Compiling Kodi and building deb packages – Raspbian Stretch

You may also like...

9 Responses

  1. Paul R. Gibson, Jr. says:

    BTW, the pthread issue I highlighted turned out to be nothing. With -Wnodev that callout was suppressed. The real issue at that time was the string(REPLACE…) syntax issue.

  2. Paul R. Gibson, Jr. says:

    ns….I am build K18 for a second time so i can get a better handle on any issues.
    From the first build attempt there was an issue with missing fmt package and with rapidjson package. Once I installed them all was ok and during second build/cmake attempt there were no fmt/rapidjson issues because they had been previously installed.
    Two other issues from both build attempts are as follows:

    1)
    CMake Error at cmake/cpack/CPackConfigDEB.cmake:126 (string):
    string sub-command REPLACE requires at least four arguments.
    Call Stack (most recent call first):
    cmake/scripts/rbpi/Install.cmake:309 (include)
    CMakeLists.txt:414 (include)

    CODE LOOKED LIKE THIS:
    string(REPLACE “\”” “” CHANGELOG ${CHANGELOG})

    I CHANGED CODE TO THIS:
    string(REPLACE “\”” ” ” CHANGELOG “${CHANGELOG}”)

    2)The file generated by cmake for the cpack debian package making process had the following entries which are incorrect. I could not find where the file CPackConfig.cmake was created so I just hacked it to look better:

    SET(CPACK_DEBIAN_PACKAGE_VERSION “2:18.0~git20171214.0453-b4e54bf036-di-1~stretch”)
    SET(CPACK_DEB_COMPONENT_INSTALL “ON”)
    SET(CPACK_GENERATOR “DEB”)
    SET(CPACK_INSTALL_CMAKE_PROJECTS “/share/kodi/build;kodi;ALL;/”)
    SET(CPACK_INSTALL_PREFIX “/usr”)
    SET(CPACK_MODULE_PATH “/share/kodi/cmake/modules”)
    SET(CPACK_NSIS_DISPLAY_NAME “kodi 0.0.1”)
    SET(CPACK_NSIS_INSTALLER_ICON_CODE “”)
    SET(CPACK_NSIS_INSTALLER_MUI_ICON_CODE “”)
    SET(CPACK_NSIS_INSTALL_ROOT “$PROGRAMFILES”)
    SET(CPACK_NSIS_PACKAGE_NAME “kodi 0.0.1”)
    SET(CPACK_OUTPUT_CONFIG_FILE “/share/kodi/build/CPackConfig.cmake”)
    SET(CPACK_PACKAGE_DEFAULT_LOCATION “/”)
    SET(CPACK_PACKAGE_DESCRIPTION_FILE “/usr/share/cmake-3.7/Templates/CPack.GenericDescription.txt”)
    SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY “kodi built using CMake”)
    SET(CPACK_PACKAGE_DIRECTORY “/share/kodi/build/packages”)
    SET(CPACK_PACKAGE_FILE_NAME “kodi-0.0.1-armv7l”)
    SET(CPACK_PACKAGE_INSTALL_DIRECTORY “kodi 0.0.1”)
    SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY “kodi 0.0.1”)
    SET(CPACK_PACKAGE_NAME “kodi”)
    SET(CPACK_PACKAGE_RELOCATABLE “true”)
    SET(CPACK_PACKAGE_VENDOR “Humanity”)
    SET(CPACK_PACKAGE_VERSION “0.0.1”)
    SET(CPACK_PACKAGE_VERSION_MAJOR “0”)
    SET(CPACK_PACKAGE_VERSION_MINOR “1”)
    SET(CPACK_PACKAGE_VERSION_PATCH “1”)

    I HACKED/CHANGED to look like this.
    SET(CPACK_DEBIAN_PACKAGE_HOMEPAGE “http://kodi.tv”)
    SET(CPACK_DEBIAN_PACKAGE_MAINTAINER ” “)
    SET(CPACK_DEBIAN_PACKAGE_VERSION “2:18.0~git20171214.0453-b4e54bf036-di-1~stretch”)
    SET(CPACK_DEB_COMPONENT_INSTALL “ON”)
    SET(CPACK_GENERATOR “DEB”)
    SET(CPACK_INSTALL_CMAKE_PROJECTS “/share/kodi/build;kodi;ALL;/”)
    SET(CPACK_INSTALL_PREFIX “/usr”)
    SET(CPACK_MODULE_PATH “/share/kodi/cmake/modules”)
    SET(CPACK_NSIS_DISPLAY_NAME “kodi 18.0.0”)
    SET(CPACK_NSIS_INSTALLER_ICON_CODE “”)
    SET(CPACK_NSIS_INSTALLER_MUI_ICON_CODE “”)
    SET(CPACK_NSIS_INSTALL_ROOT “$PROGRAMFILES”)
    SET(CPACK_NSIS_PACKAGE_NAME “kodi 18.0.0”)
    SET(CPACK_OUTPUT_CONFIG_FILE “/share/kodi/build/CPackConfig.cmake”)
    SET(CPACK_PACKAGE_DEFAULT_LOCATION “/”)
    SET(CPACK_PACKAGE_DESCRIPTION_FILE “/usr/share/cmake-3.7/Templates/CPack.GenericDescription.txt”)
    SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY “kodi built using CMake”)
    SET(CPACK_PACKAGE_DIRECTORY “/share/kodi/build/packages”)
    SET(CPACK_PACKAGE_FILE_NAME “kodi-18.0.0-armv7l”)
    SET(CPACK_PACKAGE_INSTALL_DIRECTORY “kodi 18.0.0”)
    SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY “kodi 18.0.0”)
    SET(CPACK_PACKAGE_NAME “kodi”)
    SET(CPACK_PACKAGE_RELOCATABLE “true”)
    SET(CPACK_PACKAGE_VENDOR “Humanity”)
    SET(CPACK_PACKAGE_VERSION “18.0.0”)
    SET(CPACK_PACKAGE_VERSION_MAJOR “18”)
    SET(CPACK_PACKAGE_VERSION_MINOR “0”)
    SET(CPACK_PACKAGE_VERSION_PATCH “0”)

    You can imaging what deb packages and armv7l directory looked like when set to 0.0.1

    • njs says:

      Regarding fmt and rapidjson, I submited a patch where you can compile the internal versions by setting -DENABLE_INTERNAL_FMT=ON and -DENABLE_INTERNAL_RapidJSON=ON 🙂

      About the other issues I’ll try to have a look at them in the following days 🙂

      Thanks for all the input, it’s really appreciated.

      • Paul R. Gibson, Jr. says:

        Perfect patch suggestion.
        Now if we could do something about the ffmpeg situation. Now K18 wants ffmpeg 3.4…..not an issue but I can’t seem to get builds to recognize that I have already done a make and make install on 3.4… I know about the FFMPEG_PATH and WITH_ option and INTERNAL_FFMPEG and such options but I am struggling on making a build use external ffmpeg. I want external so it does not have to wget and compile each time I wipe my build directory.
        But just had a thought. I can save off the already compiled ffmpeg stuff from the build directory. ( I’ve been playing so much and making out SD card space that I wipe things a lot…gotta stop that and buy a bigger SD card)

        • njs says:

          Honestly I never tried to build ffmpeg outside of the normal flow, specially because I mostly use popcornmix’s branches which include patches to optimise ffmpeg to make use of PI’s CPU and GPU internals, making it much more performant and tailored to the Raspberry Pi.

          I’ve just tried to compile kodi’s master by using the script I mentioned before, and it worked without any issue. I didn’t need to do any workaround or anything, just checked out plain master branch from xbmc repo, put the script in the root dir and triggered the build. So I’m not sure what happened with your builds before 🙁

          Regarding the SD, what I did was to buy a USB3 drive so I compile everything in there, otherwise the risk of wearing out the SD card with so many writes is very high. I didn’t notice any performance degradation, not that Pi supports USB3, but because USB3 drives use really fast flash memory which helps to max out the USB bus instead of waiting for IO to happen.
          Regarding this topic of saving the SD card, I wrote a post some time ago with some tips that I’ve been using without any issues so far.

          Thanks for all the input once again 🙂

  3. Paul R. Gibson, Jr. says:

    BTW I am trying to compile: git clone https://github.com/popcornmix/xbmc.git

    • Paul R. Gibson, Jr. says:

      I have/am using/are testing a kodi 18 build on my PI3 Debian Stretch.

      I had to overcome many many hurdles to accomplish the build.

      • njs says:

        Depending on the configuration you might encounter some issues indeed, I’ll try to update the branch with the latest version and compile it.

        I can also create a post about how to compile v18, so your input on the things you came across and how you solve them would be interesting.

        Thanks

  4. Paul R. Gibson, Jr. says:

    Ok…I give up and must ask for help. I am attempting Kodi 18 build. I have overcome fmt and rapidjson issues but I am stuck on how to resolve the below error. I googled and still cannot find fix.
    In your spare time is it possible for you to assist me in overcoming the below issue?
    /usr/bin/cc -fPIC -mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon-vfpv4 -mvectorize-with-neon-quad CMakeFiles/cmTC_3aabe.dir/CheckSymbolExists.c.o -o cmTC_3aabe -rdynamic
    CMakeFiles/cmTC_3aabe.dir/CheckSymbolExists.c.o: In function `main’:
    CheckSymbolExists.c:(.text+0x48): undefined reference to `pthread_create’
    collect2: error: ld returned 1 exit status

    /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_0ca02.dir/link.txt –verbose=1
    /usr/bin/cc -fPIC -mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon-vfpv4 -mvectorize-with-neon-quad -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTC_0ca02.dir/CheckFunctionExists.c.o -o cmTC_0ca02 -rdynamic -lpthreads
    /usr/bin/ld: cannot find -lpthreads
    collect2: error: ld returned 1 exit status

    On a positive note I was able to compile and use another kodi 17.6 build that I made on my Debian Stretch rpi3. (kodi still crashes on my PI. Guess I better submit a ticket to the kodi team.

    Thanks in advance, and once I am successful I will help you write a kodi 18 compile blog post if you wish.

Leave a Reply

Your email address will not be published. Required fields are marked *