From 602db62c7c746f777cda62aff9e5450d041f488f Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 12 May 2017 11:53:08 +0200 Subject: gnu: talloc: Add static variant. * gnu/packages/samba.scm (talloc/static): New variable. --- gnu/packages/samba.scm | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/gnu/packages/samba.scm b/gnu/packages/samba.scm index 5bcd5980a1..623ef93a4e 100644 --- a/gnu/packages/samba.scm +++ b/gnu/packages/samba.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2015 Ludovic Courtès +;;; Copyright © 2013, 2015, 2017 Ludovic Courtès ;;; Copyright © 2015 Mark H Weaver ;;; Copyright © 2016, 2017 Efraim Flashner ;;; Copyright © 2016 Adonay "adfeno" Felipe Nogueira @@ -25,6 +25,7 @@ (define-module (gnu packages samba) #:use-module (guix download) #:use-module (guix build-system gnu) #:use-module (guix licenses) + #:use-module (guix utils) #:use-module (gnu packages acl) #:use-module (gnu packages admin) #:use-module (gnu packages autotools) @@ -252,6 +253,44 @@ (define-public talloc destructors. It is the core memory allocator used in Samba.") (license gpl3+))) ;; The bundled "replace" library uses LGPL3. +(define-public talloc/static + (package + (inherit talloc) + (name "talloc-static") + (synopsis + "Hierarchical, reference counted memory pool system (static library)") + (arguments + (substitute-keyword-arguments (package-arguments talloc) + ((#:phases phases) + ;; Since Waf, the build system talloc uses, apparently does not + ;; support building static libraries from a ./configure flag, roll our + ;; own build process. No need to be ashamed, we're not the only ones + ;; doing that: + ;; . + ;; :-) + `(modify-phases ,phases + (replace 'build + (lambda _ + (letrec-syntax ((shell (syntax-rules () + ((_ (command ...) rest ...) + (and (zero? (system* command ...)) + (shell rest ...))) + ((_) + #t)))) + (shell ("gcc" "-c" "-Ibin/default" "-I" "lib/replace" + "-I." "-Wall" "-g" "talloc.c") + ("ar" "rc" "libtalloc.a" "talloc.o"))))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (lib (string-append out "/lib")) + (include (string-append out "/include"))) + (mkdir-p lib) + (install-file "libtalloc.a" lib) + (install-file "talloc.h" include) + #t))) + (delete 'check))))))) ;XXX: tests rely on Python modules + (define-public tevent (package (name "tevent") -- cgit v1.2.3