All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2 v2] libamcodec: New Package
@ 2016-06-10 11:51 Dagg Stompler
  2016-06-10 11:51 ` [Buildroot] [PATCH 2/2 v2] kodi: enable optional dependency on libamcodec Dagg Stompler
  0 siblings, 1 reply; 5+ messages in thread
From: Dagg Stompler @ 2016-06-10 11:51 UTC (permalink / raw)
  To: buildroot

v1 -> v2:
 - add licesne type.
 - patch is snow in git form.
 - fix comment.
 - removed #.

Signed-off-by: Dagg Stompler <daggs@gmx.com>
---
 package/Config.in                                  |  1 +
 ...-fix-makefiles-to-allow-cross-compilation.patch | 96 ++++++++++++++++++++++
 package/libamcodec/Config.in                       | 13 +++
 package/libamcodec/libamcodec.hash                 |  2 +
 package/libamcodec/libamcodec.mk                   | 34 ++++++++
 5 files changed, 146 insertions(+)
 create mode 100644 package/libamcodec/0001-libamcodec-fix-makefiles-to-allow-cross-compilation.patch
 create mode 100644 package/libamcodec/Config.in
 create mode 100644 package/libamcodec/libamcodec.hash
 create mode 100644 package/libamcodec/libamcodec.mk

diff --git a/package/Config.in b/package/Config.in
index 6c6a562..0a56070 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1074,6 +1074,7 @@ endmenu
 
 menu "Multimedia"
 	source "package/bitstream/Config.in"
+	source "package/libamcodec/Config.in"
 	source "package/libass/Config.in"
 	source "package/libbluray/Config.in"
 	source "package/libdcadec/Config.in"
diff --git a/package/libamcodec/0001-libamcodec-fix-makefiles-to-allow-cross-compilation.patch b/package/libamcodec/0001-libamcodec-fix-makefiles-to-allow-cross-compilation.patch
new file mode 100644
index 0000000..81334df
--- /dev/null
+++ b/package/libamcodec/0001-libamcodec-fix-makefiles-to-allow-cross-compilation.patch
@@ -0,0 +1,96 @@
+From 09ff48c8f6602996f668c659094651627634a0a9 Mon Sep 17 00:00:00 2001
+From: Dagg Stompler <daggs@gmx.com>
+Date: Fri, 10 Jun 2016 14:24:46 +0300
+Subject: [PATCH] libamcodec: fix makefiles to allow cross compilation.
+
+fix makefiles so it will be possible to cross compile the package
+
+Signed-off-by: Dagg Stompler <daggs@gmx.com>
+---
+ amadec/Makefile    | 8 ++++----
+ amavutils/Makefile | 6 +++---
+ amcodec/Makefile   | 4 ++--
+ amcodec/rules.mk   | 4 ++--
+ 4 files changed, 11 insertions(+), 11 deletions(-)
+
+diff --git a/amadec/Makefile b/amadec/Makefile
+index e9b90bb..734b969 100644
+--- a/amadec/Makefile
++++ b/amadec/Makefile
+@@ -10,14 +10,14 @@ TARGET=libamadec.so
+ 
+ INSTALL_DIR=$(LIB_DIR)/aml_libs
+ 
+-LDFLAGS += -shared -lpthread -lm -lasound -lrt
++override LDFLAGS += -shared -lpthread -lm -lasound -lrt
+ 
+ TOPDIR=$(shell pwd)
+ SRC?=$(TOPDIR)
+ 
+-CFLAGS+=-O2 -fPIC -g
+-CFLAGS+=-I$(SRC) -I$(SRC)/include -I$(SRC)/../amavutils/include -I$(SRC)/../amplayer/player/include -I${HEADERS_DIR} -L${LIB_DIR}
+-CFLAGS+=-DALSA_OUT
++override CFLAGS+=-O2 -fPIC -g
++override CFLAGS+=-I$(SRC) -I$(SRC)/include -I$(SRC)/../amavutils/include -I$(SRC)/../amplayer/player/include -I${HEADERS_DIR} -L${LIB_DIR}
++override CFLAGS+=-DALSA_OUT
+ 
+ ifdef DOLBY_UDC
+     CFLAGS+=-DDOLBY_USE_ARMDEC
+diff --git a/amavutils/Makefile b/amavutils/Makefile
+index eb04bb7..17e7644 100644
+--- a/amavutils/Makefile
++++ b/amavutils/Makefile
+@@ -8,13 +8,13 @@ TARGET=libamavutils.so
+ 
+ INSTALL_DIR=${LIB_DIR}/aml_libs
+ 
+-LDFLAGS += -shared -lpthread -lm -lrt
++override LDFLAGS += -shared -lpthread -lm -lrt
+ 
+ TOPDIR=$(shell pwd)
+ SRC?=$(TOPDIR)
+ 
+-CFLAGS+=-O2 -fPIC -g
+-CFLAGS+=-I$(SRC) -I$(SRC)/include -I$(SRC)/../amcodec/include -L${LIB_DIR} -I$(HEADERS_DIR)
++override CFLAGS+=-O2 -fPIC -g
++override CFLAGS+=-I$(SRC) -I$(SRC)/include -I$(SRC)/../amcodec/include -L${LIB_DIR} -I$(HEADERS_DIR)
+ 
+ 
+ 
+diff --git a/amcodec/Makefile b/amcodec/Makefile
+index 82a9ef0..75bd441 100644
+--- a/amcodec/Makefile
++++ b/amcodec/Makefile
+@@ -27,12 +27,12 @@ TARGET?=libamcodec.so
+ 
+ DIRS=audio_ctl/ codec/
+ 
+-LDFLAGS=  -O2  -L$(LIB_DIR)  -lm -lc  -shared -Wl,--shared -Wl,-soname,$(TARGET)$(LIB_VERSION)
++override LDFLAGS+=  -O2  -L$(LIB_DIR)  -lm -lc  -shared -Wl,--shared -Wl,-soname,$(TARGET)$(LIB_VERSION)
+ 
+ #INCLUDE=$(DIRS:%/=-I$(SRC)/%/include)
+ INCLUDE=${SRCTREE}/include/ 
+ #CFLAGS=-O0  -gdwarf-2  -g
+-CFLAGS=-O2 -g  -I$(SRC)/include  -I${SRCTREE}/audio_ctl -I${SRCTREE}/codec -I${SRCTREE}/../amadec/include -fPIC
++override CFLAGS+=-O2 -g  -I$(SRC)/include  -I${SRCTREE}/audio_ctl -I${SRCTREE}/codec -I${SRCTREE}/../amadec/include -fPIC
+ 
+ 
+ 
+diff --git a/amcodec/rules.mk b/amcodec/rules.mk
+index e1a298a..2660aed 100644
+--- a/amcodec/rules.mk
++++ b/amcodec/rules.mk
+@@ -2,8 +2,8 @@
+ 
+ 
+ dir_mk=$(Q)echo "MAKE $(1)";\
+-	$(MAKE) -C ${1} -f ${SRCTREE}/depends.mk;\
+-	$(MAKE) -C ${1} -f ${SRCTREE}/dir.mk
++	$(MAKE) -C ${1} -f ${SRCTREE}/depends.mk CFLAGS="$(CFLAGS)";\
++	$(MAKE) -C ${1} -f ${SRCTREE}/dir.mk CFLAGS="$(CFLAGS)"
+ 
+ c_mk=$(Q)echo "CC  $(1)";\
+ 		$(CC) $(CFLAGS)  $(EXT_CFLAGS) -c  $(1) 
+-- 
+2.8.4
+
diff --git a/package/libamcodec/Config.in b/package/libamcodec/Config.in
new file mode 100644
index 0000000..52778ba
--- /dev/null
+++ b/package/libamcodec/Config.in
@@ -0,0 +1,13 @@
+comment "libamcodec needs a toolchain w/ threads"
+	depends on BR2_arm || BR2_aarch64
+	depends on !BR2_TOOLCHAIN_HAS_THREADS
+
+config BR2_PACKAGE_LIBAMCODEC
+	bool "libamcodec"
+	depends on BR2_arm || BR2_aarch64
+	depends on BR2_TOOLCHAIN_HAS_THREADS # alsa-lib
+	select BR2_PACKAGE_ALSA_LIB
+	help
+	    Interface library for Amlogic media codecs
+
+	    https://github.com/mdrjr/c2_aml_libs.git
diff --git a/package/libamcodec/libamcodec.hash b/package/libamcodec/libamcodec.hash
new file mode 100644
index 0000000..f199c17
--- /dev/null
+++ b/package/libamcodec/libamcodec.hash
@@ -0,0 +1,2 @@
+# Locally computed hash
+sha256 44580255c63bde1544b1376bc8d33f73ef0c634afda5065455a01b77f6e2729b  libamcodec-ed1d8b8c54b05c1a02a8ee44c59744e4cbed3d8d.tar.gz
diff --git a/package/libamcodec/libamcodec.mk b/package/libamcodec/libamcodec.mk
new file mode 100644
index 0000000..065ef28
--- /dev/null
+++ b/package/libamcodec/libamcodec.mk
@@ -0,0 +1,34 @@
+################################################################################
+#
+# libamcodec
+#
+################################################################################
+
+LIBAMCODEC_VERSION = ed1d8b8c54b05c1a02a8ee44c59744e4cbed3d8d
+LIBAMCODEC_SITE = $(call github,mdrjr,c2_aml_libs,$(LIBAMCODEC_VERSION))
+LIBAMCODEC_DEPENDENCIES = alsa-lib
+LIBAMCODEC_LICENSE = Unclear
+
+# This package uses the M_PREFIX or PREFIX variables to construct the header and
+# library paths used when compiling
+define LIBAMCODEC_BUILD_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D)/amavutils M_PREFIX="$(STAGING_DIR)/usr"
+	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D)/amadec M_PREFIX="$(STAGING_DIR)/usr"
+	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D)/amcodec PREFIX="$(STAGING_DIR)"
+endef
+
+define LIBAMCODEC_INSTALL_STAGING_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/amavutils/libamavutils.so $(STAGING_DIR)/usr/lib/libamavutils.so
+	$(INSTALL) -D -m 0555 $(@D)/amadec/libamadec.so $(STAGING_DIR)/usr/lib/libamadec.so
+	$(INSTALL) -D -m 0555 $(@D)/amcodec/libamcodec.so $(STAGING_DIR)/usr/lib/libamcodec.so
+	mkdir -p $(STAGING_DIR)/usr/include/amcodec
+	cp -rf $(@D)/amcodec/include/* $(STAGING_DIR)/usr/include/amcodec
+endef
+
+define LIBAMCODEC_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/amavutils/libamavutils.so $(TARGET_DIR)/usr/lib/libamavutils.so
+	$(INSTALL) -D -m 0555 $(@D)/amadec/libamadec.so $(TARGET_DIR)/usr/lib/libamadec.so
+	$(INSTALL) -D -m 0555 $(@D)/amcodec/libamcodec.so $(TARGET_DIR)/usr/lib/libamcodec.so
+endef
+									    
+$(eval $(generic-package))
-- 
2.8.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 2/2 v2] kodi: enable optional dependency on libamcodec
  2016-06-10 11:51 [Buildroot] [PATCH 1/2 v2] libamcodec: New Package Dagg Stompler
@ 2016-06-10 11:51 ` Dagg Stompler
  2016-06-10 16:33   ` Bernd Kuhls
  0 siblings, 1 reply; 5+ messages in thread
From: Dagg Stompler @ 2016-06-10 11:51 UTC (permalink / raw)
  To: buildroot

This is based on what LibreELEC is doing.

v1 -> v2:
 - fixed mail title and comment

Signed-off-by: Dagg Stompler <daggs@gmx.com>
---
 package/kodi/kodi.mk | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/package/kodi/kodi.mk b/package/kodi/kodi.mk
index e163c24..d0b2c22 100644
--- a/package/kodi/kodi.mk
+++ b/package/kodi/kodi.mk
@@ -56,6 +56,9 @@ endif
 ifeq ($(BR2_PACKAGE_LIBFSLVPUWRAP),y)
 KODI_DEPENDENCIES += libfslvpuwrap
 KODI_CONF_OPTS += --enable-codec=imxvpu
+else ifeq ($(BR2_PACKAGE_LIBAMCODEC),y)
+KODI_DEPENDENCIES += libamcodec
+KODI_CONF_OPTS += --enable-codec=amcodec
 endif
 
 ifeq ($(BR2_PACKAGE_LIBCAP),y)
-- 
2.8.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 2/2 v2] kodi: enable optional dependency on libamcodec
  2016-06-10 11:51 ` [Buildroot] [PATCH 2/2 v2] kodi: enable optional dependency on libamcodec Dagg Stompler
