Skip to contentSkip to conversation

odroid-scripts: New Package.

PATCH Superseded Dagg Stompler 5 participants 18 messages Jun 24, 2016 – Aug 27, 2016

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/4 odroid-scripts: New Package.

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

---
 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
configs/odroidc2_defconfig +1 -0
index 1945983..74b475c 100644
@@ -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
package/Config.in +1 -0
index a2a02a8..143a304 100644
@@ -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"
package/odroid-scripts/Config.in new file +7 -0
new file mode 100644
index 0000000..48544b6
@@ -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
package/odroid-scripts/S50odroidc2_fb new file +20 -0
new file mode 100644
index 0000000..2aae59d
@@ -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 $?
package/odroid-scripts/odroid-scripts.hash new file +2 -0
new file mode 100644
index 0000000..1b05947
@@ -0,0 +1,2 @@
+#  Locally computed hash
+sha256 bf34de357180126cb99885e8e131ae3ebb2562a98187da297c8ee10e56e29f65 odroid-scripts-17c88b9c48ad89a78c68392ccaa41b3cd42a622b.tar.gz
package/odroid-scripts/odroid-scripts.mk new file +32 -0
new file mode 100644
index 0000000..993b53b
@@ -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))
Signature · 1 line
2.9.0
#1 lore raw

PATCH v3 2/4 odroid-mali: New Package

v2 -> v3:
- fix pkgconfig installation.

---
 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
package/Config.in +1 -0
index 143a304..4b8ff60 100644
@@ -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"
package/odroid-mali/Config.in new file +21 -0
new file mode 100644
index 0000000..02c6ca0
@@ -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
package/odroid-mali/odroid-mali.hash new file +3 -0
new file mode 100644
index 0000000..de3edc1
@@ -0,0 +1,3 @@
+# Locally computed hash
+sha256 122fe75fc105fc2f7c00b7f075deca567f6a3e56b5c128b00cf3096073b96e66  odroid-mali-4a34d59cd6120db67dc11023344e382afbaf28da.tar.gz
+sha256 29d98ed4b8694b860d9289787c416faa847b0de26d36580a53add1752b4c2e9a  odroid-mali-46fe49f37e3506c6205ad8c50980eca9bfff11e3.tar.gz
package/odroid-mali/odroid-mali.mk new file +37 -0
new file mode 100644
index 0000000..ffd682c
@@ -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))
Signature · 1 line
2.9.0
#2 lore raw

PATCH v3 3/4 libamcodec: New Package

In reply to Dagg Stompler

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

---
 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
package/Config.in +1 -0
index 4b8ff60..988d1ec 100644
@@ -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"
package/libamcodec/0001-libamcodec-fix-makefiles-to-allow-cross-compilation.patch new file +96 -0

96 lines not on this page · raw message

package/libamcodec/Config.in new file +13 -0
new file mode 100644
index 0000000..52778ba
@@ -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
package/libamcodec/libamcodec.hash new file +2 -0
new file mode 100644
index 0000000..3f40e3d
@@ -0,0 +1,2 @@
+# Locally computed hash
+sha256 5a9ea25341b95c47155012dc7cc0aa08547cc81ca3f61be88bf6fcaebe1ee3c6  libamcodec-ed1d8b8c54b05c1a02a8ee44c59744e4cbed3d8d.tar.gz
package/libamcodec/libamcodec.mk new file +34 -0
new file mode 100644
index 0000000..8da6f33
@@ -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))
Signature · 1 line
2.9.0
#3 lore raw

PATCH v3 3/4 libamcodec: New Package

Dagg,

Quoted 3 lines · Dagg Stompler

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].

package/libamcodec/0001-libamcodec-fix-makefiles-to-allow-cross-compilation.patch line 8

Quoted 5 lines
package/libamcodec/0001-libamcodec-fix-makefiles-to-allow-cross-compilation.patch new file +5 -0
+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 <[email protected]>

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).

Quoted 1 line

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

Quoted 1 line

+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

author
#4 lore raw

PATCH v3 3/4 libamcodec: New Package

Greetings,

Quoted 11 lines · Dagg Stompler
Quoted 3 lines

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].

Quoted 6 lines

package/libamcodec/0001-libamcodec-fix-makefiles-to-allow-cross-compilation.patch line 8

