Skip to content

Commit

Permalink
guix-static.scm: Fixed building a static wfmash binary and libs. See …
Browse files Browse the repository at this point in the history
…the header of the file for instructions.
  • Loading branch information
pjotrp committed Dec 7, 2024
1 parent 9866220 commit 495fcda
Showing 1 changed file with 40 additions and 18 deletions.
58 changes: 40 additions & 18 deletions guix-static.scm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
;;
;; mkdir build
;; cd build
;; cmake ..
;; cmake -DBUILD_STATIC=1 ..
;; make
;;
;; For the tests you may need /usr/bin/env. Inside the container:
Expand All @@ -21,18 +21,17 @@

(use-modules
((guix licenses) #:prefix license:)
(guix build-system cmake)
(guix download)
(guix gexp)
(guix packages)
(guix git-download)
(guix build-system cmake)
; (guix gexp)
(guix packages)
(guix utils)
(gnu packages algebra)
(gnu packages base)
(gnu packages bioinformatics)
(gnu packages build-tools)
(gnu packages compression)
; (gnu packages curl)
(gnu packages gcc)
(gnu packages jemalloc)
(gnu packages llvm)
Expand All @@ -45,12 +44,31 @@
(ice-9 popen)
(ice-9 rdelim))

(define-public libdeflate-static
(package
(inherit libdeflate)
(name "libdeflate-static")
(version "1.19")
(arguments
(list #:configure-flags
#~(list "-DLIBDEFLATE_BUILD_STATIC_LIB=YES"
"-DLIBDEFLATE_BUILD_TESTS=YES")))))

;; 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-public htslib-static
(package
(inherit htslib)
(name "htslib-static")
(version "1.19")
(source (origin
(method url-fetch)
(uri (string-append
"https://github.com/samtools/htslib/releases/download/"
version "/htslib-" version ".tar.bz2"))
(sha256
(base32
"0dh79lwpspwwfbkmllrrhbk8nkvlfc5b5ib4d0xg5ld79w6c8lc7"))))
(arguments
(substitute-keyword-arguments (package-arguments htslib)
((#:configure-flags flags ''())
Expand All @@ -66,31 +84,35 @@
(define-public wfmash-git
(package
(name "wfmash-git")
(version (git-version "0.10.7" "HEAD" %git-commit))
(version (git-version "0.21" "HEAD" %git-commit))
(source (local-file %source-dir #:recursive? #t))
(build-system cmake-build-system)
(arguments
`(#:configure-flags
,#~(list "-DBUILD_STATIC=1" "-DCMAKE_INSTALL_RPATH=") ; force cmake static build and do not rewrite RPATH
#:tests? #f)) ; disable tests until I fix finding the binary wfmash
(inputs
`(
;; ("clang" ,clang) ; add this to test clang builds
;; ("lld" ,lld) ; add this to test clang builds
("bzip2-static" ,bzip2 "static") ; libz2 part of htslib for static builds
("coreutils" ,coreutils) ; for echo and env in tests
("gcc" ,gcc-12)
("gsl-static" ,gsl "static")
("git" ,git)
("gmp" ,gmp)
("gsl-static" ,gsl "static")
("gsl" ,gsl)
("htslib-static" ,htslib-static)
("jemalloc" ,jemalloc)
("libdeflate-static" ,libdeflate-static)
("make" ,gnu-make)
("pkg-config" ,pkg-config)
("jemalloc" ,jemalloc)
("htslib" ,htslib-static)
("git" ,git)
; ("bc" ,bc) ; for tests
("coreutils" ,coreutils) ; for echo and env in tests
; ("curl" ,curl)
; ("parallel" ,parallel) ; for wfmash-parallel
("bzip2-static" ,bzip2 "static") ; libz2 part of htslib for static builds
("xz-static" ,xz "static") ; for static builds
("zlib-static" ,zlib "static")))
(synopsis "wfmash")
(description
"wfmash.")
"wfmash is an aligner for pangenomes that combines efficient homology
mapping with base-level alignment. It uses MashMap to find approximate
mappings between sequences, then applies WFA (Wave Front Alignment) to
obtain base-level alignments.")
(home-page "https://github.com/waveygang/wfmash")
(license license:expat)))

Expand Down

0 comments on commit 495fcda

Please sign in to comment.