about summary refs log tree commit diff
diff options
context:
space:
mode:
authorpjotrp2026-03-17 13:01:35 +0100
committerpjotrp2026-03-21 08:27:57 +0100
commitfe503ae0685744743d98432d5bb43883867cfb9b (patch)
tree9c7afa0931ccd5f492db434d9d46137d0c8e4c14
parentb9b75ce38483f5d18c4dc77cbe39bdec68e1060f (diff)
downloadguix-bioinformatics-fe503ae0685744743d98432d5bb43883867cfb9b.tar.gz
Updated (vg) now uses last vcflib release without vendoring v1.0.7.
Still, it would be good to fix the includes in vcflib itself.
-rw-r--r--gn/packages/bioinformatics.scm110
1 files changed, 25 insertions, 85 deletions
diff --git a/gn/packages/bioinformatics.scm b/gn/packages/bioinformatics.scm
index 9b19bc4..5916790 100644
--- a/gn/packages/bioinformatics.scm
+++ b/gn/packages/bioinformatics.scm
@@ -2422,40 +2422,10 @@ Cflags: -I${includedir}~%"
 (define-public vcflib-gn
   (package
     (name "vcflib-gn")
-    (version "1.0.12")
-    (source
-     (origin
-       (method git-fetch)
-       (uri (git-reference
-             (url "https://github.com/vcflib/vcflib")
-             (commit (string-append "v" version))))
-       (file-name (git-file-name name version))
-       (sha256
-        (base32 "1llqnbgx4ybb77cp5k3cs0y7n4p8ma6b3sj10iarpg5r6a5gps5a"))
-       (modules '((guix build utils)))
-       (snippet
-        #~(begin
-            (substitute* "CMakeLists.txt"
-              ((".*fastahack.*") "")
-              ((".*smithwaterman.*") "")
-              (("(pkg_check_modules\\(TABIXPP)" text)
-               (string-append
-                "pkg_check_modules(WFA2 REQUIRED libwfa2)\n"
-                "pkg_check_modules(FASTAHACK REQUIRED fastahack)\n"
-                "pkg_check_modules(SMITHWATERMAN REQUIRED smithwaterman)\n"
-                text))
-              (("\\$\\{TABIXPP_LIBRARIES\\}" text)
-               (string-append "${FASTAHACK_LIBRARIES} "
-                              "${WFA2_LIBRARIES} "
-                              "${SMITHWATERMAN_LIBRARIES} "
-                              text))
-              (("install\\(TARGETS \\$\\{WFALIB\\}.*") ""))
-            (substitute* (find-files "." "\\.(h|c)(pp)?$")
-              (("SmithWatermanGotoh.h") "smithwaterman/SmithWatermanGotoh.h")
-              (("\"convert.h\"") "<smithwaterman/convert.h>")
-              (("\"disorder.h\"") "<smithwaterman/disorder.h>")
-              (("\"wavefront/wfa.hpp\"") "<wavefront/wfa.hpp>")
-              (("Fasta.h") "fastahack/Fasta.h"))))))
+    (version "1.0.14")
+    (source (local-file "/fast/pjotr/tmp/claude/factory/vcflib"
+                        "vcflib-checkout"
+                        #:recursive? #t))
     (build-system cmake-build-system)
     (inputs
      (list bzip2
@@ -2472,20 +2442,16 @@ Cflags: -I${includedir}~%"
     (propagated-inputs
      (list wfa2-lib/fixed))
     (native-inputs
-     `(("pkg-config" ,pkg-config)
-       ;; Submodules.
-       ;; This package builds against the .o files so we need to extract the source.
-       ("filevercmp-src" ,(package-source filevercmp))
-       ("fsom-src" ,(package-source fsom))
-       ("intervaltree-src" ,(package-source intervaltree))))
+     `(("pkg-config" ,pkg-config)))
     (arguments
      (list
       #:configure-flags
       #~(list "-DZIG=OFF"
               "-DTABIXPP_LOCAL=OFF"
               "-DTABIX_FOUND=ON"
-              "-DWFA_GITMODULE=OFF")
-      #:tests? #f                       ; no tests
+              "-DWFA_GITMODULE=OFF"
+              "-DBUILD_DOC=OFF")
+      #:tests? #f
       #:phases
       #~(modify-phases %standard-phases
           (add-after 'unpack 'find-wfa2lib-headers
@@ -2495,34 +2461,17 @@ Cflags: -I${includedir}~%"
                        #$(this-package-input "wfa2-lib")
                        "/include/wfa2lib:"
                        (or (getenv "CPLUS_INCLUDE_PATH") "")))))
+          (add-after 'unpack 'restore-compat-includes
+            (lambda _
+              ;; Re-add includes to Variant.h for backward compat with
+              ;; downstream tools like vg that relied on transitive includes
+              (substitute* "src/Variant.h"
+                (("#include \"split.h\"" m)
+                 (string-append m "\n#include \"convert.h\"\n#include \"join.h\"\n#include \"cigar.hpp\"\n#include <memory>\n#include <functional>")))))
           (add-after 'unpack 'build-shared-library
             (lambda _
               (substitute* "CMakeLists.txt"
                 (("vcflib STATIC") "vcflib SHARED"))))
-          (add-after 'unpack 'unpack-submodule-sources
-            (lambda* (#:key inputs native-inputs #:allow-other-keys)
-              (let ((unpack (lambda (source target)
-                              (mkdir-p target)
-                              (with-directory-excursion target
-                                (let ((source (or (assoc-ref inputs source)
-                                                  (assoc-ref native-inputs source))))
-                                  (if (file-is-directory? source)
-                                      (copy-recursively source ".")
-                                      (invoke "tar" "xvf"
-                                              source
-                                              "--strip-components=1")))))))
-                (and
-                 (unpack "filevercmp-src" "contrib/filevercmp")
-                 (unpack "fsom-src" "contrib/fsom")
-                 (unpack "intervaltree-src" "contrib/intervaltree"))
-
-                ;; This is needed for downstream packages to allow building
-                ;; with GCC 11+.
-                (substitute* "contrib/intervaltree/IntervalTree.h"
-                  (("#include <vector>" m)
-                   (string-append m "
-#include <limits> /* std::numeric_limits */"))))))
-          ;; This pkg-config file is provided by other distributions.
           (add-after 'install 'install-pkg-config-file
             (lambda _
               (let ((pkgconfig (string-append #$output "/lib/pkgconfig")))
@@ -2802,9 +2751,8 @@ multiple sequence alignment.")
         license:zlib    ; deps/sonLib/externalTools/cutest
         license:boost1.0)))) ; catch.hpp
 
-;; vg-gn: uses bundled vcflib (1.0.7) instead of external vcflib (1.0.12)
-;; because vg needs vcflib API (canonicalize, getMaxReferencePos) that was
-;; removed in 1.0.12.  Also fixes cstdint in bundled WFA2-lib for GCC 13+.
+;; vg-gn: uses vcflib-gn 1.0.14 which has canonicalize/getMaxReferencePos
+;; merged back into Variant class (these were split out in 1.0.12).
 (define-public vg-gn
   (package
     (inherit vg)
@@ -2820,9 +2768,9 @@ multiple sequence alignment.")
           (add-after 'unpack 'patch-source
             (lambda* (#:key inputs #:allow-other-keys)
               (substitute* "Makefile"
-                ;; PKG_CONFIG_DEPS - no vcflib or fastahack (use bundled)
+                ;; PKG_CONFIG_DEPS - use external vcflib and fastahack
                 (("cairo libzstd")
-                 "cairo htslib libzstd libdw libelf protobuf raptor2 sdsl-lite tabixpp fastahack libdeflate")
+                 "cairo htslib libzstd libdw libelf protobuf raptor2 sdsl-lite tabixpp vcflib fastahack libdeflate")
 
                 (("-Wl,-B.*") "\n")
 
@@ -2842,7 +2790,11 @@ multiple sequence alignment.")
                 ((" \\$\\(LIB_DIR\\)/libdeflate\\.a")
                  (string-append " " (search-input-file inputs "/lib/libdeflate.so")))
 
-                ;; Keep bundled vcflib - don't replace libvcflib.a or vcf2tsv
+                ;; Use external vcflib
+                ((" \\$\\(LIB_DIR\\)/libvcflib.a")
+                 (string-append " " (search-input-file inputs "/lib/libvcflib.so")))
+                ((" \\$\\(BIN_DIR\\)/vcf2tsv")
+                 (string-append " " (search-input-file inputs "/bin/vcf2tsv")))
 
                 ((" \\$\\(FASTAHACK_DIR\\)/fastahack")
                  (string-append " " (search-input-file inputs "/bin/fastahack")))
@@ -2888,18 +2840,6 @@ multiple sequence alignment.")
               (substitute* "deps/libbdsg/Makefile"
                 (("\\[ ! -e \\$\\(OBJ_DIR\\) \\][^\n]*") "")
                 (("\\[ ! -e \\$\\(LIB_DIR\\) \\][^\n]*") ""))))
-          (add-after 'unpack 'fix-bundled-vcflib
-            (lambda _
-              ;; Fix GCC 13+ cstdint issue in bundled WFA2-lib
-              (substitute* "deps/vcflib/contrib/WFA2-lib/bindings/cpp/WFAligner.hpp"
-                (("#include <string>" m)
-                 (string-append m "\n#include <cstdint>")))
-              (substitute* (find-files "deps/vcflib/contrib/WFA2-lib" "\\.(h|c)$")
-                (("#include <stdlib.h>" m)
-                 (string-append m "\n#include <stdint.h>")))
-              ;; Disable pybind11 python bindings in bundled vcflib
-              (substitute* "deps/vcflib/CMakeLists.txt"
-                ((".*pyvcflib.*") ""))))
           (add-after 'unpack 'link-with-some-shared-libraries
             (lambda* (#:key inputs #:allow-other-keys)
               (substitute* '("deps/mmmultimap/CMakeLists.txt"
@@ -2978,7 +2918,7 @@ multiple sequence alignment.")
            snappy
            sparsehash
            tabixpp
-           ;; No external vcflib -- use bundled vcflib 1.0.7
+           vcflib-gn
            zlib
            (list zstd "lib")))))