diff options
author | Marius Bakke <marius@gnu.org> | 2020-06-13 22:52:25 +0200 |
---|---|---|
committer | Marius Bakke <marius@gnu.org> | 2020-06-13 22:52:25 +0200 |
commit | 8ab70bae52f8d4b6356ec3b8a88cebf9debe8520 (patch) | |
tree | 6e13e1de3c9addac9dad5d9f194c229baa3b59ab /guix | |
parent | 9bc516bada71e1437d73971584bff5e72e053dbe (diff) | |
parent | 8ea91d05b0fd16a8dd42a53efee9b16991d581b9 (diff) |
Merge branch 'staging'
Diffstat (limited to 'guix')
-rw-r--r-- | guix/build-system/cargo.scm | 3 | ||||
-rw-r--r-- | guix/build-system/go.scm | 3 | ||||
-rw-r--r-- | guix/build/cargo-build-system.scm | 13 | ||||
-rw-r--r-- | guix/build/go-build-system.scm | 7 |
4 files changed, 19 insertions, 7 deletions
diff --git a/guix/build-system/cargo.scm b/guix/build-system/cargo.scm index 1e8b3a578e..6c8edf6bac 100644 --- a/guix/build-system/cargo.scm +++ b/guix/build-system/cargo.scm @@ -4,6 +4,7 @@ ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org> ;;; Copyright © 2016 David Craven <david@craven.ch> ;;; Copyright © 2019 Ivan Petkov <ivanppetkov@gmail.com> +;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net> ;;; ;;; This file is part of GNU Guix. ;;; @@ -76,6 +77,7 @@ to NAME and VERSION." (vendor-dir "guix-vendor") (cargo-build-flags ''("--release")) (cargo-test-flags ''("--release")) + (features ''()) (skip-build? #f) (phases '(@ (guix build cargo-build-system) %standard-phases)) @@ -104,6 +106,7 @@ to NAME and VERSION." #:vendor-dir ,vendor-dir #:cargo-build-flags ,cargo-build-flags #:cargo-test-flags ,cargo-test-flags + #:features ,features #:skip-build? ,skip-build? #:tests? ,(and tests? (not skip-build?)) #:phases ,phases diff --git a/guix/build-system/go.scm b/guix/build-system/go.scm index 1b916af8f9..f8ebaefb27 100644 --- a/guix/build-system/go.scm +++ b/guix/build-system/go.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2016 Petter <petter@mykolab.ch> ;;; Copyright © 2017 Leo Famulari <leo@famulari.name> +;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net> ;;; ;;; This file is part of GNU Guix. ;;; @@ -82,6 +83,7 @@ (install-source? #t) (import-path "") (unpack-path "") + (build-flags ''()) (tests? #t) (allow-go-reference? #f) (system (%current-system)) @@ -109,6 +111,7 @@ #:install-source? ,install-source? #:import-path ,import-path #:unpack-path ,unpack-path + #:build-flags ,build-flags #:tests? ,tests? #:allow-go-reference? ,allow-go-reference? #:inputs %build-inputs))) diff --git a/guix/build/cargo-build-system.scm b/guix/build/cargo-build-system.scm index 0721989589..95e8dd772a 100644 --- a/guix/build/cargo-build-system.scm +++ b/guix/build/cargo-build-system.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com> ;;; Copyright © 2019 Ivan Petkov <ivanppetkov@gmail.com> ;;; Copyright © 2019, 2020 Efraim Flashner <efraim@flashner.co.il> +;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net> ;;; ;;; This file is part of GNU Guix. ;;; @@ -140,11 +141,14 @@ directory = '" port) (define* (build #:key skip-build? + features (cargo-build-flags '("--release")) #:allow-other-keys) "Build a given Cargo package." (or skip-build? - (apply invoke `("cargo" "build" ,@cargo-build-flags)))) + (apply invoke "cargo" "build" + "--features" (string-join features) + cargo-build-flags))) (define* (check #:key tests? @@ -152,10 +156,10 @@ directory = '" port) #:allow-other-keys) "Run tests for a given Cargo package." (if tests? - (apply invoke `("cargo" "test" ,@cargo-test-flags)) + (apply invoke "cargo" "test" cargo-test-flags) #t)) -(define* (install #:key inputs outputs skip-build? #:allow-other-keys) +(define* (install #:key inputs outputs skip-build? features #:allow-other-keys) "Install a given Cargo package." (let* ((out (assoc-ref outputs "out"))) (mkdir-p out) @@ -168,7 +172,8 @@ directory = '" port) ;; otherwise cargo will raise an error. (or skip-build? (not (has-executable-target?)) - (invoke "cargo" "install" "--path" "." "--root" out)))) + (invoke "cargo" "install" "--path" "." "--root" out + "--features" (string-join features))))) (define %standard-phases (modify-phases gnu:%standard-phases diff --git a/guix/build/go-build-system.scm b/guix/build/go-build-system.scm index 0d15f978cd..b9cb2bfd7b 100644 --- a/guix/build/go-build-system.scm +++ b/guix/build/go-build-system.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2017, 2019 Leo Famulari <leo@famulari.name> ;;; Copyright © 2019 Maxim Cournoyer <maxim.cournoyer@gmail.com> ;;; Copyright © 2020 Jack Hill <jackhill@jackhill.us> +;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net> ;;; ;;; This file is part of GNU Guix. ;;; @@ -214,18 +215,18 @@ unpacking." (_ #f)) inputs)))) -(define* (build #:key import-path #:allow-other-keys) +(define* (build #:key import-path build-flags #:allow-other-keys) "Build the package named by IMPORT-PATH." (with-throw-handler #t (lambda _ - (invoke "go" "install" + (apply invoke "go" "install" "-v" ; print the name of packages as they are compiled "-x" ; print each command as it is invoked ;; Respectively, strip the symbol table and debug ;; information, and the DWARF symbol table. "-ldflags=-s -w" - import-path)) + `(,@build-flags ,import-path))) (lambda (key . args) (display (string-append "Building '" import-path "' failed.\n" "Here are the results of `go env`:\n")) |