Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 757006 - app-text/poppler-20.11.0 fails to build [Prefix]: CMake Error at CMakeLists.txt:252
Summary: app-text/poppler-20.11.0 fails to build [Prefix]: CMake Error at CMakeLists.t...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords: PullRequest
Depends on: 733480
Blocks:
  Show dependency tree
 
Reported: 2020-11-26 22:25 UTC by Steven Trogdon
Modified: 2021-07-15 16:53 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build log (build.log,10.37 KB, text/x-log)
2020-11-26 22:25 UTC, Steven Trogdon
Details
CMakeError.log (CMakeError.log,3.22 KB, text/x-log)
2020-11-26 23:16 UTC, Steven Trogdon
Details
CMakeOutput.log (CMakeOutput.log,61.76 KB, text/x-log)
2020-11-26 23:16 UTC, Steven Trogdon
Details
emerge --info (info,5.63 KB, text/plain)
2020-11-26 23:22 UTC, Steven Trogdon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Steven Trogdon 2020-11-26 22:25:49 UTC
Created attachment 675205 [details]
build log

From build.log

CMake Error at CMakeLists.txt:252 (message):
  Install libopenjpeg2 before trying to build poppler.  You can also decide
  to use the internal unmaintained JPX decoder or none at all.

libopenjpeg2 is installed, althought it appears as libopenjp2.so

$ eix -I openjpeg
[I] media-libs/openjpeg
     Available versions:  
     (0)    1.5.2-r1(0/5)^t
     (2)    2.3.1-r1(2/7)^t
       {doc static-libs test ABI_MIPS="n32 n64 o32" ABI_S390="32 64" ABI_X86="32 64 x32"}
     Installed versions:  1.5.2-r1(0/5)^t(21:25:35 11/26/20)(-doc -static-libs -test ABI_MIPS="-n32 -n64 -o32" ABI_S390="-32 -64" ABI_X86="64 -32 -x32") 2.3.1-r1(2/7)^t(09:13:12 11/26/20)(-doc -static-libs -test ABI_MIPS="-n32 -n64 -o32" ABI_S390="-32 -64" ABI_X86="64 -32 -x32")
     Homepage:            https://www.openjpeg.org
     Description:         Open-source JPEG 2000 library

In build.log there is also

-- Package Qt5Core or Qt5Gui or Qt5Xml not found

and these packages are also installed

[I] dev-qt/qtcore
     Available versions:  (5) 5.15.1-r1(5/5.15.1)^t [m]5.15.2(5/5.15.2)^t
       {debug icu old-kernel systemd test KERNEL="linux"}
     Installed versions:  5.15.1-r1(5/5.15.1)^t(21:07:26 11/26/20)(old-kernel -debug -icu -systemd -test KERNEL="linux")
     Homepage:            https://www.qt.io/
     Description:         Cross-platform application development framework

[I] dev-qt/qtgui
     Available versions:  (5) 5.15.1-r1(5/5.15.1)^t [m]5.15.2(5/5.15.2)^t
       {+X accessibility dbus debug egl eglfs evdev +gif gles2-only ibus jpeg +libinput +png test tslib tuio +udev vnc vulkan wayland}
     Installed versions:  5.15.1-r1(5/5.15.1)^t(21:14:06 11/26/20)(X gif libinput png udev -accessibility -dbus -debug -egl -eglfs -evdev -gles2-only -ibus -jpeg -test -tslib -tuio -vnc -vulkan -wayland)
     Homepage:            https://www.qt.io/
     Description:         The GUI module and platform plugins for the Qt5 framework

[I] dev-qt/qtxml
     Available versions:  (5) 5.15.1(5/5.15)^t [m]5.15.2(5/5.15)^t
       {debug test}
     Installed versions:  5.15.1(5/5.15)^t(18:56:25 11/26/20)(-debug -test)
     Homepage:            https://www.qt.io/
     Description:         Implementation of SAX and DOM for the Qt5 framework

In build.log there are also attempts to find cmake config files which can't be found as in

  Could not find a package configuration file provided by "OpenJPEG" with any
  of the following names:

    OpenJPEGConfig.cmake
    openjpeg-config.cmake

  Add the installation prefix of "OpenJPEG" to CMAKE_PREFIX_PATH or set
  "OpenJPEG_DIR" to a directory containing one of the above files.  If
  "OpenJPEG" provides a separate development package or SDK, be sure it has
  been installed.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2020-11-26 22:27:31 UTC
Could you add these too:

