summary refs log tree commit diff
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2016-11-29 22:53:57 +0100
committerRicardo Wurmus <rekado@elephly.net>2016-11-30 16:03:11 +0100
commit7edd195ac82c7a60fb7b61dcf59d73a12c101794 (patch)
treebf7a4c9045e3a5936396ab4e980a52a322477658
parent1d60f7c2b38733b031519a48771c44d20acb785d (diff)
downloadguix-7edd195ac82c7a60fb7b61dcf59d73a12c101794.tar.gz
gnu: gcj: Conditionally apply patch for armhf.
* gnu/packages/gcc.scm (gcj)[source]: Inherit from "gcc" package.
[native-inputs]: Conditionally add arm-patch.
[arguments]: Conditionally add phase "apply-arm-patch".
-rw-r--r--gnu/packages/gcc.scm20
1 files changed, 17 insertions, 3 deletions
diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index 4d93317785..72e2309c33 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -522,9 +522,6 @@ as the 'native-search-paths' field."
   (package (inherit gcc)
     (name "gcj")
     (version (package-version gcc))
-    (source (origin (inherit (package-source gcc))
-                    (patches (cons (search-patch "gcj-arm-mode.patch")
-                                   (origin-patches (package-source gcc))))))
     (inputs
      `(("fastjar" ,fastjar)
        ("perl" ,perl)
@@ -533,6 +530,15 @@ as the 'native-search-paths' field."
        ,@(package-inputs gcc)))
     (native-inputs
      `(("dejagnu" ,dejagnu)
+       ,@(if (string-prefix? "armhf" (or (%current-system)
+                                         (%current-target-system)))
+             `(("arm-patch" ,(origin
+                               (method url-fetch)
+                               (uri (search-patch "gcj-arm-mode.patch"))
+                               (sha256
+                                (base32
+                                 "1z15xs5yx6qinnb572swzxrn9f668sw7ga5280q3gznj1jyrynfn")))))
+             '())
        ,@(package-native-inputs gcc)))
     (native-search-paths %generic-search-paths)
 
@@ -560,6 +566,14 @@ as the 'native-search-paths' field."
                        ,flags))))
        ((#:phases phases)
         `(modify-phases ,phases
+           ;; Conditionally add phase to apply patch
+           ,@(if (string-prefix? "armhf" (or (%current-system)
+                                             (%current-target-system)))
+                 `((add-after 'unpack 'apply-arm-patch
+                     (lambda* (#:key inputs #:allow-other-keys)
+                       (zero? (system* "patch" "-p1"
+                                       "-i" (assoc-ref inputs "arm-patch"))))))
+                 '())
            (add-after
             'unpack 'add-lib-output-to-rpath
             (lambda _