summary refs log tree commit diff
diff options
context:
space:
mode:
authorZheng Junjie <873216071@qq.com>2023-03-25 12:51:34 +0800
committerEfraim Flashner <efraim@flashner.co.il>2023-06-04 15:28:53 +0300
commitae04b3996be99c89142866afdbba5151099b2064 (patch)
tree35f1f63d1f200bac9fd6d377181c3c3abc542c5c
parent4f3e5548fcc2c0bbd9a5ecaf76a4fc63d2439aa3 (diff)
downloadguix-ae04b3996be99c89142866afdbba5151099b2064.tar.gz
gnu: jpegoptim: Fix cross-compiling to riscv64.
* gnu/packages/image.scm (jpegoptim)[arguments]: When cross-compiling t
riscv64, add phase to update-config-scripts.
[native-inputs]: When cross-compiling to riscv64, add config.

Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
-rw-r--r--gnu/packages/image.scm22
1 files changed, 20 insertions, 2 deletions
diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm
index 830989da78..06ace23636 100644
--- a/gnu/packages/image.scm
+++ b/gnu/packages/image.scm
@@ -571,9 +571,27 @@ official designation is ISO/IEC 29199-2). This library is an implementation of t
       (sha256
        (base32 "06f6d08xvmsiki4mc1qs985gsjqmsxx793a93b72y25q84wbg9x9"))))
    (build-system gnu-build-system)
-   (inputs (list libjpeg-turbo))
    (arguments
-    '(#:tests? #f))                     ; no tests
+    `(#:tests? #f                       ; no tests
+      ,@(if (and (target-riscv64?)
+                 (%current-target-system))
+          (list #:phases
+                #~(modify-phases %standard-phases
+                    (add-after 'unpack 'update-config-scripts
+                      (lambda* (#:key native-inputs inputs #:allow-other-keys)
+                        (for-each (lambda (file)
+                                    (install-file
+                                      (search-input-file
+                                        (or native-inputs inputs)
+                                        (string-append "/bin/" file)) "./tools"))
+                                  '("config.guess" "config.sub"))))))
+          '())))
+   (inputs (list libjpeg-turbo))
+   (native-inputs
+    (if (and (target-riscv64?)
+             (%current-target-system))
+      (list config)
+      '()))
    (synopsis "Optimize JPEG images")
    (description
     "jpegoptim provides lossless optimization (based on optimizing