From e214a22007450187c3db5d9fdef6ee021be6e953 Mon Sep 17 00:00:00 2001 From: Carl Dong Date: Wed, 11 Sep 2019 15:43:19 -0400 Subject: gnu: Add nsis-x86_64 and nsis-i686. * guix/build-system/scons.scm (scons-build): Add build-targets and install-targets parameters. * guix/build/scons-build-system.scm (build, install): Adjust accordingly. * doc/guix.texi (Build Systems): Document it. * gnu/packages/installers.scm: New file, (make-nsis): New procedure, (nsis-x86_64, nsis-i686): New variables. * gnu/packages/patches/nsis-env-passthru.patch: New file. * gnu/local.mk (dist_patch_DATA, GNU_SYSTEM_MODULES): Adjust accordingly. --- guix/build-system/scons.scm | 4 ++++ guix/build/scons-build-system.scm | 9 +++++---- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'guix') diff --git a/guix/build-system/scons.scm b/guix/build-system/scons.scm index 5e76d64180..aad455c419 100644 --- a/guix/build-system/scons.scm +++ b/guix/build-system/scons.scm @@ -76,7 +76,9 @@ (define* (scons-build store name inputs #:key (tests? #t) (scons-flags ''()) + (build-targets ''()) (test-target "test") + (install-targets ''("install")) (phases '(@ (guix build scons-build-system) %standard-phases)) (outputs '("out")) @@ -101,8 +103,10 @@ (define builder source)) #:scons-flags ,scons-flags #:system ,system + #:build-targets ,build-targets #:test-target ,test-target #:tests? ,tests? + #:install-targets ,install-targets #:phases ,phases #:outputs %outputs #:search-paths ',(map search-path-specification->sexp diff --git a/guix/build/scons-build-system.scm b/guix/build/scons-build-system.scm index eb013f03b6..17a0b7b877 100644 --- a/guix/build/scons-build-system.scm +++ b/guix/build/scons-build-system.scm @@ -29,7 +29,7 @@ (define-module (guix build scons-build-system) ;; ;; Code: -(define* (build #:key outputs (scons-flags '()) (parallel-build? #t) #:allow-other-keys) +(define* (build #:key outputs (build-targets '()) (scons-flags '()) (parallel-build? #t) #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) (mkdir-p out) (apply invoke "scons" @@ -37,7 +37,8 @@ (define* (build #:key outputs (scons-flags '()) (parallel-build? #t) #:allow-oth (list "-j" (number->string (parallel-job-count))) (list)) - scons-flags)))) + scons-flags + build-targets)))) (define* (check #:key tests? test-target (scons-flags '()) #:allow-other-keys) "Run the test suite of a given SCons application." @@ -46,9 +47,9 @@ (define* (check #:key tests? test-target (scons-flags '()) #:allow-other-keys) (format #t "test suite not run~%")) #t) -(define* (install #:key outputs (scons-flags '()) #:allow-other-keys) +(define* (install #:key outputs (install-targets '("install")) (scons-flags '()) #:allow-other-keys) "Install a given SCons application." - (apply invoke "scons" "install" scons-flags)) + (apply invoke "scons" (append scons-flags install-targets))) (define %standard-phases (modify-phases gnu:%standard-phases -- cgit v1.2.3 From f618134e4c518e87ea916d717eb25934a0fe7282 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 13 Oct 2019 23:07:56 +0200 Subject: build-system/gnu: 'package-with-explicit-inputs' uses 'package-mapping'. * guix/build-system/gnu.scm (package-with-explicit-inputs): Rename to... (package-with-explicit-inputs/deprecated): ... this. (package-with-explicit-inputs*): New procedure. (package-with-explicit-inputs): Define as a 'case-lambda*'. --- guix/build-system/gnu.scm | 59 +++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 52 insertions(+), 7 deletions(-) (limited to 'guix') diff --git a/guix/build-system/gnu.scm b/guix/build-system/gnu.scm index c9140074b7..3cc89f8852 100644 --- a/guix/build-system/gnu.scm +++ b/guix/build-system/gnu.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès +;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2019 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -57,12 +57,16 @@ (define %default-modules '((guix build gnu-build-system) (guix build utils))) -(define* (package-with-explicit-inputs p inputs - #:optional - (loc (current-source-location)) - #:key (native-inputs '()) - guile) - "Rewrite P, which is assumed to use GNU-BUILD-SYSTEM, to take INPUTS and +(define* (package-with-explicit-inputs/deprecated p inputs + #:optional + (loc (current-source-location)) + #:key (native-inputs '()) + guile) + "This variant is deprecated because it is inefficient: it memoizes only +temporarily instead of memoizing across all transformations where INPUTS is +the same. + +Rewrite P, which is assumed to use GNU-BUILD-SYSTEM, to take INPUTS and NATIVE-INPUTS as explicit inputs instead of the implicit default, and return it. INPUTS and NATIVE-INPUTS can be either input lists or thunks; in the latter case, they will be called in a context where the `%current-system' and @@ -124,6 +128,47 @@ (define rewritten-input ,@(map rewritten-input (filtered (package-inputs p))))))))) +(define* (package-with-explicit-inputs* inputs #:optional guile) + "Return a procedure that rewrites the given package and all its dependencies +so that they use INPUTS (a thunk) instead of implicit inputs." + (define (duplicate-filter package-inputs) + (let ((names (match (inputs) + (((name _ ...) ...) + name)))) + (fold alist-delete package-inputs names))) + + (define (add-explicit-inputs p) + (if (and (eq? (package-build-system p) gnu-build-system) + (not (memq #:implicit-inputs? (package-arguments p)))) + (package + (inherit p) + (inputs (append (inputs) + (duplicate-filter (package-inputs p)))) + (arguments + (ensure-keyword-arguments (package-arguments p) + `(#:implicit-inputs? #f + #:guile ,guile)))) + p)) + + (define (cut? p) + (and (eq? (package-build-system p) gnu-build-system) + (memq #:implicit-inputs? (package-arguments p)))) + + (package-mapping add-explicit-inputs cut?)) + +(define package-with-explicit-inputs + (case-lambda* + ((inputs #:optional guile) + (package-with-explicit-inputs* inputs guile)) + ((p inputs #:optional (loc (current-source-location)) + #:key (native-inputs '()) guile) + ;; deprecated + (package-with-explicit-inputs/deprecated p inputs + loc + #:native-inputs + native-inputs + #:guile guile)))) + (define (package-with-extra-configure-variable p variable value) "Return a version of P with VARIABLE=VALUE specified as an extra `configure' flag, recursively. An example is LDFLAGS=-static. If P already has configure -- cgit v1.2.3 From 396b05f04ed5c5ad6141bd1b4f70f51561a97aad Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Sun, 18 Aug 2019 11:00:23 +0200 Subject: gexp: Use cross extensions when cross-compiling. * guix/gexp.scm (load-path-expression): Use ungexp-splicing instead of ungexp-native-splicing so that the cross extensions are used when target is set. --- guix/gexp.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guix') diff --git a/guix/gexp.scm b/guix/gexp.scm index 600750e846..7323277511 100644 --- a/guix/gexp.scm +++ b/guix/gexp.scm @@ -1508,7 +1508,7 @@ (define* (load-path-expression modules #:optional (path %load-path) (gexp (eval-when (expand load eval) ;; Augment the load paths and delete duplicates. Do that ;; without loading (srfi srfi-1) or anything. - (let ((extensions '((ungexp-native-splicing extensions))) + (let ((extensions '((ungexp-splicing extensions))) (prepend (lambda (items lst) ;; This is O(N²) but N is typically small. (let loop ((items items) -- cgit v1.2.3