summaryrefslogtreecommitdiffstats
path: root/debian/patches/check-for-atomic.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/check-for-atomic.patch')
-rw-r--r--debian/patches/check-for-atomic.patch31
1 files changed, 31 insertions, 0 deletions
diff --git a/debian/patches/check-for-atomic.patch b/debian/patches/check-for-atomic.patch
new file mode 100644
index 0000000..4097100
--- /dev/null
+++ b/debian/patches/check-for-atomic.patch
@@ -0,0 +1,31 @@
+Description: Add -latomic where needed
+ This is to fix the build on armel and mipsel
+Author: Mattia Rizzolo <mattia@debian.org>
+Forwarded: https://gitlab.com/inkscape/inkscape/-/merge_requests/1867
+Last-Update: 2020-05-07
+
+--- a/CMakeScripts/DefineDependsandFlags.cmake
++++ b/CMakeScripts/DefineDependsandFlags.cmake
+@@ -60,6 +60,22 @@
+ list(APPEND INKSCAPE_LIBS "-latomic")
+ ENDIF()
+
++include(CheckCXXSourceCompiles)
++CHECK_CXX_SOURCE_COMPILES("
++#include <atomic>
++#include <cstdint>
++std::atomic<uint64_t> x (0);
++int main() {
++ uint64_t i = x.load(std::memory_order_relaxed);
++ return 0;
++}
++"
++LIBATOMIC_NOT_NEEDED)
++IF (NOT LIBATOMIC_NOT_NEEDED)
++ message(STATUS " Adding -latomic to the libs.")
++ list(APPEND INKSCAPE_LIBS "-latomic")
++ENDIF()
++
+
+ # ----------------------------------------------------------------------------
+ # Helper macros