1 |
commit: 8e8f74afb6662f813be78b857d6a88a852548e17 |
2 |
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Dec 29 11:50:41 2021 +0000 |
4 |
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Dec 29 15:41:22 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8e8f74af |
7 |
|
8 |
media-gfx/krita: Fix build with clang |
9 |
|
10 |
Reported-by: Michael Egger <egger.m <AT> protonmail.com> |
11 |
Closes: https://bugs.gentoo.org/830225 |
12 |
Package-Manager: Portage-3.0.30, Repoman-3.0.3 |
13 |
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org> |
14 |
|
15 |
media-gfx/krita/files/krita-5.0.0-clang.patch | 50 ++++++++++++++++++++++ |
16 |
.../{krita-5.0.0.ebuild => krita-5.0.0-r1.ebuild} | 5 ++- |
17 |
2 files changed, 54 insertions(+), 1 deletion(-) |
18 |
|
19 |
diff --git a/media-gfx/krita/files/krita-5.0.0-clang.patch b/media-gfx/krita/files/krita-5.0.0-clang.patch |
20 |
new file mode 100644 |
21 |
index 000000000000..6c9c71d4fca2 |
22 |
--- /dev/null |
23 |
+++ b/media-gfx/krita/files/krita-5.0.0-clang.patch |
24 |
@@ -0,0 +1,50 @@ |
25 |
+From 0b755beaa1fdba03d38f887b93a15a58fc0830c7 Mon Sep 17 00:00:00 2001 |
26 |
+From: Sharaf Zaman <shzam@×××.org> |
27 |
+Date: Wed, 27 Oct 2021 22:19:07 +0000 |
28 |
+Subject: [PATCH] Fix build on linux clang targets |
29 |
+ |
30 |
+In CheckAtomic.cmake we include is_lock_free because these routines |
31 |
+don't seem to be included in the compiler's "simple atomics". This |
32 |
+triggers a failure in clang toolchain, forcing it to link libatomic. |
33 |
+ |
34 |
+Resulting in error: ld.lld: error: undefined symbol: __atomic_is_lock_free |
35 |
+ |
36 |
+CCBUG:444247 |
37 |
+CCBUG:444547 |
38 |
+--- |
39 |
+ cmake/modules/CheckAtomic.cmake | 1 + |
40 |
+ libs/image/CMakeLists.txt | 6 ++---- |
41 |
+ 2 files changed, 3 insertions(+), 4 deletions(-) |
42 |
+ |
43 |
+diff --git a/cmake/modules/CheckAtomic.cmake b/cmake/modules/CheckAtomic.cmake |
44 |
+index b061e2d65b..df6b70504c 100644 |
45 |
+--- a/cmake/modules/CheckAtomic.cmake |
46 |
++++ b/cmake/modules/CheckAtomic.cmake |
47 |
+@@ -46,6 +46,7 @@ function(check_working_cxx_atomics64 varname) |
48 |
+ std::atomic<uint64_t> x (0); |
49 |
+ int main() { |
50 |
+ uint64_t i = x.load(std::memory_order_relaxed); |
51 |
++ x.is_lock_free(); |
52 |
+ return 0; |
53 |
+ } |
54 |
+ " ${varname}) |
55 |
+diff --git a/libs/image/CMakeLists.txt b/libs/image/CMakeLists.txt |
56 |
+index e883c7f1c8..43c945fad3 100644 |
57 |
+--- a/libs/image/CMakeLists.txt |
58 |
++++ b/libs/image/CMakeLists.txt |
59 |
+@@ -372,10 +372,8 @@ target_link_libraries(kritaimage |
60 |
+ |
61 |
+ target_link_libraries(kritaimage PUBLIC ${Boost_SYSTEM_LIBRARY}) |
62 |
+ |
63 |
+-if(NOT HAVE_CXX_ATOMICS_WITHOUT_LIB) |
64 |
+- if(NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB) |
65 |
+- target_link_libraries(kritaimage PUBLIC atomic) |
66 |
+- endif() |
67 |
++if(HAVE_CXX_ATOMICS_WITH_LIB OR HAVE_CXX_ATOMICS64_WITH_LIB) |
68 |
++ target_link_libraries(kritaimage PUBLIC atomic) |
69 |
+ endif() |
70 |
+ |
71 |
+ if(OpenEXR_FOUND) |
72 |
+-- |
73 |
+GitLab |
74 |
+ |
75 |
|
76 |
diff --git a/media-gfx/krita/krita-5.0.0.ebuild b/media-gfx/krita/krita-5.0.0-r1.ebuild |
77 |
similarity index 96% |
78 |
rename from media-gfx/krita/krita-5.0.0.ebuild |
79 |
rename to media-gfx/krita/krita-5.0.0-r1.ebuild |
80 |
index 80d88c6840a7..757396adc400 100644 |
81 |
--- a/media-gfx/krita/krita-5.0.0.ebuild |
82 |
+++ b/media-gfx/krita/krita-5.0.0-r1.ebuild |
83 |
@@ -86,7 +86,10 @@ BDEPEND=" |
84 |
sys-devel/gettext |
85 |
" |
86 |
|
87 |
-PATCHES=( "${FILESDIR}"/${PN}-4.3.1-tests-optional.patch ) |
88 |
+PATCHES=( |
89 |
+ "${FILESDIR}"/${PN}-4.3.1-tests-optional.patch |
90 |
+ "${FILESDIR}"/${P}-clang.patch # bug 830225 |
91 |
+) |
92 |
|
93 |
pkg_setup() { |
94 |
python-single-r1_pkg_setup |