Note that the most recent makepkg.conf upgrade adds pack-relative-relocs to the LDFLAGS, and while it should support the flag, cmake can't successfully FindThreads within makepkg, specifically.
CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find Threads (missing: Threads_FOUND)
Call Stack (most recent call first):
/usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake/Modules/FindThreads.cmake:226 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMakeLists.txt:166 (find_package)
If I source makepkg.conf and run it outside makepkg and replicate the PKGBUILD build steps by hand in the console, it works...not sure why, would love some help understanding and fixing it though.
For now I have this prior to calling cmake:
# makepkg is breaking the -Wl,-z,pack-relative-relocs ldflag for cmake's FindThreads
export LDFLAGS=$(echo "$LDFLAGS" | sed 's/-Wl,-z,pack-relative-relocs//g')
See my latest post, but removing the flag is effective and acceptable.
Pinned Comments
graysky commented on 2022-06-11 11:49 (UTC)
@laichiaheng - kodi is bound to a specific version of ffmpeg which is generally older than Arch's package. We avoid incompatibilities by using that specific version (ie internal ffmpeg). Recommend that you build kodi in clean chroot. See: https://wiki.archlinux.org/title/DeveloperWiki:Building_in_a_clean_chroot
I wrote a script that automates much of that called clean-chroot-manager offered here in the AUR.