commit:     10f3f7f638cbe55958959df5d83597c090ba5f25
Author:     Marek Szuba <marecki <AT> gentoo <DOT> org>
AuthorDate: Wed Jul 21 19:37:08 2021 +0000
Commit:     Marek Szuba <marecki <AT> gentoo <DOT> org>
CommitDate: Wed Jul 21 19:45:05 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=10f3f7f6

media-gfx/darktable: strip down compilation of bundled libxcf

Needed to make cmake-3.21/ninja stop trying to pass LDFLAGS to ar.
Since stripping src/external/libxcf/CMakeLists.txt to the bare minimum
results in a patch about the same size as the file itself, just inject
the necessary lines to src/external/CMakeLists.txt and ignore the one in
libxcf.

Tested on both 3.4.1 and 3.6.0, with cmake versions 3.18.5 and 3.21.0;
all combinations seem to build fine.

Closes: https://bugs.gentoo.org/803053
Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>

 media-gfx/darktable/darktable-3.4.1.ebuild           |  1 +
 media-gfx/darktable/darktable-3.6.0.ebuild           |  1 +
 .../files/darktable-3.4.1_libxcf-cmake.patch         | 20 ++++++++++++++++++++
 3 files changed, 22 insertions(+)

diff --git a/media-gfx/darktable/darktable-3.4.1.ebuild 
b/media-gfx/darktable/darktable-3.4.1.ebuild
index 54b4518a454..2f4bd3209de 100644
--- a/media-gfx/darktable/darktable-3.4.1.ebuild
+++ b/media-gfx/darktable/darktable-3.4.1.ebuild
@@ -79,6 +79,7 @@ PATCHES=(
        "${FILESDIR}"/${PN}-find-opencl-header.patch
        "${FILESDIR}"/${PN}-3.0.2_cmake-march-autodetection.patch
        "${FILESDIR}"/${PN}-3.4.0_jsonschema-automagic.patch
+       "${FILESDIR}"/${PN}-3.4.1_libxcf-cmake.patch
 )
 
 S="${WORKDIR}/${P/_/~}"

diff --git a/media-gfx/darktable/darktable-3.6.0.ebuild 
b/media-gfx/darktable/darktable-3.6.0.ebuild
index f73844b3854..ad4c79e2d6e 100644
--- a/media-gfx/darktable/darktable-3.6.0.ebuild
+++ b/media-gfx/darktable/darktable-3.6.0.ebuild
@@ -79,6 +79,7 @@ PATCHES=(
        "${FILESDIR}"/${PN}-find-opencl-header.patch
        "${FILESDIR}"/${PN}-3.0.2_cmake-march-autodetection.patch
        "${FILESDIR}"/${PN}-3.4.0_jsonschema-automagic.patch
+       "${FILESDIR}"/${PN}-3.4.1_libxcf-cmake.patch
 )
 
 S="${WORKDIR}/${P/_/~}"

diff --git a/media-gfx/darktable/files/darktable-3.4.1_libxcf-cmake.patch 
b/media-gfx/darktable/files/darktable-3.4.1_libxcf-cmake.patch
new file mode 100644
index 00000000000..72ab5aa91ad
--- /dev/null
+++ b/media-gfx/darktable/files/darktable-3.4.1_libxcf-cmake.patch
@@ -0,0 +1,20 @@
+--- a/src/external/CMakeLists.txt
++++ b/src/external/CMakeLists.txt
+@@ -1,5 +1,16 @@
+ if(USE_XCF)
+-  add_subdirectory(libxcf)
++#  find_package(ZLIB REQUIRED)
++  add_library(xcf STATIC
++    "${CMAKE_CURRENT_SOURCE_DIR}/libxcf/xcf.c"
++    "${CMAKE_CURRENT_SOURCE_DIR}/libxcf/xcf.h"
++    "${CMAKE_CURRENT_SOURCE_DIR}/libxcf/xcf_names.c"
++    "${CMAKE_CURRENT_SOURCE_DIR}/libxcf/xcf_names.h"
++  )
++  set_property(TARGET xcf PROPERTY C_STANDARD 99)
++  target_compile_definitions(xcf PRIVATE _DEFAULT_SOURCE) # needed for 
htobe*()
++  target_include_directories(xcf PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/libxcf")
++#  target_link_libraries(xcf PUBLIC ZLIB::ZLIB)
++#  target_link_libraries(xcf PUBLIC m)
+ endif()
+ 
+ add_library(whereami STATIC 
"${CMAKE_CURRENT_SOURCE_DIR}/whereami/src/whereami.c")

Reply via email to