From 7dee475589868bf16b2ad2ef93511be8efb2c77a Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Wed, 15 Jul 2020 10:26:35 +0300 Subject: build/cargo-utils: Use all allocated threads to generate checksums. * guix/build/cargo-utils.scm (generate-all-checksums): Use n-par-for-each instead of for-each when regenerating checksums for source crates. --- guix/build/cargo-utils.scm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'guix/build') diff --git a/guix/build/cargo-utils.scm b/guix/build/cargo-utils.scm index 5ac429a62a..7a3bb4b843 100644 --- a/guix/build/cargo-utils.scm +++ b/guix/build/cargo-utils.scm @@ -2,7 +2,7 @@ ;;; Copyright © 2016 David Craven ;;; Copyright © 2017 Mathieu Othacehe ;;; Copyright © 2019 Ivan Petkov -;;; Copyright © 2019 Efraim Flashner +;;; Copyright © 2019, 2020 Efraim Flashner ;;; ;;; This file is part of GNU Guix. ;;; @@ -23,6 +23,7 @@ #:use-module (guix build utils) #:use-module (ice-9 popen) #:use-module (ice-9 rdelim) + #:use-module (ice-9 threads) #:export (generate-checksums generate-all-checksums)) @@ -70,7 +71,7 @@ the same directory." (display "}" port))))) (define (generate-all-checksums dir-name) - (for-each + (n-par-for-each (parallel-job-count) (lambda (filename) (let* ((dir (dirname filename)) (checksum-file (string-append dir "/.cargo-checksum.json"))) -- cgit v1.2.3 From a13f45c1505fb4cf02dcbd3a80df90cc3edbb9ca Mon Sep 17 00:00:00 2001 From: Guillaume Le Vaillant Date: Mon, 7 Sep 2020 14:57:57 +0200 Subject: build-system: asdf: Switch from bundles to regular compilation. * gnu/packages/lisp.scm (sbcl, ecl)[native-search-paths]: Add 'XDG_CONFIG_DIRS'. * guix/build-system/asdf.scm (asdf-build): Replace 'asd-file' and 'asd-system-name' keywords by 'asd-files' and 'asd-systems'. * guix/build/asdf-build-system.scm (%object-prefix, %lisp-source-install-prefix): Update variables. (install): Update variable. (main-system-name): New variable. (copy-source): Replace 'asd-file' and 'asd-system-name' keywords by 'asd-files' and 'asd-systems'. (configure): New variable. (build, check): Replace 'asd-file' and 'asd-system-name' keywords by 'asd-files' and 'asd-systems'. (create-asd-file, symlink-asd-files): Remove variables. (create-asdf-configuration): New variable. (cleanup-files): Update variable. (%standard-phases): Remove 'create-asd-file' and 'symlink-asd-files' phases. Add 'configure' and 'create-asdf-configuration' phases. * guix/build/lisp-utils.scm (%bundle-install-prefix, normalize-dependency, inputs->asd-file-map, asdf-load-all, compile-system): Remove variables. (compile-systems): New variable. (system-dependencies, compiled-system, generate-system-definition): Remove variable. (test-system): Replace 'asd-file' parameter by 'asd-files'. (generate-executable-for-system): Update variable. (generate-dependency-links, make-asd-file, bundle-asd-file): Remove variables. (make-asdf-configuration): New variable. (build-program, build-image): Set 'XDG_CONFIG_DIRS'. (generate-executable): Update variable. --- gnu/packages/lisp.scm | 10 +- guix/build-system/asdf.scm | 38 ++++-- guix/build/asdf-build-system.scm | 163 +++++++++++--------------- guix/build/lisp-utils.scm | 245 +++++++++------------------------------ 4 files changed, 160 insertions(+), 296 deletions(-) (limited to 'guix/build') diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm index df901aa34f..d2730f3bda 100644 --- a/gnu/packages/lisp.scm +++ b/gnu/packages/lisp.scm @@ -298,7 +298,10 @@ interface to the Tk widget system.") (native-search-paths (list (search-path-specification (variable "XDG_DATA_DIRS") - (files '("share"))))) + (files '("share"))) + (search-path-specification + (variable "XDG_CONFIG_DIRS") + (files '("etc"))))) (home-page "http://ecls.sourceforge.net/") (synopsis "Embeddable Common Lisp") (description "ECL is an implementation of the Common Lisp language as @@ -546,7 +549,10 @@ an interpreter, a compiler, a debugger, and much more.") (native-search-paths (list (search-path-specification (variable "XDG_DATA_DIRS") - (files '("share"))))) + (files '("share"))) + (search-path-specification + (variable "XDG_CONFIG_DIRS") + (files '("etc"))))) (home-page "http://www.sbcl.org/") (synopsis "Common Lisp implementation") (description "Steel Bank Common Lisp (SBCL) is a high performance Common diff --git a/guix/build-system/asdf.scm b/guix/build-system/asdf.scm index 630b99e2bf..334a119948 100644 --- a/guix/build-system/asdf.scm +++ b/guix/build-system/asdf.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2016, 2017 Andy Patterson -;;; Copyright © 2019 Guillaume Le Vaillant +;;; Copyright © 2019, 2020 Guillaume Le Vaillant ;;; ;;; This file is part of GNU Guix. ;;; @@ -54,12 +54,14 @@ ;; Imported build-side modules `((guix build asdf-build-system) (guix build lisp-utils) + (guix build union) ,@%gnu-build-system-modules)) (define %asdf-build-modules ;; Used (visible) build-side modules '((guix build asdf-build-system) (guix build utils) + (guix build union) (guix build lisp-utils))) (define (default-lisp implementation) @@ -210,7 +212,7 @@ set up using CL source package conventions." (define base-arguments (if target-is-source? (strip-keyword-arguments - '(#:tests? #:asd-file #:lisp #:asd-system-name #:test-asd-file) + '(#:tests? #:asd-files #:lisp #:asd-systems #:test-asd-file) (package-arguments pkg)) (package-arguments pkg))) @@ -278,8 +280,8 @@ set up using CL source package conventions." (lambda* (store name inputs #:key source outputs (tests? #t) - (asd-file #f) - (asd-system-name #f) + (asd-files ''()) + (asd-systems ''()) (test-asd-file #f) (phases '(@ (guix build asdf-build-system) %standard-phases)) @@ -289,12 +291,24 @@ set up using CL source package conventions." (imported-modules %asdf-build-system-modules) (modules %asdf-build-modules)) - (define system-name - (or asd-system-name - (string-drop - ;; NAME is the value returned from `package-full-name'. - (hyphen-separated-name->name+version name) - (1+ (string-length lisp-type))))) ; drop the "-" prefix. + ;; FIXME: The definitions of 'systems' and 'files' are pretty hacky. + ;; Is there a more elegant way to do it? + (define systems + (if (null? (cadr asd-systems)) + `(quote + ,(list + (string-drop + ;; NAME is the value returned from `package-full-name'. + (hyphen-separated-name->name+version name) + (1+ (string-length lisp-type))))) ; drop the "-" prefix. + asd-systems)) + + (define files + (if (null? (cadr asd-files)) + `(quote ,(map (lambda (system) + (string-append system ".asd")) + (cadr systems))) + asd-files)) (define builder `(begin @@ -309,8 +323,8 @@ set up using CL source package conventions." (derivation->output-path source)) ((source) source) (source source)) - #:asd-file ,(or asd-file (string-append system-name ".asd")) - #:asd-system-name ,system-name + #:asd-files ,files + #:asd-systems ,systems #:test-asd-file ,test-asd-file #:system ,system #:tests? ,tests? diff --git a/guix/build/asdf-build-system.scm b/guix/build/asdf-build-system.scm index 25dd031962..b7957e7fc5 100644 --- a/guix/build/asdf-build-system.scm +++ b/guix/build/asdf-build-system.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2016, 2017 Andy Patterson +;;; Copyright © 2020 Guillaume Le Vaillant ;;; ;;; This file is part of GNU Guix. ;;; @@ -19,6 +20,7 @@ (define-module (guix build asdf-build-system) #:use-module ((guix build gnu-build-system) #:prefix gnu:) #:use-module (guix build utils) + #:use-module (guix build union) #:use-module (guix build lisp-utils) #:use-module (srfi srfi-1) #:use-module (srfi srfi-11) @@ -41,14 +43,22 @@ ;; ;; Code: -(define %object-prefix "/lib") +(define %object-prefix "/lib/common-lisp") (define (%lisp-source-install-prefix) - (string-append %source-install-prefix "/" (%lisp-type) "-source")) + (string-append %source-install-prefix "/" (%lisp-type))) (define %system-install-prefix (string-append %source-install-prefix "/systems")) +(define (main-system-name output) + (let ((package-name (package-name->name+version + (strip-store-file-name output))) + (lisp-prefix (string-append (%lisp-type) "-"))) + (if (string-prefix? lisp-prefix package-name) + (string-drop package-name (string-length lisp-prefix)) + package-name))) + (define (lisp-source-directory output name) (string-append output (%lisp-source-install-prefix) "/" name)) @@ -126,8 +136,7 @@ if it's present in the native-inputs." (and parent (string-append parent "/share/common-lisp/" (string-take parent-name - (string-index parent-name #\-)) - "-source"))) + (string-index parent-name #\-))))) (define (first-subdirectory directory) ; From gnu-build-system. "Return the file name of the first sub-directory of DIRECTORY." @@ -146,122 +155,87 @@ if it's present in the native-inputs." (with-directory-excursion source-directory (copy-files-to-output output package-name))) -(define* (copy-source #:key outputs asd-system-name #:allow-other-keys) +(define* (copy-source #:key outputs asd-systems #:allow-other-keys) "Copy the source to the library output." (let* ((out (library-output outputs)) - (install-path (string-append out %source-install-prefix))) - (copy-files-to-output out asd-system-name) + (install-path (string-append out %source-install-prefix)) + (system-name (main-system-name out))) + (copy-files-to-output out system-name) ;; Hide the files from asdf (with-directory-excursion install-path - (rename-file "source" (string-append (%lisp-type) "-source")) + (rename-file "source" (%lisp-type)) (delete-file-recursively "systems"))) #t) -(define* (build #:key outputs inputs asd-file asd-system-name +(define* (configure #:key inputs #:allow-other-keys) + ;; Create a directory having the configuration files for + ;; all the dependencies in 'etc/common-lisp/'. + (let ((out (string-append (getcwd) "/.cl-union"))) + (match inputs + (((name . directories) ...) + (union-build out (filter directory-exists? directories) + #:create-all-directories? #t + #:log-port (%make-void-port "w")))) + (setenv "CL_UNION" out) + (setenv "XDG_CONFIG_DIRS" (string-append out "/etc"))) + #t) + +(define* (build #:key outputs inputs asd-files asd-systems #:allow-other-keys) "Compile the system." (let* ((out (library-output outputs)) - (source-path (lisp-source-directory out asd-system-name)) + (system-name (main-system-name out)) + (source-path (string-append out (%lisp-source-install-prefix))) (translations (wrap-output-translations `(,(output-translation source-path out)))) - (asd-file (source-asd-file out asd-system-name asd-file))) - + (asd-files (map (lambda (asd-file) + (source-asd-file out system-name asd-file)) + asd-files))) (setenv "ASDF_OUTPUT_TRANSLATIONS" (replace-escaped-macros (format #f "~S" translations))) - (setenv "HOME" out) ; ecl's asdf sometimes wants to create $HOME/.cache - - (compile-system asd-system-name asd-file) - - ;; As above, ecl will sometimes create this even though it doesn't use it - - (let ((cache-directory (string-append out "/.cache"))) - (when (directory-exists? cache-directory) - (delete-file-recursively cache-directory)))) + (compile-systems asd-systems asd-files)) #t) -(define* (check #:key tests? outputs inputs asd-file asd-system-name +(define* (check #:key tests? outputs inputs asd-files asd-systems test-asd-file #:allow-other-keys) "Test the system." (let* ((out (library-output outputs)) - (asd-file (source-asd-file out asd-system-name asd-file)) + (system-name (main-system-name out)) + (asd-files (map (lambda (asd-file) + (source-asd-file out system-name asd-file)) + asd-files)) (test-asd-file (and=> test-asd-file - (cut source-asd-file out asd-system-name <>)))) + (cut source-asd-file out system-name <>)))) (if tests? - (test-system asd-system-name asd-file test-asd-file) + (test-system (first asd-systems) asd-files test-asd-file) (format #t "test suite not run~%"))) #t) -(define* (create-asd-file #:key outputs - inputs - asd-file - asd-system-name - #:allow-other-keys) - "Create a system definition file for the built system." - (let*-values (((out) (library-output outputs)) - ((_ version) (package-name->name+version - (strip-store-file-name out))) - ((new-asd-file) (string-append - (library-directory out) - "/" (normalize-string asd-system-name) - ".asd"))) - - (make-asd-file new-asd-file - #:system asd-system-name - #:version version - #:inputs inputs - #:system-asd-file asd-file)) - #t) - -(define* (symlink-asd-files #:key outputs #:allow-other-keys) - "Create an extra reference to the system in a convenient location." - (let* ((out (library-output outputs))) - (for-each - (lambda (asd-file) - (receive (new-asd-file asd-file-directory) - (bundle-asd-file out asd-file) - (mkdir-p asd-file-directory) - (symlink asd-file new-asd-file) - ;; Update the source registry for future phases which might want to - ;; use the newly compiled system. - (prepend-to-source-registry - (string-append asd-file-directory "/")))) - - (find-files (string-append out %object-prefix) "\\.asd$"))) - #t) +(define* (create-asdf-configuration #:key inputs outputs #:allow-other-keys) + "Create the ASDF configuration files for the built systems." + (let* ((system-name (main-system-name (assoc-ref outputs "out"))) + (out (library-output outputs)) + (conf-dir (string-append out "/etc/common-lisp")) + (deps-conf-dir (string-append (getenv "CL_UNION") "/etc/common-lisp")) + (source-dir (lisp-source-directory out system-name)) + (lib-dir (string-append (library-directory out) "/" system-name))) + (make-asdf-configuration system-name conf-dir deps-conf-dir + source-dir lib-dir) + #t)) (define* (cleanup-files #:key outputs #:allow-other-keys) "Remove any compiled files which are not a part of the final bundle." - (let ((out (library-output outputs))) - (match (%lisp-type) - ("sbcl" - (for-each - (lambda (file) - (unless (string-suffix? "--system.fasl" file) - (delete-file file))) - (find-files out "\\.fasl$"))) - ("ecl" - (for-each delete-file - (append (find-files out "\\.fas$") - (find-files out "\\.o$"))))) - - (with-directory-excursion (library-directory out) - (for-each - (lambda (file) - (rename-file file - (string-append "./" (basename file)))) - (find-files ".")) - (for-each delete-file-recursively - (scandir "." - (lambda (file) - (and - (directory-exists? file) - (string<> "." file) - (string<> ".." file))))))) + (let* ((out (library-output outputs)) + (cache-directory (string-append out "/.cache"))) + ;; Remove the cache directory in case the lisp implementation wrote + ;; something in there when compiling or testing a system. + (when (directory-exists? cache-directory) + (delete-file-recursively cache-directory))) #t) (define* (strip #:rest args) @@ -280,15 +254,14 @@ if it's present in the native-inputs." (define %standard-phases (modify-phases gnu:%standard-phases (delete 'bootstrap) - (delete 'configure) - (delete 'install) + (replace 'configure configure) + (add-before 'configure 'copy-source copy-source) (replace 'build build) - (add-before 'build 'copy-source copy-source) (replace 'check check) - (replace 'strip strip) - (add-after 'check 'create-asd-file create-asd-file) - (add-after 'create-asd-file 'cleanup cleanup-files) - (add-after 'cleanup 'create-symlinks symlink-asd-files))) + (add-after 'check 'create-asdf-configuration create-asdf-configuration) + (add-after 'create-asdf-configuration 'cleanup cleanup-files) + (delete 'install) + (replace 'strip strip))) (define* (asdf-build #:key inputs (phases %standard-phases) diff --git a/guix/build/lisp-utils.scm b/guix/build/lisp-utils.scm index f6d9168c48..8a02cb68dd 100644 --- a/guix/build/lisp-utils.scm +++ b/guix/build/lisp-utils.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2016, 2017 Andy Patterson +;;; Copyright © 2020 Guillaume Le Vaillant ;;; ;;; This file is part of GNU Guix. ;;; @@ -28,19 +29,17 @@ %lisp-type %source-install-prefix lisp-eval-program - compile-system + compile-systems test-system replace-escaped-macros generate-executable-wrapper-system generate-executable-entry-point generate-executable-for-system - %bundle-install-prefix - bundle-asd-file wrap-output-translations prepend-to-source-registry build-program build-image - make-asd-file + make-asdf-configuration valid-char-set normalize-string library-output)) @@ -65,9 +64,6 @@ ;; link farm for system definition (.asd) files. (define %source-install-prefix "/share/common-lisp") -(define (%bundle-install-prefix) - (string-append %source-install-prefix "/" (%lisp-type) "-bundle-systems")) - (define (library-output outputs) "If a `lib' output exists, build things there. Otherwise use `out'." (or (assoc-ref outputs "lib") (assoc-ref outputs "out"))) @@ -81,38 +77,6 @@ "Replace invalid characters in STR with a hyphen." (string-join (string-tokenize str valid-char-set) "-")) -(define (normalize-dependency dependency) - "Normalize the name of DEPENDENCY. Handles dependency definitions of the -dependency-def form described by -. -Assume that any symbols in DEPENDENCY will be in upper-case." - (match dependency - ((':VERSION name rest ...) - `(:version ,(normalize-string name) ,@rest)) - ((':FEATURE feature-specification dependency-specification) - `(:feature - ,feature-specification - ,(normalize-dependency dependency-specification))) - ((? string? name) (normalize-string name)) - (require-specification require-specification))) - -(define (inputs->asd-file-map inputs) - "Produce a hash table of the form (system . asd-file), where system is the -name of an ASD system, and asd-file is the full path to its definition." - (alist->hash-table - (filter-map - (match-lambda - ((_ . path) - (let ((prefix (string-append path (%bundle-install-prefix)))) - (and (directory-exists? prefix) - (match (find-files prefix "\\.asd$") - ((asd-file) - (cons - (string-drop-right (basename asd-file) 4) ; drop ".asd" - asd-file)) - (_ #f)))))) - inputs))) - (define (wrap-output-translations translations) `(:output-translations ,@translations @@ -143,70 +107,26 @@ with PROGRAM." "--eval" "(quit)")) (_ (error "The LISP provided is not supported at this time.")))) -(define (asdf-load-all systems) - (map (lambda (system) - `(asdf:load-system ,system)) - systems)) - -(define (compile-system system asd-file) - "Use a lisp implementation to compile SYSTEM using asdf. Load ASD-FILE -first." +(define (compile-systems systems asd-files) + "Use a lisp implementation to compile the SYSTEMS using asdf. +Load ASD-FILES first." (lisp-eval-program `((require :asdf) - (asdf:load-asd (truename ,asd-file) :name ,(normalize-string system)) - (asdf:operate 'asdf:compile-bundle-op ,system)))) - -(define (system-dependencies system asd-file) - "Return the dependencies of SYSTEM, as reported by -asdf:system-depends-on. First load the system's ASD-FILE." - (define deps-file ".deps.sexp") - (define program - `((require :asdf) - (asdf:load-asd (truename ,asd-file) :name ,(normalize-string system)) - (with-open-file - (stream ,deps-file :direction :output) - (format stream - "~s~%" - (asdf:system-depends-on - (asdf:find-system ,system)))))) - - (dynamic-wind - (lambda _ - (lisp-eval-program program)) - (lambda _ - (call-with-input-file deps-file read)) - (lambda _ - (when (file-exists? deps-file) - (delete-file deps-file))))) - -(define (compiled-system system) - (let ((system (basename system))) ; this is how asdf handles slashes - (match (%lisp-type) - ("sbcl" (string-append system "--system")) - (_ system)))) - -(define* (generate-system-definition system - #:key version dependencies component?) - `(asdf:defsystem - ,(normalize-string system) - ,@(if component? - '(:class asdf/bundle:prebuilt-system) - '()) - :version ,version - :depends-on ,dependencies - ,@(if component? - `(:components ((:compiled-file ,(compiled-system system)))) - '()) - ,@(if (string=? "ecl" (%lisp-type)) - `(:lib ,(string-append system ".a")) - '()))) - -(define (test-system system asd-file test-asd-file) - "Use a lisp implementation to test SYSTEM using asdf. Load ASD-FILE first. + ,@(map (lambda (asd-file) + `(asdf:load-asd (truename ,asd-file))) + asd-files) + ,@(map (lambda (system) + `(asdf:compile-system ,system)) + systems)))) + +(define (test-system system asd-files test-asd-file) + "Use a lisp implementation to test SYSTEM using asdf. Load ASD-FILES first. Also load TEST-ASD-FILE if necessary." (lisp-eval-program `((require :asdf) - (asdf:load-asd (truename ,asd-file) :name ,(normalize-string system)) + ,@(map (lambda (asd-file) + `(asdf:load-asd (truename ,asd-file))) + asd-files) ,@(if test-asd-file `((asdf:load-asd (truename ,test-asd-file))) ;; Try some likely files. @@ -237,6 +157,7 @@ created a \"SYSTEM-exec\" system which contains the entry program." :executable t :compression t)) '()) + (asdf:load-asd (truename ,(string-append system "-exec.asd"))) (asdf:operate ',type ,(string-append system "-exec"))))) (define (generate-executable-wrapper-system system dependencies) @@ -271,79 +192,30 @@ ENTRY-PROGRAM for SYSTEM within the current directory." (declare (ignorable arguments)) ,@entry-program)))))))) -(define (generate-dependency-links registry system) - "Creates a program which populates asdf's source registry from REGISTRY, an -alist of dependency names to corresponding asd files. This allows the system -to locate its dependent systems." - `(progn - (asdf/source-registry:ensure-source-registry) - ,@(map (match-lambda - ((name . asd-file) - `(setf - (gethash ,name - asdf/source-registry:*source-registry*) - ,(string->symbol "#p") - ,asd-file))) - registry))) - -(define* (make-asd-file asd-file - #:key system version inputs - (system-asd-file #f)) - "Create an ASD-FILE for SYSTEM@VERSION, appending a program to allow the -system to find its dependencies, as described by GENERATE-DEPENDENCY-LINKS." - (define dependencies - (let ((deps - (system-dependencies system system-asd-file))) - (if (eq? 'NIL deps) - '() - (map normalize-dependency deps)))) - - (define lisp-input-map - (inputs->asd-file-map inputs)) - - (define dependency-name - (match-lambda - ((':version name _ ...) name) - ((':feature _ dependency-specification) - (dependency-name dependency-specification)) - ((? string? name) name) - (_ #f))) - - (define registry - (filter-map hash-get-handle - (make-list (length dependencies) - lisp-input-map) - (map dependency-name dependencies))) - - ;; Ensure directory exists, which might not be the case for an .asd without components. - (mkdir-p (dirname asd-file)) - (call-with-output-file asd-file - (lambda (port) - (display - (replace-escaped-macros - (format #f "~y~%~y~%" - (generate-system-definition - system - #:version version - #:dependencies dependencies - ;; Some .asd don't have components, and thus they don't generate any .fasl. - #:component? (match (%lisp-type) - ("sbcl" (pair? (find-files (dirname asd-file) - "--system\\.fasl$"))) - ("ecl" (pair? (find-files (dirname asd-file) - "\\.fasb$"))) - (_ (error "The LISP provided is not supported at this time.")))) - (generate-dependency-links registry system))) - port)))) - -(define (bundle-asd-file output-path original-asd-file) - "Find the symlinked bundle file for ORIGINAL-ASD-FILE by looking in -OUTPUT-PATH/share/common-lisp/LISP-bundle-systems/.asd. Returns two -values: the asd file itself and the directory in which it resides." - (let ((bundle-asd-path (string-append output-path - (%bundle-install-prefix)))) - (values (string-append bundle-asd-path "/" (basename original-asd-file)) - bundle-asd-path))) +(define (make-asdf-configuration name conf-dir deps-conf-dir source-dir lib-dir) + (let ((registry-dir (string-append + conf-dir "/source-registry.conf.d")) + (translations-dir (string-append + conf-dir "/asdf-output-translations.conf.d")) + (deps-registry-dir (string-append + deps-conf-dir "/source-registry.conf.d")) + (deps-translations-dir (string-append + deps-conf-dir + "/asdf-output-translations.conf.d"))) + (mkdir-p registry-dir) + (when (directory-exists? deps-registry-dir) + (copy-recursively deps-registry-dir registry-dir)) + (with-output-to-file (string-append registry-dir "/50-" name ".conf") + (lambda _ + (format #t "~y~%" `(:tree ,source-dir)))) + + (mkdir-p translations-dir) + (when (directory-exists? deps-translations-dir) + (copy-recursively deps-translations-dir translations-dir)) + (with-output-to-file (string-append translations-dir "/50-" name ".conf") + (lambda _ + (format #t "~y~%" `((,source-dir :**/ :*.*.*) + (,lib-dir :**/ :*.*.*))))))) (define (replace-escaped-macros string) "Replace simple lisp forms that the guile writer escapes, for example by @@ -368,6 +240,7 @@ will run ENTRY-PROGRAM, a list of Common Lisp expressions in which `arguments' has been bound to the command-line arguments which were passed. Link in any asd files from DEPENDENCY-PREFIXES to ensure references to those libraries are retained." + (setenv "XDG_CONFIG_DIRS" (string-append (library-output outputs) "/etc")) (generate-executable program #:dependencies dependencies #:dependency-prefixes dependency-prefixes @@ -388,6 +261,7 @@ retained." "Generate an image, possibly standalone, which contains all DEPENDENCIES, placing the result in IMAGE.image. Link in any asd files from DEPENDENCY-PREFIXES to ensure references to those libraries are retained." + (setenv "XDG_CONFIG_DIRS" (string-append (library-output outputs) "/etc")) (generate-executable image #:dependencies dependencies #:dependency-prefixes dependency-prefixes @@ -416,20 +290,15 @@ references to those libraries are retained." (mkdir-p bin-directory) (with-directory-excursion bin-directory (generate-executable-wrapper-system name dependencies) - (generate-executable-entry-point name entry-program)) - - (prepend-to-source-registry - (string-append bin-directory "/")) - - (setenv "ASDF_OUTPUT_TRANSLATIONS" - (replace-escaped-macros - (format - #f "~S" - (wrap-output-translations - `(((,bin-directory :**/ :*.*.*) - (,bin-directory :**/ :*.*.*))))))) - - (generate-executable-for-system type name #:compress? compress?) + (generate-executable-entry-point name entry-program) + (setenv "ASDF_OUTPUT_TRANSLATIONS" + (replace-escaped-macros + (format + #f "~S" + (wrap-output-translations + `(((,bin-directory :**/ :*.*.*) + (,bin-directory :**/ :*.*.*))))))) + (generate-executable-for-system type name #:compress? compress?)) (let* ((after-store-prefix-index (string-index out-file #\/ @@ -445,9 +314,11 @@ references to those libraries are retained." (symlink asd-file (string-append hidden-asd-links "/" (basename asd-file)))) - (find-files (string-append path (%bundle-install-prefix)) + (find-files (string-append path %source-install-prefix "/" + (%lisp-type)) "\\.asd$"))) dependency-prefixes)) (delete-file (string-append bin-directory "/" name "-exec.asd")) - (delete-file (string-append bin-directory "/" name "-exec.lisp")))) + (delete-file (string-append bin-directory "/" name "-exec.lisp")) + (delete-file (string-append bin-directory "/" name "-exec.fasl")))) -- cgit v1.2.3 From 952fafb2a3c7a0978cc6a96268ad0632558b212d Mon Sep 17 00:00:00 2001 From: Guillaume Le Vaillant Date: Tue, 15 Sep 2020 14:36:24 +0200 Subject: build-system: asdf: Read all .asd files if no #:asd-files specified. * guix/build-system/asdf.scm (asdf-build): Remove the 'files' variable. * guix/build/asd-build-system.scm (find-asd-files): New variable. (build, check): Use it. --- guix/build-system/asdf.scm | 11 ++--------- guix/build/asdf-build-system.scm | 15 +++++++++------ 2 files changed, 11 insertions(+), 15 deletions(-) (limited to 'guix/build') diff --git a/guix/build-system/asdf.scm b/guix/build-system/asdf.scm index 334a119948..28403a1960 100644 --- a/guix/build-system/asdf.scm +++ b/guix/build-system/asdf.scm @@ -291,7 +291,7 @@ set up using CL source package conventions." (imported-modules %asdf-build-system-modules) (modules %asdf-build-modules)) - ;; FIXME: The definitions of 'systems' and 'files' are pretty hacky. + ;; FIXME: The definition of 'systems' is pretty hacky. ;; Is there a more elegant way to do it? (define systems (if (null? (cadr asd-systems)) @@ -303,13 +303,6 @@ set up using CL source package conventions." (1+ (string-length lisp-type))))) ; drop the "-" prefix. asd-systems)) - (define files - (if (null? (cadr asd-files)) - `(quote ,(map (lambda (system) - (string-append system ".asd")) - (cadr systems))) - asd-files)) - (define builder `(begin (use-modules ,@modules) @@ -323,7 +316,7 @@ set up using CL source package conventions." (derivation->output-path source)) ((source) source) (source source)) - #:asd-files ,files + #:asd-files ,asd-files #:asd-systems ,systems #:test-asd-file ,test-asd-file #:system ,system diff --git a/guix/build/asdf-build-system.scm b/guix/build/asdf-build-system.scm index b7957e7fc5..26d295e083 100644 --- a/guix/build/asdf-build-system.scm +++ b/guix/build/asdf-build-system.scm @@ -81,6 +81,13 @@ to it's binary output." (define (source-asd-file output name asd-file) (string-append (lisp-source-directory output name) "/" asd-file)) +(define (find-asd-files output name asd-files) + (if (null? asd-files) + (find-files (lisp-source-directory output name) "\\.asd$") + (map (lambda (asd-file) + (source-asd-file output name asd-file)) + asd-files))) + (define (copy-files-to-output out name) "Copy all files from the current directory to OUT. Create an extra link to any system-defining files in the source to a convenient location. This is @@ -189,9 +196,7 @@ if it's present in the native-inputs." (translations (wrap-output-translations `(,(output-translation source-path out)))) - (asd-files (map (lambda (asd-file) - (source-asd-file out system-name asd-file)) - asd-files))) + (asd-files (find-asd-files out system-name asd-files))) (setenv "ASDF_OUTPUT_TRANSLATIONS" (replace-escaped-macros (format #f "~S" translations))) (setenv "HOME" out) ; ecl's asdf sometimes wants to create $HOME/.cache @@ -204,9 +209,7 @@ if it's present in the native-inputs." "Test the system." (let* ((out (library-output outputs)) (system-name (main-system-name out)) - (asd-files (map (lambda (asd-file) - (source-asd-file out system-name asd-file)) - asd-files)) + (asd-files (find-asd-files out system-name asd-files)) (test-asd-file (and=> test-asd-file (cut source-asd-file out system-name <>)))) -- cgit v1.2.3 From e0d9103f416d5c6e6c0c230f08dc9392bb8e8df1 Mon Sep 17 00:00:00 2001 From: Guillaume Le Vaillant Date: Tue, 15 Sep 2020 22:00:29 +0200 Subject: build-system: asdf: Improve install phase for CL source packages. * guix/build/asdf-build-system.scm (install)[parent-source]: Add support for package names not containing a hyphen. --- guix/build/asdf-build-system.scm | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'guix/build') diff --git a/guix/build/asdf-build-system.scm b/guix/build/asdf-build-system.scm index 26d295e083..6ad855cab2 100644 --- a/guix/build/asdf-build-system.scm +++ b/guix/build/asdf-build-system.scm @@ -124,9 +124,10 @@ if it's present in the native-inputs." (package-name->name+version (strip-store-file-name output))) (define (no-prefix pkgname) - (if (string-index pkgname #\-) - (string-drop pkgname (1+ (string-index pkgname #\-))) - pkgname)) + (let ((index (string-index pkgname #\-))) + (if index + (string-drop pkgname (1+ index)) + pkgname))) (define parent (match (assoc package-name inputs (lambda (key alist-car) @@ -142,8 +143,10 @@ if it's present in the native-inputs." (define parent-source (and parent (string-append parent "/share/common-lisp/" - (string-take parent-name - (string-index parent-name #\-))))) + (let ((index (string-index parent-name #\-))) + (if index + (string-take parent-name index) + parent-name))))) (define (first-subdirectory directory) ; From gnu-build-system. "Return the file name of the first sub-directory of DIRECTORY." -- cgit v1.2.3 From c1cc0c4865a8bfff43c5c9bd6ae8dcadb061c8a0 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Tue, 6 Oct 2020 10:29:47 +0300 Subject: build-system/cargo: Don't install .crates.toml file. Fixes . * guix/build/cargo-build-system.scm (install): Remove installed .crates.toml file. --- guix/build/cargo-build-system.scm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'guix/build') 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 -- cgit v1.2.3 From a5a3f813c74aa8143af1e42a3d754f1bf7be2fb0 Mon Sep 17 00:00:00 2001 From: zimoun Date: Mon, 5 Oct 2020 18:36:34 +0200 Subject: build: hg: Handle fetch errors. * guix/build/hg.scm (hg-fetch): Add 'guard' to handle errors. Signed-off-by: Mathieu Othacehe --- guix/build/hg.scm | 50 +++++++++++++++++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 17 deletions(-) (limited to 'guix/build') diff --git a/guix/build/hg.scm b/guix/build/hg.scm index b3e3ff7ac3..1cceb63433 100644 --- a/guix/build/hg.scm +++ b/guix/build/hg.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2016 Ricardo Wurmus ;;; Copyright © 2018 Mark H Weaver ;;; Copyright © 2018 Björn Höfling +;;; Copyright © 2020 Simon Tournier ;;; ;;; 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,35 @@ "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) + (format (current-error-port) + "hg-fetch: '~a~{ ~a~}' failed with exit code ~a~%" + (invoke-error-program c) + (invoke-error-arguments c) + (or (invoke-error-exit-status c) + (invoke-error-stop-signal c) + (invoke-error-term-signal 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 -- cgit v1.2.3 From 2fb12dd1bb725592e1561ac8f4b32fb68accb161 Mon Sep 17 00:00:00 2001 From: zimoun Date: Mon, 5 Oct 2020 18:47:39 +0200 Subject: build: svn: Handle fetch errors. * guix/build/svn.scm (svn-fetch): Add 'guard' to handle errors. Signed-off-by: Mathieu Othacehe --- guix/build/svn.scm | 46 +++++++++++++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 15 deletions(-) (limited to 'guix/build') diff --git a/guix/build/svn.scm b/guix/build/svn.scm index 33783f3056..48d28f0327 100644 --- a/guix/build/svn.scm +++ b/guix/build/svn.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2014 Ludovic Courtès ;;; Copyright © 2014 Sree Harsha Totakura ;;; Copyright © 2018 Mark H Weaver +;;; Copyright © 2020 Simon Tournier ;;; ;;; 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,33 @@ (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) + (mkdir-p directory) + + (guard (c ((invoke-error? c) + (format (current-error-port) + "svn-fetch: '~a~{ ~a~}' failed with exit code ~a~%" + (invoke-error-program c) + (invoke-error-arguments c) + (or (invoke-error-exit-status c) + (invoke-error-stop-signal c) + (invoke-error-term-signal c))) + (delete-file-recursively directory) + #f)) + (with-directory-excursion directory + (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 -- cgit v1.2.3 From 1ec67d5220b0ebac20263b44f4fefaf51ba8fdbb Mon Sep 17 00:00:00 2001 From: Paul Garlick Date: Tue, 6 Oct 2020 14:44:09 +0100 Subject: Revert "build: svn: Handle fetch errors." This reverts commit 2fb12dd1bb725592e1561ac8f4b32fb68accb161, which causes the 'svn export' command to fail with: svn: E155000: Destination directory exists; please remove the directory or use --force to overwrite --- guix/build/svn.scm | 46 +++++++++++++++------------------------------- 1 file changed, 15 insertions(+), 31 deletions(-) (limited to 'guix/build') diff --git a/guix/build/svn.scm b/guix/build/svn.scm index 48d28f0327..33783f3056 100644 --- a/guix/build/svn.scm +++ b/guix/build/svn.scm @@ -2,7 +2,6 @@ ;;; Copyright © 2014 Ludovic Courtès ;;; Copyright © 2014 Sree Harsha Totakura ;;; Copyright © 2018 Mark H Weaver -;;; Copyright © 2020 Simon Tournier ;;; ;;; This file is part of GNU Guix. ;;; @@ -21,8 +20,6 @@ (define-module (guix build svn) #:use-module (guix build utils) - #:use-module (srfi srfi-34) - #:use-module (ice-9 format) #:export (svn-fetch)) ;;; Commentary: @@ -39,33 +36,20 @@ (password #f)) "Fetch REVISION from URL into DIRECTORY. REVISION must be an integer, and a valid Subversion revision. Return #t on success, #f otherwise." - (mkdir-p directory) - - (guard (c ((invoke-error? c) - (format (current-error-port) - "svn-fetch: '~a~{ ~a~}' failed with exit code ~a~%" - (invoke-error-program c) - (invoke-error-arguments c) - (or (invoke-error-exit-status c) - (invoke-error-stop-signal c) - (invoke-error-term-signal c))) - (delete-file-recursively directory) - #f)) - (with-directory-excursion directory - (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))) + (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 -- cgit v1.2.3 From db9e4af0ead4b02e1a70f358de995c43249b8bcf Mon Sep 17 00:00:00 2001 From: zimoun Date: Wed, 7 Oct 2020 01:05:21 +0200 Subject: build: svn: Fix handle fetch errors. This fixes the revert 1ec67d5220b0ebac20263b44f4fefaf51ba8fdbb. * guix/build/svn.scm (svn-fetch): Add 'guard' to handle errors. Signed-off-by: Mathieu Othacehe --- guix/build/svn.scm | 42 +++++++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 15 deletions(-) (limited to 'guix/build') diff --git a/guix/build/svn.scm b/guix/build/svn.scm index 33783f3056..f6b4ca0776 100644 --- a/guix/build/svn.scm +++ b/guix/build/svn.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2014 Ludovic Courtès ;;; Copyright © 2014 Sree Harsha Totakura ;;; Copyright © 2018 Mark H Weaver +;;; Copyright © 2020 Simon Tournier ;;; ;;; 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,29 @@ (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) + (format (current-error-port) + "svn-fetch: '~a~{ ~a~}' failed with exit code ~a~%" + (invoke-error-program c) + (invoke-error-arguments c) + (or (invoke-error-exit-status c) + (invoke-error-stop-signal c) + (invoke-error-term-signal 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 -- cgit v1.2.3 From b55409b2c0a0cb53f251ceab7746d35805b64ab7 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 10 Oct 2020 00:03:57 +0200 Subject: svn-download, hg-download: Use 'report-invoke-error'. * guix/build/hg.scm (hg-fetch): Use 'report-invoke-error' instead of 'format'. * guix/build/svn.scm (svn-fetch): Likewise. --- guix/build/hg.scm | 8 +------- guix/build/svn.scm | 10 ++-------- 2 files changed, 3 insertions(+), 15 deletions(-) (limited to 'guix/build') diff --git a/guix/build/hg.scm b/guix/build/hg.scm index 1cceb63433..0ffad7fa2d 100644 --- a/guix/build/hg.scm +++ b/guix/build/hg.scm @@ -41,13 +41,7 @@ Mercurial changeset identifier. Return #t on success, #f otherwise." (mkdir-p directory) (guard (c ((invoke-error? c) - (format (current-error-port) - "hg-fetch: '~a~{ ~a~}' failed with exit code ~a~%" - (invoke-error-program c) - (invoke-error-arguments c) - (or (invoke-error-exit-status c) - (invoke-error-stop-signal c) - (invoke-error-term-signal c))) + (report-invoke-error c) (delete-file-recursively directory) #f)) (with-directory-excursion directory diff --git a/guix/build/svn.scm b/guix/build/svn.scm index f6b4ca0776..44d77a968f 100644 --- a/guix/build/svn.scm +++ b/guix/build/svn.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2014 Ludovic Courtès +;;; Copyright © 2014, 2020 Ludovic Courtès ;;; Copyright © 2014 Sree Harsha Totakura ;;; Copyright © 2018 Mark H Weaver ;;; Copyright © 2020 Simon Tournier @@ -40,13 +40,7 @@ "Fetch REVISION from URL into DIRECTORY. REVISION must be an integer, and a valid Subversion revision. Return #t on success, #f otherwise." (guard (c ((invoke-error? c) - (format (current-error-port) - "svn-fetch: '~a~{ ~a~}' failed with exit code ~a~%" - (invoke-error-program c) - (invoke-error-arguments c) - (or (invoke-error-exit-status c) - (invoke-error-stop-signal c) - (invoke-error-term-signal c))) + (report-invoke-error c) #f)) (apply invoke svn-command "export" "--non-interactive" -- cgit v1.2.3 From 6b793fa66218337a1f638466753cd5326a6a6c18 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Wed, 7 Oct 2020 10:11:05 +0300 Subject: build-system/go: Install license files. * guix/build/go-build-system.scm (install-license-files): New procedure. (%standard-phases): Replace inherited 'install-license-files phase. --- guix/build/go-build-system.scm | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'guix/build') diff --git a/guix/build/go-build-system.scm b/guix/build/go-build-system.scm index b9cb2bfd7b..227df820db 100644 --- a/guix/build/go-build-system.scm +++ b/guix/build/go-build-system.scm @@ -4,6 +4,7 @@ ;;; Copyright © 2019 Maxim Cournoyer ;;; Copyright © 2020 Jack Hill ;;; Copyright © 2020 Jakub Kądziołka +;;; Copyright © 2020 Efraim Flashner ;;; ;;; This file is part of GNU Guix. ;;; @@ -254,6 +255,17 @@ XXX We can't make use of compiled libraries (Go \"packages\")." (copy-recursively source dest #:keep-mtime? #t))) #t) +(define* (install-license-files #:key unpack-path + import-path + #:allow-other-keys + #:rest args) + "Install license files matching LICENSE-FILE-REGEXP to 'share/doc'. Adjust +the standard install-license-files phase to first enter the correct directory." + (with-directory-excursion (string-append "src/" (if (string-null? unpack-path) + import-path + unpack-path)) + (apply (assoc-ref gnu:%standard-phases 'install-license-files) args))) + (define* (remove-store-reference file file-name #:optional (store (%store-directory))) "Remove from FILE occurrences of FILE-NAME in STORE; return #t when FILE-NAME @@ -317,6 +329,7 @@ files in OUTPUTS." (replace 'build build) (replace 'check check) (replace 'install install) + (replace 'install-license-files install-license-files) (add-after 'install 'remove-go-references remove-go-references))) (define* (go-build #:key inputs (phases %standard-phases) -- cgit v1.2.3