diff options
Diffstat (limited to 'guix')
-rw-r--r-- | guix/build-system/glib-or-gtk.scm | 3 | ||||
-rw-r--r-- | guix/build-system/gnu.scm | 16 | ||||
-rw-r--r-- | guix/build/cmake-build-system.scm | 3 | ||||
-rw-r--r-- | guix/build/gnu-build-system.scm | 27 | ||||
-rw-r--r-- | guix/build/utils.scm | 1 | ||||
-rw-r--r-- | guix/download.scm | 110 | ||||
-rw-r--r-- | guix/packages.scm | 6 | ||||
-rw-r--r-- | guix/profiles.scm | 6 |
8 files changed, 72 insertions, 100 deletions
diff --git a/guix/build-system/glib-or-gtk.scm b/guix/build-system/glib-or-gtk.scm index d585d84f20..621e68e0ab 100644 --- a/guix/build-system/glib-or-gtk.scm +++ b/guix/build-system/glib-or-gtk.scm @@ -110,7 +110,8 @@ (outputs '("out")) (search-paths '()) (configure-flags ''()) - (make-flags ''()) + ;; Disable icon theme cache generation. + (make-flags ''("gtk_update_icon_cache=true")) (out-of-source? #t) (tests? #t) (test-target "check") diff --git a/guix/build-system/gnu.scm b/guix/build-system/gnu.scm index 047ace7e6b..c9140074b7 100644 --- a/guix/build-system/gnu.scm +++ b/guix/build-system/gnu.scm @@ -273,6 +273,10 @@ standard packages used as implicit inputs of the GNU build system." (build (if target gnu-cross-build gnu-build)) (arguments (strip-keyword-arguments private-keywords arguments)))) +(define %license-file-regexp + ;; Regexp matching license files. + "^(COPYING.*|LICEN[CS]E.*|[Ll]icen[cs]e.*|Copy[Rr]ight(\\.(txt|md))?)$") + (define* (gnu-build store name input-drvs #:key (guile #f) (outputs '("out")) @@ -291,6 +295,7 @@ standard packages used as implicit inputs of the GNU build system." (strip-directories ''("lib" "lib64" "libexec" "bin" "sbin")) (validate-runpath? #t) + (license-file-regexp %license-file-regexp) (phases '%standard-phases) (locale "en_US.utf8") (system (%current-system)) @@ -358,6 +363,7 @@ packages that must not be referenced." #:patch-shebangs? ,patch-shebangs? #:strip-binaries? ,strip-binaries? #:validate-runpath? ,validate-runpath? + #:license-file-regexp ,license-file-regexp #:strip-flags ,strip-flags #:strip-directories ,strip-directories))) @@ -408,7 +414,13 @@ is one of `host' or `target'." #:libc (libc target))) ("cross-binutils" ,(binutils target)))) ((target) - `(("cross-libc" ,(libc target)))))))) + (let ((libc (libc target))) + `(("cross-libc" ,libc) + + ;; MinGW's libc doesn't have a "static" output. + ,@(if (member "static" (package-outputs libc)) + `(("cross-libc:static" ,libc "static")) + '())))))))) (define* (gnu-cross-build store name #:key @@ -432,6 +444,7 @@ is one of `host' or `target'." (strip-directories ''("lib" "lib64" "libexec" "bin" "sbin")) (validate-runpath? #t) + (license-file-regexp %license-file-regexp) (phases '%standard-phases) (locale "en_US.utf8") (system (%current-system)) @@ -509,6 +522,7 @@ platform." #:patch-shebangs? ,patch-shebangs? #:strip-binaries? ,strip-binaries? #:validate-runpath? ,validate-runpath? + #:license-file-regexp ,license-file-regexp #:strip-flags ,strip-flags #:strip-directories ,strip-directories)))) diff --git a/guix/build/cmake-build-system.scm b/guix/build/cmake-build-system.scm index 128ab28fe5..c82d9fef87 100644 --- a/guix/build/cmake-build-system.scm +++ b/guix/build/cmake-build-system.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com> ;;; Copyright © 2014, 2015 Andreas Enge <andreas@enge.fr> +;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il> ;;; ;;; This file is part of GNU Guix. ;;; @@ -53,6 +54,8 @@ build-type)) '()) ,(string-append "-DCMAKE_INSTALL_PREFIX=" out) + ;; ensure that the libraries are installed into /lib + "-DCMAKE_INSTALL_LIBDIR=lib" ;; add input libraries to rpath "-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE" ;; add (other) libraries of the project itself to rpath diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm index e37b751403..7b43361f99 100644 --- a/guix/build/gnu-build-system.scm +++ b/guix/build/gnu-build-system.scm @@ -29,6 +29,7 @@ #:use-module (srfi srfi-26) #:use-module (rnrs io ports) #:export (%standard-phases + %license-file-regexp gnu-build)) ;; Commentary: @@ -641,6 +642,31 @@ which cannot be found~%" outputs) #t) +(define %license-file-regexp + ;; Regexp matching license files. + "^(COPYING.*|LICEN[CS]E.*|[Ll]icen[cs]e.*|Copy[Rr]ight(\\.(txt|md))?)$") + +(define* (install-license-files #:key outputs + (license-file-regexp %license-file-regexp) + #:allow-other-keys) + "Install license files matching LICENSE-FILE-REGEXP to 'share/doc'." + (let* ((regexp (make-regexp license-file-regexp)) + (out (or (assoc-ref outputs "out") + (match outputs + (((_ . output) _ ...) + output)))) + (package (strip-store-file-name out)) + (directory (string-append out "/share/doc/" package)) + (files (scandir "." (lambda (file) + (regexp-exec regexp file))))) + (format #t "installing ~a license files~%" (length files)) + (for-each (lambda (file) + (if (file-is-directory? file) + (copy-recursively file directory) + (install-file file directory))) + files) + #t)) + (define %standard-phases ;; Standard build phases, as a list of symbol/procedure pairs. (let-syntax ((phases (syntax-rules () @@ -654,6 +680,7 @@ which cannot be found~%" validate-documentation-location delete-info-dir-file patch-dot-desktop-files + install-license-files reset-gzip-timestamps compress-documentation))) diff --git a/guix/build/utils.scm b/guix/build/utils.scm index 7391307c87..d7ed3d5177 100644 --- a/guix/build/utils.scm +++ b/guix/build/utils.scm @@ -29,6 +29,7 @@ #:use-module (ice-9 regex) #:use-module (ice-9 rdelim) #:use-module (ice-9 format) + #:use-module (ice-9 threads) #:use-module (rnrs bytevectors) #:use-module (rnrs io ports) #:re-export (alist-cons diff --git a/guix/download.scm b/guix/download.scm index 8a0b19c012..55da2c1d37 100644 --- a/guix/download.scm +++ b/guix/download.scm @@ -447,89 +447,6 @@ download by itself using its own dependencies." ;; for that built-in is widespread. #:local-build? #t))) -(define* (in-band-download file-name url - #:key system hash-algo hash - mirrors content-addressed-mirrors - guile) - "Download FILE-NAME from URL using a normal, \"in-band\" fixed-output -derivation. - -This is now deprecated since it has the drawback of causing bootstrapping -issues: we may need to build GnuTLS just to be able to download the source of -GnuTLS itself and its dependencies. See <http://bugs.gnu.org/22774>." - (define need-gnutls? - ;; True if any of the URLs need TLS support. - (let ((https? (cut string-prefix? "https://" <>))) - (match url - ((? string?) - (https? url)) - ((url ...) - (any https? url))))) - - (define builder - (with-imported-modules '((guix build download) - (guix build utils) - (guix ftp-client) - (guix base32) - (guix base64)) - #~(begin - #+(if need-gnutls? - - ;; Add GnuTLS to the inputs and to the load path. - #~(eval-when (load expand eval) - (set! %load-path - (cons (string-append #+(gnutls-package) - "/share/guile/site/" - (effective-version)) - %load-path))) - #~#t) - - (use-modules (guix build download) - (guix base32)) - - (let ((value-from-environment (lambda (variable) - (call-with-input-string - (getenv variable) - read)))) - (url-fetch (value-from-environment "guix download url") - #$output - #:mirrors (call-with-input-file #$mirrors read) - - ;; Content-addressed mirrors. - #:hashes - (value-from-environment "guix download hashes") - #:content-addressed-mirrors - (primitive-load #$content-addressed-mirrors) - - ;; No need to validate certificates since we know the - ;; hash of the expected result. - #:verify-certificate? #f))))) - - (mlet %store-monad ((guile (package->derivation guile system))) - (gexp->derivation file-name builder - #:guile-for-build guile - #:system system - #:hash-algo hash-algo - #:hash hash - - ;; Use environment variables and a fixed script - ;; name so there's only one script in store for - ;; all the downloads. - #:script-name "download" - #:env-vars - `(("guix download url" . ,(object->string url)) - ("guix download hashes" - . ,(object->string `((,hash-algo . ,hash))))) - - ;; Honor the user's proxy settings. - #:leaked-env-vars '("http_proxy" "https_proxy") - - ;; In general, offloading downloads is not a good - ;; idea. Daemons before 0.8.3 would also - ;; interpret this as "do not substitute" (see - ;; <https://bugs.gnu.org/18747>.) - #:local-build? #t))) - (define* (url-fetch url hash-algo hash #:optional name #:key (system (%current-system)) @@ -556,18 +473,21 @@ in the store." (and uri (memq (uri-scheme uri) '(#f file)))) (interned-file (if uri (uri-path uri) url) (or name file-name)) - (mlet* %store-monad ((builtins (built-in-builders*)) - (download -> (if (member "download" builtins) - built-in-download - in-band-download))) - (download (or name file-name) url - #:guile guile - #:system system - #:hash-algo hash-algo - #:hash hash - #:mirrors %mirror-file - #:content-addressed-mirrors - %content-addressed-mirror-file))))) + (mlet %store-monad ((builtins (built-in-builders*))) + ;; The "download" built-in builder was added in guix-daemon in + ;; Nov. 2016 and made it in the 0.12.0 release of Dec. 2016. We now + ;; require it. + (unless (member "download" builtins) + (error "'guix-daemon' is too old, please upgrade" builtins)) + + (built-in-download (or name file-name) url + #:guile guile + #:system system + #:hash-algo hash-algo + #:hash hash + #:mirrors %mirror-file + #:content-addressed-mirrors + %content-addressed-mirror-file))))) (define* (url-fetch/tarbomb url hash-algo hash #:optional name diff --git a/guix/packages.scm b/guix/packages.scm index 7d884aa366..b5c0b60440 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -538,7 +538,8 @@ specifies modules in scope when evaluating SNIPPET." (setenv "LOCPATH" (string-append #+locales "/lib/locale/" #+(and locales - (package-version locales)))) + (version-major+minor + (package-version locales))))) (setlocale LC_ALL "en_US.utf8")) (setenv "PATH" (string-append #+xz "/bin" ":" @@ -619,6 +620,9 @@ itself. This is implemented as a breadth-first traversal such that INPUTS is preserved, and only duplicate propagated inputs are removed." (define (seen? seen item outputs) + ;; FIXME: We're using pointer identity here, which is extremely sensitive + ;; to memoization in package-producing procedures; see + ;; <https://bugs.gnu.org/30155>. (match (vhash-assq item seen) ((_ . o) (equal? o outputs)) (_ #f))) diff --git a/guix/profiles.scm b/guix/profiles.scm index 3c05543bec..8e3e49e444 100644 --- a/guix/profiles.scm +++ b/guix/profiles.scm @@ -813,7 +813,8 @@ MANIFEST. Single-file bundles are required by programs such as Git and Lynx." ;; install a UTF-8 locale. (setenv "LOCPATH" (string-append #+glibc-utf8-locales "/lib/locale/" - #+(package-version glibc-utf8-locales))) + #+(version-major+minor + (package-version glibc-utf8-locales)))) (setlocale LC_ALL "en_US.utf8") (match (append-map ca-files '#$(manifest-inputs manifest)) @@ -1244,7 +1245,8 @@ are cross-built for TARGET." #~(begin (setenv "LOCPATH" #$(file-append glibc-utf8-locales "/lib/locale/" - (package-version glibc-utf8-locales))) + (version-major+minor + (package-version glibc-utf8-locales)))) (setlocale LC_ALL "en_US.utf8"))) (define builder |