When emerging sdl2-ttf it fails with: CMake Error at /lib64/cmake/SDL2/sdl2-config.cmake:13 (message): File or directory //include/SDL2 referenced by variable SDL2_INCLUDE_DIR does not exist ! When trying to build in manually it works fine though. Reproducible: Always Steps to Reproduce: 1. emerge -1avq media-libs/sdl2-ttf 2. 3.
Created attachment 844941 [details] build.log
Created attachment 844943 [details] emerge --info
Please also share /var/tmp/portage/media-libs/sdl2-ttf-2.20.0/work/SDL2_ttf-2.20.0_build-abi_x86_64.amd64/CMakeFiles/CMakeOutput.log.
I wonder what's getting it the idea to use /lib64/cmake/SDL2 before /usr/lib64/cmake/SDL2? The same is happening with the gcc check: -- Check for working C compiler: /sbin/x86_64-pc-linux-gnu-gcc - skipped While (also on merged-usr) me I get: -- Check for working C compiler: /usr/sbin/x86_64-pc-linux-gnu-gcc - skipped The //include bit is not so strange given: get_filename_component(prefix "${CMAKE_CURRENT_LIST_DIR}/../../.." ABSOLUTE) set(includedir "${prefix}/include") (so, if it's using /lib64 then prefix=/ leading to //include which is not found, so it fails) Can't seem to reproduce, not that I experimented much.
Created attachment 845231 [details] CMakeOutput.log
FIND=kfind, FILE=dolpihn, etc in environment could be it. If you try in a fresh, clean shell (env -i) as root, does it happen?
(In reply to Sam James from comment #6) > FIND=kfind, FILE=dolpihn, etc in environment could be it. If you try in a > fresh, clean shell (env -i) as root, does it happen? magnesium ~ # env -i emerge -1avq media-libs/sdl2-ttf PORTAGE_BZIP2_COMMAND setting is invalid: 'bzip2' PORTAGE_BZIP2_COMMAND setting from make.globals is invalid: 'bzip2' !!! BINPKG_COMPRESS unsupported zstd. Missing package: app-arch/zstd[ebuild R ] media-libs/sdl2-ttf-2.20.0 USE="ha rfbuzz -X -static-libs" ABI_X86="(64) -32 (-x32)" Would you like to merge these packages? [Yes/No] >>> Verifying ebuild manifests >>> Emerging (1 of 1) media-libs/sdl2-ttf-2.20.0::gentoo >>> Failed to emerge media-libs/sdl2-ttf-2.20.0, Log file: >>> '/var/log/portage/elog/media-libs:sdl2-ttf-2.20.0:20221227-153413.log' >>> Jobs: 0 of 1 complete, 1 failed Load avg: 0.13, 0.11, 0.20 Same error.
Please show the output of the following: ls -ld /bin /sbin /usr/bin /usr/sbin /lib64 /usr/lib64
(In reply to Mike Gilbert from comment #8) ❯ ls -ld /bin /sbin /usr/bin /usr/sbin /lib64 /usr/lib64 lrwxrwxrwx 1 root root 7 Sep 14 2019 /bin -> usr/bin lrwxrwxrwx 1 root root 9 Sep 14 2019 /lib64 -> usr/lib64 lrwxrwxrwx 1 root root 8 Sep 14 2019 /sbin -> usr/sbin drwxr-xr-x 1 root root 78500 Dez 27 17:57 /usr/bin drwxr-xr-x 1 root root 145500 Dez 27 17:45 /usr/lib64 lrwxrwxrwx 1 root root 3 Dez 9 19:37 /usr/sbin -> bin
I can reproduce the failure if I set ROOTPATH="/usr/bin:/usr/sbin" in the environment before calling emerge/ebuild. Portage seems to mangle PATH based on the ROOTPATH variable, and always moves those directories to the end. It also forcibly adds /sbin and /bin to to PATH before ROOTPATH if the latter does not contain them. For example: > % sudo ROOTPATH=/usr/bin:/usr/sbin ebuild foo-0.ebuild clean setup > * ROOTPATH=/usr/bin:/usr/sbin > * PATH=/usr/lib/ccache/bin:/home/floppym/src/portage/bin/ebuild-helpers/xattr:/home/floppym/src/portage/bin/ebuild-helpers:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/bin:/usr/sbin It appears that cmake searches for modules based on where it finds itself in PATH, and so it thinks it is installed in /sbin with prefix="".
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=69f2221413852630b2c231774e1f811f350fa3e6 commit 69f2221413852630b2c231774e1f811f350fa3e6 Author: Mike Gilbert <floppym@gentoo.org> AuthorDate: 2022-12-31 22:01:08 +0000 Commit: Mike Gilbert <floppym@gentoo.org> CommitDate: 2023-01-02 20:35:27 +0000 _doebuild_path: simplify logic used to set PATH Remove logic to incoporate PREROOTPATH and ROOTPATH. I'm not sure where PREROOTPATH was ever used, and ROOTPATH has been deprecated in baselayout for a while. Remove logic to add hard-coded directories like ${EPREFIX}/{,usr{,/local}/{sbin,bin}. Adding these paths is unnecessary if env.d or the calling environment have a valid PATH setting. Add logic to ignore PATH from the calling environment if PATH is set in env.d. This ensures that packages can update PATH by installing files in /etc/env.d and this will work without having to restart Portage with an updated environment. Bug: https://bugs.gentoo.org/607696 Bug: https://bugs.gentoo.org/693308 Bug: https://bugs.gentoo.org/888543 Signed-off-by: Mike Gilbert <floppym@gentoo.org> lib/portage/package/ebuild/doebuild.py | 44 +++++++++++----------------------- 1 file changed, 14 insertions(+), 30 deletions(-)
Created attachment 848479 [details, diff] media-libs/libsdl2 cmake merged-usr fix using REALPATH
Created attachment 848489 [details] [New Ebuild] media-libs/libsdl2-2.26.2-r1.ebuild
*** Bug 890833 has been marked as a duplicate of this bug. ***
The bug is in dev-util/cmake-2.25.1.ebuild Adding GetRealPath to CollapseFullPath the problem is resolved See Also: https://bugs.gentoo.org/889822
Created attachment 848545 [details, diff] dev-util/cmake-3.25.1 add GetRealPath to CollapseFullPath
Created attachment 848547 [details] [New Ebuild] dev-util/cmake-3.25.1-r1.ebuild
See Also: https://bugs.gentoo.org/889822
(In reply to Jon Daniel from comment #15) > The bug is in dev-util/cmake-2.25.1.ebuild Please stop posting your patch(es) to every bug report you can find.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e342b1cae0ba19e35d27fe523ce0331e1412e295 commit e342b1cae0ba19e35d27fe523ce0331e1412e295 Author: Sam James <sam@gentoo.org> AuthorDate: 2023-01-15 22:13:26 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-01-15 22:13:26 +0000 sys-apps/portage: add 3.0.44 Closes: https://bugs.gentoo.org/889328 Closes: https://bugs.gentoo.org/607696 Closes: https://bugs.gentoo.org/867031 Closes: https://bugs.gentoo.org/873202 Closes: https://bugs.gentoo.org/888543 Closes: https://bugs.gentoo.org/834038 Signed-off-by: Sam James <sam@gentoo.org> sys-apps/portage/Manifest | 1 + sys-apps/portage/portage-3.0.44.ebuild | 288 +++++++++++++++++++++++++++++++++ 2 files changed, 289 insertions(+)