All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/4 v2] odroid-scripts: New Package.
@ 2016-06-24 18:22 Dagg Stompler
  2016-06-24 18:22 ` [Buildroot] [PATCH 2/4 v3] odroid-mali: " Dagg Stompler
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Dagg Stompler @ 2016-06-24 18:22 UTC (permalink / raw)
  To: buildroot

v1 -> v2:
 - fix hash type in hash file.

Signed-off-by: Dagg Stompler <daggs@gmx.com>
---
 configs/odroidc2_defconfig                 |  1 +
 package/Config.in                          |  1 +
 package/odroid-scripts/Config.in           |  7 +++++++
 package/odroid-scripts/S50odroidc2_fb      | 20 +++++++++++++++++++
 package/odroid-scripts/odroid-scripts.hash |  2 ++
 package/odroid-scripts/odroid-scripts.mk   | 32 ++++++++++++++++++++++++++++++
 6 files changed, 63 insertions(+)
 create mode 100644 package/odroid-scripts/Config.in
 create mode 100644 package/odroid-scripts/S50odroidc2_fb
 create mode 100644 package/odroid-scripts/odroid-scripts.hash
 create mode 100644 package/odroid-scripts/odroid-scripts.mk

diff --git a/configs/odroidc2_defconfig b/configs/odroidc2_defconfig
index 1945983..74b475c 100644
--- a/configs/odroidc2_defconfig
+++ b/configs/odroidc2_defconfig
@@ -6,6 +6,7 @@ BR2_TARGET_GENERIC_HOSTNAME="odroidc2"
 BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
 BR2_ROOTFS_POST_IMAGE_SCRIPT="board/hardkernel/odroidc2/post-image.sh"
+BR2_PACKAGE_ODROID_SCRIPTS=y
 
 # Kernel
 BR2_KERNEL_HEADERS_VERSION=y
diff --git a/package/Config.in b/package/Config.in
index a2a02a8..143a304 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1679,6 +1679,7 @@ endif
 	source "package/ncdu/Config.in"
 	source "package/numactl/Config.in"
 	source "package/nut/Config.in"
+	source "package/odroid-scripts/Config.in"
 	source "package/openvmtools/Config.in"
 	source "package/polkit/Config.in"
 	source "package/powerpc-utils/Config.in"
diff --git a/package/odroid-scripts/Config.in b/package/odroid-scripts/Config.in
new file mode 100644
index 0000000..48544b6
--- /dev/null
+++ b/package/odroid-scripts/Config.in
@@ -0,0 +1,7 @@
+config BR2_PACKAGE_ODROID_SCRIPTS
+	bool "odroid-scripts"
+	depends on BR2_aarch64 || BR2_arm
+	help
+	  Install the scripts for the odroidc2 based systems.
+
+	  https://github.com/mdrjr/c2_bootini
diff --git a/package/odroid-scripts/S50odroidc2_fb b/package/odroid-scripts/S50odroidc2_fb
new file mode 100644
index 0000000..2aae59d
--- /dev/null
+++ b/package/odroid-scripts/S50odroidc2_fb
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+# Set up frame buffer
+#
+
+case "$1" in
+    start)
+        echo "Setting up display..."
+        /usr/sbin/odroidc2_init_fb.sh
+        ;;
+    stop)
+        ;;
+    restart|reload)
+        ;;
+    *)
+        echo "Usage: $0 {start|stop|restart}"
+        exit 1
+esac
+
+exit $?
diff --git a/package/odroid-scripts/odroid-scripts.hash b/package/odroid-scripts/odroid-scripts.hash
new file mode 100644
index 0000000..1b05947
--- /dev/null
+++ b/package/odroid-scripts/odroid-scripts.hash
@@ -0,0 +1,2 @@
+#  Locally computed hash
+sha256 bf34de357180126cb99885e8e131ae3ebb2562a98187da297c8ee10e56e29f65 odroid-scripts-17c88b9c48ad89a78c68392ccaa41b3cd42a622b.tar.gz
diff --git a/package/odroid-scripts/odroid-scripts.mk b/package/odroid-scripts/odroid-scripts.mk
new file mode 100644
index 0000000..993b53b
--- /dev/null
+++ b/package/odroid-scripts/odroid-scripts.mk
@@ -0,0 +1,32 @@
+################################################################################
+#
+# odroid-scripts
+#
+################################################################################
+
+ODROID_SCRIPTS_VERSION = 17c88b9c48ad89a78c68392ccaa41b3cd42a622b
+ODROID_SCRIPTS_SITE = $(call github,mdrjr,c2_bootini,$(ODROID_SCRIPTS_VERSION))
+ODROID_SCRIPTS_LICENSE = unclear
+
+ifeq ($(BR2_PACKAGE_EUDEV),y)
+	ODROID_SCRIPTS_INSTALL_UDEV_RULES = $(INSTALL) -D -m 0644 $(@D)/10-odroid.rules $(TARGET_DIR)/etc/udev/rules.d/10-odroid.rules
+else
+	ODROID_SCRIPTS_INSTALL_UDEV_RULES =
+endif
+
+define ODROID_SCRIPTS_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/c2_init.sh $(TARGET_DIR)/usr/sbin/odroidc2_init_fb.sh
+	$(ODROID_SCRIPTS_INSTALL_UDEV_RULES)
+endef
+
+define ODROID_SCRIPTS_INSTALL_INIT_SYSTEMD
+	$(INSTALL) -D -m 0644 $(@D)/amlogic.service $(TARGET_DIR)/usr/lib/systemd/system/odroidc2_fb.service
+	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
+	ln -fs ../../../../usr/lib/systemd/system/odroidc2_fb.service $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/odroidc2_fb.service
+endef
+
+define ODROID_SCRIPTS_INSTALL_INIT_SYSV
+	$(INSTALL) -D -m 0755 package/odroid-scripts/S50odroidc2_fb $(TARGET_DIR)/etc/init.d/S50odroidc2_fb
+endef
+
+$(eval $(generic-package))
-- 
2.9.0

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

* [Buildroot] [PATCH 2/4 v3] odroid-mali: New Package
  2016-06-24 18:22 [Buildroot] [PATCH 1/4 v2] odroid-scripts: New Package Dagg Stompler
@ 2016-06-24 18:22 ` Dagg Stompler
  2016-06-24 18:22 ` [Buildroot] [PATCH 3/4 v3] libamcodec: " Dagg Stompler
  2016-06-24 18:22 ` [Buildroot] [PATCH 4/4 v3] kodi: allow enablement of libamcodec as codec if selected Dagg Stompler
  2 siblings, 0 replies; 18+ messages in thread
