diff options
author | Marius Bakke <marius@gnu.org> | 2020-10-13 23:39:27 +0200 |
---|---|---|
committer | Marius Bakke <marius@gnu.org> | 2020-10-13 23:39:27 +0200 |
commit | f7175626ffce578be1bc6df4916a129f86557872 (patch) | |
tree | 2eb0040522f2883764b3e09dc36595d68eeb14c1 /guix/build | |
parent | 2b6ecdf41a09ab9ecae06d7c537583a2f0f28efc (diff) | |
parent | e8c5533d26b4441c96e9ae92350efcb24d787c4b (diff) |
Merge branch 'master' into staging
Diffstat (limited to 'guix/build')
-rw-r--r-- | guix/build/cargo-build-system.scm | 8 | ||||
-rw-r--r-- | guix/build/hg.scm | 44 | ||||
-rw-r--r-- | guix/build/svn.scm | 38 |
3 files changed, 56 insertions, 34 deletions
diff --git a/guix/build/cargo-build-system.scm b/guix/build/cargo-build-system.scm index 95e8dd772a..117c8da66c 100644 --- a/guix/build/cargo-build-system.scm +++ b/guix/build/cargo-build-system.scm @@ -173,7 +173,13 @@ directory = '" port) (or skip-build? (not (has-executable-target?)) (invoke "cargo" "install" "--path" "." "--root" out - "--features" (string-join features))))) + "--features" (string-join features))) + + ;; This is a file which we definitely don't need installed. + (when (file-exists? (string-append out "/.crates.toml")) + (delete-file (string-append out "/.crates.toml"))) + + #t)) (define %standard-phases (modify-phases gnu:%standard-phases diff --git a/guix/build/hg.scm b/guix/build/hg.scm index b3e3ff7ac3..0ffad7fa2d 100644 --- a/guix/build/hg.scm +++ b/guix/build/hg.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net> ;;; Copyright © 2018 Mark H Weaver <mhw@netris.org> ;;; Copyright © 2018 Björn Höfling <bjoern.hoefling@bjoernhoefling.de> +;;; Copyright © 2020 Simon Tournier <zimon.toutoune@gmail.com> ;;; ;;; This file is part of GNU Guix. ;;; @@ -20,6 +21,8 @@ (define-module (guix build hg) #:use-module (guix build utils) + #:use-module (srfi srfi-34) + #:use-module (ice-9 format) #:export (hg-fetch)) ;;; Commentary: @@ -35,22 +38,29 @@ "Fetch CHANGESET from URL into DIRECTORY. CHANGESET must be a valid Mercurial changeset identifier. Return #t on success, #f otherwise." - (invoke hg-command - "clone" url - "--rev" changeset - ;; Disable TLS certificate verification. The hash of - ;; the checkout is known in advance anyway. - "--insecure" - directory) - - ;; The contents of '.hg' vary as a function of the current - ;; status of the Mercurial repo. Since we want a fixed - ;; output, this directory needs to be taken out. - ;; Since the '.hg' file is also in sub-modules, we have to - ;; search for it in all sub-directories. - (for-each delete-file-recursively - (find-files directory "^\\.hg$" #:directories? #t)) - - #t) + (mkdir-p directory) + + (guard (c ((invoke-error? c) + (report-invoke-error c) + (delete-file-recursively directory) + #f)) + (with-directory-excursion directory + (invoke hg-command + "clone" url + "--rev" changeset + ;; Disable TLS certificate verification. The hash of + ;; the checkout is known in advance anyway. + "--insecure" + directory) + + ;; The contents of '.hg' vary as a function of the current + ;; status of the Mercurial repo. Since we want a fixed + ;; output, this directory needs to be taken out. + ;; Since the '.hg' file is also in sub-modules, we have to + ;; search for it in all sub-directories. + (for-each delete-file-recursively + (find-files directory "^\\.hg$" #:directories? #t)) + + #t))) ;;; hg.scm ends here diff --git a/guix/build/svn.scm b/guix/build/svn.scm index 33783f3056..44d77a968f 100644 --- a/guix/build/svn.scm +++ b/guix/build/svn.scm @@ -1,7 +1,8 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2014 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2014, 2020 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2014 Sree Harsha Totakura <sreeharsha@totakura.in> ;;; Copyright © 2018 Mark H Weaver <mhw@netris.org> +;;; Copyright © 2020 Simon Tournier <zimon.toutoune@gmail.com> ;;; ;;; This file is part of GNU Guix. ;;; @@ -20,6 +21,8 @@ (define-module (guix build svn) #:use-module (guix build utils) + #:use-module (srfi srfi-34) + #:use-module (ice-9 format) #:export (svn-fetch)) ;;; Commentary: @@ -36,20 +39,23 @@ (password #f)) "Fetch REVISION from URL into DIRECTORY. REVISION must be an integer, and a valid Subversion revision. Return #t on success, #f otherwise." - (apply invoke svn-command - "export" "--non-interactive" - ;; Trust the server certificate. This is OK as we - ;; verify the checksum later. This can be removed when - ;; ca-certificates package is added. - "--trust-server-cert" "-r" (number->string revision) - `(,@(if (and user-name password) - (list (string-append "--username=" user-name) - (string-append "--password=" password)) - '()) - ,@(if recursive? - '() - (list "--ignore-externals")) - ,url ,directory)) - #t) + (guard (c ((invoke-error? c) + (report-invoke-error c) + #f)) + (apply invoke svn-command + "export" "--non-interactive" + ;; Trust the server certificate. This is OK as we + ;; verify the checksum later. This can be removed when + ;; ca-certificates package is added. + "--trust-server-cert" "-r" (number->string revision) + `(,@(if (and user-name password) + (list (string-append "--username=" user-name) + (string-append "--password=" password)) + '()) + ,@(if recursive? + '() + (list "--ignore-externals")) + ,url ,directory)) + #t)) ;;; svn.scm ends here |