From df1fab5837ccecb952faf2bacf67b2d9c737af42 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 13 Oct 2012 22:36:39 +0200 Subject: 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. --- guix/utils.scm | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'guix/utils.scm') 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 @@ (define (memoize proc) (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'." -- cgit v1.2.3