summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorMark H Weaver <mhw@netris.org>2016-01-24 21:04:54 -0500
committerMark H Weaver <mhw@netris.org>2016-01-24 21:04:54 -0500
commit412bee5e2931a53066ae593808935608d54a4345 (patch)
tree28b297694296115f056ead6de81d24bbd98d75f5 /guix
parent68716289995d106c7adc779548eebc5df324e6cf (diff)
parent880d647d0f1a0ea0aea2af84fa2e99e3286b65a1 (diff)
downloadguix-patches-412bee5e2931a53066ae593808935608d54a4345.tar
guix-patches-412bee5e2931a53066ae593808935608d54a4345.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'guix')
-rw-r--r--guix/import/cran.scm103
-rw-r--r--guix/import/gem.scm7
-rw-r--r--guix/licenses.scm8
-rw-r--r--guix/scripts/build.scm10
-rw-r--r--guix/scripts/import/cran.scm9
-rw-r--r--guix/scripts/refresh.scm1
6 files changed, 112 insertions, 26 deletions
diff --git a/guix/import/cran.scm b/guix/import/cran.scm
index 1c30da89c7..f36e9482cf 100644
--- a/guix/import/cran.scm
+++ b/guix/import/cran.scm
@@ -29,12 +29,14 @@
#:use-module (guix base32)
#:use-module ((guix download) #:select (download-to-store))
#:use-module (guix import utils)
- #:use-module ((guix build-system r) #:select (cran-uri))
+ #:use-module ((guix build-system r) #:select (cran-uri bioconductor-uri))
#:use-module (guix upstream)
#:use-module (guix packages)
#:use-module (gnu packages)
#:export (cran->guix-package
- %cran-updater))
+ bioconductor->guix-package
+ %cran-updater
+ %bioconductor-updater))
;;; Commentary:
;;;
@@ -108,6 +110,15 @@ package definition."
`((,type (,'quasiquote ,(format-inputs package-inputs)))))))
(define %cran-url "http://cran.r-project.org/web/packages/")
+(define %bioconductor-url "http://bioconductor.org/packages/")
+
+;; The latest Bioconductor release is 3.2. Bioconductor packages should be
+;; updated together.
+(define %bioconductor-svn-url
+ (string-append "https://readonly:readonly@"
+ "hedgehog.fhcrc.org/bioconductor/branches/RELEASE_3_2/"
+ "madman/Rpacks/"))
+
(define (fetch-description base-url name)
"Return an alist of the contents of the DESCRIPTION file for the R package
@@ -136,24 +147,31 @@ empty list when the FIELD cannot be found."
(string-any char-set:whitespace item)))
(map string-trim-both items))))))
-(define (description->package meta)
- "Return the `package' s-expression for a CRAN package from the alist META,
-which was derived from the R package's DESCRIPTION file."
+(define (description->package repository meta)
+ "Return the `package' s-expression for an R package published on REPOSITORY
+from the alist META, which was derived from the R package's DESCRIPTION file."
(define (guix-name name)
(if (string-prefix? "r-" name)
(string-downcase name)
(string-append "r-" (string-downcase name))))
- (let* ((name (assoc-ref meta "Package"))
+ (let* ((base-url (case repository
+ ((cran) %cran-url)
+ ((bioconductor) %bioconductor-url)))
+ (uri-helper (case repository
+ ((cran) cran-uri)
+ ((bioconductor) bioconductor-uri)))
+ (name (assoc-ref meta "Package"))
(synopsis (assoc-ref meta "Title"))
(version (assoc-ref meta "Version"))
(license (string->license (assoc-ref meta "License")))
;; Some packages have multiple home pages. Some have none.
(home-page (match (listify meta "URL")
((url rest ...) url)
- (_ (string-append %cran-url name))))
- (source-url (match (cran-uri name version)
+ (_ (string-append base-url name))))
+ (source-url (match (uri-helper name version)
((url rest ...) url)
+ ((? string? url) url)
(_ #f)))
(tarball (with-store store (download-to-store store source-url)))
(sysdepends (map string-downcase (listify meta "SystemRequirements")))
@@ -167,26 +185,32 @@ which was derived from the R package's DESCRIPTION file."
(version ,version)
(source (origin
(method url-fetch)
- (uri (cran-uri ,name version))
+ (uri (,(procedure-name uri-helper) ,name version))
(sha256
(base32
,(bytevector->nix-base32-string (file-sha256 tarball))))))
- (properties ,`(,'quasiquote ((,'upstream-name . ,name))))
+ ,@(if (not (equal? (string-append "r-" name)
+ (guix-name name)))
+ `((properties ,`(,'quasiquote ((,'upstream-name . ,name)))))
+ '())
(build-system r-build-system)
,@(maybe-inputs sysdepends)
,@(maybe-inputs propagate 'propagated-inputs)
(home-page ,(if (string-null? home-page)
- (string-append %cran-url name)
+ (string-append base-url name)
home-page))
(synopsis ,synopsis)
(description ,(beautify-description (assoc-ref meta "Description")))
(license ,license))))
-(define (cran->guix-package package-name)
- "Fetch the metadata for PACKAGE-NAME from cran.r-project.org, and return the
-`package' s-expression corresponding to that package, or #f on failure."
- (let ((module-meta (fetch-description %cran-url package-name)))
- (and=> module-meta description->package)))
+(define* (cran->guix-package package-name #:optional (repo 'cran))
+ "Fetch the metadata for PACKAGE-NAME from REPO and return the `package'
+s-expression corresponding to that package, or #f on failure."
+ (let* ((url (case repo
+ ((cran) %cran-url)
+ ((bioconductor) %bioconductor-svn-url)))
+ (module-meta (fetch-description url package-name)))
+ (and=> module-meta (cut description->package repo <>))))
;;;
@@ -212,7 +236,7 @@ which was derived from the R package's DESCRIPTION file."
(_ #f)))
(_ #f)))))
-(define (latest-release package)
+(define (latest-cran-release package)
"Return an <upstream-source> for the latest release of PACKAGE."
(define upstream-name
@@ -229,16 +253,55 @@ which was derived from the R package's DESCRIPTION file."
(version version)
(urls (cran-uri upstream-name version))))))
+(define (latest-bioconductor-release package)
+ "Return an <upstream-source> for the latest release of PACKAGE."
+
+ (define upstream-name
+ (package->upstream-name (specification->package package)))
+
+ (define meta
+ (fetch-description %bioconductor-svn-url upstream-name))
+
+ (and meta
+ (let ((version (assoc-ref meta "Version")))
+ ;; Bioconductor does not provide signatures.
+ (upstream-source
+ (package package)
+ (version version)
+ (urls (bioconductor-uri upstream-name version))))))
+
(define (cran-package? package)
"Return true if PACKAGE is an R package from CRAN."
- ;; Assume all R packages are available on CRAN.
- (string-prefix? "r-" (package-name package)))
+ (and (string-prefix? "r-" (package-name package))
+ (match (and=> (package-source package) origin-uri)
+ ((? string? uri)
+ (string-prefix? "mirror://cran" uri))
+ ((? list? uris)
+ (any (cut string-prefix? "mirror://cran" <>) uris))
+ (_ #f))))
+
+(define (bioconductor-package? package)
+ "Return true if PACKAGE is an R package from Bioconductor."
+ (and (string-prefix? "r-" (package-name package))
+ (match (and=> (package-source package) origin-uri)
+ ((? string? uri)
+ (string-prefix? "http://bioconductor.org" uri))
+ ((? list? uris)
+ (any (cut string-prefix? "http://bioconductor.org" <>) uris))
+ (_ #f))))
(define %cran-updater
(upstream-updater
(name 'cran)
(description "Updater for CRAN packages")
(pred cran-package?)
- (latest latest-release)))
+ (latest latest-cran-release)))
+
+(define %bioconductor-updater
+ (upstream-updater
+ (name 'bioconductor)
+ (description "Updater for Bioconductor packages")
+ (pred bioconductor-package?)
+ (latest latest-bioconductor-release)))
;;; cran.scm ends here
diff --git a/guix/import/gem.scm b/guix/import/gem.scm
index 3c42052f1a..4b2a253130 100644
--- a/guix/import/gem.scm
+++ b/guix/import/gem.scm
@@ -77,7 +77,7 @@ the package."
(bytevector-u8-set! bv i (read-byte i))
(loop (1+ i)))))))
-(define (make-gem-sexp name version hash home-page description
+(define (make-gem-sexp name version hash home-page synopsis description
dependencies licenses)
"Return the `package' s-expression for a Ruby package with the given NAME,
VERSION, HASH, HOME-PAGE, DESCRIPTION, DEPENDENCIES, and LICENSES."
@@ -101,7 +101,7 @@ VERSION, HASH, HOME-PAGE, DESCRIPTION, DEPENDENCIES, and LICENSES."
(,'unquote
,(string->symbol name))))
dependencies)))))
- (synopsis ,description) ; nothing better to use
+ (synopsis ,synopsis)
(description ,description)
(home-page ,home-page)
(license ,(match licenses
@@ -117,6 +117,7 @@ VERSION, HASH, HOME-PAGE, DESCRIPTION, DEPENDENCIES, and LICENSES."
(let ((name (assoc-ref package "name"))
(version (assoc-ref package "version"))
(hash (assoc-ref package "sha"))
+ (synopsis (assoc-ref package "info")) ; nothing better to use
(description (beautify-description
(assoc-ref package "info")))
(home-page (assoc-ref package "homepage_uri"))
@@ -129,5 +130,5 @@ VERSION, HASH, HOME-PAGE, DESCRIPTION, DEPENDENCIES, and LICENSES."
"runtime")))
(licenses (map string->license
(assoc-ref package "licenses"))))
- (make-gem-sexp name version hash home-page
+ (make-gem-sexp name version hash home-page synopsis
description dependencies licenses)))))
diff --git a/guix/licenses.scm b/guix/licenses.scm
index 9ace7f543b..1def1acb3e 100644
--- a/guix/licenses.scm
+++ b/guix/licenses.scm
@@ -4,6 +4,7 @@
;;; Copyright © 2012, 2013 Nikita Karetnikov <nikita@karetnikov.org>
;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2016 Eric Bavier <bavier@member.fsf.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -49,7 +50,7 @@
imlib2
ipa
lgpl2.0 lgpl2.0+ lgpl2.1 lgpl2.1+ lgpl3 lgpl3+
- mpl1.1 mpl2.0
+ mpl1.0 mpl1.1 mpl2.0
ms-pl
ncsa
openldap2.8 openssl
@@ -302,6 +303,11 @@ at URI, which may be a file:// URI pointing the package's tree."
"https://www.gnu.org/licenses/lgpl.html"
"https://www.gnu.org/licenses/license-list#LGPLv3"))
+(define mpl1.0
+ (license "MPL 1.0"
+ "http://www.mozilla.org/MPL/1.0/"
+ "https://www.gnu.org/licenses/license-list.html#MPL"))
+
(define mpl1.1
(license "MPL 1.1"
"http://directory.fsf.org/wiki/License:MPLv1.1"
diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm
index 9193ad32b2..7ca2c6ebc8 100644
--- a/guix/scripts/build.scm
+++ b/guix/scripts/build.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2013 Mark H Weaver <mhw@netris.org>
;;;
;;; This file is part of GNU Guix.
@@ -153,6 +153,8 @@ options handled by 'set-build-options-from-command-line', and listed in
(display (_ "
-K, --keep-failed keep build tree of failed builds"))
(display (_ "
+ -k, --keep-going keep going when some of the derivations fail"))
+ (display (_ "
-n, --dry-run do not build the derivations"))
(display (_ "
--fallback fall back to building when the substituter fails"))
@@ -183,6 +185,7 @@ options handled by 'set-build-options-from-command-line', and listed in
;; TODO: Add more options.
(set-build-options store
#:keep-failed? (assoc-ref opts 'keep-failed?)
+ #:keep-going? (assoc-ref opts 'keep-going?)
#:rounds (assoc-ref opts 'rounds)
#:build-cores (or (assoc-ref opts 'cores) 0)
#:max-build-jobs (or (assoc-ref opts 'max-jobs) 1)
@@ -214,6 +217,11 @@ options handled by 'set-build-options-from-command-line', and listed in
(apply values
(alist-cons 'keep-failed? #t result)
rest)))
+ (option '(#\k "keep-going") #f #f
+ (lambda (opt name arg result . rest)
+ (apply values
+ (alist-cons 'keep-going? #t result)
+ rest)))
(option '("rounds") #t #f
(lambda (opt name arg result . rest)
(apply values
diff --git a/guix/scripts/import/cran.scm b/guix/scripts/import/cran.scm
index 8d001ac494..ace1123b90 100644
--- a/guix/scripts/import/cran.scm
+++ b/guix/scripts/import/cran.scm
@@ -42,6 +42,8 @@
(display (_ "Usage: guix import cran PACKAGE-NAME
Import and convert the CRAN package for PACKAGE-NAME.\n"))
(display (_ "
+ -a, --archive=ARCHIVE specify the archive repository"))
+ (display (_ "
-h, --help display this help and exit"))
(display (_ "
-V, --version display version information and exit"))
@@ -57,6 +59,10 @@ Import and convert the CRAN package for PACKAGE-NAME.\n"))
(option '(#\V "version") #f #f
(lambda args
(show-version-and-exit "guix import cran")))
+ (option '(#\a "archive") #t #f
+ (lambda (opt name arg result)
+ (alist-cons 'repo (string->symbol arg)
+ (alist-delete 'repo result))))
%standard-import-options))
@@ -82,7 +88,8 @@ Import and convert the CRAN package for PACKAGE-NAME.\n"))
(reverse opts))))
(match args
((package-name)
- (let ((sexp (cran->guix-package package-name)))
+ (let ((sexp (cran->guix-package package-name
+ (or (assoc-ref opts 'repo) 'cran))))
(unless sexp
(leave (_ "failed to download description for package '~a'~%")
package-name))
diff --git a/guix/scripts/refresh.scm b/guix/scripts/refresh.scm
index a5834d12cc..f9e3f31a03 100644
--- a/guix/scripts/refresh.scm
+++ b/guix/scripts/refresh.scm
@@ -195,6 +195,7 @@ unavailable optional dependencies such as Guile-JSON."
%gnome-updater
%elpa-updater
%cran-updater
+ %bioconductor-updater
((guix import pypi) => %pypi-updater)))
(define (lookup-updater name)