media-tv/kodi: Adding cross-compilation support
authorGerhard Bräunlich <wippbox@gmx.net>
Fri, 23 Sep 2016 10:07:23 +0000 (12:07 +0200)
committerDavid Seifert <soap@gentoo.org>
Thu, 17 Nov 2016 07:35:45 +0000 (08:35 +0100)
Gentoo-bugs: https://bugs.gentoo.org/show_bug.cgi?id=560196

Package-Manager: portage-2.2.28
Closes: https://github.com/gentoo/gentoo/pull/2392

Signed-off-by: David Seifert <soap@gentoo.org>
media-tv/kodi/kodi-16.0.ebuild
media-tv/kodi/kodi-16.1.ebuild
media-tv/kodi/kodi-9999.ebuild

index 47aac929ac756b583031ac44f9705af53bdb0109..faa7ec2919b6927e467cb2254cf94dbd717ab817 100644 (file)
@@ -178,7 +178,29 @@ src_prepare() {
        multijob_finish
        elibtoolize
 
-       if [[ ${PV} == "9999" ]] || use java ; then #558798
+       # Cross-compiler support
+       # We need JsonSchemaBuilder and TexturePacker binaries for the host system
+       # Later we need libsquish for the target system
+       if tc-is-cross-compiler ; then
+               mkdir "${WORKDIR}"/${CBUILD} || die
+               pushd "${WORKDIR}"/${CBUILD} >/dev/null || die
+               einfo "Building host tools"
+               cp -a "$S"/{tools,xbmc} ./ || die
+               local tools=( JsonSchemaBuilder )
+               use texturepacker && tools+=( TexturePacker )
+               for tool in "${tools[@]}" ; do
+                       tc-env_build emake -C tools/depends/native/$tool
+                       mkdir "$S"/tools/depends/native/$tool/bin || die
+                       ln -s "${WORKDIR}"/${CBUILD}/tools/depends/native/$tool/bin/$tool "$S"/tools/depends/native/$tool/bin/$tool || die
+               done
+               popd >/dev/null || die
+
+               emake -f codegenerator.mk
+
+               # Binary kodi.bin links against libsquish,
+               # so we need libsquish compiled for the target system
+               emake -C tools/depends/native/libsquish-native/ CXX=$(tc-getCXX)
+       elif [[ ${PV} == "9999" ]] || use java ; then #558798
                tc-env_build emake -f codegenerator.mk
        fi
 
index 0195f28f329f5d3d5ee50c5037e90a4efe1316a4..0f9bb40de86d42fb3f72c0edd83a439ecef0624f 100644 (file)
@@ -182,7 +182,29 @@ src_prepare() {
        multijob_finish
        elibtoolize
 
-       if [[ ${PV} == "9999" ]] || use java ; then #558798
+       # Cross-compiler support
+       # We need JsonSchemaBuilder and TexturePacker binaries for the host system
+       # Later we need libsquish for the target system
+       if tc-is-cross-compiler ; then
+               mkdir "${WORKDIR}"/${CBUILD} || die
+               pushd "${WORKDIR}"/${CBUILD} >/dev/null || die
+               einfo "Building host tools"
+               cp -a "$S"/{tools,xbmc} ./ || die
+               local tools=( JsonSchemaBuilder )
+               use texturepacker && tools+=( TexturePacker )
+               for tool in "${tools[@]}" ; do
+                       tc-env_build emake -C tools/depends/native/$tool
+                       mkdir "$S"/tools/depends/native/$tool/bin || die
+                       ln -s "${WORKDIR}"/${CBUILD}/tools/depends/native/$tool/bin/$tool "$S"/tools/depends/native/$tool/bin/$tool || die
+               done
+               popd >/dev/null || die
+
+               emake -f codegenerator.mk
+
+               # Binary kodi.bin links against libsquish,
+               # so we need libsquish compiled for the target system
+               emake -C tools/depends/native/libsquish-native/ CXX=$(tc-getCXX)
+       elif [[ ${PV} == "9999" ]] || use java ; then #558798
                tc-env_build emake -f codegenerator.mk
        fi
 
index 58bc5422739452668ec583f74a28b892807a78ee..462bb8b6d630787bcbe162be82965ecd3718c3a1 100644 (file)
@@ -183,7 +183,29 @@ src_prepare() {
        multijob_finish
        elibtoolize
 
-       if [[ ${PV} == "9999" ]] || use java ; then #558798
+       # Cross-compiler support
+       # We need JsonSchemaBuilder and TexturePacker binaries for the host system
+       # Later we need libsquish for the target system
+       if tc-is-cross-compiler ; then
+               mkdir "${WORKDIR}"/${CBUILD} || die
+               pushd "${WORKDIR}"/${CBUILD} >/dev/null || die
+               einfo "Building host tools"
+               cp -a "$S"/{tools,xbmc} ./ || die
+               local tools=( JsonSchemaBuilder )
+               use texturepacker && tools+=( TexturePacker )
+               for tool in "${tools[@]}" ; do
+                       tc-env_build emake -C tools/depends/native/$tool
+                       mkdir "$S"/tools/depends/native/$tool/bin || die
+                       ln -s "${WORKDIR}"/${CBUILD}/tools/depends/native/$tool/bin/$tool "$S"/tools/depends/native/$tool/bin/$tool || die
+               done
+               popd >/dev/null || die
+
+               emake -f codegenerator.mk
+
+               # Binary kodi.bin links against libsquish,
+               # so we need libsquish compiled for the target system
+               emake -C tools/depends/native/libsquish-native/ CXX=$(tc-getCXX)
+       elif [[ ${PV} == "9999" ]] || use java ; then #558798
                tc-env_build emake -f codegenerator.mk
        fi