Building of graphics/poppler 21.12.0_1 fails on some systems due to not being able to find libopenjpeg2 despite graphics/openjpeg being installed: ### ===> Configuring for poppler-21.12.0_1 ===> Performing in-source build /bin/mkdir -p /usr/ports/graphics/poppler/work/poppler-21.12.0 -- The C compiler identification is Clang 10.0.1 -- The CXX compiler identification is Clang 10.0.1 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found PkgConfig: /usr/local/bin/pkgconf (found version "1.8.0") -- Looking for pthread.h -- Looking for pthread.h - found -- Found Threads: TRUE -- Checking _FILE_OFFSET_BITS for large files -- Checking _FILE_OFFSET_BITS for large files - not needed CMake Warning at CMakeLists.txt:102 (message): No test data found in $testdatadir. You will not be able to run 'make test' successfully. The test data is not included in the source packages and is also not part of the main git repository. Instead, you can checkout the test data from its own git repository with: git clone git://git.freedesktop.org/git/poppler/test You should checkout the test data as a sibling of your poppler source folder or specify the location of your checkout with -DTESTDATADIR=/path/to/checkoutdir/test. -- Found Freetype: /usr/local/lib/libfreetype.so (found version "2.11.1") -- Checking for module 'fontconfig' -- Found fontconfig, version 2.13.94 -- Found Fontconfig: /usr/local/lib/libfontconfig.so -- Found JPEG: /usr/local/lib/libjpeg.so (found version "80") -- Found ZLIB: /usr/lib/libz.so (found version "1.2.11") -- Found PNG: /usr/local/lib/libpng.so (found version "1.6.37+apng") -- Found TIFF: /usr/local/lib/libtiff.so (found version "4.3.0") -- Checking for module 'nss>=3.19' -- Found nss, version 3.76 -- Found NSS3: nss3;smime3;ssl3;nssutil3;plds4;plc4;nspr4;dl -- Package Qt6Core or Qt6Gui or Qt6Widgets or Qt6Test not found -- Checking for module 'cairo>=1.10.0' -- Found cairo, version 1.17.4 -- Found Cairo: /usr/local/lib/libcairo.so (Required is at least version "1.10.0") -- Found Boost: /usr/local/include (found suitable version "1.72.0", minimum required is "1.58.0") -- Performing Test ICONV_SECOND_ARGUMENT_IS_CONST -- Performing Test ICONV_SECOND_ARGUMENT_IS_CONST - Failed -- Could NOT find openjpeg2. CMake Error at CMakeLists.txt:272 (message): Install libopenjpeg2 before trying to build poppler. You can also decide to use the internal unmaintained JPX decoder or none at all. Possible options are: -DENABLE_LIBOPENJPEG=openjpeg2, -DENABLE_LIBOPENJPEG=none, -DENABLE_LIBOPENJPEG=unmaintained, -- Configuring incomplete, errors occurred! See also "/usr/ports/graphics/poppler/work/poppler-21.12.0/CMakeFiles/CMakeOutput.log". See also "/usr/ports/graphics/poppler/work/poppler-21.12.0/CMakeFiles/CMakeError.log". *** Error code 1 Stop. make[1]: stopped in /usr/ports/graphics/poppler *** Error code 1 Stop. make: stopped in /usr/ports/graphics/poppler ===>>> make build failed for graphics/poppler ===>>> Aborting update ===>>> You can restart from the point of failure with this command line: portmaster <flags> graphics/poppler This command has been saved to ~/portmasterfail.txt
Same here. 13.0-RELEASE-p8.
Moin moin I cannot reproduce this here with the given information. Poppler uses openjpeg's installed cmake files -- could you double check that the openjpeg package you're using is not corrupted? Also please check whether the noted cmake-logs contain anything useful :) mfg Tobias
Created attachment 232796 [details] cmake output
Created attachment 232797 [details] cmake error
I've tried rebuilding graphics/openjpeg along with all of poppler's build, runtime, and library dependencies yet receive the same build failure with poppler. I've attached the contents of CMakeOutput.log and CMakeError.log from a failed build. From my experience the failure occurs on some systems while other systems build openjpeg successfully. All systems are running 12.3-RELEASE-p4
Using cmake --debug find (and set(CMAKE_FIND_DEBUG_MODE TRUE) in the CMakeLists.txt): CMake Debug Log at CMakeLists.txt:270 (find_package): find_package considered the following paths for OpenJPEG.cmake /usr/obj/usr/ports/graphics/poppler/work/poppler-21.12.0/cmake/modules/FindOpenJPEG.cmake /usr/local/share/cmake/Modules/FindOpenJPEG.cmake The file was not found. /usr/local/lib/openjpeg-1.5/OpenJPEGConfig.cmake It's getting confused if you have both openjpeg2 and the old version installed.
Configures fine if you delete graphics/openjpeg15 (FreeBSD 13.0-RELEASE-p7).
Builds fine with -DENABLE_LIBOPENJPEG="none" (even in the presence of openjpeg15). Haven't tried "unmaintainde". No openjpeg2 in the ports tree (only openjpeg and openjpeg15).
(In reply to Citroën from comment #8) openjpeg2 is only a flag to the cmake to look for openjpeg, it has nothing to do with the port version or port name. In the CMakeLists.txt file: if(ENABLE_LIBOPENJPEG STREQUAL "openjpeg2") ... -DENABLE_LIBOPENJPEG="none" has the port not use openjpeg at all (so will always work) In the port Makefile: OPENJPEG_CMAKE_OFF=-DENABLE_LIBOPENJPEG:STR="none"
Created attachment 232802 [details] Ignore openjpeg15 in CMakeLists.txt This patch forces cmake to ignore the openjpeg-1.5 directory when searching for the cmake files. Currently not ideal as it hard codes the full path.
Flag. OK. Yet (default build, openjpeg installed) "CMake Error at CMakeLists.txt:272 (message): Install libopenjpeg2 before trying to build poppler..." and... "--Could NOT find openjpeg2. Configuring incomplete, errors occured!" So some bad response to a test condition leading to cryptic error message ?
(In reply to Robert Kruus from comment #10) Hm, I still cannot reproduce the issue even when both available versions of OpenJPEG are present on the system.
I have the same issue: 12.3-RELEASE-p4 Both openjpeg ports are currently installed. As soon as I completely disable openjpeg support graphics/poppler builds just fine.
Moin moin OK, I can reproduce it in my 13.x jail. mfg Tobias
Still doesn't build here (13.0-RELEASE-p8) with openjepeg15 after having completely disabled (deleted) openjpeg. Same error: cannot find openjpeg2...
This is quite sensitive to installed versions, paths, and filesystem order. - I have a 12.3 VM which I installed openjpeg15 and openjpeg in (so, that's versions 1.5 and 2.4 of the same library). This gave me two files called OpenJPEGConfig.cmake, one in /usr/local/lib/openjpeg-1.5 and one in /usr/local/lib/openjpeg-2.4. On this system, poppler fails to configure, as described in this PR. - I have a 13.0 jail with openjpeg15 and openjpeg installed, that's my poudriere jail, and here the config files live in /usr/local/lib/openjpeg-2.4 and /usr/localshare/openjpeg. On this system, poppler can be configured and builds just fine. Making poppler search for a specific version, e.g. `find_package(OpenJPEG 2)` fails because neither of the config files defines a version in a way that standard cmake-version-checking understands. So it comes down to: if both are installed, and in paths such that the 1.5 version is found first, things will go sideways. An underlying fix is to make openjpeg report its version correctly to CMake -- that is a patch that makes sense for version 2 and could be filed upstream -- and then make poppler look for version 2 as well.
Moin moin Please try https://people.freebsd.org/~tcberner/patches/0001-graphics-poppler-ignore-graphics-openjpeg15-presence.patch mfg Tobias
Works as expected. Funny opengjpeg would generate /usr/local/lib/openjpeg-2.4 while openjpeg15 /usr/local/lib/openjpeg-1.5...
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=7f6220a9b5d9ee74b0564706001a5287094b0428 commit 7f6220a9b5d9ee74b0564706001a5287094b0428 Author: Tobias C. Berner <tcberner@FreeBSD.org> AuthorDate: 2022-03-31 03:58:43 +0000 Commit: Tobias C. Berner <tcberner@FreeBSD.org> CommitDate: 2022-04-01 14:19:30 +0000 graphics/poppler: ignore graphics/openjpeg15 presence - cmake can under some non-determinstic circumstances find the OpenJPEGConfig.cmake in ${PREFIX}/lib/openjpeg-1.5 prior to the one in ${PREFIX}/lib/openjpeg2 with would be the wanted one. - Use CMAKE_IGNORE_PATH to explicitely make it not see that prefix. https://cmake.org/cmake/help/latest/variable/CMAKE_IGNORE_PATH.html#variable:CMAKE_IGNORE_PATH PR: 262888 graphics/poppler/Makefile | 5 +++++ 1 file changed, 5 insertions(+)
I'll close this as "fixed" then :)