about summary refs log tree commit diff
diff options
context:
space:
mode:
authorpjotrp2026-03-18 08:44:22 +0100
committerpjotrp2026-03-21 08:31:38 +0100
commit822ecade05a66ec3a301de150f3051764b1e0003 (patch)
tree703cb3b28422cf993c0b8715d751a7b63fecf5a5
parent7309cf6c5d4714e7551ba768049da9119d03389c (diff)
downloadguix-bioinformatics-822ecade05a66ec3a301de150f3051764b1e0003.tar.gz
Updated (wfa2lib) to latest version and simplified package definition [AI]
-rw-r--r--gn/packages/bioinformatics.scm121
1 files changed, 25 insertions, 96 deletions
diff --git a/gn/packages/bioinformatics.scm b/gn/packages/bioinformatics.scm
index fddb29c..b329e4c 100644
--- a/gn/packages/bioinformatics.scm
+++ b/gn/packages/bioinformatics.scm
@@ -2319,105 +2319,34 @@ in-memory footprint at the cost of packing and unpacking.")
                             odgi-x86-64-v4)))
     (properties `((tunable? . #f)))))
 
+;; new wfa2-lib v2.3.6 with cstdint fix, pkg-config and tests 
 (define-public wfa2-lib
-  (let ((commit "af6be887614e8bb4e2b6e8c4e500705a978bd513")     ; 14 April 2022
-        (revision "1"))
-    (package
-      (name "wfa2-lib")
-      (version (git-version "2.1" revision commit))     ; As seen in ./VERSION
-      (source (origin
-                (method git-fetch)
-                (uri (git-reference
-                       (url "https://github.com/smarco/WFA2-lib")
-                       (commit commit)))
-                (file-name (git-file-name name version))
-                (sha256
-                 (base32 "09gsmks4dzmfscklb60m6gcsvsd9r6jywf10633dpcsfsdcvmzaw"))
-                (snippet
-                 #~(begin
-                     (use-modules ((guix build utils)))
-                     (substitute* "Makefile"
-                       (("^CC=") "CC:=")
-                       (("^CPP=") "CPP:=")
-                       (("-march=native") ""))))))
-      (build-system gnu-build-system)
-      (arguments
-       (list
-         #:tests? #f            ; No tests.
-         #:parallel-build? #f   ; Race condition in Makefile.
-         #:modules '((guix build gnu-build-system)
-                     (guix build utils)
-                     (srfi srfi-26))
-         #:make-flags
-         #~(list (string-append "CC=" #$(cc-for-target))
-                 (string-append "CPP=" #$(cxx-for-target)))
-         #:phases
-         #~(modify-phases %standard-phases
-             (delete 'configure)        ; No configure script.
-             ;; -flto breaks align_benchmark.
-             (replace 'build
-               (lambda* (#:key (make-flags '()) #:allow-other-keys)
-                 (apply invoke "make" "all" make-flags)))
-             (replace 'install
-               (lambda _
-                 (for-each
-                   (cut install-file <> (string-append #$output "/bin"))
-                   (find-files "bin"))
-                 (for-each
-                   (cut install-file <> (string-append #$output "/lib"))
-                   (find-files "lib"))
-                 (for-each
-                   (lambda (file)
-                     (mkdir-p (string-append #$output "/include/wfa2-lib/" (dirname file)))
-                     (copy-file file (string-append #$output "/include/wfa2-lib/" file)))
-                   (find-files "." "\\.(h|hpp)$")))))))
-      (home-page "https://github.com/smarco/WFA2-lib")
-      (synopsis "Wavefront alignment algorithm library")
-      (description "The @acronym{wavefront alignment, WFA} algorithm is an exact
-gap-affine algorithm that takes advantage of homologous regions between the
-sequences to accelerate the alignment process.  Unlike to traditional dynamic
-programming algorithms that run in quadratic time, the WFA runs in time
-@code{O(ns+s^2)}, proportional to the sequence length @code{n} and the alignment
-score @code{s}, using @code{O(s^2)} memory.  Moreover, the WFA algorithm
-exhibits simple computational patterns that the modern compilers can
-automatically vectorize for different architectures without adapting the code.")
-      (properties '((tunable? . #t)))
-      (license license:expat))))
-
-;; wfa2-lib from Guix fails with GCC 13+ due to missing <cstdint>.
-(define-public wfa2-lib/fixed
   (package
-    (inherit wfa2-lib)
+    (name "wfa2-lib")
+    (version "2.3.6")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/smarco/WFA2-lib")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0hfgq09r0ndrsa2jwy9wkg8p7xzgvclbj5ysp73bawwkgwpgfhy4"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     (list pkg-config time)) ; time for testing
     (arguments
-     (list #:phases
-           #~(modify-phases %standard-phases
-               (add-after 'unpack 'fix-cstdint
-                 (lambda _
-                   (substitute* "bindings/cpp/WFAligner.hpp"
-                     (("#include <string>" m)
-                      (string-append m "\n#include <cstdint>")))
-                   ;; C headers need <stdint.h>
-                   (substitute* (find-files "." "\\.(h|c)$")
-                     (("#include <stdlib.h>" m)
-                      (string-append m "\n#include <stdint.h>")))))
-               (add-after 'install 'install-pkg-config-file
-                 (lambda _
-                   (let ((pkgconfig (string-append #$output "/lib/pkgconfig")))
-                     (mkdir-p pkgconfig)
-                     (with-output-to-file (string-append pkgconfig "/libwfa2.pc")
-                       (lambda _
-                         (format #t "prefix=~a~@
-exec_prefix=${prefix}~@
-libdir=${exec_prefix}/lib~@
-includedir=${prefix}/include/wfa2lib~@
-~@
-Name: libwfa2~@
-Version: ~a~@
-Description: Wavefront alignment algorithm library~@
-Libs: -L${libdir} -lwfa2 -lwfa2cpp~@
-Cflags: -I${includedir}~%"
-                                 #$output
-                                 #$(package-version wfa2-lib))))))))))))
+     (list
+      #:configure-flags
+      #~(list "-DCMAKE_BUILD_TYPE=RelWithDebInfo")))
+    (home-page "https://github.com/smarco/WFA2-lib")
+    (synopsis "Wavefront alignment algorithm library")
+    (description "The wavefront alignment (WFA) algorithm is an exact
+gap-affine algorithm that takes advantage of homologous regions between the
+sequences to accelerate the alignment process.")
+    (properties '((tunable? . #t)))
+    (license license:expat)))
 
 (define-public vcflib-gn
   (package