See also "/storage/strogdon/gentoo-rap/var/tmp/portage/app-text/poppler-20.11.0/work/poppler-20.11.0_build/CMakeFiles/CMakeOutput.log".
See also "/storage/strogdon/gentoo-rap/var/tmp/portage/app-text/poppler-20.11.0/work/poppler-20.11.0_build/CMakeFiles/CMakeError.log".
 [31;01m*[0m ERROR: app-text/poppler-20.11.0::gentoo failed (configure phase):

and emerge --info?
Comment 2 Steven Trogdon 2020-11-26 23:16:06 UTC
Created attachment 675211 [details]
CMakeError.log
Comment 3 Steven Trogdon 2020-11-26 23:16:56 UTC
Created attachment 675214 [details]
CMakeOutput.log
Comment 4 Steven Trogdon 2020-11-26 23:20:37 UTC
From CMakeError.log (I had looked at this previously) it doesn't appear that things are happy with my gcc. But I don't know if that is significant.
Comment 5 Steven Trogdon 2020-11-26 23:22:38 UTC
Created attachment 675217 [details]
emerge --info
Comment 6 Steven Trogdon 2020-11-26 23:39:14 UTC
(In reply to Steven Trogdon from comment #4)
> From CMakeError.log (I had looked at this previously) it doesn't appear that
> things are happy with my gcc. But I don't know if that is significant.

should have been "aren't happy"
Comment 7 Steven Trogdon 2020-11-27 03:24:48 UTC
The .cmake files do seem to be installed properly under EPREFIX/lib64/cmake/pkgs, i.e.

$ ls ~/usr/lib64/cmake/openjpeg-2.3/
OpenJPEGConfig.cmake  OpenJPEGTargets-gentoo.cmake  OpenJPEGTargets.cmake
Comment 8 Steven Trogdon 2020-11-29 02:18:31 UTC
A data point relative to Qt5Core. The find_package( ... ) that appears in CMakeLists.txt as 

find_package(Qt5Core 5.5) 

is not quite smart enough to find the desired Qt5CoreConfig.cmake file. Adding 

-DCMAKE_FIND_DEBUG_MODE=ON to mycmakeargs in the ebuild and running the configure phase, I have in build.log

Prefix:
  find_package considered the following locations for the Config module:

    /storage/strogdon/gentoo-rap/usr/lib/portage/python3.8/ebuild-helpers/unprivileged/Qt5CoreConfig.cmake
    /storage/strogdon/gentoo-rap/usr/lib/portage/python3.8/ebuild-helpers/unprivileged/qt5core-config.cmake
    /storage/strogdon/gentoo-rap/usr/lib/portage/python3.8/ebuild-helpers/Qt5CoreConfig.cmake
    /storage/strogdon/gentoo-rap/usr/lib/portage/python3.8/ebuild-helpers/qt5core-config.cmake
    /storage/strogdon/gentoo-rap/usr/local/Qt5CoreConfig.cmake
    /storage/strogdon/gentoo-rap/usr/local/qt5core-config.cmake
    /storage/strogdon/gentoo-rap/usr/Qt5CoreConfig.cmake
    /storage/strogdon/gentoo-rap/usr/qt5core-config.cmake
    /storage/strogdon/gentoo-rap/Qt5CoreConfig.cmake
    /storage/strogdon/gentoo-rap/qt5core-config.cmake
    /storage/strogdon/gentoo-rap/opt/Qt5CoreConfig.cmake
    /storage/strogdon/gentoo-rap/opt/qt5core-config.cmake
    /storage/strogdon/gentoo-rap/usr/lib/llvm/11/Qt5CoreConfig.cmake
    /storage/strogdon/gentoo-rap/usr/lib/llvm/11/qt5core-config.cmake
    /usr/Qt5CoreConfig.cmake
    /usr/qt5core-config.cmake
    /Qt5CoreConfig.cmake
    /qt5core-config.cmake
    /opt/Qt5CoreConfig.cmake
    /opt/qt5core-config.cmake

  The file was not found.

while on

Gentoo:
 find_package considered the following locations for the Config module:

    /usr/lib/portage/python3.8/ebuild-helpers/xattr/Qt5CoreConfig.cmake
    /usr/lib/portage/python3.8/ebuild-helpers/xattr/qt5core-config.cmake
    /usr/lib/portage/python3.8/ebuild-helpers/Qt5CoreConfig.cmake
    /usr/lib/portage/python3.8/ebuild-helpers/qt5core-config.cmake
    /usr/lib/llvm/8/Qt5CoreConfig.cmake
    /usr/lib/llvm/8/qt5core-config.cmake
    /usr/lib/llvm/7/Qt5CoreConfig.cmake
    /usr/lib/llvm/7/qt5core-config.cmake
    /usr/lib/llvm/6/Qt5CoreConfig.cmake
    /usr/lib/llvm/6/qt5core-config.cmake
    /usr/local/Qt5CoreConfig.cmake
    /usr/local/qt5core-config.cmake
    /usr/Qt5CoreConfig.cmake
    /usr/qt5core-config.cmake
    /usr/lib64/cmake/Qt5Core/Qt5CoreConfig.cmake

  The file was found at

    /usr/lib64/cmake/Qt5Core/Qt5CoreConfig.cmake

Not sure why the search paths are different but I believe this is why poppler fails in Prefix. The find_package( ... ) function has to be told where to search.
Comment 9 Steven Trogdon 2020-12-05 23:32:20 UTC
This issue also exists with app-text/poppler-20.12.0. FWIW adding

-DCMAKE_PREFIX_PATH=${EPREFIX}/usr/$(get_libdir)/cmake

to 

 local mycmakeargs=( ...
 
 )

allows both poppler-20.11.0 and poppler-20.12.0 to build here in prefix.
Comment 10 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2020-12-05 23:34:32 UTC
(In reply to Steven Trogdon from comment #9)
> This issue also exists with app-text/poppler-20.12.0. FWIW adding
> 
> -DCMAKE_PREFIX_PATH=${EPREFIX}/usr/$(get_libdir)/cmake
> 
> to 
> 
>  local mycmakeargs=( ...
>  
>  )
> 
> allows both poppler-20.11.0 and poppler-20.12.0 to build here in prefix.

Hmm.

$ grep -rsin "prefix_path" ~/git/gentoo/eclass
/Users/sam/git/gentoo/eclass/cmake-utils.eclass:639:			SET (CMAKE_PREFIX_PATH "${EPREFIX}/usr" CACHE STRING "" FORCE)
/Users/sam/git/gentoo/eclass/ros-catkin.eclass:161:	export CATKIN_PREFIX_PATH="${EPREFIX}/usr"
/Users/sam/git/gentoo/eclass/ros-catkin.eclass:178:		"-DCATKIN_PREFIX_PATH=${SYSROOT:-${EROOT}}/usr"
/Users/sam/git/gentoo/eclass/cmake.eclass:465:				set(CMAKE_PREFIX_PATH "${EPREFIX}/usr" CACHE STRING "" FORCE)

So, I guess for some reason, that's not enough in this case.
Comment 11 Andreas Sturmlechner gentoo-dev 2020-12-12 18:22:48 UTC
Does your host system have one-of

/etc/debian_version
/etc/arch-release

? Suspecting this is just bug 733480.
Comment 12 Steven Trogdon 2020-12-12 18:45:08 UTC
(In reply to Andreas Sturmlechner from comment #11)
> Does your host system have one-of
> 
> /etc/debian_version
> /etc/arch-release
> 
> ? Suspecting this is just bug 733480.

Yes, the host is ubuntu and 

/etc/debian_version exists
Comment 13 Larry the Git Cow gentoo-dev 2021-07-15 16:53:36 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8e5e1f3ef263363ec0426ce7a8a3dec6f5f5bb5d

commit 8e5e1f3ef263363ec0426ce7a8a3dec6f5f5bb5d
Author:     Benda Xu <heroxbd@gentoo.org>
AuthorDate: 2021-07-15 16:48:22 +0000
Commit:     Benda Xu <heroxbd@gentoo.org>
CommitDate: 2021-07-15 16:53:17 +0000

    p/f/prefix/standalone/profile.bashrc: remove Debian magic.
    
    We are Gentoo, and we unconditionally turn off Debian related tests.
    
    The upstreaming process has stalled and we work around this bug by
    hacking the profile.  Remove this when upstream figure out how to deal
    with distributions.
    
    Reference: https://gitlab.kitware.com/cmake/cmake/-/merge_requests/5047
    Reference: https://gitlab.kitware.com/cmake/cmake/-/issues/18979
    
    Bug: https://bugs.gentoo.org/733480
    Closes: https://bugs.gentoo.org/757006
    Closes: https://github.com/gentoo/gentoo/pull/20274
    
    Signed-off-by: Benda Xu <heroxbd@gentoo.org>

 profiles/features/prefix/standalone/profile.bashrc | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)