From 927c2518465579d48315e8e6b5102097c146fece Mon Sep 17 00:00:00 2001 From: Jakub Kądziołka Date: Fri, 6 Mar 2020 22:34:53 +0100 Subject: cargo-build-system: Accept a #:features argument * guix/build/cargo-build-system.scm (build, install): Pass the features to cargo. (check): Remove indirection layer for consistency with build and install. * guix/build-system/cargo.scm (cargo-build): New argument; pass it into the builder. * gnu/packages/rust-apps.scm (ripgrep): Use the new argument instead of a custom phase. --- guix/build-system/cargo.scm | 3 +++ 1 file changed, 3 insertions(+) (limited to 'guix/build-system') 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 ;;; Copyright © 2016 David Craven ;;; Copyright © 2019 Ivan Petkov +;;; Copyright © 2020 Jakub Kądziołka ;;; ;;; 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 -- cgit v1.2.3 From 3f3c9fdcd8cff2e761a2768b175b63b3c09ef4e3 Mon Sep 17 00:00:00 2001 From: Jakub Kądziołka Date: Sun, 5 Jan 2020 17:13:20 +0100 Subject: build-system/go: Allow providing additional build flags * guix/build-system/go.scm (build-flags): New argument. * guix/build/go-build-system.scm (build): Use apply to pass the additional arguments to invoke. --- guix/build-system/go.scm | 3 +++ guix/build/go-build-system.scm | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'guix/build-system') 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 ;;; Copyright © 2017 Leo Famulari +;;; Copyright © 2020 Jakub Kądziołka ;;; ;;; 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/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 ;;; Copyright © 2019 Maxim Cournoyer ;;; Copyright © 2020 Jack Hill +;;; Copyright © 2020 Jakub Kądziołka ;;; ;;; 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")) -- cgit v1.2.3