From 6c4ccf3228dd16e2d53168298b7bcf1a6874d3a8 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 16 Mar 2017 10:18:48 +0100 Subject: gnu: ngs-sdk: Update to 1.3.0. * gnu/packages/bioinformatics.scm (ngs-sdk): Update to 1.3.0. --- gnu/packages/bioinformatics.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm index 3387a2571a..517ea38007 100644 --- a/gnu/packages/bioinformatics.scm +++ b/gnu/packages/bioinformatics.scm @@ -4383,7 +4383,7 @@ Roche 454, Ion Torrent and Pacific BioSciences SMRT.") (define-public ngs-sdk (package (name "ngs-sdk") - (version "1.2.5") + (version "1.3.0") (source (origin (method url-fetch) @@ -4393,7 +4393,7 @@ Roche 454, Ion Torrent and Pacific BioSciences SMRT.") (file-name (string-append name "-" version ".tar.gz")) (sha256 (base32 - "04y1fsmdnb5y86m3gg6f5g9wcscr6r25n7m8mdlcxy0i2q6w6cia")))) + "1wiyf4c6nm2j87pv015cbi0qny5byf3pbvcw3likifz5dl56ag40")))) (build-system gnu-build-system) (arguments `(#:parallel-build? #f ; not supported -- cgit v1.2.3 From 5021f5478795901bdabf49cf68c0dfd7df895dc4 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 16 Mar 2017 10:19:25 +0100 Subject: gnu: ncbi-vdb: Update to 2.8.2. * gnu/packages/bioinformatics.scm (ncbi-vdb): Update to 2.8.2. --- gnu/packages/bioinformatics.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm index 517ea38007..c9f901f32d 100644 --- a/gnu/packages/bioinformatics.scm +++ b/gnu/packages/bioinformatics.scm @@ -4447,7 +4447,7 @@ simultaneously.") (define-public ncbi-vdb (package (name "ncbi-vdb") - (version "2.7.0") + (version "2.8.2") (source (origin (method url-fetch) @@ -4457,7 +4457,7 @@ simultaneously.") (file-name (string-append name "-" version ".tar.gz")) (sha256 (base32 - "0x1cg1x8vy0yjlkp0snc1533zcjhxqzqsaiwqk598n7vvw37n8lf")))) + "1acn4bv81mfl137qnbn9995mjjhwd36pm0b7qli1iw5skrxa9j8m")))) (build-system gnu-build-system) (arguments `(#:parallel-build? #f ; not supported -- cgit v1.2.3 From 701111989e446ef2d2ac2d0d67a1ae78c5e1499a Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 16 Mar 2017 10:20:56 +0100 Subject: gnu: ncbi-vdb: Use modify-phases syntax. * gnu/packages/bioinformatics.scm (ncbi-vdb)[arguments]: Use modify-phases syntax. --- gnu/packages/bioinformatics.scm | 109 ++++++++++++++++++++-------------------- 1 file changed, 54 insertions(+), 55 deletions(-) diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm index c9f901f32d..7238446aaf 100644 --- a/gnu/packages/bioinformatics.scm +++ b/gnu/packages/bioinformatics.scm @@ -4463,61 +4463,60 @@ simultaneously.") `(#:parallel-build? #f ; not supported #:tests? #f ; no "check" target #:phases - (alist-replace - 'configure - (lambda* (#:key inputs outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out"))) - ;; Override include path for libmagic - (substitute* "setup/package.prl" - (("name => 'magic', Include => '/usr/include'") - (string-append "name=> 'magic', Include => '" - (assoc-ref inputs "libmagic") - "/include" "'"))) - - ;; Install kdf5 library (needed by sra-tools) - (substitute* "build/Makefile.install" - (("LIBRARIES_TO_INSTALL =") - "LIBRARIES_TO_INSTALL = kdf5.$(VERSION_LIBX) kdf5.$(VERSION_SHLX)")) - - (substitute* "build/Makefile.env" - (("CFLAGS =" prefix) - (string-append prefix "-msse2 "))) - - ;; The 'configure' script doesn't recognize things like - ;; '--enable-fast-install'. - (zero? (system* - "./configure" - (string-append "--build-prefix=" (getcwd) "/build") - (string-append "--prefix=" (assoc-ref outputs "out")) - (string-append "--debug") - (string-append "--with-xml2-prefix=" - (assoc-ref inputs "libxml2")) - (string-append "--with-ngs-sdk-prefix=" - (assoc-ref inputs "ngs-sdk")) - (string-append "--with-ngs-java-prefix=" - (assoc-ref inputs "java-ngs")) - (string-append "--with-hdf5-prefix=" - (assoc-ref inputs "hdf5")))))) - (alist-cons-after - 'install 'install-interfaces - (lambda* (#:key outputs #:allow-other-keys) - ;; Install interface libraries. On i686 the interface libraries - ;; are installed to "linux/gcc/i386", so we need to use the Linux - ;; architecture name ("i386") instead of the target system prefix - ;; ("i686"). - (mkdir (string-append (assoc-ref outputs "out") "/ilib")) - (copy-recursively (string-append "build/ncbi-vdb/linux/gcc/" - ,(system->linux-architecture - (or (%current-target-system) - (%current-system))) - "/rel/ilib") - (string-append (assoc-ref outputs "out") - "/ilib")) - ;; Install interface headers - (copy-recursively "interfaces" - (string-append (assoc-ref outputs "out") - "/include"))) - %standard-phases)))) + (modify-phases %standard-phases + (replace 'configure + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + ;; Override include path for libmagic + (substitute* "setup/package.prl" + (("name => 'magic', Include => '/usr/include'") + (string-append "name=> 'magic', Include => '" + (assoc-ref inputs "libmagic") + "/include" "'"))) + + ;; Install kdf5 library (needed by sra-tools) + (substitute* "build/Makefile.install" + (("LIBRARIES_TO_INSTALL =") + "LIBRARIES_TO_INSTALL = kdf5.$(VERSION_LIBX) kdf5.$(VERSION_SHLX)")) + + (substitute* "build/Makefile.env" + (("CFLAGS =" prefix) + (string-append prefix "-msse2 "))) + + ;; The 'configure' script doesn't recognize things like + ;; '--enable-fast-install'. + (zero? (system* + "./configure" + (string-append "--build-prefix=" (getcwd) "/build") + (string-append "--prefix=" (assoc-ref outputs "out")) + (string-append "--debug") + (string-append "--with-xml2-prefix=" + (assoc-ref inputs "libxml2")) + (string-append "--with-ngs-sdk-prefix=" + (assoc-ref inputs "ngs-sdk")) + (string-append "--with-ngs-java-prefix=" + (assoc-ref inputs "java-ngs")) + (string-append "--with-hdf5-prefix=" + (assoc-ref inputs "hdf5"))))))) + (add-after 'install 'install-interfaces + (lambda* (#:key outputs #:allow-other-keys) + ;; Install interface libraries. On i686 the interface libraries + ;; are installed to "linux/gcc/i386", so we need to use the Linux + ;; architecture name ("i386") instead of the target system prefix + ;; ("i686"). + (mkdir (string-append (assoc-ref outputs "out") "/ilib")) + (copy-recursively (string-append "build/ncbi-vdb/linux/gcc/" + ,(system->linux-architecture + (or (%current-target-system) + (%current-system))) + "/rel/ilib") + (string-append (assoc-ref outputs "out") + "/ilib")) + ;; Install interface headers + (copy-recursively "interfaces" + (string-append (assoc-ref outputs "out") + "/include")) + #t))))) (inputs `(("libxml2" ,libxml2) ("ngs-sdk" ,ngs-sdk) -- cgit v1.2.3 From 558e23074e258202421e8e675927ec35f35db493 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 16 Mar 2017 13:38:39 +0100 Subject: gnu: ncbi-vdb: Override search path for java-ngs. * gnu/packages/bioinformatics.scm (ncbi-vdb)[arguments]: Patch "package.prl" to ensure that java-ngs is found by the configure script; remove configure flag "--with-ngs-java-prefix". --- gnu/packages/bioinformatics.scm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm index 7238446aaf..eb74da6b28 100644 --- a/gnu/packages/bioinformatics.scm +++ b/gnu/packages/bioinformatics.scm @@ -4483,6 +4483,11 @@ simultaneously.") (("CFLAGS =" prefix) (string-append prefix "-msse2 "))) + ;; Override search path for ngs-java + (substitute* "setup/package.prl" + (("/usr/local/ngs/ngs-java") + (assoc-ref inputs "java-ngs"))) + ;; The 'configure' script doesn't recognize things like ;; '--enable-fast-install'. (zero? (system* @@ -4494,8 +4499,6 @@ simultaneously.") (assoc-ref inputs "libxml2")) (string-append "--with-ngs-sdk-prefix=" (assoc-ref inputs "ngs-sdk")) - (string-append "--with-ngs-java-prefix=" - (assoc-ref inputs "java-ngs")) (string-append "--with-hdf5-prefix=" (assoc-ref inputs "hdf5"))))))) (add-after 'install 'install-interfaces -- cgit v1.2.3 From d5e17162397a260f00be5d437c2405c7dfb52076 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 16 Mar 2017 13:39:53 +0100 Subject: gnu: ncbi-vdb: Install configuration files. * gnu/packages/bioinformatics.scm (ncbi-vdb)[arguments]: Add phase "install-configuration-files". --- gnu/packages/bioinformatics.scm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm index eb74da6b28..220e352ea7 100644 --- a/gnu/packages/bioinformatics.scm +++ b/gnu/packages/bioinformatics.scm @@ -4519,6 +4519,14 @@ simultaneously.") (copy-recursively "interfaces" (string-append (assoc-ref outputs "out") "/include")) + #t)) + ;; These files are needed by sra-tools. + (add-after 'install 'install-configuration-files + (lambda* (#:key outputs #:allow-other-keys) + (let ((target (string-append (assoc-ref outputs "out") "/kfg"))) + (mkdir target) + (install-file "libs/kfg/default.kfg" target) + (install-file "libs/kfg/certs.kfg" target)) #t))))) (inputs `(("libxml2" ,libxml2) -- cgit v1.2.3 From 79849358f86ca9e49298f3c9f3cf2e964e69ecac Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 16 Mar 2017 13:40:36 +0100 Subject: gnu: sra-tools: Update to 2.8.2-1. * gnu/packages/bioinformatics.scm (sra-tools): Update to 2.8.2-1. [arguments]: Add DEFAULT_CRT and DEFAULT_KFG to make flags. --- gnu/packages/bioinformatics.scm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm index 220e352ea7..2a568297ba 100644 --- a/gnu/packages/bioinformatics.scm +++ b/gnu/packages/bioinformatics.scm @@ -4738,7 +4738,7 @@ sequence itself can be retrieved from these databases.") (define-public sra-tools (package (name "sra-tools") - (version "2.7.0") + (version "2.8.2-1") (source (origin (method url-fetch) @@ -4748,13 +4748,19 @@ sequence itself can be retrieved from these databases.") (file-name (string-append name "-" version ".tar.gz")) (sha256 (base32 - "13paw7bq6y47d2pl0ac5gpgcqp1xsy1g7v1fwysm3hr8lb2dck17")))) + "1camsijmvv2s45mb4iyf44ghl4gkd4rl0viphpcgl3ccchy32a0g")))) (build-system gnu-build-system) (arguments `(#:parallel-build? #f ; not supported #:tests? #f ; no "check" target #:make-flags - (list (string-append "VDB_LIBDIR=" + (list (string-append "DEFAULT_CRT=" + (assoc-ref %build-inputs "ncbi-vdb") + "/kfg/certs.kfg") + (string-append "DEFAULT_KFG=" + (assoc-ref %build-inputs "ncbi-vdb") + "/kfg/default.kfg") + (string-append "VDB_LIBDIR=" (assoc-ref %build-inputs "ncbi-vdb") ,(if (string-prefix? "x86_64" (or (%current-target-system) -- cgit v1.2.3 From 2441c284140ddbd354b61c9d1606af1357f95c1f Mon Sep 17 00:00:00 2001 From: Raoul Jean Pierre Bonnal Date: Thu, 19 Jan 2017 19:55:30 +0100 Subject: gnu: Add r-seurat. * gnu/packages/bioinformatics.scm (r-seurat): New variable. Co-authored-by: Ricardo Wurmus --- gnu/packages/bioinformatics.scm | 79 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm index 2a568297ba..077f9b2885 100644 --- a/gnu/packages/bioinformatics.scm +++ b/gnu/packages/bioinformatics.scm @@ -8609,6 +8609,85 @@ contains a number of utilities to explore the MS/MS results and assess missed and irregular enzymatic cleavages, mass measurement accuracy, etc.") (license license:artistic2.0))) +(define-public r-seurat + ;; Source releases are only made for new x.0 versions. All newer versions + ;; are only released as pre-built binaries. At the time of this writing the + ;; latest binary release is 1.4.0.12, which is equivalent to this commit. + (let ((commit "fccb77d1452c35ee47e47ebf8e87bddb59f3b08d") + (revision "1")) + (package + (name "r-seurat") + (version (string-append "1.4.0.12-" revision "." (string-take commit 7))) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/satijalab/seurat") + (commit commit))) + (file-name (string-append name "-" version "-checkout")) + (sha256 + (base32 + "101wq3aqrdmbfi3lqmq4iivk9iwbf10d4z216ss25hf7n9091cyl")) + ;; Delete pre-built jar. + (snippet + '(begin (delete-file "inst/java/ModularityOptimizer.jar") + #t)))) + (build-system r-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after 'unpack 'build-jar + (lambda* (#:key inputs #:allow-other-keys) + (let ((classesdir "tmp-classes")) + (setenv "JAVA_HOME" (assoc-ref inputs "jdk")) + (mkdir classesdir) + (and (zero? (apply system* `("javac" "-d" ,classesdir + ,@(find-files "java" "\\.java$")))) + (zero? (system* "jar" + "-cf" "inst/java/ModularityOptimizer.jar" + "-C" classesdir "."))))))))) + (native-inputs + `(("jdk" ,icedtea "jdk"))) + (propagated-inputs + `(("r-ape" ,r-ape) + ("r-caret" ,r-caret) + ("r-cowplot" ,r-cowplot) + ("r-dplyr" ,r-dplyr) + ("r-fastica" ,r-fastica) + ("r-fnn" ,r-fnn) + ("r-fpc" ,r-fpc) + ("r-gdata" ,r-gdata) + ("r-ggplot2" ,r-ggplot2) + ("r-gplots" ,r-gplots) + ("r-gridextra" ,r-gridextra) + ("r-igraph" ,r-igraph) + ("r-irlba" ,r-irlba) + ("r-lars" ,r-lars) + ("r-mixtools" ,r-mixtools) + ("r-pbapply" ,r-pbapply) + ("r-plyr" ,r-plyr) + ("r-ranger" ,r-ranger) + ("r-rcolorbrewer" ,r-rcolorbrewer) + ("r-rcpp" ,r-rcpp) + ("r-rcppeigen" ,r-rcppeigen) + ("r-rcppprogress" ,r-rcppprogress) + ("r-reshape2" ,r-reshape2) + ("r-rocr" ,r-rocr) + ("r-rtsne" ,r-rtsne) + ("r-stringr" ,r-stringr) + ("r-tclust" ,r-tclust) + ("r-tsne" ,r-tsne) + ("r-vgam" ,r-vgam))) + (home-page "http://www.satijalab.org/seurat") + (synopsis "Seurat is an R toolkit for single cell genomics") + (description + "This package is an R package designed for QC, analysis, and +exploration of single cell RNA-seq data. It easily enables widely-used +analytical techniques, including the identification of highly variable genes, +dimensionality reduction; PCA, ICA, t-SNE, standard unsupervised clustering +algorithms; density clustering, hierarchical clustering, k-means, and the +discovery of differentially expressed genes and markers.") + (license license:gpl3)))) + (define htslib-for-sambamba (let ((commit "2f3c3ea7b301f9b45737a793c0b2dcf0240e5ee5")) (package -- cgit v1.2.3 From 2c715a922324e0cd1ab50c5ea0b70f12a33565d5 Mon Sep 17 00:00:00 2001 From: Clément Lassieur Date: Wed, 15 Mar 2017 23:49:32 +0100 Subject: gnu: password-store: Fix compatibility with GnuPG 2.1.19. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/patches/password-store-gnupg-compat.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/password-utils.scm (password-store)[source]: Use it. Signed-off-by: Clément Lassieur --- gnu/local.mk | 2 + gnu/packages/password-utils.scm | 4 +- .../patches/password-store-gnupg-compat.patch | 53 ++++++++++++++++++++++ 3 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/password-store-gnupg-compat.patch diff --git a/gnu/local.mk b/gnu/local.mk index c1b076a5f3..b3aa79ad90 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -9,6 +9,7 @@ # Copyright © 2016 Adonay "adfeno" Felipe Nogueira # Copyright © 2016, 2017 Ricardo Wurmus # Copyright © 2016 Ben Woodcroft +# Copyright © 2017 Clément Lassieur # # This file is part of GNU Guix. # @@ -806,6 +807,7 @@ dist_patch_DATA = \ %D%/packages/patches/ots-no-include-missing-file.patch \ %D%/packages/patches/p7zip-CVE-2016-9296.patch \ %D%/packages/patches/p7zip-remove-unused-code.patch \ + %D%/packages/patches/password-store-gnupg-compat.patch \ %D%/packages/patches/patchelf-page-size.patch \ %D%/packages/patches/patchelf-rework-for-arm.patch \ %D%/packages/patches/patchutils-xfail-gendiff-tests.patch \ diff --git a/gnu/packages/password-utils.scm b/gnu/packages/password-utils.scm index 811173cae4..3f125a0119 100644 --- a/gnu/packages/password-utils.scm +++ b/gnu/packages/password-utils.scm @@ -8,6 +8,7 @@ ;;; Copyright © 2016 Lukas Gradl ;;; Copyright © 2016 Alex Griffin ;;; Copyright © 2017 Leo Famulari +;;; Copyright © 2017 Clément Lassieur ;;; ;;; This file is part of GNU Guix. ;;; @@ -291,7 +292,8 @@ any X11 window.") name "-" version ".tar.xz")) (sha256 (base32 - "002mw7j0m33bw483rllzhcf41wp3ixka8yma6kqrfaj57jyw66hn")))) + "002mw7j0m33bw483rllzhcf41wp3ixka8yma6kqrfaj57jyw66hn")) + (patches (search-patches "password-store-gnupg-compat.patch")))) (build-system gnu-build-system) (arguments '(#:phases diff --git a/gnu/packages/patches/password-store-gnupg-compat.patch b/gnu/packages/patches/password-store-gnupg-compat.patch new file mode 100644 index 0000000000..c314ba6647 --- /dev/null +++ b/gnu/packages/patches/password-store-gnupg-compat.patch @@ -0,0 +1,53 @@ +Copied from upstream mailing list: +https://lists.zx2c4.com/pipermail/password-store/2017-March/002844.html. + +The patch actually restores compatibility with GnuPG 2.1.19, the '2.2.19' in +the commit message is a typo. + +From 8723d8e8192683891904aff321446b0fac37d1ad Mon Sep 17 00:00:00 2001 +From: Andreas Stieger +Date: Fri, 10 Mar 2017 15:43:26 +0100 +Subject: [PATCH] Fix compatibility with GnuPG 2.2.19 + +GnuPG 2.2.19 added a warning when no command was given. + +* src/password-store.sh (reencrypt_path): Add --decrypt to --list-only +* tests/t0300-reencryption.sh (gpg_keys_from_encrypted_file): same + +https://bugs.gnupg.org/gnupg/msg9873 +http://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg.git;a=commit;h=810adfd47801fc01e45fb71af9f05c91f7890cdb +https://bugzilla.suse.com/show_bug.cgi?id=1028867 +--- + src/password-store.sh | 2 +- + tests/t0300-reencryption.sh | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/password-store.sh b/src/password-store.sh +index 1ab6fb5..bad8d4f 100755 +--- a/src/password-store.sh ++++ b/src/password-store.sh +@@ -125,7 +125,7 @@ reencrypt_path() { + done + gpg_keys="$($GPG $PASSWORD_STORE_GPG_OPTS --list-keys --with-colons "${GPG_RECIPIENTS[@]}" | sed -n 's/sub:[^:]*:[^:]*:[^:]*:\([^:]*\):[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[a-zA-Z]*e[a-zA-Z]*:.*/\1/p' | LC_ALL=C sort -u)" + fi +- current_keys="$($GPG $PASSWORD_STORE_GPG_OPTS -v --no-secmem-warning --no-permission-warning --list-only --keyid-format long "$passfile" 2>&1 | cut -d ' ' -f 5 | LC_ALL=C sort -u)" ++ current_keys="$($GPG $PASSWORD_STORE_GPG_OPTS -v --no-secmem-warning --no-permission-warning --decrypt --list-only --keyid-format long "$passfile" 2>&1 | cut -d ' ' -f 5 | LC_ALL=C sort -u)" + + if [[ $gpg_keys != "$current_keys" ]]; then + echo "$passfile_display: reencrypting to ${gpg_keys//$'\n'/ }" +diff --git a/tests/t0300-reencryption.sh b/tests/t0300-reencryption.sh +index 9d46580..6d5811d 100755 +--- a/tests/t0300-reencryption.sh ++++ b/tests/t0300-reencryption.sh +@@ -10,7 +10,7 @@ canonicalize_gpg_keys() { + $GPG --list-keys --with-colons "$@" | sed -n 's/sub:[^:]*:[^:]*:[^:]*:\([^:]*\):[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[a-zA-Z]*e[a-zA-Z]*:.*/\1/p' | LC_ALL=C sort -u + } + gpg_keys_from_encrypted_file() { +- $GPG -v --no-secmem-warning --no-permission-warning --list-only --keyid-format long "$1" 2>&1 | cut -d ' ' -f 5 | LC_ALL=C sort -u ++ $GPG -v --no-secmem-warning --no-permission-warning --decrypt --list-only --keyid-format long "$1" 2>&1 | cut -d ' ' -f 5 | LC_ALL=C sort -u + } + gpg_keys_from_group() { + local output="$($GPG --list-config --with-colons | sed -n "s/^cfg:group:$1:\\(.*\\)/\\1/p" | head -n 1)" +-- +2.12.0 + -- cgit v1.2.3 From 4c0c4db0702048488a9712dbba7cad862c667d54 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 15 Mar 2017 21:54:34 +0100 Subject: utils: Move base16 procedures to (guix base16). * guix/utils.scm (bytevector->base16-string, base16-string->bytevector): Move to... * guix/base16.scm: ... here. New file. * tests/utils.scm ("bytevector->base16-string->bytevector"): Move to... * tests/base16.scm: ... here. New file. * Makefile.am (MODULES): Add guix/base16.scm. (SCM_TESTS): Add tests/base16.scm. * build-aux/download.scm, guix/derivations.scm, guix/docker.scm, guix/import/snix.scm, guix/pk-crypto.scm, guix/scripts/authenticate.scm, guix/scripts/download.scm, guix/scripts/hash.scm, guix/store.scm, tests/hash.scm, tests/pk-crypto.scm: Adjust imports accordingly. --- Makefile.am | 2 ++ build-aux/download.scm | 4 +-- guix/base16.scm | 83 +++++++++++++++++++++++++++++++++++++++++++ guix/derivations.scm | 1 + guix/docker.scm | 1 + guix/import/snix.scm | 3 +- guix/pk-crypto.scm | 6 ++-- guix/scripts/authenticate.scm | 4 +-- guix/scripts/download.scm | 4 +-- guix/scripts/hash.scm | 2 +- guix/store.scm | 1 + guix/utils.scm | 65 +-------------------------------- tests/base16.scm | 34 ++++++++++++++++++ tests/hash.scm | 2 +- tests/pk-crypto.scm | 3 +- tests/utils.scm | 9 +---- 16 files changed, 138 insertions(+), 86 deletions(-) create mode 100644 guix/base16.scm create mode 100644 tests/base16.scm diff --git a/Makefile.am b/Makefile.am index dea70de00f..ff37a46355 100644 --- a/Makefile.am +++ b/Makefile.am @@ -30,6 +30,7 @@ nodist_noinst_SCRIPTS = \ include gnu/local.mk MODULES = \ + guix/base16.scm \ guix/base32.scm \ guix/base64.scm \ guix/cpio.scm \ @@ -251,6 +252,7 @@ TEST_EXTENSIONS = .scm .sh if CAN_RUN_TESTS SCM_TESTS = \ + tests/base16.scm \ tests/base32.scm \ tests/base64.scm \ tests/cpio.scm \ diff --git a/build-aux/download.scm b/build-aux/download.scm index 1e91e4b87c..8f41f33b14 100644 --- a/build-aux/download.scm +++ b/build-aux/download.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013 Ludovic Courtès +;;; Copyright © 2012, 2013, 2017 Ludovic Courtès ;;; Copyright © 2014, 2015 Mark H Weaver ;;; ;;; This file is part of GNU Guix. @@ -26,7 +26,7 @@ (web client) (rnrs io ports) (srfi srfi-11) - (guix utils) + (guix base16) (guix hash)) (define %url-base diff --git a/guix/base16.scm b/guix/base16.scm new file mode 100644 index 0000000000..6c15a9f588 --- /dev/null +++ b/guix/base16.scm @@ -0,0 +1,83 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2012, 2014, 2017 Ludovic Courtès +;;; +;;; 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 . + +(define-module (guix base16) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26) + #:use-module (srfi srfi-60) + #:use-module (rnrs bytevectors) + #:use-module (ice-9 vlist) + #:use-module (ice-9 format) + #:export (bytevector->base16-string + base16-string->bytevector)) + +;;; +;;; Base 16. +;;; + +(define (bytevector->base16-string bv) + "Return the hexadecimal representation of BV's contents." + (define len + (bytevector-length bv)) + + (let-syntax ((base16-chars (lambda (s) + (syntax-case s () + (_ + (let ((v (list->vector + (unfold (cut > <> 255) + (lambda (n) + (format #f "~2,'0x" n)) + 1+ + 0)))) + v)))))) + (define chars base16-chars) + (let loop ((i len) + (r '())) + (if (zero? i) + (string-concatenate r) + (let ((i (- i 1))) + (loop i + (cons (vector-ref chars (bytevector-u8-ref bv i)) r))))))) + +(define base16-string->bytevector + (let ((chars->value (fold (lambda (i r) + (vhash-consv (string-ref (number->string i 16) + 0) + i r)) + vlist-null + (iota 16)))) + (lambda (s) + "Return the bytevector whose hexadecimal representation is string S." + (define bv + (make-bytevector (quotient (string-length s) 2) 0)) + + (string-fold (lambda (chr i) + (let ((j (quotient i 2)) + (v (and=> (vhash-assv chr chars->value) cdr))) + (if v + (if (zero? (logand i 1)) + (bytevector-u8-set! bv j + (arithmetic-shift v 4)) + (let ((w (bytevector-u8-ref bv j))) + (bytevector-u8-set! bv j (logior v w)))) + (error "invalid hexadecimal character" chr))) + (+ i 1)) + 0 + s) + bv))) + diff --git a/guix/derivations.scm b/guix/derivations.scm index 47a783f42f..e02d1ee036 100644 --- a/guix/derivations.scm +++ b/guix/derivations.scm @@ -31,6 +31,7 @@ #:use-module (ice-9 vlist) #:use-module (guix store) #:use-module (guix utils) + #:use-module (guix base16) #:use-module (guix memoization) #:use-module (guix combinators) #:use-module (guix monads) diff --git a/guix/docker.scm b/guix/docker.scm index dbe1e5351c..6dabaf25b0 100644 --- a/guix/docker.scm +++ b/guix/docker.scm @@ -19,6 +19,7 @@ (define-module (guix docker) #:use-module (guix hash) #:use-module (guix store) + #:use-module (guix base16) #:use-module (guix utils) #:use-module ((guix build utils) #:select (delete-file-recursively diff --git a/guix/import/snix.scm b/guix/import/snix.scm index bc75cbfda5..778768ff2d 100644 --- a/guix/import/snix.scm +++ b/guix/import/snix.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Ludovic Courtès +;;; Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -39,6 +39,7 @@ #:use-module ((guix build utils) #:select (package-name->name+version)) #:use-module (guix import utils) + #:use-module (guix base16) #:use-module (guix base32) #:use-module (guix config) #:use-module (guix gnu-maintenance) diff --git a/guix/pk-crypto.scm b/guix/pk-crypto.scm index f90c2e61d5..7017006a71 100644 --- a/guix/pk-crypto.scm +++ b/guix/pk-crypto.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014, 2015 Ludovic Courtès +;;; Copyright © 2013, 2014, 2015, 2017 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -17,9 +17,7 @@ ;;; along with GNU Guix. If not, see . (define-module (guix pk-crypto) - #:use-module ((guix utils) - #:select (bytevector->base16-string - base16-string->bytevector)) + #:use-module (guix base16) #:use-module (guix gcrypt) #:use-module (system foreign) diff --git a/guix/scripts/authenticate.scm b/guix/scripts/authenticate.scm index d9f799df26..d9a312f1da 100644 --- a/guix/scripts/authenticate.scm +++ b/guix/scripts/authenticate.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014, 2015, 2016 Ludovic Courtès +;;; Copyright © 2013, 2014, 2015, 2016, 2017 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -18,7 +18,7 @@ (define-module (guix scripts authenticate) #:use-module (guix config) - #:use-module (guix utils) + #:use-module (guix base16) #:use-module (guix pk-crypto) #:use-module (guix pki) #:use-module (guix ui) diff --git a/guix/scripts/download.scm b/guix/scripts/download.scm index dffff79729..1ddfd648cd 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, 2016 Ludovic Courtès +;;; Copyright © 2012, 2013, 2015, 2016, 2017 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -21,7 +21,7 @@ #:use-module (guix scripts) #:use-module (guix store) #:use-module (guix hash) - #:use-module (guix utils) + #:use-module (guix base16) #:use-module (guix base32) #:use-module ((guix download) #:hide (url-fetch)) #:use-module ((guix build download) diff --git a/guix/scripts/hash.scm b/guix/scripts/hash.scm index 640b2417d2..a048b53461 100644 --- a/guix/scripts/hash.scm +++ b/guix/scripts/hash.scm @@ -24,7 +24,7 @@ #:use-module (guix serialization) #:use-module (guix ui) #:use-module (guix scripts) - #:use-module (guix utils) + #:use-module (guix base16) #:use-module (ice-9 binary-ports) #:use-module (rnrs files) #:use-module (ice-9 match) diff --git a/guix/store.scm b/guix/store.scm index cce460f3ce..2f05351767 100644 --- a/guix/store.scm +++ b/guix/store.scm @@ -22,6 +22,7 @@ #:use-module (guix memoization) #:use-module (guix serialization) #:use-module (guix monads) + #:use-module (guix base16) #:autoload (guix base32) (bytevector->base32-string) #:autoload (guix build syscalls) (terminal-columns) #:use-module (rnrs bytevectors) diff --git a/guix/utils.scm b/guix/utils.scm index b72e3f233f..bc90686de0 100644 --- a/guix/utils.scm +++ b/guix/utils.scm @@ -28,15 +28,12 @@ #:use-module (srfi srfi-11) #:use-module (srfi srfi-26) #:use-module (srfi srfi-39) - #:use-module (srfi srfi-60) - #:use-module (rnrs bytevectors) #:use-module (ice-9 binary-ports) #:autoload (rnrs io ports) (make-custom-binary-input-port) #:use-module ((rnrs bytevectors) #:select (bytevector-u8-set!)) #:use-module (guix memoization) #:use-module ((guix build utils) #:select (dump-port)) #:use-module ((guix build syscalls) #:select (mkdtemp! fdatasync)) - #:use-module (ice-9 vlist) #:use-module (ice-9 format) #:autoload (ice-9 popen) (open-pipe*) #:autoload (ice-9 rdelim) (read-line) @@ -46,10 +43,7 @@ #:use-module ((ice-9 iconv) #:prefix iconv:) #:use-module (system foreign) #:re-export (memoize) ; for backwards compatibility - #:export (bytevector->base16-string - base16-string->bytevector - - strip-keyword-arguments + #:export (strip-keyword-arguments default-keyword-arguments substitute-keyword-arguments ensure-keyword-arguments @@ -98,63 +92,6 @@ call-with-compressed-output-port canonical-newline-port)) - -;;; -;;; Base 16. -;;; - -(define (bytevector->base16-string bv) - "Return the hexadecimal representation of BV's contents." - (define len - (bytevector-length bv)) - - (let-syntax ((base16-chars (lambda (s) - (syntax-case s () - (_ - (let ((v (list->vector - (unfold (cut > <> 255) - (lambda (n) - (format #f "~2,'0x" n)) - 1+ - 0)))) - v)))))) - (define chars base16-chars) - (let loop ((i len) - (r '())) - (if (zero? i) - (string-concatenate r) - (let ((i (- i 1))) - (loop i - (cons (vector-ref chars (bytevector-u8-ref bv i)) r))))))) - -(define base16-string->bytevector - (let ((chars->value (fold (lambda (i r) - (vhash-consv (string-ref (number->string i 16) - 0) - i r)) - vlist-null - (iota 16)))) - (lambda (s) - "Return the bytevector whose hexadecimal representation is string S." - (define bv - (make-bytevector (quotient (string-length s) 2) 0)) - - (string-fold (lambda (chr i) - (let ((j (quotient i 2)) - (v (and=> (vhash-assv chr chars->value) cdr))) - (if v - (if (zero? (logand i 1)) - (bytevector-u8-set! bv j - (arithmetic-shift v 4)) - (let ((w (bytevector-u8-ref bv j))) - (bytevector-u8-set! bv j (logior v w)))) - (error "invalid hexadecimal character" chr))) - (+ i 1)) - 0 - s) - bv))) - - ;;; ;;; Filtering & pipes. diff --git a/tests/base16.scm b/tests/base16.scm new file mode 100644 index 0000000000..a64b650bec --- /dev/null +++ b/tests/base16.scm @@ -0,0 +1,34 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2012, 2017 Ludovic Courtès +;;; +;;; 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 . + +(define-module (test-base16) + #:use-module (guix base16) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-64) + #:use-module (rnrs bytevectors)) + +(test-begin "base16") + +(test-assert "bytevector->base16-string->bytevector" + (every (lambda (bv) + (equal? (base16-string->bytevector + (bytevector->base16-string bv)) + bv)) + (map string->utf8 '("" "f" "fo" "foo" "foob" "fooba" "foobar")))) + +(test-end "base16") diff --git a/tests/hash.scm b/tests/hash.scm index 86501dca2d..b189e435c8 100644 --- a/tests/hash.scm +++ b/tests/hash.scm @@ -18,7 +18,7 @@ (define-module (test-hash) #:use-module (guix hash) - #:use-module (guix utils) + #:use-module (guix base16) #:use-module (srfi srfi-1) #:use-module (srfi srfi-11) #:use-module (srfi srfi-64) diff --git a/tests/pk-crypto.scm b/tests/pk-crypto.scm index 5024a15a43..fe33a6f7b5 100644 --- a/tests/pk-crypto.scm +++ b/tests/pk-crypto.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014 Ludovic Courtès +;;; Copyright © 2013, 2014, 2017 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -19,6 +19,7 @@ (define-module (test-pk-crypto) #:use-module (guix pk-crypto) #:use-module (guix utils) + #:use-module (guix base16) #:use-module (guix hash) #:use-module (srfi srfi-1) #:use-module (srfi srfi-11) diff --git a/tests/utils.scm b/tests/utils.scm index bcfaa14faa..035886dd16 100644 --- a/tests/utils.scm +++ b/tests/utils.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès +;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès ;;; Copyright © 2014 Eric Bavier ;;; Copyright © 2016 Mathieu Lirzin ;;; @@ -36,13 +36,6 @@ (test-begin "utils") -(test-assert "bytevector->base16-string->bytevector" - (every (lambda (bv) - (equal? (base16-string->bytevector - (bytevector->base16-string bv)) - bv)) - (map string->utf8 '("" "f" "fo" "foo" "foob" "fooba" "foobar")))) - (test-assert "gnu-triplet->nix-system" (let ((samples '(("i586-gnu0.3" "i686-gnu") ("x86_64-unknown-linux-gnu" "x86_64-linux") -- cgit v1.2.3 From d938a58beefc669ab340aa1aeab49df3dc24d123 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 15 Mar 2017 22:14:36 +0100 Subject: gexp: Add '=>' syntax to import computed modules. * guix/gexp.scm (imported-files)[file-pair]: Add case for pairs where the cdr is not a string. (imported-modules): Support '=>' syntax in MODULES. * tests/gexp.scm ("imported-files with file-like objects") ("gexp->derivation & with-imported-module & computed module"): New tests. * doc/guix.texi (G-Expressions): Document '=>' syntax for 'with-imported-modules'. --- doc/guix.texi | 18 ++++++++++++++++-- guix/gexp.scm | 40 +++++++++++++++++++++++++++++----------- tests/gexp.scm | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 84 insertions(+), 13 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 78bf03de9e..2e70848e55 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -4347,8 +4347,22 @@ of the @code{gexp?} type (see below.) @deffn {Scheme Syntax} with-imported-modules @var{modules} @var{body}@dots{} Mark the gexps defined in @var{body}@dots{} as requiring @var{modules} -in their execution environment. @var{modules} must be a list of Guile -module names, such as @code{'((guix build utils) (guix build gremlin))}. +in their execution environment. + +Each item in @var{modules} can be the name of a module, such as +@code{(guix build utils)}, or it can be a module name, followed by an +arrow, followed by a file-like object: + +@example +`((guix build utils) + (guix gcrypt) + ((guix config) => ,(scheme-file "config.scm" + #~(define-module @dots{})))) +@end example + +@noindent +In the example above, the first two modules are taken from the search +path, and the last one is created from the given file-like object. This form has @emph{lexical} scope: it has an effect on the gexps directly defined in @var{body}@dots{}, but not on those defined, say, in diff --git a/guix/gexp.scm b/guix/gexp.scm index d11ed177fe..1b8e43e994 100644 --- a/guix/gexp.scm +++ b/guix/gexp.scm @@ -912,13 +912,17 @@ environment." (system (%current-system)) (guile (%guile-for-build))) "Return a derivation that imports FILES into STORE. FILES must be a list -of (FINAL-PATH . FILE-NAME) pairs; each FILE-NAME is read from the file -system, imported, and appears under FINAL-PATH in the resulting store path." +of (FINAL-PATH . FILE) pairs. Each FILE is mapped to FINAL-PATH in the +resulting store path. FILE can be either a file name, or a file-like object, +as returned by 'local-file' for example." (define file-pair (match-lambda - ((final-path . file-name) + ((final-path . (? string? file-name)) (mlet %store-monad ((file (interned-file file-name (basename final-path)))) + (return (list final-path file)))) + ((final-path . file-like) + (mlet %store-monad ((file (lower-object file-like system))) (return (list final-path file)))))) (mlet %store-monad ((files (sequence %store-monad @@ -950,14 +954,28 @@ system, imported, and appears under FINAL-PATH in the resulting store path." (guile (%guile-for-build)) (module-path %load-path)) "Return a derivation that contains the source files of MODULES, a list of -module names such as `(ice-9 q)'. All of MODULES must be in the MODULE-PATH -search path." - ;; TODO: Determine the closure of MODULES, build the `.go' files, - ;; canonicalize the source files through read/write, etc. - (let ((files (map (lambda (m) - (let ((f (module->source-file-name m))) - (cons f (search-path* module-path f)))) - modules))) +module names such as `(ice-9 q)'. All of MODULES must be either names of +modules to be found in the MODULE-PATH search path, or a module name followed +by an arrow followed by a file-like object. For example: + + (imported-modules `((guix build utils) + (guix gcrypt) + ((guix config) => ,(scheme-file …)))) + +In this example, the first two modules are taken from MODULE-PATH, and the +last one is created from the given object." + (mlet %store-monad ((files + (mapm %store-monad + (match-lambda + (((module ...) '=> file) + (return + (cons (module->source-file-name module) + file))) + ((module ...) + (let ((f (module->source-file-name module))) + (return + (cons f (search-path* module-path f)))))) + modules))) (imported-files files #:name name #:system system #:guile guile))) diff --git a/tests/gexp.scm b/tests/gexp.scm index baf78837ae..b3f7323984 100644 --- a/tests/gexp.scm +++ b/tests/gexp.scm @@ -598,6 +598,23 @@ get-bytevector-all)))) files)))))) +(test-assertm "imported-files with file-like objects" + (mlet* %store-monad ((plain -> (plain-file "foo" "bar!")) + (q-scm -> (search-path %load-path "ice-9/q.scm")) + (files -> `(("a/b/c" . ,q-scm) + ("p/q" . ,plain))) + (drv (imported-files files))) + (mbegin %store-monad + (built-derivations (list drv)) + (mlet %store-monad ((dir -> (derivation->output-path drv)) + (plain* (text-file "foo" "bar!")) + (q-scm* (interned-file q-scm "c"))) + (return + (and (string=? (readlink (string-append dir "/a/b/c")) + q-scm*) + (string=? (readlink (string-append dir "/p/q")) + plain*))))))) + (test-equal "gexp-modules & ungexp" '((bar) (foo)) ((@@ (guix gexp) gexp-modules) @@ -668,6 +685,28 @@ (equal? '(chdir "/foo") (call-with-input-file b read)))))))) +(test-assertm "gexp->derivation & with-imported-module & computed module" + (mlet* %store-monad + ((module -> (scheme-file "x" #~(begin + (define-module (foo bar) + #:export (the-answer)) + + (define the-answer 42)))) + (build -> (with-imported-modules `(((foo bar) => ,module) + (guix build utils)) + #~(begin + (use-modules (guix build utils) + (foo bar)) + mkdir-p + (call-with-output-file #$output + (lambda (port) + (write the-answer port)))))) + (drv (gexp->derivation "thing" build)) + (out -> (derivation->output-path drv))) + (mbegin %store-monad + (built-derivations (list drv)) + (return (= 42 (call-with-input-file out read)))))) + (test-assertm "gexp->derivation #:references-graphs" (mlet* %store-monad ((one (text-file "one" (random-text))) -- cgit v1.2.3 From 34d60c49cbffcee2bdaec32f0bfe2fef1c1ea8e6 Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Mon, 20 Feb 2017 16:25:44 +0100 Subject: services: connman: Rework service. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/services/networking.scm (connman-service): Remove. (): New record specifying the package to be used (connman) and whether vpn plugin shall be disabled (disable-vpn?). (connman-configuration): New exported variable. (connman-configuration?): New exported variable. (connman-service-type): Export it. * doc/guix.texi (Networking Services): Adjust accordingly. Signed-off-by: Ludovic Courtès --- doc/guix.texi | 34 +++++++++++++----- gnu/services/networking.scm | 86 ++++++++++++++++++++++++++------------------- 2 files changed, 75 insertions(+), 45 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 2e70848e55..3382ac414e 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -9263,16 +9263,34 @@ NetworkManager will not modify @code{resolv.conf}. @end deftp @cindex Connman -@deffn {Scheme Procedure} connman-service @ - [#:connman @var{connman}] -Return a service that runs @url{https://01.org/connman,Connman}, a network -connection manager. - -This service adds the @var{connman} package to the global profile, providing -several the @command{connmanctl} command to interact with the daemon and -configure networking." +@deffn {Scheme Variable} connman-service-type +This is the service type to run @url{https://01.org/connman,Connman}, +a network connection manager. + +Its value must be an +@code{connman-configuration} record as in this example: + +@example +(service connman-service-type + (connman-configuration + (disable-vpn? #t))) +@end example + +See below for details about @code{connman-configuration}. @end deffn +@deftp {Data Type} connman-configuration +Data Type representing the configuration of connman. + +@table @asis +@item @code{connman} (default: @var{connman}) +The connman package to use. + +@item @code{disable-vpn?} (default: @code{#f}) +When true, enable connman's vpn plugin. +@end table +@end deftp + @cindex WPA Supplicant @defvr {Scheme Variable} wpa-supplicant-service-type This is the service type to run @url{https://w1.fi/wpa_supplicant/,WPA diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index 18bce2a2b8..9b8e5b36b1 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -80,7 +80,10 @@ network-manager-configuration-dns network-manager-service-type - connman-service + connman-configuration + connman-configuration? + connman-service-type + wpa-supplicant-service-type openvswitch-service-type @@ -822,45 +825,54 @@ dns=" dns " ;;; Connman ;;; -(define %connman-activation - ;; Activation gexp for Connman. - #~(begin - (use-modules (guix build utils)) - (mkdir-p "/var/lib/connman/") - (mkdir-p "/var/lib/connman-vpn/"))) - -(define (connman-shepherd-service connman) +(define-record-type* + connman-configuration make-connman-configuration + connman-configuration? + (connman connman-configuration-connman + (default connman)) + (disable-vpn? connman-configuration-disable-vpn? + (default #f))) + +(define (connman-activation config) + (let ((disable-vpn? (connman-configuration-disable-vpn? config))) + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils)) + (mkdir-p "/var/lib/connman/") + (unless #$disable-vpn? + (mkdir-p "/var/lib/connman-vpn/")))))) + +(define (connman-shepherd-service config) "Return a shepherd service for Connman" - (list (shepherd-service - (documentation "Run Connman") - (provision '(networking)) - (requirement '(user-processes dbus-system loopback wpa-supplicant)) - (start #~(make-forkexec-constructor - (list (string-append #$connman - "/sbin/connmand") - "-n" "-r"))) - (stop #~(make-kill-destructor))))) + (and + (connman-configuration? config) + (let ((connman (connman-configuration-connman config)) + (disable-vpn? (connman-configuration-disable-vpn? config))) + (list (shepherd-service + (documentation "Run Connman") + (provision '(networking)) + (requirement + '(user-processes dbus-system loopback wpa-supplicant)) + (start #~(make-forkexec-constructor + (list (string-append #$connman + "/sbin/connmand") + "-n" "-r" + #$@(if disable-vpn? '("--noplugin=vpn") '())))) + (stop #~(make-kill-destructor))))))) (define connman-service-type - (service-type (name 'connman) - (extensions - (list (service-extension shepherd-root-service-type - connman-shepherd-service) - (service-extension dbus-root-service-type list) - (service-extension activation-service-type - (const %connman-activation)) - ;; Add connman to the system profile. - (service-extension profile-service-type list))))) - -(define* (connman-service #:key (connman connman)) - "Return a service that runs @url{https://01.org/connman,Connman}, a network -connection manager. - -This service adds the @var{connman} package to the global profile, providing -several the @command{connmanctl} command to interact with the daemon and -configure networking." - (service connman-service-type connman)) - + (let ((connman-package (compose list connman-configuration-connman))) + (service-type (name 'connman) + (extensions + (list (service-extension shepherd-root-service-type + connman-shepherd-service) + (service-extension dbus-root-service-type + connman-package) + (service-extension activation-service-type + connman-activation) + ;; Add connman to the system profile. + (service-extension profile-service-type + connman-package)))))) ;;; -- cgit v1.2.3 From 146db52a188b871769d9512867aa7f409f37dbac Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 16 Mar 2017 13:41:51 +0100 Subject: memoization: Micro-optimize code produced by 'define-cache-procedure'. * guix/memoization.scm (%nothing): Remove. (define-cache-procedure): Make '%nothing' a local variable, with a literal list. --- guix/memoization.scm | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/guix/memoization.scm b/guix/memoization.scm index d64f60fe9c..5cae283610 100644 --- a/guix/memoization.scm +++ b/guix/memoization.scm @@ -31,9 +31,6 @@ (define-syntax-rule (return/1 value) value) -(define %nothing ;nothingness - (list 'this 'is 'nothing)) - (define-syntax define-cache-procedure (syntax-rules () "Define a procedure NAME that implements a cache using HASH-REF and @@ -41,15 +38,17 @@ HASH-SET!. Use CALL to invoke the thunk and RETURN to return its value; CALL and RETURN are used to distinguish between multiple-value and single-value returns." ((_ name hash-ref hash-set! call return) - (define (name cache key thunk) - "Cache the result of THUNK under KEY in CACHE, or return the + (define name + (let ((%nothing '(this is nothing))) + (lambda (cache key thunk) + "Cache the result of THUNK under KEY in CACHE, or return the already-cached result." - (let ((results (hash-ref cache key %nothing))) - (if (eq? results %nothing) - (let ((results (call thunk))) - (hash-set! cache key results) - (return results)) - (return results))))) + (let ((results (hash-ref cache key %nothing))) + (if (eq? results %nothing) + (let ((results (call thunk))) + (hash-set! cache key results) + (return results)) + (return results))))))) ((_ name hash-ref hash-set!) (define-cache-procedure name hash-ref hash-set! call/mv return/mv)))) -- cgit v1.2.3 From 2971f39c3330a69f44d1ac97443e42b0f8e0173e Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 16 Mar 2017 17:31:10 +0100 Subject: pack: Honor command-line options related to the store. * guix/scripts/pack.scm (guix-pack): Call 'set-build-options-from-command-line'. --- guix/scripts/pack.scm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm index 067b1227e0..e422b3cdda 100644 --- a/guix/scripts/pack.scm +++ b/guix/scripts/pack.scm @@ -284,6 +284,9 @@ Create a bundle of PACKAGE.\n")) (symlinks (assoc-ref opts 'symlinks)) (localstatedir? (assoc-ref opts 'localstatedir?))) (with-store store + ;; Set the build options before we do anything else. + (set-build-options-from-command-line store opts) + (run-with-store store (mlet* %store-monad ((profile (profile-derivation (packages->manifest packages))) -- cgit v1.2.3 From b1edfbc37f2f008188d91f594b046c5986485e47 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 16 Mar 2017 18:02:59 +0100 Subject: pack: Add '--format' option and Docker output support. * guix/docker.scm: Remove dependency on (guix store) and (guix utils). Use (guix build store-copy). Load (json) lazily. (build-docker-image): Remove #:system. Add #:closure, #:compressor, and 'image' parameters. Use 'uname' to determine the architecture. Remove use of 'call-with-temporary-directory'. Use 'read-reference-graph' to compute ITEMS. Honor #:compressor. * guix/scripts/pack.scm (docker-image): New procedure. (%default-options): Add 'format'. (%formats): New variable. (%options, show-help): Add '--format'. (guix-pack): Honor '--format'. * guix/scripts/archive.scm: Remove '--format' option. This reverts commits 1545a012cb7cd78e25ed99ecee26df457be590e9, 01445711db6771cea6122859c3f717f130359f55, and 03476a23ff2d4175b7d3c808726178f764359bec. * doc/guix.texi (Invoking guix pack): Document '--format'. (Invoking guix archive): Remove documentation of '--format'. --- doc/guix.texi | 34 ++++++++-------- guix/docker.scm | 103 ++++++++++++++++++++++++++--------------------- guix/scripts/archive.scm | 31 ++------------ guix/scripts/pack.scm | 95 ++++++++++++++++++++++++++++++++++++++----- 4 files changed, 161 insertions(+), 102 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 3382ac414e..45d171c52d 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -2435,6 +2435,22 @@ guix pack -S /opt/gnu/bin=bin guile emacs geiser @noindent That way, users can happily type @file{/opt/gnu/bin/guile} and enjoy. +Alternatively, you can produce a pack in the Docker image format, as +described in +@uref{https://github.com/docker/docker/blob/master/image/spec/v1.2.md, +version 1.2 of the specification}. This is what the following command +does: + +@example +guix pack -f docker guile emacs geiser +@end example + +@noindent +The result is a tarball that can be passed to the @command{docker load} +command. See the +@uref{https://docs.docker.com/engine/reference/commandline/load/, Docker +documentation} for more information. + Several command-line options allow you to customize your pack: @table @code @@ -2537,7 +2553,7 @@ what you should use in this case (@pxref{Invoking guix copy}). @cindex nar, archive format @cindex normalized archive (nar) -By default archives are stored in the ``normalized archive'' or ``nar'' format, which is +Archives are stored in the ``normalized archive'' or ``nar'' format, which is comparable in spirit to `tar', but with differences that make it more appropriate for our purposes. First, rather than recording all Unix metadata for each file, the nar format only mentions @@ -2553,9 +2569,6 @@ verifies the signature and rejects the import in case of an invalid signature or if the signing key is not authorized. @c FIXME: Add xref to daemon doc about signatures. -Optionally, archives can be exported as a Docker image in the tar -archive format using @code{--format=docker}. - The main options are: @table @code @@ -2584,19 +2597,6 @@ Read a list of store file names from the standard input, one per line, and write on the standard output the subset of these files missing from the store. -@item -f -@item --format=@var{FMT} -@cindex docker, export -@cindex export format -Specify the export format. Acceptable arguments are @code{nar} and -@code{docker}. The default is the nar format. When the format is -@code{docker}, recursively export the specified store directory as a -Docker image in tar archive format, as specified in -@uref{https://github.com/docker/docker/blob/master/image/spec/v1.2.md, -version 1.2.0 of the Docker Image Specification}. Using -@code{--format=docker} implies @code{--recursive}. The generated -archive can be loaded by Docker using @command{docker load}. - @item --generate-key[=@var{parameters}] @cindex signing, archives Generate a new key pair for the daemon. This is a prerequisite before diff --git a/guix/docker.scm b/guix/docker.scm index 6dabaf25b0..56a0f7ec2b 100644 --- a/guix/docker.scm +++ b/guix/docker.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017 Ricardo Wurmus +;;; Copyright © 2017 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -18,17 +19,18 @@ (define-module (guix docker) #:use-module (guix hash) - #:use-module (guix store) #:use-module (guix base16) - #:use-module (guix utils) #:use-module ((guix build utils) #:select (delete-file-recursively with-directory-excursion)) - #:use-module (json) + #:use-module (guix build store-copy) #:use-module (rnrs bytevectors) #:use-module (ice-9 match) #:export (build-docker-image)) +;; Load Guile-JSON at run time to simplify the job of 'imported-modules' & co. +(module-use! (current-module) (resolve-interface '(json))) + ;; Generate a 256-bit identifier in hexadecimal encoding for the Docker image ;; containing the closure at PATH. (define docker-id @@ -81,48 +83,55 @@ (rootfs . ((type . "layers") (diff_ids . (,(layer-diff-id layer))))))) -(define* (build-docker-image path #:key system) - "Generate a Docker image archive from the given store PATH. The image -contains the closure of the given store item." - (let ((id (docker-id path)) +(define* (build-docker-image image path #:key closure compressor) + "Write to IMAGE a Docker image archive from the given store PATH. The image +contains the closure of PATH, as specified in CLOSURE (a file produced by +#:references-graphs). Use COMPRESSOR, a command such as '(\"gzip\" \"-9n\"), +to compress IMAGE." + (let ((directory "/tmp/docker-image") ;temporary working directory + (closure (canonicalize-path closure)) + (id (docker-id path)) (time (strftime "%FT%TZ" (localtime (current-time)))) - (name (string-append (getcwd) - "/docker-image-" (basename path) ".tar")) - (arch (match system - ("x86_64-linux" "amd64") - ("i686-linux" "386") - ("armhf-linux" "arm") - ("mips64el-linux" "mips64le")))) - (and (call-with-temporary-directory - (lambda (directory) - (with-directory-excursion directory - ;; Add symlink from /bin to /gnu/store/.../bin - (symlink (string-append path "/bin") "bin") - - (mkdir id) - (with-directory-excursion id - (with-output-to-file "VERSION" - (lambda () (display schema-version))) - (with-output-to-file "json" - (lambda () (scm->json (image-description id time)))) - - ;; Wrap it up - (let ((items (with-store store - (requisites store (list path))))) - (and (zero? (apply system* "tar" "-cf" "layer.tar" - (cons "../bin" items))) - (delete-file "../bin")))) - - (with-output-to-file "config.json" - (lambda () - (scm->json (config (string-append id "/layer.tar") - time arch)))) - (with-output-to-file "manifest.json" - (lambda () - (scm->json (manifest path id)))) - (with-output-to-file "repositories" - (lambda () - (scm->json (repositories path id))))) - (and (zero? (system* "tar" "-C" directory "-cf" name ".")) - (begin (delete-file-recursively directory) #t)))) - name))) + (arch (match (utsname:machine (uname)) + ("x86_64" "amd64") + ("i686" "386") + ("armv7l" "arm") + ("mips64" "mips64le")))) + ;; Make sure we start with a fresh, empty working directory. + (mkdir directory) + + (and (with-directory-excursion directory + ;; Add symlink from /bin to /gnu/store/.../bin + (symlink (string-append path "/bin") "bin") + + (mkdir id) + (with-directory-excursion id + (with-output-to-file "VERSION" + (lambda () (display schema-version))) + (with-output-to-file "json" + (lambda () (scm->json (image-description id time)))) + + ;; Wrap it up + (let ((items (call-with-input-file closure + read-reference-graph))) + (and (zero? (apply system* "tar" "-cf" "layer.tar" + (cons "../bin" items))) + (delete-file "../bin")))) + + (with-output-to-file "config.json" + (lambda () + (scm->json (config (string-append id "/layer.tar") + time arch)))) + (with-output-to-file "manifest.json" + (lambda () + (scm->json (manifest path id)))) + (with-output-to-file "repositories" + (lambda () + (scm->json (repositories path id))))) + + (and (zero? (apply system* "tar" "-C" directory "-cf" image + `(,@(if compressor + (list "-I" (string-join compressor)) + '()) + "."))) + (begin (delete-file-recursively directory) #t))))) diff --git a/guix/scripts/archive.scm b/guix/scripts/archive.scm index cad279fb50..8137455a9d 100644 --- a/guix/scripts/archive.scm +++ b/guix/scripts/archive.scm @@ -1,6 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013, 2014, 2015, 2016, 2017 Ludovic Courtès -;;; Copyright © 2017 Ricardo Wurmus ;;; ;;; This file is part of GNU Guix. ;;; @@ -45,11 +44,6 @@ #:export (guix-archive options->derivations+files)) -;; XXX: Use this hack instead of #:autoload to avoid compilation errors. -;; See . -(module-autoload! (current-module) - '(guix docker) '(build-docker-image)) - ;;; ;;; Command-line options. @@ -57,8 +51,7 @@ (define %default-options ;; Alist of default option values. - `((format . "nar") - (system . ,(%current-system)) + `((system . ,(%current-system)) (substitutes? . #t) (graft? . #t) (max-silent-time . 3600) @@ -69,8 +62,6 @@ Export/import one or more packages from/to the store.\n")) (display (_ " --export export the specified files/packages to stdout")) - (display (_ " - --format=FMT export files/packages in the specified format FMT")) (display (_ " -r, --recursive combined with '--export', include dependencies")) (display (_ " @@ -126,9 +117,6 @@ Export/import one or more packages from/to the store.\n")) (option '("export") #f #f (lambda (opt name arg result) (alist-cons 'export #t result))) - (option '(#\f "format") #t #f - (lambda (opt name arg result . rest) - (alist-cons 'format arg result))) (option '(#\r "recursive") #f #f (lambda (opt name arg result) (alist-cons 'export-recursive? #t result))) @@ -258,21 +246,8 @@ resulting archive to the standard output port." (if (or (assoc-ref opts 'dry-run?) (build-derivations store drv)) - (match (assoc-ref opts 'format) - ("nar" - (export-paths store files (current-output-port) - #:recursive? (assoc-ref opts 'export-recursive?))) - ("docker" - (match files - ((file) - (let ((system (assoc-ref opts 'system))) - (format #t "~a\n" - (build-docker-image file #:system system)))) - (x - ;; TODO: Remove this restriction. - (leave (_ "only a single item can be exported to Docker~%"))))) - (format - (leave (_ "~a: unknown archive format~%") format))) + (export-paths store files (current-output-port) + #:recursive? (assoc-ref opts 'export-recursive?)) (leave (_ "unable to export the given packages~%"))))) (define (generate-key-pair parameters) diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm index e422b3cdda..c6f2145c5c 100644 --- a/guix/scripts/pack.scm +++ b/guix/scripts/pack.scm @@ -24,6 +24,7 @@ #:use-module (guix store) #:use-module (guix grafts) #:use-module (guix monads) + #:use-module (guix modules) #:use-module (guix packages) #:use-module (guix profiles) #:use-module (guix derivations) @@ -32,6 +33,8 @@ #:use-module (gnu packages compression) #:autoload (gnu packages base) (tar) #:autoload (gnu packages package-management) (guix) + #:autoload (gnu packages gnupg) (libgcrypt) + #:autoload (gnu packages guile) (guile-json) #:use-module (srfi srfi-1) #:use-module (srfi srfi-9) #:use-module (srfi srfi-37) @@ -177,6 +180,59 @@ added to the pack." build #:references-graphs `(("profile" ,profile)))) +(define* (docker-image name profile + #:key deduplicate? + (compressor (first %compressors)) + localstatedir? + (symlinks '()) + (tar tar)) + "Return a derivation to construct a Docker image of PROFILE. The +image is a tarball conforming to the Docker Image Specification, compressed +with COMPRESSOR. It can be passed to 'docker load'." + ;; FIXME: Honor SYMLINKS and LOCALSTATEDIR?. + (define not-config? + (match-lambda + (('guix 'config) #f) + (('guix rest ...) #t) + (('gnu rest ...) #t) + (rest #f))) + + (define config + ;; (guix config) module for consumption by (guix gcrypt). + (scheme-file "gcrypt-config.scm" + #~(begin + (define-module (guix config) + #:export (%libgcrypt)) + + ;; XXX: Work around . + (eval-when (expand load eval) + (define %libgcrypt + #+(file-append libgcrypt "/lib/libgcrypt")))))) + + (define build + (with-imported-modules `(,@(source-module-closure '((guix docker)) + #:select? not-config?) + ((guix config) => ,config)) + #~(begin + ;; Guile-JSON is required by (guix docker). + (add-to-load-path + (string-append #$guile-json "/share/guile/site/" + (effective-version))) + + (use-modules (guix docker)) + + (setenv "PATH" + (string-append #$tar "/bin:" + #$(compressor-package compressor) "/bin")) + + (build-docker-image #$output #$profile + #:closure "profile" + #:compressor '#$(compressor-command compressor))))) + + (gexp->derivation (string-append name ".tar." + (compressor-extension compressor)) + build + #:references-graphs `(("profile" ,profile)))) ;;; @@ -185,7 +241,8 @@ added to the pack." (define %default-options ;; Alist of default option values. - `((system . ,(%current-system)) + `((format . tarball) + (system . ,(%current-system)) (substitutes? . #t) (graft? . #t) (max-silent-time . 3600) @@ -193,6 +250,11 @@ added to the pack." (symlinks . ()) (compressor . ,(first %compressors)))) +(define %formats + ;; Supported pack formats. + `((tarball . ,self-contained-tarball) + (docker . ,docker-image))) + (define %options ;; Specifications of the command-line options. (cons* (option '(#\h "help") #f #f @@ -206,6 +268,9 @@ added to the pack." (option '(#\n "dry-run") #f #f (lambda (opt name arg result) (alist-cons 'dry-run? #t (alist-cons 'graft? #f result)))) + (option '(#\f "format") #t #f + (lambda (opt name arg result) + (alist-cons 'format (string->symbol arg) result))) (option '(#\s "system") #t #f (lambda (opt name arg result) (alist-cons 'system arg @@ -242,6 +307,8 @@ Create a bundle of PACKAGE.\n")) (show-transformation-options-help) (newline) (display (_ " + -f, --format=FORMAT build a pack in the given FORMAT")) + (display (_ " -s, --system=SYSTEM attempt to build for SYSTEM--e.g., \"i686-linux\"")) (display (_ " -C, --compression=TOOL compress using TOOL--e.g., \"lzip\"")) @@ -280,8 +347,16 @@ Create a bundle of PACKAGE.\n")) (specification->package+output spec)) list)) specs)) - (compressor (assoc-ref opts 'compressor)) - (symlinks (assoc-ref opts 'symlinks)) + (pack-format (assoc-ref opts 'format)) + (name (string-append (symbol->string pack-format) + "-pack")) + (compressor (assoc-ref opts 'compressor)) + (symlinks (assoc-ref opts 'symlinks)) + (build-image (match (assq-ref %formats pack-format) + ((? procedure? proc) proc) + (#f + (leave (_ "~a: unknown pack format") + format)))) (localstatedir? (assoc-ref opts 'localstatedir?))) (with-store store ;; Set the build options before we do anything else. @@ -290,13 +365,13 @@ Create a bundle of PACKAGE.\n")) (run-with-store store (mlet* %store-monad ((profile (profile-derivation (packages->manifest packages))) - (drv (self-contained-tarball "pack" profile - #:compressor - compressor - #:symlinks - symlinks - #:localstatedir? - localstatedir?))) + (drv (build-image name profile + #:compressor + compressor + #:symlinks + symlinks + #:localstatedir? + localstatedir?))) (mbegin %store-monad (show-what-to-build* (list drv) #:use-substitutes? -- cgit v1.2.3 From 84dda5a9c0772b2507fab3209938ead9da2a3442 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 16 Mar 2017 21:41:38 +0100 Subject: pack: Use a fixed timestamp in Docker images. * guix/docker.scm (build-docker-image): Add #:creation-time parameter. Use SRFI-19 'date->string' instead of 'strftime' et al. * guix/scripts/pack.scm (docker-image)[build]: Pass #:creation-time to 'build-docker-image'. --- guix/docker.scm | 10 +++++++--- guix/scripts/pack.scm | 5 +++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/guix/docker.scm b/guix/docker.scm index 56a0f7ec2b..5614ab2115 100644 --- a/guix/docker.scm +++ b/guix/docker.scm @@ -24,6 +24,7 @@ #:select (delete-file-recursively with-directory-excursion)) #:use-module (guix build store-copy) + #:use-module (srfi srfi-19) #:use-module (rnrs bytevectors) #:use-module (ice-9 match) #:export (build-docker-image)) @@ -83,15 +84,18 @@ (rootfs . ((type . "layers") (diff_ids . (,(layer-diff-id layer))))))) -(define* (build-docker-image image path #:key closure compressor) +(define* (build-docker-image image path + #:key closure compressor + (creation-time (current-time time-utc))) "Write to IMAGE a Docker image archive from the given store PATH. The image contains the closure of PATH, as specified in CLOSURE (a file produced by #:references-graphs). Use COMPRESSOR, a command such as '(\"gzip\" \"-9n\"), -to compress IMAGE." +to compress IMAGE. Use CREATION-TIME, a SRFI-19 time-utc object, as the +creation time in metadata." (let ((directory "/tmp/docker-image") ;temporary working directory (closure (canonicalize-path closure)) (id (docker-id path)) - (time (strftime "%FT%TZ" (localtime (current-time)))) + (time (date->string (time-utc->date creation-time) "~4")) (arch (match (utsname:machine (uname)) ("x86_64" "amd64") ("i686" "386") diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm index c6f2145c5c..694b2f2aee 100644 --- a/guix/scripts/pack.scm +++ b/guix/scripts/pack.scm @@ -219,7 +219,7 @@ with COMPRESSOR. It can be passed to 'docker load'." (string-append #$guile-json "/share/guile/site/" (effective-version))) - (use-modules (guix docker)) + (use-modules (guix docker) (srfi srfi-19)) (setenv "PATH" (string-append #$tar "/bin:" @@ -227,7 +227,8 @@ with COMPRESSOR. It can be passed to 'docker load'." (build-docker-image #$output #$profile #:closure "profile" - #:compressor '#$(compressor-command compressor))))) + #:compressor '#$(compressor-command compressor) + #:creation-time (make-time time-utc 0 1))))) (gexp->derivation (string-append name ".tar." (compressor-extension compressor)) -- cgit v1.2.3 From 54241dc8e62c8616dcd72effe816e6e570607055 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 16 Mar 2017 21:56:10 +0100 Subject: docker: Build images in a reproducible fashion. * guix/docker.scm (%tar-determinism-options): New variable. (build-docker-image): Use it on the two 'tar' invocations. --- guix/docker.scm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/guix/docker.scm b/guix/docker.scm index 5614ab2115..9b7a28f6f3 100644 --- a/guix/docker.scm +++ b/guix/docker.scm @@ -84,6 +84,11 @@ (rootfs . ((type . "layers") (diff_ids . (,(layer-diff-id layer))))))) +(define %tar-determinism-options + ;; GNU tar options to produce archives deterministically. + '("--sort=name" "--mtime=@1" + "--owner=root:0" "--group=root:0")) + (define* (build-docker-image image path #:key closure compressor (creation-time (current-time time-utc))) @@ -119,7 +124,8 @@ creation time in metadata." (let ((items (call-with-input-file closure read-reference-graph))) (and (zero? (apply system* "tar" "-cf" "layer.tar" - (cons "../bin" items))) + (append %tar-determinism-options + (cons "../bin" items)))) (delete-file "../bin")))) (with-output-to-file "config.json" @@ -134,7 +140,8 @@ creation time in metadata." (scm->json (repositories path id))))) (and (zero? (apply system* "tar" "-C" directory "-cf" image - `(,@(if compressor + `(,@%tar-determinism-options + ,@(if compressor (list "-I" (string-join compressor)) '()) "."))) -- cgit v1.2.3 From 9e84ea3673f77ebe5c5e9ce39fbcdb6d7bc8a06f Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 16 Mar 2017 22:40:06 +0100 Subject: pack: Honor symlinks in the Docker back-end. * guix/docker.scm (symlink-source, topmost-component): New procedures. (build-docker-image): Add #:symlinks parameter and honor it. Remove hard-coded /bin symlink. * guix/scripts/pack.scm (docker-image): Pass #:symlinks to 'build-docker-image'. --- guix/docker.scm | 46 ++++++++++++++++++++++++++++++++++++---------- guix/scripts/pack.scm | 3 ++- 2 files changed, 38 insertions(+), 11 deletions(-) diff --git a/guix/docker.scm b/guix/docker.scm index 9b7a28f6f3..290ad3dcf1 100644 --- a/guix/docker.scm +++ b/guix/docker.scm @@ -21,7 +21,8 @@ #:use-module (guix hash) #:use-module (guix base16) #:use-module ((guix build utils) - #:select (delete-file-recursively + #:select (mkdir-p + delete-file-recursively with-directory-excursion)) #:use-module (guix build store-copy) #:use-module (srfi srfi-19) @@ -89,14 +90,30 @@ '("--sort=name" "--mtime=@1" "--owner=root:0" "--group=root:0")) +(define symlink-source + (match-lambda + ((source '-> target) + (string-trim source #\/)))) + +(define (topmost-component file) + "Return the topmost component of FILE. For instance, if FILE is \"/a/b/c\", +return \"a\"." + (match (string-tokenize file (char-set-complement (char-set #\/))) + ((first rest ...) + first))) + (define* (build-docker-image image path #:key closure compressor + (symlinks '()) (creation-time (current-time time-utc))) "Write to IMAGE a Docker image archive from the given store PATH. The image contains the closure of PATH, as specified in CLOSURE (a file produced by -#:references-graphs). Use COMPRESSOR, a command such as '(\"gzip\" \"-9n\"), -to compress IMAGE. Use CREATION-TIME, a SRFI-19 time-utc object, as the -creation time in metadata." +#:references-graphs). SYMLINKS must be a list of (SOURCE -> TARGET) tuples +describing symlinks to be created in the image, where each TARGET is relative +to PATH. + +Use COMPRESSOR, a command such as '(\"gzip\" \"-9n\"), to compress IMAGE. Use +CREATION-TIME, a SRFI-19 time-utc object, as the creation time in metadata." (let ((directory "/tmp/docker-image") ;temporary working directory (closure (canonicalize-path closure)) (id (docker-id path)) @@ -110,9 +127,6 @@ creation time in metadata." (mkdir directory) (and (with-directory-excursion directory - ;; Add symlink from /bin to /gnu/store/.../bin - (symlink (string-append path "/bin") "bin") - (mkdir id) (with-directory-excursion id (with-output-to-file "VERSION" @@ -120,13 +134,25 @@ creation time in metadata." (with-output-to-file "json" (lambda () (scm->json (image-description id time)))) - ;; Wrap it up + ;; Wrap it up. (let ((items (call-with-input-file closure read-reference-graph))) + ;; Create SYMLINKS. + (for-each (match-lambda + ((source '-> target) + (let ((source (string-trim source #\/))) + (mkdir-p (dirname source)) + (symlink (string-append path "/" target) + source)))) + symlinks) + (and (zero? (apply system* "tar" "-cf" "layer.tar" (append %tar-determinism-options - (cons "../bin" items)))) - (delete-file "../bin")))) + items + (map symlink-source symlinks)))) + (for-each delete-file-recursively + (map (compose topmost-component symlink-source) + symlinks))))) (with-output-to-file "config.json" (lambda () diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm index 694b2f2aee..edeb82fafd 100644 --- a/guix/scripts/pack.scm +++ b/guix/scripts/pack.scm @@ -189,7 +189,7 @@ added to the pack." "Return a derivation to construct a Docker image of PROFILE. The image is a tarball conforming to the Docker Image Specification, compressed with COMPRESSOR. It can be passed to 'docker load'." - ;; FIXME: Honor SYMLINKS and LOCALSTATEDIR?. + ;; FIXME: Honor LOCALSTATEDIR?. (define not-config? (match-lambda (('guix 'config) #f) @@ -227,6 +227,7 @@ with COMPRESSOR. It can be passed to 'docker load'." (build-docker-image #$output #$profile #:closure "profile" + #:symlinks '#$symlinks #:compressor '#$(compressor-command compressor) #:creation-time (make-time time-utc 0 1))))) -- cgit v1.2.3 From db3f2b61adfe56d69029ec5f6d962462a50a1f33 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 16 Mar 2017 22:46:43 +0100 Subject: pack: Allow for "-S /opt/foo=". Reported by Andy Wingo. * guix/scripts/pack.scm (%options): Use 'string-split' instead of 'string-tokenize'. --- guix/scripts/pack.scm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm index edeb82fafd..74d4ee6d4d 100644 --- a/guix/scripts/pack.scm +++ b/guix/scripts/pack.scm @@ -283,9 +283,10 @@ with COMPRESSOR. It can be passed to 'docker load'." result))) (option '(#\S "symlink") #t #f (lambda (opt name arg result) - (match (string-tokenize arg - (char-set-complement - (char-set #\=))) + ;; Note: Using 'string-split' allows us to handle empty + ;; TARGET (as in "/opt/guile=", meaning that /opt/guile is + ;; a symlink to the profile) correctly. + (match (string-split arg (char-set #\=)) ((source target) (let ((symlinks (assoc-ref result 'symlinks))) (alist-cons 'symlinks -- cgit v1.2.3 From 107b8da6228fca888a0801c3eadf4bb23a6b46a4 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 16 Mar 2017 22:59:33 +0100 Subject: doc: Mention 'guix pack' reproducibility. * doc/guix.texi (Invoking guix pack): Mention reproducibility. --- doc/guix.texi | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index 45d171c52d..bdbfedfdb5 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -2405,7 +2405,9 @@ The @command{guix pack} command creates a shrink-wrapped @dfn{pack} or containing the binaries of the software you're interested in, and all its dependencies. The resulting archive can be used on any machine that does not have Guix, and people can run the exact same binaries as those -you have with Guix. +you have with Guix. The pack itself is created in a bit-reproducible +fashion, so anyone can verify that it really contains the build results +that you pretend to be shipping. For example, to create a bundle containing Guile, Emacs, Geiser, and all their dependencies, you can run: -- cgit v1.2.3 From ad172c4a767e9a88d8861a1bd979c3a140dfdb68 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 16 Mar 2017 23:03:40 +0100 Subject: doc: Reorganize categories. * doc/guix.texi: Move "guix build" to the "Software Development" category; add "guix pack". --- doc/guix.texi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index bdbfedfdb5..93640dfba5 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -47,7 +47,6 @@ Documentation License''. @direntry * Guix: (guix). Manage installed software and system configuration. * guix package: (guix)Invoking guix package. Installing, removing, and upgrading packages. -* guix build: (guix)Invoking guix build. Building packages. * guix gc: (guix)Invoking guix gc. Reclaiming unused disk space. * guix pull: (guix)Invoking guix pull. Update the list of available packages. * guix system: (guix)Invoking guix system. Manage the operating system configuration. @@ -56,6 +55,8 @@ Documentation License''. @dircategory Software development @direntry * guix environment: (guix)Invoking guix environment. Building development environments with Guix. +* guix build: (guix)Invoking guix build. Building packages. +* guix pack: (guix)Invoking guix pack. Creating binary bundles. @end direntry @titlepage -- cgit v1.2.3 From 1e5b8beeff95e0adf767f1c13963c39b794573fe Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Thu, 16 Mar 2017 14:13:08 -0400 Subject: gnu: virglrenderer: Fix CVE-2017-6386. * gnu/packages/patches/virglrenderer-CVE-2017-6386.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/spice.scm (virglrenderer)[source]: Use it. --- gnu/local.mk | 1 + .../patches/virglrenderer-CVE-2017-6386.patch | 54 ++++++++++++++++++++++ gnu/packages/spice.scm | 1 + 3 files changed, 56 insertions(+) create mode 100644 gnu/packages/patches/virglrenderer-CVE-2017-6386.patch diff --git a/gnu/local.mk b/gnu/local.mk index b3aa79ad90..c1a15e94ff 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -965,6 +965,7 @@ dist_patch_DATA = \ %D%/packages/patches/upower-builddir.patch \ %D%/packages/patches/valgrind-enable-arm.patch \ %D%/packages/patches/vim-CVE-2017-5953.patch \ + %D%/packages/patches/virglrenderer-CVE-2017-6386.patch \ %D%/packages/patches/vorbis-tools-CVE-2014-9638+CVE-2014-9639.patch \ %D%/packages/patches/vorbis-tools-CVE-2014-9640.patch \ %D%/packages/patches/vorbis-tools-CVE-2015-6749.patch \ diff --git a/gnu/packages/patches/virglrenderer-CVE-2017-6386.patch b/gnu/packages/patches/virglrenderer-CVE-2017-6386.patch new file mode 100644 index 0000000000..bd3bf106bf --- /dev/null +++ b/gnu/packages/patches/virglrenderer-CVE-2017-6386.patch @@ -0,0 +1,54 @@ +Fix CVE-2017-6386 (memory leak introduced by fix for CVE-2017-5994). + +https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-5994 + +Patch copied from upstream source repository: + +https://cgit.freedesktop.org/virglrenderer/commit/?id=737c3350850ca4dbc5633b3bdb4118176ce59920 + +From 737c3350850ca4dbc5633b3bdb4118176ce59920 Mon Sep 17 00:00:00 2001 +From: Dave Airlie +Date: Tue, 28 Feb 2017 14:52:09 +1000 +Subject: renderer: fix memory leak in vertex elements state create + +Reported-by: Li Qiang +Free the vertex array in error path. +This was introduced by this commit: +renderer: fix heap overflow in vertex elements state create. + +I rewrote the code to not require the allocation in the first +place if we have an error, seems nicer. + +Signed-off-by: Dave Airlie + +diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c +index 1bca7ad..e5d9f5c 100644 +--- a/src/vrend_renderer.c ++++ b/src/vrend_renderer.c +@@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx, + unsigned num_elements, + const struct pipe_vertex_element *elements) + { +- struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_array); ++ struct vrend_vertex_element_array *v; + const struct util_format_description *desc; + GLenum type; + int i; + uint32_t ret_handle; + +- if (!v) +- return ENOMEM; +- + if (num_elements > PIPE_MAX_ATTRIBS) + return EINVAL; + ++ v = CALLOC_STRUCT(vrend_vertex_element_array); ++ if (!v) ++ return ENOMEM; ++ + v->count = num_elements; + for (i = 0; i < num_elements; i++) { + memcpy(&v->elements[i].base, &elements[i], sizeof(struct pipe_vertex_element)); +-- +cgit v0.10.2 + diff --git a/gnu/packages/spice.scm b/gnu/packages/spice.scm index 363a5e8fc5..838db4b35d 100644 --- a/gnu/packages/spice.scm +++ b/gnu/packages/spice.scm @@ -102,6 +102,7 @@ (uri (string-append "https://www.freedesktop.org/software/virgl/" "virglrenderer-" version ".tar.bz2")) + (patches (search-patches "virglrenderer-CVE-2017-6386.patch")) (sha256 (base32 "06kf0q4l52gzx5p63l8850hff8pmhp7xv1hk8zgx2apbw18y6jd5")))) -- cgit v1.2.3 From 49ac6dbb0ae8386fd7da5d751107ba7a6aab44ad Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Thu, 16 Mar 2017 14:58:13 -0400 Subject: gnu: qemu: Fix CVE-2017-{2620,2630}. * gnu/packages/patches/qemu-CVE-2017-2620.patch, gnu/packages/patches/qemu-CVE-2017-2630.patch: New files. * gnu/local.mk (dist_patch_DATA): Add them. * gnu/packages/qemu.scm (qemu)[source]: Use them. --- gnu/local.mk | 2 + gnu/packages/patches/qemu-CVE-2017-2620.patch | 134 ++++++++++++++++++++++++++ gnu/packages/patches/qemu-CVE-2017-2630.patch | 47 +++++++++ gnu/packages/qemu.scm | 2 + 4 files changed, 185 insertions(+) create mode 100644 gnu/packages/patches/qemu-CVE-2017-2620.patch create mode 100644 gnu/packages/patches/qemu-CVE-2017-2630.patch diff --git a/gnu/local.mk b/gnu/local.mk index c1a15e94ff..2cc5d546b3 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -877,6 +877,8 @@ dist_patch_DATA = \ %D%/packages/patches/python2-subprocess32-disable-input-test.patch \ %D%/packages/patches/qemu-CVE-2016-10155.patch \ %D%/packages/patches/qemu-CVE-2017-2615.patch \ + %D%/packages/patches/qemu-CVE-2017-2620.patch \ + %D%/packages/patches/qemu-CVE-2017-2630.patch \ %D%/packages/patches/qemu-CVE-2017-5525.patch \ %D%/packages/patches/qemu-CVE-2017-5526.patch \ %D%/packages/patches/qemu-CVE-2017-5552.patch \ diff --git a/gnu/packages/patches/qemu-CVE-2017-2620.patch b/gnu/packages/patches/qemu-CVE-2017-2620.patch new file mode 100644 index 0000000000..d3111827b7 --- /dev/null +++ b/gnu/packages/patches/qemu-CVE-2017-2620.patch @@ -0,0 +1,134 @@ +Fix CVE-2017-2620: + +https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-2620 +https://lists.gnu.org/archive/html/qemu-devel/2017-02/msg04700.html + +Both patches copied from upstream source repository: + +Fixes CVE-2017-2620: +http://git.qemu-project.org/?p=qemu.git;a=commit;h=92f2b88cea48c6aeba8de568a45f2ed958f3c298 + +The CVE-2017-2620 bug-fix depends on this earlier patch: +http://git.qemu-project.org/?p=qemu.git;a=commit;h=913a87885f589d263e682c2eb6637c6e14538061 + +From 92f2b88cea48c6aeba8de568a45f2ed958f3c298 Mon Sep 17 00:00:00 2001 +From: Gerd Hoffmann +Date: Wed, 8 Feb 2017 11:18:36 +0100 +Subject: [PATCH] cirrus: add blit_is_unsafe call to cirrus_bitblt_cputovideo + (CVE-2017-2620) + +CIRRUS_BLTMODE_MEMSYSSRC blits do NOT check blit destination +and blit width, at all. Oops. Fix it. + +Security impact: high. + +The missing blit destination check allows to write to host memory. +Basically same as CVE-2014-8106 for the other blit variants. + +Cc: qemu-stable@nongnu.org +Signed-off-by: Gerd Hoffmann +--- + hw/display/cirrus_vga.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c +index 1deb52070a..b9e7cb1df1 100644 +--- a/hw/display/cirrus_vga.c ++++ b/hw/display/cirrus_vga.c +@@ -900,6 +900,10 @@ static int cirrus_bitblt_cputovideo(CirrusVGAState * s) + { + int w; + ++ if (blit_is_unsafe(s, true)) { ++ return 0; ++ } ++ + s->cirrus_blt_mode &= ~CIRRUS_BLTMODE_MEMSYSSRC; + s->cirrus_srcptr = &s->cirrus_bltbuf[0]; + s->cirrus_srcptr_end = &s->cirrus_bltbuf[0]; +@@ -925,6 +929,10 @@ static int cirrus_bitblt_cputovideo(CirrusVGAState * s) + } + s->cirrus_srccounter = s->cirrus_blt_srcpitch * s->cirrus_blt_height; + } ++ ++ /* the blit_is_unsafe call above should catch this */ ++ assert(s->cirrus_blt_srcpitch <= CIRRUS_BLTBUFSIZE); ++ + s->cirrus_srcptr = s->cirrus_bltbuf; + s->cirrus_srcptr_end = s->cirrus_bltbuf + s->cirrus_blt_srcpitch; + cirrus_update_memory_access(s); +-- +2.12.0 + +From 913a87885f589d263e682c2eb6637c6e14538061 Mon Sep 17 00:00:00 2001 +From: Bruce Rogers +Date: Mon, 9 Jan 2017 13:35:20 -0700 +Subject: [PATCH] display: cirrus: ignore source pitch value as needed in + blit_is_unsafe + +Commit 4299b90 added a check which is too broad, given that the source +pitch value is not required to be initialized for solid fill operations. +This patch refines the blit_is_unsafe() check to ignore source pitch in +that case. After applying the above commit as a security patch, we +noticed the SLES 11 SP4 guest gui failed to initialize properly. + +Signed-off-by: Bruce Rogers +Message-id: 20170109203520.5619-1-brogers@suse.com +Signed-off-by: Gerd Hoffmann +--- + hw/display/cirrus_vga.c | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c +index bdb092ee9d..379910db2d 100644 +--- a/hw/display/cirrus_vga.c ++++ b/hw/display/cirrus_vga.c +@@ -294,7 +294,7 @@ static bool blit_region_is_unsafe(struct CirrusVGAState *s, + return false; + } + +-static bool blit_is_unsafe(struct CirrusVGAState *s) ++static bool blit_is_unsafe(struct CirrusVGAState *s, bool dst_only) + { + /* should be the case, see cirrus_bitblt_start */ + assert(s->cirrus_blt_width > 0); +@@ -308,6 +308,9 @@ static bool blit_is_unsafe(struct CirrusVGAState *s) + s->cirrus_blt_dstaddr & s->cirrus_addr_mask)) { + return true; + } ++ if (dst_only) { ++ return false; ++ } + if (blit_region_is_unsafe(s, s->cirrus_blt_srcpitch, + s->cirrus_blt_srcaddr & s->cirrus_addr_mask)) { + return true; +@@ -673,7 +676,7 @@ static int cirrus_bitblt_common_patterncopy(CirrusVGAState * s, + + dst = s->vga.vram_ptr + (s->cirrus_blt_dstaddr & s->cirrus_addr_mask); + +- if (blit_is_unsafe(s)) ++ if (blit_is_unsafe(s, false)) + return 0; + + (*s->cirrus_rop) (s, dst, src, +@@ -691,7 +694,7 @@ static int cirrus_bitblt_solidfill(CirrusVGAState *s, int blt_rop) + { + cirrus_fill_t rop_func; + +- if (blit_is_unsafe(s)) { ++ if (blit_is_unsafe(s, true)) { + return 0; + } + rop_func = cirrus_fill[rop_to_index[blt_rop]][s->cirrus_blt_pixelwidth - 1]; +@@ -795,7 +798,7 @@ static int cirrus_do_copy(CirrusVGAState *s, int dst, int src, int w, int h) + + static int cirrus_bitblt_videotovideo_copy(CirrusVGAState * s) + { +- if (blit_is_unsafe(s)) ++ if (blit_is_unsafe(s, false)) + return 0; + + return cirrus_do_copy(s, s->cirrus_blt_dstaddr - s->vga.start_addr, +-- +2.12.0 + diff --git a/gnu/packages/patches/qemu-CVE-2017-2630.patch b/gnu/packages/patches/qemu-CVE-2017-2630.patch new file mode 100644 index 0000000000..b154d171f1 --- /dev/null +++ b/gnu/packages/patches/qemu-CVE-2017-2630.patch @@ -0,0 +1,47 @@ +Fix CVE-2017-2630: + +https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-2630 +https://lists.gnu.org/archive/html/qemu-devel/2017-02/msg01246.html + +Patch copied from upstream source repository: + +http://git.qemu-project.org/?p=qemu.git;a=commit;h=2563c9c6b8670400c48e562034b321a7cf3d9a85 + +From 2563c9c6b8670400c48e562034b321a7cf3d9a85 Mon Sep 17 00:00:00 2001 +From: Vladimir Sementsov-Ogievskiy +Date: Tue, 7 Mar 2017 09:16:27 -0600 +Subject: [PATCH] nbd/client: fix drop_sync [CVE-2017-2630] +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Comparison symbol is misused. It may lead to memory corruption. +Introduced in commit 7d3123e. + +Signed-off-by: Vladimir Sementsov-Ogievskiy +Message-Id: <20170203154757.36140-6-vsementsov@virtuozzo.com> +[eblake: add CVE details, update conditional] +Signed-off-by: Eric Blake +Reviewed-by: Marc-André Lureau +Message-Id: <20170307151627.27212-1-eblake@redhat.com> +Signed-off-by: Paolo Bonzini +--- + nbd/client.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/nbd/client.c b/nbd/client.c +index 5c9dee37fa..3dc2564cd0 100644 +--- a/nbd/client.c ++++ b/nbd/client.c +@@ -94,7 +94,7 @@ static ssize_t drop_sync(QIOChannel *ioc, size_t size) + char small[1024]; + char *buffer; + +- buffer = sizeof(small) < size ? small : g_malloc(MIN(65536, size)); ++ buffer = sizeof(small) >= size ? small : g_malloc(MIN(65536, size)); + while (size > 0) { + ssize_t count = read_sync(ioc, buffer, MIN(65536, size)); + +-- +2.12.0 + diff --git a/gnu/packages/qemu.scm b/gnu/packages/qemu.scm index 3aa4128be0..07ab871fae 100644 --- a/gnu/packages/qemu.scm +++ b/gnu/packages/qemu.scm @@ -79,6 +79,8 @@ "0qjy3rcrn89n42y5iz60kgr0rrl29hpnj8mq2yvbc1wrcizmvzfs")) (patches (search-patches "qemu-CVE-2016-10155.patch" "qemu-CVE-2017-2615.patch" + "qemu-CVE-2017-2620.patch" + "qemu-CVE-2017-2630.patch" "qemu-CVE-2017-5525.patch" "qemu-CVE-2017-5526.patch" "qemu-CVE-2017-5552.patch" -- cgit v1.2.3 From bcc5b74173d399af6cdc5fb155bdd7020d1d278e Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Thu, 16 Mar 2017 18:24:51 -0400 Subject: gnu: linux-libre@4.9: Update to 4.9.15. * gnu/packages/linux.scm (linux-libre-4.9): Update to 4.9.15. --- gnu/packages/linux.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 28440297e0..c46cf4b2e8 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -348,8 +348,8 @@ It has been modified to remove all non-free binary blobs.") #:configuration-file kernel-config)) (define-public linux-libre-4.9 - (make-linux-libre "4.9.14" - "104715z772if18qi61jbyhvidfh6qnwkiy0m9aa8irxgzs1pk9mn" + (make-linux-libre "4.9.15" + "1p8mfd2djgndwpgqg7nylpncgdqrjn9038bzhc7z1mjykzfb3d8a" %intel-compatible-systems #:configuration-file kernel-config)) -- cgit v1.2.3 From 2044306f05bb0b4bf00dbf7835c9801896635189 Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Thu, 16 Mar 2017 18:25:55 -0400 Subject: gnu: linux-libre@4.4: Update to 4.4.54. * gnu/packages/linux.scm (linux-libre-4.4): Update to 4.4.54. --- gnu/packages/linux.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index c46cf4b2e8..351fd3e492 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -354,8 +354,8 @@ It has been modified to remove all non-free binary blobs.") #:configuration-file kernel-config)) (define-public linux-libre-4.4 - (make-linux-libre "4.4.53" - "07sfg4i506f3hmd9k4iimnq1w3x0980qxnh649d1sldqxbmhdgjs" + (make-linux-libre "4.4.54" + "0ny6hsrngl4y4j3ha4py2k7b0fldl9j5mn1h8z115fx2vq9nkfhv" %intel-compatible-systems #:configuration-file kernel-config)) -- cgit v1.2.3 From 2ec5ba859f63dcaa56655584573d361f286d4020 Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Thu, 16 Mar 2017 18:26:39 -0400 Subject: gnu: linux-libre: Update to 4.10.3. * gnu/packages/linux.scm (%linux-libre-version): Update to 4.10.3. (%linux-libre-hash): Update hash. --- gnu/packages/linux.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 351fd3e492..4557194e86 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -338,8 +338,8 @@ It has been modified to remove all non-free binary blobs.") (define %intel-compatible-systems '("x86_64-linux" "i686-linux")) -(define %linux-libre-version "4.10.2") -(define %linux-libre-hash "01kinnv40lqsk6fyz1k7hkx2diyg4mgp28bwraar5sii1gqmcw7k") +(define %linux-libre-version "4.10.3") +(define %linux-libre-hash "1znrcwc0y35cjkizkmjvnxnkldf490pfxqs7dn4vcgmb80y7smfc") (define-public linux-libre (make-linux-libre %linux-libre-version -- cgit v1.2.3 From 366efcb2fbc78c7fdeabf795f4d27ccfcf61c8a4 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Thu, 16 Mar 2017 16:08:42 +0100 Subject: gnu: dns: Fix typo and use @dfn in descriptions. * gnu/packages/dns.scm (bind)[description]: Use @dfn to expand acronyms. (yadifa)[description]: Likewise, and fix a typo. --- gnu/packages/dns.scm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gnu/packages/dns.scm b/gnu/packages/dns.scm index 541979f587..f347240410 100644 --- a/gnu/packages/dns.scm +++ b/gnu/packages/dns.scm @@ -134,8 +134,8 @@ and BOOTP/TFTP for network booting of diskless machines.") (lambda _ (zero? (system* "make" "force-test"))))))) (synopsis "An implementation of the Domain Name System") - (description "BIND is an implementation of the Domain Name System (DNS) -protocols for the Internet. It is a reference implementation of those + (description "BIND is an implementation of the @dfn{Domain Name System} +(DNS) protocols for the Internet. It is a reference implementation of those protocols, but it is also production-grade software, suitable for use in high-volume and high-reliability applications. The name BIND stands for \"Berkeley Internet Name Domain\", because the software originated in the early @@ -298,9 +298,9 @@ asynchronous fashion.") "--disable-nsid"))) (home-page "http://www.yadifa.eu/") (synopsis "Authoritative DNS name server") - (description "YADIFA is an authorative name server for the Domain Name -System (DNS). It aims for both higher performance and a smaller memory + (description "YADIFA is an authoritative name server for the @dfn{Domain +Name System} (DNS). It aims for both higher performance and a smaller memory footprint than other implementations, while remaining fully RFC-compliant. -YADIFA supports dynamic record updates and the Domain Name System Security -Extensions (DNSSEC).") +YADIFA supports dynamic record updates and the @dfn{Domain Name System Security +Extensions} (DNSSEC).") (license license:bsd-3))) -- cgit v1.2.3 From 754667f0eb44491370a2ec4fa0b4705cfcf6d237 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Sun, 30 Oct 2016 16:32:22 +0100 Subject: gnu: Add liburcu. * gnu/packages/datastructures.scm (liburcu): New variable. --- gnu/packages/datastructures.scm | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/gnu/packages/datastructures.scm b/gnu/packages/datastructures.scm index b9e6061238..ef249b9659 100644 --- a/gnu/packages/datastructures.scm +++ b/gnu/packages/datastructures.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2015, 2016 Ricardo Wurmus -;;; Copyright © 2016 Tobias Geerinckx-Rice +;;; Copyright © 2016, 2017 Tobias Geerinckx-Rice ;;; ;;; This file is part of GNU Guix. ;;; @@ -19,6 +19,7 @@ (define-module (gnu packages datastructures) #:use-module (gnu packages) + #:use-module (gnu packages perl) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) #:use-module (guix download) @@ -92,3 +93,26 @@ hashes (CTPH), also called fuzzy checksums. It can identify similar files that have sequences of identical bytes in the same order, even though bytes in between these sequences may be different in both content and length.") (license license:gpl2+))) + +(define-public liburcu + (package + (name "liburcu") + (version "0.9.3") + (source (origin + (method url-fetch) + (uri (string-append "https://www.lttng.org/files/urcu/" + "userspace-rcu-" version ".tar.bz2")) + (sha256 + (base32 + "01j0xp3f0w147yfyzybkjvb7i67i7prsvnkssgvgwry9lvk35khv")))) + (build-system gnu-build-system) + (native-inputs + `(("perl" ,perl))) ; for tests + (home-page "http://liburcu.org/") + (synopsis "User-space RCU data synchronisation library") + (description "liburcu is a user-space @dfn{Read-Copy-Update} (RCU) data +synchronisation library. It provides read-side access that scales linearly +with the number of cores. liburcu-cds provides efficient data structures +based on RCU and lock-free algorithms. These structures include hash tables, +queues, stacks, and doubly-linked lists.") + (license license:lgpl2.1+))) -- cgit v1.2.3 From f9cdf1c15b83392fc85e7dcbfa019d184356591b Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Thu, 16 Mar 2017 15:30:15 +0100 Subject: gnu: Add knot. * gnu/packages/dns.scm (knot): New variable. --- gnu/packages/dns.scm | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 80 insertions(+), 1 deletion(-) diff --git a/gnu/packages/dns.scm b/gnu/packages/dns.scm index f347240410..d09abc1366 100644 --- a/gnu/packages/dns.scm +++ b/gnu/packages/dns.scm @@ -5,7 +5,7 @@ ;;; Copyright © 2016 Efraim Flashner ;;; Copyright © 2016 John Darrington ;;; Copyright © 2016 ng0 -;;; Copyright © 2016 Tobias Geerinckx-Rice +;;; Copyright © 2016, 2017 Tobias Geerinckx-Rice ;;; Copyright © 2016 Marius Bakke ;;; ;;; This file is part of GNU Guix. @@ -24,17 +24,25 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu packages dns) + #:use-module (gnu packages admin) #:use-module (gnu packages autotools) #:use-module (gnu packages base) #:use-module (gnu packages databases) #:use-module (gnu packages crypto) + #:use-module (gnu packages datastructures) #:use-module (gnu packages glib) #:use-module (gnu packages groff) + #:use-module (gnu packages groff) + #:use-module (gnu packages libedit) #:use-module (gnu packages libevent) + #:use-module (gnu packages libidn) #:use-module (gnu packages linux) + #:use-module (gnu packages ncurses) + #:use-module (gnu packages nettle) #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) #:use-module (gnu packages tls) + #:use-module (gnu packages web) #:use-module (gnu packages xml) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) @@ -304,3 +312,74 @@ footprint than other implementations, while remaining fully RFC-compliant. YADIFA supports dynamic record updates and the @dfn{Domain Name System Security Extensions} (DNSSEC).") (license license:bsd-3))) + +(define-public knot + (package + (name "knot") + (version "2.4.1") + (source (origin + (method url-fetch) + (uri (string-append "https://secure.nic.cz/files/knot-dns/" + name "-" version ".tar.xz")) + (sha256 + (base32 + "0k3hkc6vqj8yd479zdn80ki5f0vnjhrm4fka7kfj9z7mkgwxsr60")) + (modules '((guix build utils))) + (snippet + '(begin + ;; Remove bundled libraries and dependencies on them. + (substitute* "configure" + (("src/contrib/dnstap/Makefile") "")) + (substitute* "src/Makefile.in" + (("contrib/dnstap ") "")) + (with-directory-excursion "src/contrib" + (for-each delete-file-recursively + (list "dnstap" "lmdb"))))))) + (build-system gnu-build-system) + (native-inputs + `(("pkg-config" ,pkg-config))) + (inputs + `(("gnutls" ,gnutls) + ("jansson" ,jansson) + ("libcap-ng" ,libcap-ng) + ("libedit" ,libedit) + ("libidn" ,libidn) + ("liburcu" ,liburcu) + ("lmdb" ,lmdb) + ("ncurses" ,ncurses) + ("nettle" ,nettle))) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-before 'configure 'disable-directory-pre-creation + (lambda _ + ;; Don't install empty directories like ‘/etc’ outside the store. + (substitute* "src/Makefile.in" (("\\$\\(INSTALL\\) -d") "true")))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (doc (string-append out "/share/doc/knot")) + (etc (string-append doc "/examples/etc"))) + (zero? + (system* "make" + (string-append "config_dir=" etc) + "install")))))) + #:configure-flags + (list "--sysconfdir=/etc" + "--localstatedir=/var" + "--enable-rosedb" ; serve static records from a database + (string-append "--with-bash-completions=" + (assoc-ref %outputs "out") + "/etc/bash_completion.d")))) + (home-page "https://www.knot-dns.cz/") + (synopsis "Authoritative DNS name server") + (description "Knot DNS is an authorative name server for the @dfn{Domain +Name System} (DNS), designed to meet the needs of root and @dfn{top-level +domain} (TLD) name servers. It is implemented as a threaded daemon and uses a +number of programming techniques to improve speed. For example, the responder +is completely lock-free, resulting in a very high response rate. Other features +include automatic @dfn{DNS Security Extensions} (DNSSEC) signing, dynamic record +synthesis, and on-the-fly re-configuration.") + (license (list license:expat ; src/contrib/{hat-trie,murmurhash3} + license:lgpl2.0+ ; parts of scr/contrib/ucw + license:gpl3+)))) ; everything else -- cgit v1.2.3 From 3078821d1380c26c738be6b5d430c595327d401f Mon Sep 17 00:00:00 2001 From: Kei Kebreau Date: Thu, 16 Mar 2017 01:37:42 -0400 Subject: gnu: asciidoc: Use local docbook-xml package. * gnu/packages/documentation.scm (asciidoc)[inputs]: Add docbook-xml. [arguments]: Add 'make-local-docbook-xml' phase. --- gnu/packages/documentation.scm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gnu/packages/documentation.scm b/gnu/packages/documentation.scm index 94e979c881..8b943788a6 100644 --- a/gnu/packages/documentation.scm +++ b/gnu/packages/documentation.scm @@ -83,8 +83,17 @@ release/xsl/current") (string-append (assoc-ref inputs "docbook-xsl") "/xml/xsl/docbook-xsl-" ,(package-version docbook-xsl))))) + #t)) + ;; Do the same for docbook-xml. + (add-before 'install 'make-local-docbook-xml + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "docbook45.conf" + (("http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd") + (string-append (assoc-ref inputs "docbook-xml") + "/xml/dtd/docbook/docbookx.dtd"))) #t))))) (inputs `(("python" ,python-2) + ("docbook-xml" ,docbook-xml) ("docbook-xsl" ,docbook-xsl) ("libxml2" ,libxml2) ("libxslt" ,libxslt))) -- cgit v1.2.3 From 54d556bdd739dc617c27eeedf9e28706e3277d0e Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Fri, 17 Mar 2017 03:08:45 +0100 Subject: gnu: youtube-dl: Update to 2017.03.16. * gnu/packages/video.scm (youtube-dl): Update to 2017.03.16. --- gnu/packages/video.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm index 9e18790d6f..9142dd95f2 100644 --- a/gnu/packages/video.scm +++ b/gnu/packages/video.scm @@ -975,7 +975,7 @@ access to mpv's powerful playback capabilities.") (define-public youtube-dl (package (name "youtube-dl") - (version "2017.03.15") + (version "2017.03.16") (source (origin (method url-fetch) (uri (string-append "https://yt-dl.org/downloads/" @@ -983,7 +983,7 @@ access to mpv's powerful playback capabilities.") version ".tar.gz")) (sha256 (base32 - "0h561pbphdkfalir9awp0k4fmsnzdf6kx56adb9bb0v9pfsb1y0f")))) + "14nlgl0kh4mwl7sx58vd7nxr5iklxi00612lmydy91ngm6ykrpsm")))) (build-system python-build-system) (arguments ;; The problem here is that the directory for the man page and completion -- cgit v1.2.3 From 708b54a99252d3929b8062bc57167cc6d097a126 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 17 Mar 2017 09:44:08 +0100 Subject: doc: Really document 'guix pack --format'. * doc/guix.texi (Invoking guix pack): Properly document --format. --- doc/guix.texi | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 93640dfba5..3db6dad5f3 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -2438,11 +2438,8 @@ guix pack -S /opt/gnu/bin=bin guile emacs geiser @noindent That way, users can happily type @file{/opt/gnu/bin/guile} and enjoy. -Alternatively, you can produce a pack in the Docker image format, as -described in -@uref{https://github.com/docker/docker/blob/master/image/spec/v1.2.md, -version 1.2 of the specification}. This is what the following command -does: +Alternatively, you can produce a pack in the Docker image format using +the following command: @example guix pack -f docker guile emacs geiser @@ -2457,6 +2454,23 @@ documentation} for more information. Several command-line options allow you to customize your pack: @table @code +@item --format=@var{format} +@itemx -f @var{format} +Produce a pack in the given @var{format}. + +The available formats are: + +@table @code +@item tarball +This is the default format. It produces a tarball containing all the +specifies binaries and symlinks. + +@item docker +This produces a tarball that follows the +@uref{https://github.com/docker/docker/blob/master/image/spec/v1.2.md, +Docker Image Specification}. +@end table + @item --system=@var{system} @itemx -s @var{system} Attempt to build for @var{system}---e.g., @code{i686-linux}---instead of -- cgit v1.2.3 From 8f0069170c261642fd0b3128c3eb194e4ba2efca Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Sun, 12 Mar 2017 00:11:56 +0100 Subject: gnu: Add r-boot. * gnu/packages/statistics.scm (r-boot): New variable. --- gnu/packages/statistics.scm | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm index 75bdb5df83..54305a2f86 100644 --- a/gnu/packages/statistics.scm +++ b/gnu/packages/statistics.scm @@ -220,6 +220,27 @@ publication-quality data plots. A large amount of 3rd-party packages are available, greatly increasing its breadth and scope.") (license license:gpl3+))) +(define-public r-boot + (package + (name "r-boot") + (version "1.3-18") + (source + (origin + (method url-fetch) + (uri (cran-uri "boot" version)) + (sha256 + (base32 + "0pi348vvgzn1ny54yxhw6kq6nl7rx9bpr9ji1a6wqs8ah5zj7z8j")))) + (build-system r-build-system) + (home-page "http://cran.r-project.org/web/packages/boot") + (synopsis "Bootstrap functions for R") + (description + "This package provides functions and datasets for bootstrapping from the +book \"Bootstrap Methods and Their Application\" by A.C. Davison and +D.V. Hinkley (1997, CUP), originally written by Angelo Canty for S.") + ;; Unlimited distribution + (license (license:non-copyleft "file://R/bootfuns.q")))) + (define-public r-bit (package (name "r-bit") -- cgit v1.2.3 From c7e80a7e0d4c1ec9d6c127e6f335a5424d1e06e8 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Sun, 12 Mar 2017 00:12:18 +0100 Subject: gnu: Add r-mass. * gnu/packages/statistics.scm (r-mass): New variable. --- gnu/packages/statistics.scm | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm index 54305a2f86..189a1d2998 100644 --- a/gnu/packages/statistics.scm +++ b/gnu/packages/statistics.scm @@ -241,6 +241,27 @@ D.V. Hinkley (1997, CUP), originally written by Angelo Canty for S.") ;; Unlimited distribution (license (license:non-copyleft "file://R/bootfuns.q")))) +(define-public r-mass + (package + (name "r-mass") + (version "7.3-45") + (source + (origin + (method url-fetch) + (uri (cran-uri "MASS" version)) + (sha256 + (base32 + "13lp5919h2bnpmf8rbmkar8a41yx62fnx66pkvljvqf60wa29qsx")))) + (properties `((upstream-name . "MASS"))) + (build-system r-build-system) + (home-page "http://www.stats.ox.ac.uk/pub/MASS4/") + (synopsis "Support functions and datasets for Venables and Ripley's MASS") + (description + "This package provides functions and datasets for the book \"Modern +Applied Statistics with S\" (4th edition, 2002) by Venables and Ripley.") + ;; Either version may be picked. + (license (list license:gpl2 license:gpl3)))) + (define-public r-bit (package (name "r-bit") -- cgit v1.2.3 From 74892587517974997cdbcc81b19fe092af353a6d Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Sun, 12 Mar 2017 00:12:41 +0100 Subject: gnu: Add r-class. * gnu/packages/statistics.scm (r-class): New variable. --- gnu/packages/statistics.scm | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm index 189a1d2998..9199c0b9e0 100644 --- a/gnu/packages/statistics.scm +++ b/gnu/packages/statistics.scm @@ -262,6 +262,28 @@ Applied Statistics with S\" (4th edition, 2002) by Venables and Ripley.") ;; Either version may be picked. (license (list license:gpl2 license:gpl3)))) +(define-public r-class + (package + (name "r-class") + (version "7.3-14") + (source + (origin + (method url-fetch) + (uri (cran-uri "class" version)) + (sha256 + (base32 + "173b8a16lh1i0zjmr784l0xr0azp9v8bgslh12hfdswbq7dpdf0q")))) + (build-system r-build-system) + (propagated-inputs + `(("r-mass" ,r-mass))) + (home-page "http://www.stats.ox.ac.uk/pub/MASS4/") + (synopsis "R functions for classification") + (description + "This package provides various functions for classification, including +k-nearest neighbour, Learning Vector Quantization and Self-Organizing Maps.") + ;; Either of the two versions can be picked. + (license (list license:gpl2 license:gpl3)))) + (define-public r-bit (package (name "r-bit") -- cgit v1.2.3 From a27bfb84848cd0c1bc7d864cf1f1592e5504ff4c Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Sun, 12 Mar 2017 00:13:01 +0100 Subject: gnu: Add r-cluster. * gnu/packages/statistics.scm (r-cluster): New variable. --- gnu/packages/statistics.scm | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm index 9199c0b9e0..1492dccfb4 100644 --- a/gnu/packages/statistics.scm +++ b/gnu/packages/statistics.scm @@ -284,6 +284,26 @@ k-nearest neighbour, Learning Vector Quantization and Self-Organizing Maps.") ;; Either of the two versions can be picked. (license (list license:gpl2 license:gpl3)))) +(define-public r-cluster + (package + (name "r-cluster") + (version "2.0.5") + (source + (origin + (method url-fetch) + (uri (cran-uri "cluster" version)) + (sha256 + (base32 + "1bkvqmv8h2c423q9ag2afb6s9j2vcdlxsf559zzbimraphrr2c2b")))) + (build-system r-build-system) + (home-page "http://cran.r-project.org/web/packages/cluster") + (synopsis "Methods for cluster analysis") + (description + "This package provides methods for cluster analysis. It is a much +extended version of the original from Peter Rousseeuw, Anja Struyf and Mia +Hubert, based on Kaufman and Rousseeuw (1990) \"Finding Groups in Data\".") + (license license:gpl2+))) + (define-public r-bit (package (name "r-bit") -- cgit v1.2.3 From c1999c591023a4dfce69304d986b387a116663a2 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Sun, 12 Mar 2017 00:13:27 +0100 Subject: gnu: Add r-codetools. * gnu/packages/statistics.scm (r-codetools): New variable. --- gnu/packages/statistics.scm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm index 1492dccfb4..cbf5c14b1a 100644 --- a/gnu/packages/statistics.scm +++ b/gnu/packages/statistics.scm @@ -304,6 +304,24 @@ extended version of the original from Peter Rousseeuw, Anja Struyf and Mia Hubert, based on Kaufman and Rousseeuw (1990) \"Finding Groups in Data\".") (license license:gpl2+))) +(define-public r-codetools + (package + (name "r-codetools") + (version "0.2-15") + (source + (origin + (method url-fetch) + (uri (cran-uri "codetools" version)) + (sha256 + (base32 + "0h7sjmvvsi35041jp47cxhsqzgf1y8jrw6fxii7n26i8g7nrh1sf")))) + (build-system r-build-system) + (home-page "http://cran.r-project.org/web/packages/codetools") + (synopsis "Code analysis tools for R") + (description "This package provides code analysis tools for R.") + ;; Any version of the GPL. + (license (list license:gpl2+ license:gpl3+)))) + (define-public r-bit (package (name "r-bit") -- cgit v1.2.3 From 69fddd2d6e4c77ea39640ebb85ec306a26e5b3c1 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Sun, 12 Mar 2017 00:13:43 +0100 Subject: gnu: Add r-foreign. * gnu/packages/statistics.scm (r-foreign): New variable. --- gnu/packages/statistics.scm | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm index cbf5c14b1a..2317b37c38 100644 --- a/gnu/packages/statistics.scm +++ b/gnu/packages/statistics.scm @@ -322,6 +322,26 @@ Hubert, based on Kaufman and Rousseeuw (1990) \"Finding Groups in Data\".") ;; Any version of the GPL. (license (list license:gpl2+ license:gpl3+)))) +(define-public r-foreign + (package + (name "r-foreign") + (version "0.8-67") + (source + (origin + (method url-fetch) + (uri (cran-uri "foreign" version)) + (sha256 + (base32 + "1mcrm2pydimbyjhkrw5h380bifj1jhwzifph1xgh90asf3lvd1xd")))) + (build-system r-build-system) + (home-page "http://cran.r-project.org/web/packages/foreign") + (synopsis "Read data stored by other statistics software") + (description + "This package provides functions for reading and writing data stored by +some versions of Epi Info, Minitab, S, SAS, SPSS, Stata, Systat and Weka and +for reading and writing some dBase files.") + (license license:gpl2+))) + (define-public r-bit (package (name "r-bit") -- cgit v1.2.3 From e88bad6ddb5a230a34acff2577ee24af95f0ac12 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Sun, 12 Mar 2017 00:14:00 +0100 Subject: gnu: Add r-kernsmooth. * gnu/packages/statistics.scm (r-kernsmooth): New variable. --- gnu/packages/statistics.scm | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm index 2317b37c38..0b092ed153 100644 --- a/gnu/packages/statistics.scm +++ b/gnu/packages/statistics.scm @@ -342,6 +342,28 @@ some versions of Epi Info, Minitab, S, SAS, SPSS, Stata, Systat and Weka and for reading and writing some dBase files.") (license license:gpl2+))) +(define-public r-kernsmooth + (package + (name "r-kernsmooth") + (version "2.23-15") + (source + (origin + (method url-fetch) + (uri (cran-uri "KernSmooth" version)) + (sha256 + (base32 + "1xhha8kw10jv8pv8b61hb5in9qiw3r2a9kdji3qlm991s4zd4wlb")))) + (properties `((upstream-name . "KernSmooth"))) + (build-system r-build-system) + (home-page "http://cran.r-project.org/web/packages/KernSmooth") + (synopsis "Functions for kernel smoothing") + (description + "This package provides functions for kernel smoothing (and density +estimation) corresponding to the book: Wand, M.P. and Jones, M.C. (1995) +\"Kernel Smoothing\".") + ;; Unlimited distribution + (license (license:non-copyleft "file://LICENCE.note")))) + (define-public r-bit (package (name "r-bit") -- cgit v1.2.3 From 060c12868bb232c5275a76ceabb3a966b04bf7a6 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Sun, 12 Mar 2017 00:14:34 +0100 Subject: gnu: r-lattice: Move to other recommended R packages. * gnu/packages/statistics.scm (r-lattice): Move to the set of recommended R packages. --- gnu/packages/statistics.scm | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm index 0b092ed153..0fa3be42cc 100644 --- a/gnu/packages/statistics.scm +++ b/gnu/packages/statistics.scm @@ -364,6 +364,26 @@ estimation) corresponding to the book: Wand, M.P. and Jones, M.C. (1995) ;; Unlimited distribution (license (license:non-copyleft "file://LICENCE.note")))) +(define-public r-lattice + (package + (name "r-lattice") + (version "0.20-34") + (source (origin + (method url-fetch) + (uri (cran-uri "lattice" version)) + (sha256 + (base32 + "0615h69czr73k47whhzimf1qxv5qk0cabcrkljwhyrn6m6piq6ja")))) + (build-system r-build-system) + (home-page "http://lattice.r-forge.r-project.org/") + (synopsis "High-level data visualization system") + (description + "The lattice package provides a powerful and elegant high-level data +visualization system inspired by Trellis graphics, with an emphasis on +multivariate data. Lattice is sufficient for typical graphics needs, and is +also flexible enough to handle most nonstandard requirements.") + (license license:gpl2+))) + (define-public r-bit (package (name "r-bit") @@ -2171,26 +2191,6 @@ scaling functions for R.") "This package provides an integration of base and grid graphics for R.") (license license:gpl2+))) -(define-public r-lattice - (package - (name "r-lattice") - (version "0.20-34") - (source (origin - (method url-fetch) - (uri (cran-uri "lattice" version)) - (sha256 - (base32 - "0615h69czr73k47whhzimf1qxv5qk0cabcrkljwhyrn6m6piq6ja")))) - (build-system r-build-system) - (home-page "http://lattice.r-forge.r-project.org/") - (synopsis "High-level data visualization system") - (description - "The lattice package provides a powerful and elegant high-level data -visualization system inspired by Trellis graphics, with an emphasis on -multivariate data. Lattice is sufficient for typical graphics needs, and is -also flexible enough to handle most nonstandard requirements.") - (license license:gpl2+))) - (define-public r-latticeextra (package (name "r-latticeextra") -- cgit v1.2.3 From 69e14f9ec756996e4e4dbcb57444cdb7ac1a642b Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Sun, 12 Mar 2017 00:15:44 +0100 Subject: gnu: r-matrix: Move to set of recommended R packages. * gnu/packages/statistics.scm (r-matrix): Move to set of recommended R packages. --- gnu/packages/statistics.scm | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm index 0fa3be42cc..23d6c9392b 100644 --- a/gnu/packages/statistics.scm +++ b/gnu/packages/statistics.scm @@ -384,6 +384,28 @@ multivariate data. Lattice is sufficient for typical graphics needs, and is also flexible enough to handle most nonstandard requirements.") (license license:gpl2+))) +(define-public r-matrix + (package + (name "r-matrix") + (version "1.2-7.1") + (source + (origin + (method url-fetch) + (uri (cran-uri "Matrix" version)) + (sha256 + (base32 + "09rd51na9spz0lm1lylkfhw43w7c922b83m4jsggmpg3pbd6dssa")))) + (properties `((upstream-name . "Matrix"))) + (build-system r-build-system) + (propagated-inputs + `(("r-lattice" ,r-lattice))) + (home-page "http://Matrix.R-forge.R-project.org/") + (synopsis "Sparse and dense matrix classes and methods") + (description + "This package provides classes and methods for dense and sparse matrices +and operations on them using LAPACK and SuiteSparse.") + (license license:gpl2+))) + (define-public r-bit (package (name "r-bit") @@ -623,28 +645,6 @@ and Francois (2011, JSS), and the book by Eddelbuettel (2013, Springer); see 'citation(\"Rcpp\")' for details on these last two.") (license license:gpl2+))) -(define-public r-matrix - (package - (name "r-matrix") - (version "1.2-7.1") - (source - (origin - (method url-fetch) - (uri (cran-uri "Matrix" version)) - (sha256 - (base32 - "09rd51na9spz0lm1lylkfhw43w7c922b83m4jsggmpg3pbd6dssa")))) - (properties `((upstream-name . "Matrix"))) - (build-system r-build-system) - (propagated-inputs - `(("r-lattice" ,r-lattice))) - (home-page "http://Matrix.R-forge.R-project.org/") - (synopsis "Sparse and dense matrix classes and methods") - (description - "This package provides classes and methods for dense and sparse matrices -and operations on them using LAPACK and SuiteSparse.") - (license license:gpl2+))) - (define-public r-mgcv (package (name "r-mgcv") -- cgit v1.2.3 From 248f65269a51ed8a541f4db06e39fae2a2733aff Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Sun, 12 Mar 2017 00:16:44 +0100 Subject: gnu: Add r-nlme. * gnu/packages/statistics.scm (r-nlme): New variable. --- gnu/packages/statistics.scm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm index 23d6c9392b..c072bcbcba 100644 --- a/gnu/packages/statistics.scm +++ b/gnu/packages/statistics.scm @@ -406,6 +406,29 @@ also flexible enough to handle most nonstandard requirements.") and operations on them using LAPACK and SuiteSparse.") (license license:gpl2+))) +(define-public r-nlme + (package + (name "r-nlme") + (version "3.1-131") + (source + (origin + (method url-fetch) + (uri (cran-uri "nlme" version)) + (sha256 + (base32 + "0k2nvdzhic6bzhfsbq6la6q6a1i5nlj4pnh6lpdxiiwvxdks3nkr")))) + (build-system r-build-system) + (propagated-inputs + `(("r-lattice" ,r-lattice))) + (native-inputs + `(("gfortran" ,gfortran))) + (home-page "http://cran.r-project.org/web/packages/nlme") + (synopsis "Linear and nonlinear mixed effects models") + (description + "This package provides tools to fit and compare Gaussian linear and +nonlinear mixed-effects models.") + (license license:gpl2+))) + (define-public r-bit (package (name "r-bit") -- cgit v1.2.3 From ac8d738b97a6da8ffda5ee3dcf2c3bdc3e595344 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Sun, 12 Mar 2017 00:17:13 +0100 Subject: gnu: r-mgcv: Move to set of recommended R packages. * gnu/packages/statistics.scm (r-mgcv): Move up to set of recommended R packages. --- gnu/packages/statistics.scm | 45 ++++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm index c072bcbcba..e5237d5099 100644 --- a/gnu/packages/statistics.scm +++ b/gnu/packages/statistics.scm @@ -429,6 +429,30 @@ and operations on them using LAPACK and SuiteSparse.") nonlinear mixed-effects models.") (license license:gpl2+))) +(define-public r-mgcv + (package + (name "r-mgcv") + (version "1.8-16") + (source + (origin + (method url-fetch) + (uri (cran-uri "mgcv" version)) + (sha256 + (base32 + "0pj31gdwra7nv8spys4pfcbmsik99q1y1d0d2g37ywc3sz5s0rlj")))) + (build-system r-build-system) + (propagated-inputs + `(("r-matrix" ,r-matrix) + ("r-nlme" ,r-nlme))) + (home-page "http://cran.r-project.org/web/packages/mgcv") + (synopsis "Mixed generalised additive model computation") + (description + "GAMs, GAMMs and other generalized ridge regression with multiple smoothing +parameter estimation by GCV, REML or UBRE/AIC. The library includes a +@code{gam()} function, a wide variety of smoothers, JAGS support and +distributions beyond the exponential family.") + (license license:gpl2+))) + (define-public r-bit (package (name "r-bit") @@ -668,27 +692,6 @@ and Francois (2011, JSS), and the book by Eddelbuettel (2013, Springer); see 'citation(\"Rcpp\")' for details on these last two.") (license license:gpl2+))) -(define-public r-mgcv - (package - (name "r-mgcv") - (version "1.8-16") - (source - (origin - (method url-fetch) - (uri (cran-uri "mgcv" version)) - (sha256 - (base32 - "0pj31gdwra7nv8spys4pfcbmsik99q1y1d0d2g37ywc3sz5s0rlj")))) - (build-system r-build-system) - (home-page "http://cran.r-project.org/web/packages/mgcv") - (synopsis "Mixed generalised additive model computation") - (description - "GAMs, GAMMs and other generalized ridge regression with multiple smoothing -parameter estimation by GCV, REML or UBRE/AIC. The library includes a -@code{gam()} function, a wide variety of smoothers, JAGS support and -distributions beyond the exponential family.") - (license license:gpl2+))) - (define-public r-permute (package (name "r-permute") -- cgit v1.2.3 From a5a343656b6691ee39cebcaf22952c64e8bbf78a Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Sun, 12 Mar 2017 00:17:55 +0100 Subject: gnu: r-nnet: Move to set of recommended R packages. * gnu/packages/machine-learning.scm (r-nnet): Move from here... * gnu/packages/statistics.scm (r-nnet): ...to here because the other recommended R packages are here. --- gnu/packages/machine-learning.scm | 19 ------------------- gnu/packages/statistics.scm | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index 7bad833b38..73c78744f8 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -460,25 +460,6 @@ adaptive sparsity and the Wong algorithm for adaptively sparse gaussian geometric models.") (license license:lgpl3+))) -(define-public r-nnet - (package - (name "r-nnet") - (version "7.3-12") - (source - (origin - (method url-fetch) - (uri (cran-uri "nnet" version)) - (sha256 - (base32 - "17amqnw9dpap2w8ivx53hxha2xrm0drwfnj32li0xk41hlz548r7")))) - (build-system r-build-system) - (home-page "http://www.stats.ox.ac.uk/pub/MASS4/") - (synopsis "Feed-forward neural networks and multinomial log-linear models") - (description - "This package provides functions for feed-forward neural networks with a -single hidden layer, and for multinomial log-linear models.") - (license (list license:gpl2+ license:gpl3+)))) - (define-public r-kernlab (package (name "r-kernlab") diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm index e5237d5099..29cf32a60e 100644 --- a/gnu/packages/statistics.scm +++ b/gnu/packages/statistics.scm @@ -453,6 +453,25 @@ parameter estimation by GCV, REML or UBRE/AIC. The library includes a distributions beyond the exponential family.") (license license:gpl2+))) +(define-public r-nnet + (package + (name "r-nnet") + (version "7.3-12") + (source + (origin + (method url-fetch) + (uri (cran-uri "nnet" version)) + (sha256 + (base32 + "17amqnw9dpap2w8ivx53hxha2xrm0drwfnj32li0xk41hlz548r7")))) + (build-system r-build-system) + (home-page "http://www.stats.ox.ac.uk/pub/MASS4/") + (synopsis "Feed-forward neural networks and multinomial log-linear models") + (description + "This package provides functions for feed-forward neural networks with a +single hidden layer, and for multinomial log-linear models.") + (license (list license:gpl2+ license:gpl3+)))) + (define-public r-bit (package (name "r-bit") -- cgit v1.2.3 From 567b154fb0c7fd123a9f29caaa5441751e5b569e Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Sun, 12 Mar 2017 00:19:00 +0100 Subject: gnu: r-rpart: Move to the set of recommended packages. * gnu/packages/statistics.scm (r-rpart): Move up to the set of recommended packages. --- gnu/packages/statistics.scm | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm index 29cf32a60e..8780027d3c 100644 --- a/gnu/packages/statistics.scm +++ b/gnu/packages/statistics.scm @@ -472,6 +472,25 @@ distributions beyond the exponential family.") single hidden layer, and for multinomial log-linear models.") (license (list license:gpl2+ license:gpl3+)))) +(define-public r-rpart + (package + (name "r-rpart") + (version "4.1-10") + (source + (origin + (method url-fetch) + (uri (cran-uri "rpart" version)) + (sha256 + (base32 + "119dvh2cpab4vq9blvbkil5hgq6w018amiwlda3ii0fki39axpf5")))) + (build-system r-build-system) + (home-page "http://cran.r-project.org/web/packages/rpart") + (synopsis "Recursive partitioning and regression trees") + (description + "This package provides recursive partitioning functions for +classification, regression and survival trees.") + (license (list license:gpl2+ license:gpl3+)))) + (define-public r-bit (package (name "r-bit") @@ -3644,25 +3663,6 @@ following problems: @end enumerate\n") (license license:gpl3+))) -(define-public r-rpart - (package - (name "r-rpart") - (version "4.1-10") - (source - (origin - (method url-fetch) - (uri (cran-uri "rpart" version)) - (sha256 - (base32 - "119dvh2cpab4vq9blvbkil5hgq6w018amiwlda3ii0fki39axpf5")))) - (build-system r-build-system) - (home-page "http://cran.r-project.org/web/packages/rpart") - (synopsis "Recursive partitioning and regression trees") - (description - "This package provides recursive partitioning functions for -classification, regression and survival trees.") - (license (list license:gpl2+ license:gpl3+)))) - (define-public r-survival (package (name "r-survival") -- cgit v1.2.3 From 4b005c7a7529838396ab74eceaaca08f66f0608c Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Sun, 12 Mar 2017 00:19:41 +0100 Subject: gnu: Add r-spatial. * gnu/packages/statistics.scm (r-spatial): New variable. --- gnu/packages/statistics.scm | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm index 8780027d3c..b338efcda2 100644 --- a/gnu/packages/statistics.scm +++ b/gnu/packages/statistics.scm @@ -491,6 +491,26 @@ single hidden layer, and for multinomial log-linear models.") classification, regression and survival trees.") (license (list license:gpl2+ license:gpl3+)))) +(define-public r-spatial + (package + (name "r-spatial") + (version "7.3-11") + (source + (origin + (method url-fetch) + (uri (cran-uri "spatial" version)) + (sha256 + (base32 + "04aw8j533sn63ybyrf4hyhrqm4058vfcb7yhjy07kq92mk94hi32")))) + (build-system r-build-system) + (home-page "http://www.stats.ox.ac.uk/pub/MASS4/") + (synopsis "Functions for kriging and point pattern analysis") + (description + "This package provides functions for kriging and point pattern +analysis.") + ;; Either version may be picked. + (license (list license:gpl2 license:gpl3)))) + (define-public r-bit (package (name "r-bit") -- cgit v1.2.3 From 6eaa9bfba6aaf14af26c78d0618954f692a090a5 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Sun, 12 Mar 2017 00:20:03 +0100 Subject: gnu: r-survival: Move to set of recommended R packages. * gnu/packages/statistics.scm (r-survival): Move up to set of recommended R packages. --- gnu/packages/statistics.scm | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm index b338efcda2..c836409b61 100644 --- a/gnu/packages/statistics.scm +++ b/gnu/packages/statistics.scm @@ -511,6 +511,28 @@ analysis.") ;; Either version may be picked. (license (list license:gpl2 license:gpl3)))) +(define-public r-survival + (package + (name "r-survival") + (version "2.40-1") + (source + (origin + (method url-fetch) + (uri (cran-uri "survival" version)) + (sha256 + (base32 + "10pf0kq0g66k5rgizrvh29mq3r84acljw2jgrv5yp6z38xw23mci")))) + (build-system r-build-system) + (propagated-inputs + `(("r-matrix" ,r-matrix))) + (home-page "https://github.com/therneau/survival") + (synopsis "Survival analysis") + (description + "This package contains the core survival analysis routines, including +definition of Surv objects, Kaplan-Meier and Aalen-Johansen (multi-state) +curves, Cox models, and parametric accelerated failure time models.") + (license license:lgpl2.0+))) + (define-public r-bit (package (name "r-bit") @@ -3683,26 +3705,6 @@ following problems: @end enumerate\n") (license license:gpl3+))) -(define-public r-survival - (package - (name "r-survival") - (version "2.40-1") - (source - (origin - (method url-fetch) - (uri (cran-uri "survival" version)) - (sha256 - (base32 - "10pf0kq0g66k5rgizrvh29mq3r84acljw2jgrv5yp6z38xw23mci")))) - (build-system r-build-system) - (home-page "https://github.com/therneau/survival") - (synopsis "Survival analysis") - (description - "This package contains the core survival analysis routines, including -definition of Surv objects, Kaplan-Meier and Aalen-Johansen (multi-state) -curves, Cox models, and parametric accelerated failure time models.") - (license license:lgpl2.0+))) - (define-public r-base64 (package (name "r-base64") -- cgit v1.2.3 From aeb64f3cb295f63ecea772716c5576cfd8223dd8 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Sun, 12 Mar 2017 00:21:39 +0100 Subject: gnu: r: Do not build recommended packages. * gnu/packages/statistics.scm (r)[arguments]: Rename phase "build-recommended-packages-reproducibly" to "build-reproducibly"; add configure flag "--without-recommended-packages". * guix/import/cran.scm (default-r-packages): Remove recommended packages. * gnu/packages/python.scm (python-rpy2)[inputs]: Add r-survival. * gnu/packages/bioinformatics.scm (r-ape)[propagated-inputs]: Add r-lattice and r-nlme. (r-vegan)[propagated-inputs]: Add r-mass. (r-genefilter)[propagated-inputs]: Add r-survival. (r-grohmm)[propagated-inputs]: Add r-mass. (r-bioccheck)[propagated-inputs]: Add r-codetools. (r-summarizedexperiment)[propagated-inputs]: Add r-matrix. (r-topgo)[propagated-inputs]: Add r-lattice. (r-sva)[propagated-inputs]: Add r-mgcv. (r-raremetals2)[propagated-inputs]: Add r-mass. (r-vsn)[propagated-inputs]: Add r-lattice. (r-pcamethods)[propagated-inputs]: Add r-mass. * gnu/packages/bioinformatics.scm (r-ggplot2)[propagated-inputs]: Add r-mass. (r-locfit)[propagated-inputs]: Add r-lattice. (r-coda)[propagated-inputs]: Add r-lattice. (r-irlba)[propagated-inputs]: Add r-matrix. (r-glmnet)[propagated-inputs]: Add r-matrix. (r-e1071)[propagated-inputs]: Add r-class. (r-spams)[propagated-inputs]: Add r-lattice and r-matrix. (r-hmisc)[propagated-inputs]: Add r-cluster, r-foreign, r-lattice, r-nnet, and r-rpart. (r-zoo)[propagated-inputs]: Add r-lattice. (r-mixtools)[propagated-inputs]: Add r-boot and r-mass. (r-flexmix)[propagated-inputs]: Add r-lattice and r-nnet. (r-prabclus)[propagated-inputs]: Add r-mass. (r-fpc)[propagated-inputs]: Add r-class, r-cluster, and r-mass. (r-rcppeigen)[propagated-inputs]: Add r-matrix. (r-matrixmodels)[propagated-inputs]: Add r-matrix. (r-lme4)[propagated-inputs]: Add r-mass and r-nlme. (r-pbkrtest)[propagated-inputs]: Add r-mass and r-matrix. (r-car)[propagated-inputs]: Add r-mass, r-mgcv, and r-nnet. (r-tclust)[propagated-inputs]: Add r-cluster. --- gnu/packages/bioinformatics.scm | 21 +++++++++-- gnu/packages/python.scm | 3 +- gnu/packages/statistics.scm | 83 ++++++++++++++++++++++++++++++----------- guix/import/cran.scm | 18 +-------- 4 files changed, 82 insertions(+), 43 deletions(-) diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm index 077f9b2885..bd3c97b721 100644 --- a/gnu/packages/bioinformatics.scm +++ b/gnu/packages/bioinformatics.scm @@ -108,6 +108,9 @@ (base32 "0959fiiy11rzfzrzaknmgrx64bhszj02l0ycz79k5a6bmpfzanlk")))) (build-system r-build-system) + (propagated-inputs + `(("r-lattice" ,r-lattice) + ("r-nlme" ,r-nlme))) (home-page "http://ape-package.ird.fr/") (synopsis "Analyses of phylogenetics and evolution") (description @@ -5353,6 +5356,7 @@ information as possible.") (propagated-inputs `(("r-cluster" ,r-cluster) ("r-lattice" ,r-lattice) + ("r-mass" ,r-mass) ("r-mgcv" ,r-mgcv) ("r-permute" ,r-permute))) (home-page "https://cran.r-project.org/web/packages/vegan") @@ -5434,7 +5438,8 @@ microarrays.") `(("r-annotate" ,r-annotate) ("r-annotationdbi" ,r-annotationdbi) ("r-biobase" ,r-biobase) - ("r-s4vectors" ,r-s4vectors))) + ("r-s4vectors" ,r-s4vectors) + ("r-survival" ,r-survival))) (home-page "http://bioconductor.org/packages/genefilter") (synopsis "Filter genes from high-throughput experiments") (description @@ -5732,6 +5737,7 @@ annotation infrastructure.") ("r-genomicalignments" ,r-genomicalignments) ("r-genomicranges" ,r-genomicranges) ("r-iranges" ,r-iranges) + ("r-mass" ,r-mass) ("r-rtracklayer" ,r-rtracklayer) ("r-s4vectors" ,r-s4vectors))) (home-page "https://github.com/Kraus-Lab/groHMM") @@ -6131,7 +6137,8 @@ functionality.") (native-inputs `(("which" ,which))) (propagated-inputs - `(("r-graph" ,r-graph) + `(("r-codetools" ,r-codetools) + ("r-graph" ,r-graph) ("r-knitr" ,r-knitr) ("r-httr" ,r-httr) ("r-optparse" ,r-optparse) @@ -6659,6 +6666,7 @@ files.") ("r-genomeinfodb" ,r-genomeinfodb) ("r-genomicranges" ,r-genomicranges) ("r-iranges" ,r-iranges) + ("r-matrix" ,r-matrix) ("r-s4vectors" ,r-s4vectors))) (home-page "http://bioconductor.org/packages/SummarizedExperiment") (synopsis "Container for representing genomic ranges by sample") @@ -6850,8 +6858,9 @@ information about the latest version of the Gene Ontologies.") ("r-biobase" ,r-biobase) ("r-biocgenerics" ,r-biocgenerics) ("r-go-db" ,r-go-db) - ("r-matrixstats" ,r-matrixstats) ("r-graph" ,r-graph) + ("r-lattice" ,r-lattice) + ("r-matrixstats" ,r-matrixstats) ("r-sparsem" ,r-sparsem))) (home-page "http://bioconductor.org/packages/topGO") (synopsis "Enrichment analysis for gene ontology") @@ -8243,7 +8252,8 @@ number detection tools.") "1wc1fjm6dzlsqqagm43y57w8jh8nsh0r0m8z1p6ximcb5gxqh7hn")))) (build-system r-build-system) (propagated-inputs - `(("r-genefilter" ,r-genefilter))) + `(("r-genefilter" ,r-genefilter) + ("r-mgcv" ,r-mgcv))) (home-page "http://bioconductor.org/packages/sva") (synopsis "Surrogate variable analysis") (description @@ -8295,6 +8305,7 @@ data (variant call format, e.g. VCF or BCF) or meta-analysis results in R.") (propagated-inputs `(("r-seqminer" ,r-seqminer) ("r-mvtnorm" ,r-mvtnorm) + ("r-mass" ,r-mass) ("r-compquadform" ,r-compquadform) ("r-getopt" ,r-getopt))) (home-page "http://genome.sph.umich.edu/wiki/RareMETALS2") @@ -8453,6 +8464,7 @@ analysis.") `(("r-affy" ,r-affy) ("r-biobase" ,r-biobase) ("r-ggplot2" ,r-ggplot2) + ("r-lattice" ,r-lattice) ("r-limma" ,r-limma))) (home-page "http://bioconductor.org/packages/release/bioc/html/vsn.html") (synopsis "Variance stabilization and calibration for microarray data") @@ -8516,6 +8528,7 @@ specific parser.") (propagated-inputs `(("r-biobase" ,r-biobase) ("r-biocgenerics" ,r-biocgenerics) + ("r-mass" ,r-mass) ("r-rcpp" ,r-rcpp))) (home-page "https://github.com/hredestig/pcamethods") (synopsis "Collection of PCA methods") diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 5706218f15..ba3c7d4c36 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -4085,7 +4085,8 @@ operators such as union, intersection, and difference.") `(("readline" ,readline) ("icu4c" ,icu4c) ("pcre" ,pcre) - ("r" ,r))) + ("r" ,r) + ("r-survival" ,r-survival))) (native-inputs `(("zlib" ,zlib))) (home-page "http://rpy.sourceforge.net/") diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm index c836409b61..b8abbf62db 100644 --- a/gnu/packages/statistics.scm +++ b/gnu/packages/statistics.scm @@ -99,6 +99,9 @@ can be imported from spreadsheets, text files and database sources and it can be output in text, PostScript, PDF or HTML.") (license license:gpl3+))) +;; Update this package together with the set of recommended packages: r-boot, +;; r-class, r-cluster, r-codetools, r-foreign, r-kernsmooth, r-lattice, +;; r-mass, r-matrix, r-mgcv, r-nlme, r-nnet, r-rpart, r-spatial, r-survival. (define-public r (package (name "r") @@ -128,12 +131,8 @@ be output in text, PostScript, PDF or HTML.") (substitute* "src/scripts/R.sh.in" (("uname") uname-bin))) #t)) - (add-after 'unpack 'build-recommended-packages-reproducibly + (add-after 'unpack 'build-reproducibly (lambda _ - (substitute* "src/library/Recommended/Makefile.in" - (("INSTALL_OPTS =(.*)" line rest ) - (string-append "INSTALL_OPTS = --built-timestamp=1970-01-01" - rest))) ;; Ensure that gzipped files are reproducible (substitute* '("src/library/grDevices/Makefile.in" "doc/manual/Makefile.in") @@ -162,7 +161,12 @@ be output in text, PostScript, PDF or HTML.") (add-after 'build 'install-info (lambda _ (zero? (system* "make" "install-info"))))) #:configure-flags - '("--with-cairo" + '(;; Do not build the recommended packages. The build system creates + ;; random temporary directories and embeds their names in some + ;; package files. We build these packages with the r-build-system + ;; instead. + "--without-recommended-packages" + "--with-cairo" "--with-blas=-lopenblas" "--with-libpng" "--with-jpeglib" @@ -991,6 +995,7 @@ legends.") ("r-gtable" ,r-gtable) ("r-plyr" ,r-plyr) ("r-lazyeval" ,r-lazyeval) + ("r-mass" ,r-mass) ("r-tibble" ,r-tibble) ("r-reshape2" ,r-reshape2) ("r-scales" ,r-scales) @@ -1611,6 +1616,8 @@ side.") (base32 "0lafrmq1q7x026m92h01hc9cjjiximqqi3v1g2hw7ai9vf7i897m")))) (build-system r-build-system) + (propagated-inputs + `(("r-lattice" ,r-lattice))) (home-page "http://cran.r-project.org/web/packages/locfit") (synopsis "Local regression, likelihood and density estimation") (description @@ -1788,6 +1795,8 @@ inference for statistical models.") (base32 "14a4a8df4ygj05h37chmdn8kzcqs07fpbflxfrq530563mrza7yl")))) (build-system r-build-system) + (propagated-inputs + `(("r-lattice" ,r-lattice))) (home-page "http://cran.r-project.org/web/packages/coda") (synopsis "This is a package for Output Analysis and Diagnostics for MCMC") (description "This package provides functions for summarizing and plotting @@ -2936,6 +2945,8 @@ flexible than the orphaned \"base64\" package.") (base32 "1qbcn0ix85pmk296jhpi419kvh06vxm5cq24yk013ps3g7fyi0si")))) (build-system r-build-system) + (propagated-inputs + `(("r-matrix" ,r-matrix))) (home-page "http://cran.r-project.org/web/packages/irlba") (synopsis "Methods for eigendecomposition of large matrices") (description @@ -2956,10 +2967,11 @@ analysis of large sparse or dense matrices.") (base32 "1cbpzmbv837fvq88rgn6mgzgr9f1wqp9fg8gh2kkmngvr1957a9c")))) (build-system r-build-system) - (inputs - `(("gfortran" ,gfortran))) + (inputs + `(("gfortran" ,gfortran))) (propagated-inputs - `(("r-foreach" ,r-foreach))) + `(("r-foreach" ,r-foreach) + ("r-matrix" ,r-matrix))) (home-page "http://www.jstatsoft.org/v33/i01") (synopsis "Lasso and elastic-net regularized generalized linear models") (description @@ -3077,6 +3089,8 @@ Stochastic Neighbor Embedding using a Barnes-Hut implementation.") (base32 "1069qwj9gsjq6par2cgfah8nn5x2w38830761x1f7mqpmk0gnj3h")))) (build-system r-build-system) + (propagated-inputs + `(("r-class" ,r-class))) (home-page "http://cran.r-project.org/web/packages/e1071") (synopsis "Miscellaneous functions for probability theory") (description @@ -3688,6 +3702,9 @@ from within R.") (("if isnan\\(lambda\\) \\{") "if (isnan(lambda)) {")) #t))))) + (propagated-inputs + `(("r-lattice" ,r-lattice) + ("r-matrix" ,r-matrix))) (home-page "http://spams-devel.gforge.inria.fr") (synopsis "Toolbox for solving sparse estimation problems") (description "SPAMS (SPArse Modeling Software) is an optimization toolbox @@ -3746,17 +3763,20 @@ package instead.") `(("r-acepack" ,r-acepack) ("r-base64" ,r-base64) ("r-base64enc" ,r-base64enc) + ("r-cluster" ,r-cluster) ("r-data-table" ,r-data-table) + ("r-foreign" ,r-foreign) ("r-formula" ,r-formula) ("r-ggplot2" ,r-ggplot2) ("r-gridextra" ,r-gridextra) ("r-gtable" ,r-gtable) - ;; Hmisc needs survival >= 2.40.1, so it cannot use the survival - ;; package that comes with R 3.3.2. - ("r-survival" ,r-survival) + ("r-lattice" ,r-lattice) ("r-latticeextra" ,r-latticeextra) ("r-htmltable" ,r-htmltable) ("r-htmltools" ,r-htmltools) + ("r-nnet" ,r-nnet) + ("r-rpart" ,r-rpart) + ("r-survival" ,r-survival) ("r-viridis" ,r-viridis))) (home-page "http://biostat.mc.vanderbilt.edu/Hmisc") (synopsis "Miscellaneous data analysis and graphics functions") @@ -4041,6 +4061,8 @@ estimation) corresponding to the book: Wand, M.P. and Jones, M.C. (1995) (base32 "167m142rwwfy8b9hnfc3fi28dcsdjk61g1crqhll6sh5xmgnfn28")))) (build-system r-build-system) + (propagated-inputs + `(("r-lattice" ,r-lattice))) (home-page "http://zoo.R-Forge.R-project.org/") (synopsis "S3 infrastructure for regular and irregular time series") (description "This package contains an S3 class with methods for totally @@ -4307,7 +4329,9 @@ letters, as is often required for scientific publications.") "133rr17ywmlhsc6457hs8qxi8ng443ql9ashxpwc8875gjhv1x32")))) (build-system r-build-system) (propagated-inputs - `(("r-segmented" ,r-segmented))) + `(("r-boot" ,r-boot) + ("r-mass" ,r-mass) + ("r-segmented" ,r-segmented))) (home-page "http://cran.r-project.org/web/packages/mixtools") (synopsis "Tools for analyzing finite mixture models") (description @@ -4437,7 +4461,9 @@ to change in the future.") "1i205yw3kkxs27gqcs6zx0c2mh16p332a2p06wq6fdzb20bazg3z")))) (build-system r-build-system) (propagated-inputs - `(("r-modeltools" ,r-modeltools))) + `(("r-lattice" ,r-lattice) + ("r-modeltools" ,r-modeltools) + ("r-nnet" ,r-nnet))) (home-page "http://cran.r-project.org/web/packages/flexmix") (synopsis "Flexible mixture modeling") (description @@ -4484,7 +4510,8 @@ and resampling-based inference.") "0qjsxrx6yv338bxm4ki0w9h8hind1l98abdrz828588bwj02jya1")))) (build-system r-build-system) (propagated-inputs - `(("r-mclust" ,r-mclust))) + `(("r-mass" ,r-mass) + ("r-mclust" ,r-mclust))) (home-page "https://cran.r-project.org/web/packages/prabclus") (synopsis "Parametric bootstrap tests for spatial neighborhood clustering") (description @@ -4573,9 +4600,12 @@ of the points.") "15m0p9l9w2v7sl0cnzyg81i2fmx3hrhvr3371544mwn3fpsca5sx")))) (build-system r-build-system) (propagated-inputs - `(("r-diptest" ,r-diptest) + `(("r-class" ,r-class) + ("r-cluster" ,r-cluster) + ("r-diptest" ,r-diptest) ("r-flexmix" ,r-flexmix) ("r-kernlab" ,r-kernlab) + ("r-mass" ,r-mass) ("r-mclust" ,r-mclust) ("r-mvtnorm" ,r-mvtnorm) ("r-prabclus" ,r-prabclus) @@ -4694,7 +4724,8 @@ based on an interface to Fortran implementations by M. J. D. Powell.") (properties `((upstream-name . "RcppEigen"))) (build-system r-build-system) (propagated-inputs - `(("r-rcpp" ,r-rcpp))) + `(("r-rcpp" ,r-rcpp) + ("r-matrix" ,r-matrix))) (home-page "http://eigen.tuxfamily.org") (synopsis "Rcpp integration for the Eigen templated linear algebra library") (description @@ -4739,6 +4770,8 @@ metrics for evaluating models.") "0cyfvhci2p1vr2x52ymkyqqs63x1qchn856dh2j94yb93r08x1zy")))) (properties `((upstream-name . "MatrixModels"))) (build-system r-build-system) + (propagated-inputs + `(("r-matrix" ,r-matrix))) (home-page "https://cran.r-project.org/web/packages/MatrixModels") (synopsis "Modelling with sparse and dense matrices") (description @@ -4816,7 +4849,9 @@ algorithms.") ("r-rcppeigen" ,r-rcppeigen))) (propagated-inputs `(("r-minqa" ,r-minqa) - ("r-nloptr" ,r-nloptr))) + ("r-nloptr" ,r-nloptr) + ("r-mass" ,r-mass) + ("r-nlme" ,r-nlme))) (home-page "http://cran.r-project.org/web/packages/lme4") (synopsis "Linear mixed-effects models using eigen and S4") (description @@ -4839,7 +4874,9 @@ C++ library for numerical linear algebra and RcppEigen glue.") "00cw18q7wvddzjrbxz917wkix6r7672vi2wmsp4gwgzady8vha4x")))) (build-system r-build-system) (propagated-inputs - `(("r-lme4" ,r-lme4))) + `(("r-lme4" ,r-lme4) + ("r-mass" ,r-mass) + ("r-matrix" ,r-matrix))) (home-page "http://people.math.aau.dk/~sorenh/software/pbkrtest/") (synopsis "Methods for linear mixed model comparison") (description @@ -4861,7 +4898,10 @@ bootstrap test for generalized linear mixed models.") "0a6v7rsd1xsdyapnfqy37m7c4kx9wslkzsizc9k0lmnba0bwyfgx")))) (build-system r-build-system) (propagated-inputs - `(("r-pbkrtest" ,r-pbkrtest) + `(("r-mass" ,r-mass) + ("r-mgcv" ,r-mgcv) + ("r-nnet" ,r-nnet) + ("r-pbkrtest" ,r-pbkrtest) ("r-quantreg" ,r-quantreg))) (home-page "https://r-forge.r-project.org/projects/car/") (synopsis "Companion to applied regression") @@ -5000,7 +5040,8 @@ multivariate case.") "0a1b7yp4l9wf6ic5czizyl2cnxrc1virj0icr8i6m1vv23jd8jfp")))) (build-system r-build-system) (propagated-inputs - `(("r-mclust" ,r-mclust) + `(("r-cluster" ,r-cluster) + ("r-mclust" ,r-mclust) ("r-mvtnorm" ,r-mvtnorm) ("r-sn" ,r-sn))) (home-page "http://cran.r-project.org/web/packages/tclust") diff --git a/guix/import/cran.scm b/guix/import/cran.scm index 40cdea029b..7521a39bc9 100644 --- a/guix/import/cran.scm +++ b/guix/import/cran.scm @@ -164,32 +164,16 @@ empty list when the FIELD cannot be found." (map string-trim-both items)))))) (define default-r-packages - (list "KernSmooth" - "MASS" - "Matrix" - "base" - "boot" - "class" - "cluster" - "codetools" + (list "base" "compiler" - "datasets" - "foreign" "grDevices" "graphics" "grid" - "lattice" "methods" - "mgcv" - "nlme" - "nnet" "parallel" - "rpart" - "spatial" "splines" "stats" "stats4" - "survival" "tcltk" "tools" "translations" -- cgit v1.2.3 From f1fe5283c9f8eb6890b3e6dc3c09a00f4da19472 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Sun, 12 Mar 2017 00:22:57 +0100 Subject: gnu: Add r-with-recommended-packages. * gnu/packages/statistics.scm (r-with-recommended-packages): New variable. --- gnu/packages/statistics.scm | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm index b8abbf62db..656895273f 100644 --- a/gnu/packages/statistics.scm +++ b/gnu/packages/statistics.scm @@ -31,6 +31,7 @@ #:use-module (guix build-system gnu) #:use-module (guix build-system r) #:use-module (guix build-system python) + #:use-module (guix build-system trivial) #:use-module (gnu packages) #:use-module (gnu packages compression) #:use-module (gnu packages curl) @@ -537,6 +538,30 @@ definition of Surv objects, Kaplan-Meier and Aalen-Johansen (multi-state) curves, Cox models, and parametric accelerated failure time models.") (license license:lgpl2.0+))) +(define-public r-with-recommended-packages + (package (inherit r) + (name "r-with-recommended-packages") + (source #f) + (build-system trivial-build-system) + (arguments '(#:builder (mkdir %output))) + (propagated-inputs + `(("r" ,r) + ("r-boot" ,r-boot) + ("r-class" ,r-class) + ("r-cluster" ,r-cluster) + ("r-codetools" ,r-codetools) + ("r-foreign" ,r-foreign) + ("r-kernsmooth" ,r-kernsmooth) + ("r-lattice" ,r-lattice) + ("r-mass" ,r-mass) + ("r-matrix" ,r-matrix) + ("r-mgcv" ,r-mgcv) + ("r-nlme" ,r-nlme) + ("r-nnet" ,r-nnet) + ("r-rpart" ,r-rpart) + ("r-spatial" ,r-spatial) + ("r-survival" ,r-survival))))) + (define-public r-bit (package (name "r-bit") -- cgit v1.2.3 From 2d7c4ae3ee83841ef827a160b0d23c1d10d2570d Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Fri, 17 Mar 2017 09:42:22 +0100 Subject: gnu: r: Rename to r-minimal. * gnu/packages/statistics.scm (r): Rename to... (r-minimal): ...this new variable. (r-with-recommended-packages): Rename to... (r): ...this. * guix/build-system/r.scm (default-r): Reference r-minimal. * gnu/packages/emacs.scm (emacs-ess)[inputs], gnu/packages/machine-learning.scm (shogun)[inputs], gnu/packages/python.scm (python-rpy2)[inputs], gnu/packages/bioinformatics.scm (ribotaper)[inputs], (couger)[propagated-inputs], (roary)[inputs], (rsem)[inputs], (rcas-web)[inputs]: Change "r" to "r-minimal". --- gnu/packages/bioinformatics.scm | 10 +++++----- gnu/packages/emacs.scm | 2 +- gnu/packages/machine-learning.scm | 2 +- gnu/packages/python.scm | 2 +- gnu/packages/statistics.scm | 12 ++++++------ guix/build-system/r.scm | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm index bd3c97b721..ccde01b119 100644 --- a/gnu/packages/bioinformatics.scm +++ b/gnu/packages/bioinformatics.scm @@ -478,7 +478,7 @@ BED, GFF/GTF, VCF.") (inputs `(("bedtools" ,bedtools-2.18) ("samtools" ,samtools-0.1) - ("r" ,r) + ("r-minimal" ,r-minimal) ("r-foreach" ,r-foreach) ("r-xnomial" ,r-xnomial) ("r-domc" ,r-domc) @@ -1728,7 +1728,7 @@ gene predictor designed to work with assembled, aligned RNA-seq transcripts.") ("python2-scipy" ,python2-scipy) ("python2-matplotlib" ,python2-matplotlib))) (propagated-inputs - `(("r" ,r) + `(("r-minimal" ,r-minimal) ("libsvm" ,libsvm) ("randomjungle" ,randomjungle))) (native-inputs @@ -4004,7 +4004,7 @@ partial genes, and identifies translation initiation sites.") ("grep" ,grep) ("sed" ,sed) ("gawk" ,gawk) - ("r" ,r) + ("r-minimal" ,r-minimal) ("r-ggplot2" ,r-ggplot2) ("coreutils" ,coreutils))) (home-page "http://sanger-pathogens.github.io/Roary") @@ -4119,7 +4119,7 @@ phylogenies.") (inputs `(("boost" ,boost) ("ncurses" ,ncurses) - ("r" ,r) + ("r-minimal" ,r-minimal) ("perl" ,perl) ("samtools" ,samtools-0.1) ("zlib" ,zlib))) @@ -7636,7 +7636,7 @@ library implementing most of the pipeline's features.") `("R_LIBS_SITE" ":" = (,(getenv "R_LIBS_SITE"))))) #t))))) (inputs - `(("r" ,r) + `(("r-minimal" ,r-minimal) ("r-rcas" ,r-rcas) ("guile-next" ,guile-next) ("guile-json" ,guile2.2-json) diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm index c6e62acb7a..18d25b743b 100644 --- a/gnu/packages/emacs.scm +++ b/gnu/packages/emacs.scm @@ -2924,7 +2924,7 @@ E-Prime forbids the use of the \"to be\" form to strengthen your writing.") (string-append "SHELL = " (which "sh"))))))))) (inputs `(("emacs" ,emacs-minimal) - ("r" ,r))) + ("r-minimal" ,r-minimal))) (native-inputs `(("perl" ,perl) ("texinfo" ,texinfo) diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index 73c78744f8..5379893b76 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -402,7 +402,7 @@ sample proximities between pairs of cases.") (inputs `(("python" ,python) ("numpy" ,python-numpy) - ("r" ,r) + ("r-minimal" ,r-minimal) ("octave" ,octave) ("swig" ,swig) ("hdf5" ,hdf5) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index ba3c7d4c36..6c91401e22 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -4085,7 +4085,7 @@ operators such as union, intersection, and difference.") `(("readline" ,readline) ("icu4c" ,icu4c) ("pcre" ,pcre) - ("r" ,r) + ("r-minimal" ,r-minimal) ("r-survival" ,r-survival))) (native-inputs `(("zlib" ,zlib))) diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm index 656895273f..3a26e23053 100644 --- a/gnu/packages/statistics.scm +++ b/gnu/packages/statistics.scm @@ -103,9 +103,9 @@ be output in text, PostScript, PDF or HTML.") ;; Update this package together with the set of recommended packages: r-boot, ;; r-class, r-cluster, r-codetools, r-foreign, r-kernsmooth, r-lattice, ;; r-mass, r-matrix, r-mgcv, r-nlme, r-nnet, r-rpart, r-spatial, r-survival. -(define-public r +(define-public r-minimal (package - (name "r") + (name "r-minimal") (version "3.3.3") (source (origin (method url-fetch) @@ -538,14 +538,14 @@ definition of Surv objects, Kaplan-Meier and Aalen-Johansen (multi-state) curves, Cox models, and parametric accelerated failure time models.") (license license:lgpl2.0+))) -(define-public r-with-recommended-packages - (package (inherit r) - (name "r-with-recommended-packages") +(define-public r + (package (inherit r-minimal) + (name "r") (source #f) (build-system trivial-build-system) (arguments '(#:builder (mkdir %output))) (propagated-inputs - `(("r" ,r) + `(("r-minimal" ,r-minimal) ("r-boot" ,r-boot) ("r-class" ,r-class) ("r-cluster" ,r-cluster) diff --git a/guix/build-system/r.scm b/guix/build-system/r.scm index e8269fdeb1..c649036210 100644 --- a/guix/build-system/r.scm +++ b/guix/build-system/r.scm @@ -62,7 +62,7 @@ release corresponding to NAME and VERSION." "Return the default R package." ;; Lazily resolve the binding to avoid a circular dependency. (let ((r-mod (resolve-interface '(gnu packages statistics)))) - (module-ref r-mod 'r))) + (module-ref r-mod 'r-minimal))) (define* (lower name #:key source inputs native-inputs outputs system target -- cgit v1.2.3 From 60c9190e21edfaa3a18be857b9a906b8521e948b Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Sun, 12 Mar 2017 00:23:24 +0100 Subject: gnu: r-minimal: Fix remaining reproducibility problems. Fixes . * gnu/packages/statistics.scm (r-minimal)[arguments]: Add remaining reproducibility fixes to "build-reproducibly" phase. --- gnu/packages/statistics.scm | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm index 3a26e23053..d8e50b9984 100644 --- a/gnu/packages/statistics.scm +++ b/gnu/packages/statistics.scm @@ -134,11 +134,44 @@ be output in text, PostScript, PDF or HTML.") #t)) (add-after 'unpack 'build-reproducibly (lambda _ - ;; Ensure that gzipped files are reproducible + ;; The documentation contains time stamps to demonstrate + ;; documentation generation in different phases. + (substitute* "src/library/tools/man/Rd2HTML.Rd" + (("\\\\%Y-\\\\%m-\\\\%d at \\\\%H:\\\\%M:\\\\%S") + "(removed for reproducibility)")) + + ;; Remove timestamp from tracing environment. This fixes + ;; reproducibility of "methods.rd{b,x}". + (substitute* "src/library/methods/R/trace.R" + (("dateCreated = Sys.time\\(\\)") + "dateCreated = as.POSIXct(\"1970-1-1 00:00:00\", tz = \"UTC\")")) + + ;; Ensure that gzipped files are reproducible. (substitute* '("src/library/grDevices/Makefile.in" "doc/manual/Makefile.in") (("R_GZIPCMD\\)" line) (string-append line " -n"))) + + ;; The "srcfile" procedure in "src/library/base/R/srcfile.R" + ;; queries the mtime of a given file and records it in an object. + ;; This is acceptable at runtime to detect stale source files, + ;; but it destroys reproducibility at build time. + ;; + ;; Instead of disabling this feature, which may have unexpected + ;; consequences, we reset the mtime of generated files before + ;; passing them to the "srcfile" procedure. + (substitute* "src/library/Makefile.in" + (("@\\(cd base && \\$\\(MAKE\\) mkdesc\\)" line) + (string-append line "\n find $(top_builddir)/library/tools | xargs touch -d '1970-01-01'; \n")) + (("@\\$\\(MAKE\\) Rdobjects" line) + (string-append "@find $(srcdir)/tools | xargs touch -d '1970-01-01'; \n " + line))) + (substitute* "src/library/tools/Makefile.in" + (("@\\$\\(INSTALL_DATA\\) all.R \\$\\(top_builddir\\)/library/\\$\\(pkg\\)/R/\\$\\(pkg\\)" line) + (string-append + line + "\n find $(srcdir)/$(pkg) $(top_builddir)/library/$(pkg) | xargs touch -d \"1970-01-01\"; \n"))) + ;; This library is installed using "install_package_description", ;; so we need to pass the "builtStamp" argument. (substitute* "src/library/tools/Makefile.in" -- cgit v1.2.3 From ef71ed8ffa34f8c8b9dd029e262f21bd2eb3db20 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Fri, 17 Mar 2017 10:11:25 +0100 Subject: gnu: snakemake: Update to 3.11.2. * gnu/packages/python.scm (snakemake): Update to 3.11.2. --- gnu/packages/python.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 6c91401e22..9b9c5ff992 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -5871,13 +5871,13 @@ of the structure, dynamics, and functions of complex networks.") (define-public snakemake (package (name "snakemake") - (version "3.9.0") + (version "3.11.2") (source (origin (method url-fetch) (uri (pypi-uri "snakemake" version)) (sha256 - (base32 "1d48ql0010v9ls6mac7fz6j391gm4h74a64hqgw89s0vfqgdyzdl")))) + (base32 "0qcp7y9csvanyzh08jppryhd5di8r1z7p0d4wkfg5591pj3bb8zp")))) (build-system python-build-system) (arguments ;; TODO: Package missing test dependencies. -- cgit v1.2.3 From 0c4dbdc23e07029385abed23af837f67c8a0ffd8 Mon Sep 17 00:00:00 2001 From: Ben Woodcroft Date: Fri, 6 Jan 2017 21:01:05 +1000 Subject: gnu: Add ocaml-sqlite3. * gnu/packages/ocaml.scm (ocaml-sqlite3): New variable. --- gnu/packages/ocaml.scm | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm index ebc5caf254..f5001533ff 100644 --- a/gnu/packages/ocaml.scm +++ b/gnu/packages/ocaml.scm @@ -29,6 +29,7 @@ #:use-module (gnu packages base) #:use-module (gnu packages compression) #:use-module (gnu packages curl) + #:use-module (gnu packages databases) #:use-module (gnu packages emacs) #:use-module (gnu packages gcc) #:use-module (gnu packages ghostscript) @@ -1213,6 +1214,35 @@ to operate on the result type available from OCaml 4.03 in the standard library.") (license license:isc))) +(define-public ocaml-sqlite3 + (package + (name "ocaml-sqlite3") + (version "4.1.2") + (source + (origin + (method url-fetch) + (uri (string-append + "https://github.com/mmottl/sqlite3-ocaml/releases/download/v" + version "/sqlite3-ocaml-" version ".tar.gz")) + (sha256 + (base32 + "14c1nir7c6bivajg0vyx853y7la7r5d25g1v5hjb2wfi73r15p1m")))) + (build-system ocaml-build-system) + (native-inputs + `(("pkg-config" ,pkg-config))) + (inputs + `(("sqlite" ,sqlite))) + (home-page "https://mmottl.github.io/sqlite3-ocaml") + (synopsis "SQLite3 Bindings for OCaml") + (description + "SQLite3-OCaml is an OCaml library with bindings to the SQLite3 client +API. Sqlite3 is a self-contained, serverless, zero-configuration, +transactional SQL database engine with outstanding performance for many use +cases. These bindings are written in a way that enables a friendly +coexistence with the old (version 2) SQLite and its OCaml wrapper +@code{ocaml-sqlite}.") + (license license:expat))) + (define-public ocaml-mtime (package (name "ocaml-mtime") -- cgit v1.2.3 From 91df9eaefa371b9bb600f7d1387e6803b5e71904 Mon Sep 17 00:00:00 2001 From: Ben Woodcroft Date: Fri, 17 Mar 2017 21:19:55 +1000 Subject: gnu: Add ocaml-csv. * gnu/packages/ocaml.scm (ocaml-csv): New variable. --- gnu/packages/ocaml.scm | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm index f5001533ff..03c6433b24 100644 --- a/gnu/packages/ocaml.scm +++ b/gnu/packages/ocaml.scm @@ -1243,6 +1243,30 @@ coexistence with the old (version 2) SQLite and its OCaml wrapper @code{ocaml-sqlite}.") (license license:expat))) +(define-public ocaml-csv + (package + (name "ocaml-csv") + (version "1.6") + (source + (origin + (method url-fetch) + (uri + (string-append + "http://github.com/Chris00/ocaml-csv/releases/download/" + version "/csv-" version ".tar.gz")) + (sha256 + (base32 + "0rv7x843vn6scxj87hzl01yqrl26rc27lr8s7z6rp9vs745g05zj")))) + (build-system ocaml-build-system) + (home-page "https://github.com/Chris00/ocaml-csv") + (synopsis "Pure OCaml functions to read and write CSV") + (description + "@dfn{Comma separated values} (CSV) is a simple tabular format supported +by all major spreadsheets. This library implements pure OCaml functions to +read and write files in this format as well as some convenience functions to +manipulate such data.") + (license (package-license camlp4)))) + (define-public ocaml-mtime (package (name "ocaml-mtime") -- cgit v1.2.3 From ba1be533ad4db5a032559fc1a6f501b5de381088 Mon Sep 17 00:00:00 2001 From: Ben Woodcroft Date: Fri, 17 Mar 2017 21:23:21 +1000 Subject: gnu: Add ocaml-gsl. * gnu/packages/maths.scm (ocaml-gsl): New variable. --- gnu/packages/maths.scm | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index 03567ba083..adc81561c7 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -17,6 +17,7 @@ ;;; Copyright © 2016 Thomas Danckaert ;;; Copyright © 2017 Paul Garlick ;;; Copyright © 2017 ng0 +;;; Copyright © 2017 Ben Woodcroft ;;; ;;; This file is part of GNU Guix. ;;; @@ -44,6 +45,7 @@ #:use-module (guix build utils) #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) + #:use-module (guix build-system ocaml) #:use-module (guix build-system r) #:use-module (gnu packages algebra) #:use-module (gnu packages bison) @@ -77,6 +79,7 @@ #:use-module (gnu packages mpi) #:use-module (gnu packages multiprecision) #:use-module (gnu packages netpbm) + #:use-module (gnu packages ocaml) #:use-module (gnu packages pcre) #:use-module (gnu packages popt) #:use-module (gnu packages perl) @@ -277,6 +280,30 @@ differential equations, linear algebra, Fast Fourier Transforms and random numbers.") (license license:gpl3+))) +(define-public ocaml-gsl + (package + (name "ocaml-gsl") + (version "1.19.3") + (source + (origin + (method url-fetch) + (uri + (string-append + "https://github.com/mmottl/gsl-ocaml/releases/download/v" + version"/gsl-ocaml-" version ".tar.gz")) + (sha256 + (base32 + "0nzp43hp8pbjqkrxnwp5lgjrabxayf61h18fjaydi0s5faq6f3xh")))) + (build-system ocaml-build-system) + (inputs + `(("gsl" ,gsl))) + (home-page "https://mmottl.github.io/gsl-ocaml") + (synopsis "Bindings to the GNU Scientific Library") + (description + "GSL-OCaml is an interface to the @dfn{GNU scientific library} (GSL) for +the OCaml language.") + (license license:gpl3+))) + (define-public glpk (package (name "glpk") -- cgit v1.2.3 From 0a3063d64077f164670b8e7d0bc58b5f40ffeb12 Mon Sep 17 00:00:00 2001 From: Ben Woodcroft Date: Fri, 17 Mar 2017 21:24:13 +1000 Subject: gnu: Add ocaml-mcl. * gnu/packages/machine-learning.scm (ocaml-mcl): New variable. --- gnu/packages/machine-learning.scm | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index 5379893b76..30f005a331 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -26,6 +26,7 @@ #:use-module (guix svn-download) #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) + #:use-module (guix build-system ocaml) #:use-module (guix build-system r) #:use-module (gnu packages) #:use-module (gnu packages autotools) @@ -35,6 +36,7 @@ #:use-module (gnu packages gcc) #:use-module (gnu packages image) #:use-module (gnu packages maths) + #:use-module (gnu packages ocaml) #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) @@ -239,6 +241,39 @@ networks) based on simulation of (stochastic) flow in graphs.") ;; http://listserver.ebi.ac.uk/pipermail/mcl-users/2016/000376.html (license license:gpl3))) +(define-public ocaml-mcl + (package + (name "ocaml-mcl") + (version "12-068oasis4") + (source + (origin + (method url-fetch) + (uri (string-append + "https://github.com/fhcrc/mcl/archive/" + version ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "1l5jbhwjpsj38x8b9698hfpkv75h8hn3kj0gihjhn8ym2cwwv110")))) + (build-system ocaml-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-before 'configure 'patch-paths + (lambda _ + (substitute* "configure" + (("SHELL = /bin/sh") (string-append "SHELL = "(which "sh")))) + (substitute* "setup.ml" + (("LDFLAGS=-fPIC") + (string-append "LDFLAGS=-fPIC\"; \"SHELL=" (which "sh")))) + #t))))) + (home-page "https://github.com/fhcrc/mcl") + (synopsis "OCaml wrappers around MCL") + (description + "This package provides OCaml bindings for the MCL graph clustering +algorithm.") + (license license:gpl3))) + (define-public randomjungle (package (name "randomjungle") -- cgit v1.2.3 From 114a325e8f86c820484c9f64fde6bbadca41eed4 Mon Sep 17 00:00:00 2001 From: ng0 Date: Tue, 10 Jan 2017 20:49:30 +0000 Subject: gnu: Add libpng-apng. * gnu/packages/image.scm (libpng-apng): New variable. Co-authored-by: Kei Kebreau --- gnu/packages/image.scm | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm index 53ed69a84e..f348a61c9b 100644 --- a/gnu/packages/image.scm +++ b/gnu/packages/image.scm @@ -14,6 +14,7 @@ ;;; Copyright © 2016 Eric Bavier ;;; Copyright © 2016 Arun Isaac ;;; Copyright © 2016 Kei Kebreau +;;; Copyright © 2017 ng0 ;;; ;;; This file is part of GNU Guix. ;;; @@ -98,6 +99,57 @@ library. It supports almost all PNG features and is extensible.") (inherit (package-source libpng)) (patches (search-patches "libpng-CVE-2016-10087.patch")))))) +(define-public libpng-apng + (package + (inherit libpng) + (replacement #f) ;libpng's replacement doesn't apply here + (name "libpng-apng") + (version (package-version libpng)) + (source + (origin + (inherit (package-source libpng)) + (patches (search-patches "libpng-CVE-2016-10087.patch")))) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch-apng + (lambda* (#:key inputs #:allow-other-keys) + (define (apply-patch file) + (zero? (system* "patch" "-p1" "--force" + "--input" file))) + (let ((apng.gz (assoc-ref inputs "apng"))) + (format #t "Applying APNG patch '~a'...~%" + apng.gz) + (system (string-append "gunzip < " apng.gz " > the-patch")) + (and (apply-patch "the-patch") + (for-each apply-patch + (find-files "\\.patch")))) + #t)) + (add-before 'configure 'no-checks + (lambda _ + (substitute* "Makefile.in" + (("^scripts/symbols.chk") "") + (("check: scripts/symbols.chk") "")) + (zero? (system* "libtool")) + #t))))) + (inputs + `(("apng" ,(origin + (method url-fetch) + (uri + (string-append "mirror://sourceforge/libpng-apng/libpng16/" + version "/libpng-" version "-apng.patch.gz")) + (sha256 + (base32 + "026r0gbkf6d6v54wca02cdxln8sj4m2c1yk62sj2aasv2ki2ffh5")))))) + (native-inputs + `(("libtool" ,libtool))) + (synopsis "APNG patch for libpng") + (description + "APNG (Animated Portable Network Graphics) is an unofficial +extension of the APNG (Portable Network Graphics) format. +APNG patch provides APNG support to libpng.") + (home-page "https://sourceforge.net/projects/libpng-apng/"))) + (define-public libpng-1.2 (package (inherit libpng) -- cgit v1.2.3 From 8f9858161310ef19ff5c65c9dcce2bbd9f58d25a Mon Sep 17 00:00:00 2001 From: Kei Kebreau Date: Fri, 17 Mar 2017 11:33:04 -0400 Subject: gnu: libpng-apng: Remove unnecessary call to libtool. * gnu/packages/image.scm (libpng-apng)[phases]: Remove it. --- gnu/packages/image.scm | 1 - 1 file changed, 1 deletion(-) diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm index f348a61c9b..9b8a3a63da 100644 --- a/gnu/packages/image.scm +++ b/gnu/packages/image.scm @@ -130,7 +130,6 @@ library. It supports almost all PNG features and is extensible.") (substitute* "Makefile.in" (("^scripts/symbols.chk") "") (("check: scripts/symbols.chk") "")) - (zero? (system* "libtool")) #t))))) (inputs `(("apng" ,(origin -- cgit v1.2.3 From b0dcb529af5f0e25f95ec033b3c8b681a81ce970 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Fri, 3 Mar 2017 01:29:12 +0100 Subject: gnu: rust: Update to 1.15.0. * gnu/packages/rust.scm (%rust-bootstrap-binaries-version): Update to 1.14.0. (%rust-bootstrap-binaries): Update to 1.14.0. (rustc): Update to 1.15.0. [arguments]: Pass "--disable-rustbuild" to configure. --- gnu/packages/rust.scm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm index fb284102da..96d7d7e948 100644 --- a/gnu/packages/rust.scm +++ b/gnu/packages/rust.scm @@ -44,7 +44,7 @@ #:use-module (srfi srfi-26)) ;; Should be one less than the current released version. -(define %rust-bootstrap-binaries-version "1.13.0") +(define %rust-bootstrap-binaries-version "1.14.0") (define %rust-bootstrap-binaries (origin @@ -55,7 +55,7 @@ "-i686-unknown-linux-gnu.tar.gz")) (sha256 (base32 - "0fcl7xgm2m21sjv1f27i3v692aa91lk8r867hl8d6l377w8k95r3")))) + "0h384prpabcl08mxs1bilyb0dbk0knpdylcnz4b84ij4idr7ap4d")))) (define (increment-rust-version rust-version major patch) (match (string-split rust-version #\.) @@ -205,7 +205,7 @@ rustc-bootstrap and cargo-bootstrap packages.") "rustc-" version "-src.tar.gz")) (sha256 (base32 - "0srvmhhdbbcl21nzg9m9zni7k10h88lsy8k1ljz03g8mx79fv467")))) + "0wvn8m1nfg664b95qrdpfh72q1a6ir09rqkrnlzbkay2r7xf8mgn")))) (build-system gnu-build-system) (native-inputs `(("cmake" ,cmake) @@ -260,7 +260,7 @@ rustc-bootstrap and cargo-bootstrap packages.") "--release-channel=stable" "--enable-rpath" "--enable-local-rust" - ;;"--enable-rustbuild" + "--disable-rustbuild" ; use Makefiles "--disable-manage-submodules"))) ;; Rust uses a custom configure script (no autoconf). (zero? (apply system* "./configure" flags))))) -- cgit v1.2.3 From 893bc3f402588654121499738c1ec42da8a15841 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Fri, 3 Mar 2017 01:29:13 +0100 Subject: gnu: cargo: Use upstream cargo. * gnu/packages/rust.scm (cargo): Use upstream cargo. --- gnu/packages/rust.scm | 515 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 509 insertions(+), 6 deletions(-) diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm index 96d7d7e948..efac79c515 100644 --- a/gnu/packages/rust.scm +++ b/gnu/packages/rust.scm @@ -288,15 +288,12 @@ safety and thread safety guarantees.") (version (cargo-version (rustc-version %rust-bootstrap-binaries-version))) (source (origin (method url-fetch) - ;; Use a cargo tarball with vendored dependencies and a cargo - ;; config file. - (uri (string-append - "https://github.com/dvc94ch/cargo" - "/archive/" version "-cargo-vendor.tar.gz")) + (uri (string-append "https://github.com/rust-lang/cargo/archive/" + version ".tar.gz")) (file-name (string-append name "-" version ".tar.gz")) (sha256 (base32 - "0hpix5hwz10pm1wh65gimhsy9nxjvy7yikgbpw8afwglqr3bl856")))) + "194i06y9nql0p93gahh0vm4qwv6c1kpd9rprpf22w5gav9lpcyjz")))) (build-system cargo-build-system) (propagated-inputs `(("cmake" ,cmake) @@ -308,6 +305,483 @@ safety and thread safety guarantees.") ("openssl" ,openssl) ("python-2" ,python-2) ("zlib" ,zlib))) + (native-inputs + `(("rust-openssl" + ,(origin + (method url-fetch) + (uri (crate-uri "openssl" "0.9.1")) + (sha256 + (base32 + "1m2mhiar87qnw4gxci286q9g85ljafbc41salbj2hmcgh8aagchy")))) + ("rust-strsim" + ,(origin + (method url-fetch) + (uri (crate-uri "strsim" "0.5.1")) + (sha256 + (base32 + "0bj4fsm1l2yqbfpspyvjf9m3m50pskapcddzm0ji9c74jbgnkh2h")))) + ("rust-libc" + ,(origin + (method url-fetch) + (uri (crate-uri "libc" "0.2.18")) + (sha256 + (base32 + "0w5cghr0wx3hi2sclk8r9iyzlbxsakil87ada40q2ykyhky24655")))) + ("rust-bitflags" + ,(origin + (method url-fetch) + (uri (crate-uri "bitflags" "0.7.0")) + (sha256 + (base32 + "0v8hh6wdkpk9my8z8442g4hqrqf05h0qj53dsay6mv18lqvqklda")))) + ("rust-unicode-normalization" + ,(origin + (method url-fetch) + (uri (crate-uri "unicode-normalization" "0.1.2")) + (sha256 + (base32 + "0whi4xxqcjfsz6ywyrfd5lhgk1a44c86qwgvfqcmzidshcpklr16")))) + ("rust-rand" + ,(origin + (method url-fetch) + (uri (crate-uri "rand" "0.3.14")) + (sha256 + (base32 + "1984zvj8572ig28fz6idc4r96fx39h4lzmr07yf7kb7gdn6di497")))) + ("rust-gcc" + ,(origin + (method url-fetch) + (uri (crate-uri "gcc" "0.3.39")) + (sha256 + (base32 + "1q0idjvmhp6shkb9hqabh51rgfr8dqpi1xfmyzq7q8vgzybll7kp")))) + ("rust-tempdir" + ,(origin + (method url-fetch) + (uri (crate-uri "tempdir" "0.3.5")) + (sha256 + (base32 + "1mij45kgzflkja0h8q9avrik76h5a0b60m9hfd6k9yqxbiplm5w7")))) + ("rust-memchr" + ,(origin + (method url-fetch) + (uri (crate-uri "memchr" "0.1.11")) + (sha256 + (base32 + "084d85hjfa3xf5kwdms2mhbkh78m1gl2254cp5swcxj3a7xjkdnq")))) + ("rust-rustc-serialize" + ,(origin + (method url-fetch) + (uri (crate-uri "rustc-serialize" "0.3.21")) + (sha256 + (base32 + "064qmyr2508qf78dwcpiv25rfjp9h9vd0wrj4mmwgppjg4fgrydz")))) + ("rust-cmake" + ,(origin + (method url-fetch) + (uri (crate-uri "cmake" "0.1.19")) + (sha256 + (base32 + "0am8c8ns1h6b1a5x9z2r1m3rszvya5nccl2pzszzjv5aiiaydgcf")))) + ("rust-matches" + ,(origin + (method url-fetch) + (uri (crate-uri "matches" "0.1.4")) + (sha256 + (base32 + "1c8190j84hbicy8jwscw5icfam12j6lcxi02lvmadq9260p65mzg")))) + ("rust-winapi" + ,(origin + (method url-fetch) + (uri (crate-uri "winapi" "0.2.8")) + (sha256 + (base32 + "0yh816lh6lf56dpsgxy189c2ai1z3j8mw9si6izqb6wsjkbcjz8n")))) + ("rust-pkg-config" + ,(origin + (method url-fetch) + (uri (crate-uri "pkg-config" "0.3.8")) + (sha256 + (base32 + "1ypj4nj2z9z27qg06v3g40jyhw685i3l2wi098d21bvyri781vlc")))) + ("rust-libssh2-sys" + ,(origin + (method url-fetch) + (uri (crate-uri "libssh2-sys" "0.2.4")) + (sha256 + (base32 + "1pmmh0hcx14856wg9bp740yf618qfl2765vhf67sfs5lmf39227d")))) + ("rust-libz-sys" + ,(origin + (method url-fetch) + (uri (crate-uri "libz-sys" "1.0.10")) + (sha256 + (base32 + "1rl85x045sk5d345hgcahx99plpbdg2a3bx5vjfxig30qah74p4h")))) + ("rust-curl-sys" + ,(origin + (method url-fetch) + (uri (crate-uri "curl-sys" "0.3.6")) + (sha256 + (base32 + "0fi8kjz3f8m8vfazycs3ddm0h6j3x78hw78gwbvybx71129192i1")))) + ("rust-openssl-sys" + ,(origin + (method url-fetch) + (uri (crate-uri "openssl-sys" "0.9.1")) + (sha256 + (base32 + "1sdhgalfm2zdqf144xhdnxdha7ifjgsfbmlrqbx0j9f3mh4gpscm")))) + ("rust-fs2" + ,(origin + (method url-fetch) + (uri (crate-uri "fs2" "0.3.0")) + (sha256 + (base32 + "0lg57mgcm1r0m8jm4nqpcrl6lmxg8lj854k2h0r7qp46pphh2034")))) + ("rust-log" + ,(origin + (method url-fetch) + (uri (crate-uri "log" "0.3.6")) + (sha256 + (base32 + "0m40hgs3cg57dd5kk1mabfk6gk8z6l1cihar8akx4kmzz1xlk0xb")))) + ("rust-filetime" + ,(origin + (method url-fetch) + (uri (crate-uri "filetime" "0.1.10")) + (sha256 + (base32 + "08p9scgv30i1141cnp5xi4pqlnkfci455nrpca55df1r867anqsk")))) + ("rust-tar" + ,(origin + (method url-fetch) + (uri (crate-uri "tar" "0.4.9")) + (sha256 + (base32 + "1vi3nl8s3jjf5l20ni47gmh1p4bdjfh7q50fbg7izzqrf7i4i40c")))) + ("rust-glob" + ,(origin + (method url-fetch) + (uri (crate-uri "glob" "0.2.11")) + (sha256 + (base32 + "1ysvi72slkw784fcsymgj4308c3y03gwjjzqxp80xdjnkbh8vqcb")))) + ("rust-cfg-if" + ,(origin + (method url-fetch) + (uri (crate-uri "cfg-if" "0.1.0")) + (sha256 + (base32 + "137qikjcal4h75frzcn6mknygqk8vy5bva7w851aydb5gc6pc7ny")))) + ("rust-winapi-build" + ,(origin + (method url-fetch) + (uri (crate-uri "winapi-build" "0.1.1")) + (sha256 + (base32 + "1g4rqsgjky0a7530qajn2bbfcrl2v0zb39idgdws9b1l7gp5wc9d")))) + ("rust-advapi32-sys" + ,(origin + (method url-fetch) + (uri (crate-uri "advapi32-sys" "0.2.0")) + (sha256 + (base32 + "16largvlrd1800vvdchml0ngnszjlnpqm01rcz5hm7di1h48hrg0")))) + ("rust-gdi32-sys" + ,(origin + (method url-fetch) + (uri (crate-uri "gdi32-sys" "0.2.0")) + (sha256 + (base32 + "0605d4ngjsspghwjv4jicajich1gnl0aik9f880ajjzjixd524h9")))) + ("rust-ws2_32-sys" + ,(origin + (method url-fetch) + (uri (crate-uri "ws2_32-sys" "0.2.1")) + (sha256 + (base32 + "0ppscg5qfqaw0gzwv2a4nhn5bn01ff9iwn6ysqnzm4n8s3myz76m")))) + ("rust-user32-sys" + ,(origin + (method url-fetch) + (uri (crate-uri "user32-sys" "0.2.0")) + (sha256 + (base32 + "0ivxc7hmsxax9crdhxdd1nqwik4s9lhb2x59lc8b88bv20fp3x2f")))) + ("rust-unicode-bidi" + ,(origin + (method url-fetch) + (uri (crate-uri "unicode-bidi" "0.2.3")) + (sha256 + (base32 + "0gqbyf6slkgzr14nf6v8dw8a19l5snh6bpms8bpfvzpxdawwxxy1")))) + ("rust-net2" + ,(origin + (method url-fetch) + (uri (crate-uri "net2" "0.2.26")) + (sha256 + (base32 + "1qp3q6xynb481rsp3ig1nmqb6qlxfba3shfrmqij88cppsv9rpsy")))) + ("rust-utf8-ranges" + ,(origin + (method url-fetch) + (uri (crate-uri "utf8-ranges" "0.1.3")) + (sha256 + (base32 + "03xf604b2v51ag3jgzw92l97xnb10kw9zv948bhc7ja1ik017jm1")))) + ("rust-crossbeam" + ,(origin + (method url-fetch) + (uri (crate-uri "crossbeam" "0.2.10")) + (sha256 + (base32 + "15wga0kvk3iqf3l077957j931brf1pl3p74xibd698jccqas4phc")))) + ("rust-toml" + ,(origin + (method url-fetch) + (uri (crate-uri "toml" "0.2.1")) + (sha256 + (base32 + "1d1cz43bxrx4fd6j2p6myckf81f72bp47akg36y3flxjkhj60svk")))) + ("rust-aho-corasick" + ,(origin + (method url-fetch) + (uri (crate-uri "aho-corasick" "0.5.3")) + (sha256 + (base32 + "0rnvdmlajikq0i4zdy1p3pv699q6apvsxfc7av7byhppllp2r5ya")))) + ("rust-psapi-sys" + ,(origin + (method url-fetch) + (uri (crate-uri "psapi-sys" "0.1.0")) + (sha256 + (base32 + "0y14g8qshsfnmb7nk2gs1rpbrs1wrggajmzp4yby4q6k0wd5vkdb")))) + ("rust-idna" + ,(origin + (method url-fetch) + (uri (crate-uri "idna" "0.1.0")) + (sha256 + (base32 + "049c2rmlydrrrgrxdaq2v21adx9vkfh6k9x4xj56ckyf01p26lqh")))) + ("rust-url" + ,(origin + (method url-fetch) + (uri (crate-uri "url" "1.2.3")) + (sha256 + (base32 + "1myr1i8djbl2bhvvrm6n3h7bj7sl6kh5dmaaz2f7c6x8hyyzgk28")))) + ("rust-regex-syntax" + ,(origin + (method url-fetch) + (uri (crate-uri "regex-syntax" "0.3.9")) + (sha256 + (base32 + "0ms9hgdhhsxw9w920i7gipydvagf100bb56jbs192rz86ln01v7r")))) + ("rust-kernel32-sys" + ,(origin + (method url-fetch) + (uri (crate-uri "kernel32-sys" "0.2.2")) + (sha256 + (base32 + "1389av0601a9yz8dvx5zha9vmkd6ik7ax0idpb032d28555n41vm")))) + ("rust-term" + ,(origin + (method url-fetch) + (uri (crate-uri "term" "0.4.4")) + (sha256 + (base32 + "0jpr7jb1xidadh0arklwr99r8w1k1dfc4an3ginpsq5nnfigivrx")))) + ("rust-thread-id" + ,(origin + (method url-fetch) + (uri (crate-uri "thread-id" "2.0.0")) + (sha256 + (base32 + "00zzs2bx1xw8aqm5plqqgr7bc2zz6zkqrdxq8vpiqb8hc2srslx9")))) + ("rust-thread_local" + ,(origin + (method url-fetch) + (uri (crate-uri "thread_local" "0.2.7")) + (sha256 + (base32 + "1mgxikqvhpsic6xk7pan95lvgsky1sdxzw2w5m2l35pgrazxnxl5")))) + ("rust-miow" + ,(origin + (method url-fetch) + (uri (crate-uri "miow" "0.1.3")) + (sha256 + (base32 + "16jvfjsp6fr4mbd2sw5hcdmi4dsa0m0aa45gjz78mb1h4mwcdgym")))) + ("rust-regex" + ,(origin + (method url-fetch) + (uri (crate-uri "regex" "0.1.80")) + (sha256 + (base32 + "0bs036h3vzc6pj5jj4vc909s9rppq7b808ic99qn0y6gm3karm2g")))) + ("rust-num_cpus" + ,(origin + (method url-fetch) + (uri (crate-uri "num_cpus" "1.1.0")) + (sha256 + (base32 + "1bfwcn3yhwa31rinjw9yr7b6gvn6c06hnwnjz06pvm938w4fd448")))) + ("rust-libgit2-sys" + ,(origin + (method url-fetch) + (uri (crate-uri "libgit2-sys" "0.6.5")) + (sha256 + (base32 + "0yl80n12ih4jh1halpbj3zqlqvw5zxdr6m6xdcvdz67svjy50bjh")))) + ("rust-env_logger" + ,(origin + (method url-fetch) + (uri (crate-uri "env_logger" "0.3.5")) + (sha256 + (base32 + "0bvcjgkw4s3k1rd7glpflgc8s9a393zjd6jfdgvs8gjvwj0dgaqm")))) + ("rust-openssl-probe" + ,(origin + (method url-fetch) + (uri (crate-uri "openssl-probe" "0.1.0")) + (sha256 + (base32 + "0689h6rhzy6dypqr90lsxnf108nsnh952wsx7ggs70s48b44jvbm")))) + ("rust-lazy_static" + ,(origin + (method url-fetch) + (uri (crate-uri "lazy_static" "0.2.2")) + (sha256 + (base32 + "16z1h7w702sxnscak38jykxlhxq0b5ip4mndlb46pkaqwzi0xgka")))) + ("rust-semver-parser" + ,(origin + (method url-fetch) + (uri (crate-uri "semver-parser" "0.6.1")) + (sha256 + (base32 + "1s8s7a7yg8xhgci17y0xhyyncg229byivhpr0wbs3ljdlyjl73p8")))) + ("rust-semver" + ,(origin + (method url-fetch) + (uri (crate-uri "semver" "0.5.1")) + (sha256 + (base32 + "1xbiv8l72rmngb3lgbmk3vd4lalcbzxcnrn085c2b75irl7gcbxf")))) + ("rust-docopt" + ,(origin + (method url-fetch) + (uri (crate-uri "docopt" "0.6.86")) + (sha256 + (base32 + "1nf4f4zf5yk0d0l4kl7hkii4na22fhn0l2hgfb46yzv08l2g6zja")))) + ("rust-miniz-sys" + ,(origin + (method url-fetch) + (uri (crate-uri "miniz-sys" "0.1.7")) + (sha256 + (base32 + "0m7dlggsxash0k5jkx576p556g9r8vnhyl9244gjxhq1g8rls7wx")))) + ("rust-curl" + ,(origin + (method url-fetch) + (uri (crate-uri "curl" "0.4.1")) + (sha256 + (base32 + "1b0y27b6vpqffgzm2kxc1s2i6bgdzxk3wn65g2asbcdxrvys3mcg")))) + ("rust-flate2" + ,(origin + (method url-fetch) + (uri (crate-uri "flate2" "0.2.14")) + (sha256 + (base32 + "1fx3zsls5bb1zfx87s5sxkgk853z4nhjsbvq5s6if13kjlg4isry")))) + ("rust-git2" + ,(origin + (method url-fetch) + (uri (crate-uri "git2" "0.6.3")) + (sha256 + (base32 + "06b1bw3pwszs8617xn8js6h0j983qjgfwsychw33lshccj3cld05")))) + ("rust-crates-io" + ,(origin + (method url-fetch) + (uri (crate-uri "crates-io" "0.4.0")) + (sha256 + (base32 + "0kk6abp1qbpv44hkq1yjp7xgpzjzafs83i1l26ycr0aph1gbwig9")))) + ("rust-git2-curl" + ,(origin + (method url-fetch) + (uri (crate-uri "git2-curl" "0.7.0")) + (sha256 + (base32 + "13mzqp4rd81zp78261rlq23iw9aaysdr56484y1yy2xzhk3nnrv8")))) + ("rust-bufstream" + ,(origin + (method url-fetch) + (uri (crate-uri "bufstream" "0.1.2")) + (sha256 + (base32 + "0x6h27md1fwabbhbycfldj0wklrpjr520z9p0cpzm60fzzidnj3v")))) + ("rust-hamcrest" + ,(origin + (method url-fetch) + (uri (crate-uri "hamcrest" "0.1.1")) + (sha256 + (base32 + "1m49rf7bnkx0qxja56slrjh44zi4z5bjz5x4pblqjw265828y25z")))) + ("rust-num" + ,(origin + (method url-fetch) + (uri (crate-uri "num" "0.1.36")) + (sha256 + (base32 + "081i1r3mdz6jasqd7qwraqqfqa3sdpvdvxl1xq0s7ip714xw1rxx")))) + ("rust-num-traits" + ,(origin + (method url-fetch) + (uri (crate-uri "num-traits" "0.1.36")) + (sha256 + (base32 + "07688sp4z40p14lh5ywvrpm4zq8kcxzhjks8sg33jsr5da2l4sm1")))) + ("rust-num-integer" + ,(origin + (method url-fetch) + (uri (crate-uri "num-integer" "0.1.32")) + (sha256 + (base32 + "14pvaaawl0pgdcgh4dfdd67lz58yxlfl95bry86h28pjnfzxj97v")))) + ("rust-num-bigint" + ,(origin + (method url-fetch) + (uri (crate-uri "num-bigint" "0.1.35")) + (sha256 + (base32 + "0jayfkdm33p4zvcahlv46zdfhlzg053mpw32abf2lz0z8xw47cc8")))) + ("rust-num-rational" + ,(origin + (method url-fetch) + (uri (crate-uri "num-rational" "0.1.35")) + (sha256 + (base32 + "1bwaygv64qg7i78yqg0v4d0amfhamj598rpy4yxjz9rlhcxn1zsl")))) + ("rust-num-iter" + ,(origin + (method url-fetch) + (uri (crate-uri "num-iter" "0.1.32")) + (sha256 + (base32 + "0p74nj5c1mc33h9lx4wpmlmggmn5lnkhxv1225g0aix8d6ciqyi8")))) + ("rust-num-complex" + ,(origin + (method url-fetch) + (uri (crate-uri "num-complex" "0.1.35")) + (sha256 + (base32 + "0bzrjfppnnzf9vmkpklhp2dw9sb1lqzydb8r6k83z76i9l2qxizh")))))) (arguments `(#:cargo ,cargo-bootstrap #:tests? #f ; FIXME @@ -317,12 +791,41 @@ safety and thread safety guarantees.") (delete 'patch-source-shebangs) (delete 'patch-generated-file-shebangs) (delete 'patch-usr-bin-file) + (add-after 'unpack 'unpack-submodule-sources + (lambda* (#:key inputs #:allow-other-keys) + (let ((unpack (lambda (source target) + (mkdir-p target) + (with-directory-excursion target + (zero? (system* "tar" "xf" + source + "--strip-components=1")))))) + (mkdir "vendor") + (for-each (lambda (p) + (let ((name (car p))) + (if (string-prefix? "rust-" name) + (let ((rsrc (string-append "vendor/" + (string-drop name + (string-length "rust-"))))) + (unpack (assoc-ref inputs name) rsrc) + (system* "touch" (string-append rsrc "/.cargo-ok")) + (generate-checksums rsrc (assoc-ref inputs name)))))) inputs)))) ;; Set CARGO_HOME to use the vendored dependencies. (add-after 'unpack 'set-cargo-home (lambda* (#:key inputs #:allow-other-keys) (let* ((gcc (assoc-ref inputs "gcc")) (cc (string-append gcc "/bin/gcc"))) + (mkdir "cargohome") (setenv "CARGO_HOME" (string-append (getcwd) "/cargohome")) + (call-with-output-file "cargohome/config" + (lambda (p) + (format p " +[source.crates-io] +registry = 'https://github.com/rust-lang/crates.io-index' +replace-with = 'vendored-sources' + +[source.vendored-sources] +directory = 'vendor' +"))) (setenv "CMAKE_C_COMPILER" cc) (setenv "CC" cc)) #t))))) -- cgit v1.2.3 From 25fb58a3bee583b0ed4e0ad32fb28f420d8099cd Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Fri, 3 Mar 2017 18:17:28 +0100 Subject: build-system/cargo (cargo-build): Add cargo-build-flags, remove configure-flags. * guix/build-system/cargo.scm (cargo-build): Add cargo-build-flags, remove configure-flags. --- guix/build-system/cargo.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/guix/build-system/cargo.scm b/guix/build-system/cargo.scm index 578c4446a4..c637fbb162 100644 --- a/guix/build-system/cargo.scm +++ b/guix/build-system/cargo.scm @@ -64,7 +64,7 @@ to NAME and VERSION." #:key (tests? #t) (test-target #f) - (configure-flags #f) + (cargo-build-flags ''("--release")) (phases '(@ (guix build cargo-build-system) %standard-phases)) (outputs '("out")) @@ -89,6 +89,7 @@ to NAME and VERSION." source)) #:system ,system #:test-target ,test-target + #:cargo-build-flags ,cargo-build-flags #:tests? ,tests? #:phases ,phases #:outputs %outputs -- cgit v1.2.3 From 4ed64c534a3084bdb50346fcb13f38bda465f701 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Fri, 3 Mar 2017 20:50:47 +0100 Subject: build/cargo-build-system: Make cargo-build-system install working packages. * guix/build/cargo-build-system.scm (configure): Remove proprietary dependencies. Add rust dependencies and configure Cargo to find them. (build): Also build libraries, not just applications. (file-sha256): New variable. (generate-checksums): New variable. Export it. (touch): New variable. (install): Generate checksums so Cargo accepts the package. --- guix/build/cargo-build-system.scm | 116 +++++++++++++++++++++++++++++++------- 1 file changed, 95 insertions(+), 21 deletions(-) diff --git a/guix/build/cargo-build-system.scm b/guix/build/cargo-build-system.scm index 7d656a8d58..f11d858749 100644 --- a/guix/build/cargo-build-system.scm +++ b/guix/build/cargo-build-system.scm @@ -19,13 +19,16 @@ (define-module (guix build cargo-build-system) #:use-module ((guix build gnu-build-system) #:prefix gnu:) #:use-module (guix build utils) + #:use-module (ice-9 popen) + #:use-module (ice-9 rdelim) #:use-module (ice-9 ftw) #:use-module (ice-9 format) #:use-module (ice-9 match) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) #:export (%standard-phases - cargo-build)) + cargo-build + generate-checksums)) ;; Commentary: ;; @@ -45,27 +48,57 @@ "Replace Cargo.toml [dependencies] section with guix inputs." ;; Make sure Cargo.toml is writeable when the crate uses git-fetch. (chmod "Cargo.toml" #o644) - (let ((port (open-file "Cargo.toml" "a" #:encoding "utf-8"))) - (format port "~%[replace]~%") - (for-each - (match-lambda - ((name . path) - (let ((crate (package-name->crate-name name))) - (when (and crate path) - (match (string-split (basename path) #\-) - ((_ ... version) - (format port "\"~a:~a\" = { path = \"~a/share/rust-source\" }~%" - crate version path))))))) - inputs) - (close-port port)) + (chmod "." #o755) + (if (not (file-exists? "vendor")) + (if (not (file-exists? "Cargo.lock")) + (begin + (substitute* "Cargo.toml" + ((".*32-sys.*") " +") + ((".*winapi.*") " +") + ((".*core-foundation.*") " +")) + ;; Prepare one new directory with all the required dependencies. + ;; It's necessary to do this (instead of just using /gnu/store as the + ;; directory) because we want to hide the libraries in subdirectories + ;; share/rust-source/... instead of polluting the user's profile root. + (mkdir "vendor") + (for-each + (match-lambda + ((name . path) + (let ((crate (package-name->crate-name name))) + (when (and crate path) + (match (string-split (basename path) #\-) + ((_ ... version) + (symlink (string-append path "/share/rust-source") + (string-append "vendor/" (basename path))))))))) + inputs) + ;; Configure cargo to actually use this new directory. + (mkdir-p ".cargo") + (let ((port (open-file ".cargo/config" "w" #:encoding "utf-8"))) + (display " +[source.crates-io] +registry = 'https://github.com/rust-lang/crates.io-index' +replace-with = 'vendored-sources' + +[source.vendored-sources] +directory = '" port) + (display (getcwd) port) + (display "/vendor" port) + (display "' +" port) + (close-port port))))) + (setenv "CC" (string-append (assoc-ref inputs "gcc") "/bin/gcc")) + + ;(setenv "CARGO_HOME" "/gnu/store") + ; (setenv "CMAKE_C_COMPILER" cc) #t) -(define* (build #:key (cargo-build-flags '("--release" "--frozen")) +(define* (build #:key (cargo-build-flags '("--release")) #:allow-other-keys) "Build a given Cargo package." - (if (file-exists? "Cargo.lock") - (zero? (apply system* `("cargo" "build" ,@cargo-build-flags))) - #t)) + (zero? (apply system* `("cargo" "build" ,@cargo-build-flags)))) (define* (check #:key tests? #:allow-other-keys) "Run tests for a given Cargo package." @@ -73,6 +106,44 @@ (zero? (system* "cargo" "test")) #t)) +(define (file-sha256 file-name) + "Calculate the hexdigest of the sha256 checksum of FILE-NAME and return it." + (let ((port (open-pipe* OPEN_READ + "sha256sum" + "--" + file-name))) + (let ((result (read-delimited " " port))) + (close-pipe port) + result))) + +;; Example dir-name: "/gnu/store/hwlr49riz3la33m6in2n898ly045ylld-rust-rand-0.3.15". +(define (generate-checksums dir-name src-name) + "Given DIR-NAME, checksum all the files in it one by one and put the + result into the file \".cargo-checksum.json\" in the same directory. + Also includes the checksum of an extra file SRC-NAME as if it was + part of the directory DIR-NAME with name \"package\"." + (let* ((file-names (find-files dir-name ".")) + (dir-prefix-name (string-append dir-name "/")) + (dir-prefix-name-len (string-length dir-prefix-name)) + (checksums-file-name (string-append dir-name "/.cargo-checksum.json"))) + (call-with-output-file checksums-file-name + (lambda (port) + (display "{\"files\":{" port) + (let ((sep "")) + (for-each (lambda (file-name) + (let ((file-relative-name (string-drop file-name dir-prefix-name-len))) + (display sep port) + (set! sep ",") + (write file-relative-name port) + (display ":" port) + (write (file-sha256 file-name) port))) file-names)) + (display "},\"package\":" port) + (write (file-sha256 src-name) port) + (display "}" port))))) + +(define (touch file-name) + (call-with-output-file file-name (const #t))) + (define* (install #:key inputs outputs #:allow-other-keys) "Install a given Cargo package." (let* ((out (assoc-ref outputs "out")) @@ -86,16 +157,19 @@ ;; distributing crates as source and replacing ;; references in Cargo.toml with store paths. (copy-recursively "src" (string-append rsrc "/src")) + (touch (string-append rsrc "/.cargo-ok")) + (generate-checksums rsrc src) (install-file "Cargo.toml" rsrc) ;; When the package includes executables we install ;; it using cargo install. This fails when the crate ;; doesn't contain an executable. (if (file-exists? "Cargo.lock") - (system* "cargo" "install" "--root" out) - (mkdir out)))) + (zero? (system* "cargo" "install" "--root" out)) + (begin + (mkdir out) + #t)))) (define %standard-phases - ;; 'configure' phase is not needed. (modify-phases gnu:%standard-phases (replace 'configure configure) (replace 'build build) -- cgit v1.2.3 From 0d3ddd490b1372698b5a935068f59f3bf442841f Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Fri, 17 Mar 2017 19:32:15 +0100 Subject: gnu: btrfs-progs: Update to 4.10.1. * gnu/packages/linux.scm (btrfs-progs): Update to 4.10.1. --- gnu/packages/linux.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 4557194e86..60e496e241 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -2766,7 +2766,7 @@ and copy/paste text in the console and in xterm.") (define-public btrfs-progs (package (name "btrfs-progs") - (version "4.10") + (version "4.10.1") (source (origin (method url-fetch) (uri (string-append "mirror://kernel.org/linux/kernel/" @@ -2774,7 +2774,7 @@ and copy/paste text in the console and in xterm.") "btrfs-progs-v" version ".tar.xz")) (sha256 (base32 - "1njw2nrm51380d8arvqfmspa3app9353yd7hiddas3gpkaiwrjs4")))) + "06hs20jwa15xybbmlalba8wvhv3slq1g0wrqrgyh7ll5y11bc5kc")))) (build-system gnu-build-system) (outputs '("out" "static")) ; static versions of binaries in "out" (~16MiB!) -- cgit v1.2.3 From 039601e097fda733ea93800c8dd4d3e447c20a6b Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Fri, 17 Mar 2017 19:33:22 +0100 Subject: gnu: btrfs-progs: Use @dfn in description. * gnu/packages/linux.scm (btrfs-progs)[description]: Use @dfn. --- gnu/packages/linux.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 60e496e241..c7225dac3b 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -2809,9 +2809,9 @@ and copy/paste text in the console and in xterm.") ("which" ,which))) (home-page "https://btrfs.wiki.kernel.org/") (synopsis "Create and manage btrfs copy-on-write file systems") - (description "Btrfs is a copy-on-write (CoW) file system for Linux aimed at -implementing advanced features while focusing on fault tolerance, repair and -easy administration.") + (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux +aimed at implementing advanced features while focusing on fault tolerance, +repair and easy administration.") ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c. ;; GPL2: Everything else. (license (list license:gpl2 license:gpl2+)))) -- cgit v1.2.3 From cbef2796edcd35d63fd5a1eea9390fc98564c7f2 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Fri, 17 Mar 2017 11:15:01 +0100 Subject: gnu: ninja: Update to 1.7.2. * gnu/packages/ninja.scm (ninja): Update to 1.7.2. [source]: Remove patch. * gnu/packages/patches/ninja-tests.patch: Delete file. * gnu/local.mk (dist_patch_DATA): Remove it. --- gnu/local.mk | 1 - gnu/packages/ninja.scm | 7 +++-- gnu/packages/patches/ninja-tests.patch | 48 ---------------------------------- 3 files changed, 3 insertions(+), 53 deletions(-) delete mode 100644 gnu/packages/patches/ninja-tests.patch diff --git a/gnu/local.mk b/gnu/local.mk index 2cc5d546b3..f2ce6c0a63 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -778,7 +778,6 @@ dist_patch_DATA = \ %D%/packages/patches/netsurf-longer-test-timeout.patch \ %D%/packages/patches/ngircd-handle-zombies.patch \ %D%/packages/patches/ngircd-no-dns-in-tests.patch \ - %D%/packages/patches/ninja-tests.patch \ %D%/packages/patches/ninja-zero-mtime.patch \ %D%/packages/patches/node-9077.patch \ %D%/packages/patches/nss-pkgconfig.patch \ diff --git a/gnu/packages/ninja.scm b/gnu/packages/ninja.scm index 8f18eb3560..2a53a3f5b3 100644 --- a/gnu/packages/ninja.scm +++ b/gnu/packages/ninja.scm @@ -29,7 +29,7 @@ (define-public ninja (package (name "ninja") - (version "1.7.1") + (version "1.7.2") (source (origin (method url-fetch) (uri (string-append "https://github.com/martine/ninja/" @@ -37,9 +37,8 @@ (file-name (string-append name "-" version ".tar.gz")) (sha256 (base32 - "06dy2dc1aafm61ynw9gzig88la3km9dsh53bxf4mnw7l7kjisn2i")) - (patches (search-patches "ninja-zero-mtime.patch" - "ninja-tests.patch")))) + "1n8n3g26ppwh7zwrc37n3alkbpbj0wki34ih53s3rkhs8ajs1p9f")) + (patches (search-patches "ninja-zero-mtime.patch")))) (build-system gnu-build-system) (native-inputs `(("python" ,python-2))) (arguments diff --git a/gnu/packages/patches/ninja-tests.patch b/gnu/packages/patches/ninja-tests.patch deleted file mode 100644 index f9b0d9f910..0000000000 --- a/gnu/packages/patches/ninja-tests.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 67d6b9262efad99f8aad63ab81efc8e689748766 Mon Sep 17 00:00:00 2001 -From: Efraim Flashner -Date: Sun, 3 Jul 2016 11:55:43 +0300 -Subject: [PATCH] patch - ---- - src/subprocess_test.cc | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/src/subprocess_test.cc b/src/subprocess_test.cc -index ee16190..a537c11 100644 ---- a/src/subprocess_test.cc -+++ b/src/subprocess_test.cc -@@ -72,6 +72,7 @@ TEST_F(SubprocessTest, NoSuchCommand) { - - #ifndef _WIN32 - -+#if 0 - TEST_F(SubprocessTest, InterruptChild) { - Subprocess* subproc = subprocs_.Add("kill -INT $$"); - ASSERT_NE((Subprocess *) 0, subproc); -@@ -82,6 +83,7 @@ TEST_F(SubprocessTest, InterruptChild) { - - EXPECT_EQ(ExitInterrupted, subproc->Finish()); - } -+#endif - - TEST_F(SubprocessTest, InterruptParent) { - Subprocess* subproc = subprocs_.Add("kill -INT $PPID ; sleep 1"); -@@ -217,6 +219,7 @@ TEST_F(SubprocessTest, SetWithMulti) { - // OS X's process limit is less than 1025 by default - // (|sysctl kern.maxprocperuid| is 709 on 10.7 and 10.8 and less prior to that). - #if !defined(__APPLE__) && !defined(_WIN32) -+#if 0 - TEST_F(SubprocessTest, SetWithLots) { - // Arbitrary big number; needs to be over 1024 to confirm we're no longer - // hostage to pselect. -@@ -245,6 +248,7 @@ TEST_F(SubprocessTest, SetWithLots) { - } - ASSERT_EQ(kNumProcs, subprocs_.finished_.size()); - } -+#endif - #endif // !__APPLE__ && !_WIN32 - - // TODO: this test could work on Windows, just not sure how to simply --- -2.9.0 - -- cgit v1.2.3 From 2a047d59e03100b1cafb8cc235cab75e7e6415c7 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Fri, 17 Mar 2017 20:10:12 +0100 Subject: gnu: libwebp: Update to 0.6.0. * gnu/packages/image.scm (libwebp): Update to 0.6.0. [source]: Remove patch. * gnu/packages/patches/libwebp-CVE-2016-9085.patch: Delete file. * gnu/local.mk (dist_patch_DATA): Remove it. --- gnu/local.mk | 1 - gnu/packages/image.scm | 5 +- gnu/packages/patches/libwebp-CVE-2016-9085.patch | 144 ----------------------- 3 files changed, 2 insertions(+), 148 deletions(-) delete mode 100644 gnu/packages/patches/libwebp-CVE-2016-9085.patch diff --git a/gnu/local.mk b/gnu/local.mk index f2ce6c0a63..48c134ba6e 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -714,7 +714,6 @@ dist_patch_DATA = \ %D%/packages/patches/libtool-skip-tests2.patch \ %D%/packages/patches/libunwind-CVE-2015-3239.patch \ %D%/packages/patches/libvpx-CVE-2016-2818.patch \ - %D%/packages/patches/libwebp-CVE-2016-9085.patch \ %D%/packages/patches/libwmf-CAN-2004-0941.patch \ %D%/packages/patches/libwmf-CVE-2006-3376.patch \ %D%/packages/patches/libwmf-CVE-2007-0455.patch \ diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm index 9b8a3a63da..f2afa988cb 100644 --- a/gnu/packages/image.scm +++ b/gnu/packages/image.scm @@ -805,17 +805,16 @@ multi-dimensional image processing.") (define-public libwebp (package (name "libwebp") - (version "0.5.1") + (version "0.6.0") (source (origin (method url-fetch) (uri (string-append "http://downloads.webmproject.org/releases/webp/libwebp-" version ".tar.gz")) - (patches (search-patches "libwebp-CVE-2016-9085.patch")) (sha256 (base32 - "1pqki1g8nzi8qgciysypd5r38zccv81np1dn43g27830rmpnrmka")))) + "0h1brwkyxc7lb8lc53aacdks5vc1y9hzngqi41gg7y6l56912a69")))) (build-system gnu-build-system) (inputs `(("freeglut" ,freeglut) diff --git a/gnu/packages/patches/libwebp-CVE-2016-9085.patch b/gnu/packages/patches/libwebp-CVE-2016-9085.patch deleted file mode 100644 index e40b353303..0000000000 --- a/gnu/packages/patches/libwebp-CVE-2016-9085.patch +++ /dev/null @@ -1,144 +0,0 @@ -Fix CVE-2016-9085 (several integer overflows): - -https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-9085 -http://seclists.org/oss-sec/2016/q4/253 - -Patch copied from upstream source repository: - -https://chromium.googlesource.com/webm/libwebp/+/e2affacc35f1df6cc3b1a9fa0ceff5ce2d0cce83 - -From e2affacc35f1df6cc3b1a9fa0ceff5ce2d0cce83 Mon Sep 17 00:00:00 2001 -From: Pascal Massimino -Date: Mon, 10 Oct 2016 11:48:39 +0200 -Subject: [PATCH] fix potential overflow when width * height * 4 >= (1<<32) - -Mostly: avoid doing calculation like: ptr + j * stride -when stride is 'int'. Rather use size_t, or pointer increments (ptr += stride) -when possible. - -BUG=webp:314 - -Change-Id: I81c684b515dd1ec4f601f32d50a6e821c4e46e20 ---- - examples/gifdec.c | 56 +++++++++++++++++++++++++++++++------------------------ - 1 file changed, 32 insertions(+), 24 deletions(-) - -diff --git a/examples/gifdec.c b/examples/gifdec.c -index 83c3d82..7df176f 100644 ---- a/examples/gifdec.c -+++ b/examples/gifdec.c -@@ -20,6 +20,7 @@ - - #include "webp/encode.h" - #include "webp/mux_types.h" -+#include "webp/format_constants.h" - - #define GIF_TRANSPARENT_COLOR 0x00000000 - #define GIF_WHITE_COLOR 0xffffffff -@@ -103,12 +104,19 @@ int GIFReadFrame(GifFileType* const gif, int transparent_index, - const GifImageDesc* const image_desc = &gif->Image; - uint32_t* dst = NULL; - uint8_t* tmp = NULL; -- int ok = 0; -- GIFFrameRect rect = { -+ const GIFFrameRect rect = { - image_desc->Left, image_desc->Top, image_desc->Width, image_desc->Height - }; -+ const uint64_t memory_needed = 4 * rect.width * (uint64_t)rect.height; -+ int ok = 0; - *gif_rect = rect; - -+ if (memory_needed != (size_t)memory_needed || -+ memory_needed > 4 * MAX_IMAGE_AREA) { -+ fprintf(stderr, "Image is too large (%d x %d).", rect.width, rect.height); -+ return 0; -+ } -+ - // Use a view for the sub-picture: - if (!WebPPictureView(picture, rect.x_offset, rect.y_offset, - rect.width, rect.height, &sub_image)) { -@@ -132,15 +140,15 @@ int GIFReadFrame(GifFileType* const gif, int transparent_index, - y += interlace_jumps[pass]) { - if (DGifGetLine(gif, tmp, rect.width) == GIF_ERROR) goto End; - Remap(gif, tmp, rect.width, transparent_index, -- dst + y * sub_image.argb_stride); -+ dst + y * (size_t)sub_image.argb_stride); - } - } - } else { // Non-interlaced image. - int y; -- for (y = 0; y < rect.height; ++y) { -+ uint32_t* ptr = dst; -+ for (y = 0; y < rect.height; ++y, ptr += sub_image.argb_stride) { - if (DGifGetLine(gif, tmp, rect.width) == GIF_ERROR) goto End; -- Remap(gif, tmp, rect.width, transparent_index, -- dst + y * sub_image.argb_stride); -+ Remap(gif, tmp, rect.width, transparent_index, ptr); - } - } - ok = 1; -@@ -216,13 +224,11 @@ int GIFReadMetadata(GifFileType* const gif, GifByteType** const buf, - - static void ClearRectangle(WebPPicture* const picture, - int left, int top, int width, int height) { -- int j; -- for (j = top; j < top + height; ++j) { -- uint32_t* const dst = picture->argb + j * picture->argb_stride; -- int i; -- for (i = left; i < left + width; ++i) { -- dst[i] = GIF_TRANSPARENT_COLOR; -- } -+ int i, j; -+ const size_t stride = picture->argb_stride; -+ uint32_t* dst = picture->argb + top * stride + left; -+ for (j = 0; j < height; ++j, dst += stride) { -+ for (i = 0; i < width; ++i) dst[i] = GIF_TRANSPARENT_COLOR; - } - } - -@@ -246,29 +252,31 @@ void GIFDisposeFrame(GIFDisposeMethod dispose, const GIFFrameRect* const rect, - if (dispose == GIF_DISPOSE_BACKGROUND) { - GIFClearPic(curr_canvas, rect); - } else if (dispose == GIF_DISPOSE_RESTORE_PREVIOUS) { -- const int src_stride = prev_canvas->argb_stride; -- const uint32_t* const src = -- prev_canvas->argb + rect->x_offset + rect->y_offset * src_stride; -- const int dst_stride = curr_canvas->argb_stride; -- uint32_t* const dst = -- curr_canvas->argb + rect->x_offset + rect->y_offset * dst_stride; -+ const size_t src_stride = prev_canvas->argb_stride; -+ const uint32_t* const src = prev_canvas->argb + rect->x_offset -+ + rect->y_offset * src_stride; -+ const size_t dst_stride = curr_canvas->argb_stride; -+ uint32_t* const dst = curr_canvas->argb + rect->x_offset -+ + rect->y_offset * dst_stride; - assert(prev_canvas != NULL); -- WebPCopyPlane((uint8_t*)src, 4 * src_stride, (uint8_t*)dst, 4 * dst_stride, -+ WebPCopyPlane((uint8_t*)src, (int)(4 * src_stride), -+ (uint8_t*)dst, (int)(4 * dst_stride), - 4 * rect->width, rect->height); - } - } - - void GIFBlendFrames(const WebPPicture* const src, - const GIFFrameRect* const rect, WebPPicture* const dst) { -- int j; -+ int i, j; -+ const size_t src_stride = src->argb_stride; -+ const size_t dst_stride = dst->argb_stride; - assert(src->width == dst->width && src->height == dst->height); - for (j = rect->y_offset; j < rect->y_offset + rect->height; ++j) { -- int i; - for (i = rect->x_offset; i < rect->x_offset + rect->width; ++i) { -- const uint32_t src_pixel = src->argb[j * src->argb_stride + i]; -+ const uint32_t src_pixel = src->argb[j * src_stride + i]; - const int src_alpha = src_pixel >> 24; - if (src_alpha != 0) { -- dst->argb[j * dst->argb_stride + i] = src_pixel; -+ dst->argb[j * dst_stride + i] = src_pixel; - } - } - } --- -2.10.1 - -- cgit v1.2.3 From 715dd13d8e11bcab03348e63fd80b6207565a1b6 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Fri, 17 Mar 2017 20:28:36 +0100 Subject: gnu: libx264: Update to 20170316-2245. * gnu/packages/video.scm (libx264): Update to 20170316-2245. --- gnu/packages/video.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm index 9142dd95f2..b7e0922dea 100644 --- a/gnu/packages/video.scm +++ b/gnu/packages/video.scm @@ -215,14 +215,14 @@ television and DVD. It is also known as AC-3.") (define-public libx264 (package (name "libx264") - (version "20170224-2245") + (version "20170316-2245") (source (origin (method url-fetch) (uri (string-append "https://download.videolan.org/pub/x264/snapshots/" "x264-snapshot-" version ".tar.bz2")) (sha256 (base32 - "0paw8vzsy2qh5jf6xg2i1risjwyvmxgfnivly4gh0bib62cp4vib")))) + "1s1nnvl3axz38sv4g09skijl6k9mbbngbb1nsh26w4dr2w2gyzad")))) (build-system gnu-build-system) (native-inputs `(("pkg-config" ,pkg-config) -- cgit v1.2.3 From 7c78beb33cbed12ac062060b0ea898583b9430b0 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Fri, 17 Mar 2017 20:34:48 +0100 Subject: gnu: libbluray: Update to 1.0.0. * gnu/packages/video.scm (libbluray): Update to 1.0.0. --- gnu/packages/video.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm index b7e0922dea..b128d71acf 100644 --- a/gnu/packages/video.scm +++ b/gnu/packages/video.scm @@ -1017,7 +1017,7 @@ YouTube.com and a few more sites.") (define-public libbluray (package (name "libbluray") - (version "0.9.3") + (version "1.0.0") (source (origin (method url-fetch) (uri (string-append "https://download.videolan.org/videolan/" @@ -1025,7 +1025,7 @@ YouTube.com and a few more sites.") name "-" version ".tar.bz2")) (sha256 (base32 - "1q1whviqv5sr9nr372h31zwid1rvbfbx3z4lzr8lnj25xha6cdm6")))) + "1k3lag4lxi2jjd3zh4wcb5l3hadzm54j5kagh92yzfy76p9svqzp")))) (build-system gnu-build-system) (arguments `(#:configure-flags '("--disable-bdjava") -- cgit v1.2.3 From 48b444304e206c35cf2c8e0d87a4711f1aac4fd4 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 17 Mar 2017 17:37:00 +0100 Subject: pack: Move absolute file name to . * guix/scripts/pack.scm ()[package]: Remove. [command]: Document as being a gexp with an absolute file name. (%compressors): Adjust accordingly. (self-contained-tarball): Simplify PATH expression. Move 'string-join' for the compressor command on the build side. (docker-image): Simplify PATH expression. * tests/pack.scm (%gzip-compressor): Adjust accordingly. --- guix/scripts/pack.scm | 31 ++++++++++++++++--------------- tests/pack.scm | 3 ++- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm index 74d4ee6d4d..ce7613e4a0 100644 --- a/guix/scripts/pack.scm +++ b/guix/scripts/pack.scm @@ -46,19 +46,22 @@ ;; Type of a compression tool. (define-record-type - (compressor name package extension command) + (compressor name extension command) compressor? - (name compressor-name) ;string (e.g., "gzip") - (package compressor-package) ;package - (extension compressor-extension) ;string (e.g., "lz") - (command compressor-command)) ;list (e.g., '("gzip" "-9n")) + (name compressor-name) ;string (e.g., "gzip") + (extension compressor-extension) ;string (e.g., "lz") + (command compressor-command)) ;gexp (e.g., #~("/gnu/store/…/gzip" "-9n")) (define %compressors ;; Available compression tools. - (list (compressor "gzip" gzip "gz" '("gzip" "-9n")) - (compressor "lzip" lzip "lz" '("lzip" "-9")) - (compressor "xz" xz "xz" '("xz" "-e")) - (compressor "bzip2" bzip2 "bz2" '("bzip2" "-9")))) + (list (compressor "gzip" "gz" + #~(#+(file-append gzip "/bin/gzip") "-9n")) + (compressor "lzip" "lz" + #~(#+(file-append lzip "/bin/lzip") "-9")) + (compressor "xz" "xz" + #~(#+(file-append xz "/bin/xz") "-e")) + (compressor "bzip2" "bz2" + #~(#+(file-append bzip2 "/bin/bzip2") "-9")))) (define (lookup-compressor name) "Return the compressor object called NAME. Error out if it could not be @@ -121,8 +124,7 @@ added to the pack." (string-append #$(if localstatedir? (file-append guix "/sbin:") "") - #$tar "/bin:" - #$(compressor-package compressor) "/bin")) + #$tar "/bin")) ;; Note: there is not much to gain here with deduplication and ;; there is the overhead of the '.links' directory, so turn it @@ -142,7 +144,8 @@ added to the pack." (with-directory-excursion %root (exit (zero? (apply system* "tar" - "-I" #$(string-join (compressor-command compressor)) + "-I" + (string-join '#+(compressor-command compressor)) "--format=gnu" ;; Avoid non-determinism in the archive. Use @@ -221,9 +224,7 @@ with COMPRESSOR. It can be passed to 'docker load'." (use-modules (guix docker) (srfi srfi-19)) - (setenv "PATH" - (string-append #$tar "/bin:" - #$(compressor-package compressor) "/bin")) + (setenv "PATH" (string-append #$tar "/bin")) (build-docker-image #$output #$profile #:closure "profile" diff --git a/tests/pack.scm b/tests/pack.scm index de9ef8e6ab..eb643c3229 100644 --- a/tests/pack.scm +++ b/tests/pack.scm @@ -42,7 +42,8 @@ (define %gzip-compressor ;; Compressor that uses the bootstrap 'gzip'. ((@ (guix scripts pack) compressor) "gzip" - %bootstrap-coreutils&co "gz" '("gzip" "-6n"))) + "gz" + #~(#+(file-append %bootstrap-coreutils&co "/bin/gzip") "-6n"))) (define %tar-bootstrap %bootstrap-coreutils&co) -- cgit v1.2.3 From 176febe3776b272dffbe757414225702d08c3bdf Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 17 Mar 2017 21:48:40 +0100 Subject: profiles: Packages in a profile can be cross-compiled. * guix/profiles.scm (profile-derivation): Add #:target parameter; pass it to 'gexp->derivation'. * tests/profiles.scm ("profile-derivation, cross-compilation"): New test. --- guix/profiles.scm | 10 +++++++--- tests/profiles.scm | 31 ++++++++++++++++++++++++++++++- 2 files changed, 37 insertions(+), 4 deletions(-) diff --git a/guix/profiles.scm b/guix/profiles.scm index de82eae348..a62a076f64 100644 --- a/guix/profiles.scm +++ b/guix/profiles.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014, 2015, 2016 Ludovic Courtès +;;; Copyright © 2013, 2014, 2015, 2016, 2017 Ludovic Courtès ;;; Copyright © 2013 Nikita Karetnikov ;;; Copyright © 2014, 2016 Alex Kost ;;; Copyright © 2015 Mark H Weaver @@ -933,13 +933,16 @@ files for the truetype fonts of the @var{manifest} entries." #:key (hooks %default-profile-hooks) (locales? #t) - system) + system target) "Return a derivation that builds a profile (aka. 'user environment') with the given MANIFEST. The profile includes additional derivations returned by the monadic procedures listed in HOOKS--such as an Info 'dir' file, etc. When LOCALES? is true, the build is performed under a UTF-8 locale; this adds -a dependency on the 'glibc-utf8-locales' package." +a dependency on the 'glibc-utf8-locales' package. + +When TARGET is true, it must be a GNU triplet, and the packages in MANIFEST +are cross-built for TARGET." (mlet %store-monad ((system (if system (return system) (current-system))) @@ -1000,6 +1003,7 @@ a dependency on the 'glibc-utf8-locales' package." (gexp->derivation "profile" builder #:system system + #:target target ;; Not worth offloading. #:local-build? #t diff --git a/tests/profiles.scm b/tests/profiles.scm index 5536364889..d0b1e14a86 100644 --- a/tests/profiles.scm +++ b/tests/profiles.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014, 2015, 2016 Ludovic Courtès +;;; Copyright © 2013, 2014, 2015, 2016, 2017 Ludovic Courtès ;;; Copyright © 2014 Alex Kost ;;; ;;; This file is part of GNU Guix. @@ -212,6 +212,35 @@ #:locales? #f))) (return (derivation-inputs drv)))) +(test-assertm "profile-derivation, cross-compilation" + (mlet* %store-monad + ((manifest -> (packages->manifest (list packages:sed packages:grep))) + (target -> "arm-linux-gnueabihf") + (grep (package->cross-derivation packages:grep target)) + (sed (package->cross-derivation packages:sed target)) + (locales (package->derivation packages:glibc-utf8-locales)) + (drv (profile-derivation manifest + #:hooks '() + #:locales? #t + #:target target))) + (define (find-input name) + (let ((name (string-append name ".drv"))) + (any (lambda (input) + (let ((input (derivation-input-path input))) + (and (string-suffix? name input) input))) + (derivation-inputs drv)))) + + ;; The inputs for grep and sed should be cross-build derivations, but that + ;; for the glibc-utf8-locales should be a native build. + (return (and (string=? (derivation-system drv) (%current-system)) + (string=? (find-input (package-full-name packages:grep)) + (derivation-file-name grep)) + (string=? (find-input (package-full-name packages:sed)) + (derivation-file-name sed)) + (string=? (find-input + (package-full-name packages:glibc-utf8-locales)) + (derivation-file-name locales)))))) + (test-assert "package->manifest-entry defaults to \"out\"" (let ((outputs (package-outputs packages:glibc))) (equal? (manifest-entry-output -- cgit v1.2.3 From 5461115e8fd9a3181506307b6090716a0d5c202c Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 17 Mar 2017 22:45:32 +0100 Subject: pack: Add '--target'. * guix/scripts/pack.scm (self-contained-tarball): Add #:target. (docker-image): Add #:target. [build]: Pass it to 'build-docker-image'. (%options, show-help): Add '--target'. (guix-pack): Pass TARGET to 'profile-derivation' and to 'build-image'. * guix/docker.scm (build-docker-image): Add #:system parameter and honor it. * doc/guix.texi (Invoking guix pack): Document '--target'. (Additional Build Options): Refer to the Autoconf manual instead of the obsolete 'configure.info' for cross-compilation. --- doc/guix.texi | 10 ++++++++-- guix/docker.scm | 21 +++++++++++++++------ guix/scripts/pack.scm | 23 +++++++++++++++++++---- 3 files changed, 42 insertions(+), 12 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 3db6dad5f3..0a09bba06f 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -2476,6 +2476,12 @@ Docker Image Specification}. Attempt to build for @var{system}---e.g., @code{i686-linux}---instead of the system type of the build host. +@item --target=@var{triplet} +@cindex cross-compilation +Cross-build for @var{triplet}, which must be a valid GNU triplet, such +as @code{"mips64el-linux-gnu"} (@pxref{Specifying target triplets, GNU +configuration triplets,, autoconf, Autoconf}). + @item --compression=@var{tool} @itemx -C @var{tool} Compress the resulting tarball using @var{tool}---one of @code{gzip}, @@ -5063,8 +5069,8 @@ to build packages in a complete 32-bit environment. @item --target=@var{triplet} @cindex cross-compilation Cross-build for @var{triplet}, which must be a valid GNU triplet, such -as @code{"mips64el-linux-gnu"} (@pxref{Configuration Names, GNU -configuration triplets,, configure, GNU Configure and Build System}). +as @code{"mips64el-linux-gnu"} (@pxref{Specifying target triplets, GNU +configuration triplets,, autoconf, Autoconf}). @anchor{build-check} @item --check diff --git a/guix/docker.scm b/guix/docker.scm index 290ad3dcf1..060232148e 100644 --- a/guix/docker.scm +++ b/guix/docker.scm @@ -105,12 +105,14 @@ return \"a\"." (define* (build-docker-image image path #:key closure compressor (symlinks '()) + (system (utsname:machine (uname))) (creation-time (current-time time-utc))) "Write to IMAGE a Docker image archive from the given store PATH. The image contains the closure of PATH, as specified in CLOSURE (a file produced by #:references-graphs). SYMLINKS must be a list of (SOURCE -> TARGET) tuples describing symlinks to be created in the image, where each TARGET is relative -to PATH. +to PATH. SYSTEM is a GNU triplet (or prefix thereof) of the system the +binaries at PATH are for; it is used to produce metadata in the image. Use COMPRESSOR, a command such as '(\"gzip\" \"-9n\"), to compress IMAGE. Use CREATION-TIME, a SRFI-19 time-utc object, as the creation time in metadata." @@ -118,11 +120,18 @@ CREATION-TIME, a SRFI-19 time-utc object, as the creation time in metadata." (closure (canonicalize-path closure)) (id (docker-id path)) (time (date->string (time-utc->date creation-time) "~4")) - (arch (match (utsname:machine (uname)) - ("x86_64" "amd64") - ("i686" "386") - ("armv7l" "arm") - ("mips64" "mips64le")))) + (arch (let-syntax ((cond* (syntax-rules () + ((_ (pattern clause) ...) + (cond ((string-prefix? pattern system) + clause) + ... + (else + (error "unsupported system" + system))))))) + (cond* ("x86_64" "amd64") + ("i686" "386") + ("arm" "arm") + ("mips64" "mips64le"))))) ;; Make sure we start with a fresh, empty working directory. (mkdir directory) diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm index ce7613e4a0..626c592e1c 100644 --- a/guix/scripts/pack.scm +++ b/guix/scripts/pack.scm @@ -73,7 +73,8 @@ found." (leave (_ "~a: compressor not found~%") name))) (define* (self-contained-tarball name profile - #:key deduplicate? + #:key target + deduplicate? (compressor (first %compressors)) localstatedir? (symlinks '()) @@ -184,14 +185,17 @@ added to the pack." #:references-graphs `(("profile" ,profile)))) (define* (docker-image name profile - #:key deduplicate? + #:key target + deduplicate? (compressor (first %compressors)) localstatedir? (symlinks '()) (tar tar)) "Return a derivation to construct a Docker image of PROFILE. The image is a tarball conforming to the Docker Image Specification, compressed -with COMPRESSOR. It can be passed to 'docker load'." +with COMPRESSOR. It can be passed to 'docker load'. If TARGET is true, it +must a be a GNU triplet and it is used to derive the architecture metadata in +the image." ;; FIXME: Honor LOCALSTATEDIR?. (define not-config? (match-lambda @@ -227,6 +231,7 @@ with COMPRESSOR. It can be passed to 'docker load'." (setenv "PATH" (string-append #$tar "/bin")) (build-docker-image #$output #$profile + #:system (or #$target (utsname:machine (uname))) #:closure "profile" #:symlinks '#$symlinks #:compressor '#$(compressor-command compressor) @@ -278,6 +283,10 @@ with COMPRESSOR. It can be passed to 'docker load'." (lambda (opt name arg result) (alist-cons 'system arg (alist-delete 'system result eq?)))) + (option '("target") #t #f + (lambda (opt name arg result) + (alist-cons 'target arg + (alist-delete 'target result eq?)))) (option '(#\C "compression") #t #f (lambda (opt name arg result) (alist-cons 'compressor (lookup-compressor arg) @@ -314,6 +323,8 @@ Create a bundle of PACKAGE.\n")) -f, --format=FORMAT build a pack in the given FORMAT")) (display (_ " -s, --system=SYSTEM attempt to build for SYSTEM--e.g., \"i686-linux\"")) + (display (_ " + --target=TRIPLET cross-build for TRIPLET--e.g., \"armel-linux-gnu\"")) (display (_ " -C, --compression=TOOL compress using TOOL--e.g., \"lzip\"")) (display (_ " @@ -354,6 +365,7 @@ Create a bundle of PACKAGE.\n")) (pack-format (assoc-ref opts 'format)) (name (string-append (symbol->string pack-format) "-pack")) + (target (assoc-ref opts 'target)) (compressor (assoc-ref opts 'compressor)) (symlinks (assoc-ref opts 'symlinks)) (build-image (match (assq-ref %formats pack-format) @@ -368,8 +380,11 @@ Create a bundle of PACKAGE.\n")) (run-with-store store (mlet* %store-monad ((profile (profile-derivation - (packages->manifest packages))) + (packages->manifest packages) + #:target target)) (drv (build-image name profile + #:target + target #:compressor compressor #:symlinks -- cgit v1.2.3 From 36626c556ed75219bce196ac93d148f6b9af984c Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 17 Mar 2017 23:07:01 +0100 Subject: build: Require Guile >= 2.0.9. * configure.ac: Bump requirement to 2.0.9. * doc/guix.texi (Requirements): Adjust accordingly. * README (Requirements): Likewise. * build-aux/download.scm: Remove workaround for . * guix/build/download.scm: Likewise. (http-fetch)[post-2.0.7?]: Remove. Remove conditional code for not POST-2.0.7?. * guix/http-client.scm: Remove workaround for . (http-fetch)[post-2.0.7?]: Remove. Remove conditional code for not POST-2.0.7?. * guix/serialization.scm (read-latin1-string): Remove mention of 2.0.9. * tests/nar.scm: Use (ice-9 control). (let/ec): Remove. --- README | 2 +- build-aux/download.scm | 5 ----- configure.ac | 2 +- doc/guix.texi | 2 +- guix/build/download.scm | 29 +++-------------------------- guix/http-client.scm | 15 +++------------ guix/serialization.scm | 3 +-- tests/nar.scm | 12 +----------- 8 files changed, 11 insertions(+), 59 deletions(-) diff --git a/README b/README index 5829320dc7..4921f255da 100644 --- a/README +++ b/README @@ -20,7 +20,7 @@ Guix is based on the [[http://nixos.org/nix/][Nix]] package manager. GNU Guix currently depends on the following packages: - - [[http://gnu.org/software/guile/][GNU Guile 2.0.x]], version 2.0.7 or later + - [[http://gnu.org/software/guile/][GNU Guile 2.2.x or 2.0.x]], version 2.0.9 or later - [[http://gnupg.org/][GNU libgcrypt]] - [[http://www.gnu.org/software/make/][GNU Make]] - optionally [[http://savannah.nongnu.org/projects/guile-json/][Guile-JSON]], for the 'guix import pypi' command diff --git a/build-aux/download.scm b/build-aux/download.scm index 8f41f33b14..18b820a153 100644 --- a/build-aux/download.scm +++ b/build-aux/download.scm @@ -36,11 +36,6 @@ ;;"http://www.fdn.fr/~lcourtes/software/guix/packages" ) -;; XXX: Work around , present in Guile -;; up to 2.0.7. -(module-define! (resolve-module '(web client)) - 'shutdown (const #f)) - (define (file-name->uri file) "Return the URI for FILE." (match (string-tokenize file (char-set-complement (char-set #\/))) diff --git a/configure.ac b/configure.ac index 3bf2bf1610..76f52e0ec3 100644 --- a/configure.ac +++ b/configure.ac @@ -82,7 +82,7 @@ if test "x$GUILD" = "x"; then fi if test "x$GUILE_EFFECTIVE_VERSION" = "x2.0"; then - PKG_CHECK_MODULES([GUILE], [guile-2.0 >= 2.0.7]) + PKG_CHECK_MODULES([GUILE], [guile-2.0 >= 2.0.9]) fi dnl Installation directory for .scm and .go files. diff --git a/doc/guix.texi b/doc/guix.texi index 0a09bba06f..944e1fad1b 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -552,7 +552,7 @@ in the Guix source tree for additional details. GNU Guix depends on the following packages: @itemize -@item @url{http://gnu.org/software/guile/, GNU Guile}, version 2.0.7 or +@item @url{http://gnu.org/software/guile/, GNU Guile}, version 2.0.9 or later, including 2.2.x; @item @url{http://gnupg.org/, GNU libgcrypt}; @item diff --git a/guix/build/download.scm b/guix/build/download.scm index e7a7afecd1..d956a9f33e 100644 --- a/guix/build/download.scm +++ b/guix/build/download.scm @@ -512,12 +512,6 @@ port if PORT is a TLS session record port." 'set-port-encoding! (lambda (p e) #f)) -;; XXX: Work around , present in Guile -;; up to 2.0.7. -(module-define! (resolve-module '(web client)) - 'shutdown (const #f)) - - ;; XXX: Work around , fixed in Guile commit ;; 16050431f29d56f80c4a8253506fc851b8441840. Guile's date validation ;; procedure rejects dates in which the hour is not padded with a zero but @@ -682,12 +676,6 @@ the connection could not be established in less than TIMEOUT seconds. Return FILE on success. When VERIFY-CERTIFICATE? is true, verify HTTPS certificates; otherwise simply ignore them." - (define post-2.0.7? - (or (> (string->number (major-version)) 2) - (> (string->number (minor-version)) 0) - (> (string->number (micro-version)) 7) - (string>? (version) "2.0.7"))) - (define headers `(;; Some web sites, such as http://dist.schmorp.de, would block you if ;; there's no 'User-Agent' header, presumably on the assumption that @@ -712,20 +700,9 @@ certificates; otherwise simply ignore them." #:verify-certificate? verify-certificate?)) ((resp bv-or-port) - ;; XXX: `http-get*' was introduced in 2.0.7, and replaced by - ;; #:streaming? in 2.0.8. We know we're using it within the - ;; chroot, but `guix-download' might be using a different - ;; version. So keep this compatibility hack for now. - (if post-2.0.7? - (http-get uri #:port connection #:decode-body? #f - #:streaming? #t - #:headers headers) - (if (module-defined? (resolve-interface '(web client)) - 'http-get*) - (http-get* uri #:port connection #:decode-body? #f - #:headers headers) - (http-get uri #:port connection #:decode-body? #f - #:extra-headers headers)))) + (http-get uri #:port connection #:decode-body? #f + #:streaming? #t + #:headers headers)) ((code) (response-code resp)) ((size) diff --git a/guix/http-client.scm b/guix/http-client.scm index 78d39a0208..855ae95a43 100644 --- a/guix/http-client.scm +++ b/guix/http-client.scm @@ -217,10 +217,6 @@ or if EOF is reached." (when (module-variable %web-http 'read-line*) (module-set! %web-http 'read-line* read-header-line)))) -;; XXX: Work around , present in Guile -;; up to 2.0.7. -(module-define! (resolve-module '(web client)) - 'shutdown (const #f)) (define* (http-fetch uri #:key port (text? #f) (buffered? #t) keep-alive? (verify-certificate? #t) @@ -252,14 +248,9 @@ Raise an '&http-get-error' condition if downloading fails." (unless (or buffered? (not (file-port? port))) (setvbuf port _IONBF)) (let*-values (((resp data) - ;; Try hard to use the API du jour to get an input port. - (if (guile-version>? "2.0.7") - (http-get uri #:streaming? #t #:port port - #:keep-alive? #t - #:headers headers) ; 2.0.9+ - (http-get* uri #:decode-body? text? ; 2.0.7 - #:keep-alive? #t - #:port port #:headers headers))) + (http-get uri #:streaming? #t #:port port + #:keep-alive? #t + #:headers headers)) ((code) (response-code resp))) (case code diff --git a/guix/serialization.scm b/guix/serialization.scm index 4cab5910f7..4a8cd2086e 100644 --- a/guix/serialization.scm +++ b/guix/serialization.scm @@ -130,8 +130,7 @@ ;; . See for ;; a discussion. (let ((bv (read-byte-string p))) - ;; XXX: Rewrite using (ice-9 iconv) when the minimum requirement is - ;; upgraded to Guile >= 2.0.9. + ;; XXX: Rewrite using (ice-9 iconv). (list->string (map integer->char (bytevector->u8-list bv))))) (define (read-maybe-utf8-string p) diff --git a/tests/nar.scm b/tests/nar.scm index 28ead8b783..61646db964 100644 --- a/tests/nar.scm +++ b/tests/nar.scm @@ -35,6 +35,7 @@ #:use-module (srfi srfi-64) #:use-module (ice-9 ftw) #:use-module (ice-9 regex) + #:use-module ((ice-9 control) #:select (let/ec)) #:use-module (ice-9 match)) ;; Test the (guix nar) module. @@ -148,17 +149,6 @@ (string-append (dirname (search-path %load-path "pre-inst-env")) "/test-nar-" (number->string (getpid)))) -(define-syntax-rule (let/ec k exp...) - ;; This one appeared in Guile 2.0.9, so provide a copy here. - (let ((tag (make-prompt-tag))) - (call-with-prompt tag - (lambda () - (let ((k (lambda args - (apply abort-to-prompt tag args)))) - exp...)) - (lambda (_ . args) - (apply values args))))) - (test-begin "nar") -- cgit v1.2.3 From 4fd06a4dd1d4a894b96e586cef594270f8bbb88f Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 17 Mar 2017 23:41:37 +0100 Subject: http-client: Avoid name clash with 'open-connection-for-uri' in 2.2.0. * guix/build/download.scm (open-connection-for-uri): Add note about same-named binding in Guile 2.2.0. * guix/http-client.scm: Use 'guix:open-connection-for-uri' for the procedure coming from (guix build download). * guix/scripts/lint.scm: Likewise. * guix/scripts/substitute.scm: Likewise. --- guix/build/download.scm | 3 +++ guix/http-client.scm | 10 ++++++---- guix/scripts/lint.scm | 6 ++++-- guix/scripts/substitute.scm | 23 +++++++++++++---------- 4 files changed, 26 insertions(+), 16 deletions(-) diff --git a/guix/build/download.scm b/guix/build/download.scm index d956a9f33e..36c815c167 100644 --- a/guix/build/download.scm +++ b/guix/build/download.scm @@ -464,6 +464,9 @@ ETIMEDOUT error is raised." "Like 'open-socket-for-uri', but also handle HTTPS connections. The resulting port must be closed with 'close-connection'. When VERIFY-CERTIFICATE? is true, verify HTTPS server certificates." + ;; Note: Guile 2.2.0's (web client) has a same-named export that's actually + ;; undefined. See Guile commit 011669af3b428e5626f7bbf66b11d57d9768c047. + (define https? (eq? 'https (uri-scheme uri))) diff --git a/guix/http-client.scm b/guix/http-client.scm index 855ae95a43..6874c51db6 100644 --- a/guix/http-client.scm +++ b/guix/http-client.scm @@ -38,7 +38,9 @@ #:select (mkdir-p dump-port)) #:use-module ((guix build download) #:select (open-socket-for-uri - open-connection-for-uri resolve-uri-reference)) + (open-connection-for-uri + . guix:open-connection-for-uri) + resolve-uri-reference)) #:re-export (open-socket-for-uri) #:export (&http-get-error http-get-error? @@ -234,9 +236,9 @@ Raise an '&http-get-error' condition if downloading fails." (let loop ((uri (if (string? uri) (string->uri uri) uri))) - (let ((port (or port (open-connection-for-uri uri - #:verify-certificate? - verify-certificate?))) + (let ((port (or port (guix:open-connection-for-uri uri + #:verify-certificate? + verify-certificate?))) (headers (match (uri-userinfo uri) ((? string? str) (cons (cons 'Authorization diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm index 776e7332c5..66c82f0409 100644 --- a/guix/scripts/lint.scm +++ b/guix/scripts/lint.scm @@ -44,7 +44,8 @@ #:use-module (web uri) #:use-module ((guix build download) #:select (maybe-expand-mirrors - open-connection-for-uri + (open-connection-for-uri + . guix:open-connection-for-uri) close-connection)) #:use-module (web request) #:use-module (web response) @@ -377,7 +378,8 @@ for connections to complete; when TIMEOUT is #f, wait as long as needed." ((or 'http 'https) (catch #t (lambda () - (let ((port (open-connection-for-uri uri #:timeout timeout)) + (let ((port (guix:open-connection-for-uri + uri #:timeout timeout)) (request (build-request uri #:headers headers))) (define response (dynamic-wind diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm index 524b019a31..faeb019120 100755 --- a/guix/scripts/substitute.scm +++ b/guix/scripts/substitute.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014, 2015, 2016 Ludovic Courtès +;;; Copyright © 2013, 2014, 2015, 2016, 2017 Ludovic Courtès ;;; Copyright © 2014 Nikita Karetnikov ;;; ;;; This file is part of GNU Guix. @@ -34,7 +34,8 @@ #:use-module ((guix build download) #:select (current-terminal-columns progress-proc uri-abbreviation nar-uri-abbreviation - open-connection-for-uri + (open-connection-for-uri + . guix:open-connection-for-uri) close-connection store-path-abbreviation byte-count->string)) #:use-module (ice-9 rdelim) @@ -210,8 +211,8 @@ provide." (close-connection port)))) (begin (when (or (not port) (port-closed? port)) - (set! port (open-connection-for-uri uri - #:verify-certificate? #f)) + (set! port (guix:open-connection-for-uri + uri #:verify-certificate? #f)) (unless (or buffered? (not (file-port? port))) (setvbuf port _IONBF))) (http-fetch uri #:text? #f #:port port @@ -247,9 +248,10 @@ failure, return #f and #f." read-cache-info) #f)) ((http https) - (let ((port (open-connection-for-uri uri - #:verify-certificate? #f - #:timeout %fetch-timeout))) + (let ((port (guix:open-connection-for-uri + uri + #:verify-certificate? #f + #:timeout %fetch-timeout))) (guard (c ((http-get-error? c) (warning (_ "while fetching '~a': ~a (~s)~%") (uri->string (http-get-error-uri c)) @@ -533,9 +535,10 @@ initial connection on which HTTP requests are sent." (result seed)) ;; (format (current-error-port) "connecting (~a requests left)..." ;; (length requests)) - (let ((p (or port (open-connection-for-uri base-uri - #:verify-certificate? - verify-certificate?)))) + (let ((p (or port (guix:open-connection-for-uri + base-uri + #:verify-certificate? + verify-certificate?)))) ;; For HTTPS, P is not a file port and does not support 'setvbuf'. (when (file-port? p) (setvbuf p _IOFBF (expt 2 16))) -- cgit v1.2.3 From 7f608a9b45fc3d0dd209268150ef94cbd45da8ee Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 17 Mar 2017 23:52:06 +0100 Subject: doc: Make "Application Setup" slightly more visible. Suggested by Arne Babenhauserheide. * doc/guix.texi (Binary Installation): Make the "Application Setup" reference an 8th item in the list. --- doc/guix.texi | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 944e1fad1b..7eaef06cfb 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -506,11 +506,13 @@ To use substitutes from @code{hydra.gnu.org} or one of its mirrors @example # guix archive --authorize < ~root/.guix-profile/share/guix/hydra.gnu.org.pub @end example + +@item +Each user may need to perform a few additional steps to make their Guix +environment ready for use, @pxref{Application Setup}. @end enumerate -This completes root-level install of Guix. Each user will need to -perform additional steps to make their Guix environment ready for use, -@pxref{Application Setup}. +Voilà, the installation is complete! You can confirm that Guix is working by installing a sample package into the root profile: -- cgit v1.2.3 From 55f7a27ceee3f1d4b1610f6af744f6e0f6b416fd Mon Sep 17 00:00:00 2001 From: Ben Woodcroft Date: Sat, 18 Mar 2017 09:41:00 +1000 Subject: gnu: ocaml-qtest: Update to 2.5. * gnu/packages/ocaml.scm (ocaml-qtest): Update to 2.5. --- gnu/packages/ocaml.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm index 03c6433b24..2f22226b78 100644 --- a/gnu/packages/ocaml.scm +++ b/gnu/packages/ocaml.scm @@ -972,14 +972,14 @@ GNU CC attributes. It provides also a C pretty printer as an example of use.") (define-public ocaml-qtest (package (name "ocaml-qtest") - (version "2.3") + (version "2.5") (source (origin (method url-fetch) (uri (string-append "https://github.com/vincent-hugot/iTeML/" "archive/v" version ".tar.gz")) (sha256 (base32 - "1n7x5l6h4j44f75wzgzjsjkq349i4gj707w1hr7fx84igxxfr6vl")))) + "1hw3jqir7w79payy4knc38fa3nxcvl7ap6y6hnqavrhpi8zqb59j")))) (build-system ocaml-build-system) (native-inputs `(("findlib" ,ocaml-findlib))) -- cgit v1.2.3 From b6bd9a79d48afcdef65c43f4f3af6564455d1af8 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Sat, 18 Mar 2017 00:43:01 +0100 Subject: gnu: emacs-slime: Update to 2.19. * gnu/packages/emacs.scm (emacs-slime): Update to 2.19. --- gnu/packages/emacs.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm index 18d25b743b..b84faaff07 100644 --- a/gnu/packages/emacs.scm +++ b/gnu/packages/emacs.scm @@ -2179,7 +2179,7 @@ in @code{html-mode}.") (define-public emacs-slime (package (name "emacs-slime") - (version "2.18") + (version "2.19") (source (origin (file-name (string-append name "-" version ".tar.gz")) @@ -2189,7 +2189,7 @@ in @code{html-mode}.") version ".tar.gz")) (sha256 (base32 - "146avwbwr6mw0nmgyihx8gkr0mv6al7a73igzxvysj62000cqvlj")))) + "1jhaq5cn89k45nzyl0jd12gmjxnh1bq9jlfwrxba342agxsscb0p")))) (build-system emacs-build-system) (native-inputs `(("texinfo" ,texinfo))) -- cgit v1.2.3 From a53d6719bc6b6b4afdc58e257ac712df316c8858 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Tue, 7 Mar 2017 07:51:51 +0100 Subject: gnu: Add itpp. * gnu/packages/maths.scm (itpp): New variable. --- gnu/packages/maths.scm | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index adc81561c7..fe85983c24 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -1,7 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge ;;; Copyright © 2013 Nikita Karetnikov -;;; Copyright © 2014, 2016 John Darrington +;;; Copyright © 2014, 2016, 2017 John Darrington ;;; Copyright © 2014, 2015, 2016 Eric Bavier ;;; Copyright © 2014 Federico Beffa ;;; Copyright © 2014 Mathieu Lirzin @@ -761,6 +761,34 @@ Swath).") HDF5 file is encoded according to the HDF File Format Specification.") (license (license:x11-style "file://COPYING")))) +(define-public itpp + (package + (name "itpp") + (version "4.3.1") + (source (origin + (method url-fetch) + (uri (string-append "mirror://sourceforge/itpp/itpp/" + version "/itpp-" + version ".tar.gz")) + (sha256 + (base32 + "14ddy2xnb6sgp4hiax9v5sv4pr4l4dd4ps76nfha3nrpr1ikhcqm")))) + (build-system cmake-build-system) + (arguments `(#:tests? #f)) ; Tests require googletest *sources* + (inputs `(("lapack" ,lapack) + ("fftw" ,fftw))) + (native-inputs `(("texlive-minimal" ,texlive-minimal) + ("doxygen" ,doxygen))) + (home-page "http://itpp.sourceforge.net") + (synopsis "C++ library of maths, signal processing and communication classes") + (description "IT++ is a C++ library of mathematical, signal processing and +communication classes and functions. Its main use is in simulation of +communication systems and for performing research in the area of +communications. The kernel of the library consists of generic vector and +matrix classes, and a set of accompanying routines. Such a kernel makes IT++ +similar to MATLAB, GNU Octave or SciPy.") + (license license:gpl3+))) + (define-public netcdf (package (name "netcdf") -- cgit v1.2.3 From 6d5f63b690586e819258617a8d0fb9bd18897b8f Mon Sep 17 00:00:00 2001 From: John Darrington Date: Wed, 8 Mar 2017 19:24:31 +0100 Subject: gnu: Add maxflow. * gnu/packages/maths.scm (maxflow): New variable. --- gnu/packages/maths.scm | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index fe85983c24..ed13556cb4 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -1138,6 +1138,30 @@ modules is done either interactively using the graphical user interface or in ASCII text files using Gmsh's own scripting language.") (license license:gpl2+))) +(define-public maxflow + (package + (name "maxflow") + (version "3.04") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/gerddie/maxflow.git") + (commit "42401fa54823d16b9da47716f04e5d9ef1605875"))) + (file-name (string-append name "-" version "-checkout")) + (sha256 + (base32 + "0rll38whw55h0vcjrrwdnh9ascvxby0ph7n1l0d12z17cg215kkb")))) + (build-system cmake-build-system) + (home-page "http://pub.ist.ac.at/~vnk/software.html") + (synopsis "Library implementing Maxflow algorithm") + (description "An implementation of the maxflow algorithm described in +@cite{An Experimental Comparison of Min-Cut/Max-Flow Algorithms for +Energy Minimization in Computer Vision.\n +Yuri Boykov and Vladimir Kolmogorov.\n +In IEEE Transactions on Pattern Analysis and Machine Intelligence,\n +September 2004}") + (license license:gpl3+))) + (define-public petsc (package (name "petsc") -- cgit v1.2.3 From 84aac61c819cf2c82d8d4b54cdf53ed9e713a82f Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Sat, 18 Mar 2017 10:31:26 +0100 Subject: gnu: rustc: Fix process test. * gnu/packages/rust.scm (rustc)[arguments]: Rename 'patch-lockfile-test to 'patch-tests. Add another substitution. --- gnu/packages/rust.scm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm index efac79c515..2dedef8373 100644 --- a/gnu/packages/rust.scm +++ b/gnu/packages/rust.scm @@ -234,10 +234,13 @@ rustc-bootstrap and cargo-bootstrap packages.") (lambda _ (setenv "SHELL" (which "sh")) (setenv "CONFIG_SHELL" (which "sh")))) - (add-after 'unpack 'patch-lockfile-test - (lambda _ + (add-after 'unpack 'patch-tests + (lambda* (#:key inputs #:allow-other-keys) (substitute* "src/tools/tidy/src/main.rs" - (("^.*cargo.*::check.*$") "")))) + (("^.*cargo.*::check.*$") "")) + (substitute* "src/libstd/process.rs" + (("\"/bin/sh\"") (string-append "\"" (assoc-ref inputs "bash") "/bin/sh\""))) + #t)) (replace 'configure (lambda* (#:key inputs outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) -- cgit v1.2.3 From 7208995426714c9fc3ad59cadc3cc0f52df0f018 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Sat, 18 Mar 2017 10:38:51 +0100 Subject: file-systems: Factorize file-system-packages. * gnu/system/linux-initrd.scm (base-initrd): Move helper-packages body to ... * gnu/system/file-systems.scm (file-system-packages): ... here. New variable. Also export it. --- gnu/system/file-systems.scm | 26 ++++++++++++++++++++++++++ gnu/system/linux-initrd.scm | 18 +----------------- 2 files changed, 27 insertions(+), 17 deletions(-) diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm index 7011a279d3..8107722c74 100644 --- a/gnu/system/file-systems.scm +++ b/gnu/system/file-systems.scm @@ -22,6 +22,8 @@ #:use-module (guix records) #:use-module ((gnu build file-systems) #:select (string->uuid uuid->string)) + #:use-module (gnu packages linux) + #:use-module (gnu packages disk) #:re-export (string->uuid uuid->string) #:export ( @@ -65,6 +67,8 @@ file-system-mapping->bind-mount + file-system-packages + %store-mapping %network-configuration-files %network-file-mappings)) @@ -411,4 +415,26 @@ a bind mount." (writable? (string=? file "/etc/resolv.conf")))) %network-configuration-files)) +(define (file-system-type-predicate type) + (lambda (fs) + (string=? (file-system-type fs) type))) + +(define* (file-system-packages file-systems #:key (volatile-root? #f)) + `(,@(if (find (lambda (fs) + (string-prefix? "ext" (file-system-type fs))) + file-systems) + (list e2fsck/static) + '()) + ,@(if (find (lambda (fs) + (string-suffix? "fat" (file-system-type fs))) + file-systems) + (list fatfsck/static) + '()) + ,@(if (find (file-system-type-predicate "btrfs") file-systems) + (list btrfs-progs/static) + '()) + ,@(if volatile-root? + (list unionfs-fuse/static) + '()))) + ;;; file-systems.scm ends here diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm index 81c1278c0c..1f1c306828 100644 --- a/gnu/system/linux-initrd.scm +++ b/gnu/system/linux-initrd.scm @@ -272,23 +272,7 @@ loaded at boot time in the order in which they appear." ,@extra-modules)) (define helper-packages - ;; Packages to be copied on the initrd. - `(,@(if (find (lambda (fs) - (string-prefix? "ext" (file-system-type fs))) - file-systems) - (list e2fsck/static) - '()) - ,@(if (find (lambda (fs) - (string-suffix? "fat" (file-system-type fs))) - file-systems) - (list fatfsck/static) - '()) - ,@(if (find (file-system-type-predicate "btrfs") file-systems) - (list btrfs-progs/static) - '()) - ,@(if volatile-root? - (list unionfs-fuse/static) - '()))) + (file-system-packages file-systems #:volatile-root? volatile-root?)) (raw-initrd file-systems #:linux linux -- cgit v1.2.3 From d54db52e7fe469612386ec15d4bf7650e9225a92 Mon Sep 17 00:00:00 2001 From: ng0 Date: Sat, 18 Mar 2017 10:39:21 +0000 Subject: bug#26152: [PATCH] gnu: limnoria: Update to 20170110. * gnu/packages/irc.scm (limnoria): Update to 20170110. Signed-off-by: Danny Milosavljevic --- gnu/packages/irc.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/irc.scm b/gnu/packages/irc.scm index 3d06df9ed8..f4ff7fcbef 100644 --- a/gnu/packages/irc.scm +++ b/gnu/packages/irc.scm @@ -298,14 +298,14 @@ and extensible with plugins and scripts.") (define-public limnoria (package (name "limnoria") - (version "2016.08.07") + (version "2017.01.10") (source (origin (method url-fetch) (uri (pypi-uri "limnoria" version)) (sha256 (base32 - "0w1d98hfhn4iqrczam7zahhqsvxa79n3xfcrm4jwkg5lba4f9ccm")))) + "0va7iiwkrd5miibpaphfm2jlfsmaazbqb8izkmlnlzkqnskhz1ff")))) (build-system python-build-system) (inputs `(("python-pytz" ,python-pytz) -- cgit v1.2.3 From da31b9c7f636ad22e12f001350d8835477626405 Mon Sep 17 00:00:00 2001 From: Hartmut Goebel Date: Fri, 17 Mar 2017 22:03:36 +0100 Subject: doc: Fix examples. To "spawns a Guile REPL", --ad-hoc is required. * doc/guix.texi (Invoking guix environment): Add "--ad-hoc" to container examples. --- doc/guix.texi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 7eaef06cfb..f38374385e 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -6404,7 +6404,7 @@ home directory is accessible read-only via the @file{/exchange} directory: @example -guix environment --container --expose=$HOME=/exchange guile -- guile +guix environment --container --expose=$HOME=/exchange --ad-hoc guile -- guile @end example @item --share=@var{source}[=@var{target}] @@ -6418,7 +6418,7 @@ home directory is accessible for both reading and writing via the @file{/exchange} directory: @example -guix environment --container --share=$HOME=/exchange guile -- guile +guix environment --container --share=$HOME=/exchange --ad-hoc guile -- guile @end example @end table -- cgit v1.2.3 From fdcb04afcc72b7e1512a046d803f406b98678b25 Mon Sep 17 00:00:00 2001 From: Hartmut Goebel Date: Fri, 17 Mar 2017 22:05:33 +0100 Subject: doc: Clarify reference. * doc/guix.texi (Invoking guix environment): Explicitly name "guix environment". --- doc/guix.texi | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index f38374385e..50e7944004 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -6422,9 +6422,11 @@ guix environment --container --share=$HOME=/exchange --ad-hoc guile -- guile @end example @end table -It also supports all of the common build options that @command{guix +@command{guix environment} +also supports all of the common build options that @command{guix build} supports (@pxref{Common Build Options}). + @node Invoking guix publish @section Invoking @command{guix publish} -- cgit v1.2.3 From 21122bd79e7f9b0b5349ffffe2c146bace7205dc Mon Sep 17 00:00:00 2001 From: John Darrington Date: Tue, 7 Mar 2017 07:59:21 +0100 Subject: gnu: Add niftilib. * gnu/packages/image.scm (niftilib): New variable. --- gnu/packages/image.scm | 59 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm index f2afa988cb..73c5298e17 100644 --- a/gnu/packages/image.scm +++ b/gnu/packages/image.scm @@ -6,7 +6,7 @@ ;;; Copyright © 2014, 2016 Ricardo Wurmus ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer ;;; Copyright © 2015 Amirouche Boubekki -;;; Copyright © 2014 John Darrington +;;; Copyright © 2014, 2017 John Darrington ;;; Copyright © 2016 Leo Famulari ;;; Copyright © 2016, 2017 Leo Famulari ;;; Copyright © 2016, 2017 Efraim Flashner @@ -1164,3 +1164,60 @@ interface. It supports color space extensions that allow it to compress from and decompress to 32-bit and big-endian pixel buffers (RGBX, XBGR, etc.).") (license (list license:bsd-3 ; jsimd*.[ch] and most of simd/ license:ijg)))) ; the rest + +(define-public niftilib + (package + (name "niftilib") + (version "2.0.0") + (source (origin + (method url-fetch) + (uri (list (string-append "mirror://sourceforge/niftilib/" + "nifticlib/nifticlib_" + (string-join (string-split version #\.) "_") + "/nifticlib-" version ".tar.gz"))) + (sha256 + (base32 "123z9bwzgin5y8gi5ni8j217k7n683whjsvg0lrpii9flgk8isd3")))) + (build-system gnu-build-system) + (arguments + '(#:tests? #f + #:parallel-build? #f + #:phases + (modify-phases %standard-phases + (replace 'install + (lambda _ + (for-each + (lambda (dir) + (let ((directory (assoc-ref %outputs "out"))) + (mkdir-p (string-append directory "/" dir)) + (zero? (system* "cp" "-a" dir directory)))) + '("bin" "lib" "include")))) + (replace 'configure + (lambda _ + (substitute* "Makefile" + (("^SHELL[ \t]*=[ \t]*csh") + (string-append "SHELL = " + (assoc-ref %build-inputs "bash") + "/bin/sh")) + + (("^CFLAGS[ \t]*=[ \t]\\$\\(ANSI_FLAGS\\)") + "CFLAGS = $(ANSI_FLAGS) -fPIC") + + (("^ZLIB_INC[ \t]*=[ \t]*-I/usr/include") + (string-append "ZLIB_INC = -I" + (assoc-ref %build-inputs "zlib") + "/include")) + + (("^CP[ \t]*=[ \t]*cp") + (string-append "CP = " + (assoc-ref %build-inputs "coreutils") + "/bin/cp"))) + #t))))) + (inputs + `(("zlib" ,zlib))) + (synopsis "Library for reading and writing files in the nifti-1 format") + (description "Niftilib is a set of i/o libraries for reading and writing +files in the nifti-1 data format - a binary file format for storing +medical image data, e.g. magnetic resonance image (MRI) and functional MRI +(fMRI) brain images.") + (home-page "http://niftilib.sourceforge.net") + (license license:public-domain))) -- cgit v1.2.3 From 7601b9f7cec434379fd45e47ba25e64c4ea69382 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Sat, 18 Mar 2017 17:13:08 +0100 Subject: gnu: wine: Update to 2.4. * gnu/packages/wine.scm (wine): Update to 2.4. --- gnu/packages/wine.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/wine.scm b/gnu/packages/wine.scm index 40e1dd5cfc..4f6e76d58e 100644 --- a/gnu/packages/wine.scm +++ b/gnu/packages/wine.scm @@ -54,14 +54,14 @@ (define-public wine (package (name "wine") - (version "2.3") + (version "2.4") (source (origin (method url-fetch) (uri (string-append "https://dl.winehq.org/wine/source/2.x" "/wine-" version ".tar.xz")) (sha256 (base32 - "0zh6kvs4d6d99x5qgxbb5jq2wilwzifhmib2nhq0g3ychxx5rjdg")))) + "13klfadvd44zdfrzh38al99s53i02x3mlhcj5z7fq7vqwh3xzdc7")))) (build-system gnu-build-system) (native-inputs `(("pkg-config" ,pkg-config) ("gettext" ,gettext-minimal) -- cgit v1.2.3 From 57d0bdf8c60e0f72ceb473e758416b617c75cf9c Mon Sep 17 00:00:00 2001 From: Taylan Ulrich Bayırlı/Kammer Date: Sat, 18 Mar 2017 18:21:00 +0100 Subject: gnu: guix: Don't ignore user's GUILE_LOAD_COMPILED_PATH. * gnu/packages/package-management.scm (guix-0.12.0): Guile skips invalid .go files since 2.0.12 so we don't need to override GUILE_LOAD_COMPILED_PATH to prevent problems anymore. --- gnu/packages/package-management.scm | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm index 685636e8ba..f675e22ad9 100644 --- a/gnu/packages/package-management.scm +++ b/gnu/packages/package-management.scm @@ -147,14 +147,9 @@ ssh "/share/guile/site/2.0:" gnutls "/share/guile/site/2.0"))) - ;; Ignore user settings so that a bogus - ;; GUILE_LOAD_COMPILED_PATH does not prevent use of - ;; 'guix', notably when it contains entries pointing to - ;; incompatible .go files as reported at - ;; . (wrap-program (string-append out "/bin/guix") `("GUILE_LOAD_PATH" ":" prefix (,path)) - `("GUILE_LOAD_COMPILED_PATH" ":" = (,path))) + `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,path))) #t)))))) (native-inputs `(("pkg-config" ,pkg-config) -- cgit v1.2.3 From 525acb6e826c1a800c422ce6ee6f4c68348e3bf1 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Sat, 18 Mar 2017 12:15:28 -0500 Subject: gnu: guile-8sync: Update to 0.4.2. * gnu/packages/guile.scm (guile-8sync): Update to 0.4.2. --- gnu/packages/guile.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm index e44c0652bc..9289c40a76 100644 --- a/gnu/packages/guile.scm +++ b/gnu/packages/guile.scm @@ -1630,14 +1630,14 @@ and then run @command{scm example.scm}.") (define-public guile-8sync (package (name "guile-8sync") - (version "0.4.1") + (version "0.4.2") (source (origin (method url-fetch) (uri (string-append "mirror://gnu/8sync/8sync-" version ".tar.gz")) (sha256 (base32 - "1fvf8d2s3vvg4nyskbqaiqmlm2x571hv7hizcnmny45zvalydr9h")))) + "031wm13srak3wsnll7j2mbbi29g1pcm4swdb71ds9yn567pn20qw")))) (build-system gnu-build-system) (native-inputs `(("autoconf" ,autoconf) ("automake" ,automake) -- cgit v1.2.3 From eba72e1716ca3efb5c2c416b6c2c8303cfef0d99 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Sat, 18 Mar 2017 21:28:20 +0200 Subject: gnu: apl: Update to 1.7. * gnu/packages/apl.scm (apl): Update to 1.7. [home-page]: Use https. --- gnu/packages/apl.scm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gnu/packages/apl.scm b/gnu/packages/apl.scm index 1c7d42b713..aa47edcd64 100644 --- a/gnu/packages/apl.scm +++ b/gnu/packages/apl.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013 Nikita Karetnikov ;;; Copyright © 2014, 2015 Mark H Weaver +;;; Copyright © 2017 Efraim Flashner ;;; ;;; This file is part of GNU Guix. ;;; @@ -30,16 +31,16 @@ (define-public apl (package (name "apl") - (version "1.6") + (version "1.7") (source (origin (method url-fetch) (uri (string-append "mirror://gnu/apl/apl-" version ".tar.gz")) (sha256 (base32 - "057zwzvvgcrrwsl52a27w86hgy31jqq6avqq629xj7yq90qah3ay")))) + "07xq8ddlmz8psvsmwr23gar108ri0lwmw0n6kpxcv8ypas1f5xlg")))) (build-system gnu-build-system) - (home-page "http://www.gnu.org/software/apl/") + (home-page "https://www.gnu.org/software/apl/") (inputs `(("gettext" ,gettext-minimal) ("lapack" ,lapack) -- cgit v1.2.3 From f729a4d8b274aebd578f45b2ca55cded31001b85 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Sun, 19 Mar 2017 14:24:27 +0100 Subject: gnu: niftilib: Simplify build phases. * gnu/packages/image.scm (niftilib)[arguments]: Use make-flags instead of replacing "configure" phase; simplify "install" phase. --- gnu/packages/image.scm | 91 ++++++++++++++++++++++---------------------------- 1 file changed, 39 insertions(+), 52 deletions(-) diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm index 73c5298e17..2c438a8dd0 100644 --- a/gnu/packages/image.scm +++ b/gnu/packages/image.scm @@ -3,7 +3,7 @@ ;;; Copyright © 2013, 2015, 2016 Andreas Enge ;;; Copyright © 2014, 2015, 2016 Mark H Weaver ;;; Copyright © 2014, 2015 Alex Kost -;;; Copyright © 2014, 2016 Ricardo Wurmus +;;; Copyright © 2014, 2016, 2017 Ricardo Wurmus ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer ;;; Copyright © 2015 Amirouche Boubekki ;;; Copyright © 2014, 2017 John Darrington @@ -1167,57 +1167,44 @@ and decompress to 32-bit and big-endian pixel buffers (RGBX, XBGR, etc.).") (define-public niftilib (package - (name "niftilib") - (version "2.0.0") - (source (origin - (method url-fetch) - (uri (list (string-append "mirror://sourceforge/niftilib/" - "nifticlib/nifticlib_" - (string-join (string-split version #\.) "_") - "/nifticlib-" version ".tar.gz"))) - (sha256 - (base32 "123z9bwzgin5y8gi5ni8j217k7n683whjsvg0lrpii9flgk8isd3")))) - (build-system gnu-build-system) - (arguments - '(#:tests? #f - #:parallel-build? #f - #:phases - (modify-phases %standard-phases - (replace 'install - (lambda _ - (for-each - (lambda (dir) - (let ((directory (assoc-ref %outputs "out"))) - (mkdir-p (string-append directory "/" dir)) - (zero? (system* "cp" "-a" dir directory)))) - '("bin" "lib" "include")))) - (replace 'configure - (lambda _ - (substitute* "Makefile" - (("^SHELL[ \t]*=[ \t]*csh") - (string-append "SHELL = " - (assoc-ref %build-inputs "bash") - "/bin/sh")) - - (("^CFLAGS[ \t]*=[ \t]\\$\\(ANSI_FLAGS\\)") - "CFLAGS = $(ANSI_FLAGS) -fPIC") - - (("^ZLIB_INC[ \t]*=[ \t]*-I/usr/include") - (string-append "ZLIB_INC = -I" - (assoc-ref %build-inputs "zlib") - "/include")) - - (("^CP[ \t]*=[ \t]*cp") - (string-append "CP = " - (assoc-ref %build-inputs "coreutils") - "/bin/cp"))) - #t))))) - (inputs - `(("zlib" ,zlib))) - (synopsis "Library for reading and writing files in the nifti-1 format") - (description "Niftilib is a set of i/o libraries for reading and writing + (name "niftilib") + (version "2.0.0") + (source (origin + (method url-fetch) + (uri (list (string-append "mirror://sourceforge/niftilib/" + "nifticlib/nifticlib_" + (string-join (string-split version #\.) "_") + "/nifticlib-" version ".tar.gz"))) + (sha256 + (base32 "123z9bwzgin5y8gi5ni8j217k7n683whjsvg0lrpii9flgk8isd3")))) + (build-system gnu-build-system) + (arguments + '(#:tests? #f ; there is no test target + #:parallel-build? #f ; not supported + #:make-flags + (list "SHELL=bash" + (string-append "ZLIB_INC=" + (assoc-ref %build-inputs "zlib") "/include") + ;; Append "-fPIC" to CFLAGS. + (string-append "CFLAGS=" + "-Wall -ansi -pedantic -fPIC")) + #:phases + (modify-phases %standard-phases + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (for-each + (lambda (dir) + (copy-recursively dir (string-append out "/" dir))) + '("bin" "lib" "include"))) + #t)) + (delete 'configure)))) + (inputs + `(("zlib" ,zlib))) + (synopsis "Library for reading and writing files in the nifti-1 format") + (description "Niftilib is a set of i/o libraries for reading and writing files in the nifti-1 data format - a binary file format for storing medical image data, e.g. magnetic resonance image (MRI) and functional MRI (fMRI) brain images.") - (home-page "http://niftilib.sourceforge.net") - (license license:public-domain))) + (home-page "http://niftilib.sourceforge.net") + (license license:public-domain))) -- cgit v1.2.3 From 8df672aad5dc8d93da750c96f472ba2155d51da1 Mon Sep 17 00:00:00 2001 From: Manolis Ragkousis Date: Thu, 16 Mar 2017 09:29:55 -0600 Subject: gnu: Add GNU Mach. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/hurd.scm (gnumach): New variable. Co-authored-by: Rene Saavedra Co-authored-by: Ludovic Courtès --- gnu/packages/hurd.scm | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm index ba91b60bea..2d7b7b2ac0 100644 --- a/gnu/packages/hurd.scm +++ b/gnu/packages/hurd.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2014, 2015, 2016 Manolis Fragkiskos Ragkousis +;;; Copyright © 2014, 2015, 2016, 2017 Manolis Fragkiskos Ragkousis ;;; ;;; This file is part of GNU Guix. ;;; @@ -210,3 +210,35 @@ Library for GNU/Hurd.") Hurd-minimal package which are needed for both glibc and GCC.") (home-page (package-home-page hurd-headers)) (license (package-license hurd-headers)))) + +(define-public gnumach + (package + (name "gnumach") + (version "1.8") + (source (origin + (method url-fetch) + (uri (gnumach-source-url version)) + (sha256 + (base32 + "02hygsfpd2dljl5lg1vjjg9pizi9jyxd4aiiqzjshz6jax62jm9f")))) + (build-system gnu-build-system) + (arguments + `(#:phases (modify-phases %standard-phases + (add-after 'install 'produce-image + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (boot (string-append out "/boot"))) + (and (zero? (system* "make" "gnumach.gz")) + (begin + (install-file "gnumach.gz" boot) + #t)))))))) + (native-inputs + `(("mig" ,mig) + ("perl" ,perl))) + (supported-systems (cons "i686-linux" %hurd-systems)) + (home-page + "https://www.gnu.org/software/hurd/microkernel/mach/gnumach.html") + (synopsis "Microkernel of the GNU system") + (description + "GNU Mach is the microkernel upon which a GNU Hurd system is based.") + (license gpl2+))) -- cgit v1.2.3 From f6396d862f9f8ce0c0e6894ce30599773167af0c Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 19 Mar 2017 17:30:44 +0100 Subject: gnu: Rename "guile-next" to "guile". * gnu/packages/guile.scm (guile-next): Rename to... (guile-2.2): ... this. Update users. [name]: Change to "guile". [synopsis]: Remove. [properties]: Remove 'upstream-name', 'ftp-server', and 'ftp-directory'. * gnu/packages/bioinformatics.scm (rcas-web): Update accordingly. * gnu/packages/tls.scm (gnutls/guile-2.2): Likewise. * tests/guix-build.sh: Use 'guile@2.2' instead of 'guile-next'. * doc/guix.texi (Package Transformation Options): Update examples that referred to "guile-next". --- doc/guix.texi | 6 +++--- gnu/packages/bioinformatics.scm | 2 +- gnu/packages/guile.scm | 26 +++++++++++--------------- gnu/packages/tls.scm | 2 +- tests/guix-build.sh | 4 ++-- 5 files changed, 18 insertions(+), 22 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 50e7944004..297141288c 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -4921,15 +4921,15 @@ or @code{guile@@1.8}. For instance, the following command builds Guix, but replaces its dependency on the current stable version of Guile with a dependency on -the development version of Guile, @code{guile-next}: +the legacy version of Guile, @code{guile@@2.0}: @example -guix build --with-input=guile=guile-next guix +guix build --with-input=guile=guile@@2.0 guix @end example This is a recursive, deep replacement. So in this example, both @code{guix} and its dependency @code{guile-json} (which also depends on -@code{guile}) get rebuilt against @code{guile-next}. +@code{guile}) get rebuilt against @code{guile@@2.0}. This is implemented using the @code{package-input-rewriting} Scheme procedure (@pxref{Defining Packages, @code{package-input-rewriting}}). diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm index ccde01b119..90092ddf70 100644 --- a/gnu/packages/bioinformatics.scm +++ b/gnu/packages/bioinformatics.scm @@ -7638,7 +7638,7 @@ library implementing most of the pipeline's features.") (inputs `(("r-minimal" ,r-minimal) ("r-rcas" ,r-rcas) - ("guile-next" ,guile-next) + ("guile-next" ,guile-2.2) ("guile-json" ,guile2.2-json) ("guile-redis" ,guile2.2-redis))) (native-inputs diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm index 9289c40a76..c172fd3fc1 100644 --- a/gnu/packages/guile.scm +++ b/gnu/packages/guile.scm @@ -231,9 +231,9 @@ without requiring the source code to be rewritten.") "12yqkr974y91ylgw6jnmci2v90i90s7h9vxa4zk0sai8vjnz4i1p")) (patches (search-patches "guile-repl-server-test.patch")))))) -(define-public guile-next +(define-public guile-2.2 (package (inherit guile-2.0) - (name "guile-next") + (name "guile") (version "2.2.0") (replacement #f) (source (origin @@ -250,12 +250,8 @@ without requiring the source code to be rewritten.") ;; times (almost 3 hours on a 4-core Intel i5). (snippet '(for-each delete-file (find-files "prebuilt" "\\.go$"))))) - (synopsis "Snapshot of what will become version 2.2 of GNU Guile") (properties '((timeout . 72000) ;20 hours - (max-silent-time . 10800) ;3 hours (needed on ARM) - (upstream-name . "guile") - (ftp-server . "alpha.gnu.org") - (ftp-directory . "/gnu/guile"))) + (max-silent-time . 10800))) ;3 hours (needed on ARM) (native-search-paths (list (search-path-specification (variable "GUILE_LOAD_PATH") @@ -276,12 +272,12 @@ applicable." (define package-for-guile-2.2 ;; A procedure that rewrites the dependency tree of the given package to use - ;; GUILE-NEXT instead of GUILE-2.0. - (package-input-rewriting `((,guile-2.0 . ,guile-next)) + ;; GUILE-2.2 instead of GUILE-2.0. + (package-input-rewriting `((,guile-2.0 . ,guile-2.2)) guile-2.2-package-name)) (define-public guile-for-guile-emacs - (package (inherit guile-next) + (package (inherit guile-2.2) (name "guile-for-guile-emacs") (version "20150510.d8d9a8d") (source (origin @@ -296,7 +292,7 @@ applicable." (substitute-keyword-arguments `(;; Tests aren't passing for now. ;; Obviously we should re-enable this! #:tests? #f - ,@(package-arguments guile-next)) + ,@(package-arguments guile-2.2)) ((#:phases phases) `(modify-phases ,phases (add-after 'unpack 'autogen @@ -314,7 +310,7 @@ applicable." ("flex" ,flex) ("texinfo" ,texinfo) ("gettext" ,gettext-minimal) - ,@(package-native-inputs guile-next))) + ,@(package-native-inputs guile-2.2))) ;; Same as in guile-2.0 (native-search-paths (list (search-path-specification @@ -1641,7 +1637,7 @@ and then run @command{scm example.scm}.") (build-system gnu-build-system) (native-inputs `(("autoconf" ,autoconf) ("automake" ,automake) - ("guile" ,guile-next) + ("guile" ,guile-2.2) ("pkg-config" ,pkg-config) ("texinfo" ,texinfo))) (arguments @@ -1657,7 +1653,7 @@ and then run @command{scm example.scm}.") "GNU 8sync (pronounced \"eight-sync\") is an asynchronous programming library for GNU Guile based on the actor model. -Note that 8sync is only available for Guile 2.2 (guile-next in Guix).") +Note that 8sync is only available for Guile 2.2.") (license license:lgpl3+))) (define-public guile-fibers @@ -1676,7 +1672,7 @@ Note that 8sync is only available for Guile 2.2 (guile-next in Guix).") `(("texinfo" ,texinfo) ("pkg-config" ,pkg-config))) (inputs - `(("guile" ,guile-next))) + `(("guile" ,guile-2.2))) (synopsis "Lightweight concurrency facility for Guile") (description "Fibers is a Guile library that implements a a lightweight concurrency diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm index 32aa7a61dc..9c7cb0b0ca 100644 --- a/gnu/packages/tls.scm +++ b/gnu/packages/tls.scm @@ -238,7 +238,7 @@ required structures.") (substitute-keyword-arguments (package-arguments gnutls-3.5.8) ((#:configure-flags flags) `(cdr ,flags)))) - (inputs `(("guile" ,guile-next) + (inputs `(("guile" ,guile-2.2) ,@(alist-delete "guile" (package-inputs gnutls-3.5.8)))))) (define-public openssl diff --git a/tests/guix-build.sh b/tests/guix-build.sh index e1ec560641..ab911b7210 100644 --- a/tests/guix-build.sh +++ b/tests/guix-build.sh @@ -1,5 +1,5 @@ # GNU Guix --- Functional package management for GNU -# Copyright © 2012, 2013, 2014, 2016 Ludovic Courtès +# Copyright © 2012, 2013, 2014, 2016, 2017 Ludovic Courtès # # This file is part of GNU Guix. # @@ -160,7 +160,7 @@ rm -f "$result" guix build coreutils --target=mips64el-linux-gnu --dry-run --no-substitutes # Replacements. -drv1=`guix build guix --with-input=guile=guile-next -d` +drv1=`guix build guix --with-input=guile@2.0=guile@2.2 -d` drv2=`guix build guix -d` test "$drv1" != "$drv2" -- cgit v1.2.3 From 8f4acad71b3afa56f2b54ada1cee2c25f7ded45f Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 19 Mar 2017 17:37:49 +0100 Subject: gnu: Add 'package-for-guile-2.0'. * gnu/packages/guile.scm (guile-2.2-package-name): Rename to... (guile-variant-package-name): ... this. Change to return a lambda. (package-for-guile-2.2): Adjust accordingly. (package-for-guile-2.0): New procedure. --- gnu/packages/guile.scm | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm index c172fd3fc1..8313f3f933 100644 --- a/gnu/packages/guile.scm +++ b/gnu/packages/guile.scm @@ -261,20 +261,25 @@ without requiring the source code to be rewritten.") (files '("lib/guile/2.2/site-ccache" "share/guile/site/2.2"))))))) -(define (guile-2.2-package-name name) - "Return NAME with a \"guile2.2-\" prefix instead of \"guile-\", when -applicable." - (if (string-prefix? "guile-" name) - (string-append "guile2.2-" - (string-drop name - (string-length "guile-"))) - name)) +(define (guile-variant-package-name prefix) + (lambda (name) + "Return NAME with PREFIX instead of \"guile-\", when applicable." + (if (string-prefix? "guile-" name) + (string-append prefix "-" + (string-drop name + (string-length "guile-"))) + name))) (define package-for-guile-2.2 ;; A procedure that rewrites the dependency tree of the given package to use ;; GUILE-2.2 instead of GUILE-2.0. (package-input-rewriting `((,guile-2.0 . ,guile-2.2)) - guile-2.2-package-name)) + (guile-variant-package-name "guile2.2"))) + +(define package-for-guile-2.0 + ;; Likewise, but the other way around. :-) + (package-input-rewriting `((,guile-2.2 . ,guile-2.0)) + (guile-variant-package-name "guile2.0"))) (define-public guile-for-guile-emacs (package (inherit guile-2.2) -- cgit v1.2.3 From bd19f65a859a8401505fdba3d080c73f06998bac Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 19 Mar 2017 18:00:43 +0100 Subject: gnu: haunt: Default to Guile 2.2. * gnu/packages/guile.scm (haunt)[inputs]: Replace GUILE-2.0 with GUILE-2.2. [propagated-inputs]: Replace GUILE-READER and GUILE-COMMONMARK with their 2.2 variant. (guile2.0-haunt): New variable. (guile2.2-haunt): Mark as deprecated. --- gnu/packages/guile.scm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm index 8313f3f933..87f5de161a 100644 --- a/gnu/packages/guile.scm +++ b/gnu/packages/guile.scm @@ -1057,10 +1057,10 @@ Guile's foreign function interface.") `(("pkg-config" ,pkg-config) ("texinfo" ,texinfo))) (inputs - `(("guile" ,guile-2.0))) + `(("guile" ,guile-2.2))) (propagated-inputs - `(("guile-reader" ,guile-reader) - ("guile-commonmark" ,guile-commonmark))) + `(("guile-reader" ,guile2.2-reader) + ("guile-commonmark" ,guile2.2-commonmark))) (synopsis "Functional static site generator") (description "Haunt is a static site generator written in Guile Scheme. Haunt features a functional build system and an extensible @@ -1068,9 +1068,11 @@ interface for reading articles in any format.") (home-page "http://haunt.dthompson.us") (license license:gpl3+))) +(define-public guile2.0-haunt + (package-for-guile-2.0 + (package (inherit haunt) (name "guile2.0-haunt")))) (define-public guile2.2-haunt - (package-for-guile-2.2 - (package (inherit haunt) (name "guile2.2-haunt")))) + (deprecated-package "guile2.2-haunt" haunt)) (define-public guile-config (package -- cgit v1.2.3 From bdf1022decbc2ea4e998c74af7ce75e17e5ec485 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 19 Mar 2017 18:04:37 +0100 Subject: gnu: guile-reader: Default to Guile 2.2. * gnu/packages/guile.scm (guile-reader)[inputs]: Change GUILE-2.0 to GUILE-2.2. (guile2.0-reader): New variable. (guile2.2-reader): Mark as deprecated. (haunt)[propagated-inputs]: Use GUILE-READER instead of GUILE2.2-READER. --- gnu/packages/guile.scm | 8 +++++--- gnu/packages/skribilo.scm | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm index 87f5de161a..6373eec2a4 100644 --- a/gnu/packages/guile.scm +++ b/gnu/packages/guile.scm @@ -456,7 +456,7 @@ more.") (build-system gnu-build-system) (native-inputs `(("pkgconfig" ,pkg-config) ("gperf" ,gperf))) - (inputs `(("guile" ,guile-2.0))) + (inputs `(("guile" ,guile-2.2))) (synopsis "Framework for building readers for GNU Guile") (description "Guile-Reader is a simple framework for building readers for GNU Guile. @@ -473,8 +473,10 @@ many readers as needed).") (home-page "http://www.nongnu.org/guile-reader/") (license license:gpl3+))) +(define-public guile2.0-reader + (package-for-guile-2.0 guile-reader)) (define-public guile2.2-reader - (package-for-guile-2.2 guile-reader)) + (deprecated-package "guile2.2-reader" guile-reader)) (define-public guile-ncurses (package @@ -1059,7 +1061,7 @@ Guile's foreign function interface.") (inputs `(("guile" ,guile-2.2))) (propagated-inputs - `(("guile-reader" ,guile2.2-reader) + `(("guile-reader" ,guile-reader) ("guile-commonmark" ,guile2.2-commonmark))) (synopsis "Functional static site generator") (description "Haunt is a static site generator written in Guile diff --git a/gnu/packages/skribilo.scm b/gnu/packages/skribilo.scm index 52ed1c34e3..78b4806c8c 100644 --- a/gnu/packages/skribilo.scm +++ b/gnu/packages/skribilo.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014, 2015, 2016 Ludovic Courtès +;;; Copyright © 2013, 2014, 2015, 2016, 2017 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -73,7 +73,7 @@ ;; The 'skribilo' command needs them, and for people using Skribilo as a ;; library, these inputs are needed as well. - (propagated-inputs `(("guile-reader" ,guile-reader) + (propagated-inputs `(("guile-reader" ,guile2.0-reader) ("guile-lib" ,guile-lib))) (home-page "http://www.nongnu.org/skribilo/") -- cgit v1.2.3 From 7c86c0310939619cb37d4706ca3446ed342a2444 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 19 Mar 2017 18:07:36 +0100 Subject: gnu: guile-commonmark: Default to Guile 2.2. * gnu/packages/guile.scm (guile-commonmark)[inputs]: Replace GUILE-2.0 with GUILE-2.2. (guile2.0-commonmark): New variable. (guile2.2-commonmark): Mark as deprecated. (haunt)[propagated-inputs]: Use GUILE-COMMONMARK. --- gnu/packages/guile.scm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm index 6373eec2a4..df1f17201e 100644 --- a/gnu/packages/guile.scm +++ b/gnu/packages/guile.scm @@ -1062,7 +1062,7 @@ Guile's foreign function interface.") `(("guile" ,guile-2.2))) (propagated-inputs `(("guile-reader" ,guile-reader) - ("guile-commonmark" ,guile2.2-commonmark))) + ("guile-commonmark" ,guile-commonmark))) (synopsis "Functional static site generator") (description "Haunt is a static site generator written in Guile Scheme. Haunt features a functional build system and an extensible @@ -1432,7 +1432,7 @@ you send to a FIFO file.") "/site/@GUILE_EFFECTIVE_VERSION@")))))) (build-system gnu-build-system) (inputs - `(("guile" ,guile-2.0))) + `(("guile" ,guile-2.2))) (synopsis "CommonMark parser for Guile") (description "guile-commonmark is a library for parsing CommonMark, a fully specified @@ -1443,8 +1443,10 @@ is no support for parsing block and inline level HTML.") (home-page "https://github.com/OrangeShark/guile-commonmark") (license license:lgpl3+))) +(define-public guile2.0-commonmark + (package-for-guile-2.0 guile-commonmark)) (define-public guile2.2-commonmark - (package-for-guile-2.2 guile-commonmark)) + (deprecated-package "guile2.2-commonmark" guile-commonmark)) (define-public guile-bytestructures (package -- cgit v1.2.3 From 26e34e1e1288d657e92372efb6edc95c0e299247 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Sat, 18 Mar 2017 15:06:32 +0100 Subject: services: file-system-shepherd-service: Make it find the fsck programs. Fixes . * gnu/services/base.scm (file-system-shepherd-service): Use file-system-packages. --- gnu/services/base.scm | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 5298a11f63..ab50301462 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -274,7 +274,8 @@ FILE-SYSTEM." (options (file-system-options file-system)) (check? (file-system-check? file-system)) (create? (file-system-create-mount-point? file-system)) - (dependencies (file-system-dependencies file-system))) + (dependencies (file-system-dependencies file-system)) + (packages (file-system-packages (list file-system)))) (and (file-system-mount? file-system) (with-imported-modules '((gnu build file-systems) (guix build bournish)) @@ -292,11 +293,12 @@ FILE-SYSTEM." ;; Make sure fsck.ext2 & co. can be found. (dynamic-wind (lambda () - (setenv "PATH" - (string-append - #$e2fsprogs "/sbin:" - "/run/current-system/profile/sbin:" - $PATH))) + ;; Don’t display the PATH settings. + (with-output-to-port (%make-void-port "w") + (lambda () + (set-path-environment-variable "PATH" + '("bin" "sbin") + '#$packages)))) (lambda () (mount-file-system `(#$device #$title #$target #$type #$flags -- cgit v1.2.3 From 512fc6db7bb900a892810d4b3c8b0e712b8e2379 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Sat, 18 Mar 2017 02:29:12 -0400 Subject: gnu: libevent@2.0: Add fix from upstream. This fix was cherry-picked by Mozilla from upstream libevent-2.1 to its bundled copy of libevent-2.0.21 in mozilla-esr45. * gnu/packages/patches/libevent-2.0-evbuffer-add-use-last-with-datap.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/libevent.scm (libevent-2.0)[source][patches]: Add it. --- gnu/local.mk | 1 + gnu/packages/libevent.scm | 28 ++++++++-------- ...vent-2.0-evbuffer-add-use-last-with-datap.patch | 38 ++++++++++++++++++++++ 3 files changed, 54 insertions(+), 13 deletions(-) create mode 100644 gnu/packages/patches/libevent-2.0-evbuffer-add-use-last-with-datap.patch diff --git a/gnu/local.mk b/gnu/local.mk index 48c134ba6e..885c1137a5 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -677,6 +677,7 @@ dist_patch_DATA = \ %D%/packages/patches/libdrm-symbol-check.patch \ %D%/packages/patches/libepoxy-gl-null-checks.patch \ %D%/packages/patches/libevent-dns-tests.patch \ + %D%/packages/patches/libevent-2.0-evbuffer-add-use-last-with-datap.patch \ %D%/packages/patches/libevent-2.0-evdns-fix-remote-stack-overread.patch \ %D%/packages/patches/libevent-2.0-evdns-fix-searching-empty-hostnames.patch \ %D%/packages/patches/libevent-2.0-evutil-fix-buffer-overflow.patch \ diff --git a/gnu/packages/libevent.scm b/gnu/packages/libevent.scm index dd5f7c4067..6e2ce8f257 100644 --- a/gnu/packages/libevent.scm +++ b/gnu/packages/libevent.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013, 2014, 2015, 2016 Ludovic Courtès -;;; Copyright © 2015 Mark H Weaver +;;; Copyright © 2015, 2017 Mark H Weaver ;;; Copyright © 2015 Eric Dvorsak ;;; Copyright © 2016 David Thompson ;;; Copyright © 2017 Marius Bakke @@ -74,18 +74,20 @@ loop.") (inherit libevent) (version "2.0.22") (source (origin - (method url-fetch) - (uri (string-append - "https://github.com/libevent/libevent/releases/download/release-" - version "-stable/libevent-" version "-stable.tar.gz")) - (sha256 - (base32 - "18qz9qfwrkakmazdlwxvjmw8p76g70n3faikwvdwznns1agw9hki")) - (patches (search-patches - "libevent-dns-tests.patch" - "libevent-2.0-evdns-fix-remote-stack-overread.patch" - "libevent-2.0-evutil-fix-buffer-overflow.patch" - "libevent-2.0-evdns-fix-searching-empty-hostnames.patch")))))) + (method url-fetch) + (uri (string-append + "https://github.com/libevent/libevent/releases/download/release-" + version "-stable/libevent-" version "-stable.tar.gz")) + (sha256 + (base32 + "18qz9qfwrkakmazdlwxvjmw8p76g70n3faikwvdwznns1agw9hki")) + (patches + (search-patches + "libevent-dns-tests.patch" + "libevent-2.0-evdns-fix-remote-stack-overread.patch" + "libevent-2.0-evutil-fix-buffer-overflow.patch" + "libevent-2.0-evdns-fix-searching-empty-hostnames.patch" + "libevent-2.0-evbuffer-add-use-last-with-datap.patch")))))) (define-public libev (package diff --git a/gnu/packages/patches/libevent-2.0-evbuffer-add-use-last-with-datap.patch b/gnu/packages/patches/libevent-2.0-evbuffer-add-use-last-with-datap.patch new file mode 100644 index 0000000000..0253700bf6 --- /dev/null +++ b/gnu/packages/patches/libevent-2.0-evbuffer-add-use-last-with-datap.patch @@ -0,0 +1,38 @@ +From a8769ef12d7e223e33fc47bed03fba2bfa2f3536 Mon Sep 17 00:00:00 2001 +From: Marcus Sundberg +Date: Sat, 26 Mar 2016 20:11:43 +0100 +Subject: [PATCH] evbuffer_add: Use last_with_datap if set, not last. + +evbuffer_add() would always put data in the last chain, even if there +was available space in a previous chain, and in doing so it also +failed to update last_with_datap, causing subsequent calls to other +functions that do look at last_with_datap to add data in the middle +of the evbuffer instead of at the end. + +Fixes the evbuffer_add() part of issue #335, and the evbuffer/add2 and +evbuffer/add3 tests, and also prevents wasting space available in the +chain pointed to by last_with_datap. +--- + buffer.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/buffer.c b/buffer.c +index 7cca0e8a..f378b731 100644 +--- a/buffer.c ++++ b/buffer.c +@@ -1732,7 +1732,11 @@ evbuffer_add(struct evbuffer *buf, const void *data_in, size_t datlen) + goto done; + } + +- chain = buf->last; ++ if (*buf->last_with_datap == NULL) { ++ chain = buf->last; ++ } else { ++ chain = *buf->last_with_datap; ++ } + + /* If there are no chains allocated for this buffer, allocate one + * big enough to hold all the data. */ +-- +2.12.0 + -- cgit v1.2.3 From 6191fef4e0b6c9830add4dad2a9ac908ce5a0285 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Sat, 18 Mar 2017 02:40:42 -0400 Subject: gnu: icecat: Add selected fixes from upstream mozilla-esr45. * gnu/packages/gnuzilla.scm (icecat)[source][patches]: Add selected fixes from the upstream mozilla-esr45 repository. --- gnu/packages/gnuzilla.scm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm index e6e24f6650..8d9f781a4b 100644 --- a/gnu/packages/gnuzilla.scm +++ b/gnu/packages/gnuzilla.scm @@ -348,7 +348,13 @@ standards.") (mozilla-patch "icecat-bug-1341137-pt3.patch" "69f3d44bdb48" "1ad7rw6nmg3c49ylqxlqqkb6cm2f0ygfzrigs6b60a2zkjqhbl0h") (mozilla-patch "icecat-bug-1341137-pt4.patch" "22546e2cee64" "0gbwxa3p7qkq53hwnvxcqhx8h34qmnjdxy0h3ajik4mw76vrna9s") (mozilla-patch "icecat-bug-1341137-pt5.patch" "e5083d8a855a" "1247vbpqzf007nigbxxqd6nwgr1dxd4p8cd0dr45afqh19vhlapj") - (mozilla-patch "icecat-bug-1339122.patch" "b0d156c7445e" "026jp5bb565yvhkmmicgygcn1lmak85p0466yl1vnjlx1rc8n724"))) + (mozilla-patch "icecat-bug-1339122.patch" "b0d156c7445e" "026jp5bb565yvhkmmicgygcn1lmak85p0466yl1vnjlx1rc8n724") + (mozilla-patch "icecat-bug-1319087.patch" "9cd44507fd65" "0mcfvby53r2150libazgrgaqrdyvl0g6cr1f01dsya3cgmc9mkcn") + (mozilla-patch "icecat-bug-1342661.patch" "d449995ef7d9" "1kz8k2jxvhqpjgrsj7r0kqq79036lrkfnx5pvdnsl59np9128j81") + (mozilla-patch "icecat-bug-1343261.patch" "9b5374019b58" "0v5w50r5ys4jjy1lpks280cq8paw7wdy9mrk7szzq7nlcxz90is7") + (mozilla-patch "icecat-bug-1343552-pt1.patch" "08bc7a3330e4" "1hsvffscqc4zflni866ilylgi3a13wz0n882z85xplbhwhc9lcfj") + (mozilla-patch "icecat-bug-1343552-pt2.patch" "8c61ebe37f1b" "1fjsr6bzfyd1zqzz2pglwh2ckys95h21wy3j4rlwkz66057z53qq") + (mozilla-patch "icecat-bug-1340718.patch" "bfa75fc20c2b" "08gksd06lwbb5ykdrk9gh2cb9bximwxhbxl3rprz64jj2bnmd3dq"))) (modules '((guix build utils))) (snippet '(begin -- cgit v1.2.3 From fc1bfca253d6d1797abb27aa8d392b6836690c8d Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Sun, 19 Mar 2017 20:49:26 +0100 Subject: gnu: u-boot: Update to 2017.03. * gnu/packages/bootloaders.scm (u-boot): Update to 2017.03. --- gnu/packages/bootloaders.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm index 16cb7b4c0b..8029c00da7 100644 --- a/gnu/packages/bootloaders.scm +++ b/gnu/packages/bootloaders.scm @@ -257,7 +257,7 @@ tree binary files. These are board description files used by Linux and BSD.") (define u-boot (package (name "u-boot") - (version "2017.01") + (version "2017.03") (source (origin (method url-fetch) (uri (string-append @@ -265,7 +265,7 @@ tree binary files. These are board description files used by Linux and BSD.") "u-boot-" version ".tar.bz2")) (sha256 (base32 - "1wpc51jm3zyibgcr78jng2yksqvrya76bxgsr4pcyjrsz5sm2hkc")))) + "0gqihplap05dlpwdb971wsqyv01nz2vabwq5g5649gr5jczsyjzm")))) (native-inputs `(("bc" ,bc) ("dtc" ,dtc) -- cgit v1.2.3 From 9970ef6134a53e61e237410de82c98a1ac39c63c Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Sun, 19 Mar 2017 21:36:55 +0100 Subject: services: Remove Tab character from source code whitespace. * gnu/services/base.scm (file-system-shepherd-service): Remove Tab character from source code whitespace. --- gnu/services/base.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnu/services/base.scm b/gnu/services/base.scm index ab50301462..dad1911d31 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -285,7 +285,7 @@ FILE-SYSTEM." ,@(map dependency->shepherd-service-name dependencies))) (documentation "Check, mount, and unmount the given file system.") (start #~(lambda args - #$(if create? + #$(if create? #~(mkdir-p #$target) #t) -- cgit v1.2.3 From 9baf0171a4468c330a7f8d15353b8505c27292ff Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Sun, 19 Mar 2017 17:14:56 -0400 Subject: gnu: linux-libre@4.4: Update to 4.4.55. * gnu/packages/linux.scm (linux-libre-4.4): Update to 4.4.55. --- gnu/packages/linux.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index c7225dac3b..eeffab1063 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -354,8 +354,8 @@ It has been modified to remove all non-free binary blobs.") #:configuration-file kernel-config)) (define-public linux-libre-4.4 - (make-linux-libre "4.4.54" - "0ny6hsrngl4y4j3ha4py2k7b0fldl9j5mn1h8z115fx2vq9nkfhv" + (make-linux-libre "4.4.55" + "1m4h3wi4j573hny1yfi9qwkiicx2bx3gwy52zpr8bhxpyqz0d2dl" %intel-compatible-systems #:configuration-file kernel-config)) -- cgit v1.2.3 From 92c42164a2a7306c1af6cf4add48061d8f42c8d2 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Sun, 19 Mar 2017 17:16:38 -0400 Subject: gnu: linux-libre@4.9: Update to 4.9.16. * gnu/packages/linux.scm (linux-libre-4.9): Update to 4.9.16. --- gnu/packages/linux.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index eeffab1063..9d04a2f00d 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -348,8 +348,8 @@ It has been modified to remove all non-free binary blobs.") #:configuration-file kernel-config)) (define-public linux-libre-4.9 - (make-linux-libre "4.9.15" - "1p8mfd2djgndwpgqg7nylpncgdqrjn9038bzhc7z1mjykzfb3d8a" + (make-linux-libre "4.9.16" + "0n7y7h7ps4l1pr9d0m75hkw41jnfyw301r343dsaznwc0lpq3ch7" %intel-compatible-systems #:configuration-file kernel-config)) -- cgit v1.2.3 From 8299c697af4b30e3d0aae80d21f7a529448f707e Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Sun, 19 Mar 2017 17:18:15 -0400 Subject: gnu: linux-libre: Update to 4.10.4. * gnu/packages/linux.scm (%linux-libre-version): Update to 4.10.4. (%linux-libre-hash): Update hash. --- gnu/packages/linux.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 9d04a2f00d..46052fe10d 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -338,8 +338,8 @@ It has been modified to remove all non-free binary blobs.") (define %intel-compatible-systems '("x86_64-linux" "i686-linux")) -(define %linux-libre-version "4.10.3") -(define %linux-libre-hash "1znrcwc0y35cjkizkmjvnxnkldf490pfxqs7dn4vcgmb80y7smfc") +(define %linux-libre-version "4.10.4") +(define %linux-libre-hash "0cmz4y8pb3sdag32bsrn7vg1i8v9rymfspg85ipkbamm53c7v54g") (define-public linux-libre (make-linux-libre %linux-libre-version -- cgit v1.2.3 From e05fc441cd5528ba6c83b6371c27c1e87dd393e9 Mon Sep 17 00:00:00 2001 From: rennes Date: Sun, 19 Mar 2017 15:02:00 -0600 Subject: gnu: Add pdfgrep. * guix/gnu/packages/pdf.scm (pdfgrep): New variable. Signed-off-by: Leo Famulari --- gnu/packages/pdf.scm | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/gnu/packages/pdf.scm b/gnu/packages/pdf.scm index 873100cd78..029b299e77 100644 --- a/gnu/packages/pdf.scm +++ b/gnu/packages/pdf.scm @@ -12,6 +12,7 @@ ;;; Copyright © 2016 Arun Isaac ;;; Copyright © 2017 Leo Famulari ;;; Copyright © 2017 Alex Vong +;;; Copyright © 2017 Rene Saavedra ;;; ;;; This file is part of GNU Guix. ;;; @@ -45,6 +46,7 @@ #:use-module (gnu packages fontutils) #:use-module (gnu packages game-development) #:use-module (gnu packages ghostscript) + #:use-module (gnu packages gnupg) #:use-module (gnu packages databases) #:use-module (gnu packages djvu) #:use-module (gnu packages gettext) @@ -888,3 +890,31 @@ This is much like @command{poster} does for Postscript files, but working with PDF. Since sometimes @command{poster} does not like your files converted from PDF. Indeed @command{pdfposter} was inspired by @command{poster}.") (license license:gpl3+))) + +(define-public pdfgrep + (package + (name "pdfgrep") + (version "2.0.1") + (source + (origin + (method url-fetch) + (uri (string-append "https://pdfgrep.org/download/" + name "-" version ".tar.gz")) + (sha256 + (base32 + "07llkrkcfjwd3ybai9ad10ybhr0biffcplmy7lw4fb87nd2dfw03")))) + (build-system gnu-build-system) + (native-inputs + `(("pkg-config" ,pkg-config))) + (inputs + `(("libgcrypt" ,libgcrypt) + ("pcre" ,pcre) + ("poppler" ,poppler))) + (home-page "https://pdfgrep.org") + (synopsis "Command-line utility to search text in PDF files") + (description + "Pdfgrep searches in pdf files for strings matching a regular expression. +Support some GNU grep options as file name output, page number output, +optional case insensitivity, count occurrences, color highlights and search in +multiple files.") + (license license:gpl2+))) -- cgit v1.2.3