From 7cffaeb60473e25a7ef8c1a8cb36e1531191873a Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 6 Apr 2016 23:19:00 +0200 Subject: challenge: Really exit with non-zero upon hash mismatch. Reported by John Darrington. * guix/scripts/challenge.scm (guix-challenge): Add an explicit 'exit' call when ISSUES is empty. * scripts/guix.in: Add comment about 'exit'. * doc/guix.texi (Invoking guix challenge): Mention the behavior and exit code. --- guix/scripts/challenge.scm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'guix') diff --git a/guix/scripts/challenge.scm b/guix/scripts/challenge.scm index 4a0c865b07..0eb49da0cc 100644 --- a/guix/scripts/challenge.scm +++ b/guix/scripts/challenge.scm @@ -233,9 +233,11 @@ Challenge the substitutes for PACKAGE... provided by one or more servers.\n")) (run-with-store store (mlet* %store-monad ((items (mapm %store-monad - ensure-store-item files)) + ensure-store-item files)) (issues (discrepancies items urls))) (for-each summarize-discrepancy issues) + (unless (null? issues) + (exit 1)) (return (null? issues))) #:system system))))))) -- cgit v1.2.3 From fe463dbcf7093746af541f85af4081c766e0cbed Mon Sep 17 00:00:00 2001 From: David Thompson Date: Thu, 31 Mar 2016 15:43:18 -0400 Subject: environment: container: Work around read-only /etc/resolv.conf issue. * guix/scripts/environment.scm (launch-environment/container): Mount /etc/resolv.conf as a writable file. --- guix/scripts/environment.scm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'guix') diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm index 0ec2c5d3cb..d4c09ef54c 100644 --- a/guix/scripts/environment.scm +++ b/guix/scripts/environment.scm @@ -406,7 +406,15 @@ host file systems to mount inside the container." (file-system-mapping (source file) (target file) - (writable? #f)))) + ;; XXX: On some GNU/Linux + ;; systems, /etc/resolv.conf is a + ;; symlink to a file in a tmpfs + ;; which, for an unknown reason, + ;; cannot be bind mounted + ;; read-only within the + ;; container. + (writable? + (string=? "/etc/resolv.conf"))))) %network-configuration-files) '()) ;; Mappings for the union closure of all inputs. -- cgit v1.2.3 From 50a3d59473acf9fb5e771b57528b09d3e66123c4 Mon Sep 17 00:00:00 2001 From: 宋文武 Date: Wed, 6 Apr 2016 17:35:13 +0800 Subject: utils: Add 'edit-expression'. * guix/utils.scm (edit-expression): New procedure. * tests/utils.scm (edit-expression): New test. --- guix/utils.scm | 40 ++++++++++++++++++++++++++++++++++++++++ tests/utils.scm | 13 +++++++++++++ 2 files changed, 53 insertions(+) (limited to 'guix') diff --git a/guix/utils.scm b/guix/utils.scm index de541799fa..f566a994eb 100644 --- a/guix/utils.scm +++ b/guix/utils.scm @@ -41,6 +41,7 @@ #:use-module (ice-9 regex) #:use-module (ice-9 match) #:use-module (ice-9 format) + #:use-module ((ice-9 iconv) #:select (bytevector->string)) #:use-module (system foreign) #:export (bytevector->base16-string base16-string->bytevector @@ -86,6 +87,7 @@ split cache-directory readlink* + edit-expression filtered-port compressed-port @@ -318,6 +320,44 @@ a list of command-line arguments passed to the compression program." (unless (every (compose zero? cdr waitpid) pids) (error "compressed-output-port failure" pids)))))) +(define* (edit-expression source-properties proc #:key (encoding "UTF-8")) + "Edit the expression specified by SOURCE-PROPERTIES using PROC, which should +be a procedure that takes the original expression in string and returns a new +one. ENCODING will be used to interpret all port I/O, it default to UTF-8. +This procedure returns #t on success." + (with-fluids ((%default-port-encoding encoding)) + (let* ((file (assq-ref source-properties 'filename)) + (line (assq-ref source-properties 'line)) + (column (assq-ref source-properties 'column)) + (in (open-input-file file)) + ;; The start byte position of the expression. + (start (begin (while (not (and (= line (port-line in)) + (= column (port-column in)))) + (when (eof-object? (read-char in)) + (error (format #f "~a: end of file~%" in)))) + (ftell in))) + ;; The end byte position of the expression. + (end (begin (read in) (ftell in)))) + (seek in 0 SEEK_SET) ; read from the beginning of the file. + (let* ((pre-bv (get-bytevector-n in start)) + ;; The expression in string form. + (str (bytevector->string + (get-bytevector-n in (- end start)) + (port-encoding in))) + (post-bv (get-bytevector-all in)) + (str* (proc str))) + ;; Verify the edited expression is still a scheme expression. + (call-with-input-string str* read) + ;; Update the file with edited expression. + (with-atomic-file-output file + (lambda (out) + (put-bytevector out pre-bv) + (display str* out) + ;; post-bv maybe the end-of-file object. + (when (not (eof-object? post-bv)) + (put-bytevector out post-bv)) + #t)))))) + ;;; ;;; Advisory file locking. diff --git a/tests/utils.scm b/tests/utils.scm index 6b7725554f..d0ee02a1cf 100644 --- a/tests/utils.scm +++ b/tests/utils.scm @@ -333,6 +333,19 @@ "This is a journey\r\nInto the sound\r\nA journey ...\n"))) (get-string-all (canonical-newline-port port)))) + +(test-equal "edit-expression" + "(display \"GNU Guix\")\n(newline)\n" + (begin + (call-with-output-file temp-file + (lambda (port) + (display "(display \"xiuG UNG\")\n(newline)\n" port))) + (edit-expression `((filename . ,temp-file) + (line . 0) + (column . 9)) + string-reverse) + (call-with-input-file temp-file get-string-all))) + (test-end) (false-if-exception (delete-file temp-file)) -- cgit v1.2.3 From f7df1e3efb4d4a67065b0eddc7eb02a8cb81fa21 Mon Sep 17 00:00:00 2001 From: 宋文武 Date: Wed, 6 Apr 2016 18:31:12 +0800 Subject: utils: Add 'location->source-properties'. * guix/utils (location-source->properties): New procedure. --- guix/utils.scm | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'guix') diff --git a/guix/utils.scm b/guix/utils.scm index f566a994eb..a0e9439dd3 100644 --- a/guix/utils.scm +++ b/guix/utils.scm @@ -61,6 +61,7 @@ location-line location-column source-properties->location + location->source-properties nix-system->gnu-triplet gnu-triplet->nix-system @@ -895,3 +896,10 @@ etc." ;; In accordance with the GCS, start line and column numbers at 1. Note ;; that unlike LINE and `port-column', COL is actually 1-indexed here... (location file (and line (+ line 1)) col))) + +(define (location->source-properties loc) + "Return the source property association list based on the info in LOC, +a location object." + `((line . ,(and=> (location-line loc) 1-)) + (column . ,(location-column loc)) + (filename . ,(location-file loc)))) -- cgit v1.2.3 From 2b8e9d9ed4273d5ea42cc79510b61fe71a398901 Mon Sep 17 00:00:00 2001 From: 宋文武 Date: Wed, 6 Apr 2016 18:32:20 +0800 Subject: gnu-maintenance: update-package-source: Only update the desired package. Fixes . Suggested by Andy Wingo. * guix/upstream.scm (update-package-source): Rewrite in terms of 'edit-expression'. --- guix/upstream.scm | 68 +++++++++++++++++++------------------------------------ 1 file changed, 23 insertions(+), 45 deletions(-) (limited to 'guix') diff --git a/guix/upstream.scm b/guix/upstream.scm index cea23feb82..02c50c06c8 100644 --- a/guix/upstream.scm +++ b/guix/upstream.scm @@ -22,8 +22,6 @@ #:use-module (guix utils) #:use-module ((guix download) #:select (download-to-store)) - #:use-module ((guix build utils) - #:select (substitute)) #:use-module (guix gnupg) #:use-module (guix packages) #:use-module (guix ui) @@ -205,52 +203,32 @@ and 'interactive' (default)." "Modify the source file that defines PACKAGE to refer to VERSION, whose tarball has SHA256 HASH (a bytevector). Return the new version string if an update was made, and #f otherwise." - (define (new-line line matches replacement) - ;; Iterate over MATCHES and return the modified line based on LINE. - ;; Replace each match with REPLACEMENT. - (let loop ((m* matches) ; matches - (o 0) ; offset in L - (r '())) ; result - (match m* - (() - (let ((r (cons (substring line o) r))) - (string-concatenate-reverse r))) - ((m . rest) - (loop rest - (match:end m) - (cons* replacement - (substring line o (match:start m)) - r)))))) - - (define (update-source file old-version version - old-hash hash) - ;; Update source file FILE, replacing occurrences OLD-VERSION by VERSION - ;; and occurrences of OLD-HASH by HASH (base32 representation thereof). - - ;; TODO: Currently this is a bit of a sledgehammer: if VERSION occurs in - ;; different unrelated places, we may modify it more than needed, for - ;; instance. We should try to make changes only within the sexp that - ;; corresponds to the definition of PACKAGE. + (define (update-expression expr old-version version old-hash hash) + ;; Update package expression EXPR, replacing occurrences OLD-VERSION by + ;; VERSION and occurrences of OLD-HASH by HASH (base32 representation + ;; thereof). (let ((old-hash (bytevector->nix-base32-string old-hash)) (hash (bytevector->nix-base32-string hash))) - (substitute file - `((,(regexp-quote old-version) - . ,(cut new-line <> <> version)) - (,(regexp-quote old-hash) - . ,(cut new-line <> <> hash)))) - version)) - - (let ((name (package-name package)) - (loc (package-field-location package 'version))) - (if loc - (let ((old-version (package-version package)) - (old-hash (origin-sha256 (package-source package))) - (file (and=> (location-file loc) - (cut search-path %load-path <>)))) + (string-replace-substring + (string-replace-substring expr old-hash hash) + old-version version))) + + (let ((name (package-name package)) + (version-loc (package-field-location package 'version))) + (if version-loc + (let* ((loc (package-location package)) + (old-version (package-version package)) + (old-hash (origin-sha256 (package-source package))) + (file (and=> (location-file loc) + (cut search-path %load-path <>)))) (if file - (update-source file - old-version version - old-hash hash) + (and (edit-expression + ;; Be sure to use absolute filename. + (assq-set! (location->source-properties loc) + 'filename file) + (cut update-expression <> + old-version version old-hash hash)) + version) (begin (warning (_ "~a: could not locate source file") (location-file loc)) -- cgit v1.2.3 From 82fd23b81f6ab71ef4bc5f95f273bd77dbe6baf5 Mon Sep 17 00:00:00 2001 From: Alex Kost Date: Tue, 12 Apr 2016 11:14:59 +0300 Subject: download: Follow HTTP 307 "Temporary Redirection". MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes . Reported by Albin Söderqvist . * guix/build/download.scm (http-fetch): Follow redirections upon 307. This is what 'binaries.openttd.org' does. --- guix/build/download.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'guix') diff --git a/guix/build/download.scm b/guix/build/download.scm index 0568800d7f..fb236d314a 100644 --- a/guix/build/download.scm +++ b/guix/build/download.scm @@ -530,7 +530,8 @@ Return the resulting target URI." (put-bytevector p bv-or-port)))) file)) ((301 ; moved permanently - 302) ; found (redirection) + 302 ; found (redirection) + 307) ; temporary redirection (let ((uri (resolve-uri-reference (response-location resp) uri))) (format #t "following redirection to `~a'...~%" (uri->string uri)) -- cgit v1.2.3 From 013c3fb8c70f0d651d8ae1b654fa70ccde815b53 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Fri, 8 Apr 2016 17:59:12 +0200 Subject: lint: Emit an ANSI erase-in-line sequence. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * guix/scripts/lint.scm (run-checkers): Add '\x1b[K' to progress messages and after 'for-each'. Signed-off-by: Ludovic Courtès --- guix/scripts/lint.scm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'guix') diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm index 27b9e155ec..d2fed67e13 100644 --- a/guix/scripts/lint.scm +++ b/guix/scripts/lint.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2014, 2015 Eric Bavier ;;; Copyright © 2013, 2014, 2015, 2016 Ludovic Courtès ;;; Copyright © 2015, 2016 Mathieu Lirzin +;;; Copyright © 2016 Danny Milosavljevic ;;; ;;; This file is part of GNU Guix. ;;; @@ -799,11 +800,14 @@ or a list thereof") (name (package-full-name package))) (for-each (lambda (checker) (when tty? - (format (current-error-port) "checking ~a [~a]...\r" + (format (current-error-port) "checking ~a [~a]...\x1b[K\r" name (lint-checker-name checker)) (force-output (current-error-port))) ((lint-checker-check checker) package)) - checkers))) + checkers) + (when tty? + (format (current-error-port) "\x1b[K") + (force-output (current-error-port))))) ;;; -- cgit v1.2.3 From 7d27a0259bc7a37c04b17ffc2953837fcc3e75ff Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 14 Apr 2016 21:40:20 +0200 Subject: upstream: Pass a package object to updaters. * guix/upstream.scm (package-update-path): Pass PACKAGE to 'latest-release'. * guix/gnu-maintenance.scm (latest-release*) (latest-gnome-release, latest-xorg-release): Adjust accordingly. * guix/import/cran.scm (latest-cran-release): (latest-bioconductor-release): Likewise. * guix/import/elpa.scm (latest-release): Likewise. * guix/import/gem.scm (latest-release): Likewise. * guix/import/github.scm (latest-release): Likewise. * guix/import/hackage.scm (latest-release): Likewise. * guix/import/pypi.scm (latest-release): Likewise. --- guix/gnu-maintenance.scm | 11 +++++------ guix/import/cran.scm | 11 +++++------ guix/import/elpa.scm | 14 ++++++-------- guix/import/gem.scm | 10 ++++------ guix/import/github.scm | 10 ++++------ guix/import/hackage.scm | 10 ++++------ guix/import/pypi.scm | 10 ++++------ guix/upstream.scm | 6 +++--- 8 files changed, 35 insertions(+), 47 deletions(-) (limited to 'guix') diff --git a/guix/gnu-maintenance.scm b/guix/gnu-maintenance.scm index 9d720ca030..f97f2d1692 100644 --- a/guix/gnu-maintenance.scm +++ b/guix/gnu-maintenance.scm @@ -33,7 +33,6 @@ #:use-module (guix records) #:use-module (guix upstream) #:use-module (guix packages) - #:use-module (gnu packages) #:export (gnu-package-name gnu-package-mundane-name gnu-package-copyright-holder @@ -435,7 +434,7 @@ of EXP otherwise." "Like 'latest-release', but ignore FTP errors that might occur when PACKAGE is not actually a GNU package, or not hosted on ftp.gnu.org, or not under that name (this is the case for \"emacs-auctex\", for instance.)" - (false-if-ftp-error (latest-release package))) + (false-if-ftp-error (latest-release (package-name package)))) (define %package-name-rx ;; Regexp for a package name, e.g., "foo-X.Y". Since TeXmacs uses @@ -493,10 +492,10 @@ elpa.gnu.org, and all the GNOME packages." (even-minor-version? (or version name)))) (false-if-ftp-error - (latest-ftp-release package + (latest-ftp-release (package-name package) #:server "ftp.gnome.org" #:directory (string-append "/pub/gnome/sources/" - (match package + (match (package-name package) ("gconf" "GConf") (x x))) @@ -528,10 +527,10 @@ elpa.gnu.org, and all the GNOME packages." (define (latest-xorg-release package) "Return the latest release of PACKAGE, the name of an X.org package." - (let ((uri (string->uri (origin-uri (package-source (specification->package package)))))) + (let ((uri (string->uri (origin-uri (package-source package))))) (false-if-ftp-error (latest-ftp-release - package + (package-name package) #:server "ftp.freedesktop.org" #:directory (string-append "/pub/xorg/" (dirname (uri-path uri))))))) diff --git a/guix/import/cran.scm b/guix/import/cran.scm index 562917c0a0..69485bc88d 100644 --- a/guix/import/cran.scm +++ b/guix/import/cran.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2015 Ricardo Wurmus -;;; Copyright © 2015 Ludovic Courtès +;;; Copyright © 2015, 2016 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -32,7 +32,6 @@ #:use-module ((guix build-system r) #:select (cran-uri bioconductor-uri)) #:use-module (guix upstream) #:use-module (guix packages) - #:use-module (gnu packages) #:export (cran->guix-package bioconductor->guix-package %cran-updater @@ -240,7 +239,7 @@ s-expression corresponding to that package, or #f on failure." "Return an for the latest release of PACKAGE." (define upstream-name - (package->upstream-name (specification->package package))) + (package->upstream-name package)) (define meta (fetch-description %cran-url upstream-name)) @@ -249,7 +248,7 @@ s-expression corresponding to that package, or #f on failure." (let ((version (assoc-ref meta "Version"))) ;; CRAN does not provide signatures. (upstream-source - (package package) + (package (package-name package)) (version version) (urls (cran-uri upstream-name version)))))) @@ -257,7 +256,7 @@ s-expression corresponding to that package, or #f on failure." "Return an for the latest release of PACKAGE." (define upstream-name - (package->upstream-name (specification->package package))) + (package->upstream-name package)) (define meta (fetch-description %bioconductor-svn-url upstream-name)) @@ -266,7 +265,7 @@ s-expression corresponding to that package, or #f on failure." (let ((version (assoc-ref meta "Version"))) ;; Bioconductor does not provide signatures. (upstream-source - (package package) + (package (package-name package)) (version version) (urls (bioconductor-uri upstream-name version)))))) diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm index 529de4f232..ccc4063a53 100644 --- a/guix/import/elpa.scm +++ b/guix/import/elpa.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2015 Federico Beffa -;;; Copyright © 2015 Ludovic Courtès +;;; Copyright © 2015, 2016 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -239,13 +239,11 @@ type ''." ;;; (define (latest-release package) - "Return an for the latest release of PACKAGE. PACKAGE -may be a Guix package name such as \"emacs-debbugs\" or an upstream name such -as \"debbugs\"." + "Return an for the latest release of PACKAGE." (define name - (if (string-prefix? "emacs-" package) - (string-drop package 6) - package)) + (if (string-prefix? "emacs-" (package-name package)) + (string-drop (package-name package) 6) + (package-name package))) (let* ((repo 'gnu) (info (elpa-package-info name repo)) @@ -256,7 +254,7 @@ as \"debbugs\"." ((_ raw-version reqs synopsis kind . rest) (package-source-url kind name version repo))))) (upstream-source - (package package) + (package (package-name package)) (version version) (urls (list url)) (signature-urls (list (string-append url ".sig")))))) diff --git a/guix/import/gem.scm b/guix/import/gem.scm index b46622f00d..fc06b0d748 100644 --- a/guix/import/gem.scm +++ b/guix/import/gem.scm @@ -32,7 +32,6 @@ #:use-module (guix licenses) #:use-module (guix base32) #:use-module (guix build-system ruby) - #:use-module (gnu packages) #:export (gem->guix-package %gem-updater)) @@ -171,15 +170,14 @@ package on RubyGems." ((source-url ...) (any rubygems-url? source-url)))))) -(define (latest-release guix-package) - "Return an for the latest release of GUIX-PACKAGE." - (let* ((gem-name (guix-package->gem-name - (specification->package guix-package))) +(define (latest-release package) + "Return an for the latest release of PACKAGE." + (let* ((gem-name (guix-package->gem-name package)) (metadata (rubygems-fetch gem-name)) (version (assoc-ref metadata "version")) (url (rubygems-uri gem-name version))) (upstream-source - (package guix-package) + (package (package-name package)) (version version) (urls (list url))))) diff --git a/guix/import/github.scm b/guix/import/github.scm index c696dcb363..29116d79f0 100644 --- a/guix/import/github.scm +++ b/guix/import/github.scm @@ -25,7 +25,6 @@ #:use-module (guix import utils) #:use-module (guix packages) #:use-module (guix upstream) - #:use-module (gnu packages) #:use-module (web uri) #:export (%github-updater)) @@ -175,15 +174,14 @@ https://github.com/settings/tokens")) (if (eq? (string-ref tag 0) #\v) (substring tag 1) tag))))))))) -(define (latest-release guix-package) - "Return an for the latest release of GUIX-PACKAGE." - (let* ((pkg (specification->package guix-package)) - (source-uri (origin-uri (package-source pkg))) +(define (latest-release pkg) + "Return an for the latest release of PKG." + (let* ((source-uri (origin-uri (package-source pkg))) (name (package-name pkg)) (newest-version (latest-released-version source-uri name))) (if newest-version (upstream-source - (package pkg) + (package name) (version newest-version) (urls (list (updated-github-url pkg newest-version)))) #f))) ; On GitHub but no proper releases diff --git a/guix/import/hackage.scm b/guix/import/hackage.scm index 640ead24f3..f07f453e11 100644 --- a/guix/import/hackage.scm +++ b/guix/import/hackage.scm @@ -23,7 +23,6 @@ #:use-module (srfi srfi-26) #:use-module (srfi srfi-11) #:use-module (srfi srfi-1) - #:use-module (gnu packages) #:use-module ((guix download) #:select (download-to-store url-fetch)) #:use-module ((guix utils) #:select (package-name->name+version canonical-newline-port)) @@ -269,10 +268,9 @@ respectively." ((source-url ...) (any haskell-url? source-url)))))) -(define (latest-release guix-package) - "Return an for the latest release of GUIX-PACKAGE." - (let* ((hackage-name (guix-package->hackage-name - (specification->package guix-package))) +(define (latest-release package) + "Return an for the latest release of PACKAGE." + (let* ((hackage-name (guix-package->hackage-name package)) (cabal-meta (hackage-fetch hackage-name))) (match cabal-meta (#f @@ -283,7 +281,7 @@ respectively." ((_ *** ("version" (version))) (let ((url (hackage-source-url hackage-name version))) (upstream-source - (package guix-package) + (package (package-name package)) (version version) (urls (list url)))))))) diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm index 8ae4948147..de30f4bea6 100644 --- a/guix/import/pypi.scm +++ b/guix/import/pypi.scm @@ -40,7 +40,6 @@ #:use-module (guix upstream) #:use-module (guix licenses) #:use-module (guix build-system python) - #:use-module (gnu packages) #:use-module (gnu packages python) #:export (pypi->guix-package %pypi-updater)) @@ -248,16 +247,15 @@ VERSION, SOURCE-URL, HOME-PAGE, SYNOPSIS, DESCRIPTION, and LICENSE." ((source-url ...) (any pypi-url? source-url)))))) -(define (latest-release guix-package) - "Return an for the latest release of GUIX-PACKAGE." +(define (latest-release package) + "Return an for the latest release of PACKAGE." (guard (c ((missing-source-error? c) #f)) - (let* ((pypi-name (guix-package->pypi-name - (specification->package guix-package))) + (let* ((pypi-name (guix-package->pypi-name package)) (metadata (pypi-fetch pypi-name)) (version (assoc-ref* metadata "info" "version")) (url (assoc-ref (latest-source-release metadata) "url"))) (upstream-source - (package guix-package) + (package (package-name package)) (version version) (urls (list url)))))) diff --git a/guix/upstream.scm b/guix/upstream.scm index 02c50c06c8..167c9ff89a 100644 --- a/guix/upstream.scm +++ b/guix/upstream.scm @@ -128,11 +128,11 @@ them matches." updaters)) (define (package-update-path package updaters) - "Return an upstream source to update PACKAGE to, or #f if no update is -needed or known." + "Return an upstream source to update PACKAGE, a object, or #f if +no update is needed or known." (match (lookup-updater package updaters) ((? procedure? latest-release) - (match (latest-release (package-name package)) + (match (latest-release package) ((and source ($ name version)) (and (version>? version (package-version package)) source)) -- cgit v1.2.3 From 444bb0d857e5c5a4113ae6cb99e47c5306cdd72b Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 14 Apr 2016 21:48:05 +0200 Subject: gnu-maintenance: Recognize source tarball with "-src" in their name. * guix/gnu-maintenance.scm (tarball->version): Add special case for tarball names containing "-src". --- guix/gnu-maintenance.scm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'guix') diff --git a/guix/gnu-maintenance.scm b/guix/gnu-maintenance.scm index f97f2d1692..353892f36d 100644 --- a/guix/gnu-maintenance.scm +++ b/guix/gnu-maintenance.scm @@ -258,9 +258,13 @@ true." (lambda (match) ;; Filter out unrelated files, like `guile-www-1.1.1'. ;; Case-insensitive for things like "TeXmacs" vs. "texmacs". + ;; The "-src" suffix is for "freefont-src-20120503.tar.gz". (and=> (match:substring match 1) (lambda (name) - (string-ci=? name project))))) + (or (string-ci=? name project) + (string-ci=? name + (string-append project + "-src"))))))) (not (regexp-exec %alpha-tarball-rx file)) (let ((s (sans-extension file))) (regexp-exec %package-name-rx s)))) -- cgit v1.2.3 From 63e8bb12a46fe6ff493e674fd7ccceb8729c6b47 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 14 Apr 2016 22:18:56 +0200 Subject: gnu-maintenance: Move FTP directory info to 'properties' fields. * guix/gnu-maintenance.scm (ftp-server/directory): Rewrite to honor PACKAGE's properties. Remove list of quirks. (releases): Add #:server and #:directory parameters. Remove call to 'ftp-server/directory'. (latest-release): Likewise. (latest-release*): Add call to 'ftp-server/directory'. Honor 'upstream-name' property of PACKAGE. * gnu/packages/fonts.scm (font-gnu-freefont-ttf): Add 'properties' field. * gnu/packages/gnupg.scm (libgpg-error, libgcrypt, libassuan): (libksba, gnupg): Likewise. * gnu/packages/gnuzilla.scm (icecat): Likewise. * gnu/packages/package-management.scm (guix-0.10.0): Likewise. * gnu/packages/pretty-print.scm (source-highlight): Likewise. * gnu/packages/scheme.scm (mit-scheme): Likewise. * gnu/packages/telephony.scm (ucommon): Likewise. * gnu/packages/tls.scm (gnutls): Likewise. --- gnu/packages/fonts.scm | 4 +- gnu/packages/gnupg.scm | 22 +++-- gnu/packages/gnuzilla.scm | 5 +- gnu/packages/package-management.scm | 3 +- gnu/packages/pretty-print.scm | 3 +- gnu/packages/scheme.scm | 5 +- gnu/packages/telephony.scm | 3 +- gnu/packages/tls.scm | 4 +- guix/gnu-maintenance.scm | 155 +++++++++++++++++------------------- 9 files changed, 105 insertions(+), 99 deletions(-) (limited to 'guix') diff --git a/gnu/packages/fonts.scm b/gnu/packages/fonts.scm index 3d75591560..aa78926d17 100644 --- a/gnu/packages/fonts.scm +++ b/gnu/packages/fonts.scm @@ -306,7 +306,9 @@ sans-serif designed for on-screen reading. It is used by GNOME@tie{}3.") "The GNU Freefont project aims to provide a set of free outline (PostScript Type0, TrueType, OpenType...) fonts covering the ISO 10646/Unicode UCS (Universal Character Set).") - (license license:gpl3+))) + (license license:gpl3+) + (properties '((upstream-name . "freefont") + (ftp-directory . "/gnu/freefont"))))) (define-public font-liberation (package diff --git a/gnu/packages/gnupg.scm b/gnu/packages/gnupg.scm index 5ed6885cab..b6c1233497 100644 --- a/gnu/packages/gnupg.scm +++ b/gnu/packages/gnupg.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès +;;; Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès ;;; Copyright © 2013, 2015 Andreas Enge ;;; Copyright © 2014 Eric Bavier ;;; Copyright © 2014, 2015, 2016 Mark H Weaver @@ -65,7 +65,9 @@ for all GnuPG components. Among these are GPG, GPGSM, GPGME, GPG-Agent, libgcrypt, Libksba, DirMngr, Pinentry, SmartCard Daemon and possibly more in the future.") - (license license:lgpl2.0+))) + (license license:lgpl2.0+) + (properties '((ftp-server . "ftp.gnupg.org") + (ftp-directory . "/gcrypt/libgpg-error"))))) (define-public libgcrypt (package @@ -99,7 +101,9 @@ Daemon and possibly more in the future.") standard cryptographic building blocks such as symmetric ciphers, hash algorithms, public key algorithms, large integer functions and random number generation.") - (license license:lgpl2.0+))) + (license license:lgpl2.0+) + (properties '((ftp-server . "ftp.gnupg.org") + (ftp-directory . "/gcrypt/libgcrypt"))))) (define-public libgcrypt-1.5 (package (inherit libgcrypt) @@ -136,7 +140,9 @@ generation.") protocol. This protocol is used for IPC between most newer GnuPG components. Both, server and client side functions are provided.") - (license license:lgpl2.0+))) + (license license:lgpl2.0+) + (properties '((ftp-server . "ftp.gnupg.org") + (ftp-directory . "/gcrypt/libassuan"))))) (define-public libksba (package @@ -169,7 +175,9 @@ provided.") "KSBA (pronounced Kasbah) is a library to make X.509 certificates as well as the CMS easily accessible by other applications. Both specifications are building blocks of S/MIME and TLS.") - (license license:gpl3+))) + (license license:gpl3+) + (properties '((ftp-server . "ftp.gnupg.org") + (ftp-directory . "/gcrypt/libksba"))))) (define-public npth (package @@ -243,7 +251,9 @@ features powerful key management and the ability to access public key servers. It includes several libraries: libassuan (IPC between GnuPG components), libgpg-error (centralized GnuPG error values), and libskba (working with X.509 certificates and CMS data).") - (license license:gpl3+))) + (license license:gpl3+) + (properties '((ftp-server . "ftp.gnupg.org") + (ftp-directory . "/gcrypt/gnupg"))))) (define-public gnupg-2.0 (package (inherit gnupg) diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm index b2717b8cdb..bf20a4e05f 100644 --- a/gnu/packages/gnuzilla.scm +++ b/gnu/packages/gnuzilla.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013, 2015 Andreas Enge -;;; Copyright © 2013, 2014, 2015 Ludovic Courtès +;;; Copyright © 2013, 2014, 2015, 2016 Ludovic Courtès ;;; Copyright © 2014, 2015, 2016 Mark H Weaver ;;; Copyright © 2015 Sou Bunnbu ;;; Copyright © 2016 Efraim Flashner @@ -508,4 +508,5 @@ standards.") "IceCat is the GNU version of the Firefox browser. It is entirely free software, which does not recommend non-free plugins and addons. It also features built-in privacy-protecting features.") - (license license:mpl2.0))) ; and others, see toolkit/content/license.html + (license license:mpl2.0) ;and others, see toolkit/content/license.html + (properties '((ftp-directory . "/gnu/gnuzilla"))))) diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm index 38c9bdb7d1..46ebde80ca 100644 --- a/gnu/packages/package-management.scm +++ b/gnu/packages/package-management.scm @@ -195,7 +195,8 @@ also a distribution thereof. It includes a virtual machine image. Besides the usual package management features, it also supports transactional upgrades and roll-backs, per-user profiles, and much more. It is based on the Nix package manager.") - (license gpl3+))) + (license gpl3+) + (properties '((ftp-server . "alpha.gnu.org"))))) (define guix-devel ;; Development version of Guix. diff --git a/gnu/packages/pretty-print.scm b/gnu/packages/pretty-print.scm index 7c0f50d467..a1692dd4de 100644 --- a/gnu/packages/pretty-print.scm +++ b/gnu/packages/pretty-print.scm @@ -191,7 +191,8 @@ their syntactic role. It supports over 150 different languages and it can output to 8 different formats, including HTML, LaTeX and ODF. It can also output to ANSI color escape sequences, so that highlighted source code can be seen in a terminal.") - (license gpl3+))) + (license gpl3+) + (properties '((ftp-directory . "/gnu/src-highlite"))))) (define-public astyle (package diff --git a/gnu/packages/scheme.scm b/gnu/packages/scheme.scm index f9537d72b2..6cf75c2471 100644 --- a/gnu/packages/scheme.scm +++ b/gnu/packages/scheme.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014, 2015 Ludovic Courtès +;;; Copyright © 2013, 2014, 2015, 2016 Ludovic Courtès ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer ;;; Copyright © 2015 Federico Beffa ;;; Copyright © 2016 Ricardo Wurmus @@ -174,7 +174,8 @@ "GNU/MIT Scheme is an implementation of the Scheme programming language. It provides an interpreter, a compiler and a debugger. It also features an integrated Emacs-like editor and a large runtime library.") - (license gpl2+))) + (license gpl2+) + (properties '((ftp-directory . "/gnu/mit-scheme/stable.pkg"))))) (define-public bigloo (package diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm index 76e369a563..50a83fbcf3 100644 --- a/gnu/packages/telephony.scm +++ b/gnu/packages/telephony.scm @@ -76,7 +76,8 @@ to facilitate using C++ design patterns even for very deeply embedded applications, such as for systems using uclibc along with posix threading support.") (license gpl3+) - (home-page "http://www.gnu.org/software/commoncpp"))) + (home-page "http://www.gnu.org/software/commoncpp") + (properties '((ftp-directory . "/gnu/commoncpp"))))) (define-public ccrtp (package diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm index cb538362b7..fac26b8bda 100644 --- a/gnu/packages/tls.scm +++ b/gnu/packages/tls.scm @@ -176,7 +176,9 @@ living in the same process.") and DTLS protocols. It is provided in the form of a C library to support the protocols, as well as to parse and write X.5009, PKCS 12, OpenPGP and other required structures.") - (license license:lgpl2.1+))) + (license license:lgpl2.1+) + (properties '((ftp-server . "ftp.gnutls.org") + (ftp-directory . "/gcrypt/gnutls"))))) (define-public openssl (package diff --git a/guix/gnu-maintenance.scm b/guix/gnu-maintenance.scm index 353892f36d..8021d99c8b 100644 --- a/guix/gnu-maintenance.scm +++ b/guix/gnu-maintenance.scm @@ -206,34 +206,12 @@ network to check in GNU's database." ;;; Latest release. ;;; -(define (ftp-server/directory project) - "Return the FTP server and directory where PROJECT's tarball are -stored." - (define quirks - '(("commoncpp2" "ftp.gnu.org" "/gnu/commoncpp") - ("ucommon" "ftp.gnu.org" "/gnu/commoncpp") - ("libzrtpcpp" "ftp.gnu.org" "/gnu/ccrtp") - ("libosip2" "ftp.gnu.org" "/gnu/osip") - ("libgcrypt" "ftp.gnupg.org" "/gcrypt/libgcrypt") - ("libgpg-error" "ftp.gnupg.org" "/gcrypt/libgpg-error") - ("libassuan" "ftp.gnupg.org" "/gcrypt/libassuan") - ("gnupg" "ftp.gnupg.org" "/gcrypt/gnupg") - ("freefont-ttf" "ftp.gnu.org" "/gnu/freefont") - ("gnu-ghostscript" "ftp.gnu.org" "/gnu/ghostscript") - ("mit-scheme" "ftp.gnu.org" "/gnu/mit-scheme/stable.pkg") - ("icecat" "ftp.gnu.org" "/gnu/gnuzilla") - ("source-highlight" "ftp.gnu.org" "/gnu/src-highlite") - ("gnutls" "ftp.gnutls.org" "/gcrypt/gnutls") - - ;; FIXME: ftp.texmacs.org is currently outdated; texmacs.org refers to - ;; its own http URL instead. - ("TeXmacs" "ftp.texmacs.org" "/TeXmacs/targz"))) - - (match (assoc project quirks) - ((_ server directory) - (values server directory)) - (_ - (values "ftp.gnu.org" (string-append "/gnu/" project))))) +(define (ftp-server/directory package) + "Return the FTP server and directory where PACKAGE's tarball are stored." + (values (or (assoc-ref (package-properties package) 'ftp-server) + "ftp.gnu.org") + (or (assoc-ref (package-properties package) 'ftp-directory) + (string-append "/gnu/" (package-name package))))) (define (sans-extension tarball) "Return TARBALL without its .tar.* or .zip extension." @@ -276,51 +254,53 @@ true." (gnu-package-name->name+version (sans-extension tarball)))) version)) -(define (releases project) - "Return the list of releases of PROJECT as a list of release name/directory -pairs. Example: (\"mit-scheme-9.0.1\" . \"/gnu/mit-scheme/stable.pkg/9.0.1\"). " +(define* (releases project + #:key + (server "ftp.gnu.org") + (directory (string-append "/gnu/" project))) + "Return the list of of PROJECT as a list of release +name/directory pairs." ;; TODO: Parse something like fencepost.gnu.org:/gd/gnuorg/packages-ftp. - (let-values (((server directory) (ftp-server/directory project))) - (define conn (ftp-open server)) - - (let loop ((directories (list directory)) - (result '())) - (match directories - (() - (ftp-close conn) - (coalesce-sources result)) - ((directory rest ...) - (let* ((files (ftp-list conn directory)) - (subdirs (filter-map (match-lambda - ((name 'directory . _) name) - (_ #f)) - files))) - (define (file->url file) - (string-append "ftp://" server directory "/" file)) - - (define (file->source file) - (let ((url (file->url file))) - (upstream-source - (package project) - (version (tarball->version file)) - (urls (list url)) - (signature-urls (list (string-append url ".sig")))))) - - (loop (append (map (cut string-append directory "/" <>) - subdirs) - rest) - (append - ;; Filter out signatures, deltas, and files which - ;; are potentially not releases of PROJECT--e.g., - ;; in /gnu/guile, filter out guile-oops and - ;; guile-www; in mit-scheme, filter out binaries. - (filter-map (match-lambda - ((file 'file . _) - (and (release-file? project file) - (file->source file))) - (_ #f)) - files) - result)))))))) + (define conn (ftp-open server)) + + (let loop ((directories (list directory)) + (result '())) + (match directories + (() + (ftp-close conn) + (coalesce-sources result)) + ((directory rest ...) + (let* ((files (ftp-list conn directory)) + (subdirs (filter-map (match-lambda + ((name 'directory . _) name) + (_ #f)) + files))) + (define (file->url file) + (string-append "ftp://" server directory "/" file)) + + (define (file->source file) + (let ((url (file->url file))) + (upstream-source + (package project) + (version (tarball->version file)) + (urls (list url)) + (signature-urls (list (string-append url ".sig")))))) + + (loop (append (map (cut string-append directory "/" <>) + subdirs) + rest) + (append + ;; Filter out signatures, deltas, and files which + ;; are potentially not releases of PROJECT--e.g., + ;; in /gnu/guile, filter out guile-oops and + ;; guile-www; in mit-scheme, filter out binaries. + (filter-map (match-lambda + ((file 'file . _) + (and (release-file? project file) + (file->source file))) + (_ #f)) + files) + result))))))) (define* (latest-ftp-release project #:key @@ -412,15 +392,15 @@ return the corresponding signature URL, or #f it signatures are unavailable." (ftp-close conn) result)))))) -(define (latest-release package . rest) +(define* (latest-release package + #:key + (server "ftp.gnu.org") + (directory (string-append "/gnu/" package))) "Return the for the latest version of PACKAGE or #f. -PACKAGE is the name of a GNU package. This procedure automatically uses the -right FTP server and directory for PACKAGE." - (let-values (((server directory) (ftp-server/directory package))) - (apply latest-ftp-release package - #:server server - #:directory directory - rest))) +PACKAGE must be the canonical name of a GNU package." + (latest-ftp-release package + #:server server + #:directory directory)) (define-syntax-rule (false-if-ftp-error exp) "Return #f if an FTP error is raise while evaluating EXP; return the result @@ -435,10 +415,17 @@ of EXP otherwise." #f))) (define (latest-release* package) - "Like 'latest-release', but ignore FTP errors that might occur when PACKAGE -is not actually a GNU package, or not hosted on ftp.gnu.org, or not under that -name (this is the case for \"emacs-auctex\", for instance.)" - (false-if-ftp-error (latest-release (package-name package)))) + "Like 'latest-release', but (1) take a object, and (2) ignore FTP +errors that might occur when PACKAGE is not actually a GNU package, or not +hosted on ftp.gnu.org, or not under that name (this is the case for +\"emacs-auctex\", for instance.)" + (let-values (((server directory) + (ftp-server/directory package))) + (let ((name (or (assoc-ref (package-properties package) 'upstream-name) + (package-name package)))) + (false-if-ftp-error (latest-release name + #:server server + #:directory directory))))) (define %package-name-rx ;; Regexp for a package name, e.g., "foo-X.Y". Since TeXmacs uses -- cgit v1.2.3 From 8a2154fefaafe631905c12891c9c2587dadbc863 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 14 Apr 2016 22:47:40 +0200 Subject: download: Send an ANSI erase-in-line sequence in addition to CR. Partly fixes . Reported by Danny Milosavljevic . * guix/build/download.scm (progress-proc): Send an ANSI erase-in-line sequence. --- guix/build/download.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'guix') diff --git a/guix/build/download.scm b/guix/build/download.scm index fb236d314a..3c8359b602 100644 --- a/guix/build/download.scm +++ b/guix/build/download.scm @@ -167,8 +167,8 @@ used to shorten FILE for display." (seconds->string elapsed) (progress-bar %) %))) ;; TODO: Make this adapt to the actual terminal width. + (display "\r\x1b[K" log-port) (display (string-pad-middle left right 80) log-port) - (display #\cr log-port) (flush-output-port log-port) (cont)))) (lambda (transferred cont) @@ -183,8 +183,8 @@ used to shorten FILE for display." (seconds->string elapsed) (byte-count->string transferred)))) ;; TODO: Make this adapt to the actual terminal width. + (display "\r\x1b[K" log-port) (display (string-pad-middle left right 80) log-port) - (display #\cr log-port) (flush-output-port log-port) (cont)))))))) -- cgit v1.2.3 From 4d276c640374c9981dad2681f98af8c8d133939a Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 14 Apr 2016 22:50:48 +0200 Subject: download: Add 'current-terminal-columns' parameter. * guix/build/download.scm (current-terminal-columns): New variable. (progress-proc): Use it instead of the hard-coded "80". --- guix/build/download.scm | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'guix') diff --git a/guix/build/download.scm b/guix/build/download.scm index 3c8359b602..bd354a6985 100644 --- a/guix/build/download.scm +++ b/guix/build/download.scm @@ -39,6 +39,7 @@ maybe-expand-mirrors url-fetch byte-count->string + current-terminal-columns progress-proc uri-abbreviation store-path-abbreviation)) @@ -53,6 +54,10 @@ ;; Size of the HTTP receive buffer. 65536) +(define current-terminal-columns + ;; Number of columns of the terminal. + (make-parameter 80)) + (define (nearest-exact-integer x) "Given a real number X, return the nearest exact integer, with ties going to the nearest exact even integer." @@ -166,9 +171,10 @@ used to shorten FILE for display." (byte-count->string throughput) (seconds->string elapsed) (progress-bar %) %))) - ;; TODO: Make this adapt to the actual terminal width. (display "\r\x1b[K" log-port) - (display (string-pad-middle left right 80) log-port) + (display (string-pad-middle left right + (current-terminal-columns)) + log-port) (flush-output-port log-port) (cont)))) (lambda (transferred cont) @@ -182,9 +188,10 @@ used to shorten FILE for display." (byte-count->string throughput) (seconds->string elapsed) (byte-count->string transferred)))) - ;; TODO: Make this adapt to the actual terminal width. (display "\r\x1b[K" log-port) - (display (string-pad-middle left right 80) log-port) + (display (string-pad-middle left right + (current-terminal-columns)) + log-port) (flush-output-port log-port) (cont)))))))) -- cgit v1.2.3 From 29ff6d9fcc05b283b6d797146330e950286028ed Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 14 Apr 2016 23:35:03 +0200 Subject: syscalls: Add TIOCGWINSZ bindings. * guix/build/syscalls.scm (TIOCGWINSZ): New macro. (): New record type. (winsize): New C struct. (winsize-struct): New variable. (terminal-window-size, terminal-columns): New procedures. --- guix/build/syscalls.scm | 74 ++++++++++++++++++++++++++++++++++++++++++++++++- tests/syscalls.scm | 13 +++++++++ 2 files changed, 86 insertions(+), 1 deletion(-) (limited to 'guix') diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm index 69a507def8..ed833c10b2 100644 --- a/guix/build/syscalls.scm +++ b/guix/build/syscalls.scm @@ -82,7 +82,15 @@ interface-address interface-netmask interface-broadcast-address - network-interfaces)) + network-interfaces + + window-size? + window-size-rows + window-size-columns + window-size-x-pixels + window-size-y-pixels + terminal-window-size + terminal-columns)) ;;; Commentary: ;;; @@ -853,4 +861,68 @@ network interface. This is implemented using the 'getifaddrs' libc function." (let ((ptr (dynamic-func "freeifaddrs" (dynamic-link)))) (pointer->procedure void ptr '(*)))) + +;;; +;;; Terminals. +;;; + +(define-syntax TIOCGWINSZ ; + (identifier-syntax #x5413)) + +(define-record-type + (window-size rows columns x-pixels y-pixels) + window-size? + (rows window-size-rows) + (columns window-size-columns) + (x-pixels window-size-x-pixels) + (y-pixels window-size-y-pixels)) + +(define-c-struct winsize ; + window-size + read-winsize + write-winsize! + (rows unsigned-short) + (columns unsigned-short) + (x-pixels unsigned-short) + (y-pixels unsigned-short)) + +(define winsize-struct + (list unsigned-short unsigned-short unsigned-short unsigned-short)) + +(define* (terminal-window-size #:optional (port (current-output-port))) + "Return a structure describing the terminal at PORT, or raise +a 'system-error' if PORT is not backed by a terminal. This procedure +corresponds to the TIOCGWINSZ ioctl." + (let* ((size (make-c-struct winsize-struct '(0 0 0 0))) + (ret (%ioctl (fileno port) TIOCGWINSZ size)) + (err (errno))) + (if (zero? ret) + (read-winsize (pointer->bytevector size (sizeof winsize-struct)) + 0) + (throw 'system-error "terminal-window-size" "~A" + (list (strerror err)) + (list err))))) + +(define* (terminal-columns #:optional (port (current-output-port))) + "Return the best approximation of the number of columns of the terminal at +PORT, trying to guess a reasonable value if all else fails. The result is +always a positive integer." + (define (fall-back) + (match (and=> (getenv "COLUMNS") string->number) + (#f 80) + ((? number? columns) + (if (> columns 0) columns 80)))) + + (catch 'system-error + (lambda () + (match (window-size-columns (terminal-window-size port)) + ;; Things like Emacs shell-mode return 0, which is unreasonable. + (0 (fall-back)) + ((? number? columns) columns))) + (lambda args + (let ((errno (system-error-errno args))) + (if (= errno ENOTTY) + (fall-back) + (apply throw args)))))) + ;;; syscalls.scm ends here diff --git a/tests/syscalls.scm b/tests/syscalls.scm index 8e24184fe2..1b443be0c8 100644 --- a/tests/syscalls.scm +++ b/tests/syscalls.scm @@ -244,4 +244,17 @@ (#f #f) (lo (interface-address lo))))))) +(test-equal "terminal-window-size ENOTTY" + ENOTTY + (call-with-input-file "/dev/null" + (lambda (port) + (catch 'system-error + (lambda () + (terminal-window-size port)) + (lambda args + (system-error-errno args)))))) + +(test-assert "terminal-columns" + (> (terminal-columns) 0)) + (test-end) -- cgit v1.2.3 From 069d43a7652e5b8bf07d33fd1013bdb8465012ac Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 14 Apr 2016 23:43:31 +0200 Subject: ui: 'package->recutils' accurately honors the number of columns. * guix/ui.scm (package->recutils)[width*]: New variable. Use it instead of WIDTH. --- guix/ui.scm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'guix') diff --git a/guix/ui.scm b/guix/ui.scm index f95c63a81b..391af9a99f 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -855,11 +855,16 @@ followed by \"+ \", which makes for a valid multi-line field value in the (define* (package->recutils p port #:optional (width (%text-width))) "Write to PORT a `recutils' record of package P, arranging to fit within WIDTH columns." + (define width* + ;; The available number of columns once we've taken into account space for + ;; the initial "+ " prefix. + (if (> width 2) (- width 2) width)) + (define (dependencies->recutils packages) (let ((list (string-join (map package-full-name (sort packages packagerecutils - (fill-paragraph list width + (fill-paragraph list width* (string-length "dependencies: "))))) (define (packagerecutils (string-trim-right - (parameterize ((%text-width width)) + (parameterize ((%text-width width*)) (texi->plain-text (string-append "description: " (or (and=> (package-description p) P_) -- cgit v1.2.3 From 9703fef4152622fe241d28c82542a3a5a09dec1b Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 14 Apr 2016 23:44:18 +0200 Subject: ui: Use 'terminal-columns'. * guix/ui.scm (%text-width): Default to (terminal-columns). --- guix/ui.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'guix') diff --git a/guix/ui.scm b/guix/ui.scm index 391af9a99f..04ac43723e 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -34,6 +34,7 @@ #:use-module (guix serialization) #:use-module ((guix build utils) #:select (mkdir-p)) #:use-module ((guix licenses) #:select (license? license-name)) + #:use-module ((guix build syscalls) #:select (terminal-columns)) #:use-module (gnu system file-systems) #:use-module (srfi srfi-1) #:use-module (srfi srfi-11) @@ -816,8 +817,7 @@ converted to a space; sequences of more than one line break are preserved." ;;; (define %text-width - (make-parameter (or (and=> (getenv "WIDTH") string->number) - 80))) + (make-parameter (terminal-columns))) (set! (@@ (texinfo plain-text) wrap*) ;; XXX: Monkey patch this private procedure to let 'package->recutils' -- cgit v1.2.3 From cc44fbb8d9f47070c488faef3dc4b24f2a8a07d8 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 15 Apr 2016 00:08:28 +0200 Subject: guix download: Honor the number of columns of the terminal. * guix/scripts/download.scm (guix-download): Parameterize 'current-terminal-columns'. --- guix/scripts/download.scm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'guix') diff --git a/guix/scripts/download.scm b/guix/scripts/download.scm index 6ebc14f573..1648198f6e 100644 --- a/guix/scripts/download.scm +++ b/guix/scripts/download.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013, 2015 Ludovic Courtès +;;; Copyright © 2012, 2013, 2015, 2016 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -24,6 +24,8 @@ #:use-module (guix utils) #:use-module (guix base32) #:use-module (guix download) + #:use-module ((guix build download) #:select (current-terminal-columns)) + #:use-module ((guix build syscalls) #:select (terminal-columns)) #:use-module (web uri) #:use-module (ice-9 match) #:use-module (srfi srfi-1) @@ -115,8 +117,10 @@ Supported formats: 'nix-base32' (default), 'base32', and 'base16' (add-to-store store (basename (uri-path uri)) #f "sha256" (uri-path uri))) (else - (download-to-store store (uri->string uri) - (basename (uri-path uri)))))) + (parameterize ((current-terminal-columns + (terminal-columns))) + (download-to-store store (uri->string uri) + (basename (uri-path uri))))))) (hash (call-with-input-file (or path (leave (_ "~a: download failed~%") -- cgit v1.2.3 From b0a6a9713076347c14ee2dd0ea494ab086df2a82 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 15 Apr 2016 00:10:22 +0200 Subject: substitute: Honor the number of columns of the client terminal. * guix/store.scm (set-build-options): Add #:terminal-columns parameter and honor it. * guix/scripts/substitute.scm (client-terminal-columns): New procedure. (guix-substitute): Use it to parameterize 'current-terminal-columns'. --- guix/scripts/substitute.scm | 20 ++++++++++++++++---- guix/store.scm | 10 +++++++++- 2 files changed, 25 insertions(+), 5 deletions(-) (limited to 'guix') diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm index 82ce069598..db0416b0c0 100755 --- a/guix/scripts/substitute.scm +++ b/guix/scripts/substitute.scm @@ -31,7 +31,8 @@ #:use-module (guix pki) #:use-module ((guix build utils) #:select (mkdir-p dump-port)) #:use-module ((guix build download) - #:select (progress-proc uri-abbreviation + #:select (current-terminal-columns + progress-proc uri-abbreviation open-connection-for-uri close-connection store-path-abbreviation byte-count->string)) @@ -973,6 +974,14 @@ found." ;; daemon. '("http://hydra.gnu.org")))) +(define (client-terminal-columns) + "Return the number of columns in the client's terminal, if it is known, or a +default value." + (or (and=> (or (find-daemon-option "untrusted-terminal-columns") + (find-daemon-option "terminal-columns")) + string->number) + 80)) + (define (guix-substitute . args) "Implement the build daemon's substituter protocol." (mkdir-p %narinfo-cache-directory) @@ -1003,9 +1012,12 @@ found." (loop (read-line))))))) (("--substitute" store-path destination) ;; Download STORE-PATH and add store it as a Nar in file DESTINATION. - (process-substitution store-path destination - #:cache-urls %cache-urls - #:acl (current-acl))) + ;; Specify the number of columns of the terminal so the progress + ;; report displays nicely. + (parameterize ((current-terminal-columns (client-terminal-columns))) + (process-substitution store-path destination + #:cache-urls %cache-urls + #:acl (current-acl)))) (("--version") (show-version-and-exit "guix substitute")) (("--help") diff --git a/guix/store.scm b/guix/store.scm index 906611658e..af311a0ebd 100644 --- a/guix/store.scm +++ b/guix/store.scm @@ -22,6 +22,7 @@ #:use-module (guix serialization) #:use-module (guix monads) #:autoload (guix base32) (bytevector->base32-string) + #:autoload (guix build syscalls) (terminal-columns) #:use-module (rnrs bytevectors) #:use-module (rnrs io ports) #:use-module (srfi srfi-1) @@ -530,7 +531,10 @@ encoding conversion errors." ;; the daemon's settings are used. Otherwise, it ;; overrides the daemons settings; see 'guix ;; substitute'. - (substitute-urls #f)) + (substitute-urls #f) + + ;; Number of columns in the client's terminal. + (terminal-columns (terminal-columns))) ;; Must be called after `open-connection'. (define socket @@ -565,6 +569,10 @@ encoding conversion errors." ,@(if rounds `(("build-repeat" . ,(number->string (max 0 (1- rounds))))) + '()) + ,@(if terminal-columns + `(("terminal-columns" + . ,(number->string terminal-columns))) '())))) (send (string-pairs pairs)))) (let loop ((done? (process-stderr server))) -- cgit v1.2.3 From 6d2b43915f8a628588f03136b3008902f7643e06 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 15 Apr 2016 19:47:35 +0200 Subject: syscalls: 'terminal-columns' ignores non-file ports. * guix/build/syscalls.scm (terminal-columns): Call 'terminal-window-size' only when PORT is a file port. * tests/syscalls.scm ("terminal-columns non-file port"): New test. --- guix/build/syscalls.scm | 10 ++++++---- tests/syscalls.scm | 4 ++++ 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'guix') diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm index ed833c10b2..5ce0abbb48 100644 --- a/guix/build/syscalls.scm +++ b/guix/build/syscalls.scm @@ -915,10 +915,12 @@ always a positive integer." (catch 'system-error (lambda () - (match (window-size-columns (terminal-window-size port)) - ;; Things like Emacs shell-mode return 0, which is unreasonable. - (0 (fall-back)) - ((? number? columns) columns))) + (if (file-port? port) + (match (window-size-columns (terminal-window-size port)) + ;; Things like Emacs shell-mode return 0, which is unreasonable. + (0 (fall-back)) + ((? number? columns) columns)) + (fall-back))) (lambda args (let ((errno (system-error-errno args))) (if (= errno ENOTTY) diff --git a/tests/syscalls.scm b/tests/syscalls.scm index 1b443be0c8..24ea8f5e60 100644 --- a/tests/syscalls.scm +++ b/tests/syscalls.scm @@ -257,4 +257,8 @@ (test-assert "terminal-columns" (> (terminal-columns) 0)) +(test-assert "terminal-columns non-file port" + (> (terminal-columns (open-input-string "Join us now, share the software!")) + 0)) + (test-end) -- cgit v1.2.3 From dd1d09f7e4c522d2185eda9c806ea525e10172be Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 18 Apr 2016 19:26:34 +0200 Subject: utils: 'cache-directory' gracefully deals with unset 'HOME'. Fixes . * guix/utils.scm (cache-directory): Use 'getpwuid' when 'HOME' is unset. --- guix/utils.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'guix') diff --git a/guix/utils.scm b/guix/utils.scm index a0e9439dd3..6c01edde21 100644 --- a/guix/utils.scm +++ b/guix/utils.scm @@ -808,7 +808,8 @@ elements after E." (define (cache-directory) "Return the cache directory for Guix, by default ~/.cache/guix." (or (getenv "XDG_CONFIG_HOME") - (and=> (getenv "HOME") + (and=> (or (getenv "HOME") + (passwd:dir (getpwuid (getuid)))) (cut string-append <> "/.cache/guix")))) (define (readlink* file) -- cgit v1.2.3 From 4f8cede062cf89a8326842c6a60e8e0178a78b2c Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Wed, 10 Feb 2016 14:17:33 +0200 Subject: syscalls: If a syscall is not available, defer the error. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * guix/build/syscalls.scm (syscall->procedure): New procedure. (mount, umount, swapon, swapoff, clone, pivot-root): Use it. (clone): Add case for nonexistent syscall id. Signed-off-by: Ludovic Courtès --- guix/build/syscalls.scm | 43 ++++++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 17 deletions(-) (limited to 'guix') diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm index 5ce0abbb48..04fc3ef5fe 100644 --- a/guix/build/syscalls.scm +++ b/guix/build/syscalls.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2014, 2015, 2016 Ludovic Courtès ;;; Copyright © 2015 David Thompson +;;; Copyright © 2015 Mark H Weaver ;;; ;;; This file is part of GNU Guix. ;;; @@ -145,6 +146,19 @@ "Evaluate EXPR and restart upon EINTR. Return the value of EXPR." (call-with-restart-on-EINTR (lambda () expr))) +(define (syscall->procedure return-type name argument-types) + "Return a procedure that wraps the C function NAME using the dynamic FFI. +If an error occurs while creating the binding, defer the error report until +the returned procedure is called." + (catch #t + (lambda () + (let ((ptr (dynamic-func name (dynamic-link)))) + (pointer->procedure return-type ptr argument-types))) + (lambda args + (lambda _ + (error (format #f "~a: syscall->procedure failed: ~s" + name args)))))) + (define (augment-mtab source target type options) "Augment /etc/mtab with information about the given mount point." (let ((port (open-file "/etc/mtab" "a"))) @@ -193,8 +207,7 @@ (define UMOUNT_NOFOLLOW 8) (define mount - (let* ((ptr (dynamic-func "mount" (dynamic-link))) - (proc (pointer->procedure int ptr `(* * * ,unsigned-long *)))) + (let ((proc (syscall->procedure int "mount" `(* * * ,unsigned-long *)))) (lambda* (source target type #:optional (flags 0) options #:key (update-mtab? #f)) "Mount device SOURCE on TARGET as a file system TYPE. Optionally, FLAGS @@ -222,8 +235,7 @@ error." (augment-mtab source target type options)))))) (define umount - (let* ((ptr (dynamic-func "umount2" (dynamic-link))) - (proc (pointer->procedure int ptr `(* ,int)))) + (let ((proc (syscall->procedure int "umount2" `(* ,int)))) (lambda* (target #:optional (flags 0) #:key (update-mtab? #f)) "Unmount TARGET. Optionally FLAGS may be one of the MNT_* or UMOUNT_* @@ -250,8 +262,7 @@ constants from ." (loop (cons mount-point result)))))))))) (define swapon - (let* ((ptr (dynamic-func "swapon" (dynamic-link))) - (proc (pointer->procedure int ptr (list '* int)))) + (let ((proc (syscall->procedure int "swapon" (list '* int)))) (lambda* (device #:optional (flags 0)) "Use the block special device at DEVICE for swapping." (let ((ret (proc (string->pointer device) flags)) @@ -262,8 +273,7 @@ constants from ." (list err))))))) (define swapoff - (let* ((ptr (dynamic-func "swapoff" (dynamic-link))) - (proc (pointer->procedure int ptr '(*)))) + (let ((proc (syscall->procedure int "swapoff" '(*)))) (lambda (device) "Stop using block special device DEVICE for swapping." (let ((ret (proc (string->pointer device))) @@ -327,18 +337,18 @@ string TMPL and return its file name. TMPL must end with 'XXXXXX'." ;; declared in as a variadic function; in practice, it expects 6 ;; pointer-sized arguments, as shown in, e.g., x86_64/syscall.S. (define clone - (let* ((ptr (dynamic-func "syscall" (dynamic-link))) - (proc (pointer->procedure long ptr - (list long ;sysno - unsigned-long ;flags - '* '* '* - '*))) + (let* ((proc (syscall->procedure int "syscall" + (list long ;sysno + unsigned-long ;flags + '* '* '* + '*))) ;; TODO: Don't do this. (syscall-id (match (utsname:machine (uname)) ("i686" 120) ("x86_64" 56) ("mips64" 5055) - ("armv7l" 120)))) + ("armv7l" 120) + (_ #f)))) (lambda (flags) "Create a new child process by duplicating the current parent process. Unlike the fork system call, clone accepts FLAGS that specify which resources @@ -373,8 +383,7 @@ there is no such limitation." (list err)))))))) (define pivot-root - (let* ((ptr (dynamic-func "pivot_root" (dynamic-link))) - (proc (pointer->procedure int ptr (list '* '*)))) + (let ((proc (syscall->procedure int "pivot_root" (list '* '*)))) (lambda (new-root put-old) "Change the root file system to NEW-ROOT and move the current root file system to PUT-OLD." -- cgit v1.2.3 From 967ee481e893fd77ff8ca896188e20e425331bf2 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 20 Apr 2016 13:12:57 +0200 Subject: download: Add "%COMPAT" to the priority string. Fixes . * guix/build/download.scm (tls-wrap): Add 'set-session-priorities!' call. --- guix/build/download.scm | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'guix') diff --git a/guix/build/download.scm b/guix/build/download.scm index bd354a6985..e00fa04e35 100644 --- a/guix/build/download.scm +++ b/guix/build/download.scm @@ -274,6 +274,13 @@ host name without trailing dot." (set-session-transport-fd! session (fileno port)) (set-session-default-priority! session) + + ;; The "%COMPAT" bit allows us to work around firewall issues (info + ;; "(gnutls) Priority Strings"); see . + ;; Explicitly disable SSLv3, which is insecure: + ;; . + (set-session-priorities! session "NORMAL:%COMPAT:-VERS-SSL3.0") + (set-session-credentials! session (make-certificate-credentials)) ;; Uncomment the following lines in case of debugging emergency. -- cgit v1.2.3 From 3e31ec827a887eda2d13f5fb7b7f61e222b2169d Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 20 Apr 2016 22:52:35 +0200 Subject: download: 'uri-abbreviation' can abbreviate the URI's basename. * guix/build/download.scm (uri-abbreviation): Use 'ellipsis' instead of "...". Abbreviate the basename of PATH if needed. --- guix/build/download.scm | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'guix') diff --git a/guix/build/download.scm b/guix/build/download.scm index e00fa04e35..fe7a453c89 100644 --- a/guix/build/download.scm +++ b/guix/build/download.scm @@ -202,13 +202,18 @@ abbreviation of URI showing the scheme, host, and basename of the file." (uri->string uri)) (define (elide-path) - (let ((path (uri-path uri))) - (string-append (symbol->string (uri-scheme uri)) "://" - - ;; `file' URIs have no host part. - (or (uri-host uri) "") - - (string-append "/.../" (basename path))))) + (let* ((path (uri-path uri)) + (base (basename path)) + (prefix (string-append (symbol->string (uri-scheme uri)) "://" + + ;; `file' URIs have no host part. + (or (uri-host uri) "") + + (string-append "/" (ellipsis) "/")))) + (if (> (+ (string-length prefix) (string-length base)) max-length) + (string-append prefix (ellipsis) + (string-drop base (quotient (string-length base) 2))) + (string-append prefix base)))) (if (> (string-length uri-as-string) max-length) (let ((short (elide-path))) -- cgit v1.2.3 From cf5e58297d441e5e8f93e104f23eb3d18b2b51c9 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 20 Apr 2016 23:01:41 +0200 Subject: substitute: Better abbreviate substitute URL in progress report. Suggested by Danny Milosavljevic . * guix/build/download.scm (nar-uri-abbreviation): New procedure. * guix/scripts/substitute.scm (process-substitution): Use it instead of 'store-path-abbreviation'. --- guix/build/download.scm | 12 ++++++++++++ guix/scripts/substitute.scm | 6 +++--- 2 files changed, 15 insertions(+), 3 deletions(-) (limited to 'guix') diff --git a/guix/build/download.scm b/guix/build/download.scm index fe7a453c89..fec4cec3e8 100644 --- a/guix/build/download.scm +++ b/guix/build/download.scm @@ -42,6 +42,7 @@ current-terminal-columns progress-proc uri-abbreviation + nar-uri-abbreviation store-path-abbreviation)) ;;; Commentary: @@ -222,6 +223,17 @@ abbreviation of URI showing the scheme, host, and basename of the file." uri-as-string)) uri-as-string)) +(define (nar-uri-abbreviation uri) + "Abbreviate URI, which is assumed to be the URI of a nar as served by Hydra +and 'guix publish', something like +\"http://example.org/nar/1ldrllwbna0aw5z8kpci4fsvbd2w8cw4-texlive-bin-2015\"." + (let* ((uri (if (string? uri) (string->uri uri) uri)) + (path (basename (uri-path uri)))) + (if (and (> (string-length path) 33) + (char=? (string-ref path 32) #\-)) + (string-drop path 33) + path))) + (define (ftp-fetch uri file) "Fetch data from URI and write it to FILE. Return FILE on success." (let* ((conn (ftp-open (uri-host uri))) diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm index db0416b0c0..0f0677fb22 100755 --- a/guix/scripts/substitute.scm +++ b/guix/scripts/substitute.scm @@ -32,7 +32,7 @@ #:use-module ((guix build utils) #:select (mkdir-p dump-port)) #:use-module ((guix build download) #:select (current-terminal-columns - progress-proc uri-abbreviation + progress-proc uri-abbreviation nar-uri-abbreviation open-connection-for-uri close-connection store-path-abbreviation byte-count->string)) @@ -896,11 +896,11 @@ DESTINATION as a nar file. Verify the substitute against ACL." (dl-size (or download-size (and (equal? comp "none") (narinfo-size narinfo)))) - (progress (progress-proc (uri-abbreviation uri) + (progress (progress-proc (uri->string uri) dl-size (current-error-port) #:abbreviation - store-path-abbreviation))) + nar-uri-abbreviation))) (progress-report-port progress raw))) ((input pids) (decompressed-port (and=> (narinfo-compression narinfo) -- cgit v1.2.3 From f954c9b5da256009fc41483e8fccd9bee1504870 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 20 Apr 2016 23:16:02 +0200 Subject: substitute: Internationalize signature and download messages. * guix/scripts/substitute.scm (assert-valid-narinfo): Use gettext for messages. --- guix/scripts/substitute.scm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'guix') diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm index 0f0677fb22..e0a694ad0f 100755 --- a/guix/scripts/substitute.scm +++ b/guix/scripts/substitute.scm @@ -400,8 +400,10 @@ or is signed by an unauthorized key." (when verbose? ;; Visually separate substitutions with a newline. (format (current-error-port) - "~%Found valid signature for ~a~%From ~a~%" - (narinfo-path narinfo) + (_ "~%Found valid signature for ~a~%") + (narinfo-path narinfo)) + (format (current-error-port) + (_ "From ~a~%") (uri->string (narinfo-uri narinfo))))) narinfo)))) -- cgit v1.2.3 From 38f50f49f395fcda6ab3395ebaa312f8ee24d80d Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 20 Apr 2016 23:16:47 +0200 Subject: substitute: Install the client's locale. * guix/store.scm (set-build-options): Add #:locale parameter and honor it. * guix/scripts/substitute.scm (guix-substitute): Install the client's locale. --- guix/scripts/substitute.scm | 7 +++++++ guix/store.scm | 8 +++++++- 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'guix') diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm index e0a694ad0f..fa1dd09df8 100755 --- a/guix/scripts/substitute.scm +++ b/guix/scripts/substitute.scm @@ -1000,6 +1000,13 @@ default value." (newline) (force-output (current-output-port)) + ;; Attempt to install the client's locale, mostly so that messages are + ;; suitably translated. + (match (or (find-daemon-option "untrusted-locale") + (find-daemon-option "locale")) + (#f #f) + (locale (false-if-exception (setlocale LC_ALL locale)))) + (with-networking (with-error-handling ; for signature errors (match args diff --git a/guix/store.scm b/guix/store.scm index af311a0ebd..8d1099dab2 100644 --- a/guix/store.scm +++ b/guix/store.scm @@ -534,7 +534,10 @@ encoding conversion errors." (substitute-urls #f) ;; Number of columns in the client's terminal. - (terminal-columns (terminal-columns))) + (terminal-columns (terminal-columns)) + + ;; Locale of the client. + (locale (false-if-exception (setlocale LC_ALL)))) ;; Must be called after `open-connection'. (define socket @@ -573,6 +576,9 @@ encoding conversion errors." ,@(if terminal-columns `(("terminal-columns" . ,(number->string terminal-columns))) + '()) + ,@(if locale + `(("locale" . ,locale)) '())))) (send (string-pairs pairs)))) (let loop ((done? (process-stderr server))) -- cgit v1.2.3 From 85fc958d9b8b36fb4b540882dfbcec45aab9eb82 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 20 Apr 2016 23:21:49 +0200 Subject: substitute: Sanitize the client-provided column number. * guix/scripts/substitute.scm (client-terminal-columns): Sanitize the client's column number. --- guix/scripts/substitute.scm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'guix') diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm index fa1dd09df8..1cfab81dbd 100755 --- a/guix/scripts/substitute.scm +++ b/guix/scripts/substitute.scm @@ -981,7 +981,9 @@ found." default value." (or (and=> (or (find-daemon-option "untrusted-terminal-columns") (find-daemon-option "terminal-columns")) - string->number) + (lambda (str) + (let ((number (string->number str))) + (and number (max 20 (- number 1)))))) 80)) (define (guix-substitute . args) -- cgit v1.2.3 From 03d0e2d2b9f9cc3be8e871842c11df9453e903bd Mon Sep 17 00:00:00 2001 From: Mathieu Lirzin Date: Thu, 21 Apr 2016 18:07:52 +0200 Subject: build: Move 'Makefile' fragments to subdirectories. This follows a convention used by some other GNU packages like Autoconf, Bison, Coreutils, and Gnulib. * doc.am: Rename to ... * doc/local.mk: ... this. * emacs.am: Rename to ... * emacs/local.mk: ... this. * gnu-system.am: Rename to ... * gnu/local.mk: ... this. * daemon.am: Rename to ... * nix/local.mk: ... this. * Makefile.am: Adapt to them. * doc/guix.texi (Porting to a New Platform): Adapt documentation. * guix/config.scm.in (%state-directory, %config-directory): Adapt comments. * emacs/guix-config.el.in (guix-config-state-directory): Likewise. --- Makefile.am | 8 +- daemon.am | 226 ------------- doc.am | 157 --------- doc/guix.texi | 2 +- doc/local.mk | 157 +++++++++ emacs.am | 76 ----- emacs/guix-config.el.in | 2 +- emacs/local.mk | 76 +++++ gnu-system.am | 875 ------------------------------------------------ gnu/local.mk | 875 ++++++++++++++++++++++++++++++++++++++++++++++++ guix/config.scm.in | 4 +- nix/local.mk | 226 +++++++++++++ 12 files changed, 1342 insertions(+), 1342 deletions(-) delete mode 100644 daemon.am delete mode 100644 doc.am create mode 100644 doc/local.mk delete mode 100644 emacs.am create mode 100644 emacs/local.mk delete mode 100644 gnu-system.am create mode 100644 gnu/local.mk create mode 100644 nix/local.mk (limited to 'guix') diff --git a/Makefile.am b/Makefile.am index 1f257a009c..5cee3d3b6f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -27,7 +27,7 @@ nodist_noinst_SCRIPTS = \ pre-inst-env \ test-env -include gnu-system.am +include gnu/local.mk MODULES = \ guix/base32.scm \ @@ -416,11 +416,11 @@ install-data-hook: set-bootstrap-executable-permissions SUBDIRS = po/guix po/packages BUILT_SOURCES = -include doc.am +include doc/local.mk if BUILD_DAEMON -include daemon.am +include nix/local.mk endif BUILD_DAEMON @@ -437,7 +437,7 @@ AM_DISTCHECK_CONFIGURE_FLAGS = \ dist_emacsui_DATA = emacs/guix-main.scm nodist_emacsui_DATA = emacs/guix-helper.scm -include emacs.am +include emacs/local.mk # The self-contained tarball. guix-binary.%.tar.xz: diff --git a/daemon.am b/daemon.am deleted file mode 100644 index 3c15531f54..0000000000 --- a/daemon.am +++ /dev/null @@ -1,226 +0,0 @@ -# GNU Guix --- Functional package management for GNU -# Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès -# Copyright © 2016 Mathieu Lirzin -# -# This file is part of GNU Guix. -# -# GNU Guix is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or (at -# your option) any later version. -# -# GNU Guix is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Guix. If not, see . - -# -# Integration of the `guix-daemon' code taken from upstream Nix. -# - -BUILT_SOURCES += nix/libstore/schema.sql.hh -CLEANFILES += $(BUILT_SOURCES) etc/guix-daemon.service etc/guix-daemon.conf - -noinst_LIBRARIES = libformat.a libutil.a libstore.a - -# Use '-std=c++11' for 'std::shared_ptr', 'auto', lambdas, and more. -AM_CXXFLAGS = -Wall -std=c++11 - -libformat_a_SOURCES = \ - nix/boost/format/free_funcs.cc \ - nix/boost/format/parsing.cc \ - nix/boost/format/format_implementation.cc - -libformat_headers = \ - nix/boost/throw_exception.hpp \ - nix/boost/format.hpp \ - nix/boost/assert.hpp \ - nix/boost/format/macros_default.hpp \ - nix/boost/format/format_fwd.hpp \ - nix/boost/format/format_class.hpp \ - nix/boost/format/exceptions.hpp \ - nix/boost/format/group.hpp \ - nix/boost/format/feed_args.hpp \ - nix/boost/format/internals_fwd.hpp \ - nix/boost/format/internals.hpp - -libformat_a_CPPFLAGS = \ - -I$(top_srcdir)/nix - -libutil_a_SOURCES = \ - nix/libutil/archive.cc \ - nix/libutil/affinity.cc \ - nix/libutil/serialise.cc \ - nix/libutil/util.cc \ - nix/libutil/xml-writer.cc \ - nix/libutil/hash.cc \ - nix/libutil/gcrypt-hash.cc - -libutil_headers = \ - nix/libutil/affinity.hh \ - nix/libutil/hash.hh \ - nix/libutil/serialise.hh \ - nix/libutil/xml-writer.hh \ - nix/libutil/util.hh \ - nix/libutil/archive.hh \ - nix/libutil/types.hh \ - nix/libutil/gcrypt-hash.hh \ - nix/libutil/md5.h \ - nix/libutil/sha1.h \ - nix/libutil/sha256.h \ - nix/libutil/sha512.h - -libutil_a_CPPFLAGS = \ - -I$(top_builddir)/nix \ - -I$(top_srcdir)/nix/libutil \ - $(libformat_a_CPPFLAGS) - -libstore_a_SOURCES = \ - nix/libstore/gc.cc \ - nix/libstore/globals.cc \ - nix/libstore/misc.cc \ - nix/libstore/references.cc \ - nix/libstore/store-api.cc \ - nix/libstore/optimise-store.cc \ - nix/libstore/local-store.cc \ - nix/libstore/build.cc \ - nix/libstore/pathlocks.cc \ - nix/libstore/derivations.cc - -libstore_headers = \ - nix/libstore/references.hh \ - nix/libstore/pathlocks.hh \ - nix/libstore/globals.hh \ - nix/libstore/worker-protocol.hh \ - nix/libstore/derivations.hh \ - nix/libstore/misc.hh \ - nix/libstore/local-store.hh \ - nix/libstore/store-api.hh - -libstore_a_CPPFLAGS = \ - $(libutil_a_CPPFLAGS) \ - -I$(top_srcdir)/nix/libstore \ - -I$(top_builddir)/nix/libstore \ - -DNIX_STORE_DIR=\"$(storedir)\" \ - -DNIX_DATA_DIR=\"$(datadir)\" \ - -DNIX_STATE_DIR=\"$(localstatedir)/guix\" \ - -DNIX_LOG_DIR=\"$(localstatedir)/log/guix\" \ - -DNIX_CONF_DIR=\"$(sysconfdir)/guix\" \ - -DNIX_LIBEXEC_DIR=\"$(libexecdir)\" \ - -DNIX_BIN_DIR=\"$(bindir)\" \ - -DOPENSSL_PATH="\"guix-authenticate\"" \ - -DDEFAULT_CHROOT_DIRS="\"\"" - -libstore_a_CXXFLAGS = $(AM_CXXFLAGS) \ - $(SQLITE3_CFLAGS) $(LIBGCRYPT_CFLAGS) - -bin_PROGRAMS = guix-daemon -sbin_PROGRAMS = guix-register - -guix_daemon_SOURCES = \ - nix/nix-daemon/nix-daemon.cc \ - nix/nix-daemon/guix-daemon.cc - -guix_daemon_CPPFLAGS = \ - -DLOCALEDIR=\"$(localedir)\" \ - $(libutil_a_CPPFLAGS) \ - -I$(top_srcdir)/nix/libstore - -guix_daemon_LDADD = \ - libstore.a libutil.a libformat.a -lbz2 \ - $(SQLITE3_LIBS) $(LIBGCRYPT_LIBS) - -guix_daemon_headers = \ - nix/nix-daemon/shared.hh - - -guix_register_SOURCES = \ - nix/guix-register/guix-register.cc - -guix_register_CPPFLAGS = \ - $(libutil_a_CPPFLAGS) \ - $(libstore_a_CPPFLAGS) \ - -I$(top_srcdir)/nix/libstore - -# XXX: Should we start using shared libs? -guix_register_LDADD = \ - libstore.a libutil.a libformat.a -lbz2 \ - $(SQLITE3_LIBS) $(LIBGCRYPT_LIBS) - - -noinst_HEADERS = \ - $(libformat_headers) $(libutil_headers) $(libstore_headers) \ - $(guix_daemon_headers) - -nix/libstore/schema.sql.hh: nix/libstore/schema.sql - $(AM_V_GEN)$(GUILE) --no-auto-compile -c \ - "(use-modules (rnrs io ports)) \ - (call-with-output-file \"$@\" \ - (lambda (out) \ - (call-with-input-file \"$^\" \ - (lambda (in) \ - (write (get-string-all in) out)))))" - -nodist_pkglibexec_SCRIPTS = \ - nix/scripts/list-runtime-roots \ - nix/scripts/substitute - -if BUILD_DAEMON_OFFLOAD - -nodist_pkglibexec_SCRIPTS += \ - nix/scripts/offload - -endif BUILD_DAEMON_OFFLOAD - - -# XXX: It'd be better to hide it in $(pkglibexecdir). -nodist_libexec_SCRIPTS = \ - nix/scripts/guix-authenticate - -# The '.service' file for systemd. -systemdservicedir = $(libdir)/systemd/system -nodist_systemdservice_DATA = etc/guix-daemon.service - -etc/guix-daemon.service: etc/guix-daemon.service.in \ - $(top_builddir)/config.status - $(AM_V_GEN)$(MKDIR_P) "`dirname $@`"; \ - $(SED) -e 's|@''bindir''@|$(bindir)|' < \ - "$(srcdir)/etc/guix-daemon.service.in" > "$@.tmp"; \ - mv "$@.tmp" "$@" - -# The '.conf' job for Upstart. -upstartjobdir = $(libdir)/upstart/system -nodist_upstartjob_DATA = etc/guix-daemon.conf - -etc/guix-daemon.conf: etc/guix-daemon.conf.in \ - $(top_builddir)/config.status - $(AM_V_GEN)$(MKDIR_P) "`dirname $@`"; \ - $(SED) -e 's|@''bindir''@|$(bindir)|' < \ - "$(srcdir)/etc/guix-daemon.conf.in" > "$@.tmp"; \ - mv "$@.tmp" "$@" - -EXTRA_DIST += \ - nix/libstore/schema.sql \ - nix/AUTHORS \ - nix/COPYING \ - etc/guix-daemon.service.in \ - etc/guix-daemon.conf.in - -if CAN_RUN_TESTS - -AM_TESTS_ENVIRONMENT += \ - top_builddir="$(abs_top_builddir)" - -TESTS += \ - tests/guix-daemon.sh - -endif CAN_RUN_TESTS - -clean-local: - -if test -d "$(GUIX_TEST_ROOT)"; then \ - find "$(GUIX_TEST_ROOT)" | xargs chmod +w; \ - fi - -rm -rf "$(GUIX_TEST_ROOT)" diff --git a/doc.am b/doc.am deleted file mode 100644 index b9f07c3590..0000000000 --- a/doc.am +++ /dev/null @@ -1,157 +0,0 @@ -# GNU Guix --- Functional package management for GNU -# Copyright © 2016 Eric Bavier -# Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès -# Copyright © 2013 Andreas Enge -# Copyright © 2016 Taylan Ulrich Bayırlı/Kammer -# Copyright © 2016 Mathieu Lirzin -# -# This file is part of GNU Guix. -# -# GNU Guix is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or (at -# your option) any later version. -# -# GNU Guix is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Guix. If not, see . - -info_TEXINFOS = doc/guix.texi - -DOT_FILES = \ - doc/images/bootstrap-graph.dot \ - doc/images/bootstrap-packages.dot \ - doc/images/coreutils-graph.dot \ - doc/images/coreutils-bag-graph.dot \ - doc/images/service-graph.dot \ - doc/images/shepherd-graph.dot - -DOT_VECTOR_GRAPHICS = \ - $(DOT_FILES:%.dot=%.eps) \ - $(DOT_FILES:%.dot=%.pdf) - -EXTRA_DIST += \ - doc/htmlxref.cnf \ - doc/contributing.texi \ - doc/emacs.texi \ - doc/fdl-1.3.texi \ - $(DOT_FILES) \ - $(DOT_VECTOR_GRAPHICS) \ - doc/images/coreutils-size-map.eps \ - doc/environment-gdb.scm \ - doc/package-hello.scm - -OS_CONFIG_EXAMPLES_TEXI = \ - doc/os-config-bare-bones.texi \ - doc/os-config-desktop.texi \ - doc/os-config-lightweight-desktop.texi - -# Bundle this file so that makeinfo finds it in out-of-source-tree builds. -BUILT_SOURCES += $(OS_CONFIG_EXAMPLES_TEXI) -EXTRA_DIST += $(OS_CONFIG_EXAMPLES_TEXI) -MAINTAINERCLEANFILES = $(OS_CONFIG_EXAMPLES_TEXI) - -doc/os-config-%.texi: gnu/system/examples/%.tmpl - $(AM_V_GEN)$(MKDIR_P) "`dirname $@`"; \ - cp "$<" "$@" - -infoimagedir = $(infodir)/images -dist_infoimage_DATA = \ - $(DOT_FILES:%.dot=%.png) \ - doc/images/coreutils-size-map.png - -# Try hard to obtain an image size and aspect that's reasonable for inclusion -# in an Info or PDF document. -DOT_OPTIONS = \ - -Gratio=.9 -Gnodesep=.005 -Granksep=.00005 \ - -Nfontsize=9 -Nheight=.1 -Nwidth=.1 - -.dot.png: - $(AM_V_DOT)$(DOT) -Tpng $(DOT_OPTIONS) < "$<" > "$(srcdir)/$@.tmp"; \ - mv "$(srcdir)/$@.tmp" "$(srcdir)/$@" - -.dot.pdf: - $(AM_V_DOT)$(DOT) -Tpdf $(DOT_OPTIONS) < "$<" > "$(srcdir)/$@.tmp"; \ - mv "$(srcdir)/$@.tmp" "$(srcdir)/$@" - -.dot.eps: - $(AM_V_DOT)$(DOT) -Teps $(DOT_OPTIONS) < "$<" > "$(srcdir)/$@.tmp"; \ - mv "$(srcdir)/$@.tmp" "$(srcdir)/$@" - -.png.eps: - $(AM_V_GEN)convert "$<" "$@-tmp.eps"; \ - mv "$@-tmp.eps" "$@" - -# We cannot add new dependencies to `doc/guix.pdf' & co. (info "(automake) -# Extending"). Using the `-local' rules is imperfect, because they may be -# triggered after the main rule. Oh, well. -pdf-local: $(DOT_FILES=%.dot=$(top_srcdir)/%.pdf) -info-local: $(DOT_FILES=%.dot=$(top_srcdir)/%.png) -ps-local: $(DOT_FILES=%.dot=$(top_srcdir)/%.eps) \ - $(top_srcdir)/doc/images/coreutils-size-map.eps -dvi-local: ps-local - -## ----------- ## -## Man pages. ## -## ----------- ## - -# The man pages are generated using GNU Help2man. In makefiles rules they -# depend not on the binary, but on the source files. This usage allows a -# manual page to be generated by the maintainer and included in the -# distribution without requiring the end-user to have 'help2man' installed. -# They are built in $(srcdir) like info manuals. - -sub_commands_mans = \ - $(srcdir)/doc/guix-archive.1 \ - $(srcdir)/doc/guix-build.1 \ - $(srcdir)/doc/guix-challenge.1 \ - $(srcdir)/doc/guix-download.1 \ - $(srcdir)/doc/guix-edit.1 \ - $(srcdir)/doc/guix-environment.1 \ - $(srcdir)/doc/guix-gc.1 \ - $(srcdir)/doc/guix-hash.1 \ - $(srcdir)/doc/guix-import.1 \ - $(srcdir)/doc/guix-lint.1 \ - $(srcdir)/doc/guix-package.1 \ - $(srcdir)/doc/guix-publish.1 \ - $(srcdir)/doc/guix-pull.1 \ - $(srcdir)/doc/guix-refresh.1 \ - $(srcdir)/doc/guix-size.1 \ - $(srcdir)/doc/guix-system.1 - -dist_man1_MANS = \ - $(srcdir)/doc/guix.1 \ - $(sub_commands_mans) - -gen_man = \ - LANGUAGE= $(top_builddir)/pre-inst-env $(HELP2MAN) \ - $(HELP2MANFLAGS) - -HELP2MANFLAGS = --source=GNU --info-page=$(PACKAGE_TARNAME) - -$(srcdir)/doc/guix.1: scripts/guix.in $(sub_commands_mans) - -$(AM_V_HELP2MAN)$(gen_man) --output="$@" `basename "$@" .1` - -# The 'case' ensures the man pages are only generated if the corresponding -# source script (the first prerequisite) has been changed. The $(GOBJECTS) -# prerequisite is solely meant to force these docs to be made only after all -# Guile modules have been compiled. -$(srcdir)/doc/guix-%.1: guix/scripts/%.scm $(GOBJECTS) - -@case '$?' in \ - *$<*) $(AM_V_P) && set -x || echo " HELP2MAN $@"; \ - $(gen_man) --output="$@" "guix $*";; \ - *) : ;; \ - esac - -if BUILD_DAEMON - -dist_man1_MANS += $(srcdir)/doc/guix-daemon.1 - -$(srcdir)/doc/guix-daemon.1: nix/nix-daemon/guix-daemon.cc - -$(AM_V_HELP2MAN)$(gen_man) --output="$@" `basename "$@" .1` - -endif diff --git a/doc/guix.texi b/doc/guix.texi index 859db2be12..ab07d1066e 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -11286,7 +11286,7 @@ to be updated to refer to these binaries on the target platform. That is, the hashes and URLs of the bootstrap tarballs for the new platform must be added alongside those of the currently supported platforms. The bootstrap Guile tarball is treated specially: it is expected to be -available locally, and @file{gnu-system.am} has rules do download it for +available locally, and @file{gnu/local.mk} has rules do download it for the supported architectures; a rule for the new platform must be added as well. diff --git a/doc/local.mk b/doc/local.mk new file mode 100644 index 0000000000..b9f07c3590 --- /dev/null +++ b/doc/local.mk @@ -0,0 +1,157 @@ +# GNU Guix --- Functional package management for GNU +# Copyright © 2016 Eric Bavier +# Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès +# Copyright © 2013 Andreas Enge +# Copyright © 2016 Taylan Ulrich Bayırlı/Kammer +# Copyright © 2016 Mathieu Lirzin +# +# This file is part of GNU Guix. +# +# GNU Guix is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or (at +# your option) any later version. +# +# GNU Guix is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Guix. If not, see . + +info_TEXINFOS = doc/guix.texi + +DOT_FILES = \ + doc/images/bootstrap-graph.dot \ + doc/images/bootstrap-packages.dot \ + doc/images/coreutils-graph.dot \ + doc/images/coreutils-bag-graph.dot \ + doc/images/service-graph.dot \ + doc/images/shepherd-graph.dot + +DOT_VECTOR_GRAPHICS = \ + $(DOT_FILES:%.dot=%.eps) \ + $(DOT_FILES:%.dot=%.pdf) + +EXTRA_DIST += \ + doc/htmlxref.cnf \ + doc/contributing.texi \ + doc/emacs.texi \ + doc/fdl-1.3.texi \ + $(DOT_FILES) \ + $(DOT_VECTOR_GRAPHICS) \ + doc/images/coreutils-size-map.eps \ + doc/environment-gdb.scm \ + doc/package-hello.scm + +OS_CONFIG_EXAMPLES_TEXI = \ + doc/os-config-bare-bones.texi \ + doc/os-config-desktop.texi \ + doc/os-config-lightweight-desktop.texi + +# Bundle this file so that makeinfo finds it in out-of-source-tree builds. +BUILT_SOURCES += $(OS_CONFIG_EXAMPLES_TEXI) +EXTRA_DIST += $(OS_CONFIG_EXAMPLES_TEXI) +MAINTAINERCLEANFILES = $(OS_CONFIG_EXAMPLES_TEXI) + +doc/os-config-%.texi: gnu/system/examples/%.tmpl + $(AM_V_GEN)$(MKDIR_P) "`dirname $@`"; \ + cp "$<" "$@" + +infoimagedir = $(infodir)/images +dist_infoimage_DATA = \ + $(DOT_FILES:%.dot=%.png) \ + doc/images/coreutils-size-map.png + +# Try hard to obtain an image size and aspect that's reasonable for inclusion +# in an Info or PDF document. +DOT_OPTIONS = \ + -Gratio=.9 -Gnodesep=.005 -Granksep=.00005 \ + -Nfontsize=9 -Nheight=.1 -Nwidth=.1 + +.dot.png: + $(AM_V_DOT)$(DOT) -Tpng $(DOT_OPTIONS) < "$<" > "$(srcdir)/$@.tmp"; \ + mv "$(srcdir)/$@.tmp" "$(srcdir)/$@" + +.dot.pdf: + $(AM_V_DOT)$(DOT) -Tpdf $(DOT_OPTIONS) < "$<" > "$(srcdir)/$@.tmp"; \ + mv "$(srcdir)/$@.tmp" "$(srcdir)/$@" + +.dot.eps: + $(AM_V_DOT)$(DOT) -Teps $(DOT_OPTIONS) < "$<" > "$(srcdir)/$@.tmp"; \ + mv "$(srcdir)/$@.tmp" "$(srcdir)/$@" + +.png.eps: + $(AM_V_GEN)convert "$<" "$@-tmp.eps"; \ + mv "$@-tmp.eps" "$@" + +# We cannot add new dependencies to `doc/guix.pdf' & co. (info "(automake) +# Extending"). Using the `-local' rules is imperfect, because they may be +# triggered after the main rule. Oh, well. +pdf-local: $(DOT_FILES=%.dot=$(top_srcdir)/%.pdf) +info-local: $(DOT_FILES=%.dot=$(top_srcdir)/%.png) +ps-local: $(DOT_FILES=%.dot=$(top_srcdir)/%.eps) \ + $(top_srcdir)/doc/images/coreutils-size-map.eps +dvi-local: ps-local + +## ----------- ## +## Man pages. ## +## ----------- ## + +# The man pages are generated using GNU Help2man. In makefiles rules they +# depend not on the binary, but on the source files. This usage allows a +# manual page to be generated by the maintainer and included in the +# distribution without requiring the end-user to have 'help2man' installed. +# They are built in $(srcdir) like info manuals. + +sub_commands_mans = \ + $(srcdir)/doc/guix-archive.1 \ + $(srcdir)/doc/guix-build.1 \ + $(srcdir)/doc/guix-challenge.1 \ + $(srcdir)/doc/guix-download.1 \ + $(srcdir)/doc/guix-edit.1 \ + $(srcdir)/doc/guix-environment.1 \ + $(srcdir)/doc/guix-gc.1 \ + $(srcdir)/doc/guix-hash.1 \ + $(srcdir)/doc/guix-import.1 \ + $(srcdir)/doc/guix-lint.1 \ + $(srcdir)/doc/guix-package.1 \ + $(srcdir)/doc/guix-publish.1 \ + $(srcdir)/doc/guix-pull.1 \ + $(srcdir)/doc/guix-refresh.1 \ + $(srcdir)/doc/guix-size.1 \ + $(srcdir)/doc/guix-system.1 + +dist_man1_MANS = \ + $(srcdir)/doc/guix.1 \ + $(sub_commands_mans) + +gen_man = \ + LANGUAGE= $(top_builddir)/pre-inst-env $(HELP2MAN) \ + $(HELP2MANFLAGS) + +HELP2MANFLAGS = --source=GNU --info-page=$(PACKAGE_TARNAME) + +$(srcdir)/doc/guix.1: scripts/guix.in $(sub_commands_mans) + -$(AM_V_HELP2MAN)$(gen_man) --output="$@" `basename "$@" .1` + +# The 'case' ensures the man pages are only generated if the corresponding +# source script (the first prerequisite) has been changed. The $(GOBJECTS) +# prerequisite is solely meant to force these docs to be made only after all +# Guile modules have been compiled. +$(srcdir)/doc/guix-%.1: guix/scripts/%.scm $(GOBJECTS) + -@case '$?' in \ + *$<*) $(AM_V_P) && set -x || echo " HELP2MAN $@"; \ + $(gen_man) --output="$@" "guix $*";; \ + *) : ;; \ + esac + +if BUILD_DAEMON + +dist_man1_MANS += $(srcdir)/doc/guix-daemon.1 + +$(srcdir)/doc/guix-daemon.1: nix/nix-daemon/guix-daemon.cc + -$(AM_V_HELP2MAN)$(gen_man) --output="$@" `basename "$@" .1` + +endif diff --git a/emacs.am b/emacs.am deleted file mode 100644 index 62e33e4fd2..0000000000 --- a/emacs.am +++ /dev/null @@ -1,76 +0,0 @@ -# GNU Guix --- Functional package management for GNU -# Copyright © 2014, 2015, 2016 Alex Kost -# Copyright © 2016 Mathieu Lirzin -# -# This file is part of GNU Guix. -# -# GNU Guix is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or (at -# your option) any later version. -# -# GNU Guix is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Guix. If not, see . - -AUTOLOADS = emacs/guix-autoloads.el - -ELFILES = \ - emacs/guix-backend.el \ - emacs/guix-base.el \ - emacs/guix-build-log.el \ - emacs/guix-buffer.el \ - emacs/guix-command.el \ - emacs/guix-devel.el \ - emacs/guix-emacs.el \ - emacs/guix-entry.el \ - emacs/guix-external.el \ - emacs/guix-geiser.el \ - emacs/guix-guile.el \ - emacs/guix-help-vars.el \ - emacs/guix-history.el \ - emacs/guix-hydra.el \ - emacs/guix-hydra-build.el \ - emacs/guix-hydra-jobset.el \ - emacs/guix-info.el \ - emacs/guix-init.el \ - emacs/guix-license.el \ - emacs/guix-list.el \ - emacs/guix-location.el \ - emacs/guix-messages.el \ - emacs/guix-pcomplete.el \ - emacs/guix-popup.el \ - emacs/guix-prettify.el \ - emacs/guix-profiles.el \ - emacs/guix-read.el \ - emacs/guix-ui.el \ - emacs/guix-ui-license.el \ - emacs/guix-ui-location.el \ - emacs/guix-ui-package.el \ - emacs/guix-ui-generation.el \ - emacs/guix-ui-system-generation.el \ - emacs/guix-utils.el - -if HAVE_EMACS - -dist_lisp_DATA = $(ELFILES) - -nodist_lisp_DATA = \ - emacs/guix-config.el \ - $(AUTOLOADS) - -$(AUTOLOADS): $(ELFILES) - $(AM_V_EMACS)$(EMACS) --batch --eval \ - "(let ((backup-inhibited t) \ - (generated-autoload-file \ - (expand-file-name \"$(AUTOLOADS)\" \"$(builddir)\"))) \ - (update-directory-autoloads \ - (expand-file-name \"emacs\" \"$(srcdir)\")))" - -CLEANFILES += $(AUTOLOADS) - -endif HAVE_EMACS diff --git a/emacs/guix-config.el.in b/emacs/guix-config.el.in index bd821596c4..d03df9ce63 100644 --- a/emacs/guix-config.el.in +++ b/emacs/guix-config.el.in @@ -24,7 +24,7 @@ (replace-regexp-in-string "${prefix}" "@prefix@" "@emacsuidir@")) (defconst guix-config-state-directory - ;; This must match `NIX_STATE_DIR' as defined in `daemon.am'. + ;; This must match `NIX_STATE_DIR' as defined in `nix/local.mk'. (or (getenv "NIX_STATE_DIR") "@guix_localstatedir@/guix")) (defconst guix-config-guile-program "@GUILE@" diff --git a/emacs/local.mk b/emacs/local.mk new file mode 100644 index 0000000000..62e33e4fd2 --- /dev/null +++ b/emacs/local.mk @@ -0,0 +1,76 @@ +# GNU Guix --- Functional package management for GNU +# Copyright © 2014, 2015, 2016 Alex Kost +# Copyright © 2016 Mathieu Lirzin +# +# This file is part of GNU Guix. +# +# GNU Guix is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or (at +# your option) any later version. +# +# GNU Guix is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Guix. If not, see . + +AUTOLOADS = emacs/guix-autoloads.el + +ELFILES = \ + emacs/guix-backend.el \ + emacs/guix-base.el \ + emacs/guix-build-log.el \ + emacs/guix-buffer.el \ + emacs/guix-command.el \ + emacs/guix-devel.el \ + emacs/guix-emacs.el \ + emacs/guix-entry.el \ + emacs/guix-external.el \ + emacs/guix-geiser.el \ + emacs/guix-guile.el \ + emacs/guix-help-vars.el \ + emacs/guix-history.el \ + emacs/guix-hydra.el \ + emacs/guix-hydra-build.el \ + emacs/guix-hydra-jobset.el \ + emacs/guix-info.el \ + emacs/guix-init.el \ + emacs/guix-license.el \ + emacs/guix-list.el \ + emacs/guix-location.el \ + emacs/guix-messages.el \ + emacs/guix-pcomplete.el \ + emacs/guix-popup.el \ + emacs/guix-prettify.el \ + emacs/guix-profiles.el \ + emacs/guix-read.el \ + emacs/guix-ui.el \ + emacs/guix-ui-license.el \ + emacs/guix-ui-location.el \ + emacs/guix-ui-package.el \ + emacs/guix-ui-generation.el \ + emacs/guix-ui-system-generation.el \ + emacs/guix-utils.el + +if HAVE_EMACS + +dist_lisp_DATA = $(ELFILES) + +nodist_lisp_DATA = \ + emacs/guix-config.el \ + $(AUTOLOADS) + +$(AUTOLOADS): $(ELFILES) + $(AM_V_EMACS)$(EMACS) --batch --eval \ + "(let ((backup-inhibited t) \ + (generated-autoload-file \ + (expand-file-name \"$(AUTOLOADS)\" \"$(builddir)\"))) \ + (update-directory-autoloads \ + (expand-file-name \"emacs\" \"$(srcdir)\")))" + +CLEANFILES += $(AUTOLOADS) + +endif HAVE_EMACS diff --git a/gnu-system.am b/gnu-system.am deleted file mode 100644 index d58155a1b5..0000000000 --- a/gnu-system.am +++ /dev/null @@ -1,875 +0,0 @@ -# GNU Guix --- Functional package management for GNU -# Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès -# Copyright © 2013, 2014, 2015, 2016 Andreas Enge -# Copyright © 2016 Mathieu Lirzin -# Copyright © 2013, 2014, 2015, 2016 Mark H Weaver -# Copyright © 2016 Chris Marusich -# Copyright © 2016 Kei Yamashita -# -# This file is part of GNU Guix. -# -# GNU Guix is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or (at -# your option) any later version. -# -# GNU Guix is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Guix. If not, see . - -# Definitions for the GNU System: package modules, patches, bootstrap -# binaries. - -GNU_SYSTEM_MODULES = \ - gnu.scm \ - gnu/artwork.scm \ - gnu/packages.scm \ - gnu/packages/abduco.scm \ - gnu/packages/abiword.scm \ - gnu/packages/acct.scm \ - gnu/packages/acl.scm \ - gnu/packages/admin.scm \ - gnu/packages/adns.scm \ - gnu/packages/algebra.scm \ - gnu/packages/aidc.scm \ - gnu/packages/animation.scm \ - gnu/packages/anthy.scm \ - gnu/packages/apl.scm \ - gnu/packages/apr.scm \ - gnu/packages/asciidoc.scm \ - gnu/packages/aspell.scm \ - gnu/packages/attr.scm \ - gnu/packages/audacity.scm \ - gnu/packages/audio.scm \ - gnu/packages/augeas.scm \ - gnu/packages/autogen.scm \ - gnu/packages/autotools.scm \ - gnu/packages/avahi.scm \ - gnu/packages/avr.scm \ - gnu/packages/backup.scm \ - gnu/packages/base.scm \ - gnu/packages/bash.scm \ - gnu/packages/bdw-gc.scm \ - gnu/packages/bioinformatics.scm \ - gnu/packages/bittorrent.scm \ - gnu/packages/bison.scm \ - gnu/packages/boost.scm \ - gnu/packages/bootstrap.scm \ - gnu/packages/busybox.scm \ - gnu/packages/c.scm \ - gnu/packages/calcurse.scm \ - gnu/packages/ccache.scm \ - gnu/packages/cdrom.scm \ - gnu/packages/certs.scm \ - gnu/packages/check.scm \ - gnu/packages/ci.scm \ - gnu/packages/cmake.scm \ - gnu/packages/code.scm \ - gnu/packages/commencement.scm \ - gnu/packages/compression.scm \ - gnu/packages/conkeror.scm \ - gnu/packages/conky.scm \ - gnu/packages/cook.scm \ - gnu/packages/cpio.scm \ - gnu/packages/cppi.scm \ - gnu/packages/cross-base.scm \ - gnu/packages/crypto.scm \ - gnu/packages/cryptsetup.scm \ - gnu/packages/cups.scm \ - gnu/packages/curl.scm \ - gnu/packages/cyrus-sasl.scm \ - gnu/packages/databases.scm \ - gnu/packages/datamash.scm \ - gnu/packages/datastructures.scm \ - gnu/packages/dav.scm \ - gnu/packages/dc.scm \ - gnu/packages/debug.scm \ - gnu/packages/dejagnu.scm \ - gnu/packages/dico.scm \ - gnu/packages/dictionaries.scm \ - gnu/packages/dillo.scm \ - gnu/packages/disk.scm \ - gnu/packages/djvu.scm \ - gnu/packages/dns.scm \ - gnu/packages/docbook.scm \ - gnu/packages/docker.scm \ - gnu/packages/doxygen.scm \ - gnu/packages/dunst.scm \ - gnu/packages/dvtm.scm \ - gnu/packages/ebook.scm \ - gnu/packages/ed.scm \ - gnu/packages/elf.scm \ - gnu/packages/emacs.scm \ - gnu/packages/enchant.scm \ - gnu/packages/engineering.scm \ - gnu/packages/enlightenment.scm \ - gnu/packages/fcitx.scm \ - gnu/packages/feh.scm \ - gnu/packages/figlet.scm \ - gnu/packages/file.scm \ - gnu/packages/finance.scm \ - gnu/packages/firmware.scm \ - gnu/packages/fish.scm \ - gnu/packages/flashing-tools.scm \ - gnu/packages/flex.scm \ - gnu/packages/fltk.scm \ - gnu/packages/fonts.scm \ - gnu/packages/fontutils.scm \ - gnu/packages/freedesktop.scm \ - gnu/packages/freeipmi.scm \ - gnu/packages/ftp.scm \ - gnu/packages/fribidi.scm \ - gnu/packages/fvwm.scm \ - gnu/packages/game-development.scm \ - gnu/packages/games.scm \ - gnu/packages/gawk.scm \ - gnu/packages/gcal.scm \ - gnu/packages/gcc.scm \ - gnu/packages/gd.scm \ - gnu/packages/gdb.scm \ - gnu/packages/geeqie.scm \ - gnu/packages/gettext.scm \ - gnu/packages/ghostscript.scm \ - gnu/packages/gimp.scm \ - gnu/packages/gkrellm.scm \ - gnu/packages/gl.scm \ - gnu/packages/glib.scm \ - gnu/packages/gnome.scm \ - gnu/packages/gnu-doc.scm \ - gnu/packages/gnucash.scm \ - gnu/packages/gnunet.scm \ - gnu/packages/gnupg.scm \ - gnu/packages/gnustep.scm \ - gnu/packages/gnuzilla.scm \ - gnu/packages/gnu-pw-mgr.scm \ - gnu/packages/gperf.scm \ - gnu/packages/gprolog.scm \ - gnu/packages/gps.scm \ - gnu/packages/graphics.scm \ - gnu/packages/graphviz.scm \ - gnu/packages/groff.scm \ - gnu/packages/grub.scm \ - gnu/packages/grue-hunter.scm \ - gnu/packages/gsasl.scm \ - gnu/packages/gstreamer.scm \ - gnu/packages/gtk.scm \ - gnu/packages/guile.scm \ - gnu/packages/guile-wm.scm \ - gnu/packages/gv.scm \ - gnu/packages/gxmessage.scm \ - gnu/packages/haskell.scm \ - gnu/packages/hugs.scm \ - gnu/packages/hurd.scm \ - gnu/packages/ibus.scm \ - gnu/packages/icu4c.scm \ - gnu/packages/idutils.scm \ - gnu/packages/image.scm \ - gnu/packages/imagemagick.scm \ - gnu/packages/indent.scm \ - gnu/packages/inklingreader.scm \ - gnu/packages/inkscape.scm \ - gnu/packages/irc.scm \ - gnu/packages/iso-codes.scm \ - gnu/packages/java.scm \ - gnu/packages/jemalloc.scm \ - gnu/packages/jrnl.scm \ - gnu/packages/julia.scm \ - gnu/packages/kde.scm \ - gnu/packages/kde-frameworks.scm \ - gnu/packages/key-mon.scm \ - gnu/packages/kodi.scm \ - gnu/packages/language.scm \ - gnu/packages/ldc.scm \ - gnu/packages/lego.scm \ - gnu/packages/less.scm \ - gnu/packages/lesstif.scm \ - gnu/packages/libcanberra.scm \ - gnu/packages/libdaemon.scm \ - gnu/packages/libedit.scm \ - gnu/packages/libevent.scm \ - gnu/packages/libffcall.scm \ - gnu/packages/libffi.scm \ - gnu/packages/libftdi.scm \ - gnu/packages/calendar.scm \ - gnu/packages/libidn.scm \ - gnu/packages/libphidget.scm \ - gnu/packages/libreoffice.scm \ - gnu/packages/libsigsegv.scm \ - gnu/packages/libunistring.scm \ - gnu/packages/libusb.scm \ - gnu/packages/libunwind.scm \ - gnu/packages/libupnp.scm \ - gnu/packages/lightning.scm \ - gnu/packages/links.scm \ - gnu/packages/linux.scm \ - gnu/packages/lirc.scm \ - gnu/packages/lisp.scm \ - gnu/packages/llvm.scm \ - gnu/packages/lout.scm \ - gnu/packages/lsh.scm \ - gnu/packages/lsof.scm \ - gnu/packages/lua.scm \ - gnu/packages/lxde.scm \ - gnu/packages/lxqt.scm \ - gnu/packages/lynx.scm \ - gnu/packages/m4.scm \ - gnu/packages/machine-learning.scm \ - gnu/packages/man.scm \ - gnu/packages/mail.scm \ - gnu/packages/make-bootstrap.scm \ - gnu/packages/markdown.scm \ - gnu/packages/marst.scm \ - gnu/packages/mate.scm \ - gnu/packages/maths.scm \ - gnu/packages/mc.scm \ - gnu/packages/mcrypt.scm \ - gnu/packages/messaging.scm \ - gnu/packages/mg.scm \ - gnu/packages/mit-krb5.scm \ - gnu/packages/moe.scm \ - gnu/packages/moreutils.scm \ - gnu/packages/mpd.scm \ - gnu/packages/mp3.scm \ - gnu/packages/mpi.scm \ - gnu/packages/multiprecision.scm \ - gnu/packages/music.scm \ - gnu/packages/mtools.scm \ - gnu/packages/nano.scm \ - gnu/packages/ncdu.scm \ - gnu/packages/ncurses.scm \ - gnu/packages/netpbm.scm \ - gnu/packages/nettle.scm \ - gnu/packages/networking.scm \ - gnu/packages/ninja.scm \ - gnu/packages/node.scm \ - gnu/packages/noweb.scm \ - gnu/packages/ntp.scm \ - gnu/packages/nutrition.scm \ - gnu/packages/nvi.scm \ - gnu/packages/ocaml.scm \ - gnu/packages/ocr.scm \ - gnu/packages/onc-rpc.scm \ - gnu/packages/openbox.scm \ - gnu/packages/openldap.scm \ - gnu/packages/openstack.scm \ - gnu/packages/orpheus.scm \ - gnu/packages/ots.scm \ - gnu/packages/owncloud.scm \ - gnu/packages/package-management.scm \ - gnu/packages/parallel.scm \ - gnu/packages/password-utils.scm \ - gnu/packages/patchutils.scm \ - gnu/packages/pciutils.scm \ - gnu/packages/pcre.scm \ - gnu/packages/pdf.scm \ - gnu/packages/pem.scm \ - gnu/packages/perl.scm \ - gnu/packages/photo.scm \ - gnu/packages/pkg-config.scm \ - gnu/packages/plotutils.scm \ - gnu/packages/polkit.scm \ - gnu/packages/popt.scm \ - gnu/packages/pth.scm \ - gnu/packages/pulseaudio.scm \ - gnu/packages/pumpio.scm \ - gnu/packages/pretty-print.scm \ - gnu/packages/protobuf.scm \ - gnu/packages/pv.scm \ - gnu/packages/python.scm \ - gnu/packages/qemu.scm \ - gnu/packages/qt.scm \ - gnu/packages/ragel.scm \ - gnu/packages/ratpoison.scm \ - gnu/packages/rc.scm \ - gnu/packages/rdesktop.scm \ - gnu/packages/rdf.scm \ - gnu/packages/readline.scm \ - gnu/packages/rrdtool.scm \ - gnu/packages/rsync.scm \ - gnu/packages/ruby.scm \ - gnu/packages/rush.scm \ - gnu/packages/samba.scm \ - gnu/packages/sawfish.scm \ - gnu/packages/scanner.scm \ - gnu/packages/scheme.scm \ - gnu/packages/screen.scm \ - gnu/packages/scribus.scm \ - gnu/packages/sdl.scm \ - gnu/packages/search.scm \ - gnu/packages/serialization.scm \ - gnu/packages/serveez.scm \ - gnu/packages/shishi.scm \ - gnu/packages/skarnet.scm \ - gnu/packages/skribilo.scm \ - gnu/packages/slang.scm \ - gnu/packages/slim.scm \ - gnu/packages/smalltalk.scm \ - gnu/packages/ssh.scm \ - gnu/packages/stalonetray.scm \ - gnu/packages/statistics.scm \ - gnu/packages/suckless.scm \ - gnu/packages/swig.scm \ - gnu/packages/sxiv.scm \ - gnu/packages/synergy.scm \ - gnu/packages/task-management.scm \ - gnu/packages/tbb.scm \ - gnu/packages/tcl.scm \ - gnu/packages/tcsh.scm \ - gnu/packages/telephony.scm \ - gnu/packages/terminals.scm \ - gnu/packages/texinfo.scm \ - gnu/packages/texlive.scm \ - gnu/packages/textutils.scm \ - gnu/packages/time.scm \ - gnu/packages/tls.scm \ - gnu/packages/tmux.scm \ - gnu/packages/tor.scm \ - gnu/packages/tre.scm \ - gnu/packages/tv.scm \ - gnu/packages/unrtf.scm \ - gnu/packages/upnp.scm \ - gnu/packages/uucp.scm \ - gnu/packages/valgrind.scm \ - gnu/packages/version-control.scm \ - gnu/packages/video.scm \ - gnu/packages/vim.scm \ - gnu/packages/vpn.scm \ - gnu/packages/vtk.scm \ - gnu/packages/w3m.scm \ - gnu/packages/wdiff.scm \ - gnu/packages/web.scm \ - gnu/packages/webkit.scm \ - gnu/packages/wget.scm \ - gnu/packages/wicd.scm \ - gnu/packages/wine.scm \ - gnu/packages/wm.scm \ - gnu/packages/wordnet.scm \ - gnu/packages/wv.scm \ - gnu/packages/wxwidgets.scm \ - gnu/packages/xfig.scm \ - gnu/packages/xiph.scm \ - gnu/packages/xml.scm \ - gnu/packages/xnee.scm \ - gnu/packages/xdisorg.scm \ - gnu/packages/xorg.scm \ - gnu/packages/xfce.scm \ - gnu/packages/yasm.scm \ - gnu/packages/yubico.scm \ - gnu/packages/zile.scm \ - gnu/packages/zip.scm \ - gnu/packages/zsh.scm \ - \ - gnu/services.scm \ - gnu/services/avahi.scm \ - gnu/services/base.scm \ - gnu/services/databases.scm \ - gnu/services/dbus.scm \ - gnu/services/desktop.scm \ - gnu/services/lirc.scm \ - gnu/services/mail.scm \ - gnu/services/networking.scm \ - gnu/services/shepherd.scm \ - gnu/services/herd.scm \ - gnu/services/ssh.scm \ - gnu/services/web.scm \ - gnu/services/xorg.scm \ - \ - gnu/system.scm \ - gnu/system/file-systems.scm \ - gnu/system/grub.scm \ - gnu/system/install.scm \ - gnu/system/linux-container.scm \ - gnu/system/linux-initrd.scm \ - gnu/system/locale.scm \ - gnu/system/mapped-devices.scm \ - gnu/system/nss.scm \ - gnu/system/pam.scm \ - gnu/system/shadow.scm \ - gnu/system/vm.scm \ - \ - gnu/build/activation.scm \ - gnu/build/file-systems.scm \ - gnu/build/install.scm \ - gnu/build/linux-boot.scm \ - gnu/build/linux-container.scm \ - gnu/build/linux-initrd.scm \ - gnu/build/linux-modules.scm \ - gnu/build/vm.scm - - -patchdir = $(guilemoduledir)/gnu/packages/patches -dist_patch_DATA = \ - gnu/packages/patches/abiword-explictly-cast-bools.patch \ - gnu/packages/patches/abiword-wmf-version-lookup-fix.patch \ - gnu/packages/patches/acl-hurd-path-max.patch \ - gnu/packages/patches/aegis-constness-error.patch \ - gnu/packages/patches/aegis-perl-tempdir1.patch \ - gnu/packages/patches/aegis-perl-tempdir2.patch \ - gnu/packages/patches/aegis-test-fixup-1.patch \ - gnu/packages/patches/aegis-test-fixup-2.patch \ - gnu/packages/patches/agg-am_c_prototype.patch \ - gnu/packages/patches/alsa-lib-mips-atomic-fix.patch \ - gnu/packages/patches/apr-skip-getservbyname-test.patch \ - gnu/packages/patches/arb-ldconfig.patch \ - gnu/packages/patches/asymptote-gsl2.patch \ - gnu/packages/patches/ath9k-htc-firmware-binutils.patch \ - gnu/packages/patches/ath9k-htc-firmware-gcc.patch \ - gnu/packages/patches/ath9k-htc-firmware-objcopy.patch \ - gnu/packages/patches/audacity-fix-ffmpeg-binding.patch \ - gnu/packages/patches/automake-skip-amhello-tests.patch \ - gnu/packages/patches/automake-regexp-syntax.patch \ - gnu/packages/patches/avahi-localstatedir.patch \ - gnu/packages/patches/avidemux-install-to-lib.patch \ - gnu/packages/patches/avrdude-fix-libusb.patch \ - gnu/packages/patches/bash-completion-directories.patch \ - gnu/packages/patches/bigloo-gc-shebangs.patch \ - gnu/packages/patches/binutils-ld-new-dtags.patch \ - gnu/packages/patches/binutils-loongson-workaround.patch \ - gnu/packages/patches/byobu-writable-status.patch \ - gnu/packages/patches/calibre-drop-unrar.patch \ - gnu/packages/patches/calibre-no-updates-dialog.patch \ - gnu/packages/patches/cdparanoia-fpic.patch \ - gnu/packages/patches/chmlib-inttypes.patch \ - gnu/packages/patches/clang-libc-search-path.patch \ - gnu/packages/patches/clucene-pkgconfig.patch \ - gnu/packages/patches/cmake-fix-tests.patch \ - gnu/packages/patches/cpio-gets-undeclared.patch \ - gnu/packages/patches/cpio-CVE-2016-2037.patch \ - gnu/packages/patches/cpufrequtils-fix-aclocal.patch \ - gnu/packages/patches/crda-optional-gcrypt.patch \ - gnu/packages/patches/crossmap-allow-system-pysam.patch \ - gnu/packages/patches/csound-header-ordering.patch \ - gnu/packages/patches/cssc-gets-undeclared.patch \ - gnu/packages/patches/cssc-missing-include.patch \ - gnu/packages/patches/clucene-contribs-lib.patch \ - gnu/packages/patches/cursynth-wave-rand.patch \ - gnu/packages/patches/dbus-helper-search-path.patch \ - gnu/packages/patches/dealii-p4est-interface.patch \ - gnu/packages/patches/devil-fix-libpng.patch \ - gnu/packages/patches/dico-libtool-deterministic.patch \ - gnu/packages/patches/diffutils-gets-undeclared.patch \ - gnu/packages/patches/dfu-programmer-fix-libusb.patch \ - gnu/packages/patches/doxygen-test.patch \ - gnu/packages/patches/duplicity-piped-password.patch \ - gnu/packages/patches/duplicity-test_selection-tmp.patch \ - gnu/packages/patches/elfutils-tests-ptrace.patch \ - gnu/packages/patches/einstein-build.patch \ - gnu/packages/patches/emacs-constants-lisp-like.patch \ - gnu/packages/patches/emacs-exec-path.patch \ - gnu/packages/patches/emacs-scheme-complete-scheme-r5rs-info.patch \ - gnu/packages/patches/emacs-source-date-epoch.patch \ - gnu/packages/patches/eudev-rules-directory.patch \ - gnu/packages/patches/evilwm-lost-focus-bug.patch \ - gnu/packages/patches/expat-CVE-2015-1283.patch \ - gnu/packages/patches/fastcap-mulGlobal.patch \ - gnu/packages/patches/fastcap-mulSetup.patch \ - gnu/packages/patches/fasthenry-spAllocate.patch \ - gnu/packages/patches/fasthenry-spBuild.patch \ - gnu/packages/patches/fasthenry-spUtils.patch \ - gnu/packages/patches/fasthenry-spSolve.patch \ - gnu/packages/patches/fasthenry-spFactor.patch \ - gnu/packages/patches/findutils-localstatedir.patch \ - gnu/packages/patches/findutils-test-xargs.patch \ - gnu/packages/patches/flashrom-use-libftdi1.patch \ - gnu/packages/patches/flint-ldconfig.patch \ - gnu/packages/patches/fltk-shared-lib-defines.patch \ - gnu/packages/patches/fontforge-svg-modtime.patch \ - gnu/packages/patches/freeimage-CVE-2015-0852.patch \ - gnu/packages/patches/gawk-fts-test.patch \ - gnu/packages/patches/gawk-shell.patch \ - gnu/packages/patches/gcc-arm-link-spec-fix.patch \ - gnu/packages/patches/gcc-cross-environment-variables.patch \ - gnu/packages/patches/gcc-libvtv-runpath.patch \ - gnu/packages/patches/gcc-5.0-libvtv-runpath.patch \ - gnu/packages/patches/geoclue-config.patch \ - gnu/packages/patches/ghostscript-CVE-2015-3228.patch \ - gnu/packages/patches/ghostscript-runpath.patch \ - gnu/packages/patches/glib-networking-ssl-cert-file.patch \ - gnu/packages/patches/glib-tests-desktop.patch \ - gnu/packages/patches/glib-tests-homedir.patch \ - gnu/packages/patches/glib-tests-prlimit.patch \ - gnu/packages/patches/glib-tests-timer.patch \ - gnu/packages/patches/glib-tests-gapplication.patch \ - gnu/packages/patches/glibc-CVE-2015-7547.patch \ - gnu/packages/patches/glibc-bootstrap-system.patch \ - gnu/packages/patches/glibc-hurd-extern-inline.patch \ - gnu/packages/patches/glibc-ldd-x86_64.patch \ - gnu/packages/patches/glibc-locales.patch \ - gnu/packages/patches/glibc-locale-incompatibility.patch \ - gnu/packages/patches/glibc-o-largefile.patch \ - gnu/packages/patches/glibc-versioned-locpath.patch \ - gnu/packages/patches/gmp-arm-asm-nothumb.patch \ - gnu/packages/patches/gmp-faulty-test.patch \ - gnu/packages/patches/gnucash-price-quotes-perl.patch \ - gnu/packages/patches/gnupg-simple-query-ignore-status-messages.patch \ - gnu/packages/patches/gobject-introspection-absolute-shlib-path.patch \ - gnu/packages/patches/gobject-introspection-cc.patch \ - gnu/packages/patches/gobject-introspection-girepository.patch \ - gnu/packages/patches/grep-timing-sensitive-test.patch \ - gnu/packages/patches/grub-CVE-2015-8370.patch \ - gnu/packages/patches/grub-gets-undeclared.patch \ - gnu/packages/patches/grub-freetype.patch \ - gnu/packages/patches/guile-1.8-cpp-4.5.patch \ - gnu/packages/patches/guile-arm-fixes.patch \ - gnu/packages/patches/guile-default-utf8.patch \ - gnu/packages/patches/guile-linux-syscalls.patch \ - gnu/packages/patches/guile-present-coding.patch \ - gnu/packages/patches/guile-relocatable.patch \ - gnu/packages/patches/guile-rsvg-pkgconfig.patch \ - gnu/packages/patches/gtk2-respect-GUIX_GTK2_PATH.patch \ - gnu/packages/patches/gtk3-respect-GUIX_GTK3_PATH.patch \ - gnu/packages/patches/gtkglext-disable-disable-deprecated.patch \ - gnu/packages/patches/hop-bigloo-4.0b.patch \ - gnu/packages/patches/hop-linker-flags.patch \ - gnu/packages/patches/hydra-automake-1.15.patch \ - gnu/packages/patches/hydra-disable-darcs-test.patch \ - gnu/packages/patches/icecat-avoid-bundled-includes.patch \ - gnu/packages/patches/icecat-re-enable-DHE-cipher-suites.patch \ - gnu/packages/patches/icu4c-CVE-2014-6585.patch \ - gnu/packages/patches/icu4c-CVE-2015-1270.patch \ - gnu/packages/patches/icu4c-CVE-2015-4760.patch \ - gnu/packages/patches/ilmbase-fix-tests.patch \ - gnu/packages/patches/imagemagick-test-segv.patch \ - gnu/packages/patches/irrlicht-mesa-10.patch \ - gnu/packages/patches/jasper-CVE-2007-2721.patch \ - gnu/packages/patches/jasper-CVE-2008-3520.patch \ - gnu/packages/patches/jasper-CVE-2008-3522.patch \ - gnu/packages/patches/jasper-CVE-2011-4516-and-CVE-2011-4517.patch \ - gnu/packages/patches/jasper-CVE-2014-8137.patch \ - gnu/packages/patches/jasper-CVE-2014-8138.patch \ - gnu/packages/patches/jasper-CVE-2014-8157.patch \ - gnu/packages/patches/jasper-CVE-2014-8158.patch \ - gnu/packages/patches/jasper-CVE-2014-9029.patch \ - gnu/packages/patches/jasper-CVE-2016-1577.patch \ - gnu/packages/patches/jasper-CVE-2016-1867.patch \ - gnu/packages/patches/jasper-CVE-2016-2089.patch \ - gnu/packages/patches/jasper-CVE-2016-2116.patch \ - gnu/packages/patches/jbig2dec-ignore-testtest.patch \ - gnu/packages/patches/kmod-module-directory.patch \ - gnu/packages/patches/ldc-disable-tests.patch \ - gnu/packages/patches/lftp-dont-save-unknown-host-fingerprint.patch \ - gnu/packages/patches/liba52-enable-pic.patch \ - gnu/packages/patches/liba52-link-with-libm.patch \ - gnu/packages/patches/liba52-set-soname.patch \ - gnu/packages/patches/liba52-use-mtune-not-mcpu.patch \ - gnu/packages/patches/libarchive-bsdtar-test.patch \ - gnu/packages/patches/libarchive-CVE-2013-0211.patch \ - gnu/packages/patches/libarchive-fix-lzo-test-case.patch \ - gnu/packages/patches/libarchive-mtree-filename-length-fix.patch \ - gnu/packages/patches/libbonobo-activation-test-race.patch \ - gnu/packages/patches/libcanberra-sound-theme-freedesktop.patch \ - gnu/packages/patches/libcmis-fix-test-onedrive.patch \ - gnu/packages/patches/libdrm-symbol-check.patch \ - gnu/packages/patches/libevent-dns-tests.patch \ - gnu/packages/patches/libextractor-ffmpeg-3.patch \ - gnu/packages/patches/libmtp-devices.patch \ - gnu/packages/patches/liboop-mips64-deplibs-fix.patch \ - gnu/packages/patches/libotr-test-auth-fix.patch \ - gnu/packages/patches/liblxqt-include.patch \ - gnu/packages/patches/libmad-armv7-thumb-pt1.patch \ - gnu/packages/patches/libmad-armv7-thumb-pt2.patch \ - gnu/packages/patches/libmad-frame-length.patch \ - gnu/packages/patches/libmad-mips-newgcc.patch \ - gnu/packages/patches/libssh-0.6.5-CVE-2016-0739.patch \ - gnu/packages/patches/libtheora-config-guess.patch \ - gnu/packages/patches/libtiff-CVE-2015-8665+CVE-2015-8683.patch \ - gnu/packages/patches/libtiff-oob-accesses-in-decode.patch \ - gnu/packages/patches/libtiff-oob-write-in-nextdecode.patch \ - gnu/packages/patches/libtool-skip-tests2.patch \ - gnu/packages/patches/libunwind-CVE-2015-3239.patch \ - gnu/packages/patches/libwmf-CAN-2004-0941.patch \ - gnu/packages/patches/libwmf-CVE-2006-3376.patch \ - gnu/packages/patches/libwmf-CVE-2007-0455.patch \ - gnu/packages/patches/libwmf-CVE-2007-2756.patch \ - gnu/packages/patches/libwmf-CVE-2007-3472.patch \ - gnu/packages/patches/libwmf-CVE-2007-3473.patch \ - gnu/packages/patches/libwmf-CVE-2007-3477.patch \ - gnu/packages/patches/libwmf-CVE-2009-1364.patch \ - gnu/packages/patches/libwmf-CVE-2009-3546.patch \ - gnu/packages/patches/libwmf-CVE-2015-0848+CVE-2015-4588.patch \ - gnu/packages/patches/libwmf-CVE-2015-4695.patch \ - gnu/packages/patches/libwmf-CVE-2015-4696.patch \ - gnu/packages/patches/libxslt-CVE-2015-7995.patch \ - gnu/packages/patches/lirc-localstatedir.patch \ - gnu/packages/patches/libpthread-glibc-preparation.patch \ - gnu/packages/patches/lm-sensors-hwmon-attrs.patch \ - gnu/packages/patches/lua-pkgconfig.patch \ - gnu/packages/patches/lua51-liblua-so.patch \ - gnu/packages/patches/lua52-liblua-so.patch \ - gnu/packages/patches/luajit-no_ldconfig.patch \ - gnu/packages/patches/luajit-symlinks.patch \ - gnu/packages/patches/luit-posix.patch \ - gnu/packages/patches/m4-gets-undeclared.patch \ - gnu/packages/patches/make-impure-dirs.patch \ - gnu/packages/patches/mars-install.patch \ - gnu/packages/patches/mars-sfml-2.3.patch \ - gnu/packages/patches/matplotlib-setupext-tk.patch \ - gnu/packages/patches/maxima-defsystem-mkdir.patch \ - gnu/packages/patches/mcron-install.patch \ - gnu/packages/patches/mdadm-gcc-4.9-fix.patch \ - gnu/packages/patches/mhash-keygen-test-segfault.patch \ - gnu/packages/patches/mit-krb5-CVE-2015-8629.patch \ - gnu/packages/patches/mit-krb5-CVE-2015-8630.patch \ - gnu/packages/patches/mit-krb5-CVE-2015-8631.patch \ - gnu/packages/patches/mit-krb5-init-context-null-spnego.patch \ - gnu/packages/patches/mpc123-initialize-ao.patch \ - gnu/packages/patches/mplayer2-theora-fix.patch \ - gnu/packages/patches/module-init-tools-moduledir.patch \ - gnu/packages/patches/mumps-build-parallelism.patch \ - gnu/packages/patches/mupen64plus-ui-console-notice.patch \ - gnu/packages/patches/mutt-store-references.patch \ - gnu/packages/patches/net-tools-bitrot.patch \ - gnu/packages/patches/ngircd-handle-zombies.patch \ - gnu/packages/patches/ngircd-no-dns-in-tests.patch \ - gnu/packages/patches/ninja-tests.patch \ - gnu/packages/patches/ninja-zero-mtime.patch \ - gnu/packages/patches/nss-pkgconfig.patch \ - gnu/packages/patches/nvi-assume-preserve-path.patch \ - gnu/packages/patches/nvi-dbpagesize-binpower.patch \ - gnu/packages/patches/nvi-db4.patch \ - gnu/packages/patches/ocaml-findlib-make-install.patch \ - gnu/packages/patches/openexr-missing-samples.patch \ - gnu/packages/patches/openimageio-boost-1.60.patch \ - gnu/packages/patches/openjpeg-CVE-2015-6581.patch \ - gnu/packages/patches/openjpeg-use-after-free-fix.patch \ - gnu/packages/patches/openssh-CVE-2015-8325.patch \ - gnu/packages/patches/openssl-runpath.patch \ - gnu/packages/patches/openssl-c-rehash-in.patch \ - gnu/packages/patches/orpheus-cast-errors-and-includes.patch \ - gnu/packages/patches/ots-no-include-missing-file.patch \ - gnu/packages/patches/patchelf-page-size.patch \ - gnu/packages/patches/patchelf-rework-for-arm.patch \ - gnu/packages/patches/patchutils-xfail-gendiff-tests.patch \ - gnu/packages/patches/patch-hurd-path-max.patch \ - gnu/packages/patches/pcre-CVE-2016-3191.patch \ - gnu/packages/patches/perl-CVE-2015-8607.patch \ - gnu/packages/patches/perl-CVE-2016-2381.patch \ - gnu/packages/patches/perl-autosplit-default-time.patch \ - gnu/packages/patches/perl-deterministic-ordering.patch \ - gnu/packages/patches/perl-finance-quote-unuse-mozilla-ca.patch \ - gnu/packages/patches/perl-gd-options-passthrough-and-fontconfig.patch \ - gnu/packages/patches/perl-io-socket-ssl-openssl-1.0.2f-fix.patch \ - gnu/packages/patches/perl-net-amazon-s3-moose-warning.patch \ - gnu/packages/patches/perl-net-ssleay-disable-ede-test.patch \ - gnu/packages/patches/perl-no-build-time.patch \ - gnu/packages/patches/perl-no-sys-dirs.patch \ - gnu/packages/patches/perl-module-pluggable-search.patch \ - gnu/packages/patches/perl-source-date-epoch.patch \ - gnu/packages/patches/pidgin-add-search-path.patch \ - gnu/packages/patches/pinball-const-fix.patch \ - gnu/packages/patches/pinball-cstddef.patch \ - gnu/packages/patches/pinball-missing-separators.patch \ - gnu/packages/patches/pinball-src-deps.patch \ - gnu/packages/patches/pinball-system-ltdl.patch \ - gnu/packages/patches/pingus-sdl-libs-config.patch \ - gnu/packages/patches/plink-1.07-unclobber-i.patch \ - gnu/packages/patches/plotutils-libpng-jmpbuf.patch \ - gnu/packages/patches/polkit-drop-test.patch \ - gnu/packages/patches/portaudio-audacity-compat.patch \ - gnu/packages/patches/procmail-ambiguous-getline-debian.patch \ - gnu/packages/patches/pt-scotch-build-parallelism.patch \ - gnu/packages/patches/pulseaudio-fix-mult-test.patch \ - gnu/packages/patches/pulseaudio-longer-test-timeout.patch \ - gnu/packages/patches/pycairo-wscript.patch \ - gnu/packages/patches/pybugz-encode-error.patch \ - gnu/packages/patches/pybugz-stty.patch \ - gnu/packages/patches/pygpgme-disable-problematic-tests.patch \ - gnu/packages/patches/pyqt-configure.patch \ - gnu/packages/patches/python-2-deterministic-build-info.patch \ - gnu/packages/patches/python-2.7-search-paths.patch \ - gnu/packages/patches/python-2.7-source-date-epoch.patch \ - gnu/packages/patches/python-3-deterministic-build-info.patch \ - gnu/packages/patches/python-3-search-paths.patch \ - gnu/packages/patches/python-disable-ssl-test.patch \ - gnu/packages/patches/python-fix-tests.patch \ - gnu/packages/patches/python-ipython-inputhook-ctype.patch \ - gnu/packages/patches/python-rarfile-fix-tests.patch \ - gnu/packages/patches/python2-rdflib-drop-sparqlwrapper.patch \ - gnu/packages/patches/python-configobj-setuptools.patch \ - gnu/packages/patches/python-paste-remove-website-test.patch \ - gnu/packages/patches/python-paste-remove-timing-test.patch \ - gnu/packages/patches/python2-pygobject-2-gi-info-type-error-domain.patch \ - gnu/packages/patches/python-pandas-fix-tslib-test-failure.patch \ - gnu/packages/patches/qemu-CVE-2015-8558.patch \ - gnu/packages/patches/qemu-CVE-2015-8567.patch \ - gnu/packages/patches/qemu-CVE-2015-8613.patch \ - gnu/packages/patches/qemu-CVE-2015-8619.patch \ - gnu/packages/patches/qemu-CVE-2015-8701.patch \ - gnu/packages/patches/qemu-CVE-2015-8743.patch \ - gnu/packages/patches/qemu-CVE-2016-1568.patch \ - gnu/packages/patches/qemu-CVE-2016-1922.patch \ - gnu/packages/patches/qemu-CVE-2016-1981.patch \ - gnu/packages/patches/qemu-CVE-2016-2197.patch \ - gnu/packages/patches/qemu-usb-ehci-oob-read.patch \ - gnu/packages/patches/qemu-virtio-9p-use-accessor-to-get-thread-pool.patch \ - gnu/packages/patches/qt4-ldflags.patch \ - gnu/packages/patches/ratpoison-shell.patch \ - gnu/packages/patches/readline-link-ncurses.patch \ - gnu/packages/patches/ripperx-missing-file.patch \ - gnu/packages/patches/rsem-makefile.patch \ - gnu/packages/patches/sed-hurd-path-max.patch \ - gnu/packages/patches/scheme48-tests.patch \ - gnu/packages/patches/scotch-test-threading.patch \ - gnu/packages/patches/sdl-libx11-1.6.patch \ - gnu/packages/patches/serf-comment-style-fix.patch \ - gnu/packages/patches/serf-deflate-buckets-test-fix.patch \ - gnu/packages/patches/slim-session.patch \ - gnu/packages/patches/slim-config.patch \ - gnu/packages/patches/slim-sigusr1.patch \ - gnu/packages/patches/slurm-configure-remove-nonfree-contribs.patch \ - gnu/packages/patches/soprano-find-clucene.patch \ - gnu/packages/patches/sudo-CVE-2015-5602.patch \ - gnu/packages/patches/superlu-dist-scotchmetis.patch \ - gnu/packages/patches/synfig-build-fix.patch \ - gnu/packages/patches/tar-d_ino_in_dirent-fix.patch \ - gnu/packages/patches/tar-skip-unreliable-tests.patch \ - gnu/packages/patches/tcl-mkindex-deterministic.patch \ - gnu/packages/patches/tclxml-3.2-install.patch \ - gnu/packages/patches/tcsh-fix-autotest.patch \ - gnu/packages/patches/texi2html-document-encoding.patch \ - gnu/packages/patches/texi2html-i18n.patch \ - gnu/packages/patches/tidy-CVE-2015-5522+5523.patch \ - gnu/packages/patches/tinyxml-use-stl.patch \ - gnu/packages/patches/tk-find-library.patch \ - gnu/packages/patches/ttf2eot-cstddef.patch \ - gnu/packages/patches/ttfautohint-source-date-epoch.patch \ - gnu/packages/patches/tophat-build-with-later-seqan.patch \ - gnu/packages/patches/torsocks-dns-test.patch \ - gnu/packages/patches/tvtime-gcc41.patch \ - gnu/packages/patches/tvtime-pngoutput.patch \ - gnu/packages/patches/tvtime-videodev2.patch \ - gnu/packages/patches/tvtime-xmltv.patch \ - gnu/packages/patches/unzip-CVE-2014-8139.patch \ - gnu/packages/patches/unzip-CVE-2014-8140.patch \ - gnu/packages/patches/unzip-CVE-2014-8141.patch \ - gnu/packages/patches/unzip-CVE-2014-9636.patch \ - gnu/packages/patches/unzip-CVE-2015-7696.patch \ - gnu/packages/patches/unzip-CVE-2015-7697.patch \ - gnu/packages/patches/unzip-allow-greater-hostver-values.patch \ - gnu/packages/patches/unzip-attribs-overflow.patch \ - gnu/packages/patches/unzip-overflow-on-invalid-input.patch \ - gnu/packages/patches/unzip-format-secure.patch \ - gnu/packages/patches/unzip-initialize-symlink-flag.patch \ - gnu/packages/patches/unzip-overflow-long-fsize.patch \ - gnu/packages/patches/unzip-remove-build-date.patch \ - gnu/packages/patches/util-linux-tests.patch \ - gnu/packages/patches/upower-builddir.patch \ - gnu/packages/patches/valgrind-enable-arm.patch \ - gnu/packages/patches/vorbis-tools-CVE-2015-6749.patch \ - gnu/packages/patches/vpnc-script.patch \ - gnu/packages/patches/vtk-mesa-10.patch \ - gnu/packages/patches/w3m-libgc.patch \ - gnu/packages/patches/w3m-force-ssl_verify_server-on.patch \ - gnu/packages/patches/w3m-disable-sslv2-and-sslv3.patch \ - gnu/packages/patches/w3m-disable-weak-ciphers.patch \ - gnu/packages/patches/weechat-python.patch \ - gnu/packages/patches/weex-vacopy.patch \ - gnu/packages/patches/wicd-bitrate-none-fix.patch \ - gnu/packages/patches/wicd-get-selected-profile-fix.patch \ - gnu/packages/patches/wicd-urwid-1.3.patch \ - gnu/packages/patches/wicd-wpa2-ttls.patch \ - gnu/packages/patches/wmctrl-64-fix.patch \ - gnu/packages/patches/woff2-libbrotli.patch \ - gnu/packages/patches/wpa-supplicant-CVE-2015-5310.patch \ - gnu/packages/patches/wpa-supplicant-CVE-2015-5314.patch \ - gnu/packages/patches/wpa-supplicant-CVE-2015-5315.patch \ - gnu/packages/patches/wpa-supplicant-CVE-2015-5316.patch \ - gnu/packages/patches/xdotool-fix-makefile.patch \ - gnu/packages/patches/xf86-video-ark-remove-mibstore.patch \ - gnu/packages/patches/xf86-video-ast-remove-mibstore.patch \ - gnu/packages/patches/xf86-video-geode-glibc-2.20.patch \ - gnu/packages/patches/xf86-video-glint-remove-mibstore.patch \ - gnu/packages/patches/xf86-video-i128-remove-mibstore.patch \ - gnu/packages/patches/xf86-video-intel-compat-api.patch \ - gnu/packages/patches/xf86-video-intel-glibc-2.20.patch \ - gnu/packages/patches/xf86-video-mach64-glibc-2.20.patch \ - gnu/packages/patches/xf86-video-nv-remove-mibstore.patch \ - gnu/packages/patches/xf86-video-openchrome-glibc-2.20.patch \ - gnu/packages/patches/xf86-video-tga-remove-mibstore.patch \ - gnu/packages/patches/xfce4-panel-plugins.patch \ - gnu/packages/patches/xfce4-session-fix-xflock4.patch \ - gnu/packages/patches/xfce4-settings-defaults.patch \ - gnu/packages/patches/xmodmap-asprintf.patch \ - gnu/packages/patches/zathura-plugindir-environment-variable.patch - -MISC_DISTRO_FILES = \ - gnu/packages/ld-wrapper.in - -bootstrapdir = $(guilemoduledir)/gnu/packages/bootstrap -bootstrap_x86_64_linuxdir = $(bootstrapdir)/x86_64-linux -bootstrap_i686_linuxdir = $(bootstrapdir)/i686-linux -bootstrap_armhf_linuxdir = $(bootstrapdir)/armhf-linux -bootstrap_mips64el_linuxdir = $(bootstrapdir)/mips64el-linux - -dist_bootstrap_x86_64_linux_DATA = \ - gnu/packages/bootstrap/x86_64-linux/bash \ - gnu/packages/bootstrap/x86_64-linux/mkdir \ - gnu/packages/bootstrap/x86_64-linux/tar \ - gnu/packages/bootstrap/x86_64-linux/xz - -dist_bootstrap_i686_linux_DATA = \ - gnu/packages/bootstrap/i686-linux/bash \ - gnu/packages/bootstrap/i686-linux/mkdir \ - gnu/packages/bootstrap/i686-linux/tar \ - gnu/packages/bootstrap/i686-linux/xz - -dist_bootstrap_armhf_linux_DATA = \ - gnu/packages/bootstrap/armhf-linux/bash \ - gnu/packages/bootstrap/armhf-linux/mkdir \ - gnu/packages/bootstrap/armhf-linux/tar \ - gnu/packages/bootstrap/armhf-linux/xz - -dist_bootstrap_mips64el_linux_DATA = \ - gnu/packages/bootstrap/mips64el-linux/bash \ - gnu/packages/bootstrap/mips64el-linux/mkdir \ - gnu/packages/bootstrap/mips64el-linux/tar \ - gnu/packages/bootstrap/mips64el-linux/xz - -# Big bootstrap binaries are not included in the tarball. Instead, they -# are downloaded. -nodist_bootstrap_x86_64_linux_DATA = \ - gnu/packages/bootstrap/x86_64-linux/guile-2.0.9.tar.xz -nodist_bootstrap_i686_linux_DATA = \ - gnu/packages/bootstrap/i686-linux/guile-2.0.9.tar.xz -nodist_bootstrap_armhf_linux_DATA = \ - gnu/packages/bootstrap/armhf-linux/guile-2.0.11.tar.xz -nodist_bootstrap_mips64el_linux_DATA = \ - gnu/packages/bootstrap/mips64el-linux/guile-2.0.9.tar.xz - -# Those files must remain executable, so they remain executable once -# imported into the store. -set-bootstrap-executable-permissions: - chmod +x $(DESTDIR)$(bootstrapdir)/*/{bash,mkdir,tar,xz} - -DISTCLEANFILES = \ - $(nodist_bootstrap_x86_64_linux_DATA) \ - $(nodist_bootstrap_i686_linux_DATA) \ - $(nodist_bootstrap_armhf_linux_DATA) \ - $(nodist_bootstrap_mips64el_linux_DATA) - -# Method to download a file from an external source. -DOWNLOAD_FILE = \ - GUILE_LOAD_COMPILED_PATH="$(top_builddir):$$GUILE_LOAD_COMPILED_PATH" \ - $(GUILE) --no-auto-compile -L "$(top_builddir)" -L "$(top_srcdir)" \ - "$(top_srcdir)/build-aux/download.scm" - -gnu/packages/bootstrap/x86_64-linux/guile-2.0.9.tar.xz: - $(AM_V_DL)$(MKDIR_P) `dirname "$@"`; \ - $(DOWNLOAD_FILE) "$@" \ - "037b103522a2d0d7d69c7ffd8de683dfe5bb4b59c1fafd70b4ffd397fd2f57f0" -gnu/packages/bootstrap/i686-linux/guile-2.0.9.tar.xz: - $(AM_V_DL)$(MKDIR_P) `dirname "$@"`; \ - $(DOWNLOAD_FILE) "$@" \ - "b757cd46bf13ecac83fb8e955fb50096ac2d17bb610ca8eb816f29302a00a846" -gnu/packages/bootstrap/armhf-linux/guile-2.0.11.tar.xz: - $(AM_V_DL)$(MKDIR_P) `dirname "$@"`; \ - $(DOWNLOAD_FILE) "$@" \ - "e551d05d4d385d6706ab8d574856a087758294dc90ab4c06e70a157a685e23d6" -gnu/packages/bootstrap/mips64el-linux/guile-2.0.9.tar.xz: - $(AM_V_DL)$(MKDIR_P) `dirname "$@"`; \ - $(DOWNLOAD_FILE) "$@" \ - "994680f0001346864aa2c2cc5110f380ee7518dcd701c614291682b8e948f73b" diff --git a/gnu/local.mk b/gnu/local.mk new file mode 100644 index 0000000000..d58155a1b5 --- /dev/null +++ b/gnu/local.mk @@ -0,0 +1,875 @@ +# GNU Guix --- Functional package management for GNU +# Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès +# Copyright © 2013, 2014, 2015, 2016 Andreas Enge +# Copyright © 2016 Mathieu Lirzin +# Copyright © 2013, 2014, 2015, 2016 Mark H Weaver +# Copyright © 2016 Chris Marusich +# Copyright © 2016 Kei Yamashita +# +# This file is part of GNU Guix. +# +# GNU Guix is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or (at +# your option) any later version. +# +# GNU Guix is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Guix. If not, see . + +# Definitions for the GNU System: package modules, patches, bootstrap +# binaries. + +GNU_SYSTEM_MODULES = \ + gnu.scm \ + gnu/artwork.scm \ + gnu/packages.scm \ + gnu/packages/abduco.scm \ + gnu/packages/abiword.scm \ + gnu/packages/acct.scm \ + gnu/packages/acl.scm \ + gnu/packages/admin.scm \ + gnu/packages/adns.scm \ + gnu/packages/algebra.scm \ + gnu/packages/aidc.scm \ + gnu/packages/animation.scm \ + gnu/packages/anthy.scm \ + gnu/packages/apl.scm \ + gnu/packages/apr.scm \ + gnu/packages/asciidoc.scm \ + gnu/packages/aspell.scm \ + gnu/packages/attr.scm \ + gnu/packages/audacity.scm \ + gnu/packages/audio.scm \ + gnu/packages/augeas.scm \ + gnu/packages/autogen.scm \ + gnu/packages/autotools.scm \ + gnu/packages/avahi.scm \ + gnu/packages/avr.scm \ + gnu/packages/backup.scm \ + gnu/packages/base.scm \ + gnu/packages/bash.scm \ + gnu/packages/bdw-gc.scm \ + gnu/packages/bioinformatics.scm \ + gnu/packages/bittorrent.scm \ + gnu/packages/bison.scm \ + gnu/packages/boost.scm \ + gnu/packages/bootstrap.scm \ + gnu/packages/busybox.scm \ + gnu/packages/c.scm \ + gnu/packages/calcurse.scm \ + gnu/packages/ccache.scm \ + gnu/packages/cdrom.scm \ + gnu/packages/certs.scm \ + gnu/packages/check.scm \ + gnu/packages/ci.scm \ + gnu/packages/cmake.scm \ + gnu/packages/code.scm \ + gnu/packages/commencement.scm \ + gnu/packages/compression.scm \ + gnu/packages/conkeror.scm \ + gnu/packages/conky.scm \ + gnu/packages/cook.scm \ + gnu/packages/cpio.scm \ + gnu/packages/cppi.scm \ + gnu/packages/cross-base.scm \ + gnu/packages/crypto.scm \ + gnu/packages/cryptsetup.scm \ + gnu/packages/cups.scm \ + gnu/packages/curl.scm \ + gnu/packages/cyrus-sasl.scm \ + gnu/packages/databases.scm \ + gnu/packages/datamash.scm \ + gnu/packages/datastructures.scm \ + gnu/packages/dav.scm \ + gnu/packages/dc.scm \ + gnu/packages/debug.scm \ + gnu/packages/dejagnu.scm \ + gnu/packages/dico.scm \ + gnu/packages/dictionaries.scm \ + gnu/packages/dillo.scm \ + gnu/packages/disk.scm \ + gnu/packages/djvu.scm \ + gnu/packages/dns.scm \ + gnu/packages/docbook.scm \ + gnu/packages/docker.scm \ + gnu/packages/doxygen.scm \ + gnu/packages/dunst.scm \ + gnu/packages/dvtm.scm \ + gnu/packages/ebook.scm \ + gnu/packages/ed.scm \ + gnu/packages/elf.scm \ + gnu/packages/emacs.scm \ + gnu/packages/enchant.scm \ + gnu/packages/engineering.scm \ + gnu/packages/enlightenment.scm \ + gnu/packages/fcitx.scm \ + gnu/packages/feh.scm \ + gnu/packages/figlet.scm \ + gnu/packages/file.scm \ + gnu/packages/finance.scm \ + gnu/packages/firmware.scm \ + gnu/packages/fish.scm \ + gnu/packages/flashing-tools.scm \ + gnu/packages/flex.scm \ + gnu/packages/fltk.scm \ + gnu/packages/fonts.scm \ + gnu/packages/fontutils.scm \ + gnu/packages/freedesktop.scm \ + gnu/packages/freeipmi.scm \ + gnu/packages/ftp.scm \ + gnu/packages/fribidi.scm \ + gnu/packages/fvwm.scm \ + gnu/packages/game-development.scm \ + gnu/packages/games.scm \ + gnu/packages/gawk.scm \ + gnu/packages/gcal.scm \ + gnu/packages/gcc.scm \ + gnu/packages/gd.scm \ + gnu/packages/gdb.scm \ + gnu/packages/geeqie.scm \ + gnu/packages/gettext.scm \ + gnu/packages/ghostscript.scm \ + gnu/packages/gimp.scm \ + gnu/packages/gkrellm.scm \ + gnu/packages/gl.scm \ + gnu/packages/glib.scm \ + gnu/packages/gnome.scm \ + gnu/packages/gnu-doc.scm \ + gnu/packages/gnucash.scm \ + gnu/packages/gnunet.scm \ + gnu/packages/gnupg.scm \ + gnu/packages/gnustep.scm \ + gnu/packages/gnuzilla.scm \ + gnu/packages/gnu-pw-mgr.scm \ + gnu/packages/gperf.scm \ + gnu/packages/gprolog.scm \ + gnu/packages/gps.scm \ + gnu/packages/graphics.scm \ + gnu/packages/graphviz.scm \ + gnu/packages/groff.scm \ + gnu/packages/grub.scm \ + gnu/packages/grue-hunter.scm \ + gnu/packages/gsasl.scm \ + gnu/packages/gstreamer.scm \ + gnu/packages/gtk.scm \ + gnu/packages/guile.scm \ + gnu/packages/guile-wm.scm \ + gnu/packages/gv.scm \ + gnu/packages/gxmessage.scm \ + gnu/packages/haskell.scm \ + gnu/packages/hugs.scm \ + gnu/packages/hurd.scm \ + gnu/packages/ibus.scm \ + gnu/packages/icu4c.scm \ + gnu/packages/idutils.scm \ + gnu/packages/image.scm \ + gnu/packages/imagemagick.scm \ + gnu/packages/indent.scm \ + gnu/packages/inklingreader.scm \ + gnu/packages/inkscape.scm \ + gnu/packages/irc.scm \ + gnu/packages/iso-codes.scm \ + gnu/packages/java.scm \ + gnu/packages/jemalloc.scm \ + gnu/packages/jrnl.scm \ + gnu/packages/julia.scm \ + gnu/packages/kde.scm \ + gnu/packages/kde-frameworks.scm \ + gnu/packages/key-mon.scm \ + gnu/packages/kodi.scm \ + gnu/packages/language.scm \ + gnu/packages/ldc.scm \ + gnu/packages/lego.scm \ + gnu/packages/less.scm \ + gnu/packages/lesstif.scm \ + gnu/packages/libcanberra.scm \ + gnu/packages/libdaemon.scm \ + gnu/packages/libedit.scm \ + gnu/packages/libevent.scm \ + gnu/packages/libffcall.scm \ + gnu/packages/libffi.scm \ + gnu/packages/libftdi.scm \ + gnu/packages/calendar.scm \ + gnu/packages/libidn.scm \ + gnu/packages/libphidget.scm \ + gnu/packages/libreoffice.scm \ + gnu/packages/libsigsegv.scm \ + gnu/packages/libunistring.scm \ + gnu/packages/libusb.scm \ + gnu/packages/libunwind.scm \ + gnu/packages/libupnp.scm \ + gnu/packages/lightning.scm \ + gnu/packages/links.scm \ + gnu/packages/linux.scm \ + gnu/packages/lirc.scm \ + gnu/packages/lisp.scm \ + gnu/packages/llvm.scm \ + gnu/packages/lout.scm \ + gnu/packages/lsh.scm \ + gnu/packages/lsof.scm \ + gnu/packages/lua.scm \ + gnu/packages/lxde.scm \ + gnu/packages/lxqt.scm \ + gnu/packages/lynx.scm \ + gnu/packages/m4.scm \ + gnu/packages/machine-learning.scm \ + gnu/packages/man.scm \ + gnu/packages/mail.scm \ + gnu/packages/make-bootstrap.scm \ + gnu/packages/markdown.scm \ + gnu/packages/marst.scm \ + gnu/packages/mate.scm \ + gnu/packages/maths.scm \ + gnu/packages/mc.scm \ + gnu/packages/mcrypt.scm \ + gnu/packages/messaging.scm \ + gnu/packages/mg.scm \ + gnu/packages/mit-krb5.scm \ + gnu/packages/moe.scm \ + gnu/packages/moreutils.scm \ + gnu/packages/mpd.scm \ + gnu/packages/mp3.scm \ + gnu/packages/mpi.scm \ + gnu/packages/multiprecision.scm \ + gnu/packages/music.scm \ + gnu/packages/mtools.scm \ + gnu/packages/nano.scm \ + gnu/packages/ncdu.scm \ + gnu/packages/ncurses.scm \ + gnu/packages/netpbm.scm \ + gnu/packages/nettle.scm \ + gnu/packages/networking.scm \ + gnu/packages/ninja.scm \ + gnu/packages/node.scm \ + gnu/packages/noweb.scm \ + gnu/packages/ntp.scm \ + gnu/packages/nutrition.scm \ + gnu/packages/nvi.scm \ + gnu/packages/ocaml.scm \ + gnu/packages/ocr.scm \ + gnu/packages/onc-rpc.scm \ + gnu/packages/openbox.scm \ + gnu/packages/openldap.scm \ + gnu/packages/openstack.scm \ + gnu/packages/orpheus.scm \ + gnu/packages/ots.scm \ + gnu/packages/owncloud.scm \ + gnu/packages/package-management.scm \ + gnu/packages/parallel.scm \ + gnu/packages/password-utils.scm \ + gnu/packages/patchutils.scm \ + gnu/packages/pciutils.scm \ + gnu/packages/pcre.scm \ + gnu/packages/pdf.scm \ + gnu/packages/pem.scm \ + gnu/packages/perl.scm \ + gnu/packages/photo.scm \ + gnu/packages/pkg-config.scm \ + gnu/packages/plotutils.scm \ + gnu/packages/polkit.scm \ + gnu/packages/popt.scm \ + gnu/packages/pth.scm \ + gnu/packages/pulseaudio.scm \ + gnu/packages/pumpio.scm \ + gnu/packages/pretty-print.scm \ + gnu/packages/protobuf.scm \ + gnu/packages/pv.scm \ + gnu/packages/python.scm \ + gnu/packages/qemu.scm \ + gnu/packages/qt.scm \ + gnu/packages/ragel.scm \ + gnu/packages/ratpoison.scm \ + gnu/packages/rc.scm \ + gnu/packages/rdesktop.scm \ + gnu/packages/rdf.scm \ + gnu/packages/readline.scm \ + gnu/packages/rrdtool.scm \ + gnu/packages/rsync.scm \ + gnu/packages/ruby.scm \ + gnu/packages/rush.scm \ + gnu/packages/samba.scm \ + gnu/packages/sawfish.scm \ + gnu/packages/scanner.scm \ + gnu/packages/scheme.scm \ + gnu/packages/screen.scm \ + gnu/packages/scribus.scm \ + gnu/packages/sdl.scm \ + gnu/packages/search.scm \ + gnu/packages/serialization.scm \ + gnu/packages/serveez.scm \ + gnu/packages/shishi.scm \ + gnu/packages/skarnet.scm \ + gnu/packages/skribilo.scm \ + gnu/packages/slang.scm \ + gnu/packages/slim.scm \ + gnu/packages/smalltalk.scm \ + gnu/packages/ssh.scm \ + gnu/packages/stalonetray.scm \ + gnu/packages/statistics.scm \ + gnu/packages/suckless.scm \ + gnu/packages/swig.scm \ + gnu/packages/sxiv.scm \ + gnu/packages/synergy.scm \ + gnu/packages/task-management.scm \ + gnu/packages/tbb.scm \ + gnu/packages/tcl.scm \ + gnu/packages/tcsh.scm \ + gnu/packages/telephony.scm \ + gnu/packages/terminals.scm \ + gnu/packages/texinfo.scm \ + gnu/packages/texlive.scm \ + gnu/packages/textutils.scm \ + gnu/packages/time.scm \ + gnu/packages/tls.scm \ + gnu/packages/tmux.scm \ + gnu/packages/tor.scm \ + gnu/packages/tre.scm \ + gnu/packages/tv.scm \ + gnu/packages/unrtf.scm \ + gnu/packages/upnp.scm \ + gnu/packages/uucp.scm \ + gnu/packages/valgrind.scm \ + gnu/packages/version-control.scm \ + gnu/packages/video.scm \ + gnu/packages/vim.scm \ + gnu/packages/vpn.scm \ + gnu/packages/vtk.scm \ + gnu/packages/w3m.scm \ + gnu/packages/wdiff.scm \ + gnu/packages/web.scm \ + gnu/packages/webkit.scm \ + gnu/packages/wget.scm \ + gnu/packages/wicd.scm \ + gnu/packages/wine.scm \ + gnu/packages/wm.scm \ + gnu/packages/wordnet.scm \ + gnu/packages/wv.scm \ + gnu/packages/wxwidgets.scm \ + gnu/packages/xfig.scm \ + gnu/packages/xiph.scm \ + gnu/packages/xml.scm \ + gnu/packages/xnee.scm \ + gnu/packages/xdisorg.scm \ + gnu/packages/xorg.scm \ + gnu/packages/xfce.scm \ + gnu/packages/yasm.scm \ + gnu/packages/yubico.scm \ + gnu/packages/zile.scm \ + gnu/packages/zip.scm \ + gnu/packages/zsh.scm \ + \ + gnu/services.scm \ + gnu/services/avahi.scm \ + gnu/services/base.scm \ + gnu/services/databases.scm \ + gnu/services/dbus.scm \ + gnu/services/desktop.scm \ + gnu/services/lirc.scm \ + gnu/services/mail.scm \ + gnu/services/networking.scm \ + gnu/services/shepherd.scm \ + gnu/services/herd.scm \ + gnu/services/ssh.scm \ + gnu/services/web.scm \ + gnu/services/xorg.scm \ + \ + gnu/system.scm \ + gnu/system/file-systems.scm \ + gnu/system/grub.scm \ + gnu/system/install.scm \ + gnu/system/linux-container.scm \ + gnu/system/linux-initrd.scm \ + gnu/system/locale.scm \ + gnu/system/mapped-devices.scm \ + gnu/system/nss.scm \ + gnu/system/pam.scm \ + gnu/system/shadow.scm \ + gnu/system/vm.scm \ + \ + gnu/build/activation.scm \ + gnu/build/file-systems.scm \ + gnu/build/install.scm \ + gnu/build/linux-boot.scm \ + gnu/build/linux-container.scm \ + gnu/build/linux-initrd.scm \ + gnu/build/linux-modules.scm \ + gnu/build/vm.scm + + +patchdir = $(guilemoduledir)/gnu/packages/patches +dist_patch_DATA = \ + gnu/packages/patches/abiword-explictly-cast-bools.patch \ + gnu/packages/patches/abiword-wmf-version-lookup-fix.patch \ + gnu/packages/patches/acl-hurd-path-max.patch \ + gnu/packages/patches/aegis-constness-error.patch \ + gnu/packages/patches/aegis-perl-tempdir1.patch \ + gnu/packages/patches/aegis-perl-tempdir2.patch \ + gnu/packages/patches/aegis-test-fixup-1.patch \ + gnu/packages/patches/aegis-test-fixup-2.patch \ + gnu/packages/patches/agg-am_c_prototype.patch \ + gnu/packages/patches/alsa-lib-mips-atomic-fix.patch \ + gnu/packages/patches/apr-skip-getservbyname-test.patch \ + gnu/packages/patches/arb-ldconfig.patch \ + gnu/packages/patches/asymptote-gsl2.patch \ + gnu/packages/patches/ath9k-htc-firmware-binutils.patch \ + gnu/packages/patches/ath9k-htc-firmware-gcc.patch \ + gnu/packages/patches/ath9k-htc-firmware-objcopy.patch \ + gnu/packages/patches/audacity-fix-ffmpeg-binding.patch \ + gnu/packages/patches/automake-skip-amhello-tests.patch \ + gnu/packages/patches/automake-regexp-syntax.patch \ + gnu/packages/patches/avahi-localstatedir.patch \ + gnu/packages/patches/avidemux-install-to-lib.patch \ + gnu/packages/patches/avrdude-fix-libusb.patch \ + gnu/packages/patches/bash-completion-directories.patch \ + gnu/packages/patches/bigloo-gc-shebangs.patch \ + gnu/packages/patches/binutils-ld-new-dtags.patch \ + gnu/packages/patches/binutils-loongson-workaround.patch \ + gnu/packages/patches/byobu-writable-status.patch \ + gnu/packages/patches/calibre-drop-unrar.patch \ + gnu/packages/patches/calibre-no-updates-dialog.patch \ + gnu/packages/patches/cdparanoia-fpic.patch \ + gnu/packages/patches/chmlib-inttypes.patch \ + gnu/packages/patches/clang-libc-search-path.patch \ + gnu/packages/patches/clucene-pkgconfig.patch \ + gnu/packages/patches/cmake-fix-tests.patch \ + gnu/packages/patches/cpio-gets-undeclared.patch \ + gnu/packages/patches/cpio-CVE-2016-2037.patch \ + gnu/packages/patches/cpufrequtils-fix-aclocal.patch \ + gnu/packages/patches/crda-optional-gcrypt.patch \ + gnu/packages/patches/crossmap-allow-system-pysam.patch \ + gnu/packages/patches/csound-header-ordering.patch \ + gnu/packages/patches/cssc-gets-undeclared.patch \ + gnu/packages/patches/cssc-missing-include.patch \ + gnu/packages/patches/clucene-contribs-lib.patch \ + gnu/packages/patches/cursynth-wave-rand.patch \ + gnu/packages/patches/dbus-helper-search-path.patch \ + gnu/packages/patches/dealii-p4est-interface.patch \ + gnu/packages/patches/devil-fix-libpng.patch \ + gnu/packages/patches/dico-libtool-deterministic.patch \ + gnu/packages/patches/diffutils-gets-undeclared.patch \ + gnu/packages/patches/dfu-programmer-fix-libusb.patch \ + gnu/packages/patches/doxygen-test.patch \ + gnu/packages/patches/duplicity-piped-password.patch \ + gnu/packages/patches/duplicity-test_selection-tmp.patch \ + gnu/packages/patches/elfutils-tests-ptrace.patch \ + gnu/packages/patches/einstein-build.patch \ + gnu/packages/patches/emacs-constants-lisp-like.patch \ + gnu/packages/patches/emacs-exec-path.patch \ + gnu/packages/patches/emacs-scheme-complete-scheme-r5rs-info.patch \ + gnu/packages/patches/emacs-source-date-epoch.patch \ + gnu/packages/patches/eudev-rules-directory.patch \ + gnu/packages/patches/evilwm-lost-focus-bug.patch \ + gnu/packages/patches/expat-CVE-2015-1283.patch \ + gnu/packages/patches/fastcap-mulGlobal.patch \ + gnu/packages/patches/fastcap-mulSetup.patch \ + gnu/packages/patches/fasthenry-spAllocate.patch \ + gnu/packages/patches/fasthenry-spBuild.patch \ + gnu/packages/patches/fasthenry-spUtils.patch \ + gnu/packages/patches/fasthenry-spSolve.patch \ + gnu/packages/patches/fasthenry-spFactor.patch \ + gnu/packages/patches/findutils-localstatedir.patch \ + gnu/packages/patches/findutils-test-xargs.patch \ + gnu/packages/patches/flashrom-use-libftdi1.patch \ + gnu/packages/patches/flint-ldconfig.patch \ + gnu/packages/patches/fltk-shared-lib-defines.patch \ + gnu/packages/patches/fontforge-svg-modtime.patch \ + gnu/packages/patches/freeimage-CVE-2015-0852.patch \ + gnu/packages/patches/gawk-fts-test.patch \ + gnu/packages/patches/gawk-shell.patch \ + gnu/packages/patches/gcc-arm-link-spec-fix.patch \ + gnu/packages/patches/gcc-cross-environment-variables.patch \ + gnu/packages/patches/gcc-libvtv-runpath.patch \ + gnu/packages/patches/gcc-5.0-libvtv-runpath.patch \ + gnu/packages/patches/geoclue-config.patch \ + gnu/packages/patches/ghostscript-CVE-2015-3228.patch \ + gnu/packages/patches/ghostscript-runpath.patch \ + gnu/packages/patches/glib-networking-ssl-cert-file.patch \ + gnu/packages/patches/glib-tests-desktop.patch \ + gnu/packages/patches/glib-tests-homedir.patch \ + gnu/packages/patches/glib-tests-prlimit.patch \ + gnu/packages/patches/glib-tests-timer.patch \ + gnu/packages/patches/glib-tests-gapplication.patch \ + gnu/packages/patches/glibc-CVE-2015-7547.patch \ + gnu/packages/patches/glibc-bootstrap-system.patch \ + gnu/packages/patches/glibc-hurd-extern-inline.patch \ + gnu/packages/patches/glibc-ldd-x86_64.patch \ + gnu/packages/patches/glibc-locales.patch \ + gnu/packages/patches/glibc-locale-incompatibility.patch \ + gnu/packages/patches/glibc-o-largefile.patch \ + gnu/packages/patches/glibc-versioned-locpath.patch \ + gnu/packages/patches/gmp-arm-asm-nothumb.patch \ + gnu/packages/patches/gmp-faulty-test.patch \ + gnu/packages/patches/gnucash-price-quotes-perl.patch \ + gnu/packages/patches/gnupg-simple-query-ignore-status-messages.patch \ + gnu/packages/patches/gobject-introspection-absolute-shlib-path.patch \ + gnu/packages/patches/gobject-introspection-cc.patch \ + gnu/packages/patches/gobject-introspection-girepository.patch \ + gnu/packages/patches/grep-timing-sensitive-test.patch \ + gnu/packages/patches/grub-CVE-2015-8370.patch \ + gnu/packages/patches/grub-gets-undeclared.patch \ + gnu/packages/patches/grub-freetype.patch \ + gnu/packages/patches/guile-1.8-cpp-4.5.patch \ + gnu/packages/patches/guile-arm-fixes.patch \ + gnu/packages/patches/guile-default-utf8.patch \ + gnu/packages/patches/guile-linux-syscalls.patch \ + gnu/packages/patches/guile-present-coding.patch \ + gnu/packages/patches/guile-relocatable.patch \ + gnu/packages/patches/guile-rsvg-pkgconfig.patch \ + gnu/packages/patches/gtk2-respect-GUIX_GTK2_PATH.patch \ + gnu/packages/patches/gtk3-respect-GUIX_GTK3_PATH.patch \ + gnu/packages/patches/gtkglext-disable-disable-deprecated.patch \ + gnu/packages/patches/hop-bigloo-4.0b.patch \ + gnu/packages/patches/hop-linker-flags.patch \ + gnu/packages/patches/hydra-automake-1.15.patch \ + gnu/packages/patches/hydra-disable-darcs-test.patch \ + gnu/packages/patches/icecat-avoid-bundled-includes.patch \ + gnu/packages/patches/icecat-re-enable-DHE-cipher-suites.patch \ + gnu/packages/patches/icu4c-CVE-2014-6585.patch \ + gnu/packages/patches/icu4c-CVE-2015-1270.patch \ + gnu/packages/patches/icu4c-CVE-2015-4760.patch \ + gnu/packages/patches/ilmbase-fix-tests.patch \ + gnu/packages/patches/imagemagick-test-segv.patch \ + gnu/packages/patches/irrlicht-mesa-10.patch \ + gnu/packages/patches/jasper-CVE-2007-2721.patch \ + gnu/packages/patches/jasper-CVE-2008-3520.patch \ + gnu/packages/patches/jasper-CVE-2008-3522.patch \ + gnu/packages/patches/jasper-CVE-2011-4516-and-CVE-2011-4517.patch \ + gnu/packages/patches/jasper-CVE-2014-8137.patch \ + gnu/packages/patches/jasper-CVE-2014-8138.patch \ + gnu/packages/patches/jasper-CVE-2014-8157.patch \ + gnu/packages/patches/jasper-CVE-2014-8158.patch \ + gnu/packages/patches/jasper-CVE-2014-9029.patch \ + gnu/packages/patches/jasper-CVE-2016-1577.patch \ + gnu/packages/patches/jasper-CVE-2016-1867.patch \ + gnu/packages/patches/jasper-CVE-2016-2089.patch \ + gnu/packages/patches/jasper-CVE-2016-2116.patch \ + gnu/packages/patches/jbig2dec-ignore-testtest.patch \ + gnu/packages/patches/kmod-module-directory.patch \ + gnu/packages/patches/ldc-disable-tests.patch \ + gnu/packages/patches/lftp-dont-save-unknown-host-fingerprint.patch \ + gnu/packages/patches/liba52-enable-pic.patch \ + gnu/packages/patches/liba52-link-with-libm.patch \ + gnu/packages/patches/liba52-set-soname.patch \ + gnu/packages/patches/liba52-use-mtune-not-mcpu.patch \ + gnu/packages/patches/libarchive-bsdtar-test.patch \ + gnu/packages/patches/libarchive-CVE-2013-0211.patch \ + gnu/packages/patches/libarchive-fix-lzo-test-case.patch \ + gnu/packages/patches/libarchive-mtree-filename-length-fix.patch \ + gnu/packages/patches/libbonobo-activation-test-race.patch \ + gnu/packages/patches/libcanberra-sound-theme-freedesktop.patch \ + gnu/packages/patches/libcmis-fix-test-onedrive.patch \ + gnu/packages/patches/libdrm-symbol-check.patch \ + gnu/packages/patches/libevent-dns-tests.patch \ + gnu/packages/patches/libextractor-ffmpeg-3.patch \ + gnu/packages/patches/libmtp-devices.patch \ + gnu/packages/patches/liboop-mips64-deplibs-fix.patch \ + gnu/packages/patches/libotr-test-auth-fix.patch \ + gnu/packages/patches/liblxqt-include.patch \ + gnu/packages/patches/libmad-armv7-thumb-pt1.patch \ + gnu/packages/patches/libmad-armv7-thumb-pt2.patch \ + gnu/packages/patches/libmad-frame-length.patch \ + gnu/packages/patches/libmad-mips-newgcc.patch \ + gnu/packages/patches/libssh-0.6.5-CVE-2016-0739.patch \ + gnu/packages/patches/libtheora-config-guess.patch \ + gnu/packages/patches/libtiff-CVE-2015-8665+CVE-2015-8683.patch \ + gnu/packages/patches/libtiff-oob-accesses-in-decode.patch \ + gnu/packages/patches/libtiff-oob-write-in-nextdecode.patch \ + gnu/packages/patches/libtool-skip-tests2.patch \ + gnu/packages/patches/libunwind-CVE-2015-3239.patch \ + gnu/packages/patches/libwmf-CAN-2004-0941.patch \ + gnu/packages/patches/libwmf-CVE-2006-3376.patch \ + gnu/packages/patches/libwmf-CVE-2007-0455.patch \ + gnu/packages/patches/libwmf-CVE-2007-2756.patch \ + gnu/packages/patches/libwmf-CVE-2007-3472.patch \ + gnu/packages/patches/libwmf-CVE-2007-3473.patch \ + gnu/packages/patches/libwmf-CVE-2007-3477.patch \ + gnu/packages/patches/libwmf-CVE-2009-1364.patch \ + gnu/packages/patches/libwmf-CVE-2009-3546.patch \ + gnu/packages/patches/libwmf-CVE-2015-0848+CVE-2015-4588.patch \ + gnu/packages/patches/libwmf-CVE-2015-4695.patch \ + gnu/packages/patches/libwmf-CVE-2015-4696.patch \ + gnu/packages/patches/libxslt-CVE-2015-7995.patch \ + gnu/packages/patches/lirc-localstatedir.patch \ + gnu/packages/patches/libpthread-glibc-preparation.patch \ + gnu/packages/patches/lm-sensors-hwmon-attrs.patch \ + gnu/packages/patches/lua-pkgconfig.patch \ + gnu/packages/patches/lua51-liblua-so.patch \ + gnu/packages/patches/lua52-liblua-so.patch \ + gnu/packages/patches/luajit-no_ldconfig.patch \ + gnu/packages/patches/luajit-symlinks.patch \ + gnu/packages/patches/luit-posix.patch \ + gnu/packages/patches/m4-gets-undeclared.patch \ + gnu/packages/patches/make-impure-dirs.patch \ + gnu/packages/patches/mars-install.patch \ + gnu/packages/patches/mars-sfml-2.3.patch \ + gnu/packages/patches/matplotlib-setupext-tk.patch \ + gnu/packages/patches/maxima-defsystem-mkdir.patch \ + gnu/packages/patches/mcron-install.patch \ + gnu/packages/patches/mdadm-gcc-4.9-fix.patch \ + gnu/packages/patches/mhash-keygen-test-segfault.patch \ + gnu/packages/patches/mit-krb5-CVE-2015-8629.patch \ + gnu/packages/patches/mit-krb5-CVE-2015-8630.patch \ + gnu/packages/patches/mit-krb5-CVE-2015-8631.patch \ + gnu/packages/patches/mit-krb5-init-context-null-spnego.patch \ + gnu/packages/patches/mpc123-initialize-ao.patch \ + gnu/packages/patches/mplayer2-theora-fix.patch \ + gnu/packages/patches/module-init-tools-moduledir.patch \ + gnu/packages/patches/mumps-build-parallelism.patch \ + gnu/packages/patches/mupen64plus-ui-console-notice.patch \ + gnu/packages/patches/mutt-store-references.patch \ + gnu/packages/patches/net-tools-bitrot.patch \ + gnu/packages/patches/ngircd-handle-zombies.patch \ + gnu/packages/patches/ngircd-no-dns-in-tests.patch \ + gnu/packages/patches/ninja-tests.patch \ + gnu/packages/patches/ninja-zero-mtime.patch \ + gnu/packages/patches/nss-pkgconfig.patch \ + gnu/packages/patches/nvi-assume-preserve-path.patch \ + gnu/packages/patches/nvi-dbpagesize-binpower.patch \ + gnu/packages/patches/nvi-db4.patch \ + gnu/packages/patches/ocaml-findlib-make-install.patch \ + gnu/packages/patches/openexr-missing-samples.patch \ + gnu/packages/patches/openimageio-boost-1.60.patch \ + gnu/packages/patches/openjpeg-CVE-2015-6581.patch \ + gnu/packages/patches/openjpeg-use-after-free-fix.patch \ + gnu/packages/patches/openssh-CVE-2015-8325.patch \ + gnu/packages/patches/openssl-runpath.patch \ + gnu/packages/patches/openssl-c-rehash-in.patch \ + gnu/packages/patches/orpheus-cast-errors-and-includes.patch \ + gnu/packages/patches/ots-no-include-missing-file.patch \ + gnu/packages/patches/patchelf-page-size.patch \ + gnu/packages/patches/patchelf-rework-for-arm.patch \ + gnu/packages/patches/patchutils-xfail-gendiff-tests.patch \ + gnu/packages/patches/patch-hurd-path-max.patch \ + gnu/packages/patches/pcre-CVE-2016-3191.patch \ + gnu/packages/patches/perl-CVE-2015-8607.patch \ + gnu/packages/patches/perl-CVE-2016-2381.patch \ + gnu/packages/patches/perl-autosplit-default-time.patch \ + gnu/packages/patches/perl-deterministic-ordering.patch \ + gnu/packages/patches/perl-finance-quote-unuse-mozilla-ca.patch \ + gnu/packages/patches/perl-gd-options-passthrough-and-fontconfig.patch \ + gnu/packages/patches/perl-io-socket-ssl-openssl-1.0.2f-fix.patch \ + gnu/packages/patches/perl-net-amazon-s3-moose-warning.patch \ + gnu/packages/patches/perl-net-ssleay-disable-ede-test.patch \ + gnu/packages/patches/perl-no-build-time.patch \ + gnu/packages/patches/perl-no-sys-dirs.patch \ + gnu/packages/patches/perl-module-pluggable-search.patch \ + gnu/packages/patches/perl-source-date-epoch.patch \ + gnu/packages/patches/pidgin-add-search-path.patch \ + gnu/packages/patches/pinball-const-fix.patch \ + gnu/packages/patches/pinball-cstddef.patch \ + gnu/packages/patches/pinball-missing-separators.patch \ + gnu/packages/patches/pinball-src-deps.patch \ + gnu/packages/patches/pinball-system-ltdl.patch \ + gnu/packages/patches/pingus-sdl-libs-config.patch \ + gnu/packages/patches/plink-1.07-unclobber-i.patch \ + gnu/packages/patches/plotutils-libpng-jmpbuf.patch \ + gnu/packages/patches/polkit-drop-test.patch \ + gnu/packages/patches/portaudio-audacity-compat.patch \ + gnu/packages/patches/procmail-ambiguous-getline-debian.patch \ + gnu/packages/patches/pt-scotch-build-parallelism.patch \ + gnu/packages/patches/pulseaudio-fix-mult-test.patch \ + gnu/packages/patches/pulseaudio-longer-test-timeout.patch \ + gnu/packages/patches/pycairo-wscript.patch \ + gnu/packages/patches/pybugz-encode-error.patch \ + gnu/packages/patches/pybugz-stty.patch \ + gnu/packages/patches/pygpgme-disable-problematic-tests.patch \ + gnu/packages/patches/pyqt-configure.patch \ + gnu/packages/patches/python-2-deterministic-build-info.patch \ + gnu/packages/patches/python-2.7-search-paths.patch \ + gnu/packages/patches/python-2.7-source-date-epoch.patch \ + gnu/packages/patches/python-3-deterministic-build-info.patch \ + gnu/packages/patches/python-3-search-paths.patch \ + gnu/packages/patches/python-disable-ssl-test.patch \ + gnu/packages/patches/python-fix-tests.patch \ + gnu/packages/patches/python-ipython-inputhook-ctype.patch \ + gnu/packages/patches/python-rarfile-fix-tests.patch \ + gnu/packages/patches/python2-rdflib-drop-sparqlwrapper.patch \ + gnu/packages/patches/python-configobj-setuptools.patch \ + gnu/packages/patches/python-paste-remove-website-test.patch \ + gnu/packages/patches/python-paste-remove-timing-test.patch \ + gnu/packages/patches/python2-pygobject-2-gi-info-type-error-domain.patch \ + gnu/packages/patches/python-pandas-fix-tslib-test-failure.patch \ + gnu/packages/patches/qemu-CVE-2015-8558.patch \ + gnu/packages/patches/qemu-CVE-2015-8567.patch \ + gnu/packages/patches/qemu-CVE-2015-8613.patch \ + gnu/packages/patches/qemu-CVE-2015-8619.patch \ + gnu/packages/patches/qemu-CVE-2015-8701.patch \ + gnu/packages/patches/qemu-CVE-2015-8743.patch \ + gnu/packages/patches/qemu-CVE-2016-1568.patch \ + gnu/packages/patches/qemu-CVE-2016-1922.patch \ + gnu/packages/patches/qemu-CVE-2016-1981.patch \ + gnu/packages/patches/qemu-CVE-2016-2197.patch \ + gnu/packages/patches/qemu-usb-ehci-oob-read.patch \ + gnu/packages/patches/qemu-virtio-9p-use-accessor-to-get-thread-pool.patch \ + gnu/packages/patches/qt4-ldflags.patch \ + gnu/packages/patches/ratpoison-shell.patch \ + gnu/packages/patches/readline-link-ncurses.patch \ + gnu/packages/patches/ripperx-missing-file.patch \ + gnu/packages/patches/rsem-makefile.patch \ + gnu/packages/patches/sed-hurd-path-max.patch \ + gnu/packages/patches/scheme48-tests.patch \ + gnu/packages/patches/scotch-test-threading.patch \ + gnu/packages/patches/sdl-libx11-1.6.patch \ + gnu/packages/patches/serf-comment-style-fix.patch \ + gnu/packages/patches/serf-deflate-buckets-test-fix.patch \ + gnu/packages/patches/slim-session.patch \ + gnu/packages/patches/slim-config.patch \ + gnu/packages/patches/slim-sigusr1.patch \ + gnu/packages/patches/slurm-configure-remove-nonfree-contribs.patch \ + gnu/packages/patches/soprano-find-clucene.patch \ + gnu/packages/patches/sudo-CVE-2015-5602.patch \ + gnu/packages/patches/superlu-dist-scotchmetis.patch \ + gnu/packages/patches/synfig-build-fix.patch \ + gnu/packages/patches/tar-d_ino_in_dirent-fix.patch \ + gnu/packages/patches/tar-skip-unreliable-tests.patch \ + gnu/packages/patches/tcl-mkindex-deterministic.patch \ + gnu/packages/patches/tclxml-3.2-install.patch \ + gnu/packages/patches/tcsh-fix-autotest.patch \ + gnu/packages/patches/texi2html-document-encoding.patch \ + gnu/packages/patches/texi2html-i18n.patch \ + gnu/packages/patches/tidy-CVE-2015-5522+5523.patch \ + gnu/packages/patches/tinyxml-use-stl.patch \ + gnu/packages/patches/tk-find-library.patch \ + gnu/packages/patches/ttf2eot-cstddef.patch \ + gnu/packages/patches/ttfautohint-source-date-epoch.patch \ + gnu/packages/patches/tophat-build-with-later-seqan.patch \ + gnu/packages/patches/torsocks-dns-test.patch \ + gnu/packages/patches/tvtime-gcc41.patch \ + gnu/packages/patches/tvtime-pngoutput.patch \ + gnu/packages/patches/tvtime-videodev2.patch \ + gnu/packages/patches/tvtime-xmltv.patch \ + gnu/packages/patches/unzip-CVE-2014-8139.patch \ + gnu/packages/patches/unzip-CVE-2014-8140.patch \ + gnu/packages/patches/unzip-CVE-2014-8141.patch \ + gnu/packages/patches/unzip-CVE-2014-9636.patch \ + gnu/packages/patches/unzip-CVE-2015-7696.patch \ + gnu/packages/patches/unzip-CVE-2015-7697.patch \ + gnu/packages/patches/unzip-allow-greater-hostver-values.patch \ + gnu/packages/patches/unzip-attribs-overflow.patch \ + gnu/packages/patches/unzip-overflow-on-invalid-input.patch \ + gnu/packages/patches/unzip-format-secure.patch \ + gnu/packages/patches/unzip-initialize-symlink-flag.patch \ + gnu/packages/patches/unzip-overflow-long-fsize.patch \ + gnu/packages/patches/unzip-remove-build-date.patch \ + gnu/packages/patches/util-linux-tests.patch \ + gnu/packages/patches/upower-builddir.patch \ + gnu/packages/patches/valgrind-enable-arm.patch \ + gnu/packages/patches/vorbis-tools-CVE-2015-6749.patch \ + gnu/packages/patches/vpnc-script.patch \ + gnu/packages/patches/vtk-mesa-10.patch \ + gnu/packages/patches/w3m-libgc.patch \ + gnu/packages/patches/w3m-force-ssl_verify_server-on.patch \ + gnu/packages/patches/w3m-disable-sslv2-and-sslv3.patch \ + gnu/packages/patches/w3m-disable-weak-ciphers.patch \ + gnu/packages/patches/weechat-python.patch \ + gnu/packages/patches/weex-vacopy.patch \ + gnu/packages/patches/wicd-bitrate-none-fix.patch \ + gnu/packages/patches/wicd-get-selected-profile-fix.patch \ + gnu/packages/patches/wicd-urwid-1.3.patch \ + gnu/packages/patches/wicd-wpa2-ttls.patch \ + gnu/packages/patches/wmctrl-64-fix.patch \ + gnu/packages/patches/woff2-libbrotli.patch \ + gnu/packages/patches/wpa-supplicant-CVE-2015-5310.patch \ + gnu/packages/patches/wpa-supplicant-CVE-2015-5314.patch \ + gnu/packages/patches/wpa-supplicant-CVE-2015-5315.patch \ + gnu/packages/patches/wpa-supplicant-CVE-2015-5316.patch \ + gnu/packages/patches/xdotool-fix-makefile.patch \ + gnu/packages/patches/xf86-video-ark-remove-mibstore.patch \ + gnu/packages/patches/xf86-video-ast-remove-mibstore.patch \ + gnu/packages/patches/xf86-video-geode-glibc-2.20.patch \ + gnu/packages/patches/xf86-video-glint-remove-mibstore.patch \ + gnu/packages/patches/xf86-video-i128-remove-mibstore.patch \ + gnu/packages/patches/xf86-video-intel-compat-api.patch \ + gnu/packages/patches/xf86-video-intel-glibc-2.20.patch \ + gnu/packages/patches/xf86-video-mach64-glibc-2.20.patch \ + gnu/packages/patches/xf86-video-nv-remove-mibstore.patch \ + gnu/packages/patches/xf86-video-openchrome-glibc-2.20.patch \ + gnu/packages/patches/xf86-video-tga-remove-mibstore.patch \ + gnu/packages/patches/xfce4-panel-plugins.patch \ + gnu/packages/patches/xfce4-session-fix-xflock4.patch \ + gnu/packages/patches/xfce4-settings-defaults.patch \ + gnu/packages/patches/xmodmap-asprintf.patch \ + gnu/packages/patches/zathura-plugindir-environment-variable.patch + +MISC_DISTRO_FILES = \ + gnu/packages/ld-wrapper.in + +bootstrapdir = $(guilemoduledir)/gnu/packages/bootstrap +bootstrap_x86_64_linuxdir = $(bootstrapdir)/x86_64-linux +bootstrap_i686_linuxdir = $(bootstrapdir)/i686-linux +bootstrap_armhf_linuxdir = $(bootstrapdir)/armhf-linux +bootstrap_mips64el_linuxdir = $(bootstrapdir)/mips64el-linux + +dist_bootstrap_x86_64_linux_DATA = \ + gnu/packages/bootstrap/x86_64-linux/bash \ + gnu/packages/bootstrap/x86_64-linux/mkdir \ + gnu/packages/bootstrap/x86_64-linux/tar \ + gnu/packages/bootstrap/x86_64-linux/xz + +dist_bootstrap_i686_linux_DATA = \ + gnu/packages/bootstrap/i686-linux/bash \ + gnu/packages/bootstrap/i686-linux/mkdir \ + gnu/packages/bootstrap/i686-linux/tar \ + gnu/packages/bootstrap/i686-linux/xz + +dist_bootstrap_armhf_linux_DATA = \ + gnu/packages/bootstrap/armhf-linux/bash \ + gnu/packages/bootstrap/armhf-linux/mkdir \ + gnu/packages/bootstrap/armhf-linux/tar \ + gnu/packages/bootstrap/armhf-linux/xz + +dist_bootstrap_mips64el_linux_DATA = \ + gnu/packages/bootstrap/mips64el-linux/bash \ + gnu/packages/bootstrap/mips64el-linux/mkdir \ + gnu/packages/bootstrap/mips64el-linux/tar \ + gnu/packages/bootstrap/mips64el-linux/xz + +# Big bootstrap binaries are not included in the tarball. Instead, they +# are downloaded. +nodist_bootstrap_x86_64_linux_DATA = \ + gnu/packages/bootstrap/x86_64-linux/guile-2.0.9.tar.xz +nodist_bootstrap_i686_linux_DATA = \ + gnu/packages/bootstrap/i686-linux/guile-2.0.9.tar.xz +nodist_bootstrap_armhf_linux_DATA = \ + gnu/packages/bootstrap/armhf-linux/guile-2.0.11.tar.xz +nodist_bootstrap_mips64el_linux_DATA = \ + gnu/packages/bootstrap/mips64el-linux/guile-2.0.9.tar.xz + +# Those files must remain executable, so they remain executable once +# imported into the store. +set-bootstrap-executable-permissions: + chmod +x $(DESTDIR)$(bootstrapdir)/*/{bash,mkdir,tar,xz} + +DISTCLEANFILES = \ + $(nodist_bootstrap_x86_64_linux_DATA) \ + $(nodist_bootstrap_i686_linux_DATA) \ + $(nodist_bootstrap_armhf_linux_DATA) \ + $(nodist_bootstrap_mips64el_linux_DATA) + +# Method to download a file from an external source. +DOWNLOAD_FILE = \ + GUILE_LOAD_COMPILED_PATH="$(top_builddir):$$GUILE_LOAD_COMPILED_PATH" \ + $(GUILE) --no-auto-compile -L "$(top_builddir)" -L "$(top_srcdir)" \ + "$(top_srcdir)/build-aux/download.scm" + +gnu/packages/bootstrap/x86_64-linux/guile-2.0.9.tar.xz: + $(AM_V_DL)$(MKDIR_P) `dirname "$@"`; \ + $(DOWNLOAD_FILE) "$@" \ + "037b103522a2d0d7d69c7ffd8de683dfe5bb4b59c1fafd70b4ffd397fd2f57f0" +gnu/packages/bootstrap/i686-linux/guile-2.0.9.tar.xz: + $(AM_V_DL)$(MKDIR_P) `dirname "$@"`; \ + $(DOWNLOAD_FILE) "$@" \ + "b757cd46bf13ecac83fb8e955fb50096ac2d17bb610ca8eb816f29302a00a846" +gnu/packages/bootstrap/armhf-linux/guile-2.0.11.tar.xz: + $(AM_V_DL)$(MKDIR_P) `dirname "$@"`; \ + $(DOWNLOAD_FILE) "$@" \ + "e551d05d4d385d6706ab8d574856a087758294dc90ab4c06e70a157a685e23d6" +gnu/packages/bootstrap/mips64el-linux/guile-2.0.9.tar.xz: + $(AM_V_DL)$(MKDIR_P) `dirname "$@"`; \ + $(DOWNLOAD_FILE) "$@" \ + "994680f0001346864aa2c2cc5110f380ee7518dcd701c614291682b8e948f73b" diff --git a/guix/config.scm.in b/guix/config.scm.in index 764e466bc5..d7df9f7d2b 100644 --- a/guix/config.scm.in +++ b/guix/config.scm.in @@ -55,11 +55,11 @@ "@storedir@")) (define %state-directory - ;; This must match `NIX_STATE_DIR' as defined in `daemon.am'. + ;; This must match `NIX_STATE_DIR' as defined in `nix/local.mk'. (or (getenv "NIX_STATE_DIR") "@guix_localstatedir@/guix")) (define %config-directory - ;; This must match `NIX_CONF_DIR' as defined in `daemon.am'. + ;; This must match `NIX_CONF_DIR' as defined in `nix/local.mk'. (or (getenv "NIX_CONF_DIR") "@guix_sysconfdir@/guix")) (define %guix-register-program diff --git a/nix/local.mk b/nix/local.mk new file mode 100644 index 0000000000..3c15531f54 --- /dev/null +++ b/nix/local.mk @@ -0,0 +1,226 @@ +# GNU Guix --- Functional package management for GNU +# Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès +# Copyright © 2016 Mathieu Lirzin +# +# This file is part of GNU Guix. +# +# GNU Guix is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or (at +# your option) any later version. +# +# GNU Guix is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Guix. If not, see . + +# +# Integration of the `guix-daemon' code taken from upstream Nix. +# + +BUILT_SOURCES += nix/libstore/schema.sql.hh +CLEANFILES += $(BUILT_SOURCES) etc/guix-daemon.service etc/guix-daemon.conf + +noinst_LIBRARIES = libformat.a libutil.a libstore.a + +# Use '-std=c++11' for 'std::shared_ptr', 'auto', lambdas, and more. +AM_CXXFLAGS = -Wall -std=c++11 + +libformat_a_SOURCES = \ + nix/boost/format/free_funcs.cc \ + nix/boost/format/parsing.cc \ + nix/boost/format/format_implementation.cc + +libformat_headers = \ + nix/boost/throw_exception.hpp \ + nix/boost/format.hpp \ + nix/boost/assert.hpp \ + nix/boost/format/macros_default.hpp \ + nix/boost/format/format_fwd.hpp \ + nix/boost/format/format_class.hpp \ + nix/boost/format/exceptions.hpp \ + nix/boost/format/group.hpp \ + nix/boost/format/feed_args.hpp \ + nix/boost/format/internals_fwd.hpp \ + nix/boost/format/internals.hpp + +libformat_a_CPPFLAGS = \ + -I$(top_srcdir)/nix + +libutil_a_SOURCES = \ + nix/libutil/archive.cc \ + nix/libutil/affinity.cc \ + nix/libutil/serialise.cc \ + nix/libutil/util.cc \ + nix/libutil/xml-writer.cc \ + nix/libutil/hash.cc \ + nix/libutil/gcrypt-hash.cc + +libutil_headers = \ + nix/libutil/affinity.hh \ + nix/libutil/hash.hh \ + nix/libutil/serialise.hh \ + nix/libutil/xml-writer.hh \ + nix/libutil/util.hh \ + nix/libutil/archive.hh \ + nix/libutil/types.hh \ + nix/libutil/gcrypt-hash.hh \ + nix/libutil/md5.h \ + nix/libutil/sha1.h \ + nix/libutil/sha256.h \ + nix/libutil/sha512.h + +libutil_a_CPPFLAGS = \ + -I$(top_builddir)/nix \ + -I$(top_srcdir)/nix/libutil \ + $(libformat_a_CPPFLAGS) + +libstore_a_SOURCES = \ + nix/libstore/gc.cc \ + nix/libstore/globals.cc \ + nix/libstore/misc.cc \ + nix/libstore/references.cc \ + nix/libstore/store-api.cc \ + nix/libstore/optimise-store.cc \ + nix/libstore/local-store.cc \ + nix/libstore/build.cc \ + nix/libstore/pathlocks.cc \ + nix/libstore/derivations.cc + +libstore_headers = \ + nix/libstore/references.hh \ + nix/libstore/pathlocks.hh \ + nix/libstore/globals.hh \ + nix/libstore/worker-protocol.hh \ + nix/libstore/derivations.hh \ + nix/libstore/misc.hh \ + nix/libstore/local-store.hh \ + nix/libstore/store-api.hh + +libstore_a_CPPFLAGS = \ + $(libutil_a_CPPFLAGS) \ + -I$(top_srcdir)/nix/libstore \ + -I$(top_builddir)/nix/libstore \ + -DNIX_STORE_DIR=\"$(storedir)\" \ + -DNIX_DATA_DIR=\"$(datadir)\" \ + -DNIX_STATE_DIR=\"$(localstatedir)/guix\" \ + -DNIX_LOG_DIR=\"$(localstatedir)/log/guix\" \ + -DNIX_CONF_DIR=\"$(sysconfdir)/guix\" \ + -DNIX_LIBEXEC_DIR=\"$(libexecdir)\" \ + -DNIX_BIN_DIR=\"$(bindir)\" \ + -DOPENSSL_PATH="\"guix-authenticate\"" \ + -DDEFAULT_CHROOT_DIRS="\"\"" + +libstore_a_CXXFLAGS = $(AM_CXXFLAGS) \ + $(SQLITE3_CFLAGS) $(LIBGCRYPT_CFLAGS) + +bin_PROGRAMS = guix-daemon +sbin_PROGRAMS = guix-register + +guix_daemon_SOURCES = \ + nix/nix-daemon/nix-daemon.cc \ + nix/nix-daemon/guix-daemon.cc + +guix_daemon_CPPFLAGS = \ + -DLOCALEDIR=\"$(localedir)\" \ + $(libutil_a_CPPFLAGS) \ + -I$(top_srcdir)/nix/libstore + +guix_daemon_LDADD = \ + libstore.a libutil.a libformat.a -lbz2 \ + $(SQLITE3_LIBS) $(LIBGCRYPT_LIBS) + +guix_daemon_headers = \ + nix/nix-daemon/shared.hh + + +guix_register_SOURCES = \ + nix/guix-register/guix-register.cc + +guix_register_CPPFLAGS = \ + $(libutil_a_CPPFLAGS) \ + $(libstore_a_CPPFLAGS) \ + -I$(top_srcdir)/nix/libstore + +# XXX: Should we start using shared libs? +guix_register_LDADD = \ + libstore.a libutil.a libformat.a -lbz2 \ + $(SQLITE3_LIBS) $(LIBGCRYPT_LIBS) + + +noinst_HEADERS = \ + $(libformat_headers) $(libutil_headers) $(libstore_headers) \ + $(guix_daemon_headers) + +nix/libstore/schema.sql.hh: nix/libstore/schema.sql + $(AM_V_GEN)$(GUILE) --no-auto-compile -c \ + "(use-modules (rnrs io ports)) \ + (call-with-output-file \"$@\" \ + (lambda (out) \ + (call-with-input-file \"$^\" \ + (lambda (in) \ + (write (get-string-all in) out)))))" + +nodist_pkglibexec_SCRIPTS = \ + nix/scripts/list-runtime-roots \ + nix/scripts/substitute + +if BUILD_DAEMON_OFFLOAD + +nodist_pkglibexec_SCRIPTS += \ + nix/scripts/offload + +endif BUILD_DAEMON_OFFLOAD + + +# XXX: It'd be better to hide it in $(pkglibexecdir). +nodist_libexec_SCRIPTS = \ + nix/scripts/guix-authenticate + +# The '.service' file for systemd. +systemdservicedir = $(libdir)/systemd/system +nodist_systemdservice_DATA = etc/guix-daemon.service + +etc/guix-daemon.service: etc/guix-daemon.service.in \ + $(top_builddir)/config.status + $(AM_V_GEN)$(MKDIR_P) "`dirname $@`"; \ + $(SED) -e 's|@''bindir''@|$(bindir)|' < \ + "$(srcdir)/etc/guix-daemon.service.in" > "$@.tmp"; \ + mv "$@.tmp" "$@" + +# The '.conf' job for Upstart. +upstartjobdir = $(libdir)/upstart/system +nodist_upstartjob_DATA = etc/guix-daemon.conf + +etc/guix-daemon.conf: etc/guix-daemon.conf.in \ + $(top_builddir)/config.status + $(AM_V_GEN)$(MKDIR_P) "`dirname $@`"; \ + $(SED) -e 's|@''bindir''@|$(bindir)|' < \ + "$(srcdir)/etc/guix-daemon.conf.in" > "$@.tmp"; \ + mv "$@.tmp" "$@" + +EXTRA_DIST += \ + nix/libstore/schema.sql \ + nix/AUTHORS \ + nix/COPYING \ + etc/guix-daemon.service.in \ + etc/guix-daemon.conf.in + +if CAN_RUN_TESTS + +AM_TESTS_ENVIRONMENT += \ + top_builddir="$(abs_top_builddir)" + +TESTS += \ + tests/guix-daemon.sh + +endif CAN_RUN_TESTS + +clean-local: + -if test -d "$(GUIX_TEST_ROOT)"; then \ + find "$(GUIX_TEST_ROOT)" | xargs chmod +w; \ + fi + -rm -rf "$(GUIX_TEST_ROOT)" -- cgit v1.2.3 From 73f38d5ff3621c7fbc69a6a5eea598ba269e8b2a Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 25 Apr 2016 14:57:26 +0200 Subject: syscalls: Move code around [NFC]. * guix/build/syscalls.scm: Move packed structure handling to the top. --- guix/build/syscalls.scm | 217 ++++++++++++++++++++++++++---------------------- 1 file changed, 116 insertions(+), 101 deletions(-) (limited to 'guix') diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm index 04fc3ef5fe..45555060f8 100644 --- a/guix/build/syscalls.scm +++ b/guix/build/syscalls.scm @@ -101,6 +101,112 @@ ;;; ;;; Code: + +;;; +;;; Packed structures. +;;; + +(define-syntax sizeof* + ;; XXX: This duplicates 'compile-time-value'. + (syntax-rules (int128) + ((_ int128) + 16) + ((_ type) + (let-syntax ((v (lambda (s) + (let ((val (sizeof type))) + (syntax-case s () + (_ val)))))) + v)))) + +(define-syntax alignof* + ;; XXX: This duplicates 'compile-time-value'. + (syntax-rules (int128) + ((_ int128) + 16) + ((_ type) + (let-syntax ((v (lambda (s) + (let ((val (alignof type))) + (syntax-case s () + (_ val)))))) + v)))) + +(define-syntax align ;as found in (system foreign) + (syntax-rules (~) + "Add to OFFSET whatever it takes to get proper alignment for TYPE." + ((_ offset (type ~ endianness)) + (align offset type)) + ((_ offset type) + (1+ (logior (1- offset) (1- (alignof* type))))))) + +(define-syntax type-size + (syntax-rules (~) + ((_ (type ~ order)) + (sizeof* type)) + ((_ type) + (sizeof* type)))) + +(define-syntax write-type + (syntax-rules (~) + ((_ bv offset (type ~ order) value) + (bytevector-uint-set! bv offset value + (endianness order) (sizeof* type))) + ((_ bv offset type value) + (bytevector-uint-set! bv offset value + (native-endianness) (sizeof* type))))) + +(define-syntax write-types + (syntax-rules () + ((_ bv offset () ()) + #t) + ((_ bv offset (type0 types ...) (field0 fields ...)) + (begin + (write-type bv (align offset type0) type0 field0) + (write-types bv + (+ (align offset type0) (type-size type0)) + (types ...) (fields ...)))))) + +(define-syntax read-type + (syntax-rules (~ quote *) + ((_ bv offset '*) + (make-pointer (bytevector-uint-ref bv offset + (native-endianness) + (sizeof* '*)))) + ((_ bv offset (type ~ order)) + (bytevector-uint-ref bv offset + (endianness order) (sizeof* type))) + ((_ bv offset type) + (bytevector-uint-ref bv offset + (native-endianness) (sizeof* type))))) + +(define-syntax read-types + (syntax-rules () + ((_ return bv offset () (values ...)) + (return values ...)) + ((_ return bv offset (type0 types ...) (values ...)) + (read-types return + bv + (+ (align offset type0) (type-size type0)) + (types ...) + (values ... (read-type bv + (align offset type0) + type0)))))) + +(define-syntax define-c-struct + (syntax-rules () + "Define READ as a deserializer and WRITE! as a serializer for the C +structure with the given TYPES. READ uses WRAP-FIELDS to return its value." + ((_ name wrap-fields read write! (fields types) ...) + (begin + (define (write! bv offset fields ...) + (write-types bv offset (types ...) (fields ...))) + (define (read bv offset) + (read-types wrap-fields bv offset (types ...) ())))))) + + +;;; +;;; FFI. +;;; + (define %libc-errno-pointer ;; Glibc's 'errno' pointer. (let ((errno-loc (dynamic-func "__errno_location" (dynamic-link)))) @@ -159,6 +265,11 @@ the returned procedure is called." (error (format #f "~a: syscall->procedure failed: ~s" name args)))))) + +;;; +;;; File systems. +;;; + (define (augment-mtab source target type options) "Augment /etc/mtab with information about the given mount point." (let ((port (open-file "/etc/mtab" "a"))) @@ -322,6 +433,11 @@ string TMPL and return its file name. TMPL must end with 'XXXXXX'." (list err))) (pointer->string result))))) + +;;; +;;; Containers. +;;; + ;; Linux clone flags, from linux/sched.h (define CLONE_CHILD_CLEARTID #x00200000) (define CLONE_CHILD_SETTID #x01000000) @@ -395,107 +511,6 @@ system to PUT-OLD." (list new-root put-old (strerror err)) (list err))))))) - -;;; -;;; Packed structures. -;;; - -(define-syntax sizeof* - ;; XXX: This duplicates 'compile-time-value'. - (syntax-rules (int128) - ((_ int128) - 16) - ((_ type) - (let-syntax ((v (lambda (s) - (let ((val (sizeof type))) - (syntax-case s () - (_ val)))))) - v)))) - -(define-syntax alignof* - ;; XXX: This duplicates 'compile-time-value'. - (syntax-rules (int128) - ((_ int128) - 16) - ((_ type) - (let-syntax ((v (lambda (s) - (let ((val (alignof type))) - (syntax-case s () - (_ val)))))) - v)))) - -(define-syntax align ;as found in (system foreign) - (syntax-rules (~) - "Add to OFFSET whatever it takes to get proper alignment for TYPE." - ((_ offset (type ~ endianness)) - (align offset type)) - ((_ offset type) - (1+ (logior (1- offset) (1- (alignof* type))))))) - -(define-syntax type-size - (syntax-rules (~) - ((_ (type ~ order)) - (sizeof* type)) - ((_ type) - (sizeof* type)))) - -(define-syntax write-type - (syntax-rules (~) - ((_ bv offset (type ~ order) value) - (bytevector-uint-set! bv offset value - (endianness order) (sizeof* type))) - ((_ bv offset type value) - (bytevector-uint-set! bv offset value - (native-endianness) (sizeof* type))))) - -(define-syntax write-types - (syntax-rules () - ((_ bv offset () ()) - #t) - ((_ bv offset (type0 types ...) (field0 fields ...)) - (begin - (write-type bv (align offset type0) type0 field0) - (write-types bv - (+ (align offset type0) (type-size type0)) - (types ...) (fields ...)))))) - -(define-syntax read-type - (syntax-rules (~ quote *) - ((_ bv offset '*) - (make-pointer (bytevector-uint-ref bv offset - (native-endianness) - (sizeof* '*)))) - ((_ bv offset (type ~ order)) - (bytevector-uint-ref bv offset - (endianness order) (sizeof* type))) - ((_ bv offset type) - (bytevector-uint-ref bv offset - (native-endianness) (sizeof* type))))) - -(define-syntax read-types - (syntax-rules () - ((_ return bv offset () (values ...)) - (return values ...)) - ((_ return bv offset (type0 types ...) (values ...)) - (read-types return - bv - (+ (align offset type0) (type-size type0)) - (types ...) - (values ... (read-type bv - (align offset type0) - type0)))))) - -(define-syntax define-c-struct - (syntax-rules () - "Define READ as a deserializer and WRITE! as a serializer for the C -structure with the given TYPES. READ uses WRAP-FIELDS to return its value." - ((_ name wrap-fields read write! (fields types) ...) - (begin - (define (write! bv offset fields ...) - (write-types bv offset (types ...) (fields ...))) - (define (read bv offset) - (read-types wrap-fields bv offset (types ...) ())))))) - ;;; ;;; Network interfaces. -- cgit v1.2.3 From f77863a09eebf65299e734d27f1c5b96e9742f52 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 25 Apr 2016 15:41:59 +0200 Subject: syscalls: Second argument of packed-struct read is now optional. * guix/build/syscalls.scm (define-c-struct)[read]: OFFSET defaults to 0. (unfold-interface-list): Remove second argument to 'read-ifaddrs'. (terminal-window-size): Remove second argument to 'read-winsize'. --- guix/build/syscalls.scm | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'guix') diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm index 45555060f8..7c32e25971 100644 --- a/guix/build/syscalls.scm +++ b/guix/build/syscalls.scm @@ -199,7 +199,7 @@ structure with the given TYPES. READ uses WRAP-FIELDS to return its value." (begin (define (write! bv offset fields ...) (write-types bv offset (types ...) (fields ...))) - (define (read bv offset) + (define* (read bv #:optional (offset 0)) (read-types wrap-fields bv offset (types ...) ())))))) @@ -858,8 +858,7 @@ return the list of resulting objects." (result '())) (if (null-pointer? ptr) (reverse result) - (match (read-ifaddrs (pointer->bytevector ptr %sizeof-ifaddrs) - 0) + (match (read-ifaddrs (pointer->bytevector ptr %sizeof-ifaddrs)) ((ifaddr . ptr) (loop ptr (cons ifaddr result))))))) @@ -921,8 +920,7 @@ corresponds to the TIOCGWINSZ ioctl." (ret (%ioctl (fileno port) TIOCGWINSZ size)) (err (errno))) (if (zero? ret) - (read-winsize (pointer->bytevector size (sizeof winsize-struct)) - 0) + (read-winsize (pointer->bytevector size (sizeof winsize-struct))) (throw 'system-error "terminal-window-size" "~A" (list (strerror err)) (list err))))) -- cgit v1.2.3 From 785cfa8791b0d683830245f119ee6fd42e5356d3 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 25 Apr 2016 16:47:23 +0200 Subject: syscalls: 'define-c-struct' computes the struct size. * guix/build/syscalls.scm (struct-alignment, struct-size): New macros. (define-c-struct): Add 'size' parameter and honor it. (sockaddr-in, sockaddr-in6, ifaddrs, winsize): Adjust accordingly. (%struct-ifaddrs-type, %sizeof-ifaddrs, winsize-struct): Remove. (terminal-window-size): Use 'make-bytevector' instead of 'make-c-struct'. --- guix/build/syscalls.scm | 52 +++++++++++++++++++++++++++++++++---------------- 1 file changed, 35 insertions(+), 17 deletions(-) (limited to 'guix') diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm index 7c32e25971..468dc7eca2 100644 --- a/guix/build/syscalls.scm +++ b/guix/build/syscalls.scm @@ -145,6 +145,27 @@ ((_ type) (sizeof* type)))) +(define-syntax struct-alignment + (syntax-rules () + "Compute the alignment for the aggregate made of TYPES at OFFSET. The +result is the alignment of the \"most strictly aligned component\"." + ((_ offset types ...) + (max (align offset types) ...)))) + +(define-syntax struct-size + (syntax-rules () + "Return the size in bytes of the structure made of TYPES." + ((_ offset (types-processed ...)) + ;; The SysV ABI P.S. says: "Aggregates (structures and arrays) and unions + ;; assume the alignment of their most strictly aligned component." As an + ;; example, a struct such as "int32, int16" has size 8, not 6. + (1+ (logior (1- offset) + (1- (struct-alignment offset types-processed ...))))) + ((_ offset (types-processed ...) type0 types ...) + (struct-size (+ (type-size type0) (align offset type0)) + (type0 types-processed ...) + types ...)))) + (define-syntax write-type (syntax-rules (~) ((_ bv offset (type ~ order) value) @@ -193,10 +214,13 @@ (define-syntax define-c-struct (syntax-rules () - "Define READ as a deserializer and WRITE! as a serializer for the C -structure with the given TYPES. READ uses WRAP-FIELDS to return its value." - ((_ name wrap-fields read write! (fields types) ...) + "Define SIZE as the size in bytes of the C structure made of FIELDS. READ +as a deserializer and WRITE! as a serializer for the C structure with the +given TYPES. READ uses WRAP-FIELDS to return its value." + ((_ name size wrap-fields read write! (fields types) ...) (begin + (define size + (struct-size 0 () types ...)) (define (write! bv offset fields ...) (write-types bv offset (types ...) (fields ...))) (define* (read bv #:optional (offset 0)) @@ -559,6 +583,7 @@ system to PUT-OLD." 32)) (define-c-struct sockaddr-in ; + sizeof-sockaddrin (lambda (family port address) (make-socket-address family address port)) read-sockaddr-in @@ -568,6 +593,7 @@ system to PUT-OLD." (address (int32 ~ big))) (define-c-struct sockaddr-in6 ; + sizeof-sockaddr-in6 (lambda (family port flowinfo address scopeid) (make-socket-address family address port flowinfo scopeid)) read-sockaddr-in6 @@ -832,6 +858,7 @@ an object, and whose cdr is the pointer NEXT." next)) (define-c-struct ifaddrs ; + %sizeof-ifaddrs values->interface read-ifaddrs write-ifaddrs! @@ -843,14 +870,6 @@ an object, and whose cdr is the pointer NEXT." (broadcastaddr '*) (data '*)) -(define-syntax %struct-ifaddrs-type - (identifier-syntax - `(* * ,unsigned-int * * * *))) - -(define-syntax %sizeof-ifaddrs - (identifier-syntax - (sizeof* %struct-ifaddrs-type))) - (define (unfold-interface-list ptr) "Call 'read-ifaddrs' on PTR and all its 'next' fields, recursively, and return the list of resulting objects." @@ -901,6 +920,7 @@ network interface. This is implemented using the 'getifaddrs' libc function." (y-pixels window-size-y-pixels)) (define-c-struct winsize ; + sizeof-winsize window-size read-winsize write-winsize! @@ -909,18 +929,16 @@ network interface. This is implemented using the 'getifaddrs' libc function." (x-pixels unsigned-short) (y-pixels unsigned-short)) -(define winsize-struct - (list unsigned-short unsigned-short unsigned-short unsigned-short)) - (define* (terminal-window-size #:optional (port (current-output-port))) "Return a structure describing the terminal at PORT, or raise a 'system-error' if PORT is not backed by a terminal. This procedure corresponds to the TIOCGWINSZ ioctl." - (let* ((size (make-c-struct winsize-struct '(0 0 0 0))) - (ret (%ioctl (fileno port) TIOCGWINSZ size)) + (let* ((size (make-bytevector sizeof-winsize)) + (ret (%ioctl (fileno port) TIOCGWINSZ + (bytevector->pointer size))) (err (errno))) (if (zero? ret) - (read-winsize (pointer->bytevector size (sizeof winsize-struct))) + (read-winsize size) (throw 'system-error "terminal-window-size" "~A" (list (strerror err)) (list err))))) -- cgit v1.2.3 From a1f708787d08e567da6118bacc481219884296ca Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 25 Apr 2016 17:18:58 +0200 Subject: syscalls: Add 'statfs'. * guix/build/syscalls.scm (): New record type. (fsword): New macro. (%statfs): New C struct. (statfs): New procedure. --- guix/build/syscalls.scm | 71 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/syscalls.scm | 15 +++++++++++ 2 files changed, 86 insertions(+) (limited to 'guix') diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm index 468dc7eca2..d168293ee4 100644 --- a/guix/build/syscalls.scm +++ b/guix/build/syscalls.scm @@ -47,6 +47,20 @@ mount-points swapon swapoff + + file-system? + file-system-type + file-system-block-size + file-system-block-count + file-system-blocks-free + file-system-blocks-available + file-system-file-count + file-system-free-file-nodes + file-system-identifier + file-system-maximum-name-length + file-system-fragment-size + statfs + processes mkdtemp! pivot-root @@ -457,6 +471,63 @@ string TMPL and return its file name. TMPL must end with 'XXXXXX'." (list err))) (pointer->string result))))) + +(define-record-type + (file-system type block-size blocks blocks-free + blocks-available files free-files identifier + name-length fragment-size + spare0 spare1 spare2) + file-system? + (type file-system-type) + (block-size file-system-block-size) + (blocks file-system-block-count) + (blocks-free file-system-blocks-free) + (blocks-available file-system-blocks-available) + (files file-system-file-count) + (free-files file-system-free-file-nodes) + (identifier file-system-identifier) + (name-length file-system-maximum-name-length) + (fragment-size file-system-fragment-size) + (spare0 file-system--spare0) + (spare1 file-system--spare1) + (spare2 file-system--spare2)) + +(define-syntax fsword ;fsword_t + (identifier-syntax long)) + +(define-c-struct %statfs + sizeof-statfs ;slightly overestimated + file-system + read-statfs + write-statfs! + (type fsword) + (block-size fsword) + (blocks uint64) + (blocks-free uint64) + (blocks-available uint64) + (files uint64) + (free-files uint64) + (identifier uint64) ;really "int[2]" + (name-length fsword) + (fragment-size fsword) + (spare0 int128) ;really "fsword[4]" + (spare1 int128) + (spare2 int64)) ;XXX: to match array alignment + +(define statfs + (let ((proc (syscall->procedure int "statfs" '(* *)))) + (lambda (file) + "Return a data structure describing the file system +mounted at FILE." + (let* ((stat (make-bytevector sizeof-statfs)) + (ret (proc (string->pointer file) (bytevector->pointer stat))) + (err (errno))) + (if (zero? ret) + (read-statfs stat 0) + (throw 'system-error "statfs" "~A: ~A" + (list file (strerror err)) + (list err))))))) + ;;; ;;; Containers. diff --git a/tests/syscalls.scm b/tests/syscalls.scm index 24ea8f5e60..895f90f4d8 100644 --- a/tests/syscalls.scm +++ b/tests/syscalls.scm @@ -78,6 +78,21 @@ (rmdir dir) #t)))) +(test-equal "statfs, ENOENT" + ENOENT + (catch 'system-error + (lambda () + (statfs "/does-not-exist")) + (compose system-error-errno list))) + +(test-assert "statfs" + (let ((fs (statfs "/"))) + (and (file-system? fs) + (> (file-system-block-size fs) 0) + (>= (file-system-blocks-available fs) 0) + (>= (file-system-blocks-free fs) + (file-system-blocks-available fs))))) + (define (user-namespace pid) (string-append "/proc/" (number->string pid) "/ns/user")) -- cgit v1.2.3 From 0054e47036b13d46f0f026bbc04d19770c2ecbad Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 25 Apr 2016 22:19:33 +0200 Subject: guix gc: Add '--free-space'. * guix/scripts/gc.scm (show-help, %options): Add '--free-space'. (guix-gc)[ensure-free-space]: New procedure. Handle '--free-space'. --- doc/guix.texi | 9 +++++++++ guix/scripts/gc.scm | 33 ++++++++++++++++++++++++++++----- 2 files changed, 37 insertions(+), 5 deletions(-) (limited to 'guix') diff --git a/doc/guix.texi b/doc/guix.texi index ab07d1066e..6d64772262 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -1974,6 +1974,15 @@ suffix, such as @code{MiB} for mebibytes and @code{GB} for gigabytes When @var{min} is omitted, collect all the garbage. +@item --free-space=@var{free} +@itemx -F @var{free} +Collect garbage until @var{free} space is available under +@file{/gnu/store}, if possible; @var{free} denotes storage space, such +as @code{500MiB}, as described above. + +When @var{free} or more is already available in @file{/gnu/store}, do +nothing and exit immediately. + @item --delete @itemx -d Attempt to delete all the store files and directories specified as diff --git a/guix/scripts/gc.scm b/guix/scripts/gc.scm index fe1bb93f7f..4ec9ff9dca 100644 --- a/guix/scripts/gc.scm +++ b/guix/scripts/gc.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013, 2015 Ludovic Courtès +;;; Copyright © 2012, 2013, 2015, 2016 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -20,6 +20,7 @@ #:use-module (guix ui) #:use-module (guix scripts) #:use-module (guix store) + #:autoload (guix build syscalls) (statfs) #:use-module (ice-9 match) #:use-module (ice-9 regex) #:use-module (srfi srfi-1) @@ -43,6 +44,8 @@ Invoke the garbage collector.\n")) -C, --collect-garbage[=MIN] collect at least MIN bytes of garbage")) (display (_ " + -F, --free-space=FREE attempt to reach FREE available space in the store")) + (display (_ " -d, --delete attempt to delete PATHS")) (display (_ " --optimize optimize the store by deduplicating identical files")) @@ -96,6 +99,9 @@ Invoke the garbage collector.\n")) (leave (_ "invalid amount of storage: ~a~%") arg)))) (#f result))))) + (option '(#\F "free-space") #t #f + (lambda (opt name arg result) + (alist-cons 'free-space (size->number arg) result))) (option '(#\d "delete") #f #f (lambda (opt name arg result) (alist-cons 'action 'delete @@ -175,6 +181,18 @@ Invoke the garbage collector.\n")) (cut match:substring <> 1))) file)) + (define (ensure-free-space store space) + ;; Attempt to have at least SPACE bytes available in STORE. + (let* ((fs (statfs (%store-prefix))) + (free (* (file-system-block-size fs) + (file-system-blocks-available fs)))) + (if (> free space) + (info (_ "already ~h bytes available on ~a, nothing to do~%") + free (%store-prefix)) + (let ((to-free (- space free))) + (info (_ "freeing ~h bytes~%") to-free) + (collect-garbage store to-free))))) + (with-error-handling (let* ((opts (parse-options)) (store (open-connection)) @@ -197,10 +215,15 @@ Invoke the garbage collector.\n")) (case (assoc-ref opts 'action) ((collect-garbage) (assert-no-extra-arguments) - (let ((min-freed (assoc-ref opts 'min-freed))) - (if min-freed - (collect-garbage store min-freed) - (collect-garbage store)))) + (let ((min-freed (assoc-ref opts 'min-freed)) + (free-space (assoc-ref opts 'free-space))) + (cond + (free-space + (ensure-free-space store free-space)) + (min-freed + (collect-garbage store min-freed)) + (else + (collect-garbage store))))) ((delete) (delete-paths store (map direct-store-path paths))) ((list-references) -- cgit v1.2.3 From 5cd25aad3cdb6c970a76542e328a3beba8c1f2c9 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 25 Apr 2016 23:22:45 +0200 Subject: syscalls: 'terminal-columns' catches EINVAL on the TIOCGWINSZ ioctl. Reported by Mark H Weaver . * guix/build/syscalls.scm (terminal-columns): Tolerate EINVAL. * tests/syscalls.scm ("terminal-window-size ENOTTY"): Likewise. --- guix/build/syscalls.scm | 5 ++++- tests/syscalls.scm | 7 ++++--- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'guix') diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm index d168293ee4..6cdf65304d 100644 --- a/guix/build/syscalls.scm +++ b/guix/build/syscalls.scm @@ -1034,7 +1034,10 @@ always a positive integer." (fall-back))) (lambda args (let ((errno (system-error-errno args))) - (if (= errno ENOTTY) + ;; ENOTTY is what we're after but 2012-and-earlier Linux versions + ;; would return EINVAL instead in some cases: + ;; . + (if (or (= errno ENOTTY) (= errno EINVAL)) (fall-back) (apply throw args)))))) diff --git a/tests/syscalls.scm b/tests/syscalls.scm index 895f90f4d8..71bcbc4d32 100644 --- a/tests/syscalls.scm +++ b/tests/syscalls.scm @@ -259,15 +259,16 @@ (#f #f) (lo (interface-address lo))))))) -(test-equal "terminal-window-size ENOTTY" - ENOTTY +(test-assert "terminal-window-size ENOTTY" (call-with-input-file "/dev/null" (lambda (port) (catch 'system-error (lambda () (terminal-window-size port)) (lambda args - (system-error-errno args)))))) + ;; Accept EINVAL, which some old Linux versions might return. + (memv (system-error-errno args) + (list ENOTTY EINVAL))))))) (test-assert "terminal-columns" (> (terminal-columns) 0)) -- cgit v1.2.3 From b77d17d023257625af1281d49e8043a03289edaf Mon Sep 17 00:00:00 2001 From: Eric Bavier Date: Fri, 15 Apr 2016 23:52:19 -0500 Subject: import: cpan: check version bounds on core modules. Modules may be removed from Perl's core, so we must check for a removal version. * guix/import/cpan.scm (cpan-module->sexp)[core-module?]: Also check version upper bound. --- guix/import/cpan.scm | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) (limited to 'guix') diff --git a/guix/import/cpan.scm b/guix/import/cpan.scm index c80d568101..ad61ee7916 100644 --- a/guix/import/cpan.scm +++ b/guix/import/cpan.scm @@ -26,6 +26,7 @@ #:use-module (json) #:use-module (guix hash) #:use-module (guix store) + #:use-module (guix utils) #:use-module (guix base32) #:use-module ((guix download) #:select (download-to-store)) #:use-module (guix import utils) @@ -121,16 +122,30 @@ META." (define version (assoc-ref meta "version")) - (define (core-module? name) - (and (force %corelist) - (parameterize ((current-error-port (%make-void-port "w"))) - (let* ((corelist (open-pipe* OPEN_READ (force %corelist) name))) - (let loop ((line (read-line corelist))) - (if (eof-object? line) - (begin (close-pipe corelist) #f) - (if (string-contains line "first released with perl") - (begin (close-pipe corelist) #t) - (loop (read-line corelist))))))))) + (define core-module? + (let ((perl-version (package-version perl)) + (rx (make-regexp + (string-append "released with perl v?([0-9\\.]*)" + "(.*and removed from v?([0-9\\.]*))?")))) + (lambda (name) + (define (version-between? lower version upper) + (and (version>=? version lower) + (or (not upper) + (version>? upper version)))) + (and (force %corelist) + (parameterize ((current-error-port (%make-void-port "w"))) + (let* ((corelist (open-pipe* OPEN_READ (force %corelist) name))) + (let loop () + (let ((line (read-line corelist))) + (if (eof-object? line) + (begin (close-pipe corelist) #f) + (or (and=> (regexp-exec rx line) + (lambda (m) + (let ((first (match:substring m 1)) + (last (match:substring m 3))) + (version-between? + first perl-version last)))) + (loop))))))))))) (define (convert-inputs phases) ;; Convert phase dependencies into a list of name/variable pairs. -- cgit v1.2.3 From 20be23c3b67dd181a2c4b468626490a7eb74e492 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 27 Apr 2016 10:05:45 +0200 Subject: lint: Report synopses/descriptions that are not strings. Suggested by John Darrington. * guix/scripts/lint.scm (check-description-style): Emit a warning when DESCRIPTION is not a string. (check-synopsis-style): Likewise. (check-gnu-synopsis+description): Likewise. * tests/lint.scm ("description: not a string", "synopsis: not a string"): New tests. --- guix/scripts/lint.scm | 50 +++++++++++++++++++++++++++++++------------------- tests/lint.scm | 16 ++++++++++++++++ 2 files changed, 47 insertions(+), 19 deletions(-) (limited to 'guix') diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm index d2fed67e13..a8023a5b1e 100644 --- a/guix/scripts/lint.scm +++ b/guix/scripts/lint.scm @@ -187,13 +187,17 @@ by two spaces; possible infraction~p at ~{~a~^, ~}") 'description)))) (let ((description (package-description package))) - (when (string? description) - (check-not-empty description) - ;; Use raw description for this because Texinfo rendering automatically - ;; fixes end of sentence space. - (check-end-of-sentence-space description) - (and=> (check-texinfo-markup description) - check-proper-start)))) + (if (string? description) + (begin + (check-not-empty description) + ;; Use raw description for this because Texinfo rendering + ;; automatically fixes end of sentence space. + (check-end-of-sentence-space description) + (and=> (check-texinfo-markup description) + check-proper-start)) + (emit-warning package + (format #f (_ "invalid description: ~s") description) + 'description)))) (define (check-inputs-should-be-native package) ;; Emit a warning if some inputs of PACKAGE are likely to belong to its @@ -262,14 +266,19 @@ the synopsis") (_ "synopsis should not start with the package name") 'synopsis))) - (let ((synopsis (package-synopsis package))) - (when (string? synopsis) - (check-not-empty synopsis) - (check-proper-start synopsis) - (check-final-period synopsis) - (check-start-article synopsis) - (check-start-with-package-name synopsis) - (check-synopsis-length synopsis)))) + (define checks + (list check-not-empty check-proper-start check-final-period + check-start-article check-start-with-package-name + check-synopsis-length)) + + (match (package-synopsis package) + ((? string? synopsis) + (for-each (lambda (proc) + (proc synopsis)) + checks)) + (invalid + (emit-warning package (format #f (_ "invalid synopsis: ~s") invalid) + 'synopsis)))) (define* (probe-uri uri #:key timeout) "Probe URI, a URI object, and return two values: a symbol denoting the @@ -459,12 +468,14 @@ descriptions maintained upstream." (official-gnu-packages*)) (#f ;not a GNU package, so nothing to do #t) - (descriptor ;a genuine GNU package + (descriptor ;a genuine GNU package (let ((upstream (gnu-package-doc-summary descriptor)) (downstream (package-synopsis package)) (loc (or (package-field-location package 'synopsis) (package-location package)))) - (unless (and upstream (string=? upstream downstream)) + (when (and upstream + (or (not (string? downstream)) + (not (string=? upstream downstream)))) (format (guix-warning-port) (_ "~a: ~a: proposed synopsis: ~s~%") (location->string loc) (package-full-name package) @@ -475,8 +486,9 @@ descriptions maintained upstream." (loc (or (package-field-location package 'description) (package-location package)))) (when (and upstream - (not (string=? (fill-paragraph upstream 100) - (fill-paragraph downstream 100)))) + (or (not (string? downstream)) + (not (string=? (fill-paragraph upstream 100) + (fill-paragraph downstream 100))))) (format (guix-warning-port) (_ "~a: ~a: proposed description:~% \"~a\"~%") (location->string loc) (package-full-name package) diff --git a/tests/lint.scm b/tests/lint.scm index 4f0196491d..9bc42990ef 100644 --- a/tests/lint.scm +++ b/tests/lint.scm @@ -138,6 +138,14 @@ requests." (define-syntax-rule (with-warnings body ...) (call-with-warnings (lambda () body ...))) +(test-assert "description: not a string" + (->bool + (string-contains (with-warnings + (let ((pkg (dummy-package "x" + (description 'foobar)))) + (check-description-style pkg))) + "invalid description"))) + (test-assert "description: not empty" (->bool (string-contains (with-warnings @@ -191,6 +199,14 @@ requests." "E.g. Foo, i.e. Bar resp. Baz (a.k.a. DVD).")))) (check-description-style pkg))))) +(test-assert "synopsis: not a string" + (->bool + (string-contains (with-warnings + (let ((pkg (dummy-package "x" + (synopsis #f)))) + (check-synopsis-style pkg))) + "invalid synopsis"))) + (test-assert "synopsis: not empty" (->bool (string-contains (with-warnings -- cgit v1.2.3 From a17417a812614eee2a7e39155712d7efe814f559 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 27 Apr 2016 23:33:17 +0200 Subject: challenge: Use exit code 2 when discrepancies are found. Suggested by John Darrington . * guix/scripts/challenge.scm (guix-challenge): Exit with 2 when MISSING is not empty. * doc/guix.texi (Invoking guix challenge): Document it. --- doc/guix.texi | 3 ++- guix/scripts/challenge.scm | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'guix') diff --git a/doc/guix.texi b/doc/guix.texi index 6d64772262..0d72574619 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -5609,7 +5609,8 @@ guix challenge @var{options} [@var{packages}@dots{}] When a difference is found between the hash of a locally-built item and that of a server-provided substitute, or among substitutes provided by different servers, the command displays it as in the example above and -exits with a non-zero return code. +its exit code is 2 (other non-zero exit codes denote other kinds of +errors.) The one option that matters is: diff --git a/guix/scripts/challenge.scm b/guix/scripts/challenge.scm index 0eb49da0cc..149647cfdf 100644 --- a/guix/scripts/challenge.scm +++ b/guix/scripts/challenge.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2015 Ludovic Courtès +;;; Copyright © 2015, 2016 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -237,7 +237,7 @@ Challenge the substitutes for PACKAGE... provided by one or more servers.\n")) (issues (discrepancies items urls))) (for-each summarize-discrepancy issues) (unless (null? issues) - (exit 1)) + (exit 2)) (return (null? issues))) #:system system))))))) -- cgit v1.2.3 From 5c6a062d48e36d6f086c0308d57c65df87b3c518 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 28 Apr 2016 17:48:47 +0200 Subject: lint: 'check-vulnerabilities' follows package replacements. * guix/scripts/lint.scm (check-vulnerabilities): Check the replacement of PACKAGE. * tests/lint.scm ("cve: patched vulnerability in replacement"): New test. --- guix/scripts/lint.scm | 3 ++- tests/lint.scm | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) (limited to 'guix') diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm index a8023a5b1e..c581586ac3 100644 --- a/guix/scripts/lint.scm +++ b/guix/scripts/lint.scm @@ -644,7 +644,8 @@ from ~s: ~a (~s)~%") (() #t) ((vulnerabilities ...) - (let* ((patches (filter-map patch-file-name + (let* ((package (or (package-replacement package) package)) + (patches (filter-map patch-file-name (or (and=> (package-source package) origin-patches) '()))) diff --git a/tests/lint.scm b/tests/lint.scm index 9bc42990ef..1f1b0c95e9 100644 --- a/tests/lint.scm +++ b/tests/lint.scm @@ -559,6 +559,25 @@ requests." (patches (list "/a/b/pi-CVE-2015-1234.patch")))))))))) +(test-assert "cve: patched vulnerability in replacement" + (mock ((guix scripts lint) package-vulnerabilities + (lambda (package) + (list (make-struct (@@ (guix cve) ) 0 + "CVE-2015-1234" + (list (cons (package-name package) + (package-version package))))))) + (string-null? + (with-warnings + (check-vulnerabilities + (dummy-package + "pi" (version "3.14") (source (dummy-origin)) + (replacement (dummy-package + "pi" (version "3.14") + (source + (dummy-origin + (patches + (list "/a/b/pi-CVE-2015-1234.patch")))))))))))) + (test-assert "formatting: lonely parentheses" (string-contains (with-warnings -- cgit v1.2.3 From 4c0416ae1709e08c311d32af4823fac9d73364ee Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 28 Apr 2016 23:04:52 +0200 Subject: guix system: Reduce size of image produced for 'vm' action. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reduces the size of the image produced by 'guix system vm' from 26 MiB to 9 MiB. * gnu/system/vm.scm (system-qemu-image/shared-store): (system-qemu-image/shared-store-script): Change the default value of #:disk-image-size to 30 MiB when not FULL-BOOT?. * guix/scripts/system.scm (system-derivation-for-action): Likewise for the 'vm' action. --- gnu/system/vm.scm | 4 ++-- guix/scripts/system.scm | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'guix') diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm index 58a476a468..2fbef6a3fc 100644 --- a/gnu/system/vm.scm +++ b/gnu/system/vm.scm @@ -425,7 +425,7 @@ environment with the store shared with the host. MAPPINGS is a list of os #:key full-boot? - (disk-image-size (* (if full-boot? 500 15) (expt 2 20)))) + (disk-image-size (* (if full-boot? 500 30) (expt 2 20)))) "Return a derivation that builds a QEMU image of OS that shares its store with the host. @@ -480,7 +480,7 @@ with '-virtfs' options for the host file systems listed in SHARED-FS." (mappings '()) full-boot? (disk-image-size - (* (if full-boot? 500 15) + (* (if full-boot? 500 30) (expt 2 20)))) "Return a derivation that builds a script to run a virtual machine image of OS that shares its store with the host. diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index 566e7e8768..e5d754a6fa 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -477,7 +477,10 @@ PATTERN, a string. When PATTERN is #f, display all the system generations." ((vm) (system-qemu-image/shared-store-script os #:full-boot? full-boot? - #:disk-image-size image-size + #:disk-image-size + (if full-boot? + image-size + (* 30 (expt 2 20))) #:mappings mappings)) ((disk-image) (system-disk-image os #:disk-image-size image-size)))) -- cgit v1.2.3 From 200dac065492691b4291d5d382f38e2391155091 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 30 Apr 2016 23:30:56 +0200 Subject: syscalls: statfs: Add missing 'mount-flags' field of 'struct statfs'. * guix/build/syscalls.scm ()[mount-flags]: New field. [spare2]: Remove. (%statfs): Likewise. --- guix/build/syscalls.scm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'guix') diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm index 6cdf65304d..a85f865180 100644 --- a/guix/build/syscalls.scm +++ b/guix/build/syscalls.scm @@ -59,6 +59,7 @@ file-system-identifier file-system-maximum-name-length file-system-fragment-size + file-system-mount-flags statfs processes @@ -475,8 +476,7 @@ string TMPL and return its file name. TMPL must end with 'XXXXXX'." (define-record-type (file-system type block-size blocks blocks-free blocks-available files free-files identifier - name-length fragment-size - spare0 spare1 spare2) + name-length fragment-size mount-flags spare0 spare1) file-system? (type file-system-type) (block-size file-system-block-size) @@ -488,14 +488,14 @@ string TMPL and return its file name. TMPL must end with 'XXXXXX'." (identifier file-system-identifier) (name-length file-system-maximum-name-length) (fragment-size file-system-fragment-size) + (mount-flags file-system-mount-flags) (spare0 file-system--spare0) - (spare1 file-system--spare1) - (spare2 file-system--spare2)) + (spare1 file-system--spare1)) (define-syntax fsword ;fsword_t (identifier-syntax long)) -(define-c-struct %statfs +(define-c-struct %statfs ; sizeof-statfs ;slightly overestimated file-system read-statfs @@ -510,9 +510,9 @@ string TMPL and return its file name. TMPL must end with 'XXXXXX'." (identifier uint64) ;really "int[2]" (name-length fsword) (fragment-size fsword) + (mount-flags fsword) (spare0 int128) ;really "fsword[4]" - (spare1 int128) - (spare2 int64)) ;XXX: to match array alignment + (spare1 int128)) (define statfs (let ((proc (syscall->procedure int "statfs" '(* *)))) -- cgit v1.2.3 From 96f2a432bf94c531c4492a46b36fa4836d00a79b Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 30 Apr 2016 23:32:25 +0200 Subject: syscalls: 'statfs' explicitly binds 'statfs64'. * guix/build/syscalls.scm (statfs): Explicitly bind "statfs64". --- guix/build/syscalls.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'guix') diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm index a85f865180..ed7942c10a 100644 --- a/guix/build/syscalls.scm +++ b/guix/build/syscalls.scm @@ -515,7 +515,7 @@ string TMPL and return its file name. TMPL must end with 'XXXXXX'." (spare1 int128)) (define statfs - (let ((proc (syscall->procedure int "statfs" '(* *)))) + (let ((proc (syscall->procedure int "statfs64" '(* *)))) (lambda (file) "Return a data structure describing the file system mounted at FILE." @@ -523,7 +523,7 @@ mounted at FILE." (ret (proc (string->pointer file) (bytevector->pointer stat))) (err (errno))) (if (zero? ret) - (read-statfs stat 0) + (read-statfs stat) (throw 'system-error "statfs" "~A: ~A" (list file (strerror err)) (list err))))))) -- cgit v1.2.3 From 00cd41974e9579eccedb948d5eebed442efb600e Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 1 May 2016 21:38:53 +0200 Subject: syscalls: Implement arrays in 'define-c-struct' and use it. * guix/build/syscalls.scm (sizeof*, alignof*, write-type, read-type): Add support for (array ...) forms. * guix/build/syscalls.scm ()[spare0, spare1]: Remove. [spare]: New field. * guix/build/syscalls.scm (%statfs)[identifier]: Change to (array int 2). [spare0, spare1]: Remove. [spare]: New field. --- guix/build/syscalls.scm | 37 +++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) (limited to 'guix') diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm index ed7942c10a..721c590f69 100644 --- a/guix/build/syscalls.scm +++ b/guix/build/syscalls.scm @@ -123,9 +123,11 @@ (define-syntax sizeof* ;; XXX: This duplicates 'compile-time-value'. - (syntax-rules (int128) + (syntax-rules (int128 array) ((_ int128) 16) + ((_ (array type n)) + (* (sizeof* type) n)) ((_ type) (let-syntax ((v (lambda (s) (let ((val (sizeof type))) @@ -135,9 +137,11 @@ (define-syntax alignof* ;; XXX: This duplicates 'compile-time-value'. - (syntax-rules (int128) + (syntax-rules (int128 array) ((_ int128) 16) + ((_ (array type n)) + (alignof* type)) ((_ type) (let-syntax ((v (lambda (s) (let ((val (alignof type))) @@ -182,10 +186,19 @@ result is the alignment of the \"most strictly aligned component\"." types ...)))) (define-syntax write-type - (syntax-rules (~) + (syntax-rules (~ array) ((_ bv offset (type ~ order) value) (bytevector-uint-set! bv offset value (endianness order) (sizeof* type))) + ((_ bv offset (array type n) value) + (let loop ((i 0) + (value value) + (o offset)) + (unless (= i n) + (match value + ((head . tail) + (write-type bv o type head) + (loop (+ 1 i) tail (+ o (sizeof* type)))))))) ((_ bv offset type value) (bytevector-uint-set! bv offset value (native-endianness) (sizeof* type))))) @@ -202,7 +215,7 @@ result is the alignment of the \"most strictly aligned component\"." (types ...) (fields ...)))))) (define-syntax read-type - (syntax-rules (~ quote *) + (syntax-rules (~ array quote *) ((_ bv offset '*) (make-pointer (bytevector-uint-ref bv offset (native-endianness) @@ -210,6 +223,12 @@ result is the alignment of the \"most strictly aligned component\"." ((_ bv offset (type ~ order)) (bytevector-uint-ref bv offset (endianness order) (sizeof* type))) + ((_ bv offset (array type n)) + (unfold (lambda (i) (= i n)) + (lambda (i) + (read-type bv (+ offset (* i (sizeof* type))) type)) + 1+ + 0)) ((_ bv offset type) (bytevector-uint-ref bv offset (native-endianness) (sizeof* type))))) @@ -476,7 +495,7 @@ string TMPL and return its file name. TMPL must end with 'XXXXXX'." (define-record-type (file-system type block-size blocks blocks-free blocks-available files free-files identifier - name-length fragment-size mount-flags spare0 spare1) + name-length fragment-size mount-flags spare) file-system? (type file-system-type) (block-size file-system-block-size) @@ -489,8 +508,7 @@ string TMPL and return its file name. TMPL must end with 'XXXXXX'." (name-length file-system-maximum-name-length) (fragment-size file-system-fragment-size) (mount-flags file-system-mount-flags) - (spare0 file-system--spare0) - (spare1 file-system--spare1)) + (spare file-system--spare)) (define-syntax fsword ;fsword_t (identifier-syntax long)) @@ -507,12 +525,11 @@ string TMPL and return its file name. TMPL must end with 'XXXXXX'." (blocks-available uint64) (files uint64) (free-files uint64) - (identifier uint64) ;really "int[2]" + (identifier (array int 2)) (name-length fsword) (fragment-size fsword) (mount-flags fsword) - (spare0 int128) ;really "fsword[4]" - (spare1 int128)) + (spare (array fsword 4))) (define statfs (let ((proc (syscall->procedure int "statfs64" '(* *)))) -- cgit v1.2.3 From ae4ff9f359514937878cf82f4ac46dd14aac9056 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 1 May 2016 23:59:05 +0200 Subject: syscalls: Add 'tcgetattr' and 'tcsetattr' bindings. * guix/build/syscalls.scm (bits->symbols-body, define-bits) (local-flags): New macros. (TCSANOW, TCSADRAIN, TCSAFLUSH): New variables. (): New record type. (%termios): New C structure. (tcgetattr, tcsetattr): New procedures. * tests/syscalls.scm ("tcgetattr ENOTTY", "tcgetattr") ("tcsetattr"): New tests. --- guix/build/syscalls.scm | 131 ++++++++++++++++++++++++++++++++++++++++++++++++ tests/syscalls.scm | 25 +++++++++ 2 files changed, 156 insertions(+) (limited to 'guix') diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm index 721c590f69..4e543d70d8 100644 --- a/guix/build/syscalls.scm +++ b/guix/build/syscalls.scm @@ -100,6 +100,22 @@ interface-broadcast-address network-interfaces + termios? + termios-input-flags + termios-output-flags + termios-control-flags + termios-local-flags + termios-line-discipline + termios-control-chars + termios-input-speed + termios-output-speed + local-flags + TCSANOW + TCSADRAIN + TCSAFLUSH + tcgetattr + tcsetattr + window-size? window-size-rows window-size-columns @@ -996,6 +1012,121 @@ network interface. This is implemented using the 'getifaddrs' libc function." ;;; Terminals. ;;; +(define-syntax bits->symbols-body + (syntax-rules () + ((_ bits () ()) + '()) + ((_ bits (name names ...) (value values ...)) + (let ((result (bits->symbols-body bits (names ...) (values ...)))) + (if (zero? (logand bits value)) + result + (cons 'name result)))))) + +(define-syntax define-bits + (syntax-rules (define) + "Define the given numerical constants under CONSTRUCTOR, such that + (CONSTRUCTOR NAME) returns VALUE. Define BITS->SYMBOLS as a procedure that, +given an integer, returns the list of names of the constants that are or'd." + ((_ constructor bits->symbols (define names values) ...) + (begin + (define-syntax constructor + (syntax-rules (names ...) + ((_ names) values) ... + ((_ several (... ...)) + (logior (constructor several) (... ...))))) + (define (bits->symbols bits) + (bits->symbols-body bits (names ...) (values ...))) + (define names values) ...)))) + +;; 'local-flags' bits from +(define-bits local-flags + local-flags->symbols + (define ISIG #o0000001) + (define ICANON #o0000002) + (define XCASE #o0000004) + (define ECHO #o0000010) + (define ECHOE #o0000020) + (define ECHOK #o0000040) + (define ECHONL #o0000100) + (define NOFLSH #o0000200) + (define TOSTOP #o0000400) + (define ECHOCTL #o0001000) + (define ECHOPRT #o0002000) + (define ECHOKE #o0004000) + (define FLUSHO #o0010000) + (define PENDIN #o0040000) + (define IEXTEN #o0100000) + (define EXTPROC #o0200000)) + +;; "Actions" values for 'tcsetattr'. +(define TCSANOW 0) +(define TCSADRAIN 1) +(define TCSAFLUSH 2) + +(define-record-type + (termios input-flags output-flags control-flags local-flags + line-discipline control-chars + input-speed output-speed) + termios? + (input-flags termios-input-flags) + (output-flags termios-output-flags) + (control-flags termios-control-flags) + (local-flags termios-local-flags) + (line-discipline termios-line-discipline) + (control-chars termios-control-chars) + (input-speed termios-input-speed) + (output-speed termios-output-speed)) + +(define-c-struct %termios ; + sizeof-termios + termios + read-termios + write-termios! + (input-flags unsigned-int) + (output-flags unsigned-int) + (control-flags unsigned-int) + (local-flags unsigned-int) + (line-discipline uint8) + (control-chars (array uint8 32)) + (input-speed unsigned-int) + (output-speed unsigned-int)) + +(define tcgetattr + (let ((proc (syscall->procedure int "tcgetattr" (list int '*)))) + (lambda (fd) + "Return the structure for the tty at FD." + (let* ((bv (make-bytevector sizeof-termios)) + (ret (proc fd (bytevector->pointer bv))) + (err (errno))) + (if (zero? ret) + (read-termios bv) + (throw 'system-error "tcgetattr" "~A" + (list (strerror err)) + (list err))))))) + +(define tcsetattr + (let ((proc (syscall->procedure int "tcsetattr" (list int int '*)))) + (lambda (fd actions termios) + "Use TERMIOS for the tty at FD. ACTIONS is one of 'TCSANOW', +'TCSADRAIN', or 'TCSAFLUSH'; see tcsetattr(3) for details." + (define bv + (make-bytevector sizeof-termios)) + + (let-syntax ((match/write (syntax-rules () + ((_ fields ...) + (match termios + (($ fields ...) + (write-termios! bv 0 fields ...))))))) + (match/write input-flags output-flags control-flags local-flags + line-discipline control-chars input-speed output-speed)) + + (let ((ret (proc fd actions (bytevector->pointer bv))) + (err (errno))) + (unless (zero? ret) + (throw 'system-error "tcgetattr" "~A" + (list (strerror err)) + (list err))))))) + (define-syntax TIOCGWINSZ ; (identifier-syntax #x5413)) diff --git a/tests/syscalls.scm b/tests/syscalls.scm index 71bcbc4d32..ab1e13984d 100644 --- a/tests/syscalls.scm +++ b/tests/syscalls.scm @@ -259,6 +259,31 @@ (#f #f) (lo (interface-address lo))))))) +(test-equal "tcgetattr ENOTTY" + ENOTTY + (catch 'system-error + (lambda () + (call-with-input-file "/dev/null" + (lambda (port) + (tcgetattr (fileno port))))) + (compose system-error-errno list))) + +(test-skip (if (and (file-exists? "/proc/self/fd/0") + (string-prefix? "/dev/pts/" (readlink "/proc/self/fd/0"))) + 0 + 2)) + +(test-assert "tcgetattr" + (let ((termios (tcgetattr 0))) + (and (termios? termios) + (> (termios-input-speed termios) 0) + (> (termios-output-speed termios) 0)))) + +(test-assert "tcsetattr" + (let ((first (tcgetattr 0))) + (tcsetattr 0 TCSANOW first) + (equal? first (tcgetattr 0)))) + (test-assert "terminal-window-size ENOTTY" (call-with-input-file "/dev/null" (lambda (port) -- cgit v1.2.3