Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kodi use cmake #768

Merged
merged 7 commits into from Dec 6, 2016

Conversation

Projects
None yet
6 participants
@lrusak
Copy link
Member

commented Sep 26, 2016

This is a big one and requires #760 to work currently as this is based on top of that PR.

This will wait till LE9 for sure.

thanks to @stefansaraev for some of the patches.

cp -P $ROOT/$PKG_BUILD/tools/depends/native/TexturePacker/bin/TexturePacker $ROOT/$TOOLCHAIN/bin
}
PKG_CMAKE_OPTS_TARGET="-DNATIVEPREFIX=$ROOT/$TOOLCHAIN \
-DDEPENDS_PATH=$PKG_BUILD_SUBDIR/depends \

This comment has been minimized.

Copy link
@stefansaraev

# autoreconf
BOOTSTRAP_STANDALONE=1 make -f $ROOT/$PKG_BUILD/bootstrap.mk
export LIBS="$LIBS -lz -lterminfo"

This comment has been minimized.

Copy link
@stefansaraev

stefansaraev Sep 26, 2016

Contributor

hm. why would terminfo be needed here.

This comment has been minimized.

Copy link
@lrusak

lrusak Sep 28, 2016

Author Member

fails to link python or something.

@@ -371,7 +287,7 @@ post_makeinstall_target() {
cp $PKG_DIR/scripts/cputemp $INSTALL/usr/bin
ln -sf cputemp $INSTALL/usr/bin/gputemp
cp $PKG_DIR/scripts/setwakeup.sh $INSTALL/usr/bin
cp tools/EventClients/Clients/Kodi\ Send/kodi-send.py $INSTALL/usr/bin/kodi-send
# cp tools/EventClients/Clients/Kodi\ Send/kodi-send.py $INSTALL/usr/bin/kodi-send

This comment has been minimized.

Copy link
@stefansaraev

stefansaraev Sep 26, 2016

Contributor

cp $PKG_BUILD/tools/EventClients ....

This comment has been minimized.

Copy link
@lrusak

lrusak Sep 28, 2016

Author Member

removed, it's installed with cmake

mkdir -p $INSTALL/usr/lib/python$PYTHON_VERSION/site-packages/kodi
cp -R tools/EventClients/lib/python/* $INSTALL/usr/lib/python$PYTHON_VERSION/site-packages/kodi
# mkdir -p $INSTALL/usr/lib/python$PYTHON_VERSION/site-packages/kodi
# cp -R tools/EventClients/lib/python/* $INSTALL/usr/lib/python$PYTHON_VERSION/site-packages/kodi

This comment has been minimized.

Copy link
@stefansaraev

stefansaraev Sep 26, 2016

Contributor

you'll need this for kodi-send.

This comment has been minimized.

Copy link
@lrusak

lrusak Sep 28, 2016

Author Member

removed, it's installed with cmake

@@ -0,0 +1,23 @@
diff --git a/project/cmake/modules/FindPython.cmake b/project/cmake/modules/FindPython.cmake

This comment has been minimized.

Copy link
@stefansaraev

stefansaraev Sep 26, 2016

Contributor

stefansaraev/xbmc@cba2207 may be enough for you. too.

endforeach()
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/${dest}/media)
string(REPLACE "${CORE_SOURCE_DIR}/" "" dest ${skin})
- pack_xbt(${skin}/media ${CMAKE_BINARY_DIR}/${dest}/media/Textures.xbt)

This comment has been minimized.

Copy link
@stefansaraev

stefansaraev Sep 26, 2016

Contributor

you need this stuff for skin xbt packing, if you dont want it - you can as well remove texturepacker package.

This comment has been minimized.

Copy link
@lrusak

lrusak Sep 28, 2016

Author Member

we pack the skin seperately

@@ -0,0 +1,57 @@
From 7cf46841663438ea3f470429fa31f19a002c71a5 Mon Sep 17 00:00:00 2001

This comment has been minimized.

Copy link
@stefansaraev

stefansaraev Sep 26, 2016

Contributor

you dont need this patch if you build with -DENABLE_DVDCSS=ON (not sure if that has been fixed upstream yet, but LE users will want dvdcss anyway)

@lrusak

This comment has been minimized.

Copy link
Member Author

commented Sep 26, 2016

Some things are currently broken, that's why they have either been disabled or pached out for the time being.

@lrusak lrusak force-pushed the lrusak:cmake-kodi branch 3 times, most recently from 92e645e to 39da04b Sep 28, 2016

@lrusak

This comment has been minimized.

Copy link
Member Author

commented Sep 28, 2016

This is now at feature parity to what we have currently. The only issue is that kodi's cmake doesn't allow switching on or off certain features it just relies on if they are present or not (pulseaudio, bluetooth, etc). I'm not sure if this will change but I will look into patching it and sending it upstream.

@hudokkow

This comment has been minimized.

Copy link
Contributor

commented Sep 28, 2016

PRs are welcome, of course, but a list of what you guys need changed would be nice. Saves us from doubling efforts.

@stefansaraev already told me some of the things he would like implemented to have better control over the build in the slack channel.

@lrusak lrusak force-pushed the lrusak:cmake-kodi branch from 39da04b to be9546d Sep 28, 2016

@lrusak

This comment has been minimized.

Copy link
Member Author

commented Sep 28, 2016

@hudokkow I think I had it wrong, even though they are optional dependecies they can still be explicitly set otherwise they will be auto detected. Is this correct?

@stefansaraev

This comment has been minimized.

Copy link
Contributor

commented Sep 28, 2016

@lrusak ^ yes. example -DENABLE_SMBCLIENT=OFF (SMBCLIENT is all uppercase) should completely disable smbclient support. even if you have smbclient libs/headers/pkgconfig file in your toolchain.

this works for most optional deps (see project/cmake/CMakeLists.txt -> set(optional_deps ..)) but not all. last time I checked - (at least) disabling webserver (-DENABLE_MICROHTTPD=OFF) support didnt work

@lrusak

This comment has been minimized.

Copy link
Member Author

commented Sep 29, 2016

I've added PR10582 to this so that libdvd stuff gets linked properly.

@hudokkow

This comment has been minimized.

Copy link
Contributor

commented Sep 29, 2016

No need. That PR is going in as soon as jenkins is happy.

@lrusak lrusak force-pushed the lrusak:cmake-kodi branch from af362a1 to 9418932 Sep 30, 2016

@lrusak lrusak force-pushed the lrusak:cmake-kodi branch from 9418932 to e01137a Oct 13, 2016

@lrusak

This comment has been minimized.

Copy link
Member Author

commented Oct 13, 2016

updated for kodi17-beta3

@lrusak lrusak force-pushed the lrusak:cmake-kodi branch from e01137a to e48899e Nov 16, 2016

@lrusak lrusak removed the LE 9.0 label Nov 16, 2016

@lrusak

This comment has been minimized.

Copy link
Member Author

commented Nov 16, 2016

Rebased, builds fine. maybe hold off a day, or wait till someone else confirms.

@lrusak lrusak force-pushed the lrusak:cmake-kodi branch 2 times, most recently from e846dd6 to adb9fb7 Nov 19, 2016

@MilhouseVH

This comment has been minimized.

Copy link
Contributor

commented Nov 20, 2016

While building Generic with DEBUG=yes and this PR, I experienced the following failure:

Copying file m4/intl.m4
Scanning dependencies of target wrap_libexif
make[3]: Leaving directory '/home/neil/projects/LibreELEC.tv/build.LibreELEC-Generic.x86_64-8.0-devel-debug/kodi-17.0-beta5-e92818a/.x86_64-libreelec-linux-gnu'
make[3]: Entering directory '/home/neil/projects/LibreELEC.tv/build.LibreELEC-Generic.x86_64-8.0-devel-debug/kodi-17.0-beta5-e92818a/.x86_64-libreelec-linux-gnu'
[ 11%] Generating ../../system/libexif-x86_64.so
Copying file m4/intldir.m4
Copying file m4/intmax.m4
Copying file m4/inttypes-pri.m4
Copying file m4/inttypes_h.m4
collect2: fatal error: ld terminated with signal 11 [Segmentation fault], core dumped
compilation terminated.
make[3]: *** [build/exif/CMakeFiles/wrap_libexif.dir/build.make:62: system/libexif-x86_64.so] Error 1
make[3]: *** Deleting file 'system/libexif-x86_64.so'
make[3]: Leaving directory '/home/neil/projects/LibreELEC.tv/build.LibreELEC-Generic.x86_64-8.0-devel-debug/kodi-17.0-beta5-e92818a/.x86_64-libreelec-linux-gnu'
make[2]: *** [CMakeFiles/Makefile2:2365: build/exif/CMakeFiles/wrap_libexif.dir/all] Error 2
make[2]: *** Waiting for unfinished jobs....
Copying file m4/lcmessage.m4

The core is ./kodi-17.0-beta5-e92818a/.x86_64-libreelec-linux-gnu/build/exif/core, and produces the following stacktrace:

[New LWP 7133]
Core was generated by `/home/neil/projects/LibreELEC.tv/build.LibreELEC-Generic.x86_64-8.0-devel-debug'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007ff51209be34 in elf_x86_64_relocate_section (output_bfd=output_bfd@entry=0x193cb90, info=0x6f9fc0 <link_info>, input_bfd=input_bfd@entry=0x1999920, input_section=input_section@entry=0x19e9470, contents=<optimised out>, relocs=relocs@entry=0x1bf6fb0, local_syms=0x1caa0c0, local_sections=0x1cc5d80) at /home/neil/projects/LibreELEC.tv/build.LibreELEC-Generic.x86_64-8.0-devel-debug/binutils-2.27/bfd/elf64-x86-64.c:4182
4182          RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,

Thread 1 (LWP 7133):
#0  0x00007ff51209be34 in elf_x86_64_relocate_section (output_bfd=output_bfd@entry=0x193cb90, info=0x6f9fc0 <link_info>, input_bfd=input_bfd@entry=0x1999920, input_section=input_section@entry=0x19e9470, contents=<optimised out>, relocs=relocs@entry=0x1bf6fb0, local_syms=0x1caa0c0, local_sections=0x1cc5d80) at /home/neil/projects/LibreELEC.tv/build.LibreELEC-Generic.x86_64-8.0-devel-debug/binutils-2.27/bfd/elf64-x86-64.c:4182
#1  0x00007ff5120c4199 in elf_link_input_bfd (flinfo=flinfo@entry=0x7ffe425343b0, input_bfd=input_bfd@entry=0x1999920) at /home/neil/projects/LibreELEC.tv/build.LibreELEC-Generic.x86_64-8.0-devel-debug/binutils-2.27/bfd/elflink.c:10366
#2  0x00007ff5120c5987 in bfd_elf_final_link (abfd=<optimised out>, info=<optimised out>) at /home/neil/projects/LibreELEC.tv/build.LibreELEC-Generic.x86_64-8.0-devel-debug/binutils-2.27/bfd/elflink.c:11574
#3  0x000000000041a0c7 in ldwrite () at /home/neil/projects/LibreELEC.tv/build.LibreELEC-Generic.x86_64-8.0-devel-debug/binutils-2.27/ld/ldwrite.c:577
#4  0x0000000000405413 in main (argc=170, argv=0x7ffe42534698) at /home/neil/projects/LibreELEC.tv/build.LibreELEC-Generic.x86_64-8.0-devel-debug/binutils-2.27/ld/ldmain.c:431

Disabling gold with -DENABLE_LDGOLD=OFF allows the build to succeed.

diff -Naur a/packages/mediacenter/kodi/package.mk b/packages/mediacenter/kodi/package.mk
--- a/packages/mediacenter/kodi/package.mk  2016-11-20 07:52:42.715617842 +0000
+++ b/packages/mediacenter/kodi/package.mk  2016-11-20 07:55:08.660486630 +0000
@@ -210,6 +210,7 @@
                        -DENABLE_CCACHE=ON \
                        -DENABLE_LIRC=ON \
                        -DENABLE_EVENTCLIENTS=ON \
+                       -DENABLE_LDGOLD=OFF \
                        $KODI_OPENGL \
                        $KODI_OPENGLES \
                        $KODI_OPENMAX \

@lrusak it would be good if you could try and reproduce this failure before disabling gold, just to be sure it's nothing to do with my build environment:

DEBUG=yes PROJECT=Generic ARCH=x86_64 make release

I'm going to try another clean debug build myself (gold enabled), which I expect to fail.

@MilhouseVH

This comment has been minimized.

Copy link
Contributor

commented Nov 24, 2016

@lrusak has anyone suggested to Kodi that texturepacker and skins should optional/external, so that we don't have to continue to patching it out?

@stefansaraev

This comment has been minimized.

Copy link
Contributor

commented Nov 24, 2016

I did. I was told "nope. texturepacker wont be optional".

@MilhouseVH

This comment has been minimized.

Copy link
Contributor

commented Nov 24, 2016

Bugger. That means every time project/cmake/CMakeLists.txt is changed by Kodi there's a good chance it will break our patch. I wanted to test xbmc/xbmc#10479 but that doesn't apply cleanly because of changes to CMakeLists.txt, so I immediately lost interest. Maybe once things calm down it won't be a problem.

@stefansaraev

This comment has been minimized.

Copy link
Contributor

commented Nov 24, 2016

fyi, skin color themes wont work if you dont use texturepacker. "that by design, texturepacker is not optional at all!" they said. sure it is still optional if using autoconf, but kodi core does not give a damn, you are on your own "if you are using an unsupported build option". sorta..

@wsnipex

This comment has been minimized.

Copy link

commented Nov 25, 2016

xbmc/xbmc#10988 addresses the texturepacker issue
xbmc/xbmc@dbb610a fixed gold usage
xbmc/xbmc@8558d67 should render your python patchery (and setting python include dir) superfluous. It should just work via pkg-config

@lrusak

This comment has been minimized.

Copy link
Member Author

commented Nov 25, 2016

@wsnipex thanks for the help.

The texturepacker PR is great, however we still have to patch out all the skin patching stuff because we build the skin seperately.

The gold issue is fixed.

The python commit works however we don't have INTL or GMP and patching them out works, not sure what these are needed for.

@wsnipex

This comment has been minimized.

Copy link

commented Nov 25, 2016

unless CMAKE_CROSS_COMPILING is true in LE, those libs are not checked for in FindPython. We only do this for unified depends builds.

@wsnipex

This comment has been minimized.

Copy link

commented Nov 25, 2016

btw @stefansaraev not sure who you have been talking with about texturepacker, but we do give a damn.
External Texturepacker should be supported (see PR above), but why would you want to build without it?
Why do you build the skin outside of kodi?

@stefansaraev

This comment has been minimized.

Copy link
Contributor

commented Nov 25, 2016

@wsnipex I think (but I am not sure) it was martijn who said I am building with an unsupported option (--without-texturepacker) when I asked if there are any plans to make skin color packs working without texturepacker.

I tried hard to like estuary, but I could not, I still ship confluence with my fork, and I dont use texturepacker. imho texturepacker is an overcomplicated and unneeded thing nowadays, on all hardware I tested (an early intel nuc, a zotac nano box, ion330, wetek play, wetek core, wetek play 2, few thinkpad laptops) without texturepacker I can't feel any real difference at runtime.

@MilhouseVH

This comment has been minimized.

Copy link
Contributor

commented Nov 25, 2016

@wsnipex

xbmc/xbmc@dbb610a fixed gold usage

Unfortunately not. Even with PR10973, I still see a build failure when building Generic (arch=x86_64) with debug if LDGOLD is not disabled. When building Generic without debug, there is no issue with LDGOLD enabled or disabled.

While previously (without PR10973) when building debug with LDGOLD the build would end in a segfault, now with PR10973 it ends with an internal compiler error:

/home/neil/projects/LibreELEC.tv/build.LibreELEC-Generic.x86_64-8.0-devel-debug/libcdio-0.93/lib/driver/cdtext.c:238:1: note: code may be misoptimized unless -fno-strict-aliasing is used
/home/neil/projects/LibreELEC.tv/build.LibreELEC-Generic.x86_64-8.0-devel-debug/taglib-1.11/taglib/mpeg/mpegutils.h: In function 'secondSynchByte':
/home/neil/projects/LibreELEC.tv/build.LibreELEC-Generic.x86_64-8.0-devel-debug/taglib-1.11/taglib/mpeg/mpegutils.h:55:7: internal compiler error: in lhd_decl_printable_name, at langhooks.c:222
       }
       ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
lto-wrapper: fatal error: /home/neil/projects/LibreELEC.tv/build.LibreELEC-Generic.x86_64-8.0-devel-debug/toolchain/bin/x86_64-libreelec-linux-gnu-g++-6.2.0 returned 1 exit status
compilation terminated.
/home/neil/projects/LibreELEC.tv/build.LibreELEC-Generic.x86_64-8.0-devel-debug/toolchain/lib/gcc/x86_64-libreelec-linux-gnu/6.2.0/../../../../x86_64-libreelec-linux-gnu/bin/ld.gold: fatal error: lto-wrapper failed
collect2: error: ld returned 1 exit status
make[3]: *** [CMakeFiles/kodi.dir/build.make:444: kodi.bin] Error 1
make[3]: Leaving directory '/home/neil/projects/LibreELEC.tv/build.LibreELEC-Generic.x86_64-8.0-devel-debug/kodi-17.0-beta5-e92818a/.x86_64-libreelec-linux-gnu'
make[2]: *** [CMakeFiles/Makefile2:364: CMakeFiles/kodi.dir/all] Error 2
make[2]: Leaving directory '/home/neil/projects/LibreELEC.tv/build.LibreELEC-Generic.x86_64-8.0-devel-debug/kodi-17.0-beta5-e92818a/.x86_64-libreelec-linux-gnu'
make[1]: *** [Makefile:139: all] Error 2
make[1]: Leaving directory '/home/neil/projects/LibreELEC.tv/build.LibreELEC-Generic.x86_64-8.0-devel-debug/kodi-17.0-beta5-e92818a/.x86_64-libreelec-linux-gnu'
Makefile:9: recipe for target 'release' failed
make: *** [release] Error 2

I'm happy to continue building Kodi for LibreELEC without GOLD, as we know that works, but can test again if you have any other ideas.

@wsnipex

This comment has been minimized.

Copy link

commented Nov 26, 2016

lto-wrapper: fatal error

are you using LTO?

@lrusak lrusak force-pushed the lrusak:cmake-kodi branch from 961c478 to d5d9b44 Dec 1, 2016

@lrusak

This comment has been minimized.

Copy link
Member Author

commented Dec 1, 2016

rebased for kodi-17b6

@lrusak lrusak force-pushed the lrusak:cmake-kodi branch from b578ae9 to aeb3e40 Dec 1, 2016

@lrusak

This comment has been minimized.

Copy link
Member Author

commented Dec 2, 2016

@wsnipex no, we strip lto from cxxflags and cflags when building kodi. so unless kodi cmake does something with lto it is not used.

This is currently in a working state, I'll keep gold disabled for now.

lrusak added some commits Dec 2, 2016

@lrusak lrusak force-pushed the lrusak:cmake-kodi branch from aeb3e40 to 1930b5b Dec 2, 2016

@lrusak lrusak removed the MERGE BLOCKED label Dec 2, 2016

@lrusak

This comment has been minimized.

Copy link
Member Author

commented Dec 4, 2016

ready to go unless any objections

@chewitt chewitt merged commit 03bbb0c into LibreELEC:master Dec 6, 2016

MilhouseVH added a commit to MilhouseVH/LibreELEC.tv that referenced this pull request Feb 13, 2018

MilhouseVH added a commit to MilhouseVH/LibreELEC.tv that referenced this pull request Feb 16, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.