summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Sturmlechner <asturm@gentoo.org>2021-12-29 12:50:41 +0100
committerAndreas Sturmlechner <asturm@gentoo.org>2021-12-29 16:41:22 +0100
commit8e8f74afb6662f813be78b857d6a88a852548e17 (patch)
tree43fc092b522e52e76283074fda9ccdf260280c20 /media-gfx/krita
parentmedia-gfx/krita: Add missing DEPEND (diff)
downloadgentoo-8e8f74afb6662f813be78b857d6a88a852548e17.tar.gz
gentoo-8e8f74afb6662f813be78b857d6a88a852548e17.tar.bz2
gentoo-8e8f74afb6662f813be78b857d6a88a852548e17.zip
media-gfx/krita: Fix build with clang
Reported-by: Michael Egger <egger.m@protonmail.com> Closes: https://bugs.gentoo.org/830225 Package-Manager: Portage-3.0.30, Repoman-3.0.3 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'media-gfx/krita')
-rw-r--r--media-gfx/krita/files/krita-5.0.0-clang.patch50
-rw-r--r--media-gfx/krita/krita-5.0.0-r1.ebuild (renamed from media-gfx/krita/krita-5.0.0.ebuild)5
2 files changed, 54 insertions, 1 deletions
diff --git a/media-gfx/krita/files/krita-5.0.0-clang.patch b/media-gfx/krita/files/krita-5.0.0-clang.patch
new file mode 100644
index 000000000000..6c9c71d4fca2
--- /dev/null
+++ b/media-gfx/krita/files/krita-5.0.0-clang.patch
@@ -0,0 +1,50 @@
+From 0b755beaa1fdba03d38f887b93a15a58fc0830c7 Mon Sep 17 00:00:00 2001
+From: Sharaf Zaman <shzam@sdf.org>
+Date: Wed, 27 Oct 2021 22:19:07 +0000
+Subject: [PATCH] Fix build on linux clang targets
+
+In CheckAtomic.cmake we include is_lock_free because these routines
+don't seem to be included in the compiler's "simple atomics". This
+triggers a failure in clang toolchain, forcing it to link libatomic.
+
+Resulting in error: ld.lld: error: undefined symbol: __atomic_is_lock_free
+
+CCBUG:444247
+CCBUG:444547
+---
+ cmake/modules/CheckAtomic.cmake | 1 +
+ libs/image/CMakeLists.txt | 6 ++----
+ 2 files changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/cmake/modules/CheckAtomic.cmake b/cmake/modules/CheckAtomic.cmake
+index b061e2d65b..df6b70504c 100644
+--- a/cmake/modules/CheckAtomic.cmake
++++ b/cmake/modules/CheckAtomic.cmake
+@@ -46,6 +46,7 @@ function(check_working_cxx_atomics64 varname)
+ std::atomic<uint64_t> x (0);
+ int main() {
+ uint64_t i = x.load(std::memory_order_relaxed);
++ x.is_lock_free();
+ return 0;
+ }
+ " ${varname})
+diff --git a/libs/image/CMakeLists.txt b/libs/image/CMakeLists.txt
+index e883c7f1c8..43c945fad3 100644
+--- a/libs/image/CMakeLists.txt
++++ b/libs/image/CMakeLists.txt
+@@ -372,10 +372,8 @@ target_link_libraries(kritaimage
+
+ target_link_libraries(kritaimage PUBLIC ${Boost_SYSTEM_LIBRARY})
+
+-if(NOT HAVE_CXX_ATOMICS_WITHOUT_LIB)
+- if(NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB)
+- target_link_libraries(kritaimage PUBLIC atomic)
+- endif()
++if(HAVE_CXX_ATOMICS_WITH_LIB OR HAVE_CXX_ATOMICS64_WITH_LIB)
++ target_link_libraries(kritaimage PUBLIC atomic)
+ endif()
+
+ if(OpenEXR_FOUND)
+--
+GitLab
+
diff --git a/media-gfx/krita/krita-5.0.0.ebuild b/media-gfx/krita/krita-5.0.0-r1.ebuild
index 80d88c6840a7..757396adc400 100644
--- a/media-gfx/krita/krita-5.0.0.ebuild
+++ b/media-gfx/krita/krita-5.0.0-r1.ebuild
@@ -86,7 +86,10 @@ BDEPEND="
sys-devel/gettext
"
-PATCHES=( "${FILESDIR}"/${PN}-4.3.1-tests-optional.patch )
+PATCHES=(
+ "${FILESDIR}"/${PN}-4.3.1-tests-optional.patch
+ "${FILESDIR}"/${P}-clang.patch # bug 830225
+)
pkg_setup() {
python-single-r1_pkg_setup