Quoted 5 lines
package/libamcodec/0001-libamcodec-fix-makefiles-to-allow-cross-compilation.patch new file +5 -0
+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 <[email protected]>

will take into account.

Quoted 7 lines

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.

Quoted 6 lines
Quoted 1 line

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

Quoted 7 lines
Quoted 1 line

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

Quoted 3 lines

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

Dagg.

#5 lore raw

PATCH v3 3/4 libamcodec: New Package

In reply to Dagg Stompler

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

Quoted 9 lines

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

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

#6 lore raw

PATCH v3 3/4 libamcodec: New Package

Hello,

Quoted 15 lines · Bernd Kuhls

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!

Quoted 3 lines

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

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
author
#7 lore raw

PATCH v3 3/4 libamcodec: New Package

In reply to Bernd Kuhls

Greetings,

Quoted 29 lines

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

Quoted 9 lines

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

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

Quoted 6 lines

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.

#8 lore raw

PATCH v3 3/4 libamcodec: New Package

In reply to Dagg Stompler

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

Quoted 1 line

+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

#9 lore raw

PATCH v3 4/4 kodi: allow enablement of libamcodec as codec if selected

In reply to Dagg Stompler

ported from libreelec

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

---
 package/kodi/kodi.mk | 3 +++
 1 file changed, 3 insertions(+)
package/kodi/kodi.mk +3 -0
index 90c50c3..d426d12 100644
@@ -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)
Signature · 1 line
2.9.0
#10 lore raw

PATCH v3 4/4 kodi: allow enablement of libamcodec as codec if selected

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

package/kodi/kodi.mk endif · line 61

Quoted 3 lines
package/kodi/kodi.mk +3 -0
+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

author
#11 lore raw

PATCH v3 4/4 kodi: allow enablement of libamcodec as codec if selected

Greetings,

Quoted 26 lines

package/kodi/kodi.mk endif · line 61

Quoted 4 lines
package/kodi/kodi.mk +3 -0
+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:

Quoted 8 lines

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.

author
#12 lore raw

PATCH v3 4/4 kodi: allow enablement of libamcodec as codec if selected

Greetings Bernd,

Quoted 31 lines

Greetings,

Quoted 29 lines

package/kodi/kodi.mk endif · line 61

Quoted 4 lines
package/kodi/kodi.mk +3 -0
+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'

Quoted 8 lines
Quoted 5 lines

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.

#13 lore raw

PATCH v3 4/4 kodi: allow enablement of libamcodec as codec if selected

Quoted 41 lines · daggs

Greetings Bernd,

Quoted 31 lines

Greetings,

Quoted 29 lines

package/kodi/kodi.mk endif · line 61

Quoted 4 lines
package/kodi/kodi.mk +3 -0
+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'

Quoted 8 lines
Quoted 5 lines

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.

Quoted 7 lines

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

Quoted 15 lines

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

Signature · 6 lines
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
author
#14 lore raw

PATCH v3 4/4 kodi: allow enablement of libamcodec as codec if selected

Greetings,

Quoted 50 lines · daggs
Quoted 41 lines

Greetings Bernd,

Quoted 31 lines

Greetings,

Quoted 29 lines

package/kodi/kodi.mk endif · line 61

Quoted 4 lines
package/kodi/kodi.mk +3 -0
+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'

Quoted 8 lines
Quoted 5 lines

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.

Quoted 7 lines

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

Quoted 7 lines

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.

#15 lore raw

PATCH v3 4/4 kodi: allow enablement of libamcodec as codec if selected

Quoted 3 lines · daggs

Greetings,

Quoted 1 line · daggs

[snip]

Quoted 11 lines
Quoted 11 lines
Quoted 7 lines

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

Quoted 7 lines
Quoted 4 lines

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

Signature · 6 lines
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
author
#16 lore raw

PATCH v3 4/4 kodi: allow enablement of libamcodec as codec if selected

Greetings,

Quoted 27 lines
Quoted 3 lines

Greetings,

Quoted 1 line · daggs

[snip]

Quoted 11 lines
Quoted 11 lines
Quoted 7 lines

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

Quoted 7 lines
Quoted 4 lines

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

Quoted 8 lines

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.

#17 lore raw

PATCH v3 4/4 kodi: allow enablement of libamcodec as codec if selected

In reply to daggs

Hello,

Quoted 4 lines · daggs

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

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