Subject: [PATCH v2] gnu: webkit: Disable SSE2 when not on x86_64.

From: Liliana Marie Prikler <[email-masked]>
Date: Sat, 6 Nov 2021 09:21:02 +0100

* gnu/packages/webkit.scm (webkitgtk)[#:phases]: Add ‘disable-sse2’ if the
current (target) system is not an x86_64 one.
---
Hi Maxime,

I tried conditionally disabling SSE2 on the host side, but for some reason this
patch would cause a rebuild for me.  Did I do something wrong?

 gnu/packages/webkit.scm | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/webkit.scm b/gnu/packages/webkit.scm
index e54b680855..ca50ab37a8 100644
--- a/gnu/packages/webkit.scm
+++ b/gnu/packages/webkit.scm
@@ -241,7 +241,7 @@ (define-public webkitgtk
     (build-system cmake-build-system)
     (outputs '("out" "doc"))
     (arguments
-     '(#:tests? #f ; no tests
+     `(#:tests? #f ; no tests
        #:build-type "Release" ; turn off debugging symbols to save space
        #:configure-flags (list
                           "-DPORT=GTK"
@@ -295,6 +295,13 @@ (define-public webkitgtk
                  (("libWPEBackend-fdo-([\\.0-9]+)\\.so" all version)
                   (string-append wpebackend-fdo "/lib/" all)))
                #t)))
+         ,@(if (string-prefix? "x68_64" (or (%current-target-system)
+                                            (%current-system)))
+               '()
+               '((add-after 'unpack 'disable-sse2
+                   (lambda _
+                     (substitute* "Source/cmake/DetectSSE2.cmake"
+                       (("CHECK_FOR_SSE2\\(\\)") ""))))))
          (add-before 'configure 'prepare-build-environment
            (lambda* (#:key inputs #:allow-other-keys)
              (setenv "CC" "clang")
-- 
2.33.1