From b256d136199b6e2a53ee547b9239e689697c017f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Fri, 3 Apr 2020 22:15:27 +0200 Subject: 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 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 +;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2020 Ludovic Courtès ;;; Copyright © 2014, 2015, 2018 Mark H Weaver ;;; Copyright © 2016, 2019 Jan (janneke) Nieuwenhuizen ;;; Copyright © 2016 Manolis Fragkiskos Ragkousis @@ -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 -- cgit v1.2.3