From 4f7b564adbc09267fa61ee93292e2fc8a470f9cd Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 17 Jul 2015 22:31:12 +0200 Subject: download: Remove spurious warning about 'https_proxy'. * guix/build/download.scm (open-connection-for-uri)[with-https-proxy]: Warn about 'https_proxy' only when 'getenv' returns a non-empty string. --- guix/build/download.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'guix/build') 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 @@ (define https? (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)) -- cgit v1.2.3 From 13f0c6ed4147d381e7b5e4601a50fe9f997d0ca5 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 17 Jul 2015 23:31:29 +0200 Subject: syscalls: Struct deserializer can now return arbitrary objects. * guix/build/syscalls.scm (read-types): Add RETURN and VALUES parameters. (define-c-struct): Add WRAP-FIELDS parameter and pass it to 'read-types'. (sockaddr-in, sockaddr-in6): Add first argument that uses 'make-socket-address'. (read-socket-address): Remove 'match' on the result of 'read-sockaddr-in' and 'read-sockaddr-in6'. --- guix/build/syscalls.scm | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'guix/build') 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 @@ (define-syntax read-type (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 @@ (define ifreq-struct-size 32)) (define-c-struct sockaddr-in ; + (lambda (family port address) + (make-socket-address family address port)) read-sockaddr-in write-sockaddr-in! (family unsigned-short) @@ -470,6 +473,8 @@ (define-c-struct sockaddr-in ; (address (int32 ~ big))) (define-c-struct sockaddr-in6 ; + (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 @@ (define (read-socket-address bv 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)))) -- cgit v1.2.3 From 6e9f2913ba800e3488b95c661438f3981095a259 Mon Sep 17 00:00:00 2001 From: pjotrp Date: Mon, 13 Jul 2015 15:32:36 +0200 Subject: build-system/ruby: Add #:gem-flags parameter. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * guix/build-system/ruby.scm (build): add 'gem-flags' key * guix/build/ruby-build-system.scm (build): use 'gem-flags' key * doc/guix.texi (Build Systems): Mention #:gem-flags. Co-authored-by: Ludovic Courtès --- doc/guix.texi | 3 ++- guix/build-system/ruby.scm | 2 ++ guix/build/ruby-build-system.scm | 12 +++++++----- 3 files changed, 11 insertions(+), 6 deletions(-) (limited to 'guix/build') diff --git a/doc/guix.texi b/doc/guix.texi index 0d24b12f8c..71b3b2d529 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -2458,7 +2458,8 @@ implements the RubyGems build procedure used by Ruby packages, which involves running @code{gem build} followed by @code{gem install}. Which Ruby package is used can be specified with the @code{#:ruby} -parameter. +parameter. A list of additional flags to be passed to the @command{gem} +command can be specified with the @code{#:gem-flags} parameter. @end defvr @defvr {Scheme Variable} waf-build-system diff --git a/guix/build-system/ruby.scm b/guix/build-system/ruby.scm index e4fda30cf3..135eda665b 100644 --- a/guix/build-system/ruby.scm +++ b/guix/build-system/ruby.scm @@ -71,6 +71,7 @@ (define private-keywords (define* (ruby-build store name inputs #:key + (gem-flags ''()) (test-target "test") (tests? #t) (phases '(@ (guix build ruby-build-system) @@ -95,6 +96,7 @@ (define builder (source source)) #:system ,system + #:gem-flags ,gem-flags #:test-target ,test-target #:tests? ,tests? #:phases ,phases 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 @@ (define* (check #:key tests? test-target #:allow-other-keys) (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 @@ (define* (install #:key source inputs outputs #:allow-other-keys) (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 -- cgit v1.2.3