aboutsummaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2012-10-13 22:36:39 +0200
committerLudovic Courtès <ludo@gnu.org>2012-10-13 22:36:39 +0200
commitdf1fab5837ccecb952faf2bacf67b2d9c737af42 (patch)
tree9cb73ae682a3a141a5a1e0389a36cf9c3a0dc567 /guix
parent4004f95379acf963529c8693452b78164de8febe (diff)
downloadgnu-guix-df1fab5837ccecb952faf2bacf67b2d9c737af42.tar
gnu-guix-df1fab5837ccecb952faf2bacf67b2d9c737af42.tar.gz
distro: Add a statically-linked, relocatable Guile 2.0 package.
* distro/packages/base.scm (%guile-static, %guile-static-stripped): New variables. * distro/patches/guile-relocatable.patch: New file. * Makefile.am (dist_patch_DATA): Add it.
Diffstat (limited to 'guix')
-rw-r--r--guix/store.scm4
-rw-r--r--guix/utils.scm20
2 files changed, 24 insertions, 0 deletions
diff --git a/guix/store.scm b/guix/store.scm
index 3eedcbed57..9c965af605 100644
--- a/guix/store.scm
+++ b/guix/store.scm
@@ -264,6 +264,10 @@
;; This trick allows use of the `scm_c_read' optimization.
(socket PF_UNIX SOCK_STREAM 0)))
(a (make-socket-address PF_UNIX file)))
+
+ ;; Enlarge the receive buffer.
+ (setsockopt s SOL_SOCKET SO_RCVBUF (* 12 1024))
+
(connect s a)
(write-int %worker-magic-1 s)
(let ((r (read-int s)))
diff --git a/guix/utils.scm b/guix/utils.scm
index a87f119558..2d51e44a22 100644
--- a/guix/utils.scm
+++ b/guix/utils.scm
@@ -588,6 +588,26 @@ FIELD/DEFAULT-VALUE tuples."
(hash-set! cache args results)
(apply values results)))))))
+(define-syntax hash-set-proc
+ (syntax-rules (eq? eqv? equal?)
+ ((_ eq?) hashq-set!)
+ ((_ eqv?) hashv-set!)
+ ((_ equal?) hash-set!)))
+
+(define-syntax hash-ref*
+ (syntax-rules (eq? eqv? equal?)
+ ((_ table key eq?) (hashq-ref table key))
+ ((_ table key eqv?) (hashv-ref table key))
+ ((_ table key equal?) (hash-ref table key))))
+
+(define-syntax memoizing-lambda
+ (syntax-rules ()
+ ((_ ((arg type) ...) body ...)
+ (let ((cache (make-weak-key-hash-table 100)))
+ (lambda (arg ...)
+ (or (and (hash-ref* cache)))
+ )))))
+
(define (gnu-triplet->nix-system triplet)
"Return the Nix system type corresponding to TRIPLET, a GNU triplet as
returned by `config.guess'."