@ 2016-06-10 16:33   ` Bernd Kuhls
  2016-06-11  4:46     ` daggs
  0 siblings, 1 reply; 5+ messages in thread
From: Bernd Kuhls @ 2016-06-10 16:33 UTC (permalink / raw)
  To: buildroot

Am Fri, 10 Jun 2016 14:51:51 +0300 schrieb Dagg Stompler:

> +else ifeq ($(BR2_PACKAGE_LIBAMCODEC),y)
> +KODI_DEPENDENCIES += libamcodec
> +KODI_CONF_OPTS += --enable-codec=amcodec

Hi,

did you find out whether this option is necessary in the future?
http://article.gmane.org/gmane.comp.lib.uclibc.buildroot/150321

Regards, Bernd

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 2/2 v2] kodi: enable optional dependency on libamcodec
  2016-06-10 16:33   ` Bernd Kuhls
@ 2016-06-11  4:46     ` daggs
  2016-06-25  4:29       ` James Knight
  0 siblings, 1 reply; 5+ messages in thread
From: daggs @ 2016-06-11  4:46 UTC (permalink / raw)
  To: buildroot

Greetings,
> Am Fri, 10 Jun 2016 14:51:51 +0300 schrieb Dagg Stompler:
> 
> > +else ifeq ($(BR2_PACKAGE_LIBAMCODEC),y)
> > +KODI_DEPENDENCIES += libamcodec
> > +KODI_CONF_OPTS += --enable-codec=amcodec
> 
> Hi,
> 
> did you find out whether this option is necessary in the future?
> http://article.gmane.org/gmane.comp.lib.uclibc.buildroot/150321
> 
> Regards, Bernd
> 

not sure I follow, the change described here is regarding andorid.
unless I'm mistaken, my change only affects linux.
am I wrong?

Dagg.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 2/2 v2] kodi: enable optional dependency on libamcodec
  2016-06-11  4:46     ` daggs
@ 2016-06-25  4:29       ` James Knight
  0 siblings, 0 replies; 5+ messages in thread
From: James Knight @ 2016-06-25  4:29 UTC (permalink / raw)
  To: buildroot

Daggs, Bernd;

On Sat, Jun 11, 2016 at 12:46 AM, daggs <daggs@gmx.com> wrote:
> the change described here is regarding andorid.
> unless I'm mistaken

I believe you are correct. Examining the commit [1] shows that the
change is really Android specific (whether or not the merge's
description [2] doesn't indicate so).

[1]: https://github.com/xbmc/xbmc/pull/9688/commits/1015c480966d786eb050ce3d3701cdbf5231d1f5
[2]: https://github.com/xbmc/xbmc/pull/9688

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-06-25  4:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-10 11:51 [Buildroot] [PATCH 1/2 v2] libamcodec: New Package Dagg Stompler
2016-06-10 11:51 ` [Buildroot] [PATCH 2/2 v2] kodi: enable optional dependency on libamcodec Dagg Stompler
2016-06-10 16:33   ` Bernd Kuhls
2016-06-11  4:46     ` daggs
2016-06-25  4:29       ` James Knight

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.