From b3bd47569637702652c2e7da0ddee8e879b52d71 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Mon, 9 Mar 2020 14:38:18 +0100 Subject: gnu: cross-libc: Build fix for the Hurd. This fixes cross building of coreutils, e.g. ./pre-inst-env guix build --target=i586-pc-gnu coreutils * gnu/packages/cross-base.scm (cross-libc): Add -lhurduser, -lmachuser for the Hurd. --- gnu/packages/cross-base.scm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'gnu/packages/cross-base.scm') diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm index 13237fb8a8..ab866eebc6 100644 --- a/gnu/packages/cross-base.scm +++ b/gnu/packages/cross-base.scm @@ -491,7 +491,17 @@ and the cross tool chain." ',%gcc-cross-include-paths) (setenv "CROSS_LIBRARY_PATH" (string-append kernel "/lib")) ; for Hurd's libihash - #t))))))) + #t))) + ,@(if (hurd-triplet? target) + '((add-after 'install 'augment-libc.so + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out"))) + (substitute* (string-append out "/lib/libc.so") + (("/[^ ]+/lib/libc.so.0.3") + (string-append out "/lib/libc.so.0.3" + " libmachuser.so libhurduser.so")))) + #t))) + '()))))) ;; Shadow the native "kernel-headers" because glibc's recipe expects the ;; "kernel-headers" input to point to the right thing. -- cgit v1.2.3 From 79825bee07fceb781efc40a8c56a85aac13bba5a Mon Sep 17 00:00:00 2001 From: Carl Dong Date: Tue, 24 Mar 2020 15:39:06 -0400 Subject: gnu: cross-base: Add mingw-w64 specific binutils patches. These patches were originally found at the debian mingw-w64 team's binutils repo, and should improve the reproducibility of our mingw-w64 toolchain. * gnu/packages/patches/binutils-mingw-w64-reproducible-import-libraries.patch: New file. * gnu/packages/patches/binutils-mingw-w64-specify-timestamp.patch: New file. * gnu/local.mk (dist_patch_DATA): Update accordingly. * gnu/packages/cross-base.scm (cross-binutils): Apply relevant patches if target is mingw-w64. (package-with-extra-patches): New procedure. --- gnu/local.mk | 2 + gnu/packages/cross-base.scm | 22 +++- ...s-mingw-w64-reproducible-import-libraries.patch | 22 ++++ .../binutils-mingw-w64-specify-timestamp.patch | 137 +++++++++++++++++++++ 4 files changed, 178 insertions(+), 5 deletions(-) create mode 100755 gnu/packages/patches/binutils-mingw-w64-reproducible-import-libraries.patch create mode 100755 gnu/packages/patches/binutils-mingw-w64-specify-timestamp.patch (limited to 'gnu/packages/cross-base.scm') diff --git a/gnu/local.mk b/gnu/local.mk index cf588e5948..dd0169a969 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -770,6 +770,8 @@ dist_patch_DATA = \ %D%/packages/patches/bidiv-update-fribidi.patch \ %D%/packages/patches/binutils-boot-2.20.1a.patch \ %D%/packages/patches/binutils-loongson-workaround.patch \ + %D%/packages/patches/binutils-mingw-w64-specify-timestamp.patch \ + %D%/packages/patches/binutils-mingw-w64-reproducible-import-libraries.patch \ %D%/packages/patches/blender-2.79-newer-ffmpeg.patch \ %D%/packages/patches/blender-2.79-python-3.7-fix.patch \ %D%/packages/patches/bluez-CVE-2020-0556.patch \ diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm index ab866eebc6..945ef12088 100644 --- a/gnu/packages/cross-base.scm +++ b/gnu/packages/cross-base.scm @@ -76,6 +76,12 @@ (source (origin (inherit (package-source original)) (patches (list patch)))))) +(define (package-with-extra-patches original patches) + "Return package ORIGINAL with all PATCHES appended to its list of patches." + (package-with-patch original + `(,@(origin-patches (package-source original)) + ,@patches)) + (define (cross-binutils target) "Return a cross-Binutils for TARGET." (let ((binutils (package (inherit binutils) @@ -97,11 +103,17 @@ `(cons "--with-sysroot=/" ,flags))))))) ;; For Xtensa, apply Qualcomm's patch. - (cross (if (string-prefix? "xtensa-" target) - (package-with-patch binutils - (search-patch - "ath9k-htc-firmware-binutils.patch")) - binutils) + (cross (cond ((string-prefix? "xtensa-" target) + (package-with-patch binutils + (search-patch + "ath9k-htc-firmware-binutils.patch"))) + ((target-mingw? target) + (package-with-extra-patches + binutils + (search-patches + "binutils-mingw-w64-specify-timestamp.patch" + "binutils-mingw-w64-reproducible-import-libraries.patch"))) + (else binutils)) target))) (define (cross-gcc-arguments target xgcc libc) diff --git a/gnu/packages/patches/binutils-mingw-w64-reproducible-import-libraries.patch b/gnu/packages/patches/binutils-mingw-w64-reproducible-import-libraries.patch new file mode 100755 index 0000000000..3e48b87935 --- /dev/null +++ b/gnu/packages/patches/binutils-mingw-w64-reproducible-import-libraries.patch @@ -0,0 +1,22 @@ +This following patch was originally found at the debian mingw-w64 team's +binutils repo located here: +https://salsa.debian.org/mingw-w64-team/binutils-mingw-w64.git + +Invoke the following in the aforementioned repo to see the original patch: + + $ git show da63f6b:debian/patches/reproducible-import-libraries.patch + +Description: Make DLL import libraries reproducible +Author: Benjamin Moody +Bug-Debian: https://bugs.debian.org/915055 + +--- a/ld/pe-dll.c ++++ b/ld/pe-dll.c +@@ -2844,6 +2844,7 @@ + + bfd_set_format (outarch, bfd_archive); + outarch->has_armap = 1; ++ outarch->flags |= BFD_DETERMINISTIC_OUTPUT; + + /* Work out a reasonable size of things to put onto one line. */ + ar_head = make_head (outarch); diff --git a/gnu/packages/patches/binutils-mingw-w64-specify-timestamp.patch b/gnu/packages/patches/binutils-mingw-w64-specify-timestamp.patch new file mode 100755 index 0000000000..b785043b62 --- /dev/null +++ b/gnu/packages/patches/binutils-mingw-w64-specify-timestamp.patch @@ -0,0 +1,137 @@ +This following patch was originally found at the debian mingw-w64 team's +binutils repo located here: +https://salsa.debian.org/mingw-w64-team/binutils-mingw-w64.git + +Invoke the following in the aforementioned repo to see the original patch: + + $ git show da63f6b:debian/patches/specify-timestamp.patch + +Description: Allow the PE timestamp to be specified +Author: Stephen Kitt + +--- a/bfd/peXXigen.c ++++ b/bfd/peXXigen.c +@@ -70,6 +70,9 @@ + #include + #endif + ++#include ++#include ++ + /* NOTE: it's strange to be including an architecture specific header + in what's supposed to be general (to PE/PEI) code. However, that's + where the definitions are, and they don't vary per architecture +@@ -879,10 +882,38 @@ + + /* Use a real timestamp by default, unless the no-insert-timestamp + option was chosen. */ +- if ((pe_data (abfd)->insert_timestamp)) +- H_PUT_32 (abfd, time (0), filehdr_out->f_timdat); +- else ++ if (pe_data (abfd)->insert_timestamp) { ++ time_t now; ++ char *source_date_epoch; ++ unsigned long long epoch; ++ char *endptr; ++ ++ now = time(NULL); ++ source_date_epoch = getenv("SOURCE_DATE_EPOCH"); ++ if (source_date_epoch) { ++ errno = 0; ++ epoch = strtoull(source_date_epoch, &endptr, 10); ++ if ((errno == ERANGE && (epoch == ULLONG_MAX || epoch == 0)) ++ || (errno != 0 && epoch == 0)) { ++ _bfd_error_handler("Environment variable $SOURCE_DATE_EPOCH: strtoull: %s\n", ++ strerror(errno)); ++ } else if (endptr == source_date_epoch) { ++ _bfd_error_handler("Environment variable $SOURCE_DATE_EPOCH: No digits were found: %s\n", ++ endptr); ++ } else if (*endptr != '\0') { ++ _bfd_error_handler("Environment variable $SOURCE_DATE_EPOCH: Trailing garbage: %s\n", ++ endptr); ++ } else if (epoch > ULONG_MAX) { ++ _bfd_error_handler("Environment variable $SOURCE_DATE_EPOCH: value must be smaller than or equal to: %lu but was found to be: %llu\n", ++ ULONG_MAX, epoch); ++ } else { ++ now = epoch; ++ } ++ } ++ H_PUT_32 (abfd, now, filehdr_out->f_timdat); ++ } else { + H_PUT_32 (abfd, 0, filehdr_out->f_timdat); ++ } + + PUT_FILEHDR_SYMPTR (abfd, filehdr_in->f_symptr, + filehdr_out->f_symptr); +--- a/ld/pe-dll.c ++++ b/ld/pe-dll.c +@@ -26,6 +26,8 @@ + #include "filenames.h" + #include "safe-ctype.h" + ++#include ++#include + #include + + #include "ld.h" +@@ -1202,8 +1204,36 @@ + + memset (edata_d, 0, edata_sz); + +- if (pe_data (abfd)->insert_timestamp) +- H_PUT_32 (abfd, time (0), edata_d + 4); ++ if (pe_data (abfd)->insert_timestamp) { ++ time_t now; ++ char *source_date_epoch; ++ unsigned long long epoch; ++ char *endptr; ++ ++ now = time(NULL); ++ source_date_epoch = getenv("SOURCE_DATE_EPOCH"); ++ if (source_date_epoch) { ++ errno = 0; ++ epoch = strtoull(source_date_epoch, &endptr, 10); ++ if ((errno == ERANGE && (epoch == ULLONG_MAX || epoch == 0)) ++ || (errno != 0 && epoch == 0)) { ++ einfo("Environment variable $SOURCE_DATE_EPOCH: strtoull: %s\n", ++ strerror(errno)); ++ } else if (endptr == source_date_epoch) { ++ einfo("Environment variable $SOURCE_DATE_EPOCH: No digits were found: %s\n", ++ endptr); ++ } else if (*endptr != '\0') { ++ einfo("Environment variable $SOURCE_DATE_EPOCH: Trailing garbage: %s\n", ++ endptr); ++ } else if (epoch > ULONG_MAX) { ++ einfo("Environment variable $SOURCE_DATE_EPOCH: value must be smaller than or equal to: %lu but was found to be: %llu\n", ++ ULONG_MAX, epoch); ++ } else { ++ now = epoch; ++ } ++ } ++ H_PUT_32 (abfd, now, edata_d + 4); ++ } + + if (pe_def_file->version_major != -1) + { +--- a/ld/emultempl/pe.em ++++ b/ld/emultempl/pe.em +@@ -303,7 +303,7 @@ + OPTION_USE_NUL_PREFIXED_IMPORT_TABLES}, + {"no-leading-underscore", no_argument, NULL, OPTION_NO_LEADING_UNDERSCORE}, + {"leading-underscore", no_argument, NULL, OPTION_LEADING_UNDERSCORE}, +- {"insert-timestamp", no_argument, NULL, OPTION_INSERT_TIMESTAMP}, ++ {"insert-timestamp", optional_argument, NULL, OPTION_INSERT_TIMESTAMP}, + {"no-insert-timestamp", no_argument, NULL, OPTION_NO_INSERT_TIMESTAMP}, + #ifdef DLL_SUPPORT + /* getopt allows abbreviations, so we do this to stop it +--- a/ld/emultempl/pep.em ++++ b/ld/emultempl/pep.em +@@ -321,7 +321,7 @@ + {"no-bind", no_argument, NULL, OPTION_NO_BIND}, + {"wdmdriver", no_argument, NULL, OPTION_WDM_DRIVER}, + {"tsaware", no_argument, NULL, OPTION_TERMINAL_SERVER_AWARE}, +- {"insert-timestamp", no_argument, NULL, OPTION_INSERT_TIMESTAMP}, ++ {"insert-timestamp", optional_argument, NULL, OPTION_INSERT_TIMESTAMP}, + {"no-insert-timestamp", no_argument, NULL, OPTION_NO_INSERT_TIMESTAMP}, + {"build-id", optional_argument, NULL, OPTION_BUILD_ID}, + {NULL, no_argument, NULL, 0} -- cgit v1.2.3 From 401d28e4334dc1b9bb77af3aca6c53364dd51e1b Mon Sep 17 00:00:00 2001 From: Carl Dong Date: Thu, 2 Apr 2020 18:08:33 -0400 Subject: gnu: cross-base: Hotfix for paren * gnu/packages/cross-base.scm (package-with-extra-patches): Add trailing paren. --- gnu/packages/cross-base.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnu/packages/cross-base.scm') diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm index 945ef12088..dc63dc9462 100644 --- a/gnu/packages/cross-base.scm +++ b/gnu/packages/cross-base.scm @@ -80,7 +80,7 @@ "Return package ORIGINAL with all PATCHES appended to its list of patches." (package-with-patch original `(,@(origin-patches (package-source original)) - ,@patches)) + ,@patches))) (define (cross-binutils target) "Return a cross-Binutils for TARGET." -- cgit v1.2.3 From c1c50cb5b099897a18e4cd8c27970cb45a7c3a94 Mon Sep 17 00:00:00 2001 From: Carl Dong Date: Fri, 3 Apr 2020 13:46:17 -0400 Subject: gnu: cross-base: Fix PACKAGE-WITH-EXTRA-PATCHES This also removes the execute bit from the patches added. Not sure how or why those were set in the first place. * gnu/packages/cross-base.scm (package-with-extra-patches): Imitate PACKAGE-WITH-PATCH instead of using it. * gnu/packages/patches/binutils-mingw-w64-reproducible-import-libraries.patch: Remove execute bit. * gnu/packages/patches/binutils-mingw-w64-specify-timestamp.patch: Remove execute bit. --- gnu/packages/cross-base.scm | 10 ++++++---- .../binutils-mingw-w64-reproducible-import-libraries.patch | 0 .../patches/binutils-mingw-w64-specify-timestamp.patch | 0 3 files changed, 6 insertions(+), 4 deletions(-) mode change 100755 => 100644 gnu/packages/patches/binutils-mingw-w64-reproducible-import-libraries.patch mode change 100755 => 100644 gnu/packages/patches/binutils-mingw-w64-specify-timestamp.patch (limited to 'gnu/packages/cross-base.scm') diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm index dc63dc9462..add1a6fe91 100644 --- a/gnu/packages/cross-base.scm +++ b/gnu/packages/cross-base.scm @@ -76,11 +76,13 @@ (source (origin (inherit (package-source original)) (patches (list patch)))))) -(define (package-with-extra-patches original patches) +(define (package-with-extra-patches original extra-patches) "Return package ORIGINAL with all PATCHES appended to its list of patches." - (package-with-patch original - `(,@(origin-patches (package-source original)) - ,@patches))) + (let ((original-origin (package-source original))) + (package (inherit original) + (source (origin (inherit original-origin) + (patches `(,@extra-patches + ,@(origin-patches original-origin)))))))) (define (cross-binutils target) "Return a cross-Binutils for TARGET." diff --git a/gnu/packages/patches/binutils-mingw-w64-reproducible-import-libraries.patch b/gnu/packages/patches/binutils-mingw-w64-reproducible-import-libraries.patch old mode 100755 new mode 100644 diff --git a/gnu/packages/patches/binutils-mingw-w64-specify-timestamp.patch b/gnu/packages/patches/binutils-mingw-w64-specify-timestamp.patch old mode 100755 new mode 100644 -- cgit v1.2.3 From b256d136199b6e2a53ee547b9239e689697c017f Mon Sep 17 00:00:00 2001 From: Ludovic Courtès 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(-) (limited to 'gnu/packages/cross-base.scm') 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 From 524a4e357cd71566841aaf405e8548fa3600b11b Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 4 Apr 2020 22:50:55 +0200 Subject: gnu: cross-base: Remove unneeded 'let'. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a followup to 102d307520dee27a40feb1ca5a699763a2f3aefe. * gnu/packages/cross-base.scm (cross-libc): Remove (let ((libc libc)) …). --- gnu/packages/cross-base.scm | 126 ++++++++++++++++++++++---------------------- 1 file changed, 63 insertions(+), 63 deletions(-) (limited to 'gnu/packages/cross-base.scm') diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm index bdf91a80fd..ae3ac210b7 100644 --- a/gnu/packages/cross-base.scm +++ b/gnu/packages/cross-base.scm @@ -469,69 +469,69 @@ and the cross tool chain." (native-libc target libc #:xgcc xgcc #:xbinutils xbinutils) - (let ((libc libc)) - (package (inherit libc) - (name (string-append "glibc-cross-" target)) - (arguments - (substitute-keyword-arguments - `(;; Disable stripping (see above.) - #:strip-binaries? #f - - ;; This package is used as a target input, but it should not have - ;; the usual cross-compilation inputs since that would include - ;; itself. - #:implicit-cross-inputs? #f - - ;; We need SRFI 26. - #:modules ((guix build gnu-build-system) - (guix build utils) - (srfi srfi-26)) - - ,@(package-arguments libc)) - ((#:configure-flags flags) - `(cons ,(string-append "--host=" target) - ,(if (hurd-triplet? target) - `(cons "--disable-werror" ,flags) - flags))) - ((#:phases phases) - `(modify-phases ,phases - (add-before 'configure 'set-cross-kernel-headers-path - (lambda* (#:key inputs #:allow-other-keys) - (let* ((kernel (assoc-ref inputs "kernel-headers")) - (cpath (string-append kernel "/include"))) - (for-each (cut setenv <> cpath) - ',%gcc-cross-include-paths) - (setenv "CROSS_LIBRARY_PATH" - (string-append kernel "/lib")) ; for Hurd's libihash - #t))) - ,@(if (hurd-triplet? target) - '((add-after 'install 'augment-libc.so - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out"))) - (substitute* (string-append out "/lib/libc.so") - (("/[^ ]+/lib/libc.so.0.3") - (string-append out "/lib/libc.so.0.3" - " libmachuser.so libhurduser.so")))) - #t))) - '()))))) - - ;; Shadow the native "kernel-headers" because glibc's recipe expects the - ;; "kernel-headers" input to point to the right thing. - (propagated-inputs `(("kernel-headers" ,xheaders))) - - ;; FIXME: 'static-bash' should really be an input, not a native input, but - ;; to do that will require building an intermediate cross libc. - (inputs '()) - - (native-inputs `(("cross-gcc" ,xgcc) - ("cross-binutils" ,xbinutils) - ,@(if (hurd-triplet? target) - `(("cross-mig" - ,@(assoc-ref (package-native-inputs xheaders) - "cross-mig"))) - '()) - ,@(package-inputs libc) ;FIXME: static-bash - ,@(package-native-inputs libc))))))) + (package + (inherit libc) + (name (string-append "glibc-cross-" target)) + (arguments + (substitute-keyword-arguments + `( ;; Disable stripping (see above.) + #:strip-binaries? #f + + ;; This package is used as a target input, but it should not have + ;; the usual cross-compilation inputs since that would include + ;; itself. + #:implicit-cross-inputs? #f + + ;; We need SRFI 26. + #:modules ((guix build gnu-build-system) + (guix build utils) + (srfi srfi-26)) + + ,@(package-arguments libc)) + ((#:configure-flags flags) + `(cons ,(string-append "--host=" target) + ,(if (hurd-triplet? target) + `(cons "--disable-werror" ,flags) + flags))) + ((#:phases phases) + `(modify-phases ,phases + (add-before 'configure 'set-cross-kernel-headers-path + (lambda* (#:key inputs #:allow-other-keys) + (let* ((kernel (assoc-ref inputs "kernel-headers")) + (cpath (string-append kernel "/include"))) + (for-each (cut setenv <> cpath) + ',%gcc-cross-include-paths) + (setenv "CROSS_LIBRARY_PATH" + (string-append kernel "/lib")) ; for Hurd's libihash + #t))) + ,@(if (hurd-triplet? target) + '((add-after 'install 'augment-libc.so + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out"))) + (substitute* (string-append out "/lib/libc.so") + (("/[^ ]+/lib/libc.so.0.3") + (string-append out "/lib/libc.so.0.3" + " libmachuser.so libhurduser.so")))) + #t))) + '()))))) + + ;; Shadow the native "kernel-headers" because glibc's recipe expects the + ;; "kernel-headers" input to point to the right thing. + (propagated-inputs `(("kernel-headers" ,xheaders))) + + ;; FIXME: 'static-bash' should really be an input, not a native input, but + ;; to do that will require building an intermediate cross libc. + (inputs '()) + + (native-inputs `(("cross-gcc" ,xgcc) + ("cross-binutils" ,xbinutils) + ,@(if (hurd-triplet? target) + `(("cross-mig" + ,@(assoc-ref (package-native-inputs xheaders) + "cross-mig"))) + '()) + ,@(package-inputs libc) ;FIXME: static-bash + ,@(package-native-inputs libc)))))) (define* (native-libc target #:optional -- cgit v1.2.3 From b066c25026f21fb57677aa34692a5034338e7ee3 Mon Sep 17 00:00:00 2001 From: Carl Dong Date: Mon, 6 Apr 2020 14:02:42 -0400 Subject: gnu: Move PACKAGES-WITH-*PATCHES to (guix packages) * gnu/packages/cross-base.scm (package-with-extra-patches, package-with-patches): Move procedures from here... * guix/packages.scm (package-with-extra-patches, package-with-patches): ...to here, and export. --- gnu/packages/cross-base.scm | 12 ------------ guix/packages.scm | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 12 deletions(-) (limited to 'gnu/packages/cross-base.scm') diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm index ae3ac210b7..b0eb7ab4ed 100644 --- a/gnu/packages/cross-base.scm +++ b/gnu/packages/cross-base.scm @@ -70,18 +70,6 @@ `(cons ,(string-append "--target=" target) ,flags)))))) -(define (package-with-patches original patches) - "Return package ORIGINAL with PATCHES applied." - (package (inherit original) - (source (origin (inherit (package-source original)) - (patches patches))))) - -(define (package-with-extra-patches original patches) - "Return package ORIGINAL with all PATCHES appended to its list of patches." - (package-with-patches original - (append (origin-patches (package-source original)) - patches))) - (define (cross-binutils target) "Return a cross-Binutils for TARGET." (let ((binutils (package (inherit binutils) diff --git a/guix/packages.scm b/guix/packages.scm index 04d9b7824c..6c6a06e0ce 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -111,6 +111,8 @@ package-output package-grafts package-patched-vulnerabilities + package-with-patches + package-with-extra-patches package/inherit transitive-input-references @@ -654,6 +656,18 @@ specifies modules in scope when evaluating SNIPPET." #:properties `((type . origin) (patches . ,(length patches))))))) +(define (package-with-patches original patches) + "Return package ORIGINAL with PATCHES applied." + (package (inherit original) + (source (origin (inherit (package-source original)) + (patches patches))))) + +(define (package-with-extra-patches original patches) + "Return package ORIGINAL with all PATCHES appended to its list of patches." + (package-with-patches original + (append (origin-patches (package-source original)) + patches))) + (define (transitive-inputs inputs) "Return the closure of INPUTS when considering the 'propagated-inputs' edges. Omit duplicate inputs, except for those already present in INPUTS -- cgit v1.2.3