From c2590362ad7c926050db0ea1dacd437027241520 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 11 Jun 2015 11:09:12 +0200 Subject: [PATCH 01/45] environment: Connect to the store after the command line has been parsed. * guix/scripts/environment.scm (guix-environment): Call 'parse-command-line' outside of 'with-store'. This allows things like --help to run even if the daemon is not running. --- guix/scripts/environment.scm | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm index 42178091e6..007fde1606 100644 --- a/guix/scripts/environment.scm +++ b/guix/scripts/environment.scm @@ -232,20 +232,22 @@ packages." (alist-cons 'package arg result)) (with-error-handling - (with-store store - (let* ((opts (parse-command-line args %options (list %default-options) - #:argument-handler handle-argument)) - (pure? (assoc-ref opts 'pure)) - (ad-hoc? (assoc-ref opts 'ad-hoc?)) - (command (assoc-ref opts 'exec)) - (packages (pick-all (options/resolve-packages opts) 'package)) - (inputs (if ad-hoc? + (let* ((opts (parse-command-line args %options (list %default-options) + #:argument-handler handle-argument)) + (pure? (assoc-ref opts 'pure)) + (ad-hoc? (assoc-ref opts 'ad-hoc?)) + (command (assoc-ref opts 'exec)) + (packages (pick-all (options/resolve-packages opts) 'package)) + (inputs (if ad-hoc? (packages+propagated-inputs packages) - (packages->transitive-inputs packages))) - (drvs (run-with-store store - (mbegin %store-monad - (set-guile-for-build (default-guile)) - (build-inputs inputs opts))))) + (packages->transitive-inputs packages)))) + (with-store store + (define drvs + (run-with-store store + (mbegin %store-monad + (set-guile-for-build (default-guile)) + (build-inputs inputs opts)))) + (cond ((assoc-ref opts 'dry-run?) #t) ((assoc-ref opts 'search-paths) From a43b55f1a6fa0eb712b2610b86a1775383d3f2cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 11 Jun 2015 11:19:12 +0200 Subject: [PATCH 02/45] guix build: Allow directories to be passed to --with-source. * guix/scripts/build.scm (package-with-source)[tarball-base-name]: Gracefully handle file names that lack an extension. Pass #:recursive? #t to 'download-to-store'. * guix/download.scm (download-to-store): Add #:recursive? parameter and pass it to 'add-to-store'. * doc/guix.texi (Invoking guix build): Add an example of --with-source with a directory. --- doc/guix.texi | 7 +++++++ guix/download.scm | 9 +++++---- guix/scripts/build.scm | 13 ++++++++++--- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index be7a292f08..c70d1000ae 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -3438,6 +3438,13 @@ candidates: guix build guile --with-source=../guile-2.0.9.219-e1bb7.tar.xz @end example +@dots{} or to build from a checkout in a pristine environment: + +@example +$ git clone git://git.sv.gnu.org/guix.git +$ guix build guix --with-source=./guix +@end example + @item --no-grafts Do not ``graft'' packages. In practice, this means that package updates available as grafts are not applied. @xref{Security Updates}, for more diff --git a/guix/download.scm b/guix/download.scm index 6b0349402a..3f7f7badce 100644 --- a/guix/download.scm +++ b/guix/download.scm @@ -282,14 +282,15 @@ in the store." ))))) (define* (download-to-store store url #:optional (name (basename url)) - #:key (log (current-error-port))) + #:key (log (current-error-port)) recursive?) "Download from URL to STORE, either under NAME or URL's basename if -omitted. Write progress reports to LOG." +omitted. Write progress reports to LOG. RECURSIVE? has the same effect as +the same-named parameter of 'add-to-store'." (define uri (string->uri url)) (if (or (not uri) (memq (uri-scheme uri) '(file #f))) - (add-to-store store name #f "sha256" + (add-to-store store name recursive? "sha256" (if uri (uri-path uri) url)) (call-with-temporary-output-file (lambda (temp port) @@ -298,6 +299,6 @@ omitted. Write progress reports to LOG." (build:url-fetch url temp #:mirrors %mirrors)))) (close port) (and result - (add-to-store store name #f "sha256" temp))))))) + (add-to-store store name recursive? "sha256" temp))))))) ;;; download.scm ends here diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm index 2307f76b42..7fd05da189 100644 --- a/guix/scripts/build.scm +++ b/guix/scripts/build.scm @@ -77,19 +77,26 @@ the new package's version number from URI." ;; Return the "base" of FILE-NAME, removing '.tar.gz' or similar ;; extensions. ;; TODO: Factorize. - (cond ((numeric-extension? file-name) + (cond ((not (file-extension file-name)) + file-name) + ((numeric-extension? file-name) file-name) ((string=? (file-extension file-name) "tar") (file-sans-extension file-name)) + ((file-extension file-name) + (tarball-base-name (file-sans-extension file-name))) (else - (tarball-base-name (file-sans-extension file-name))))) + file-name))) (let ((base (tarball-base-name (basename uri)))) (let-values (((name version) (package-name->name+version base))) (package (inherit p) (version (or version (package-version p))) - (source (download-to-store store uri)))))) + + ;; Use #:recursive? #t to allow for directories. + (source (download-to-store store uri + #:recursive? #t)))))) ;;; From 8b1c8e4e27e3973ea97ecf7d774540a43886b90e Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Thu, 11 Jun 2015 10:07:34 -0400 Subject: [PATCH 03/45] gnu: inetutils: Update to 1.9.4. * gnu/packages/admin.scm (inetutils): Update to 1.9.4. --- gnu/packages/admin.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index a96ce9cdfb..960264bc2d 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -152,14 +152,14 @@ re-executing them as necessary.") (define-public inetutils (package (name "inetutils") - (version "1.9.3") + (version "1.9.4") (source (origin (method url-fetch) (uri (string-append "mirror://gnu/inetutils/inetutils-" version ".tar.gz")) (sha256 (base32 - "06dshajjpyi9sxi7qfki9gnp5r3nxvyvf81r81gx0x2qkqzqcxlj")))) + "05n65k4ixl85dc6rxc51b1b732gnmm8xnqi424dy9f1nz7ppb3xy")))) (build-system gnu-build-system) (arguments `(;; FIXME: `tftp.sh' relies on `netstat' from utils-linux, ;; which is currently missing. From 4510b2da3e496f22495ecf9196e8f81dd1806b6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= Date: Thu, 11 Jun 2015 23:29:19 +0800 Subject: [PATCH 04/45] gnu: Add librest. * gnu/packages/gnome.scm (librest): New variable. --- gnu/packages/gnome.scm | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm index 4af1d13495..4599f4d234 100644 --- a/gnu/packages/gnome.scm +++ b/gnu/packages/gnome.scm @@ -1854,6 +1854,40 @@ library.") library.") (license license:lgpl2.0+))) +(define-public librest + (package + (name "librest") + (version "0.7.93") + (source (origin + (method url-fetch) + (uri (string-append "mirror://gnome/sources/rest/" + (version-major+minor version) "/" + "rest-" version ".tar.xz")) + (sha256 + (base32 + "05mj10hhiik23ai8w4wkk5vhsp7hcv24bih5q3fl82ilam268467")))) + (build-system gnu-build-system) + (arguments + '(#:tests? #f ; tests require internet connection + #:configure-flags + '("--with-ca-certificates=/etc/ssl/certs/ca-certificates.crt"))) + (native-inputs + `(("glib-mkenums" ,glib "bin") + ("gobject-introspection" ,gobject-introspection) + ("pkg-config" ,pkg-config))) + (propagated-inputs + ;; rest-0.7.pc refers to all these. + `(("glib" ,glib) + ("libsoup" ,libsoup) + ("libxml2" ,libxml2))) + (home-page "http://www.gtk.org/") + (synopsis "RESTful web api query library") + (description + "This library was designed to make it easier to access web services that +claim to be \"RESTful\". It includes convenience wrappers for libsoup and +libxml to ease remote use of the RESTful API.") + (license license:lgpl2.1+))) + (define-public libsoup (package (name "libsoup") From b45ce07a8a338590cb45d70cf8cf9c08d59744f8 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Thu, 11 Jun 2015 14:37:18 -0400 Subject: [PATCH 05/45] gnu: gnupg: Update to 2.1.5. * gnu/packages/gnupg.scm (gnupg): Update to 2.1.5. --- gnu/packages/gnupg.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/gnupg.scm b/gnu/packages/gnupg.scm index 5724bc8348..2044ef0501 100644 --- a/gnu/packages/gnupg.scm +++ b/gnu/packages/gnupg.scm @@ -190,14 +190,14 @@ compatible to GNU Pth.") (define-public gnupg (package (name "gnupg") - (version "2.1.4") + (version "2.1.5") (source (origin (method url-fetch) (uri (string-append "mirror://gnupg/gnupg/gnupg-" version ".tar.bz2")) (sha256 (base32 - "1c3c89b7ziknz6h1dnwmfjhgyy28g982rcncrhmhylb8v3npw4k4")))) + "0k5818r847zplbrwjp6i48s6xb5zy44rny2kmbisd6y3c1qml45m")))) (build-system gnu-build-system) (inputs `(("bzip2" ,bzip2) From 39fc041a7de18e4b41c4e9007cfdadbff581334a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 11 Jun 2015 21:37:49 +0200 Subject: [PATCH 06/45] records: Replace 'eval-when' with a proper 'define-syntax'. * guix/records.scm (make-syntactic-constructor): Remove enclosing 'eval-when'. Turn into a 'syntax-rules' macro. --- guix/records.scm | 188 +++++++++++++++++++++++------------------------ 1 file changed, 92 insertions(+), 96 deletions(-) diff --git a/guix/records.scm b/guix/records.scm index db59a99052..2378969843 100644 --- a/guix/records.scm +++ b/guix/records.scm @@ -42,106 +42,102 @@ (format #f fmt args ...) form)))) -(eval-when (expand load eval) - ;; This procedure is a syntactic helper used by 'define-record-type*', hence - ;; 'eval-when'. +(define-syntax make-syntactic-constructor + (syntax-rules () + "Make the syntactic constructor NAME for TYPE, that calls CTOR, and +expects all of EXPECTED fields to be initialized. DEFAULTS is the list of +FIELD/DEFAULT-VALUE tuples, THUNKED is the list of identifiers of thunked +fields, and DELAYED is the list of identifiers of delayed fields." + ((_ type name ctor (expected ...) + #:thunked thunked + #:delayed delayed + #:defaults defaults) + (define-syntax name + (lambda (s) + (define (record-inheritance orig-record field+value) + ;; Produce code that returns a record identical to ORIG-RECORD, + ;; except that values for the FIELD+VALUE alist prevail. + (define (field-inherited-value f) + (and=> (find (lambda (x) + (eq? f (car (syntax->datum x)))) + field+value) + car)) - (define* (make-syntactic-constructor type name ctor fields - #:key (thunked '()) (defaults '()) - (delayed '())) - "Make the syntactic constructor NAME for TYPE, that calls CTOR, and expects -all of FIELDS to be initialized. DEFAULTS is the list of FIELD/DEFAULT-VALUE -tuples, THUNKED is the list of identifiers of thunked fields, and DELAYED is -the list of identifiers of delayed fields." - (with-syntax ((type type) - (name name) - (ctor ctor) - (expected fields) - (defaults defaults)) - #`(define-syntax name - (lambda (s) - (define (record-inheritance orig-record field+value) - ;; Produce code that returns a record identical to ORIG-RECORD, - ;; except that values for the FIELD+VALUE alist prevail. - (define (field-inherited-value f) - (and=> (find (lambda (x) - (eq? f (car (syntax->datum x)))) - field+value) - car)) + ;; Make sure there are no unknown field names. + (let* ((fields (map (compose car syntax->datum) field+value)) + (unexpected (lset-difference eq? fields '(expected ...)))) + (when (pair? unexpected) + (record-error 'name s "extraneous field initializers ~a" + unexpected))) - ;; Make sure there are no unknown field names. - (let* ((fields (map (compose car syntax->datum) field+value)) - (unexpected (lset-difference eq? fields 'expected))) - (when (pair? unexpected) - (record-error 'name s "extraneous field initializers ~a" - unexpected))) + #`(make-struct type 0 + #,@(map (lambda (field index) + (or (field-inherited-value field) + #`(struct-ref #,orig-record + #,index))) + '(expected ...) + (iota (length '(expected ...)))))) - #`(make-struct type 0 - #,@(map (lambda (field index) - (or (field-inherited-value field) - #`(struct-ref #,orig-record - #,index))) - 'expected - (iota (length 'expected))))) + (define (thunked-field? f) + (memq (syntax->datum f) 'thunked)) - (define (thunked-field? f) - (memq (syntax->datum f) '#,thunked)) + (define (delayed-field? f) + (memq (syntax->datum f) 'delayed)) - (define (delayed-field? f) - (memq (syntax->datum f) '#,delayed)) + (define (wrap-field-value f value) + (cond ((thunked-field? f) + #`(lambda () #,value)) + ((delayed-field? f) + #`(delay #,value)) + (else value))) - (define (wrap-field-value f value) - (cond ((thunked-field? f) - #`(lambda () #,value)) - ((delayed-field? f) - #`(delay #,value)) - (else value))) + (define (field-bindings field+value) + ;; Return field to value bindings, for use in 'let*' below. + (map (lambda (field+value) + (syntax-case field+value () + ((field value) + #`(field + #,(wrap-field-value #'field #'value))))) + field+value)) - (define (field-bindings field+value) - ;; Return field to value bindings, for use in 'let*' below. - (map (lambda (field+value) - (syntax-case field+value () - ((field value) - #`(field - #,(wrap-field-value #'field #'value))))) - field+value)) + (syntax-case s (inherit expected ...) + ((_ (inherit orig-record) (field value) (... ...)) + #`(let* #,(field-bindings #'((field value) (... ...))) + #,(record-inheritance #'orig-record + #'((field value) (... ...))))) + ((_ (field value) (... ...)) + (let ((fields (map syntax->datum #'(field (... ...)))) + (dflt (map (match-lambda + ((f v) + (list (syntax->datum f) v))) + #'defaults))) - (syntax-case s (inherit #,@fields) - ((_ (inherit orig-record) (field value) (... ...)) - #`(let* #,(field-bindings #'((field value) (... ...))) - #,(record-inheritance #'orig-record - #'((field value) (... ...))))) - ((_ (field value) (... ...)) - (let ((fields (map syntax->datum #'(field (... ...)))) - (dflt (map (match-lambda - ((f v) - (list (syntax->datum f) v))) - #'defaults))) + (define (field-value f) + (or (and=> (find (lambda (x) + (eq? f (car (syntax->datum x)))) + #'((field value) (... ...))) + car) + (let ((value + (car (assoc-ref dflt (syntax->datum f))))) + (wrap-field-value f value)))) - (define (field-value f) - (or (and=> (find (lambda (x) - (eq? f (car (syntax->datum x)))) - #'((field value) (... ...))) - car) - (let ((value - (car (assoc-ref dflt (syntax->datum f))))) - (wrap-field-value f value)))) - - (let ((fields (append fields (map car dflt)))) - (cond ((lset= eq? fields 'expected) - #`(let* #,(field-bindings - #'((field value) (... ...))) - (ctor #,@(map field-value 'expected)))) - ((pair? (lset-difference eq? fields 'expected)) - (record-error 'name s - "extraneous field initializers ~a" - (lset-difference eq? fields - 'expected))) - (else - (record-error 'name s - "missing field initializers ~a" - (lset-difference eq? 'expected - fields))))))))))))) + (let ((fields (append fields (map car dflt)))) + (cond ((lset= eq? fields '(expected ...)) + #`(let* #,(field-bindings + #'((field value) (... ...))) + (ctor #,@(map field-value '(expected ...))))) + ((pair? (lset-difference eq? fields + '(expected ...))) + (record-error 'name s + "extraneous field initializers ~a" + (lset-difference eq? fields + '(expected ...)))) + (else + (record-error 'name s + "missing field initializers ~a" + (lset-difference eq? + '(expected ...) + fields))))))))))))) (define-syntax define-record-type* (lambda (s) @@ -279,11 +275,11 @@ field." field-spec* ...) (begin thunked-field-accessor ... delayed-field-accessor ...) - #,(make-syntactic-constructor #'type #'syntactic-ctor #'ctor - #'(field ...) - #:thunked thunked - #:delayed delayed - #:defaults defaults)))))))) + (make-syntactic-constructor type syntactic-ctor ctor + (field ...) + #:thunked #,thunked + #:delayed #,delayed + #:defaults #,defaults)))))))) (define* (alist->record alist make keys #:optional (multiple-value-keys '())) From b9c8647337762983ac046aec66328ad0efd2f276 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 11 Jun 2015 21:49:02 +0200 Subject: [PATCH 07/45] records: Separate default-value handling. * guix/records.scm (make-syntactic-constructor)[default-values]: New variable. [field-default-value]: New procedure. Use them. --- guix/records.scm | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/guix/records.scm b/guix/records.scm index 2378969843..f66fda8a32 100644 --- a/guix/records.scm +++ b/guix/records.scm @@ -91,6 +91,16 @@ fields, and DELAYED is the list of identifiers of delayed fields." #`(delay #,value)) (else value))) + (define default-values + ;; List of symbol/value tuples. + (map (match-lambda + ((f v) + (list (syntax->datum f) v))) + #'defaults)) + + (define (field-default-value f) + (car (assoc-ref default-values (syntax->datum f)))) + (define (field-bindings field+value) ;; Return field to value bindings, for use in 'let*' below. (map (lambda (field+value) @@ -106,22 +116,15 @@ fields, and DELAYED is the list of identifiers of delayed fields." #,(record-inheritance #'orig-record #'((field value) (... ...))))) ((_ (field value) (... ...)) - (let ((fields (map syntax->datum #'(field (... ...)))) - (dflt (map (match-lambda - ((f v) - (list (syntax->datum f) v))) - #'defaults))) - + (let ((fields (map syntax->datum #'(field (... ...))))) (define (field-value f) (or (and=> (find (lambda (x) (eq? f (car (syntax->datum x)))) #'((field value) (... ...))) car) - (let ((value - (car (assoc-ref dflt (syntax->datum f))))) - (wrap-field-value f value)))) + (wrap-field-value f (field-default-value f)))) - (let ((fields (append fields (map car dflt)))) + (let ((fields (append fields (map car default-values)))) (cond ((lset= eq? fields '(expected ...)) #`(let* #,(field-bindings #'((field value) (... ...))) From faef3b6a96114524c2a25e3b84caa042a2d2e598 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 11 Jun 2015 22:22:05 +0200 Subject: [PATCH 08/45] records: Factorize field property predicates. * guix/records.scm (define-field-property-predicate): New macro. (define-record-type*)[thunked-field?, delayed-field?]: Use it. --- guix/records.scm | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/guix/records.scm b/guix/records.scm index f66fda8a32..dbdd2201a6 100644 --- a/guix/records.scm +++ b/guix/records.scm @@ -142,6 +142,17 @@ fields, and DELAYED is the list of identifiers of delayed fields." '(expected ...) fields))))))))))))) +(define-syntax-rule (define-field-property-predicate predicate property) + "Define PREDICATE as a procedure that takes a syntax object and, when passed +a field specification, returns the field name if it has the given PROPERTY." + (define (predicate s) + (syntax-case s (property) + ((field (property values (... ...)) _ (... ...)) + #'field) + ((field _ properties (... ...)) + (predicate #'(field properties (... ...)))) + (_ #f)))) + (define-syntax define-record-type* (lambda (s) "Define the given record type such that an additional \"syntactic @@ -189,23 +200,8 @@ field." (field-default-value #'(field options ...))) (_ #f))) - (define (delayed-field? s) - ;; Return the field name if the field defined by S is delayed. - (syntax-case s (delayed) - ((field (delayed) _ ...) - #'field) - ((field _ options ...) - (delayed-field? #'(field options ...))) - (_ #f))) - - (define (thunked-field? s) - ;; Return the field name if the field defined by S is thunked. - (syntax-case s (thunked) - ((field (thunked) _ ...) - #'field) - ((field _ options ...) - (thunked-field? #'(field options ...))) - (_ #f))) + (define-field-property-predicate delayed-field? delayed) + (define-field-property-predicate thunked-field? thunked) (define (wrapped-field? s) (or (thunked-field? s) (delayed-field? s))) From 792798f48647ef664cfe6fdd7ff313901e383f6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 11 Jun 2015 22:26:18 +0200 Subject: [PATCH 09/45] =?UTF-8?q?records:=20"options"=20=E2=86=92=20"prope?= =?UTF-8?q?rties".?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * guix/records.scm (define-record-type*): Change "options" to "properties". --- guix/records.scm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/guix/records.scm b/guix/records.scm index dbdd2201a6..816e9f6f01 100644 --- a/guix/records.scm +++ b/guix/records.scm @@ -196,8 +196,8 @@ field." (syntax-case s (default) ((field (default val) _ ...) (list #'field #'val)) - ((field _ options ...) - (field-default-value #'(field options ...))) + ((field _ properties ...) + (field-default-value #'(field properties ...))) (_ #f))) (define-field-property-predicate delayed-field? delayed) @@ -210,7 +210,7 @@ field." ;; Return the name (an unhygienic syntax object) of the "real" ;; getter for field, which is assumed to be a wrapped field. (syntax-case field () - ((field get options ...) + ((field get properties ...) (let* ((getter (syntax->datum #'get)) (real-getter (symbol-append '% getter '-real))) (datum->syntax #'get real-getter))))) @@ -219,7 +219,7 @@ field." ;; Convert a field spec of our style to a SRFI-9 field spec of the ;; form (field get). (syntax-case field () - ((name get options ...) + ((name get properties ...) #`(name #,(if (wrapped-field? field) (wrapped-field-accessor-name field) @@ -247,12 +247,12 @@ field." (syntax-case s () ((_ type syntactic-ctor ctor pred - (field get options ...) ...) - (let* ((field-spec #'((field get options ...) ...)) + (field get properties ...) ...) + (let* ((field-spec #'((field get properties ...) ...)) (thunked (filter-map thunked-field? field-spec)) (delayed (filter-map delayed-field? field-spec)) (defaults (filter-map field-default-value - #'((field options ...) ...)))) + #'((field properties ...) ...)))) (with-syntax (((field-spec* ...) (map field-spec->srfi-9 field-spec)) ((thunked-field-accessor ...) From 8a16d064fa265c449d136ff6c3d3267e314cde8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 11 Jun 2015 22:57:33 +0200 Subject: [PATCH 10/45] records: Add support for 'innate' fields. * guix/records.scm (make-syntactic-constructor): Add #:innate parameter. [record-inheritance]: Honor it. [innate-field?]: New procedure. (define-record-type*)[innate-field?]: New procedure. Pass #:innate to 'make-syntactic-constructor'. * tests/records.scm ("define-record-type* & inherit & innate", "define-record-type* & thunked & innate"): New tests. --- guix/records.scm | 20 ++++++++++++++++---- tests/records.scm | 30 ++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 4 deletions(-) diff --git a/guix/records.scm b/guix/records.scm index 816e9f6f01..b68aaae1c4 100644 --- a/guix/records.scm +++ b/guix/records.scm @@ -51,6 +51,7 @@ fields, and DELAYED is the list of identifiers of delayed fields." ((_ type name ctor (expected ...) #:thunked thunked #:delayed delayed + #:innate innate #:defaults defaults) (define-syntax name (lambda (s) @@ -73,8 +74,11 @@ fields, and DELAYED is the list of identifiers of delayed fields." #`(make-struct type 0 #,@(map (lambda (field index) (or (field-inherited-value field) - #`(struct-ref #,orig-record - #,index))) + (if (innate-field? field) + (wrap-field-value + field (field-default-value field)) + #`(struct-ref #,orig-record + #,index)))) '(expected ...) (iota (length '(expected ...)))))) @@ -84,6 +88,9 @@ fields, and DELAYED is the list of identifiers of delayed fields." (define (delayed-field? f) (memq (syntax->datum f) 'delayed)) + (define (innate-field? f) + (memq (syntax->datum f) 'innate)) + (define (wrap-field-value f value) (cond ((thunked-field? f) #`(lambda () #,value)) @@ -164,7 +171,8 @@ may look like this: thing? (name thing-name (default \"chbouib\")) (port thing-port - (default (current-output-port)) (thunked))) + (default (current-output-port)) (thunked)) + (loc thing-location (innate) (default (current-source-location)))) This example defines a macro 'thing' that can be used to instantiate records of this type: @@ -190,7 +198,8 @@ It is possible to copy an object 'x' created with 'thing' like this: (thing (inherit x) (name \"bar\")) This expression returns a new object equal to 'x' except for its 'name' -field." +field and its 'loc' field---the latter is marked as \"innate\", so it is not +inherited." (define (field-default-value s) (syntax-case s (default) @@ -202,6 +211,7 @@ field." (define-field-property-predicate delayed-field? delayed) (define-field-property-predicate thunked-field? thunked) + (define-field-property-predicate innate-field? innate) (define (wrapped-field? s) (or (thunked-field? s) (delayed-field? s))) @@ -251,6 +261,7 @@ field." (let* ((field-spec #'((field get properties ...) ...)) (thunked (filter-map thunked-field? field-spec)) (delayed (filter-map delayed-field? field-spec)) + (innate (filter-map innate-field? field-spec)) (defaults (filter-map field-default-value #'((field properties ...) ...)))) (with-syntax (((field-spec* ...) @@ -278,6 +289,7 @@ field." (field ...) #:thunked #,thunked #:delayed #,delayed + #:innate #,innate #:defaults #,defaults)))))))) (define* (alist->record alist make keys diff --git a/tests/records.scm b/tests/records.scm index a00e38db7d..6346c154cd 100644 --- a/tests/records.scm +++ b/tests/records.scm @@ -90,6 +90,20 @@ (match b (($ 1 2) #t)) (equal? b c))))) +(test-assert "define-record-type* & inherit & innate" + (begin + (define-record-type* foo make-foo + foo? + (bar foo-bar (innate) (default 42))) + (let* ((a (foo (bar 1))) + (b (foo (inherit a))) + (c (foo (inherit a) (bar 3))) + (d (foo))) + (and (match a (($ 1) #t)) + (match b (($ 42) #t)) + (match c (($ 3) #t)) + (match d (($ 42) #t)))))) + (test-assert "define-record-type* & thunked" (begin (define-record-type* foo make-foo @@ -139,6 +153,22 @@ (parameterize ((mark (cons 'a 'b))) (eq? (foo-baz y) (mark)))))))) +(test-assert "define-record-type* & thunked & innate" + (let ((mark (make-parameter #f))) + (define-record-type* foo make-foo + foo? + (bar foo-bar (thunked) (innate) (default (mark))) + (baz foo-baz (default #f))) + + (let* ((x (foo (bar 42))) + (y (foo (inherit x) (baz 'unused)))) + (and (procedure? (struct-ref x 0)) + (equal? (foo-bar x) 42) + (parameterize ((mark (cons 'a 'b))) + (eq? (foo-bar y) (mark))) + (parameterize ((mark (cons 'a 'b))) + (eq? (foo-bar y) (mark))))))) + (test-assert "define-record-type* & delayed" (begin (define-record-type* foo make-foo From 0004c5904c2e69a89005eac8b6322d18a8e9f611 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 11 Jun 2015 23:06:06 +0200 Subject: [PATCH 11/45] packages: Make 'location' field innate. * guix/packages.scm ()[location]: Add 'innate' property. * guix/build-system/gnu.scm (static-package): Remove 'loc' parameter and 'location' field. * gnu/packages/autotools.scm (autoconf-wrapper): Remove 'location' field. * gnu/packages/commencement.scm (gnu-make-boot0, diffutils-boot0, gcc-final): Likewise. * gnu/packages/cross-base.scm (cross): Likewise. * gnu/packages/emacs.scm (emacs-no-x, emacs-no-x-toolkit): Likewise. * gnu/packages/make-bootstrap.scm (tarball-package): Likewise. * gnu/packages/maths.scm (petsc-complex): Likewise. --- gnu/packages/autotools.scm | 1 - gnu/packages/commencement.scm | 3 --- gnu/packages/cross-base.scm | 1 - gnu/packages/emacs.scm | 2 -- gnu/packages/make-bootstrap.scm | 3 +-- gnu/packages/maths.scm | 1 - guix/build-system/gnu.scm | 4 +--- guix/packages.scm | 3 ++- 8 files changed, 4 insertions(+), 14 deletions(-) diff --git a/gnu/packages/autotools.scm b/gnu/packages/autotools.scm index 24ff90cc5c..f2b4d95b95 100644 --- a/gnu/packages/autotools.scm +++ b/gnu/packages/autotools.scm @@ -95,7 +95,6 @@ use our own Bash instead of /bin/sh in shebangs. For that reason, it should only be used internally---users should not end up distributing `configure' files with a system-specific shebang." (package (inherit autoconf) - (location (source-properties->location (current-source-location))) (name (string-append (package-name autoconf) "-wrapper")) (build-system trivial-build-system) (inputs `(("guile" diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm index 9611ff2620..a5402f0556 100644 --- a/gnu/packages/commencement.scm +++ b/gnu/packages/commencement.scm @@ -65,7 +65,6 @@ (package-with-bootstrap-guile (package (inherit gnu-make) (name "make-boot0") - (location (source-properties->location (current-source-location))) (arguments `(#:guile ,%bootstrap-guile #:implicit-inputs? #f @@ -93,7 +92,6 @@ ,@%bootstrap-inputs) #:guile %bootstrap-guile))) (package (inherit p) - (location (source-properties->location (current-source-location))) (arguments `(#:tests? #f ; the test suite needs diffutils ,@(package-arguments p))))))) @@ -531,7 +529,6 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%" ;; The final GCC. (package (inherit gcc-boot0) (name "gcc") - (location (source-properties->location (current-source-location))) (arguments `(#:guile ,%bootstrap-guile #:implicit-inputs? #f diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm index 9a459400e8..f1aca505d8 100644 --- a/gnu/packages/cross-base.scm +++ b/gnu/packages/cross-base.scm @@ -38,7 +38,6 @@ (define (cross p target) (package (inherit p) - (location (source-properties->location (current-source-location))) (name (string-append (package-name p) "-cross-" target)) (arguments (substitute-keyword-arguments (package-arguments p) diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm index fbddff1cf6..0f71c77bf2 100644 --- a/gnu/packages/emacs.scm +++ b/gnu/packages/emacs.scm @@ -123,7 +123,6 @@ languages.") ;; This is the version that you should use as an input to packages that just ;; need to byte-compile .el files. (package (inherit emacs) - (location (source-properties->location (current-source-location))) (name "emacs-no-x") (synopsis "The extensible, customizable, self-documenting text editor (console only)") @@ -138,7 +137,6 @@ editor (console only)") (define-public emacs-no-x-toolkit (package (inherit emacs) - (location (source-properties->location (current-source-location))) (name "emacs-no-x-toolkit") (synopsis "The extensible, customizable, self-documenting text editor (without an X toolkit)" ) diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm index 88fad0e604..7f1b6d50b0 100644 --- a/gnu/packages/make-bootstrap.scm +++ b/gnu/packages/make-bootstrap.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013, 2014 Ludovic Courtès +;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -605,7 +605,6 @@ for `sh' in $PATH, and without nscd, and with static NSS modules." (define (tarball-package pkg) "Return a package containing a tarball of PKG." (package (inherit pkg) - (location (source-properties->location (current-source-location))) (name (string-append (package-name pkg) "-tarball")) (build-system trivial-build-system) (native-inputs `(("tar" ,tar) diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index 4d837c85e2..6fbe6fd27d 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -560,7 +560,6 @@ scientific applications modeled by partial differential equations.") (define-public petsc-complex (package (inherit petsc) - (location (source-properties->location (current-source-location))) (name "petsc-complex") (arguments (substitute-keyword-arguments (package-arguments petsc) diff --git a/guix/build-system/gnu.scm b/guix/build-system/gnu.scm index da664e5422..05b6e6f680 100644 --- a/guix/build-system/gnu.scm +++ b/guix/build-system/gnu.scm @@ -160,12 +160,10 @@ flags for VARIABLE, the associated value is augmented." "A version of P linked with `-static-gcc'." (package-with-extra-configure-variable p "LDFLAGS" "-static-libgcc")) -(define* (static-package p #:optional (loc (current-source-location)) - #:key (strip-all? #t)) +(define* (static-package p #:key (strip-all? #t)) "Return a statically-linked version of package P. If STRIP-ALL? is true, use `--strip-all' as the arguments to `strip'." (package (inherit p) - (location (source-properties->location loc)) (arguments (let ((a (default-keyword-arguments (package-arguments p) '(#:configure-flags '() diff --git a/guix/packages.scm b/guix/packages.scm index c955b35155..c900541e53 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -240,7 +240,8 @@ representation." (location package-location (default (and=> (current-source-location) - source-properties->location)))) + source-properties->location)) + (innate))) (set-record-type-printer! (lambda (package port) From e21adc768e7e40362a26b60e73ecc30e988d79e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 11 Jun 2015 23:10:26 +0200 Subject: [PATCH 12/45] gnu: guix: Update snapshot. * gnu/packages/package-management.scm (guix-devel): Update to a43b55f. [source]: Add 'file-name' field. [native-inputs]: Add HELP2MAN. --- gnu/packages/package-management.scm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm index db05969139..a2c74c2fe6 100644 --- a/gnu/packages/package-management.scm +++ b/gnu/packages/package-management.scm @@ -38,6 +38,7 @@ #:use-module (gnu packages perl) #:use-module (gnu packages curl) #:use-module (gnu packages web) + #:use-module (gnu packages man) #:use-module (gnu packages emacs) #:use-module (gnu packages openssl) #:use-module (gnu packages bdw-gc)) @@ -150,7 +151,7 @@ the Nix package manager.") ;; ;; Note: use a short commit id; when using the long one, the limit on socket ;; file names is exceeded while running the tests. - (let ((commit "c2ee19e")) + (let ((commit "a43b55f")) (package (inherit guix-0.8.2) (version (string-append "0.8.2." commit)) (source (origin @@ -160,7 +161,8 @@ the Nix package manager.") (commit commit))) (sha256 (base32 - "1gwc1gypgscxg2m3n2vd0mw4dmxr7vsisqgh3y0lr05q9z5742sj")))) + "1r0l8gfh5nxc1j0sqj8ywkg280k9qbj7zsk33z84rvl7l0nwnk88")) + (file-name (string-append "guix-" version "-checkout")))) (arguments (substitute-keyword-arguments (package-arguments guix-0.8.2) ((#:phases phases) @@ -180,6 +182,7 @@ the Nix package manager.") ("gettext" ,gnu-gettext) ("texinfo" ,texinfo) ("graphviz" ,graphviz) + ("help2man" ,help2man) ,@(package-native-inputs guix-0.8.2)))))) (define-public guix guix-devel) From 79477def6b08437e4eacaf67c012ae8717bd64e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 11 Jun 2015 23:17:16 +0200 Subject: [PATCH 13/45] tests: Write the random seed to the error port. * guix/tests.scm (random-seed): New procedure. (%seed): Use it, and write the random seed to the error port. --- guix/tests.scm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/guix/tests.scm b/guix/tests.scm index 87e6cc2830..a19eda250c 100644 --- a/guix/tests.scm +++ b/guix/tests.scm @@ -63,8 +63,16 @@ store))) +(define (random-seed) + (or (and=> (getenv "GUIX_TESTS_RANDOM_SEED") + number->string) + (logxor (getpid) (car (gettimeofday))))) + (define %seed - (seed->random-state (logxor (getpid) (car (gettimeofday))))) + (let ((seed (random-seed))) + (format (current-error-port) "random seed for tests: ~a~%" + seed) + (seed->random-state seed))) (define (random-text) "Return the hexadecimal representation of a random number." From ad7c1a2cde80c00f0394a48c0c2be0a478900eb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 11 Jun 2015 23:28:13 +0200 Subject: [PATCH 14/45] records: Remove unnecessary 'begin'. * guix/records.scm (define-record-type*): Remove unnecessary 'begin'. --- guix/records.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/guix/records.scm b/guix/records.scm index b68aaae1c4..0d35a747b0 100644 --- a/guix/records.scm +++ b/guix/records.scm @@ -283,8 +283,8 @@ inherited." (ctor field ...) pred field-spec* ...) - (begin thunked-field-accessor ... - delayed-field-accessor ...) + thunked-field-accessor ... + delayed-field-accessor ... (make-syntactic-constructor type syntactic-ctor ctor (field ...) #:thunked #,thunked From 6c356414537fa8394b140b6593ce31df93e4a69d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 11 Jun 2015 23:28:31 +0200 Subject: [PATCH 15/45] tests: Avoid sequence of zero expressions. * tests/records.scm ("define-record-type* with let* behavior"): Add missing body for clause. --- tests/records.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/records.scm b/tests/records.scm index 6346c154cd..800ed03827 100644 --- a/tests/records.scm +++ b/tests/records.scm @@ -56,7 +56,7 @@ (and (match (bar (x 1) (y (+ x 1)) (z (* y 2))) (($ 1 2 4) #t)) (match (bar (x 7) (z (* x 3))) - (($ 7 42 21))) + (($ 7 42 21) #t)) (match (bar (z 21) (x (/ z 3))) (($ 7 42 21) #t))))) From 4f467e33de0b64b1afd935d14ec6a4839e03bdfc Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Fri, 12 Jun 2015 01:24:58 -0400 Subject: [PATCH 16/45] gnu: openssl: Update to 1.0.2b. * gnu/packages/openssl.scm (openssl): Update to 1.0.2b. --- gnu/packages/openssl.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/openssl.scm b/gnu/packages/openssl.scm index 1ed7a7a1f2..f55e54465c 100644 --- a/gnu/packages/openssl.scm +++ b/gnu/packages/openssl.scm @@ -29,14 +29,14 @@ (define-public openssl (package (name "openssl") - (version "1.0.2a") + (version "1.0.2b") (source (origin (method url-fetch) (uri (string-append "ftp://ftp.openssl.org/source/openssl-" version ".tar.gz")) (sha256 (base32 - "0jijgzf72659pikms2bc5w31h78xrd1h5zp2r01an2h340y3kdhm")) + "0gwf4fy1yqmai6wph0g9lh09iarwxaa70hm7jm0rf1qakz68im6m")) (patches (list (search-patch "openssl-runpath.patch"))))) (build-system gnu-build-system) (native-inputs `(("perl" ,perl))) From dc7b1817f6f75fa7e69b7675c313095cc1fddc63 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Fri, 12 Jun 2015 01:46:03 -0400 Subject: [PATCH 17/45] Revert "gnu: openssl: Update to 1.0.2b." This reverts commit 4f467e33de0b64b1afd935d14ec6a4839e03bdfc. --- gnu/packages/openssl.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/openssl.scm b/gnu/packages/openssl.scm index f55e54465c..1ed7a7a1f2 100644 --- a/gnu/packages/openssl.scm +++ b/gnu/packages/openssl.scm @@ -29,14 +29,14 @@ (define-public openssl (package (name "openssl") - (version "1.0.2b") + (version "1.0.2a") (source (origin (method url-fetch) (uri (string-append "ftp://ftp.openssl.org/source/openssl-" version ".tar.gz")) (sha256 (base32 - "0gwf4fy1yqmai6wph0g9lh09iarwxaa70hm7jm0rf1qakz68im6m")) + "0jijgzf72659pikms2bc5w31h78xrd1h5zp2r01an2h340y3kdhm")) (patches (list (search-patch "openssl-runpath.patch"))))) (build-system gnu-build-system) (native-inputs `(("perl" ,perl))) From 84de458ba8c6499dd63c6d7e7c67087df339e371 Mon Sep 17 00:00:00 2001 From: Eric Bavier Date: Sat, 6 Jun 2015 06:38:58 -0500 Subject: [PATCH 18/45] profiles: Search for ghc conf files only if package db exists. This avoids having 'find-files' report warnings about searching in non-existent directories. * guix/profiles.scm (ghc-package-cache-file)[conf-files]: Only search for *.conf files if the search directory exists. --- guix/profiles.scm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/guix/profiles.scm b/guix/profiles.scm index 28150affb6..33a0511a3a 100644 --- a/guix/profiles.scm +++ b/guix/profiles.scm @@ -500,7 +500,10 @@ entries of MANIFEST, or #f if MANIFEST does not have any GHC packages." (string-append #$output "/" db-subdir)) (define (conf-files top) - (find-files (string-append top "/" db-subdir) "\\.conf$")) + (let ((db (string-append top "/" db-subdir))) + (if (file-exists? db) + (find-files db "\\.conf$") + '()))) (define (copy-conf-file conf) (let ((base (basename conf))) From b4b1fe9d2f7321a95fa16d18a5f0088908122361 Mon Sep 17 00:00:00 2001 From: Eric Bavier Date: Sat, 6 Jun 2015 06:43:19 -0500 Subject: [PATCH 19/45] profiles: Process ghc conf files only once. A package may be listed in the manifest inputs multiple times. Avoid copying ghc *.conf files twice by deleting duplicates. * guix/profiles.scm (ghc-package-cache-file)[conf-files]: Delete duplicate manifest inputs before copying conf files. --- guix/profiles.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/guix/profiles.scm b/guix/profiles.scm index 33a0511a3a..5c19c95d42 100644 --- a/guix/profiles.scm +++ b/guix/profiles.scm @@ -512,7 +512,8 @@ entries of MANIFEST, or #f if MANIFEST does not have any GHC packages." (system* (string-append #+ghc "/bin/ghc-pkg") "init" db-dir) (for-each copy-conf-file (append-map conf-files - '#$(manifest-inputs manifest))) + (delete-duplicates + '#$(manifest-inputs manifest)))) (let ((success (zero? (system* (string-append #+ghc "/bin/ghc-pkg") "recache" From 6508ce55e95b0472b2212befcb56919eb44fb41c Mon Sep 17 00:00:00 2001 From: Eric Bavier Date: Sat, 6 Jun 2015 07:28:57 -0500 Subject: [PATCH 20/45] build-system/haskell: install config for any package that creates it. A Cabal package is allowed to declare an "empty" library, in an otherwise executable-only package, for the purpose of allowing Cabal to use it as a dependency for other packages. See e.g. hspec-discover. * guix/build/haskell-build-system.scm (register): Unconditionally call setup script with "register", and install any config file generated. --- guix/build/haskell-build-system.scm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/guix/build/haskell-build-system.scm b/guix/build/haskell-build-system.scm index d382ee403d..c0cb789581 100644 --- a/guix/build/haskell-build-system.scm +++ b/guix/build/haskell-build-system.scm @@ -166,13 +166,13 @@ generate the cache as it would clash in user profiles." (package-name-version haskell) "/package.conf.d")) (id-rx (make-regexp "^id: *(.*)$")) - (lib-rx (make-regexp "lib.*\\.(a|so)")) - (config-file (string-append config-dir "/" name ".conf")) + (config-file (string-append out "/" name ".conf")) (params (list (string-append "--gen-pkg-config=" config-file)))) - (unless (null? (find-files lib lib-rx)) + (run-setuphs "register" params) + ;; The conf file is created only when there is a library to register. + (when (file-exists? config-file) (mkdir-p config-dir) - (run-setuphs "register" params) (let ((config-file-name+id (call-with-ascii-input-file config-file (cut grep id-rx <>)))) (rename-file config-file From 48d21d6cd600cabc147cfec243518931bbc3169a Mon Sep 17 00:00:00 2001 From: Eric Bavier Date: Thu, 11 Jun 2015 17:51:47 -0500 Subject: [PATCH 21/45] gnu: ghc: Patch runtime references to /bin/sh. * gnu/packages/haskell.scm (ghc)[arguments]: Rename 'unpack-and-fix-testsuite' phase to 'unpack-testsuite-and-fix-bins'. Patch source files that reference /bin/sh. --- gnu/packages/haskell.scm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm index ac87de540e..75bbb24479 100644 --- a/gnu/packages/haskell.scm +++ b/gnu/packages/haskell.scm @@ -144,7 +144,7 @@ (ghc-bootstrap-prefix (string-append ghc-bootstrap-path "/usr" ))) (alist-cons-after - 'unpack-bin 'unpack-and-fix-testsuite + 'unpack-bin 'unpack-testsuite-and-fix-bins (lambda* (#:key inputs outputs #:allow-other-keys) (with-directory-excursion ".." (copy-file (assoc-ref inputs "ghc-testsuite") @@ -155,7 +155,9 @@ "testsuite/timeout/timeout.py" "testsuite/timeout/timeout.hs" "testsuite/tests/rename/prog006/Setup.lhs" - "testsuite/tests/programs/life_space_leak/life.test") + "testsuite/tests/programs/life_space_leak/life.test" + "libraries/process/System/Process/Internals.hs" + "libraries/unix/cbits/execvpe.c") (("/bin/sh") (which "sh")) (("/bin/rm") "rm")) #t) From e0a02cb21f7758f5e60f518f9ee115b64aac74da Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Mon, 1 Jun 2015 12:09:44 +0200 Subject: [PATCH 22/45] gnu: ngs-sdk: Update to version 1.1.1. * gnu/packages/bioinformatics.scm (ngs-sdk): Update to version 1.1.1. --- gnu/packages/bioinformatics.scm | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm index c7836f173e..1334600af6 100644 --- a/gnu/packages/bioinformatics.scm +++ b/gnu/packages/bioinformatics.scm @@ -1331,7 +1331,7 @@ viewer.") (define-public ngs-sdk (package (name "ngs-sdk") - (version "1.1.0") + (version "1.1.1") (source (origin (method url-fetch) @@ -1341,7 +1341,7 @@ viewer.") (file-name (string-append name "-" version ".tar.gz")) (sha256 (base32 - "09fakv9w87lfg9g70kwzmnryqdjj1sz2c7kw01i6drjf787gkjhw")))) + "1x58gpm574n0xmk2a98gmikbgycq78ia0bvnb42k5ck34fmd5v8y")))) (build-system gnu-build-system) (arguments `(#:parallel-build? #f ; not supported @@ -1351,20 +1351,6 @@ viewer.") 'configure (lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) - ;; Only replace the version suffix, not the version number in the - ;; directory name; fixed in commit 46d4509fa8 (no release yet). - (substitute* "setup/konfigure.perl" - (((string-append "\\$\\(subst " - "(\\$\\(VERSION[^\\)]*\\))," - "(\\$\\([^\\)]+\\))," - "(\\$\\([^\\)]+\\)|\\$\\@)" - "\\)") - _ pattern replacement target) - (string-append "$(patsubst " - "%" pattern "," - "%" replacement "," - target ")"))) - ;; The 'configure' script doesn't recognize things like ;; '--enable-fast-install'. (zero? (system* "./configure" From 741115b6490c111f9db7b86964b13bdb22fd6dd0 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 28 May 2015 15:53:14 +0200 Subject: [PATCH 23/45] gnu: Add libsvm. * gnu/packages/machine-learning.scm: New file. * gnu-system.am (GNU_SYSTEM_MODULES): Add it. --- gnu-system.am | 1 + gnu/packages/machine-learning.scm | 65 +++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 gnu/packages/machine-learning.scm diff --git a/gnu-system.am b/gnu-system.am index 978e839bfa..d79c2c7917 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -196,6 +196,7 @@ GNU_SYSTEM_MODULES = \ gnu/packages/lxqt.scm \ gnu/packages/lynx.scm \ gnu/packages/m4.scm \ + gnu/packages/machine-learning.scm \ gnu/packages/man.scm \ gnu/packages/mail.scm \ gnu/packages/make-bootstrap.scm \ diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm new file mode 100644 index 0000000000..78d7e649a9 --- /dev/null +++ b/gnu/packages/machine-learning.scm @@ -0,0 +1,65 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2015 Ricardo Wurmus +;;; +;;; 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 (gnu packages machine-learning) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages) + #:use-module (guix utils) + #:use-module (guix download) + #:use-module (guix build-system gnu) + #:use-module (gnu packages)) + +(define-public libsvm + (package + (name "libsvm") + (version "3.20") + (source + (origin + (method url-fetch) + (uri (string-append + "https://github.com/cjlin1/libsvm/archive/v" + (string-delete #\. version) ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "1jpjlql3frjza7zxzrqqr2firh44fjb8fqsdmvz6bjz7sb47zgp4")))) + (build-system gnu-build-system) + (arguments + `(#:tests? #f ;no "check" target + #:phases (modify-phases %standard-phases + (delete 'configure) + (replace + 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin/"))) + (mkdir-p bin) + (for-each (lambda (file) + (copy-file file (string-append bin file))) + '("svm-train" + "svm-predict" + "svm-scale"))) + #t))))) + (home-page "http://www.csie.ntu.edu.tw/~cjlin/libsvm/") + (synopsis "Library for Support Vector Machines") + (description + "LIBSVM is a machine learning library for support vector +classification, (C-SVC, nu-SVC), regression (epsilon-SVR, nu-SVR) and +distribution estimation (one-class SVM). It supports multi-class +classification.") + (license license:bsd-3))) From 71f80f548741fa61fa3bc2039c296feb1a25d4de Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Tue, 2 Jun 2015 15:10:37 +0200 Subject: [PATCH 24/45] gnu: Add python-libsvm. * gnu/packages/machine-learning.scm (python-libsvm): New variable. --- gnu/packages/machine-learning.scm | 35 ++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index 78d7e649a9..b35e9b72c6 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -22,7 +22,8 @@ #:use-module (guix utils) #:use-module (guix download) #:use-module (guix build-system gnu) - #:use-module (gnu packages)) + #:use-module (gnu packages) + #:use-module (gnu packages python)) (define-public libsvm (package @@ -63,3 +64,35 @@ classification, (C-SVC, nu-SVC), regression (epsilon-SVR, nu-SVR) and distribution estimation (one-class SVM). It supports multi-class classification.") (license license:bsd-3))) + +(define-public python-libsvm + (package (inherit libsvm) + (name "python-libsvm") + (build-system gnu-build-system) + (arguments + `(#:tests? #f ;no "check" target + #:make-flags '("-C" "python") + #:phases + (modify-phases %standard-phases + (delete 'configure) + (replace + 'install + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((site (string-append (assoc-ref outputs "out") + "/lib/python" + (string-take + (string-take-right + (assoc-ref inputs "python") 5) 3) + "/site-packages/"))) + (substitute* "python/svm.py" + (("../libsvm.so.2") "libsvm.so.2")) + (mkdir-p site) + (for-each (lambda (file) + (copy-file file (string-append site (basename file)))) + (find-files "python" "\\.py")) + (copy-file "libsvm.so.2" + (string-append site "libsvm.so.2"))) + #t))))) + (inputs + `(("python" ,python))) + (synopsis "Python bindings of libSVM"))) From 0931c6091ccf028b9556c0c3d7e1e3157034b97d Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Tue, 2 Jun 2015 15:47:22 +0200 Subject: [PATCH 25/45] gnu: Add randomjungle. * gnu/packages/machine-learning.scm (randomjungle): New variable. --- gnu/packages/machine-learning.scm | 50 ++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index b35e9b72c6..cfeb1daf63 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -23,7 +23,12 @@ #:use-module (guix download) #:use-module (guix build-system gnu) #:use-module (gnu packages) - #:use-module (gnu packages python)) + #:use-module (gnu packages boost) + #:use-module (gnu packages compression) + #:use-module (gnu packages gcc) + #:use-module (gnu packages maths) + #:use-module (gnu packages python) + #:use-module (gnu packages xml)) (define-public libsvm (package @@ -96,3 +101,46 @@ classification.") (inputs `(("python" ,python))) (synopsis "Python bindings of libSVM"))) + +(define-public randomjungle + (package + (name "randomjungle") + (version "2.1.0") + (source + (origin + (method url-fetch) + (uri (string-append + "http://www.imbs-luebeck.de/imbs/sites/default/files/u59/" + "randomjungle-" version ".tar_.gz")) + (sha256 + (base32 + "12c8rf30cla71swx2mf4ww9mfd8jbdw5lnxd7dxhyw1ygrvg6y4w")))) + (build-system gnu-build-system) + (arguments + `(#:configure-flags + (list (string-append "--with-boost=" + (assoc-ref %build-inputs "boost"))) + #:phases + (modify-phases %standard-phases + (add-before + 'configure 'set-CXXFLAGS + (lambda _ + (setenv "CXXFLAGS" "-fpermissive ") + #t))))) + (inputs + `(("boost" ,boost) + ("gsl" ,gsl) + ("libxml2" ,libxml2) + ("zlib" ,zlib))) + (native-inputs + `(("gfortran" ,gfortran-4.8))) + (home-page "http://www.imbs-luebeck.de/imbs/de/node/227/") + (synopsis "Implementation of the Random Forests machine learning method") + (description + "Random Jungle is an implementation of Random Forests. It is supposed to +analyse high dimensional data. In genetics, it can be used for analysing big +Genome Wide Association (GWA) data. Random Forests is a powerful machine +learning method. Most interesting features are variable selection, missing +value imputation, classifier creation, generalization error estimation and +sample proximities between pairs of cases.") + (license license:gpl3+))) From 36742f438939fc30c8ebd71400218e31540e8acb Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 3 Jun 2015 12:56:16 +0200 Subject: [PATCH 26/45] gnu: Add Couger. * gnu/packages/bioinformatics.scm (couger): New variable. --- gnu/packages/bioinformatics.scm | 71 +++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm index 1334600af6..df627fbe48 100644 --- a/gnu/packages/bioinformatics.scm +++ b/gnu/packages/bioinformatics.scm @@ -34,6 +34,7 @@ #:use-module (gnu packages file) #:use-module (gnu packages java) #:use-module (gnu packages linux) + #:use-module (gnu packages machine-learning) #:use-module (gnu packages maths) #:use-module (gnu packages ncurses) #:use-module (gnu packages perl) @@ -438,6 +439,76 @@ multiple sequence alignments.") "CLIPper is a tool to define peaks in CLIP-seq datasets.") (license license:gpl2))) +(define-public couger + (package + (name "couger") + (version "1.8.2") + (source (origin + (method url-fetch) + (uri (string-append + "http://couger.oit.duke.edu/static/assets/COUGER" + version ".zip")) + (sha256 + (base32 + "04p2b14nmhzxw5h72mpzdhalv21bx4w9b87z0wpw0xzxpysyncmq")))) + (build-system gnu-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (delete 'configure) + (delete 'build) + (replace + 'install + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (copy-recursively "src" (string-append out "/src")) + (mkdir (string-append out "/bin")) + ;; Add "src" directory to module lookup path. + (substitute* "couger" + (("from argparse") + (string-append "import sys\nsys.path.append(\"" + out "\")\nfrom argparse"))) + (copy-file "couger" (string-append out "/bin/couger"))) + #t)) + (add-after + 'install 'wrap-program + (lambda* (#:key inputs outputs #:allow-other-keys) + ;; Make sure 'couger' runs with the correct PYTHONPATH. + (let* ((out (assoc-ref outputs "out")) + (path (getenv "PYTHONPATH"))) + (wrap-program (string-append out "/bin/couger") + `("PYTHONPATH" ":" prefix (,path)))) + #t))))) + (inputs + `(("python" ,python-2) + ("python2-pillow" ,python2-pillow) + ("python2-numpy" ,python2-numpy) + ("python2-scipy" ,python2-scipy) + ("python2-matplotlib" ,python2-matplotlib))) + (propagated-inputs + `(("r" ,r) + ("libsvm" ,libsvm) + ("randomjungle" ,randomjungle))) + (native-inputs + `(("unzip" ,unzip))) + (home-page "http://couger.oit.duke.edu") + (synopsis "Identify co-factors in sets of genomic regions") + (description + "COUGER can be applied to any two sets of genomic regions bound by +paralogous TFs (e.g., regions derived from ChIP-seq experiments) to identify +putative co-factors that provide specificity to each TF. The framework +determines the genomic targets uniquely-bound by each TF, and identifies a +small set of co-factors that best explain the in vivo binding differences +between the two TFs. + +COUGER uses classification algorithms (support vector machines and random +forests) with features that reflect the DNA binding specificities of putative +co-factors. The features are generated either from high-throughput TF-DNA +binding data (from protein binding microarray experiments), or from large +collections of DNA motifs.") + (license license:gpl3+))) + (define-public clustal-omega (package (name "clustal-omega") From 47da6268c45796d858eccff601e17ce11a7aeb62 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Tue, 9 Jun 2015 12:53:23 +0200 Subject: [PATCH 27/45] gnu: icedtea7: Bootstrap with GCJ. * gnu/packages/java.scm (icedtea7): Bootstrap with GCJ rather than compile with IcedTea6. --- gnu/packages/java.scm | 71 ++++++++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 35 deletions(-) diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index ea8de9e2cf..aa8cd2cf51 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -610,6 +610,9 @@ build process and its dependencies, whereas Make uses Makefile format.") (modules '((guix build utils))) (snippet '(substitute* "Makefile.in" + ;; link against libgcj to avoid linker error + (("-o native-ecj") + "-lgcj -o native-ecj") ;; do not leak information about the build host (("DISTRIBUTION_ID=\"\\$\\(DIST_ID\\)\"") "DISTRIBUTION_ID=\"\\\"guix\\\"\""))))) @@ -627,15 +630,7 @@ build process and its dependencies, whereas Make uses Makefile format.") #:locale "C" ,@(substitute-keyword-arguments (package-arguments icedtea6) ((#:configure-flags flags) - `(let ((jdk (assoc-ref %build-inputs "icedtea6")) - (ant (assoc-ref %build-inputs "ant"))) - `("--disable-bootstrap" - "--without-rhino" - "--enable-nss" - "--enable-system-lcms" - "--disable-downloading" - ,(string-append "--with-ant-home=" ant) - ,(string-append "--with-jdk-home=" jdk)))) + `(delete "--with-openjdk-src-dir=./openjdk" ,flags)) ((#:phases phases) `(modify-phases ,phases (replace @@ -677,30 +672,37 @@ build process and its dependencies, whereas Make uses Makefile format.") (replace 'set-additional-paths (lambda* (#:key inputs #:allow-other-keys) - (substitute* "openjdk/jdk/make/common/shared/Sanity.gmk" - (("ALSA_INCLUDE=/usr/include/alsa/version.h") - (string-append "ALSA_INCLUDE=" - (assoc-ref inputs "alsa-lib") - "/include/alsa/version.h"))) - (setenv "CC" "gcc") - (setenv "CPATH" - (string-append (assoc-ref inputs "libxrender") - "/include/X11/extensions" ":" - (assoc-ref inputs "libxtst") - "/include/X11/extensions" ":" - (assoc-ref inputs "libxinerama") - "/include/X11/extensions" ":" - (or (getenv "CPATH") ""))) - (setenv "ALT_OBJCOPY" (which "objcopy")) - (setenv "ALT_CUPS_HEADERS_PATH" - (string-append (assoc-ref inputs "cups") - "/include")) - (setenv "ALT_FREETYPE_HEADERS_PATH" - (string-append (assoc-ref inputs "freetype") - "/include")) - (setenv "ALT_FREETYPE_LIB_PATH" - (string-append (assoc-ref inputs "freetype") - "/lib")))) + (let (;; Get target-specific include directory so that + ;; libgcj-config.h is found when compiling hotspot. + (gcjinclude (let* ((port (open-input-pipe "gcj -print-file-name=include")) + (str (read-line port))) + (close-pipe port) + str))) + (substitute* "openjdk/jdk/make/common/shared/Sanity.gmk" + (("ALSA_INCLUDE=/usr/include/alsa/version.h") + (string-append "ALSA_INCLUDE=" + (assoc-ref inputs "alsa-lib") + "/include/alsa/version.h"))) + (setenv "CC" "gcc") + (setenv "CPATH" + (string-append gcjinclude ":" + (assoc-ref inputs "libxrender") + "/include/X11/extensions" ":" + (assoc-ref inputs "libxtst") + "/include/X11/extensions" ":" + (assoc-ref inputs "libxinerama") + "/include/X11/extensions" ":" + (or (getenv "CPATH") ""))) + (setenv "ALT_OBJCOPY" (which "objcopy")) + (setenv "ALT_CUPS_HEADERS_PATH" + (string-append (assoc-ref inputs "cups") + "/include")) + (setenv "ALT_FREETYPE_HEADERS_PATH" + (string-append (assoc-ref inputs "freetype") + "/include")) + (setenv "ALT_FREETYPE_LIB_PATH" + (string-append (assoc-ref inputs "freetype") + "/lib"))))) (add-after 'unpack 'fix-x11-extension-include-path (lambda* (#:key inputs #:allow-other-keys) @@ -733,7 +735,6 @@ build process and its dependencies, whereas Make uses Makefile format.") (delete 'patch-patches)))))) (native-inputs `(("ant" ,ant) - ("icedtea6" ,icedtea6 "jdk") ("openjdk-drop" ,(drop "openjdk" "03gxqn17cxwl1nspnwigacaqd28p02d45f396j5f4kkbzfnbl0ak")) @@ -756,4 +757,4 @@ build process and its dependencies, whereas Make uses Makefile format.") ,(drop "hotspot" "1yqxfd2jwbm5y41wscyfx8h0fr3h8ny2g2mda5iwd8sikxsaj96p")) ,@(fold alist-delete (package-native-inputs icedtea6) - '("openjdk6-src" "ant-bootstrap" "gcj"))))))) + '("openjdk6-src" "ant-bootstrap"))))))) From 1e44cf8b0ffe88f2675718c0a0f5119c87a8bf6a Mon Sep 17 00:00:00 2001 From: Ben Woodcroft Date: Tue, 9 Jun 2015 16:10:51 +0200 Subject: [PATCH 28/45] gnu: Add OrfM. * gnu/packages/bioinformatics.scm (orfm): New variable. Signed-off-by: Ricardo Wurmus --- gnu/packages/bioinformatics.scm | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm index df627fbe48..7175ecf41d 100644 --- a/gnu/packages/bioinformatics.scm +++ b/gnu/packages/bioinformatics.scm @@ -1101,6 +1101,27 @@ RNA-Seq, the MISO model uses Bayesian inference to compute the probability that a read originated from a particular isoform.") (license license:gpl2))) +(define-public orfm + (package + (name "orfm") + (version "0.3.2") + (source (origin + (method url-fetch) + (uri (string-append + "https://github.com/wwood/OrfM/releases/download/v" + version "/orfm-" version ".tar.gz")) + (sha256 + (base32 + "00jqvlspj9662ni9r4n1snxfnwkzc02i46g5nk1kwjshi6v3vgg3")))) + (build-system gnu-build-system) + (inputs `(("zlib" ,zlib))) + (synopsis "Simple and not slow open reading frame (ORF) caller") + (description + "An ORF caller finds stretches of DNA that when translated are not +interrupted by stop codons. OrfM finds and prints these ORFs.") + (home-page "https://github.com/wwood/OrfM") + (license license:lgpl3+))) + (define-public python2-pbcore (package (name "python2-pbcore") From e1ad6bfbe187dc38560642edb31452105d3182a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Fri, 12 Jun 2015 19:28:14 +0200 Subject: [PATCH 29/45] install: Use udev rules for device-mapper. Fixes . Reported by Benz Schenk . * gnu/system/install.scm (installation-services): Add #:rules argument for 'udev-service'. --- gnu/system/install.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gnu/system/install.scm b/gnu/system/install.scm index 27d8ecdefc..e8a36b3def 100644 --- a/gnu/system/install.scm +++ b/gnu/system/install.scm @@ -269,7 +269,8 @@ You have been warned. Thanks for being so brave. (guix-service #:authorize-hydra-key? #t) ;; Start udev so that useful device nodes are available. - (udev-service) + ;; Use device-mapper rules for cryptsetup & co. + (udev-service #:rules (list lvm2)) ;; Add the 'cow-store' service, which users have to start manually ;; since it takes the installation directory as an argument. From 76e146384c3465beb5cdbfad05c31bd79808a668 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Mon, 25 May 2015 22:13:27 +0200 Subject: [PATCH 30/45] gnu: Add withershins. * gnu/packages/code.scm (withershins): New variable. --- gnu/packages/code.scm | 64 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/gnu/packages/code.scm b/gnu/packages/code.scm index 9d2bde829d..97261d6c79 100644 --- a/gnu/packages/code.scm +++ b/gnu/packages/code.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013, 2015 Ludovic Courtès ;;; Copyright © 2015 Andreas Enge +;;; Copyright © 2015 Ricardo Wurmus ;;; ;;; This file is part of GNU Guix. ;;; @@ -22,9 +23,12 @@ #:use-module (guix download) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix build-system gnu) + #:use-module (guix build-system cmake) + #:use-module (gnu packages base) #:use-module (gnu packages compression) #:use-module (gnu packages databases) #:use-module (gnu packages emacs) + #:use-module (gnu packages gcc) #:use-module (gnu packages pcre) #:use-module (gnu packages pkg-config) #:use-module (gnu packages perl) @@ -225,3 +229,63 @@ COCOMO model or user-provided parameters.") files, but compared to grep is much faster and respects files like .gitignore, .hgignore, etc.") (license license:asl2.0))) + +(define-public withershins + (package + (name "withershins") + (version "0.1") + (source (origin + (method url-fetch) + (uri (string-append + "https://github.com/cameronwhite/withershins/archive/v" + version ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "08z3lyvswx7sad10637vfpwglbcbgzzcpfihw0x8lzr74f3b70bh")))) + (build-system cmake-build-system) + (arguments + `(#:out-of-source? #f + #:modules ((guix build utils) + (guix build cmake-build-system) + (ice-9 popen) + (ice-9 rdelim)) + #:phases + (modify-phases %standard-phases + (add-after + 'unpack 'find-libiberty + (lambda _ + (let ((plugin (let* ((port (open-input-pipe + "gcc -print-file-name=plugin")) + (str (read-line port))) + (close-pipe port) + str))) + (substitute* "cmake/FindIberty.cmake" + (("/usr/include") (string-append plugin "/include")) + (("libiberty.a iberty") (string-append "NAMES libiberty.a iberty\nPATHS \"" + (assoc-ref %build-inputs "gcc") + "/lib" "\""))) + #t))) + (replace + 'install + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (mkdir-p (string-append out "/lib")) + (mkdir (string-append out "/include")) + (copy-file "src/withershins.hpp" + (string-append out "/include/withershins.hpp")) + (copy-file "src/libwithershins.a" + (string-append out "/lib/libwithershins.a"))) + #t))))) + (home-page "https://github.com/cameronwhite/withershins") + (inputs + `(("gcc" ,gcc-4.8 "lib") ;for libiberty.a + ("binutils" ,binutils) ;for libbfd + ("zlib" ,zlib))) + (synopsis "C++11 library for generating stack traces") + (description + "Withershins is a simple cross-platform C++11 library for generating +stack traces.") + ;; Sources are released under Expat license, but since BFD is licensed + ;; under the GPLv3+ the combined work is GPLv3+ as well. + (license license:gpl3+))) From ccb8da2654ed4dc570c385331fafb9673d5ae452 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Mon, 25 May 2015 22:14:39 +0200 Subject: [PATCH 31/45] gnu: Add RapidJSON. * gnu/packages/web.scm (rapidjson): New variable. --- gnu/packages/web.scm | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm index e77bad76d6..6660c3fe8e 100644 --- a/gnu/packages/web.scm +++ b/gnu/packages/web.scm @@ -259,6 +259,27 @@ easily construct JSON objects in C, output them as JSON formatted strings and parse JSON formatted strings back into the C representation of JSON objects.") (license l:x11))) +(define-public rapidjson + (package + (name "rapidjson") + (version "1.0.2") + (source (origin + (method url-fetch) + (uri (string-append + "https://github.com/miloyip/rapidjson/archive/v" + version ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "0rl6s0vg5y1dhh9vfl1lqay3sxf69sxjh0czxrjmasn7ng91wwf3")))) + (build-system cmake-build-system) + (home-page "https://github.com/miloyip/rapidjson") + (synopsis "JSON parser/generator for C++ with both SAX/DOM style API") + (description + "RapidJSON is a fast JSON parser/generator for C++ with both SAX/DOM +style API.") + (license l:expat))) + (define-public libwebsockets (package (name "libwebsockets") From 6ce212b8686487355dd5797917faf819ab80dc3e Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 28 May 2015 09:43:53 +0200 Subject: [PATCH 32/45] gnu: Add pugixml. * gnu/packages/xml.scm (pugixml): New variable. --- gnu/packages/xml.scm | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/gnu/packages/xml.scm b/gnu/packages/xml.scm index 8a4d2fbb5b..a7925d9aa6 100644 --- a/gnu/packages/xml.scm +++ b/gnu/packages/xml.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2013, 2014, 2015 Ludovic Courtès ;;; Copyright © 2013, 2015 Andreas Enge ;;; Copyright © 2015 Eric Bavier +;;; Copyright © 2015 Ricardo Wurmus ;;; ;;; This file is part of GNU Guix. ;;; @@ -30,6 +31,7 @@ #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) #:use-module (guix download) + #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) #:use-module (guix build-system perl) #:use-module (gnu packages linux)) @@ -358,6 +360,41 @@ from XML::Parser. It parses XML strings or files and builds a data structure that conforms to the API of the Document Object Model.") (home-page "http://search.cpan.org/~tjmather/XML-DOM-1.44/lib/XML/DOM.pm"))) +(define-public pugixml + (package + (name "pugixml") + (version "1.6") + (source + (origin + (method url-fetch) + (uri (string-append "https://github.com/zeux/pugixml/archive/v" + version ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "0czbcv9aqf2rw3s9cljz2wb1f4zbhd07wnj7ykklklccl0ipfnwi")))) + (build-system cmake-build-system) + (arguments + `(#:tests? #f + #:out-of-source? #f + #:phases (modify-phases %standard-phases + (add-before + 'configure 'chdir + (lambda _ + (chdir "scripts") + #t))))) + (home-page "http://pugixml.org") + (synopsis "Light-weight, simple and fast XML parser for C++ with XPath support") + (description + "pugixml is a C++ XML processing library, which consists of a DOM-like +interface with rich traversal/modification capabilities, a fast XML parser +which constructs the DOM tree from an XML file/buffer, and an XPath 1.0 +implementation for complex data-driven tree queries. Full Unicode support is +also available, with Unicode interface variants and conversions between +different Unicode encodings which happen automatically during +parsing/saving.") + (license license:expat))) + (define-public xmlto (package (name "xmlto") From cc45cff83aaf190e7cefed957db20214b3586754 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 28 May 2015 09:44:30 +0200 Subject: [PATCH 33/45] gnu: Add rtmidi. * gnu/packages/audio.scm (rtmidi): New variable. --- gnu/packages/audio.scm | 51 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/gnu/packages/audio.scm b/gnu/packages/audio.scm index fdc783a455..3b2d4e1022 100644 --- a/gnu/packages/audio.scm +++ b/gnu/packages/audio.scm @@ -1031,6 +1031,57 @@ and ALSA.") tempo and pitch of an audio recording independently of one another.") (license license:gpl2+))) +(define-public rtmidi + (package + (name "rtmidi") + (version "2.1.0") + (source (origin + (method url-fetch) + (uri + (string-append "https://github.com/powertab/rtmidi/archive/" + version ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "0d49lapnmdgmjxh4vw57h6xk74nn5r0zwysv7jbd7m8kqhpq5rjj")))) + (build-system gnu-build-system) + (arguments + `(#:tests? #f ;no "check" target + #:phases (modify-phases %standard-phases + (add-before + 'configure 'autoconf + (lambda _ (zero? (system* "autoreconf" "-vfi")))) + (add-before + 'build 'fix-makefile + (lambda _ + (substitute* "Makefile" + (("/bin/ln") "ln") + (("RtMidi.h RtError.h") "RtMidi.h")) + #t)) + (add-before + 'install 'make-target-dirs + (lambda _ + (let ((out (assoc-ref %outputs "out"))) + (mkdir-p (string-append out "/bin")) + (mkdir (string-append out "/lib")) + (mkdir (string-append out "/include"))) + #t))))) + (inputs + `(("jack" ,jack-1) + ("alsa-lib" ,alsa-lib))) + (native-inputs + `(("autoconf" ,autoconf) + ("automake" ,automake) + ("libtool" ,libtool) + ("pkg-config" ,pkg-config))) + (home-page "https://github.com/powertab/rtmidi") + (synopsis "Cross-platform MIDI library for C++") + (description + "RtMidi is a set of C++ classes (RtMidiIn, RtMidiOut, and API specific +classes) that provide a common cross-platform API for realtime MIDI +input/output.") + (license license:expat))) + (define-public sratom (package (name "sratom") From 14a17ef6f4e416c9b1f888679961e7ffe04166c6 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 3 Jun 2015 22:53:56 +0200 Subject: [PATCH 34/45] gnu: catch-framework: Update to 1.1.3. * gnu/packages/check.scm (catch-framework): Update to 1.1.3. --- gnu/packages/check.scm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm index 5349ede0fa..e0ee7c4d4f 100644 --- a/gnu/packages/check.scm +++ b/gnu/packages/check.scm @@ -113,18 +113,17 @@ supervised tests.") (define-public catch-framework (package (name "catch") - (version "1.0.53") ;Sub-minor is the build number + (version "1.1.3") ;Sub-minor is the build number (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/philsquared/Catch") - ;; Semi-arbitrary. Contains mostly documentation fixes - ;; since build 53. - (commit "b9ec8a1"))) + ;; Semi-arbitrary. + (commit "c51e86819d"))) (file-name (string-append name "-" version)) (sha256 (base32 - "05iijiwjwcjbza7qamwd32d0jypi0lpywmilmmj2xh280mcl4dbd")))) + "0kgi7wxxysgjbpisqfj4dj0k19cyyai92f001zi8gzkybd4fkgv5")))) (build-system trivial-build-system) (arguments `(#:modules ((guix build utils)) From 8b9ec354edc4a4f50ce67e43f4f7121331c8f4e4 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 4 Jun 2015 10:01:11 +0200 Subject: [PATCH 35/45] gnu: Add powertabeditor. * gnu/packages/music.scm (powertabeditor): New variable. --- gnu/packages/music.scm | 98 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm index 5795ecbb0d..a42d5c35c5 100644 --- a/gnu/packages/music.scm +++ b/gnu/packages/music.scm @@ -22,9 +22,15 @@ #:use-module (guix download) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix build-system gnu) + #:use-module (guix build-system cmake) #:use-module (gnu packages) #:use-module (gnu packages audio) + #:use-module (gnu packages base) ;libbdf + #:use-module (gnu packages boost) #:use-module (gnu packages bison) + #:use-module (gnu packages code) + #:use-module (gnu packages check) + #:use-module (gnu packages compression) #:use-module (gnu packages docbook) #:use-module (gnu packages flex) #:use-module (gnu packages fonts) @@ -45,9 +51,11 @@ #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) + #:use-module (gnu packages qt) #:use-module (gnu packages rsync) #:use-module (gnu packages texinfo) #:use-module (gnu packages texlive) + #:use-module (gnu packages web) #:use-module (gnu packages xml) #:use-module (gnu packages xiph) #:use-module (gnu packages zip)) @@ -224,6 +232,96 @@ sessions. Solfege is also designed to be extensible so you can easily write your own lessons.") (license license:gpl3+))) +(define-public powertabeditor + (package + (name "powertabeditor") + (version "2.0.0-alpha7") + (source (origin + (method url-fetch) + (uri (string-append + "https://github.com/powertab/powertabeditor/archive/" + version ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "1yp6ck2r72c2pfq31z1kpw1j639rndrifj85l3cbj2kdf8rdzhkk")) + (modules '((guix build utils))) + (snippet + '(begin + ;; Remove bundled sources for external libraries + (delete-file-recursively "external") + (substitute* "CMakeLists.txt" + (("include_directories\\(\\$\\{PROJECT_SOURCE_DIR\\}/external/.*") "") + ;; TODO: tests cannot be built: + ;; test/test_main.cpp:28:12: error: ‘Session’ is not a member of ‘Catch’ + (("add_subdirectory\\(test\\)") "") + (("add_subdirectory\\(external\\)") "")) + (substitute* "test/CMakeLists.txt" + (("include_directories\\(\\$\\{PROJECT_SOURCE_DIR\\}/external/.*") "")) + + ;; Add install target + (substitute* "source/CMakeLists.txt" + (("qt5_use_modules") + (string-append + "install(TARGETS powertabeditor " + "RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)\n" + "install(FILES data/tunings.json DESTINATION " + "${CMAKE_INSTALL_PREFIX}/share/powertabeditor/)\n" + "qt5_use_modules"))) + #t)))) + (build-system cmake-build-system) + (arguments + `(#:tests? #f ; no "check" target + #:modules ((guix build cmake-build-system) + (guix build utils) + (ice-9 match)) + #:configure-flags + ;; CMake appears to lose the RUNPATH for some reason, so it has to be + ;; explicitly set with CMAKE_INSTALL_RPATH. + (list (string-append "-DCMAKE_INSTALL_RPATH=" + (string-join (map (match-lambda + ((name . directory) + (string-append directory "/lib"))) + %build-inputs) ";"))) + #:phases + (modify-phases %standard-phases + (add-before + 'configure 'remove-third-party-libs + (lambda* (#:key inputs #:allow-other-keys) + ;; Link with required static libraries, because we're not + ;; using the bundled version of withershins. + (substitute* '("source/CMakeLists.txt" + "test/CMakeLists.txt") + (("target_link_libraries\\((powertabeditor)" _ target) + (string-append "target_link_libraries(" target " " + (assoc-ref inputs "binutils") + "/lib/libbfd.a " + (assoc-ref inputs "gcc") + "/lib/libiberty.a " + "dl"))) + #t))))) + (inputs + `(("boost" ,boost) + ("alsa-lib" ,alsa-lib) + ("qt" ,qt) + ("withershins" ,withershins) + ("gcc" ,gcc-4.8 "lib") ;for libiberty.a (for withershins) + ("binutils" ,binutils) ;for -lbfd and -liberty (for withershins) + ("timidity" ,timidity++) + ("pugixml" ,pugixml) + ("rtmidi" ,rtmidi) + ("rapidjson" ,rapidjson) + ("zlib" ,zlib))) + (native-inputs + `(("catch" ,catch-framework) + ("pkg-config" ,pkg-config))) + (home-page "http://powertabs.net") + (synopsis "Guitar tablature editor") + (description + "Power Tab Editor 2.0 is the successor to the famous original Power Tab +Editor. It is compatible with Power Tab Editor 1.7 and Guitar Pro.") + (license license:gpl3+))) + (define-public tuxguitar (package (name "tuxguitar") From 1937e38d06ac35c9d683a6943c7d988d1ffdf4f9 Mon Sep 17 00:00:00 2001 From: Eric Bavier Date: Sun, 19 Apr 2015 09:54:23 -0500 Subject: [PATCH 36/45] gnu: Add Set-Object. * gnu/packages/perl.scm (perl-set-object): New variable. --- gnu/packages/perl.scm | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm index e5ec25e418..ec6f89a626 100644 --- a/gnu/packages/perl.scm +++ b/gnu/packages/perl.scm @@ -4095,6 +4095,28 @@ collector.") (description "Set::Infinite is a set theory module for infinite sets.") (license (package-license perl)))) +(define-public perl-set-object + (package + (name "perl-set-object") + (version "1.35") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://cpan/authors/id/R/RU/RURBAN/" + "Set-Object-" version ".tar.gz")) + (sha256 + (base32 + "1rqf11274s3h17jgbimmg47k4fmayifajqwaa6lgm0z5qdy4v6hq")))) + (build-system perl-build-system) + (propagated-inputs + `(("perl-moose" ,perl-moose) + ("perl-test-leaktrace" ,perl-test-leaktrace))) + (home-page "http://search.cpan.org/dist/Set-Object") + (synopsis "Unordered collections of Perl Objects") + (description "Set::Object provides efficient sets, unordered collections +of Perl objects without duplicates for scalars and references.") + (license artistic2.0))) + (define-public perl-set-scalar (package (name "perl-set-scalar") From 514214cbe5909a21d965986aa552c83885a5ff6f Mon Sep 17 00:00:00 2001 From: Eric Bavier Date: Sun, 19 Apr 2015 09:55:28 -0500 Subject: [PATCH 37/45] gnu: Add Catalyst-Plugin-Authorization-Roles. * gnu/packages/web.scm (perl-catalyst-plugin-authorization-roles): New variable. --- gnu/packages/web.scm | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm index 6660c3fe8e..6446959d2f 100644 --- a/gnu/packages/web.scm +++ b/gnu/packages/web.scm @@ -926,6 +926,35 @@ who they claim to be), and authorization (allowing the user to do what the system authorises them to do).") (license (package-license perl)))) +(define-public perl-catalyst-plugin-authorization-roles + (package + (name "perl-catalyst-plugin-authorization-roles") + (version "0.09") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://cpan/authors/id/B/BO/BOBTFISH/" + "Catalyst-Plugin-Authorization-Roles-" + version ".tar.gz")) + (sha256 + (base32 + "0l83lkwmq0lngwh8b1rv3r719pn8w1gdbyhjqm74rnd0wbjl8h7f")))) + (build-system perl-build-system) + (native-inputs + `(("perl-test-exception" ,perl-test-exception))) + (propagated-inputs + `(("perl-catalyst-plugin-authentication" + ,perl-catalyst-plugin-authentication) + ("perl-catalyst-runtime" ,perl-catalyst-runtime) + ("perl-set-object" ,perl-set-object) + ("perl-universal-isa" ,perl-universal-isa))) + (home-page + "http://search.cpan.org/dist/Catalyst-Plugin-Authorization-Roles") + (synopsis "Role-based authorization for Catalyst") + (description "Catalyst::Plugin::Authorization::Roles provides role-based +authorization for Catalyst based on Catalyst::Plugin::Authentication.") + (license (package-license perl)))) + (define-public perl-catalyst-plugin-captcha (package (name "perl-catalyst-plugin-captcha") From 6e545bbf5565b6273423ac50187e2c50f84399b0 Mon Sep 17 00:00:00 2001 From: Eric Bavier Date: Fri, 17 Apr 2015 23:20:51 -0500 Subject: [PATCH 38/45] gnu: Add Catalyst-Authentication-Store-DBIx-Class. * gnu/packages/web.scm (perl-catalyst-authentication-store-dbix-class): New variable. --- gnu/packages/web.scm | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm index 6446959d2f..94d9970ea6 100644 --- a/gnu/packages/web.scm +++ b/gnu/packages/web.scm @@ -725,6 +725,41 @@ action with the generated name, and failing that it will try to dispatch to a regular method.") (license (package-license perl)))) +(define-public perl-catalyst-authentication-store-dbix-class + (package + (name "perl-catalyst-authentication-store-dbix-class") + (version "0.1506") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://cpan/authors/id/I/IL/ILMARI/" + "Catalyst-Authentication-Store-DBIx-Class-" + version ".tar.gz")) + (sha256 + (base32 + "0i5ja7690fs9nhxcij6lw51j804sm8s06m5mvk1n8pi8jljrymvw")))) + (build-system perl-build-system) + (native-inputs + `(("perl-catalyst-plugin-authorization-roles" + ,perl-catalyst-plugin-authorization-roles) + ("perl-catalyst-plugin-session-state-cookie" + ,perl-catalyst-plugin-session-state-cookie) + ("perl-dbd-sqlite" ,perl-dbd-sqlite) + ("perl-test-www-mechanize-catalyst" ,perl-test-www-mechanize-catalyst))) + (propagated-inputs + `(("perl-catalyst-runtime" ,perl-catalyst-runtime) + ("perl-catalyst-plugin-authentication" + ,perl-catalyst-plugin-authentication) + ("perl-dbix-class" ,perl-dbix-class) + ("perl-catalyst-model-dbic-schema" ,perl-catalyst-model-dbic-schema))) + (home-page + "http://search.cpan.org/dist/Catalyst-Authentication-Store-DBIx-Class") + (synopsis "Storage class for Catalyst authentication using DBIx::Class") + (description "The Catalyst::Authentication::Store::DBIx::Class class +provides access to authentication information stored in a database via +DBIx::Class.") + (license (package-license perl)))) + (define-public perl-catalyst-component-instancepercontext (package (name "perl-catalyst-component-instancepercontext") From 0061079a19c9ac38a2d2a170bcfea17fd362d15e Mon Sep 17 00:00:00 2001 From: Eric Bavier Date: Sun, 19 Apr 2015 12:59:37 -0500 Subject: [PATCH 39/45] gnu: Add hydra. * gnu/packages/ci.scm: New file. * gnu/packages/patches/hydra-automake-1.15.patch, gnu/packages/patches/hydra-disable-darcs-test.patch: New files. * gnu-system.am (GNU_SYSTEM_MODULES): Add file. (dist_patch_DATA): Add patches. --- gnu-system.am | 3 + gnu/packages/ci.scm | 182 ++++++++++++++++++ .../patches/hydra-automake-1.15.patch | 63 ++++++ .../patches/hydra-disable-darcs-test.patch | 25 +++ 4 files changed, 273 insertions(+) create mode 100644 gnu/packages/ci.scm create mode 100644 gnu/packages/patches/hydra-automake-1.15.patch create mode 100644 gnu/packages/patches/hydra-disable-darcs-test.patch diff --git a/gnu-system.am b/gnu-system.am index d79c2c7917..7e0ee52875 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -59,6 +59,7 @@ GNU_SYSTEM_MODULES = \ gnu/packages/cdrom.scm \ gnu/packages/certs.scm \ gnu/packages/check.scm \ + gnu/packages/ci.scm \ gnu/packages/cmake.scm \ gnu/packages/code.scm \ gnu/packages/commencement.scm \ @@ -454,6 +455,8 @@ dist_patch_DATA = \ gnu/packages/patches/gtkglext-disable-disable-deprecated.patch \ gnu/packages/patches/hop-bigloo-4.0b.patch \ gnu/packages/patches/hop-linker-flags.patch \ + gnu/packages/patches/hydra-automake-1.15.patch \ + gnu/packages/patches/hydra-disable-darcs-test.patch \ gnu/packages/patches/irrlicht-mesa-10.patch \ gnu/packages/patches/jbig2dec-ignore-testtest.patch \ gnu/packages/patches/kmod-module-directory.patch \ diff --git a/gnu/packages/ci.scm b/gnu/packages/ci.scm new file mode 100644 index 0000000000..b68e0dce3b --- /dev/null +++ b/gnu/packages/ci.scm @@ -0,0 +1,182 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2015 Eric Bavier +;;; +;;; 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 (gnu packages ci) + #:use-module ((guix licenses) #:prefix l:) + #:use-module (gnu packages) + #:use-module (guix packages) + #:use-module (guix git-download) + #:use-module (gnu packages autotools) + #:use-module (gnu packages base) + #:use-module (gnu packages docbook) + #:use-module (gnu packages compression) + #:use-module (gnu packages databases) + #:use-module (gnu packages guile) + #:use-module (gnu packages mail) + #:use-module (gnu packages openssl) + #:use-module (gnu packages package-management) + #:use-module (gnu packages perl) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages version-control) + #:use-module (gnu packages web) + #:use-module (gnu packages xml) + #:use-module (gnu packages zip) + #:use-module (guix build-system gnu)) + +(define-public hydra + (let ((commit "4c0e3e4")) + (package + (name "hydra") + (version (string-append "20150407." commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/NixOS/hydra") + (commit commit))) + (file-name (string-append name "-" version)) + (sha256 + (base32 + "08vc76xb7f42hh65j7qvjf58hw36aki5ml343170pq94vk75b1nh")) + (patches (map search-patch + '("hydra-automake-1.15.patch" + ;; TODO: Remove once we have a darcs input + "hydra-disable-darcs-test.patch"))))) + (build-system gnu-build-system) + (native-inputs + `(("unzip" ,unzip) + ("pkg-config" ,pkg-config) + ;; For documentation + ("dblatex" ,dblatex) + ("xsltproc" ,libxslt) + ("docbook-xsl" ,docbook-xsl) + ;; For bootstrap + ("autoconf" ,autoconf) + ("automake" ,automake) + ("libtool" ,libtool) + ;; For tests + ("git" ,git) + ("subversion" ,subversion) + ("mercurial" ,mercurial) + ("bazaar" ,bazaar))) + (inputs + `(("perl" ,perl) + ("guile" ,guile-2.0) + ("openssl" ,openssl) + ("bzip2" ,bzip2) + ("gzip" ,gzip) + ("sed" ,sed) + ("starman" ,starman) + ("git" ,git) + ("subversion" ,subversion) + ("mercurial" ,mercurial) + ("bazaar" ,bazaar) + ("nix" ,nix) + ;; Lots o' perl modules... + ("perl-catalyst-action-rest" ,perl-catalyst-action-rest) + ("perl-catalyst-authentication-store-dbix-class" + ,perl-catalyst-authentication-store-dbix-class) + ("perl-catalyst-devel" ,perl-catalyst-devel) + ("perl-catalyst-dispatchtype-regex" ,perl-catalyst-dispatchtype-regex) + ("perl-catalyst-plugin-accesslog" ,perl-catalyst-plugin-accesslog) + ("perl-catalyst-plugin-authorization-roles" + ,perl-catalyst-plugin-authorization-roles) + ("perl-catalyst-plugin-captcha" ,perl-catalyst-plugin-captcha) + ("perl-catalyst-plugin-session-state-cookie" + ,perl-catalyst-plugin-session-state-cookie) + ("perl-catalyst-plugin-session-store-fastmmap" + ,perl-catalyst-plugin-session-store-fastmmap) + ("perl-catalyst-plugin-stacktrace" ,perl-catalyst-plugin-stacktrace) + ("perl-catalyst-traitfor-request-proxybase" + ,perl-catalyst-traitfor-request-proxybase) + ("perl-catalyst-view-download" ,perl-catalyst-view-download) + ("perl-catalyst-view-json" ,perl-catalyst-view-json) + ("perl-catalyst-view-tt" ,perl-catalyst-view-tt) + ("perl-catalystx-roleapplicator" ,perl-catalystx-roleapplicator) + ("perl-catalystx-script-server-starman" + ,perl-catalystx-script-server-starman) + ("perl-crypt-randpasswd" ,perl-crypt-randpasswd) + ("perl-data-dump" ,perl-data-dump) + ("perl-datetime" ,perl-datetime) + ("perl-dbd-pg" ,perl-dbd-pg) + ("perl-dbd-sqlite" ,perl-dbd-sqlite) + ("perl-digest-sha1" ,perl-digest-sha1) + ("perl-email-mime" ,perl-email-mime) + ("perl-email-sender" ,perl-email-sender) + ("perl-file-slurp" ,perl-file-slurp) + ("perl-io-compress" ,perl-io-compress) + ("perl-ipc-run" ,perl-ipc-run) + ("perl-json-any" ,perl-json-any) + ("perl-json-xs" ,perl-json-xs) + ("perl-libwww" ,perl-libwww) + ("perl-lwp-protocol-https" ,perl-lwp-protocol-https) + ("perl-net-amazon-s3" ,perl-net-amazon-s3) + ("perl-padwalker" ,perl-padwalker) + ("perl-readonly" ,perl-readonly) + ("perl-set-scalar" ,perl-set-scalar) + ("perl-sql-splitstatement" ,perl-sql-splitstatement) + ("perl-sys-hostname-long" ,perl-sys-hostname-long) + ("perl-text-diff" ,perl-text-diff) + ("perl-text-table" ,perl-text-table) + ("perl-xml-simple" ,perl-xml-simple))) + (arguments + `(#:configure-flags + (let ((docbook (assoc-ref %build-inputs "docbook-xsl"))) + (list (string-append "--with-docbook-xsl=" + docbook "/xml/xsl/docbook-xsl-" + ,(package-version docbook-xsl)) + (string-append "--docdir=" %output + "/doc/hydra-" ,version))) + #:phases (modify-phases %standard-phases + (add-after + 'unpack 'bootstrap + (lambda _ (zero? (system* "autoreconf" "-vfi")))) + (add-before + 'check 'check-setup + (lambda _ (setenv "LOGNAME" "test.log"))) + (add-after + 'install 'wrap-program + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (for-each + (lambda (file) + (wrap-program file + `("PATH" ":" prefix + (,(string-append out "/bin") + ,@(map (lambda (i) + (string-append (assoc-ref inputs i) + "/bin")) + '("subversion" "git" "bazaar" + "mercurial" "coreutils" "gzip" + "sed" "unzip" "nix")))) + `("PERL5LIB" ":" prefix + (,(string-append out "/libexec/hydra/lib") + ,@(search-path-as-string->list + (getenv "PERL5LIB")))) + `("HYDRA_RELEASE" = (,,version)) + `("HYDRA_HOME" = + (,(string-append out "/libexec/hydra"))) + `("NIX_RELEASE" = (,,(package-version nix))))) + (find-files (string-append out "/bin") + ".*")))))))) + (home-page "https://nixos.org/hydra") + (synopsis "Continuous build system") + (description + "Hydra is a tool for continuous integration testing and software +release that uses a purely functional language to describe build jobs and +their dependencies.") + (license l:gpl3+)))) diff --git a/gnu/packages/patches/hydra-automake-1.15.patch b/gnu/packages/patches/hydra-automake-1.15.patch new file mode 100644 index 0000000000..0d8fa98519 --- /dev/null +++ b/gnu/packages/patches/hydra-automake-1.15.patch @@ -0,0 +1,63 @@ +This patch takes a slightly different approach to solving the issue reported +at https://github.com/NixOS/hydra/issues/200. This fix allows us to use +Automake's parallel test harness. + +--- source/configure.ac.orig 1969-12-31 18:00:01.000000000 -0600 ++++ source/configure.ac 2015-04-15 10:58:15.974679278 -0500 +@@ -33,7 +33,7 @@ + fi + ]) + +-NEED_PROG(perl, perl) ++NEED_PROG([PERL], perl) + + NEED_PROG([NIX_STORE_PROGRAM], [nix-store]) + +--- source/tests/Makefile.am.orig 1969-12-31 18:00:01.000000000 -0600 ++++ source/tests/Makefile.am 2015-04-15 11:00:35.846682904 -0500 +@@ -1,19 +1,20 @@ +-TESTS_ENVIRONMENT = \ +- BZR_HOME="$(abs_builddir)/data" \ +- HYDRA_DBI="dbi:SQLite:db.sqlite" \ +- HYDRA_DATA="$(abs_builddir)/data" \ +- HYDRA_HOME="$(top_srcdir)/src" \ +- HYDRA_CONFIG= \ +- NIX_REMOTE= \ +- NIX_CONF_DIR="$(abs_builddir)/nix/etc/nix" \ +- NIX_STATE_DIR="$(abs_builddir)/nix/var/nix" \ +- NIX_MANIFESTS_DIR="$(abs_builddir)/nix/var/nix/manifests" \ +- NIX_STORE_DIR="$(abs_builddir)/nix/store" \ +- NIX_LOG_DIR="$(abs_builddir)/nix/var/log/nix" \ +- NIX_BUILD_HOOK= \ +- PERL5LIB="$(srcdir):$(top_srcdir)/src/lib:$$PERL5LIB" \ +- PATH=$(abs_top_srcdir)/src/script:$(abs_top_srcdir)/src/c:$$PATH \ +- perl -w ++AM_TESTS_ENVIRONMENT = \ ++ BZR_HOME="$(abs_builddir)/data"; export BZR_HOME; \ ++ HYDRA_DBI="dbi:SQLite:db.sqlite"; export HYDRA_DBI; \ ++ HYDRA_DATA="$(abs_builddir)/data"; export HYDRA_DATA; \ ++ HYDRA_HOME="$(top_srcdir)/src"; export HYDRA_HOME; \ ++ HYDRA_CONFIG=; export HYDRA_CONFIG; \ ++ NIX_REMOTE=; export NIX_REMOTE; \ ++ NIX_CONF_DIR="$(abs_builddir)/nix/etc/nix"; export NIX_CONF_DIR; \ ++ NIX_STATE_DIR="$(abs_builddir)/nix/var/nix"; export NIX_STATE_DIR; \ ++ NIX_MANIFESTS_DIR="$(abs_builddir)/nix/var/nix/manifests"; export NIX_MANIFESTS_DIR; \ ++ NIX_STORE_DIR="$(abs_builddir)/nix/store"; export NIX_STORE_DIR; \ ++ NIX_LOG_DIR="$(abs_builddir)/nix/var/log/nix"; export NIX_LOG_DIR; \ ++ NIX_BUILD_HOOK=; export NIX_BUILD_HOOK; \ ++ PERL5LIB="$(srcdir):$(top_srcdir)/src/lib:$$PERL5LIB"; export PERL5LIB; \ ++ PATH=$(abs_top_srcdir)/src/script:$(abs_top_srcdir)/src/c:$$PATH; export PATH; ++LOG_COMPILER = $(PERL) ++AM_LOG_FLAGS = -w + + EXTRA_DIST = \ + $(wildcard *.pm) \ +@@ -33,7 +34,7 @@ + check_SCRIPTS = db.sqlite repos + + db.sqlite: $(top_srcdir)/src/sql/hydra-sqlite.sql +- $(TESTS_ENVIRONMENT) $(top_srcdir)/src/script/hydra-init ++ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) $(top_srcdir)/src/script/hydra-init + + repos: dirs + diff --git a/gnu/packages/patches/hydra-disable-darcs-test.patch b/gnu/packages/patches/hydra-disable-darcs-test.patch new file mode 100644 index 0000000000..5d8e015b08 --- /dev/null +++ b/gnu/packages/patches/hydra-disable-darcs-test.patch @@ -0,0 +1,25 @@ +--- hydra-20150407.4c0e3e4/tests/evaluation-tests.pl 2015-04-15 12:00:19.000000000 -0500 ++++ hydra-20150407.4c0e3e4/tests/evaluation-tests.pl 2015-04-17 08:53:04.940301471 -0500 +@@ -7,7 +7,7 @@ + + my $db = Hydra::Model::DB->new; + +-use Test::Simple tests => 72; ++use Test::Simple tests => 68; + + hydra_setup($db); + +@@ -103,13 +103,6 @@ + uri => "$jobsBaseUri/hg-repo", + update => getcwd . "/jobs/hg-update.sh" + }, +- { +- name => "darcs", +- nixexpr => "darcs-input.nix", +- type => "darcs", +- uri => "$jobsBaseUri/darcs-repo", +- update => getcwd . "/jobs/darcs-update.sh" +- } + ); + + foreach my $scm ( @scminputs ) { From 02c2cf43ce53718f02376c438b87504a7a2e1c0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sat, 13 Jun 2015 18:32:35 +0200 Subject: [PATCH 40/45] gnu: guix: Use 'modify-phases'. * gnu/packages/package-management.scm (guix-0.8.2)[arguments]: Use 'modify-phases' instead of 'alist-cons-before'. --- gnu/packages/package-management.scm | 46 ++++++++++++++--------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm index a2c74c2fe6..33dce5c809 100644 --- a/gnu/packages/package-management.scm +++ b/gnu/packages/package-management.scm @@ -75,31 +75,31 @@ (string-append "--with-libgcrypt-prefix=" (assoc-ref %build-inputs "libgcrypt"))) - #:phases (alist-cons-before - 'configure 'copy-bootstrap-guile - (lambda* (#:key system inputs #:allow-other-keys) - (define (boot-guile-version arch) - (if (string=? "armhf" arch) - "2.0.11" - "2.0.9")) + #:phases (modify-phases %standard-phases + (add-before + 'configure 'copy-bootstrap-guile + (lambda* (#:key system inputs #:allow-other-keys) + (define (boot-guile-version arch) + (if (string=? "armhf" arch) + "2.0.11" + "2.0.9")) - (define (copy arch) - (let ((guile (assoc-ref inputs - (string-append "boot-guile/" - arch))) - (target (string-append "gnu/packages/bootstrap/" - arch "-linux/" - "/guile-" - (boot-guile-version arch) - ".tar.xz"))) - (copy-file guile target))) + (define (copy arch) + (let ((guile (assoc-ref inputs + (string-append "boot-guile/" + arch))) + (target (string-append "gnu/packages/bootstrap/" + arch "-linux/" + "/guile-" + (boot-guile-version arch) + ".tar.xz"))) + (copy-file guile target))) - (copy "i686") - (copy "x86_64") - (copy "mips64el") - (copy "armhf") - #t) - %standard-phases))) + (copy "i686") + (copy "x86_64") + (copy "mips64el") + (copy "armhf") + #t))))) (native-inputs `(("pkg-config" ,pkg-config) ("emacs" ,emacs-no-x))) ;for guix.el (inputs From 932e7204afbe6d56b8319f7c298ea43e12004a95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sat, 13 Jun 2015 19:31:24 +0200 Subject: [PATCH 41/45] gnu: guix: Wrap 'guix' so GUILE_LOAD_PATH includes the dependencies. * gnu/packages/package-management.scm (guix-0.8.2)[arguments]: Add 'wrap-program' phase. --- gnu/packages/package-management.scm | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm index 33dce5c809..7f6ec56151 100644 --- a/gnu/packages/package-management.scm +++ b/gnu/packages/package-management.scm @@ -99,7 +99,22 @@ (copy "x86_64") (copy "mips64el") (copy "armhf") - #t))))) + #t)) + (add-after + 'install 'wrap-program + (lambda* (#:key inputs outputs #:allow-other-keys) + ;; Make sure the 'guix' command finds GnuTLS and + ;; Guile-JSON automatically. + (let* ((out (assoc-ref outputs "out")) + (json (assoc-ref inputs "guile-json")) + (gnutls (assoc-ref inputs "gnutls")) + (path (string-append + json "/share/guile/site/2.0:" + gnutls "/share/guile/site/2.0"))) + (wrap-program (string-append out "/bin/guix") + `("GUILE_LOAD_PATH" ":" prefix (,path)) + `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,path))) + #t)))))) (native-inputs `(("pkg-config" ,pkg-config) ("emacs" ,emacs-no-x))) ;for guix.el (inputs From 8c01b9d05aa5d5449398d5babdf7fa1fe95af1c2 Mon Sep 17 00:00:00 2001 From: Mathieu Lirzin Date: Wed, 10 Jun 2015 13:39:54 +0200 Subject: [PATCH 42/45] doc: Move most 'HACKING' informations into the manual. * HACKING (Contributing): New section. (Building from Git, The Perfect Setup, Coding Style, Submitting Patches): Move to ... * doc/guix.texi (Running Guix Before It Is Installed): Likewise. * doc/contributing.texi: ... here. New file. * doc.am (EXTRA_DIST): Use it. * README (Installation): Adapt to it. * configure.ac (DOT): Likewise. --- HACKING | 133 ++------------------------ README | 4 +- configure.ac | 2 +- doc.am | 1 + doc/contributing.texi | 216 ++++++++++++++++++++++++++++++++++++++++++ doc/guix.texi | 73 ++++---------- 6 files changed, 244 insertions(+), 185 deletions(-) create mode 100644 doc/contributing.texi diff --git a/HACKING b/HACKING index 1e742c8454..41838ee816 100644 --- a/HACKING +++ b/HACKING @@ -2,141 +2,20 @@ #+TITLE: Hacking GNU Guix and Its Incredible Distro -Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès -Copyright © 2013 Nikita Karetnikov -Copyright © 2014 Pierre-Antoine Rault +Copyright © 2012, 2013, 2014 Ludovic Courtès +Copyright © 2015 Mathieu Lirzin Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. +* Contributing -* Building from Git +See the manual for useful hacking informations, either by running -When building Guix from a checkout, the following packages are required in -addition to those mentioned in the installation instructions: + info -f doc/guix.info "(guix) Contributing" - - [[http://www.gnu.org/software/autoconf/][GNU Autoconf]] - - [[http://www.gnu.org/software/automake/][GNU Automake]] - - [[http://www.gnu.org/software/gettext/][GNU Gettext]] - - [[http://www.graphviz.org/][Graphviz]] - - [[http://www.gnu.org/software/help2man/][GNU Help2man]] (optional) - -Run ‘./bootstrap’ to download the Nix daemon source code and to generate the -build system infrastructure using autoconf. It reports an error if an -inappropriate version of the above packages is being used. - -If you get an error like this one: - - configure.ac:46: error: possibly undefined macro: PKG_CHECK_MODULES - -it probably means that Autoconf couldn’t find ‘pkg.m4’, which is provided by -pkg-config. Make sure that ‘pkg.m4’ is available. For instance, if you -installed Automake in ‘/usr/local’, it wouldn’t look for ‘.m4’ files in -‘/usr/share’. So you have to invoke the following command in that case - - $ export ACLOCAL_PATH=/usr/share/aclocal - -See “info '(automake) Macro Search Path'” for more information. - -Then, run ‘./configure’ as usual. - -Finally, you have to invoke ‘make check’ to run tests. If anything fails, -take a look at “info '(guix) Installation'” or send a message to -. - -* Running Guix before it is installed - -See the same-named section in the manual. - -* The Perfect Setup - -The Perfect Setup to hack on Guix is basically the perfect setup used -for Guile hacking (info "(guile) Using Guile in Emacs"). First, you -need more than an editor, you need [[http://www.gnu.org/software/emacs][Emacs]], empowered by the wonderful -[[http://nongnu.org/geiser/][Geiser]]. - -Geiser allows for interactive and incremental development from within -Emacs: code compilation and evaluation from within buffers, access to -on-line documentation (docstrings), context-sensitive completion, M-. to -jump to an object definition, a REPL to try out your code, and more. - -To actually edit the code, Emacs already has a neat Scheme mode. But in -addition to that, you must not miss [[http://www.emacswiki.org/emacs/ParEdit][Paredit]]. It provides facilities to -directly operate on the syntax tree, such as raising an s-expression or -wrapping it, swallowing or rejecting the following s-expression, etc. - -* Submitting Patches - -Development is done using the Git distributed version control system. Thus, -access to the repository is not strictly necessary. We welcome contributions -in the form of patches as produced by ‘git format-patch’ sent to -guix-devel@gnu.org. Please write commit logs in the [[http://www.gnu.org/prep/standards/html_node/Change-Logs.html#Change-Logs][GNU ChangeLog -format]]; you can check the commit history for examples. - -Before submitting a patch that adds or modifies a package definition, please -run ‘guix lint PACKAGE’, where PACKAGE is the name of the new or modified -package, and fix any errors it reports. In addition, please make sure the -package builds on your platform, using ‘guix build’. You may also want to -check that dependent package (if applicable) are not affected by the change; -‘guix refresh --list-dependent PACKAGE’ will help you do that. - -When posting a patch to the mailing list, use "[PATCH] ..." as a subject. You -may use your email client or the ‘git send-mail’ command. - -As you become a regular contributor, you may find it convenient to have write -access to the repository (see below.) - -* Coding Style - -In general our code follows the [[info:standards][GNU Coding Standards]] (GCS). However, the GCS -do not say much about Scheme, so here are some additional rules. - -** Programming Paradigm - -Scheme code in Guix is written in a purely functional style. One exception is -code that involves input/output, and procedures that implement low-level -concepts, such as the ‘memoize’ procedure. - -** Modules - -Guile modules that are meant to be used on the builder side must live in the -(guix build …) name space. They must not refer to other Guix or GNU modules. -However, it is OK for a “host-side” module to use a build-side module. - -Modules that deal with the broader GNU system should be in the (gnu …) name -space rather than (guix …). - -** Data Types and Pattern Matching - -The tendency in classical Lisp is to use lists to represent everything, and -then to browse them “by hand” using ‘car’, ‘cdr’, ‘cadr’, and co. There are -several problems with that style, notably the fact that it is hard to read, -error-prone, and a hindrance to proper type error reports. - -Guix code should define appropriate data types (for instance, using -‘define-record-type*’) rather than abuse lists. In addition, it should use -pattern matching, via Guile’s (ice-9 match) module, especially when matching -lists. - -** Formatting Code - -When writing Scheme code, we follow common wisdom among Scheme programmers. -In general, we follow the [[http://mumble.net/~campbell/scheme/style.txt][Riastradh's Lisp Style Rules]]. This document happens -to describe the conventions mostly used in Guile’s code too. It is very -thoughtful and well written, so please do read it. - -Some special forms introduced in Guix, such as the ‘substitute*’ macro, have -special indentation rules. These are defined in the .dir-locals.el file, -which Emacs automatically uses. If you do not use Emacs, please make sure to -let your editor know the rules. - -We require all top-level procedures to carry a docstring. This requirement -can be relaxed for simple private procedures in the (guix build …) name space, -though. - -Procedures should not have more than four positional parameters. Use keyword -parameters for procedures that take more than four parameters. +or by checking the [[http://www.gnu.org/software/guix/manual/guix.html#Contributing][web copy of the manual]]. * Commit Access diff --git a/README b/README index 4d3367ed8f..df528222e9 100644 --- a/README +++ b/README @@ -46,8 +46,8 @@ See the manual for the installation instructions, either by running or by checking the [[http://www.gnu.org/software/guix/manual/guix.html#Installation][web copy of the manual]]. -For information on installation from a Git checkout, please see the ‘HACKING’ -file. +For information on installation from a Git checkout, please see the section +"Building from Git" in the manual. * Installing Guix from Guix diff --git a/configure.ac b/configure.ac index 50b65fdac1..2c8b9f076c 100644 --- a/configure.ac +++ b/configure.ac @@ -179,7 +179,7 @@ AC_CACHE_SAVE m4_include([config-daemon.ac]) dnl `dot' (from the Graphviz package) is only needed for maintainers. -dnl See `HACKING' for more info. +dnl See `Building from Git' in the manual for more info. AM_MISSING_PROG([DOT], [dot]) dnl Manual pages. diff --git a/doc.am b/doc.am index 14343ceacb..de232a87a4 100644 --- a/doc.am +++ b/doc.am @@ -19,6 +19,7 @@ info_TEXINFOS = doc/guix.texi EXTRA_DIST += \ + doc/contributing.texi \ doc/emacs.texi \ doc/fdl-1.3.texi \ doc/images/bootstrap-graph.dot \ diff --git a/doc/contributing.texi b/doc/contributing.texi new file mode 100644 index 0000000000..536f223da4 --- /dev/null +++ b/doc/contributing.texi @@ -0,0 +1,216 @@ +@node Contributing +@chapter Contributing + +This project is a cooperative effort, and we need your help to make it +grow! Please get in touch with us on @email{guix-devel@@gnu.org} and +@code{#guix} on the Freenode IRC network. We welcome ideas, bug +reports, patches, and anything that may be helpful to the project. We +particularly welcome help on packaging (@pxref{Packaging Guidelines}). + +@menu +* Building from Git:: The latest and greatest. +* Running Guix Before It Is Installed:: Hacker tricks. +* The Perfect Setup:: The right tools. +* Coding Style:: Hygiene of the contributor. +* Submitting Patches:: Share your work. +@end menu + +@node Building from Git +@section Building from Git + +If you want to hack Guix itself, it is recommended to use the latest +version from the Git repository. When building Guix from a checkout, +the following packages are required in addition to those mentioned in +the installation instructions (@pxref{Requirements}). + +@itemize +@item @url{http://gnu.org/software/autoconf/, GNU Autoconf}; +@item @url{http://gnu.org/software/automake/, GNU Automake}; +@item @url{http://gnu.org/software/gettext/, GNU Gettext}; +@item @url{http://www.graphviz.org/, Graphviz}; +@item @url{http://www.gnu.org/software/help2man/, GNU Help2man (optional)}. +@end itemize + +Run @command{./bootstrap} to download the Nix daemon source code and to +generate the build system infrastructure using autoconf. It reports an +error if an inappropriate version of the above packages is being used. + +@noindent +If you get an error like this one: + +@example +configure.ac:46: error: possibly undefined macro: PKG_CHECK_MODULES +@end example + +it probably means that Autoconf couldn’t find @file{pkg.m4}, which is +provided by @command{pkg-config}. Make sure that @file{pkg.m4} is +available. For instance, if you installed Automake in +@file{/usr/local}, it wouldn’t look for @file{.m4} files in +@file{/usr/share}. So you have to invoke the following command in that +case + +@example +export ACLOCAL_PATH=/usr/share/aclocal +@end example + +See @pxref{Macro Search Path,,, automake, The GNU Automake Manual} for +more information. + +Then, run @command{./configure} as usual. + +Finally, you have to invoke @code{make check} to run tests. If anything +fails, take a look at installation instructions (@pxref{Installation}) +or send a message to the @email{guix-devel@@gnu.org, mailing list}. + + +@node Running Guix Before It Is Installed +@section Running Guix Before It Is Installed + +In order to keep a sane working environment, you will find it useful to +test the changes made in your local source tree checkout without +actually installing them. So that you can distinguish between your +``end-user'' hat and your ``motley'' costume. + +To that end, all the command-line tools can be used even if you have not +run @code{make install}. To do that, prefix each command with +@command{./pre-inst-env} (the @file{pre-inst-env} script lives in the +top build tree of Guix), as in: + +@example +$ sudo ./pre-inst-env guix-daemon --build-users-group=guixbuild +$ ./pre-inst-env guix build hello +@end example + +@noindent +Similarly, for a Guile session using the Guix modules: + +@example +$ ./pre-inst-env guile -c '(use-modules (guix utils)) (pk (%current-system))' +@end example + +The @command{pre-inst-env} script sets up all the environment variables +necessary to support this, including @env{PATH} and @env{GUILE_LOAD_PATH}. + + +@node The Perfect Setup +@section The Perfect Setup + +The Perfect Setup to hack on Guix is basically the perfect setup used +for Guile hacking (@pxref{Using Guile in Emacs,,, guile, Guile Reference +Manual}). First, you need more than an editor, you need +@url{http://www.gnu.org/software/emacs, Emacs}, empowered by the +wonderful @url{http://nongnu.org/geiser/, Geiser}. + +Geiser allows for interactive and incremental development from within +Emacs: code compilation and evaluation from within buffers, access to +on-line documentation (docstrings), context-sensitive completion, +@kbd{M-.} to jump to an object definition, a REPL to try out your code, +and more (@pxref{Introduction,,, geiser, Geiser User Manual}). For +convenient Guix development, make sure to augment Guile’s load path so +that it finds source files from your checkout: + +@lisp +;; @r{Assuming the Guix checkout is in ~/src/guix.} +(add-to-list 'geiser-guile-load-path "~/src/guix") +@end lisp + +To actually edit the code, Emacs already has a neat Scheme mode. But in +addition to that, you must not miss +@url{http://www.emacswiki.org/emacs/ParEdit, Paredit}. It provides +facilities to directly operate on the syntax tree, such as raising an +s-expression or wrapping it, swallowing or rejecting the following +s-expression, etc. + + +@node Coding Style +@section Coding Style + +In general our code follows the GNU Coding Standards (@pxref{Top,,, +standards, GNU Coding Standards}). However, they do not say much about +Scheme, so here are some additional rules. + +@menu +* Programming Paradigm:: How to compose your elements. +* Modules:: Where to store your code? +* Data Types and Pattern Matching:: Implementing data structures. +* Formatting Code:: Writing conventions. +@end menu + +@node Programming Paradigm +@subsection Programming Paradigm + +Scheme code in Guix is written in a purely functional style. One +exception is code that involves input/output, and procedures that +implement low-level concepts, such as the @code{memoize} procedure. + +@node Modules +@subsection Modules + +Guile modules that are meant to be used on the builder side must live in +the @code{(guix build @dots{})} name space. They must not refer to +other Guix or GNU modules. However, it is OK for a ``host-side'' module +to use a build-side module. + +Modules that deal with the broader GNU system should be in the +@code{(gnu @dots{})} name space rather than @code{(guix @dots{})}. + +@node Data Types and Pattern Matching +@subsection Data Types and Pattern Matching + +The tendency in classical Lisp is to use lists to represent everything, +and then to browse them ``by hand'' using @code{car}, @code{cdr}, +@code{cadr}, and co. There are several problems with that style, +notably the fact that it is hard to read, error-prone, and a hindrance +to proper type error reports. + +Guix code should define appropriate data types (for instance, using +@code{define-record-type*}) rather than abuse lists. In addition, it +should use pattern matching, via Guile’s @code{(ice-9 match)} module, +especially when matching lists. + +@node Formatting Code +@subsection Formatting Code + +When writing Scheme code, we follow common wisdom among Scheme +programmers. In general, we follow the +@url{http://mumble.net/~campbell/scheme/style.txt, Riastradh's Lisp +Style Rules}. This document happens to describe the conventions mostly +used in Guile’s code too. It is very thoughtful and well written, so +please do read it. + +Some special forms introduced in Guix, such as the @code{substitute*} +macro, have special indentation rules. These are defined in the +@file{.dir-locals.el} file, which Emacs automatically uses. If you do +not use Emacs, please make sure to let your editor know the rules. + +We require all top-level procedures to carry a docstring. This +requirement can be relaxed for simple private procedures in the +@code{(guix build @dots{})} name space, though. + +Procedures should not have more than four positional parameters. Use +keyword parameters for procedures that take more than four parameters. + + +@node Submitting Patches +@section Submitting Patches + +Development is done using the Git distributed version control system. +Thus, access to the repository is not strictly necessary. We welcome +contributions in the form of patches as produced by @code{git +format-patch} sent to the @email{guix-devel@@gnu.org, mailing list}. +Please write commit logs in the ChangeLog format (@pxref{Change Logs,,, +standards, GNU Coding Standards}); you can check the commit history for +examples. + +Before submitting a patch that adds or modifies a package definition, +please run @code{guix lint @var{package}}, where @var{package} is the +name of the new or modified package, and fix any errors it reports +(@pxref{Invoking guix lint}). In addition, please make sure the package +builds on your platform, using @code{guix build @var{package}}. You may +also want to check that dependent package (if applicable) are not +affected by the change; @code{guix refresh --list-dependent +@var{package}} will help you do that (@pxref{Invoking guix refresh}). + +When posting a patch to the mailing list, use @samp{[PATCH] @dots{}} as a +subject. You may use your email client or the @command{git send-mail} +command. diff --git a/doc/guix.texi b/doc/guix.texi index c70d1000ae..46dccb8e2b 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -13,6 +13,8 @@ Copyright @copyright{} 2012, 2013, 2014, 2015 Ludovic Courtès@* Copyright @copyright{} 2013, 2014 Andreas Enge@* Copyright @copyright{} 2013 Nikita Karetnikov@* +Copyright @copyright{} 2015 Mathieu Lirzin@* +Copyright @copyright{} 2014 Pierre-Antoine Rault@* Copyright @copyright{} 2015 Taylan Ulrich Bayırlı/Kammer Permission is granted to copy, distribute and/or modify this document @@ -88,7 +90,6 @@ Installation * Running the Test Suite:: Testing Guix. * Setting Up the Daemon:: Preparing the build daemon's environment. * Invoking guix-daemon:: Running the build daemon. -* Running Guix Before It Is Installed:: Hacker tricks. Setting Up the Daemon @@ -177,6 +178,21 @@ Packaging Guidelines * Perl Modules:: Little pearls. * Fonts:: Fond of fonts. +Contributing + +* Building from Git:: The latest and greatest. +* Running Guix Before It Is Installed:: Hacker tricks. +* The Perfect Setup:: The right tools. +* Coding Style:: Hygiene of the contributor. +* Submitting Patches:: Share your work. + +Coding Style + +* Programming Paradigm:: How to compose your elements. +* Modules:: Where to store your code? +* Data Types and Pattern Matching:: Implementing data structures. +* Formatting Code:: Writing conventions. + @end detailmenu @end menu @@ -253,7 +269,6 @@ instead, you want to install the complete GNU operating system, * Running the Test Suite:: Testing Guix. * Setting Up the Daemon:: Preparing the build daemon's environment. * Invoking guix-daemon:: Running the build daemon. -* Running Guix Before It Is Installed:: Hacker tricks. @end menu @node Binary Installation @@ -847,44 +862,6 @@ useful in exceptional circumstances, such as if you need to run several daemons on the same machine. @end table -@node Running Guix Before It Is Installed -@section Running Guix Before It Is Installed - -If you are hacking Guix itself---which is a good idea!---you will find -it useful to test the changes made in your local source tree checkout -without actually installing them. - -To that end, all the command-line tools can be used even if you have not -run @command{make install}. To do that, prefix each command with -@command{./pre-inst-env} (the @file{pre-inst-env} script lives in the -top build tree of Guix), as in: - -@example -$ sudo ./pre-inst-env guix-daemon --build-users-group=guixbuild -$ ./pre-inst-env guix build hello -@end example - -@noindent -Similarly, for a Guile session using the Guix modules: - -@example -$ ./pre-inst-env guile -c '(use-modules (guix utils)) (pk (%current-system))' -@end example - -The @command{pre-inst-env} script sets up all the environment variables -necessary to support this, including @code{PATH} and -@code{GUILE_LOAD_PATH}. - -If you are hacking Guix from Emacs using the wonderful Geiser -(@pxref{Introduction,,, geiser, Geiser User Manual}), make sure to -augment Guile's load path so that it finds source files from your -checkout: - -@lisp -;; Assuming the Guix checkout is in ~/src/guix. -(add-to-list 'geiser-guile-load-path "~/src/guix") -@end lisp - @c ********************************************************************* @node Package Management @@ -6788,22 +6765,8 @@ Second, some of the required packages could fail to build for that platform. Lastly, the generated binaries could be broken for some reason. - @c ********************************************************************* -@node Contributing -@chapter Contributing - -This project is a cooperative effort, and we need your help to make it -grow! Please get in touch with us on @email{guix-devel@@gnu.org} and -@code{#guix} on the Freenode IRC network. We welcome ideas, bug -reports, patches, and anything that may be helpful to the project. We -particularly welcome help on packaging (@pxref{Packaging Guidelines}). - -Please see the -@url{http://git.savannah.gnu.org/cgit/guix.git/tree/HACKING, -@file{HACKING} file} that comes with the Guix source code for practical -details about contributions. - +@include contributing.texi @c ********************************************************************* @node Acknowledgments From 4c50e5ab3a393c6d86fc6362c58f7ecf32dd9680 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Fri, 12 Jun 2015 03:24:12 -0400 Subject: [PATCH 43/45] gnu: python: Disable ssl test that fails with openssl-1.0.2b. * gnu/packages/patches/python-disable-ssl-test.patch: New file. * gnu-system.am (dist_patch_DATA): Add it. * gnu/packages/python.scm (python): Add patch. --- gnu-system.am | 1 + gnu/packages/patches/python-disable-ssl-test.patch | 12 ++++++++++++ gnu/packages/python.scm | 4 +++- 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/python-disable-ssl-test.patch diff --git a/gnu-system.am b/gnu-system.am index 7e0ee52875..fd7b1e5e86 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -526,6 +526,7 @@ dist_patch_DATA = \ gnu/packages/patches/pybugz-encode-error.patch \ gnu/packages/patches/pybugz-stty.patch \ gnu/packages/patches/pyqt-configure.patch \ + gnu/packages/patches/python-disable-ssl-test.patch \ gnu/packages/patches/python-fix-tests.patch \ gnu/packages/patches/python-libffi-mips-n32-fix.patch \ gnu/packages/patches/python2-rdflib-drop-sparqlwrapper.patch \ diff --git a/gnu/packages/patches/python-disable-ssl-test.patch b/gnu/packages/patches/python-disable-ssl-test.patch new file mode 100644 index 0000000000..e351c77505 --- /dev/null +++ b/gnu/packages/patches/python-disable-ssl-test.patch @@ -0,0 +1,12 @@ +Disable a test that fails with openssl-1.0.2b. + +--- Lib/test/test_ssl.py.orig 2015-02-25 06:27:45.000000000 -0500 ++++ Lib/test/test_ssl.py 2015-06-12 03:14:09.395212502 -0400 +@@ -2718,6 +2718,7 @@ + chatty=True, connectionchatty=True) + self.assertIs(stats['compression'], None) + ++ @unittest.skipIf(True, "openssl 1.0.2b complains: dh key too small") + def test_dh_params(self): + # Check we can get a connection with ephemeral Diffie-Hellman + context = ssl.SSLContext(ssl.PROTOCOL_TLSv1) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 914c2dc23c..232a785778 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -207,7 +207,9 @@ data types.") (method url-fetch) (uri (string-append "https://www.python.org/ftp/python/" version "/Python-" version ".tar.xz")) - (patches (list (search-patch "python-fix-tests.patch"))) + (patches (list (search-patch "python-fix-tests.patch") + ;; XXX Try removing this patch for python > 3.4.3 + (search-patch "python-disable-ssl-test.patch"))) (patch-flags '("-p0")) (sha256 (base32 From 0ad8f76f7ff3233533dbc0afb109946d5c459b1e Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Fri, 12 Jun 2015 03:40:12 -0400 Subject: [PATCH 44/45] gnu: perl-net-ssleay: Disable test that fails with openssl-1.0.2b. * gnu/packages/patches/perl-net-ssleay-disable-ede-test.patch: New file. * gnu-system.am (dist_patch_DATA): Add it. * gnu/packages/openssl.scm (perl-net-ssleay): Add patch. --- gnu-system.am | 1 + gnu/packages/openssl.scm | 5 +++- .../perl-net-ssleay-disable-ede-test.patch | 23 +++++++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/perl-net-ssleay-disable-ede-test.patch diff --git a/gnu-system.am b/gnu-system.am index fd7b1e5e86..d551eb8ba2 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -512,6 +512,7 @@ dist_patch_DATA = \ gnu/packages/patches/perl-gd-options-passthrough-and-fontconfig.patch \ gnu/packages/patches/perl-module-pluggable-search.patch \ gnu/packages/patches/perl-net-amazon-s3-moose-warning.patch \ + gnu/packages/patches/perl-net-ssleay-disable-ede-test.patch \ gnu/packages/patches/perl-no-sys-dirs.patch \ gnu/packages/patches/perl-tk-x11-discover.patch \ gnu/packages/patches/petsc-fix-threadcomm.patch \ diff --git a/gnu/packages/openssl.scm b/gnu/packages/openssl.scm index 1ed7a7a1f2..5ed0f63268 100644 --- a/gnu/packages/openssl.scm +++ b/gnu/packages/openssl.scm @@ -91,7 +91,10 @@ "Net-SSLeay-" version ".tar.gz")) (sha256 (base32 - "1m2wwzhjwsg0drlhp9w12fl6bsgj69v8gdz72jqrqll3qr7f408p")))) + "1m2wwzhjwsg0drlhp9w12fl6bsgj69v8gdz72jqrqll3qr7f408p")) + (patches + ;; XXX Try removing this patch for perl-net-ssleay > 1.68 + (list (search-patch "perl-net-ssleay-disable-ede-test.patch"))))) (build-system perl-build-system) (inputs `(("openssl" ,openssl))) (arguments diff --git a/gnu/packages/patches/perl-net-ssleay-disable-ede-test.patch b/gnu/packages/patches/perl-net-ssleay-disable-ede-test.patch new file mode 100644 index 0000000000..16f136fb54 --- /dev/null +++ b/gnu/packages/patches/perl-net-ssleay-disable-ede-test.patch @@ -0,0 +1,23 @@ +Disable a test that fails with openssl-1.0.2b. + +--- Net-SSLeay-1.68/t/local/33_x509_create_cert.t.orig 2014-06-07 02:01:39.000000000 -0400 ++++ Net-SSLeay-1.68/t/local/33_x509_create_cert.t 2015-06-12 03:38:57.620286888 -0400 +@@ -2,7 +2,7 @@ + + use strict; + use warnings; +-use Test::More tests => 123; ++use Test::More tests => 122; + use Net::SSLeay qw/MBSTRING_ASC MBSTRING_UTF8 EVP_PK_RSA EVP_PKT_SIGN EVP_PKT_ENC/; + use File::Spec; + use utf8; +@@ -101,7 +101,8 @@ + like(my $key_pem3 = Net::SSLeay::PEM_get_string_PrivateKey($pk,"password",$alg1), qr/-----BEGIN (ENCRYPTED|RSA) PRIVATE KEY-----/, "PEM_get_string_PrivateKey+passwd+enc_alg"); + + ok(my $alg2 = Net::SSLeay::EVP_get_cipherbyname("DES-EDE3-OFB"), "EVP_get_cipherbyname"); +- like(my $key_pem4 = Net::SSLeay::PEM_get_string_PrivateKey($pk,"password",$alg2), qr/-----BEGIN (ENCRYPTED|RSA) PRIVATE KEY-----/, "PEM_get_string_PrivateKey+passwd+enc_alg"); ++ # This test fails with openssl-1.0.2b ++ #like(my $key_pem4 = Net::SSLeay::PEM_get_string_PrivateKey($pk,"password",$alg2), qr/-----BEGIN (ENCRYPTED|RSA) PRIVATE KEY-----/, "PEM_get_string_PrivateKey+passwd+enc_alg"); + + is(Net::SSLeay::X509_NAME_print_ex($name), "O=Company Name,C=UK,CN=Common name text X509", "X509_NAME_print_ex"); + From 7871724df7218428fac53133496c474bac8c5ea8 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Fri, 12 Jun 2015 01:24:58 -0400 Subject: [PATCH 45/45] gnu: openssl: Update to 1.0.2b. * gnu/packages/openssl.scm (openssl): Update to 1.0.2b. --- gnu/packages/openssl.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/openssl.scm b/gnu/packages/openssl.scm index 5ed0f63268..dec51a1e04 100644 --- a/gnu/packages/openssl.scm +++ b/gnu/packages/openssl.scm @@ -29,14 +29,14 @@ (define-public openssl (package (name "openssl") - (version "1.0.2a") + (version "1.0.2b") (source (origin (method url-fetch) (uri (string-append "ftp://ftp.openssl.org/source/openssl-" version ".tar.gz")) (sha256 (base32 - "0jijgzf72659pikms2bc5w31h78xrd1h5zp2r01an2h340y3kdhm")) + "0gwf4fy1yqmai6wph0g9lh09iarwxaa70hm7jm0rf1qakz68im6m")) (patches (list (search-patch "openssl-runpath.patch"))))) (build-system gnu-build-system) (native-inputs `(("perl" ,perl)))