On Wed, 9 Jan 2019 22:01:28 +0100 Matthias Kilian <k...@outback.escape.de> wrote:
> But it's obviously ugly and wrong (hard coded /usr/X11R6). I'm not > very familiar with cmake, so if anyone could help a little bit > (passing -L ${X11BASE}lib via CONFIGURE_ARGS to the invocation of > g-ir-scanner), I'd be really happy. Thank you for looking at this problem! I had added a similar patch to my powerpc machine, but it also hardcoded /usr/X11R6, and it was for an older version of poppler. I can't find a way to pass -L /usr/X11R6/lib to g-ir-scanner without patching a cmake script. I can't do cmake -D Poppler_0_18_gir_CFLAGS=-L${X11BASE}/lib because the set(Poppler_0_18_gir_CFLAGS ...) in the cmake script would override the value from the command line. The next diff (on top of your 0.73.0 update, and with qt5/poppler-version.h moved to PLIST-qt5) builds a package on amd64 using `make package USE_LLD=No`. This wraps ld.bfd in /usr/ports/pobj/poppler-0.73.0-no_qt5-bootstrap/bin/ld --- Makefile.orig Thu Jan 10 11:05:42 2019 +++ Makefile Thu Jan 10 11:06:15 2019 @@ -105,6 +105,7 @@ -DBUILD_GTK_TESTS=False \ -DENABLE_LIBCURL=False \ -DCMAKE_DISABLE_FIND_PACKAGE_NSS3=True \ - -DOpenJPEG_DIR=${LOCALBASE}/lib/openjp2 + -DOpenJPEG_DIR=${LOCALBASE}/lib/openjp2 \ + -DX11BASE=${X11BASE} .include <bsd.port.mk> --- /dev/null Thu Jan 10 11:17:48 2019 +++ patches/patch-glib_CMakeLists_txt Thu Jan 10 11:11:17 2019 @@ -0,0 +1,16 @@ +$OpenBSD$ + +Index: glib/CMakeLists.txt +--- glib/CMakeLists.txt.orig ++++ glib/CMakeLists.txt +@@ -130,7 +130,9 @@ if (HAVE_INTROSPECTION AND BUILD_SHARED_LIBS) + set(Poppler_0_18_gir_INCLUDES GObject-2.0 Gio-2.0 cairo-1.0) + get_directory_property(_tmp_includes INCLUDE_DIRECTORIES) + _list_prefix(_includes _tmp_includes "-I") +- set(Poppler_0_18_gir_CFLAGS ${_includes} -L${CMAKE_BINARY_DIR} -L${CMAKE_CURRENT_BINARY_DIR}) ++ set(Poppler_0_18_gir_CFLAGS ${_includes} -L${CMAKE_BINARY_DIR} -L${CMAKE_CURRENT_BINARY_DIR} ++ -L${X11BASE}/lib ++ ) + set(Poppler_0_18_gir_LIBS poppler-glib) + _list_prefix(_abs_introspection_files introspection_files "${CMAKE_CURRENT_SOURCE_DIR}/") + list(APPEND _abs_introspection_files There are a few different ways to get the value of X11BASE into cmake. I did cmake -DX11BASE=${X11BASE} which sets X11BASE in CMake's cache, but no existing port does this. Another way is to use SUBST_CMD to expand ${X11BASE}. This happens in 3 ports: cad/kicad emulators/ppsspp games/lostpixels Another way is to use ${OPENBSD_X11BASE}, which is set by CMake but not documented in cmake-variables(7) nor port-modules(5). This happens in 2 ports: games/openrct2 math/freemat /usr/local/share/cmake/Modules/Platform/OpenBSD.cmake sets OPENBSD_X11BASE to $ENV{X11BASE} or /usr/X11R6, but I don't see X11BASE in make show=CONFIGURE_ENV. I believe that OPENBSD_X11BASE would ignore X11BASE from ports and hardcode /usr/X11R6. -- George Koehler <kern...@gmail.com>