summary refs log tree commit diff
path: root/gnu/packages/image.scm
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2020-01-26 12:57:56 +0100
committerMarius Bakke <mbakke@fastmail.com>2020-01-26 13:39:18 +0100
commitf3418f58dc6fc2698183a46dacdf01fe16d685f0 (patch)
tree5b0a2c23bd9ac840bfcaa36baa2e89c1ca62a553 /gnu/packages/image.scm
parent28ba01aec6d998ffffc819458db308d691948246 (diff)
downloadguix-f3418f58dc6fc2698183a46dacdf01fe16d685f0.tar.gz
gnu: libjpeg-turbo: Fix cross-compilation.
* gnu/packages/image.scm (libjpeg-turbo)[arguments]: In #:configure-flags, add
"-DCMAKE_SYSTEM_PROCESSOR" for known architectures when cross-compiling.
Diffstat (limited to 'gnu/packages/image.scm')
-rw-r--r--gnu/packages/image.scm17
1 files changed, 16 insertions, 1 deletions
diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm
index ebb30742a4..ecd1867af6 100644
--- a/gnu/packages/image.scm
+++ b/gnu/packages/image.scm
@@ -1507,7 +1507,22 @@ is hereby granted."))))
      `(("nasm" ,nasm)))
     (arguments
      `(#:configure-flags '("-DCMAKE_INSTALL_LIBDIR:PATH=lib"
-                           "-DENABLE_STATIC=0")
+                           "-DENABLE_STATIC=0"
+                           ;; The build system probes for the current CPU, but
+                           ;; that fails when cross-compiling.
+                           ,@(let ((target (%current-target-system)))
+                               (if target
+                                   (cond
+                                    ((string-prefix? "arm" target)
+                                     `("-DCMAKE_SYSTEM_PROCESSOR=arm"))
+                                    ((string-prefix? "aarch64" target)
+                                     `("-DCMAKE_SYSTEM_PROCESSOR=aarch64"))
+                                    ((string-prefix? "i686" target)
+                                     `("-DCMAKE_SYSTEM_PROCESSOR=x86"))
+                                    ((string-prefix? "x86_64" target)
+                                     `("-DCMAKE_SYSTEM_PROCESSOR=x86_64"))
+                                    (else '()))
+                                   '())))
        ,@(if (%current-target-system)
              '()
              ;; Use a special "bootstrap" CMake for the native build to work