summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
Diffstat (limited to 'guix')
-rw-r--r--guix/build/ant-build-system.scm15
-rw-r--r--guix/build/cargo-build-system.scm15
-rw-r--r--guix/build/cargo-utils.scm16
3 files changed, 28 insertions, 18 deletions
diff --git a/guix/build/ant-build-system.scm b/guix/build/ant-build-system.scm
index 49549c1b4b..fae1b47ec5 100644
--- a/guix/build/ant-build-system.scm
+++ b/guix/build/ant-build-system.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2016, 2018 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2019 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -171,6 +172,12 @@ to the default GNU unpack strategy."
#:allow-other-keys)
(apply invoke `("ant" ,build-target ,@make-flags)))
+(define (regular-jar-file-predicate file stat)
+ "Predicate returning true if FILE is ending on '.jar'
+and STAT indicates it is a regular file."
+ (and ((file-name-predicate "\\.jar$") file stat)
+ (eq? 'regular (stat:type stat))))
+
(define* (generate-jar-indices #:key outputs #:allow-other-keys)
"Generate file \"META-INF/INDEX.LIST\". This file does not use word wraps
and is preferred over \"META-INF/MANIFEST.MF\", which does use word wraps,
@@ -181,7 +188,10 @@ dependencies of this jar file."
(invoke "jar" "-i" jar))
(for-each (match-lambda
((output . directory)
- (for-each generate-index (find-files directory "\\.jar$"))))
+ (for-each generate-index
+ (find-files
+ directory
+ regular-jar-file-predicate))))
outputs)
#t)
@@ -222,7 +232,8 @@ repack them. This is necessary to ensure that archives are reproducible."
(for-each (match-lambda
((output . directory)
- (for-each repack-archive (find-files directory "\\.jar$"))))
+ (for-each repack-archive
+ (find-files directory regular-jar-file-predicate))))
outputs)
#t)
diff --git a/guix/build/cargo-build-system.scm b/guix/build/cargo-build-system.scm
index 4be5443083..8a8d74ee1b 100644
--- a/guix/build/cargo-build-system.scm
+++ b/guix/build/cargo-build-system.scm
@@ -40,21 +40,6 @@
;;
;; Code:
-;; TODO: Move this to (guix build cargo-utils). Will cause a full rebuild
-;; of all rust compilers.
-
-(define (generate-all-checksums dir-name)
- (for-each
- (lambda (filename)
- (let* ((dir (dirname filename))
- (checksum-file (string-append dir "/.cargo-checksum.json")))
- (when (file-exists? checksum-file) (delete-file checksum-file))
- (display (string-append
- "patch-cargo-checksums: generate-checksums for "
- dir "\n"))
- (generate-checksums dir)))
- (find-files dir-name "Cargo.toml$")))
-
(define (manifest-targets)
"Extract all targets from the Cargo.toml manifest"
(let* ((port (open-input-pipe "cargo read-manifest"))
diff --git a/guix/build/cargo-utils.scm b/guix/build/cargo-utils.scm
index 79e5440378..5ac429a62a 100644
--- a/guix/build/cargo-utils.scm
+++ b/guix/build/cargo-utils.scm
@@ -2,6 +2,7 @@
;;; Copyright © 2016 David Craven <david@craven.ch>
;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
;;; Copyright © 2019 Ivan Petkov <ivanppetkov@gmail.com>
+;;; Copyright © 2019 Efraim Flashner <efraim@flashner.co.il>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -22,7 +23,8 @@
#:use-module (guix build utils)
#:use-module (ice-9 popen)
#:use-module (ice-9 rdelim)
- #:export (generate-checksums))
+ #:export (generate-checksums
+ generate-all-checksums))
;; Commentary:
;;
@@ -66,3 +68,15 @@ the same directory."
(display "},\"package\":" port)
(write (file-sha256 "/dev/null") port)
(display "}" port)))))
+
+(define (generate-all-checksums dir-name)
+ (for-each
+ (lambda (filename)
+ (let* ((dir (dirname filename))
+ (checksum-file (string-append dir "/.cargo-checksum.json")))
+ (when (file-exists? checksum-file) (delete-file checksum-file))
+ (display (string-append
+ "patch-cargo-checksums: generate-checksums for "
+ dir "\n"))
+ (generate-checksums dir)))
+ (find-files dir-name "Cargo.toml$")))