From 74a445eec91c7294769f0233d62588f4a179e983 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Fri, 1 Apr 2022 16:12:33 +0530 Subject: gn: Add wfmash-static. * gn/packages/static.scm: Import (gnu packages bioinformatics), (gnu packages compression), (gnu packages cpp), (gnu packages jemalloc), (gnu packages maths), (guix gexp) and (guix utils). (htslib-minimal, wfmash-static): New variables. --- gn/packages/static.scm | 54 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) (limited to 'gn') diff --git a/gn/packages/static.scm b/gn/packages/static.scm index 7ce1a9c..3b0d913 100644 --- a/gn/packages/static.scm +++ b/gn/packages/static.scm @@ -11,11 +11,63 @@ (define-module (gn packages static) #:use-module (gnu packages base) + #:use-module (gnu packages bioinformatics) + #:use-module (gnu packages compression) + #:use-module (gnu packages cpp) + #:use-module (gnu packages jemalloc) + #:use-module (gnu packages maths) #:use-module (guix build-system gnu) - #:use-module (guix packages)) + #:use-module (guix gexp) + #:use-module (guix packages) + #:use-module (guix utils)) ;; Static hello, for testing (define-public hello-static (package (inherit (static-package hello)) (name "hello-static"))) + +;; A minimal version of htslib that does not depend on curl and openssl. This +;; reduces the number of higher order dependencies in static linking. +(define htslib-minimal + (package + (inherit htslib) + (arguments + (substitute-keyword-arguments (package-arguments htslib) + ((#:configure-flags flags ''()) + ''()))) + (inputs + (list bzip2 xz)))) + +(define-public wfmash-static + (package + (inherit wfmash) + (arguments + (substitute-keyword-arguments (package-arguments wfmash) + ((#:configure-flags flags ''()) + `(cons* "-DCMAKE_EXE_LINKER_FLAGS=-static" + "-DCMAKE_SKIP_RPATH=TRUE" + ,flags)) + ((#:phases phases ''()) + #~(modify-phases #$phases + ;; When static linking, we need to link against the entire + ;; dependency tree, not just the direct first-order dependencies. + (add-after 'unpack 'add-higher-order-dependencies + (lambda _ + (substitute* "CMakeLists.txt" + (("hts" all) + (string-append all " bz2 dl lzma")) + (("jemalloc" all) + ;; We add atomic because riscv64 has no lock-free atomic + ;; instructions. + (string-append all " atomic pthread"))))))))) + (inputs + (list atomic-queue + gsl-static + htslib-minimal + jemalloc + (list zlib "static") + + ;; Second-order dependencies from htslib + (list bzip2 "static") + (list xz "static"))))) -- cgit v1.2.3