Summary: | graphics/poppler 21.12.0_1 Cannot Find libopenjpeg2 | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | Ports & Packages | Reporter: | Ryan Frederick <ryanrfrederick> | ||||||||
Component: | Individual Port(s) | Assignee: | freebsd-desktop (Team) <desktop> | ||||||||
Status: | Closed FIXED | ||||||||||
Severity: | Affects Only Me | CC: | adridg, ptarmigan, pvoigt, rob.kruus, tcberner | ||||||||
Priority: | --- | Flags: | tcberner:
maintainer-feedback+
|
||||||||
Version: | Latest | ||||||||||
Hardware: | Any | ||||||||||
OS: | Any | ||||||||||
Attachments: |
|
Description
Ryan Frederick
2022-03-28 14:47:49 UTC
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 :) |