guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/02: gnu: cross-base: Add 'package-with-patches'.


From: guix-commits
Subject: 02/02: gnu: cross-base: Add 'package-with-patches'.
Date: Fri, 3 Apr 2020 17:10:42 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit b256d136199b6e2a53ee547b9239e689697c017f
Author: Ludovic Courtès <address@hidden>
AuthorDate: Fri Apr 3 22:15:27 2020 +0200

    gnu: cross-base: Add 'package-with-patches'.
    
    This is a followup to c1c50cb5b099897a18e4cd8c27970cb45a7c3a94.
    
    * gnu/packages/cross-base.scm (package-with-patch): Rename to...
    (package-with-patches): ... this, and take a list of patches.
    (package-with-extra-patches): Use it.
    (cross-binutils): Use 'search-patches' instead of 'search-patch'.
---
 gnu/packages/cross-base.scm | 24 +++++++++++-------------
 1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm
index add1a6f..bdf91a8 100644
--- a/gnu/packages/cross-base.scm
+++ b/gnu/packages/cross-base.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès 
<address@hidden>
+;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2020 Ludovic Courtès 
<address@hidden>
 ;;; Copyright © 2014, 2015, 2018 Mark H Weaver <address@hidden>
 ;;; Copyright © 2016, 2019 Jan (janneke) Nieuwenhuizen <address@hidden>
 ;;; Copyright © 2016 Manolis Fragkiskos Ragkousis <address@hidden>
@@ -70,19 +70,17 @@
         `(cons ,(string-append "--target=" target)
                ,flags))))))
 
-(define (package-with-patch original patch)
-  "Return package ORIGINAL with PATCH applied."
+(define (package-with-patches original patches)
+  "Return package ORIGINAL with PATCHES applied."
   (package (inherit original)
     (source (origin (inherit (package-source original))
-              (patches (list patch))))))
+                    (patches patches)))))
 
-(define (package-with-extra-patches original extra-patches)
+(define (package-with-extra-patches original patches)
   "Return package ORIGINAL with all PATCHES appended to its list of patches."
-  (let ((original-origin (package-source original)))
-    (package (inherit original)
-      (source (origin (inherit original-origin)
-                (patches `(,@extra-patches
-                           ,@(origin-patches original-origin))))))))
+  (package-with-patches original
+                        (append (origin-patches (package-source original))
+                                patches)))
 
 (define (cross-binutils target)
   "Return a cross-Binutils for TARGET."
@@ -106,9 +104,9 @@
 
     ;; For Xtensa, apply Qualcomm's patch.
     (cross (cond ((string-prefix? "xtensa-" target)
-                  (package-with-patch binutils
-                                      (search-patch
-                                       "ath9k-htc-firmware-binutils.patch")))
+                  (package-with-patches binutils
+                                        (search-patches
+                                         "ath9k-htc-firmware-binutils.patch")))
                  ((target-mingw? target)
                   (package-with-extra-patches
                    binutils



reply via email to

[Prev in Thread] Current Thread [Next in Thread]