summaryrefslogtreecommitdiff
path: root/guix/build
diff options
context:
space:
mode:
authorMark H Weaver <mhw@netris.org>2015-07-19 18:12:34 -0400
committerMark H Weaver <mhw@netris.org>2015-07-19 18:12:34 -0400
commit1b4e48d498a96d478baa1aae7d9c7ecdbd817d6f (patch)
tree4b650999e49a6f4d3dd116fab3f9ee8222247e07 /guix/build
parentaa27987f71cb8afa698ede551e20b1248f160113 (diff)
parent50c7a1e297bff0935674b4f30e854a8889becfdd (diff)
downloadgnu-guix-1b4e48d498a96d478baa1aae7d9c7ecdbd817d6f.tar
gnu-guix-1b4e48d498a96d478baa1aae7d9c7ecdbd817d6f.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'guix/build')
-rw-r--r--guix/build/download.scm3
-rw-r--r--guix/build/ruby-build-system.scm12
-rw-r--r--guix/build/syscalls.scm32
3 files changed, 25 insertions, 22 deletions
diff --git a/guix/build/download.scm b/guix/build/download.scm
index 65d18eb839..ae59b0109c 100644
--- a/guix/build/download.scm
+++ b/guix/build/download.scm
@@ -231,7 +231,8 @@ host name without trailing dot."
(resolve-interface '(web client))
'current-http-proxy))
(parameterize ((current-http-proxy #f))
- (when (getenv "https_proxy")
+ (when (and=> (getenv "https_proxy")
+ (negate string-null?))
(format (current-error-port)
"warning: 'https_proxy' is ignored~%"))
(thunk))
diff --git a/guix/build/ruby-build-system.scm b/guix/build/ruby-build-system.scm
index fce39b8dfd..307ac919dd 100644
--- a/guix/build/ruby-build-system.scm
+++ b/guix/build/ruby-build-system.scm
@@ -63,7 +63,8 @@ directory."
(zero? (system* "rake" test-target))
#t))
-(define* (install #:key source inputs outputs #:allow-other-keys)
+(define* (install #:key source inputs outputs (gem-flags '())
+ #:allow-other-keys)
(let* ((ruby-version
(match:substring (string-match "ruby-(.*)\\.[0-9]$"
(assoc-ref inputs "ruby"))
@@ -72,10 +73,11 @@ directory."
(gem-home (string-append out "/lib/ruby/gems/" ruby-version ".0")))
(setenv "GEM_HOME" gem-home)
(mkdir-p gem-home)
- (zero? (system* "gem" "install" "--local"
- (first-matching-file "\\.gem$")
- ;; Executables should go into /bin, not /lib/ruby/gems.
- "--bindir" (string-append out "/bin")))))
+ (zero? (apply system* "gem" "install" "--local"
+ (first-matching-file "\\.gem$")
+ ;; Executables should go into /bin, not /lib/ruby/gems.
+ "--bindir" (string-append out "/bin")
+ gem-flags))))
(define %standard-phases
(modify-phases gnu:%standard-phases
diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm
index dcca5fc339..b7c0f7e745 100644
--- a/guix/build/syscalls.scm
+++ b/guix/build/syscalls.scm
@@ -398,22 +398,23 @@ system to PUT-OLD."
(define-syntax read-types
(syntax-rules ()
- ((_ bv offset ())
- '())
- ((_ bv offset (type0 types ...))
- (cons (read-type bv offset type0)
- (read-types bv (+ offset (type-size type0)) (types ...))))))
+ ((_ return bv offset () (values ...))
+ (return values ...))
+ ((_ return bv offset (type0 types ...) (values ...))
+ (read-types return
+ bv (+ offset (type-size type0)) (types ...)
+ (values ... (read-type bv offset type0))))))
(define-syntax define-c-struct
(syntax-rules ()
- "Define READ as an optimized serializer and WRITE! as a deserializer for
-the C structure with the given TYPES."
- ((_ name read write! (fields types) ...)
+ "Define READ as a deserializer and WRITE! as a serializer for the C
+structure with the given TYPES. READ uses WRAP-FIELDS to return its value."
+ ((_ name wrap-fields read write! (fields types) ...)
(begin
(define (write! bv offset fields ...)
(write-types bv offset (types ...) (fields ...)))
(define (read bv offset)
- (read-types bv offset (types ...)))))))
+ (read-types wrap-fields bv offset (types ...) ()))))))
;;;
@@ -463,6 +464,8 @@ the C structure with the given TYPES."
32))
(define-c-struct sockaddr-in ;<linux/in.h>
+ (lambda (family port address)
+ (make-socket-address family address port))
read-sockaddr-in
write-sockaddr-in!
(family unsigned-short)
@@ -470,6 +473,8 @@ the C structure with the given TYPES."
(address (int32 ~ big)))
(define-c-struct sockaddr-in6 ;<linux/in6.h>
+ (lambda (family port flowinfo address scopeid)
+ (make-socket-address family address port flowinfo scopeid))
read-sockaddr-in6
write-sockaddr-in6!
(family unsigned-short)
@@ -501,14 +506,9 @@ bytevector BV at INDEX."
"Read a socket address from bytevector BV at INDEX."
(let ((family (bytevector-u16-native-ref bv index)))
(cond ((= family AF_INET)
- (match (read-sockaddr-in bv index)
- ((family port address)
- (make-socket-address family address port))))
+ (read-sockaddr-in bv index))
((= family AF_INET6)
- (match (read-sockaddr-in6 bv index)
- ((family port flowinfo address scopeid)
- (make-socket-address family address port
- flowinfo scopeid))))
+ (read-sockaddr-in6 bv index))
(else
"unsupported socket address family" family))))