diff options
author | Marius Bakke <mbakke@fastmail.com> | 2018-10-05 19:15:39 +0200 |
---|---|---|
committer | Marius Bakke <mbakke@fastmail.com> | 2018-10-05 19:15:39 +0200 |
commit | cf6db76d2af2f287f12928df160447ab4165b3e5 (patch) | |
tree | 49a1309c0e04c00090ab106f7ae3495a6da328c1 /guix/build | |
parent | e65b2181e8b436278e3dd0b405602a400fbd0a75 (diff) | |
parent | a6798218bea0d6b2df598042d1ced29f74bb4250 (diff) |
Merge branch 'master' into core-updates
Diffstat (limited to 'guix/build')
-rw-r--r-- | guix/build/download.scm | 33 | ||||
-rw-r--r-- | guix/build/haskell-build-system.scm | 12 | ||||
-rw-r--r-- | guix/build/lisp-utils.scm | 7 |
3 files changed, 38 insertions, 14 deletions
diff --git a/guix/build/download.scm b/guix/build/download.scm index 315a3554ec..54163849a2 100644 --- a/guix/build/download.scm +++ b/guix/build/download.scm @@ -115,7 +115,7 @@ and 'guix publish', something like (string-drop path 33) path))) -(define* (ftp-fetch uri file #:key timeout) +(define* (ftp-fetch uri file #:key timeout print-build-trace?) "Fetch data from URI and write it to FILE. Return FILE on success. Bail out if the connection could not be established in less than TIMEOUT seconds." (let* ((conn (match (and=> (uri-userinfo uri) @@ -136,12 +136,17 @@ out if the connection could not be established in less than TIMEOUT seconds." (lambda (out) (dump-port* in out #:buffer-size %http-receive-buffer-size - #:reporter (progress-reporter/file - (uri-abbreviation uri) size)))) - - (ftp-close conn)) - (newline) - file) + #:reporter + (if print-build-trace? + (progress-reporter/trace + file (uri->string uri) size) + (progress-reporter/file + (uri-abbreviation uri) size))))) + + (ftp-close conn) + (unless print-build-trace? + (newline)) + file)) ;; Autoload GnuTLS so that this module can be used even when GnuTLS is ;; not available. At compile time, this yields "possibly unbound @@ -723,7 +728,8 @@ Return a list of URIs." #:key (timeout 10) (verify-certificate? #t) (mirrors '()) (content-addressed-mirrors '()) - (hashes '())) + (hashes '()) + print-build-trace?) "Fetch FILE from URL; URL may be either a single string, or a list of string denoting alternate URLs for FILE. Return #f on failure, and FILE on success. @@ -759,13 +765,18 @@ otherwise simply ignore them." (lambda (output) (dump-port* port output #:buffer-size %http-receive-buffer-size - #:reporter (progress-reporter/file - (uri-abbreviation uri) size)) + #:reporter (if print-build-trace? + (progress-reporter/trace + file (uri->string uri) size) + (progress-reporter/file + (uri-abbreviation uri) size))) (newline))) file))) ((ftp) (false-if-exception* (ftp-fetch uri file - #:timeout timeout))) + #:timeout timeout + #:print-build-trace? + print-build-trace?))) (else (format #t "skipping URI with unsupported scheme: ~s~%" uri) diff --git a/guix/build/haskell-build-system.scm b/guix/build/haskell-build-system.scm index 5a72d22842..72714a29ad 100644 --- a/guix/build/haskell-build-system.scm +++ b/guix/build/haskell-build-system.scm @@ -28,6 +28,7 @@ #:use-module (ice-9 regex) #:use-module (ice-9 match) #:use-module (ice-9 vlist) + #:use-module (ice-9 ftw) #:export (%standard-phases haskell-build)) @@ -266,8 +267,19 @@ given Haskell package." (run-setuphs "haddock" haddock-flags)) #t) +(define* (patch-cabal-file #:key cabal-revision #:allow-other-keys) + (when cabal-revision + ;; Cabal requires there to be a single file with the suffix ".cabal". + (match (scandir "." (cut string-suffix? ".cabal" <>)) + ((original) + (format #t "replacing ~s with ~s~%" original cabal-revision) + (copy-file cabal-revision original)) + (_ (error "Could not find a Cabal file to patch.")))) + #t) + (define %standard-phases (modify-phases gnu:%standard-phases + (add-after 'unpack 'patch-cabal-file patch-cabal-file) (delete 'bootstrap) (add-before 'configure 'setup-compiler setup-compiler) (add-before 'install 'haddock haddock) diff --git a/guix/build/lisp-utils.scm b/guix/build/lisp-utils.scm index 6470cfec97..97bc6197a3 100644 --- a/guix/build/lisp-utils.scm +++ b/guix/build/lisp-utils.scm @@ -84,11 +84,12 @@ (define (normalize-dependency dependency) "Normalize the name of DEPENDENCY. Handles dependency definitions of the dependency-def form described by -<https://common-lisp.net/project/asdf/asdf.html#The-defsystem-grammar>." +<https://common-lisp.net/project/asdf/asdf.html#The-defsystem-grammar>. +Assume that any symbols in DEPENDENCY will be in upper-case." (match dependency - ((':version name rest ...) + ((':VERSION name rest ...) `(:version ,(normalize-string name) ,@rest)) - ((':feature feature-specification dependency-specification) + ((':FEATURE feature-specification dependency-specification) `(:feature ,feature-specification ,(normalize-dependency dependency-specification))) |