Gentoo Archives: gentoo-commits

From: Marek Szuba <marecki@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-gfx/darktable/files/, media-gfx/darktable/
Date: Tue, 28 Feb 2023 13:12:58
Message-Id: 1677589960.05e28cce9d058d40e7d2001c1202b315b8a6742d.marecki@gentoo
1 commit: 05e28cce9d058d40e7d2001c1202b315b8a6742d
2 Author: Marek Szuba <marecki <AT> gentoo <DOT> org>
3 AuthorDate: Tue Feb 28 12:07:15 2023 +0000
4 Commit: Marek Szuba <marecki <AT> gentoo <DOT> org>
5 CommitDate: Tue Feb 28 13:12:40 2023 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=05e28cce
7
8 media-gfx/darktable: fix rawspeed CPU-property detection on musl
9
10 For page-cache size, the sys-libs/musl version currently in the tree
11 does support the relevant syscall so just make sure the test program
12 recognises this correctly.
13
14 For cache-line length, it does not presently seem to be possible to
15 look this up on a musl system so have CMake fall back to the hard-coded
16 default. It can already do so when in "build binary package" mode so it
17 has been a simple matter of extending one condition to check for the
18 ebuild-specified "am I linking against musl?" option.
19
20 Closes: https://bugs.gentoo.org/832027
21 Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>
22
23 media-gfx/darktable/darktable-4.2.1.ebuild | 2 ++
24 .../files/darktable-4.2.1_cmake-musl.patch | 22 ++++++++++++++++++++++
25 2 files changed, 24 insertions(+)
26
27 diff --git a/media-gfx/darktable/darktable-4.2.1.ebuild b/media-gfx/darktable/darktable-4.2.1.ebuild
28 index c9c57caa2f1f..aba89cc810c2 100644
29 --- a/media-gfx/darktable/darktable-4.2.1.ebuild
30 +++ b/media-gfx/darktable/darktable-4.2.1.ebuild
31 @@ -98,6 +98,7 @@ PATCHES=(
32 "${FILESDIR}"/${PN}-3.0.2_cmake-march-autodetection.patch
33 "${FILESDIR}"/${PN}-3.4.0_jsonschema-automagic.patch
34 "${FILESDIR}"/${PN}-3.4.1_libxcf-cmake.patch
35 + "${FILESDIR}"/${PN}-4.2.1_cmake-musl.patch
36 )
37
38 S="${WORKDIR}/${P/_/~}"
39 @@ -140,6 +141,7 @@ src_configure() {
40 -DDONT_USE_INTERNAL_LUA=ON
41 -DRAWSPEED_ENABLE_LTO=$(usex lto)
42 -DRAWSPEED_ENABLE_WERROR=OFF
43 + -DRAWSPEED_MUSL_SYSTEM=$(usex elibc_musl)
44 -DTESTBUILD_OPENCL_PROGRAMS=OFF
45 -DUSE_AVIF=$(usex avif)
46 -DUSE_CAMERA_SUPPORT=$(usex gphoto2)
47
48 diff --git a/media-gfx/darktable/files/darktable-4.2.1_cmake-musl.patch b/media-gfx/darktable/files/darktable-4.2.1_cmake-musl.patch
49 new file mode 100644
50 index 000000000000..33ad7f647752
51 --- /dev/null
52 +++ b/media-gfx/darktable/files/darktable-4.2.1_cmake-musl.patch
53 @@ -0,0 +1,22 @@
54 +--- a/src/external/rawspeed/cmake/Modules/cpu-cache-line-size.cmake
55 ++++ b/src/external/rawspeed/cmake/Modules/cpu-cache-line-size.cmake
56 +@@ -2,7 +2,7 @@
57 +
58 + unset(RAWSPEED_CACHELINESIZE)
59 +
60 +-if(BINARY_PACKAGE_BUILD)
61 ++if(BINARY_PACKAGE_BUILD OR RAWSPEED_MUSL_SYSTEM)
62 + message(STATUS "Performing binary package build, using hardcoded value.")
63 + else()
64 + try_run(RAWSPEED_CACHELINESIZE_EXITCODE RAWSPEED_CACHELINESIZE_COMPILED
65 +--- a/src/external/rawspeed/cmake/Modules/cpu-page-size.cpp
66 ++++ b/src/external/rawspeed/cmake/Modules/cpu-page-size.cpp
67 +@@ -4,7 +4,7 @@
68 + #include <unistd.h> // for _POSIX_C_SOURCE, sysconf, _SC_PAGESIZE
69 + #endif
70 +
71 +-#if (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 1) || defined(__APPLE__)
72 ++#if defined(_SC_PAGESIZE)
73 +
74 + int main() {
75 + long val = ::sysconf(_SC_PAGESIZE);