From: Dagg Stompler @ 2016-06-24 18:22 UTC (permalink / raw)
  To: buildroot

v2 -> v3:
 - fix pkgconfig installation.

Signed-off-by: Dagg Stompler <daggs@gmx.com>
---
 package/Config.in                    |  1 +
 package/odroid-mali/Config.in        | 21 ++++++++++++++++++++
 package/odroid-mali/odroid-mali.hash |  3 +++
 package/odroid-mali/odroid-mali.mk   | 37 ++++++++++++++++++++++++++++++++++++
 4 files changed, 62 insertions(+)
 create mode 100644 package/odroid-mali/Config.in
 create mode 100644 package/odroid-mali/odroid-mali.hash
 create mode 100644 package/odroid-mali/odroid-mali.mk

diff --git a/package/Config.in b/package/Config.in
index 143a304..4b8ff60 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -421,6 +421,7 @@ endif
 	source "package/nvidia-driver/Config.in"
 	source "package/nvidia-tegra23/Config.in"
 	source "package/nvme/Config.in"
+	source "package/odroid-mali/Config.in"
 	source "package/ofono/Config.in"
 	source "package/ola/Config.in"
 	source "package/on2-8170-modules/Config.in"
diff --git a/package/odroid-mali/Config.in b/package/odroid-mali/Config.in
new file mode 100644
index 0000000..02c6ca0
--- /dev/null
+++ b/package/odroid-mali/Config.in
@@ -0,0 +1,21 @@
+config BR2_PACKAGE_ODROID_MALI
+	bool "odroid-mali"
+	select BR2_PACKAGE_HAS_LIBEGL
+	select BR2_PACKAGE_HAS_LIBGLES
+	select BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
+	select BR2_PACKAGE_FBSET
+	depends on BR2_TOOLCHAIN_USES_GLIBC
+	depends on BR2_aarch64 || BR2_arm
+	depends on BR2_PACKAGE_ODROID_SCRIPTS
+	help
+	  Install the ARM Mali drivers for odroidc2 based systems.
+
+	  https://github.com/mdrjr/c2_mali
+
+if BR2_PACKAGE_ODROID_MALI
+config BR2_PACKAGE_PROVIDES_LIBEGL
+	default "odroid-mali"
+
+config BR2_PACKAGE_PROVIDES_LIBGLES
+	default "odroid-mali"
+endif
diff --git a/package/odroid-mali/odroid-mali.hash b/package/odroid-mali/odroid-mali.hash
new file mode 100644
index 0000000..de3edc1
--- /dev/null
+++ b/package/odroid-mali/odroid-mali.hash
@@ -0,0 +1,3 @@
+# Locally computed hash
+sha256 122fe75fc105fc2f7c00b7f075deca567f6a3e56b5c128b00cf3096073b96e66  odroid-mali-4a34d59cd6120db67dc11023344e382afbaf28da.tar.gz
+sha256 29d98ed4b8694b860d9289787c416faa847b0de26d36580a53add1752b4c2e9a  odroid-mali-46fe49f37e3506c6205ad8c50980eca9bfff11e3.tar.gz
diff --git a/package/odroid-mali/odroid-mali.mk b/package/odroid-mali/odroid-mali.mk
new file mode 100644
index 0000000..ffd682c
--- /dev/null
+++ b/package/odroid-mali/odroid-mali.mk
@@ -0,0 +1,37 @@
+################################################################################
+#
+# odroid-mali
+#
+################################################################################
+
+ifeq ($(BR2_aarch64),y)
+ODROID_MALI_VERSION = 4a34d59cd6120db67dc11023344e382afbaf28da
+ODROID_MALI_LIBS_INSTALL_ARCH=mali_libs
+else
+ODROID_MALI_VERSION = 46fe49f37e3506c6205ad8c50980eca9bfff11e3
+ODROID_MALI_LIBS_INSTALL_ARCH=32bit_libs
+endif
+
+ODROID_MALI_SITE = $(call github,mdrjr,c2_mali,$(ODROID_MALI_VERSION))
+ODROID_MALI_LICENSE = hardkernel
+ODROID_MALI_LICENSE_FILES = README.md
+
+ODROID_MALI_INSTALL_STAGING = YES
+ODROID_MALI_PROVIDES = libegl libgles
+
+define ODROID_MALI_INSTALL_LIBS
+	cp -aRP $(@D)/fbdev/$(ODROID_MALI_LIBS_INSTALL_ARCH)/lib* $(1)/lib/
+endef
+
+define ODROID_MALI_INSTALL_STAGING_CMDS
+	$(call ODROID_MALI_INSTALL_LIBS,$(STAGING_DIR)/usr)
+	$(INSTALL) -d $(STAGING_DIR)/usr/lib/pkgconfig
+	$(INSTALL) -m 644 $(@D)/pkgconfig/*.pc $(STAGING_DIR)/usr/lib/pkgconfig/
+	cp -aRP $(@D)/fbdev/mali_headers/* $(STAGING_DIR)/usr/include
+endef
+
+define ODROID_MALI_INSTALL_TARGET_CMDS
+	$(call ODROID_MALI_INSTALL_LIBS,$(TARGET_DIR)/usr)
+endef
+
+$(eval $(generic-package))
-- 
2.9.0

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

* [Buildroot] [PATCH 3/4 v3] libamcodec: New Package
  2016-06-24 18:22 [Buildroot] [PATCH 1/4 v2] odroid-scripts: New Package Dagg Stompler
  2016-06-24 18:22 ` [Buildroot] [PATCH 2/4 v3] odroid-mali: " Dagg Stompler
@ 2016-06-24 18:22 ` Dagg Stompler
  2016-06-25  4:11   ` James Knight
                     ` (2 more replies)
  2016-06-24 18:22 ` [Buildroot] [PATCH 4/4 v3] kodi: allow enablement of libamcodec as codec if selected Dagg Stompler
  2 siblings, 3 replies; 18+ messages in thread
From: Dagg Stompler @ 2016-06-24 18:22 UTC (permalink / raw)
  To: buildroot

v2 -> v3:
 - fix sum256 value.
 - fix patch.

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 4b8ff60..988d1ec 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1097,6 +1097,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..743b8a6
--- /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..3f40e3d
--- /dev/null
+++ b/package/libamcodec/libamcodec.hash
@@ -0,0 +1,2 @@
+# Locally computed hash
+sha256 5a9ea25341b95c47155012dc7cc0aa08547cc81ca3f61be88bf6fcaebe1ee3c6  libamcodec-ed1d8b8c54b05c1a02a8ee44c59744e4cbed3d8d.tar.gz
diff --git a/package/libamcodec/libamcodec.mk b/package/libamcodec/libamcodec.mk
new file mode 100644
index 0000000..8da6f33
--- /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.9.0

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

* [Buildroot] [PATCH 4/4 v3] kodi: allow enablement of libamcodec as codec if selected
  2016-06-24 18:22 [Buildroot] [PATCH 1/4 v2] odroid-scripts: New Package Dagg Stompler
  2016-06-24 18:22 ` [Buildroot] [PATCH 2/4 v3] odroid-mali: " Dagg Stompler
  2016-06-24 18:22 ` [Buildroot] [PATCH 3/4 v3] libamcodec: " Dagg Stompler
@ 2016-06-24 18:22 ` Dagg Stompler
  2016-06-25 14:14   ` Bernd Kuhls
  2 siblings, 1 reply; 18+ messages in thread
From: Dagg Stompler @ 2016-06-24 18:22 UTC (permalink / raw)
  To: buildroot

ported from libreelec

v2 -> v3:
 - fix change after kodi.mk was changed.

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 90c50c3..d426d12 100644
--- a/package/kodi/kodi.mk
+++ b/package/kodi/kodi.mk
@@ -56,6 +56,9 @@ endif
 ifeq ($(BR2_PACKAGE_IMX_VPUWRAP),y)
 KODI_DEPENDENCIES += imx-vpuwrap
 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.9.0

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

* [Buildroot] [PATCH 3/4 v3] libamcodec: New Package
  2016-06-24 18:22 ` [Buildroot] [PATCH 3/4 v3] libamcodec: " Dagg Stompler
@ 2016-06-25  4:11   ` James Knight
  2016-06-25  6:37     ` daggs
  2016-06-25 12:15   ` Bernd Kuhls
  2016-06-25 13:53   ` Bernd Kuhls
  2 siblings, 1 reply; 18+ messages in thread
From: James Knight @ 2016-06-25  4:11 UTC (permalink / raw)
  To: buildroot

Dagg,

On Fri, Jun 24, 2016 at 2:22 PM, Dagg Stompler <daggs@gmx.com> wrote:
> v2 -> v3:
>  - fix sum256 value.
>  - fix patch.

While I don't believe it's required, I recommending leaving old change
version information in new patches as well. This helps reviewers who
jump in late so understand your patch changes easier. For example,
patch 613857 [2].

> +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>

Out of curiosity, have you also tried submitting these changes
upstream? I don't see any forks or pull requests on
"mdrjr/c2_aml_libs" [2] (if they even handle community patches that
way). I might help the long term maintenance of this package in
Buildroot by fixing issues in the root projects (instead of having to
update patches every version/hash bump).

> +LIBAMCODEC_SITE = $(call github,mdrjr,c2_aml_libs,$(LIBAMCODEC_VERSION))

I haven't really dug into the origin of the libamcodec package, but is
there a reason why "mdrjr/c2_aml_libs" [2] is being used over (which
may be the official) "Stane1983/amlogic-libplayer" repository?

> +LIBAMCODEC_LICENSE = Unclear

Providing "unclear" is not an acceptable license choice. You need to
find the exact license for this package before anyone would submit it
into Buildroot (although, I'm not maintainer, so I couldn't stop them
if they wanted to add it anyways :D).

[1]: https://patchwork.ozlabs.org/patch/613857/
[2]: https://github.com/mdrjr/c2_aml_libs
[3]: https://github.com/Stane1983/amlogic-libplayer

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

* [Buildroot] [PATCH 3/4 v3] libamcodec: New Package
  2016-06-25  4:11   ` James Knight
@ 2016-06-25  6:37     ` daggs
  0 siblings, 0 replies; 18+ messages in thread
From: daggs @ 2016-06-25  6:37 UTC (permalink / raw)
  To: buildroot

Greetings,
> 
> On Fri, Jun 24, 2016 at 2:22 PM, Dagg Stompler <daggs@gmx.com> wrote:
> > v2 -> v3:
> >  - fix sum256 value.
> >  - fix patch.
> 
> While I don't believe it's required, I recommending leaving old change
> version information in new patches as well. This helps reviewers who
> jump in late so understand your patch changes easier. For example,
> patch 613857 [2].
> 
> > +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>
>
will take into account.
 
> Out of curiosity, have you also tried submitting these changes
> upstream? I don't see any forks or pull requests on
> "mdrjr/c2_aml_libs" [2] (if they even handle community patches that
> way). I might help the long term maintenance of this package in
> Buildroot by fixing issues in the root projects (instead of having to
> update patches every version/hash bump).
>
I didn't tried that, I can try sending patches to the maintainer of this repo.
will ask him on the msg boards. 
> > +LIBAMCODEC_SITE = $(call github,mdrjr,c2_aml_libs,$(LIBAMCODEC_VERSION))
> 
> I haven't really dug into the origin of the libamcodec package, but is
> there a reason why "mdrjr/c2_aml_libs" [2] is being used over (which
> may be the official) "Stane1983/amlogic-libplayer" repository?
> 
I don't know what is the diff but the maintaier forked it so I assume that this version works 100% on the board.
> > +LIBAMCODEC_LICENSE = Unclear
> 
> Providing "unclear" is not an acceptable license choice. You need to
> find the exact license for this package before anyone would submit it
> into Buildroot (although, I'm not maintainer, so I couldn't stop them
> if they wanted to add it anyways :D).
> 
if you look on previous mails on this matter you will see that Thomas suggested it as the license isn't clear yet.
I've contacted the maintainer and asked for license clarification but beside ack that he got my msg and will pass it alone.
I'll try to contact him again.

> [1]: https://patchwork.ozlabs.org/patch/613857/
> [2]: https://github.com/mdrjr/c2_aml_libs
> [3]: https://github.com/Stane1983/amlogic-libplayer

Dagg.

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

* [Buildroot] [PATCH 3/4 v3] libamcodec: New Package
  2016-06-24 18:22 ` [Buildroot] [PATCH 3/4 v3] libamcodec: " Dagg Stompler
  2016-06-25  4:11   ` James Knight
@ 2016-06-25 12:15   ` Bernd Kuhls
  2016-06-25 12:54     ` Thomas Petazzoni
  2016-06-25 13:13     ` daggs
  2016-06-25 13:53   ` Bernd Kuhls
  2 siblings, 2 replies; 18+ messages in thread
From: Bernd Kuhls @ 2016-06-25 12:15 UTC (permalink / raw)
  To: buildroot

Am Fri, 24 Jun 2016 21:22:55 +0300 schrieb Dagg Stompler:

> v2 -> v3:
>  - fix sum256 value.
>  - fix patch.
> 
> Signed-off-by: Dagg Stompler <daggs@gmx.com>
> ---
>  package/Config.in                                  |  1 +
>  ...-fix-makefiles-to-allow-cross-compilation.patch | 96
>  ++++++++++++++++++++++ package/libamcodec/Config.in                    

Hi,

the patch fails to apply:

Applying 0001-libamcodec-fix-makefiles-to-allow-cross-compilation.patch 
using patch: 
patching file amadec/Makefile
patching file amavutils/Makefile
patching file amcodec/Makefile
Hunk #1 FAILED at 27 (different line endings).
1 out of 1 hunk FAILED -- saving rejects to file amcodec/Makefile.rej
patching file amcodec/rules.mk
Hunk #1 FAILED at 2 (different line endings).
1 out of 1 hunk FAILED -- saving rejects to file amcodec/rules.mk.rej
Patch failed!  Please fix 0001-libamcodec-fix-makefiles-to-allow-cross-
compilation.patch!

I applied the patch using this command:

wget http://patchwork.ozlabs.org/patch/640344/mbox/ -O - | git am

Regards, Bernd

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

* [Buildroot] [PATCH 3/4 v3] libamcodec: New Package
  2016-06-25 12:15   ` Bernd Kuhls
@ 2016-06-25 12:54     ` Thomas Petazzoni
  2016-06-25 13:13     ` daggs
  1 sibling, 0 replies; 18+ messages in thread
From: Thomas Petazzoni @ 2016-06-25 12:54 UTC (permalink / raw)
  To: buildroot

Hello,

On Sat, 25 Jun 2016 14:15:39 +0200, Bernd Kuhls wrote:

> the patch fails to apply:
> 
> Applying 0001-libamcodec-fix-makefiles-to-allow-cross-compilation.patch 
> using patch: 
> patching file amadec/Makefile
> patching file amavutils/Makefile
> patching file amcodec/Makefile
> Hunk #1 FAILED at 27 (different line endings).
> 1 out of 1 hunk FAILED -- saving rejects to file amcodec/Makefile.rej
> patching file amcodec/rules.mk
> Hunk #1 FAILED at 2 (different line endings).
> 1 out of 1 hunk FAILED -- saving rejects to file amcodec/rules.mk.rej
> Patch failed!  Please fix 0001-libamcodec-fix-makefiles-to-allow-cross-
> compilation.patch!
> 
> I applied the patch using this command:
> 
> wget http://patchwork.ozlabs.org/patch/640344/mbox/ -O - | git am

If the original code uses DOS line endings, then the patch normally
contains them, but they very often get damaged by patches sent over
e-mail, so I'm not surprised. If that's the only issue, I can fix that
up when applying the patch.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH 3/4 v3] libamcodec: New Package
  2016-06-25 12:15   ` Bernd Kuhls
  2016-06-25 12:54     ` Thomas Petazzoni
@ 2016-06-25 13:13     ` daggs
  1 sibling, 0 replies; 18+ messages in thread
From: daggs @ 2016-06-25 13:13 UTC (permalink / raw)
  To: buildroot

Greetings,
> Am Fri, 24 Jun 2016 21:22:55 +0300 schrieb Dagg Stompler:
> 
> > v2 -> v3:
> >  - fix sum256 value.
> >  - fix patch.
> > 
> > Signed-off-by: Dagg Stompler <daggs@gmx.com>
> > ---
> >  package/Config.in                                  |  1 +
> >  ...-fix-makefiles-to-allow-cross-compilation.patch | 96
> >  ++++++++++++++++++++++ package/libamcodec/Config.in                    
> 
> Hi,
> 
> the patch fails to apply:
> 
> Applying 0001-libamcodec-fix-makefiles-to-allow-cross-compilation.patch 
> using patch: 
> patching file amadec/Makefile
> patching file amavutils/Makefile
> patching file amcodec/Makefile
> Hunk #1 FAILED at 27 (different line endings).
> 1 out of 1 hunk FAILED -- saving rejects to file amcodec/Makefile.rej
> patching file amcodec/rules.mk
> Hunk #1 FAILED at 2 (different line endings).
> 1 out of 1 hunk FAILED -- saving rejects to file amcodec/rules.mk.rej
> Patch failed!  Please fix 0001-libamcodec-fix-makefiles-to-allow-cross-
> compilation.patch!
> 
> I applied the patch using this command:
> 
> wget http://patchwork.ozlabs.org/patch/640344/mbox/ -O - | git am
> 
> Regards, Bernd
> 
that is exactly why I've fixed the patch, for the same reasons. I'm pretty sure I've tested it from scratch and it worked. maybe something went bad it the email of the patch.... 
as Thomas mentioned, the file is written in dos mode, thus it has ^M at the end, I've already pinged the maintainer on submitting patches to the repo.
waiting for the answer.

on the bright side, is seems that the license of this pkg is going to be dual gpl/bsd, no official word yet.

Dagg.

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

* [Buildroot] [PATCH 3/4 v3] libamcodec: New Package
  2016-06-24 18:22 ` [Buildroot] [PATCH 3/4 v3] libamcodec: " Dagg Stompler
  2016-06-25  4:11   ` James Knight
  2016-06-25 12:15   ` Bernd Kuhls
@ 2016-06-25 13:53   ` Bernd Kuhls
  2 siblings, 0 replies; 18+ messages in thread
From: Bernd Kuhls @ 2016-06-25 13:53 UTC (permalink / raw)
  To: buildroot

Am Fri, 24 Jun 2016 21:22:55 +0300 schrieb Dagg Stompler:

> +define LIBAMCODEC_INSTALL_STAGING_CMDS

Hi,

you define LIBAMCODEC_INSTALL_STAGING_CMDS but forgot to add

LIBAMCODEC_INSTALL_STAGING = YES

leading to

checking for amcodec/codec_error.h... no
configure: error: Could not find some required headers. Please see the README for your platform.

during Kodi configure.
After adding the missing line Kodi configure passes.

Regards, Bernd

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

* [Buildroot] [PATCH 4/4 v3] kodi: allow enablement of libamcodec as codec if selected
  2016-06-24 18:22 ` [Buildroot] [PATCH 4/4 v3] kodi: allow enablement of libamcodec as codec if selected Dagg Stompler
@ 2016-06-25 14:14   ` Bernd Kuhls
  2016-07-01 11:04     ` daggs
  0 siblings, 1 reply; 18+ messages in thread
From: Bernd Kuhls @ 2016-06-25 14:14 UTC (permalink / raw)
  To: buildroot

Am Fri, 24 Jun 2016 21:22:56 +0300 schrieb Dagg Stompler:

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

Hi,

using this defconfig

BR2_arm=y
BR2_cortex_a15=y
BR2_TOOLCHAIN_BUILDROOT_WCHAR=y
BR2_TOOLCHAIN_BUILDROOT_CXX=y
BR2_PACKAGE_KODI=y
BR2_PACKAGE_MESA3D=y
BR2_PACKAGE_MESA3D_DRI_DRIVER_SWRAST=y
BR2_PACKAGE_MESA3D_OPENGL_EGL=y
BR2_PACKAGE_MESA3D_OPENGL_ES=y
BR2_PACKAGE_XORG7=y
BR2_PACKAGE_LIBAMCODEC=y

$ grep -i unsafe .config
BR2_COMPILER_PARANOID_UNSAFE_PATH=y

compiling Kodi fails:

CPP     xbmc/cores/dvdplayer/DVDCodecs/Video/AMLCodec.o
arm-buildroot-linux-uclibcgnueabihf-g++: ERROR: unsafe header/library path used in cross-compilation: '/usr/include/amcodec'

due to not compile-safe code used here:
https://github.com/xbmc/xbmc/blob/Jarvis/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in#L29

Regards, Bernd

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

* [Buildroot] [PATCH 4/4 v3] kodi: allow enablement of libamcodec as codec if selected
  2016-06-25 14:14   ` Bernd Kuhls
@ 2016-07-01 11:04     ` daggs
  2016-07-02 17:58       ` daggs
  0 siblings, 1 reply; 18+ messages in thread
From: daggs @ 2016-07-01 11:04 UTC (permalink / raw)
  To: buildroot

Greetings,
> 
> > +else ifeq ($(BR2_PACKAGE_LIBAMCODEC),y)
> > +KODI_DEPENDENCIES += libamcodec
> > +KODI_CONF_OPTS += --enable-codec=amcodec
> 
> Hi,
> 
> using this defconfig
> 
> BR2_arm=y
> BR2_cortex_a15=y
> BR2_TOOLCHAIN_BUILDROOT_WCHAR=y
> BR2_TOOLCHAIN_BUILDROOT_CXX=y
> BR2_PACKAGE_KODI=y
> BR2_PACKAGE_MESA3D=y
> BR2_PACKAGE_MESA3D_DRI_DRIVER_SWRAST=y
> BR2_PACKAGE_MESA3D_OPENGL_EGL=y
> BR2_PACKAGE_MESA3D_OPENGL_ES=y
> BR2_PACKAGE_XORG7=y
> BR2_PACKAGE_LIBAMCODEC=y
> 
> $ grep -i unsafe .config
> BR2_COMPILER_PARANOID_UNSAFE_PATH=y
> 
> compiling Kodi fails:
> 
> CPP     xbmc/cores/dvdplayer/DVDCodecs/Video/AMLCodec.o
> arm-buildroot-linux-uclibcgnueabihf-g++: ERROR: unsafe header/library path used in cross-compilation: '/usr/include/amcodec'
> 
> due to not compile-safe code used here:
> https://github.com/xbmc/xbmc/blob/Jarvis/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in#L29
> 
> Regards, Bernd
> 
will take a look on this, thanks.

Dagg.

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

* [Buildroot] [PATCH 4/4 v3] kodi: allow enablement of libamcodec as codec if selected
  2016-07-01 11:04     ` daggs
@ 2016-07-02 17:58       ` daggs
  2016-07-02 20:15         ` Arnout Vandecappelle
  2016-08-27 20:30         ` Thomas Petazzoni
  0 siblings, 2 replies; 18+ messages in thread
From: daggs @ 2016-07-02 17:58 UTC (permalink / raw)
  To: buildroot

Greetings Bernd,
>
> Greetings,
> > 
> > > +else ifeq ($(BR2_PACKAGE_LIBAMCODEC),y)
> > > +KODI_DEPENDENCIES += libamcodec
> > > +KODI_CONF_OPTS += --enable-codec=amcodec
> > 
> > Hi,
> > 
> > using this defconfig
> > 
> > BR2_arm=y
> > BR2_cortex_a15=y
> > BR2_TOOLCHAIN_BUILDROOT_WCHAR=y
> > BR2_TOOLCHAIN_BUILDROOT_CXX=y
> > BR2_PACKAGE_KODI=y
> > BR2_PACKAGE_MESA3D=y
> > BR2_PACKAGE_MESA3D_DRI_DRIVER_SWRAST=y
> > BR2_PACKAGE_MESA3D_OPENGL_EGL=y
> > BR2_PACKAGE_MESA3D_OPENGL_ES=y
> > BR2_PACKAGE_XORG7=y
> > BR2_PACKAGE_LIBAMCODEC=y
> > 
> > $ grep -i unsafe .config
> > BR2_COMPILER_PARANOID_UNSAFE_PATH=y
> > 
> > compiling Kodi fails:
> > 
> > CPP     xbmc/cores/dvdplayer/DVDCodecs/Video/AMLCodec.o
> > arm-buildroot-linux-uclibcgnueabihf-g++: ERROR: unsafe header/library path used in cross-compilation: '/usr/include/amcodec'
> > 
> > due to not compile-safe code used here:
> > https://github.com/xbmc/xbmc/blob/Jarvis/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in#L29
> > 
> > Regards, Bernd
> > 
> will take a look on this, thanks.
> 
> Dagg.

I've looked into this issue, the root of the issue can be found at output/build/kodi-16.1-Jarvis/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in
where we see the following:
ifeq (@USE_LIBAMCODEC@,1)
SRCS += AMLCodec.cpp
SRCS += DVDVideoCodecAmlogic.cpp
INCLUDES += -I$(prefix)/include/amcodec
INCLUDES += -I$(prefix)/include/amplayer
endif

as prefix is set to /usr (see output/build/kodi-16.1-Jarvis/config.log), I'm not sure fixing prefix is the answer.
in general, replacing the include lines with the follows:
INCLUDES += -I$(shell $(CC) --print-sysroot)/$(prefix)/include/amcodec
INCLUDES += -I$(shell $(CC) --print-sysroot)/$(prefix)/include/amplayer

but I'm not this is the right way to fix this, thoughts?

Dagg.

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

* [Buildroot] [PATCH 4/4 v3] kodi: allow enablement of libamcodec as codec if selected
  2016-07-02 17:58       ` daggs
@ 2016-07-02 20:15         ` Arnout Vandecappelle
  2016-07-03  5:40           ` daggs
  2016-08-27 20:30         ` Thomas Petazzoni
  1 sibling, 1 reply; 18+ messages in thread
From: Arnout Vandecappelle @ 2016-07-02 20:15 UTC (permalink / raw)
  To: buildroot

On 02-07-16 19:58, daggs wrote:
> Greetings Bernd,
>>
>> Greetings,
>>>
>>>> +else ifeq ($(BR2_PACKAGE_LIBAMCODEC),y)
>>>> +KODI_DEPENDENCIES += libamcodec
>>>> +KODI_CONF_OPTS += --enable-codec=amcodec
>>>
>>> Hi,
>>>
>>> using this defconfig
>>>
>>> BR2_arm=y
>>> BR2_cortex_a15=y
>>> BR2_TOOLCHAIN_BUILDROOT_WCHAR=y
>>> BR2_TOOLCHAIN_BUILDROOT_CXX=y
>>> BR2_PACKAGE_KODI=y
>>> BR2_PACKAGE_MESA3D=y
>>> BR2_PACKAGE_MESA3D_DRI_DRIVER_SWRAST=y
>>> BR2_PACKAGE_MESA3D_OPENGL_EGL=y
>>> BR2_PACKAGE_MESA3D_OPENGL_ES=y
>>> BR2_PACKAGE_XORG7=y
>>> BR2_PACKAGE_LIBAMCODEC=y
>>>
>>> $ grep -i unsafe .config
>>> BR2_COMPILER_PARANOID_UNSAFE_PATH=y
>>>
>>> compiling Kodi fails:
>>>
>>> CPP     xbmc/cores/dvdplayer/DVDCodecs/Video/AMLCodec.o
>>> arm-buildroot-linux-uclibcgnueabihf-g++: ERROR: unsafe header/library path used in cross-compilation: '/usr/include/amcodec'
>>>
>>> due to not compile-safe code used here:
>>> https://github.com/xbmc/xbmc/blob/Jarvis/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in#L29
>>>
>>> Regards, Bernd
>>>
>> will take a look on this, thanks.
>>
>> Dagg.
> 
> I've looked into this issue, the root of the issue can be found at output/build/kodi-16.1-Jarvis/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in
> where we see the following:
> ifeq (@USE_LIBAMCODEC@,1)
> SRCS += AMLCodec.cpp
> SRCS += DVDVideoCodecAmlogic.cpp
> INCLUDES += -I$(prefix)/include/amcodec
> INCLUDES += -I$(prefix)/include/amplayer

 That is just wrong, the cpp file does #include <amcodec/codec.h> so there is no
need for this additional -I...

 So IMHO the fix is to remove those INCLUDES lines.

 Regards,
 Arnout

> endif
> 
> as prefix is set to /usr (see output/build/kodi-16.1-Jarvis/config.log), I'm not sure fixing prefix is the answer.
> in general, replacing the include lines with the follows:
> INCLUDES += -I$(shell $(CC) --print-sysroot)/$(prefix)/include/amcodec
> INCLUDES += -I$(shell $(CC) --print-sysroot)/$(prefix)/include/amplayer
> 
> but I'm not this is the right way to fix this, thoughts?
> 
> Dagg.
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
> 


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

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

* [Buildroot] [PATCH 4/4 v3] kodi: allow enablement of libamcodec as codec if selected
  2016-07-02 20:15         ` Arnout Vandecappelle
@ 2016-07-03  5:40           ` daggs
  2016-07-03  8:33             ` Arnout Vandecappelle
  0 siblings, 1 reply; 18+ messages in thread
From: daggs @ 2016-07-03  5:40 UTC (permalink / raw)
  To: buildroot

Greetings,

> On 02-07-16 19:58, daggs wrote:
> > Greetings Bernd,
> >>
> >> Greetings,
> >>>
> >>>> +else ifeq ($(BR2_PACKAGE_LIBAMCODEC),y)
> >>>> +KODI_DEPENDENCIES += libamcodec
> >>>> +KODI_CONF_OPTS += --enable-codec=amcodec
> >>>
> >>> Hi,
> >>>
> >>> using this defconfig
> >>>
> >>> BR2_arm=y
> >>> BR2_cortex_a15=y
> >>> BR2_TOOLCHAIN_BUILDROOT_WCHAR=y
> >>> BR2_TOOLCHAIN_BUILDROOT_CXX=y
> >>> BR2_PACKAGE_KODI=y
> >>> BR2_PACKAGE_MESA3D=y
> >>> BR2_PACKAGE_MESA3D_DRI_DRIVER_SWRAST=y
> >>> BR2_PACKAGE_MESA3D_OPENGL_EGL=y
> >>> BR2_PACKAGE_MESA3D_OPENGL_ES=y
> >>> BR2_PACKAGE_XORG7=y
> >>> BR2_PACKAGE_LIBAMCODEC=y
> >>>
> >>> $ grep -i unsafe .config
> >>> BR2_COMPILER_PARANOID_UNSAFE_PATH=y
> >>>
> >>> compiling Kodi fails:
> >>>
> >>> CPP     xbmc/cores/dvdplayer/DVDCodecs/Video/AMLCodec.o
> >>> arm-buildroot-linux-uclibcgnueabihf-g++: ERROR: unsafe header/library path used in cross-compilation: '/usr/include/amcodec'
> >>>
> >>> due to not compile-safe code used here:
> >>> https://github.com/xbmc/xbmc/blob/Jarvis/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in#L29
> >>>
> >>> Regards, Bernd
> >>>
> >> will take a look on this, thanks.
> >>
> >> Dagg.
> > 
> > I've looked into this issue, the root of the issue can be found at output/build/kodi-16.1-Jarvis/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in
> > where we see the following:
> > ifeq (@USE_LIBAMCODEC@,1)
> > SRCS += AMLCodec.cpp
> > SRCS += DVDVideoCodecAmlogic.cpp
> > INCLUDES += -I$(prefix)/include/amcodec
> > INCLUDES += -I$(prefix)/include/amplayer
> 
>  That is just wrong, the cpp file does #include <amcodec/codec.h> so there is no
> need for this additional -I...
> 
>  So IMHO the fix is to remove those INCLUDES lines.
> 
>  Regards,
>  Arnout

that was one of the first things I've tried, the problem is that that one of the headers under include/amcodec includes another header from the same folder in this format: #include <abc.h>
I can change it to either #include "abc.h" is this preferable? also this will require a change in libamcodec it self, a change that I'm not sure that can be accepted by the maintainer.

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

* [Buildroot] [PATCH 4/4 v3] kodi: allow enablement of libamcodec as codec if selected
  2016-07-03  5:40           ` daggs
@ 2016-07-03  8:33             ` Arnout Vandecappelle
  2016-07-06  5:02               ` daggs
  0 siblings, 1 reply; 18+ messages in thread
From: Arnout Vandecappelle @ 2016-07-03  8:33 UTC (permalink / raw)
  To: buildroot

On 03-07-16 07:40, daggs wrote:
> Greetings,
> 
>> On 02-07-16 19:58, daggs wrote:
[snip]
>>> I've looked into this issue, the root of the issue can be found at output/build/kodi-16.1-Jarvis/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in
>>> where we see the following:
>>> ifeq (@USE_LIBAMCODEC@,1)
>>> SRCS += AMLCodec.cpp
>>> SRCS += DVDVideoCodecAmlogic.cpp
>>> INCLUDES += -I$(prefix)/include/amcodec
>>> INCLUDES += -I$(prefix)/include/amplayer
>>
>>  That is just wrong, the cpp file does #include <amcodec/codec.h> so there is no
>> need for this additional -I...
>>
>>  So IMHO the fix is to remove those INCLUDES lines.
>>
>>  Regards,
>>  Arnout
> 
> that was one of the first things I've tried, the problem is that that one of the headers under include/amcodec includes another header from the same folder in this format: #include <abc.h>
> I can change it to either #include "abc.h" is this preferable? also this will require a change in libamcodec it self, a change that I'm not sure that can be accepted by the maintainer.

 I think it's better to patch libamcodec itself. I you don't patch it, it means
any other user of libamcodec will be facing the same problem. Also using "" is
the proper thing to do, so upstream might accept it. Insofar as

 An alternative is to not install libamcodec in the amcodec directory, since the
package's Makefile doesn't do that anyway, it installs directly in /usr/include.
Ugly, but if that is what upstream does, it makes sense to stick to it. But that
would mean that kodi has to be patched to _remove_ the amcodec part from the
#include directives.

 Regards,
 Arnout


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

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

* [Buildroot] [PATCH 4/4 v3] kodi: allow enablement of libamcodec as codec if selected
  2016-07-03  8:33             ` Arnout Vandecappelle
@ 2016-07-06  5:02               ` daggs
  0 siblings, 0 replies; 18+ messages in thread
From: daggs @ 2016-07-06  5:02 UTC (permalink / raw)
  To: buildroot

Greetings,
> > Greetings,
> > 
> >> On 02-07-16 19:58, daggs wrote:
> [snip]
> >>> I've looked into this issue, the root of the issue can be found at output/build/kodi-16.1-Jarvis/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in
> >>> where we see the following:
> >>> ifeq (@USE_LIBAMCODEC@,1)
> >>> SRCS += AMLCodec.cpp
> >>> SRCS += DVDVideoCodecAmlogic.cpp
> >>> INCLUDES += -I$(prefix)/include/amcodec
> >>> INCLUDES += -I$(prefix)/include/amplayer
> >>
> >>  That is just wrong, the cpp file does #include <amcodec/codec.h> so there is no
> >> need for this additional -I...
> >>
> >>  So IMHO the fix is to remove those INCLUDES lines.
> >>
> >>  Regards,
> >>  Arnout
> > 
> > that was one of the first things I've tried, the problem is that that one of the headers under include/amcodec includes another header from the same folder in this format: #include <abc.h>
> > I can change it to either #include "abc.h" is this preferable? also this will require a change in libamcodec it self, a change that I'm not sure that can be accepted by the maintainer.
> 
>  I think it's better to patch libamcodec itself. I you don't patch it, it means
> any other user of libamcodec will be facing the same problem. Also using "" is
> the proper thing to do, so upstream might accept it. Insofar as
> 
>  An alternative is to not install libamcodec in the amcodec directory, since the
> package's Makefile doesn't do that anyway, it installs directly in /usr/include.
> Ugly, but if that is what upstream does, it makes sense to stick to it. But that
> would mean that kodi has to be patched to _remove_ the amcodec part from the
> #include directives.
> 
>  Regards,
>  Arnout

ok, so I've fixed the includes in libamcodec and removed the include part from kodi, it still failes on another file but with the same issue.
this got me thinking so I've extracted the full compile commnad of the relevant file, here is it:
/home/dagg/workspace/buildroots/buildroot-master/output/host/usr/bin/arm-buildroot-linux-uclibcgnueabihf-g++ -MF AMLCodec.d -MD -c -O2 -g -D_DEBUG -Wall -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -I/home/dagg/workspace/buildroots/buildroot-master/output/host/usr/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/include -I/home/dagg/workspace/buildroots/buildroot-master/output/host/usr/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/include/libdrm -L/home/dagg/workspace/buildroots/buildroot-master/output/host/usr/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/lib -lEGL -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -std=gnu++11 -mno-apcs-stack-check -mfpu=neon -mvectorize-with-neon-quad -DTARGET_POSIX -DTARGET_LINUX -D_LINUX -D_FILE_DEFINED -D__STDC_CONSTANT_MACROS '-DBIN_INSTALL_PATH="/usr/lib/kodi"' '-DINSTALL_PATH="/usr/share/kodi"' '-DGIT_REV="Unknown"' -DNPT_CONFIG_ENABLE_LOGGING '-DPLT_HTTP_DEFAULT_USER_AGENT="UPnP/1.0 DLNADOC/1.50 Kodi"' '-DPLT_HTTP_DEFAULT_SERVER="UPnP/1.0 DLNADOC/1.50 Kodi"' -DHAVE_CONFIG_H -I/home/dagg/workspace/buildroots/buildroot-master/output/build/kodi-16.1-Jarvis/xbmc/cores/dvdplayer -I/home/dagg/workspace/buildroots/buildroot-master/output/build/kodi-16.1-Jarvis -I/home/dagg/workspace/buildroots/buildroot-master/output/build/kodi-16.1-Jarvis/lib -I/home/dagg/workspace/buildroots/buildroot-master/output/build/kodi-16.1-Jarvis/xbmc -I/home/dagg/workspace/buildroots/buildroot-master/output/build/kodi-16.1-Jarvis/xbmc/addons/include -I/home/dagg/workspace/buildroots/buildroot-master/output/build/kodi-16.1-Jarvis/addons/library.kodi.guilib -I/home/dagg/workspace/buildroots/buildroot-master/output/build/kodi-16.1-Jarvis/addons/library.xbmc.addon -I/home/dagg/workspace/buildroots/buildroot-master/output/build/kodi-16.1-Jarvis/addons/library.kodi.adsp -I/home/dagg/workspace/buildroots/buildroot-master/output/build/kodi-16.1-Jarvis/addons/library.kodi.audioengine -I/home/dagg/workspace/buildroots/buildroot-master/output/build/kodi-16.1-Jarvis/addons/library.xbmc.pvr -I/home/dagg/workspace/buildroots/buildroot-master/output/build/kodi-16.1-Jarvis/addons/library.xbmc.codec -I/home/dagg/workspace/buildroots/buildroot-master/output/host/usr/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/include -I/home/dagg/workspace/buildroots/buildroot-master/output/host/usr/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/include/freetype2 -I/home/dagg/workspace/buildroots/buildroot-master/output/host/usr/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/include/fribidi -I/home/dagg/workspace/buildroots/buildroot-master/output/host/usr/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/include/libpng16 -I/home/dagg/workspace/buildroots/buildroot-master/output/host/usr/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/include/libxml2 -I/home/dagg/workspace/buildroots/buildroot-master/output/host/usr/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/include/taglib -I/home/dagg/workspace/buildroots/buildroot-master/output/host/usr/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/include/yajl -I/home/dagg/workspace/buildroots/buildroot-master/output/build/kodi-16.1-Jarvis/xbmc/linux -I/home/dagg/workspace/buildroots/buildroot-master/output/build/kodi-16.1-Jarvis/xbmc/cores/dvdplayer AMLCodec.cpp -o AMLCodec.o

looking at the line above reveals something intresting, when enabling the enable-codec=amcodec switch, as amcodec is a lib, someone might expect to find a -i$(SYSROOT)/usr/include/amcodec in the command. there isn't one.

as I agree the is a bug in the amcodec lib when it comes to the includes, there is a bug in kodi too, probably because laziness of the devs.
I couldn't find any place in the code that checks if libamcodec is installed as it is a prerequisits. it is done for taglib or fribidi for example. but not for libamcodec.

imho that is wrong, supporting cross compilation on most of the pkgs and ignoring another is not the way to do that.
I know my suggestion before was ugly (using --print-sysroot), but as I see it, it is the only simple way to do so.

Dagg.

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

* [Buildroot] [PATCH 4/4 v3] kodi: allow enablement of libamcodec as codec if selected
  2016-07-02 17:58       ` daggs
  2016-07-02 20:15         ` Arnout Vandecappelle
@ 2016-08-27 20:30         ` Thomas Petazzoni
  1 sibling, 0 replies; 18+ messages in thread
From: Thomas Petazzoni @ 2016-08-27 20:30 UTC (permalink / raw)
  To: buildroot

Hello,

On Sat, 2 Jul 2016 19:58:21 +0200, daggs wrote:

> as prefix is set to /usr (see output/build/kodi-16.1-Jarvis/config.log), I'm not sure fixing prefix is the answer.
> in general, replacing the include lines with the follows:
> INCLUDES += -I$(shell $(CC) --print-sysroot)/$(prefix)/include/amcodec
> INCLUDES += -I$(shell $(CC) --print-sysroot)/$(prefix)/include/amplayer

You can also do:

	-I=$(prefix)/include/amcodec

'=' is automatically replaced by gcc by the sysroot path. However, as
it was discussed, there should be a choice between:

 - amcodec headers are meant to be installed in /usr/include/amcodec,
   in which case Kodi should #include <amcodec/foobar.h>, and then the
   amcodec headers also use #include <amcodec/barfoo.h> internally.

 - amcodec headers are meant to be installed in /usr/include/
   directory, in which case Kodi should #include <foobar.h>, and then
   the amcodec headers can do #include <barfoo.h>

The drawback with the second option is obviously the potential for
conflicting file names in /usr/include.

Since the patch doesn't work as-is, I've marked it as "Changes
Requested" in patchwork. Please come up with a better solution,
possibly by talking with the libamcodec maintainer.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

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

end of thread, other threads:[~2016-08-27 20:30 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-24 18:22 [Buildroot] [PATCH 1/4 v2] odroid-scripts: New Package Dagg Stompler
2016-06-24 18:22 ` [Buildroot] [PATCH 2/4 v3] odroid-mali: " Dagg Stompler
2016-06-24 18:22 ` [Buildroot] [PATCH 3/4 v3] libamcodec: " Dagg Stompler
2016-06-25  4:11   ` James Knight
2016-06-25  6:37     ` daggs
2016-06-25 12:15   ` Bernd Kuhls
2016-06-25 12:54     ` Thomas Petazzoni
2016-06-25 13:13     ` daggs
2016-06-25 13:53   ` Bernd Kuhls
2016-06-24 18:22 ` [Buildroot] [PATCH 4/4 v3] kodi: allow enablement of libamcodec as codec if selected Dagg Stompler
2016-06-25 14:14   ` Bernd Kuhls
2016-07-01 11:04     ` daggs
2016-07-02 17:58       ` daggs
2016-07-02 20:15         ` Arnout Vandecappelle
2016-07-03  5:40           ` daggs
2016-07-03  8:33             ` Arnout Vandecappelle
2016-07-06  5:02               ` daggs
2016-08-27 20:30         ` Thomas Petazzoni

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.