aboutsummaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2020-04-03 22:15:27 +0200
committerLudovic Courtès <ludo@gnu.org>2020-04-03 23:09:59 +0200
commitb256d136199b6e2a53ee547b9239e689697c017f (patch)
tree918ee76fb4d98338c8e3321d8e68806de260e365 /gnu
parentf7b5b8cd45b4560b3473dde2e6f6f20b4ff9daff (diff)
downloadpatches-b256d136199b6e2a53ee547b9239e689697c017f.tar
patches-b256d136199b6e2a53ee547b9239e689697c017f.tar.gz
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'.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/cross-base.scm24
1 files changed, 11 insertions, 13 deletions
diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm
index add1a6fe91..bdf91a80fd 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 <ludo@gnu.org>
+;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2020 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2014, 2015, 2018 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2016, 2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2016 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
@@ -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