From fc9fd5496f33f697f4dc1e0dc1f20ba62c15726a Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Sun, 17 Jan 2021 15:31:21 +0200 Subject: gnu: freebayes: Update to 1.3.3. * gnu/packages/bioinformatics.scm (freebayes): Update to 1.3.3. [source]: Add patch. Add snippet to remove vendored library. [build-system]: Switch to meson-build-system. [inputs]: Remove bamtools. Add fastahack, smithwaterman, tabixpp. [native-inputs]: Remove procps, python-2, tabixpp source, smithwaterman source, multichoose source, fsom source, filevercmp source, fastahack source, bash-tap source. Add bash-tap, grep, pkg-config, simde, vcflib. [arguments]: Drop make-flags. Don't delete 'configure phase. Delete custom 'fix-tests, 'build-tabixpp-and-vcflib, 'fix-makefiles, 'install phases. Adjust 'unpack-submodule-sources phase to changed native-inputs. Add new 'patch-source phase. --- gnu/packages/patches/freebayes-devendor-deps.patch | 129 +++++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 gnu/packages/patches/freebayes-devendor-deps.patch (limited to 'gnu/packages/patches/freebayes-devendor-deps.patch') diff --git a/gnu/packages/patches/freebayes-devendor-deps.patch b/gnu/packages/patches/freebayes-devendor-deps.patch new file mode 100644 index 0000000000..580f53a3b1 --- /dev/null +++ b/gnu/packages/patches/freebayes-devendor-deps.patch @@ -0,0 +1,129 @@ +This patch is original to Guix, ongoing work to upstream bits as possible. + +From 50833daba0b1dbe2ed364b1e980b67a09a312789 Mon Sep 17 00:00:00 2001 +From: Efraim Flashner +Date: Sun, 17 Jan 2021 13:27:17 +0200 +Subject: [PATCH] devendor-dependants + +--- + meson.build | 60 +++++++++++++++++++++++++++++++++++++++++------------ + 1 file changed, 47 insertions(+), 13 deletions(-) + +diff --git a/meson.build b/meson.build +index f6bf242..7a3805e 100644 +--- a/meson.build ++++ b/meson.build +@@ -9,8 +9,12 @@ project('freebayes', ['cpp', 'c'], + + zlib_dep = dependency('zlib') + lzma_dep = dependency('liblzma') ++simde_dep = dependency('simde') + bzip2_dep = dependency('bz2lib', required: false) + htslib_dep = dependency('htslib', required : false) ++tabixpp_dep = dependency('tabixpp', required : false) ++fastahack_dep = dependency('fastahack', required : false) ++smithwaterman_dep = dependency('smithwaterman', required : false) + thread_dep = dependency('threads') + + if htslib_dep.found() +@@ -59,6 +63,41 @@ else + ] + endif + ++if tabixpp_dep.found() ++ tabixpp_includes = '' ++ tabixpp_src = [] ++else ++ tabixpp_includes = [ ++ 'vcflib/tabixpp', ++ ] ++ tabixpp_src = [ ++ 'vcflib/tabixpp/tabix.cpp', ++ ] ++endif ++ ++if fastahack_dep.found() ++ fastahack_src = [] ++else ++ fastahack_src = [ ++ 'vcflib/fastahack/Fasta.cpp', ++ ] ++endif ++ ++if smithwaterman_dep.found() ++ smithwaterman_includes = '' ++ smithwaterman_src = [] ++else ++ smithwaterman_includes = [ ++ 'vcflib/smithwaterman', ++ ] ++ smithwaterman_src = [ ++ 'vcflib/smithwaterman/SmithWatermanGotoh.cpp', ++ 'vcflib/smithwaterman/disorder.cpp', ++ 'vcflib/smithwaterman/Repeats.cpp', ++ 'vcflib/smithwaterman/LeftAlign.cpp', ++ 'vcflib/smithwaterman/IndelAllele.cpp', ++ ] ++endif + + + # +@@ -105,22 +144,17 @@ seqlib_src = [ + ] + + vcflib_src = [ +- 'vcflib/tabixpp/tabix.cpp', + 'vcflib/src/Variant.cpp', +- 'vcflib/smithwaterman/SmithWatermanGotoh.cpp', +- 'vcflib/smithwaterman/disorder.cpp', +- 'vcflib/smithwaterman/Repeats.cpp', +- 'vcflib/smithwaterman/LeftAlign.cpp', +- 'vcflib/smithwaterman/IndelAllele.cpp', ++ tabixpp_src, ++ smithwaterman_src, + ] + + bamleftalign_src = [ + 'src/bamleftalign.cpp', + 'src/IndelAllele.cpp', + 'contrib/SeqLib/src/BamWriter.cpp', +- 'vcflib/fastahack/Fasta.cpp', +- 'vcflib/smithwaterman/LeftAlign.cpp', +- 'vcflib/smithwaterman/IndelAllele.cpp', ++ fastahack_src, ++ smithwaterman_src, + 'vcflib/src/split.cpp', + 'src/LeftAlign.cpp', + ] +@@ -135,8 +169,8 @@ incdir = include_directories( + 'contrib', + 'contrib/SeqLib', + 'vcflib/src', +- 'vcflib/tabixpp', +- 'vcflib/smithwaterman', ++ tabixpp_includes, ++ smithwaterman_includes, + 'vcflib/multichoose', + 'vcflib/filevercmp') + +@@ -152,7 +186,7 @@ executable('freebayes', + include_directories : incdir, + cpp_args : cpp_args, + c_args : c_args, +- dependencies: [zlib_dep, lzma_dep, htslib_dep, thread_dep], ++ dependencies: [zlib_dep, lzma_dep, simde_dep, htslib_dep, tabixpp_dep, smithwaterman_dep, thread_dep], + install: true + ) + +@@ -165,7 +199,7 @@ executable('bamleftalign', + include_directories : incdir, + cpp_args : cpp_args, + c_args : c_args, +- dependencies: [zlib_dep, lzma_dep, htslib_dep, thread_dep], ++ dependencies: [zlib_dep, lzma_dep, simde_dep, htslib_dep, tabixpp_dep, fastahack_dep, smithwaterman_dep, thread_dep], + install: true + ) + +-- +2.30.0 + -- cgit v1.2.3 From 99043adf46d3e27fb10939c1365552844596345d Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Tue, 19 Jan 2021 11:38:06 +0200 Subject: gnu: freebayes: Don't include vcflib sources. * gnu/packages/bioinformatics.scm (freebayes)[native-inputs]: Remove vcflib-source, intervaltree-source. Move vcflib ... [inputs]: ... to here. [arguments]: Adjust 'patch-source and 'unpack-submodule-sources for changes in vendored code. * gnu/packages/patches/freebayes-devendor-deps.patch: Update patch. --- gnu/packages/bioinformatics.scm | 30 ++++-------- gnu/packages/patches/freebayes-devendor-deps.patch | 57 +++++++++++++++------- 2 files changed, 49 insertions(+), 38 deletions(-) (limited to 'gnu/packages/patches/freebayes-devendor-deps.patch') diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm index 95352f948b..70166501d7 100644 --- a/gnu/packages/bioinformatics.scm +++ b/gnu/packages/bioinformatics.scm @@ -15138,6 +15138,7 @@ manipulations on VCF files.") ("htslib" ,htslib) ("smithwaterman" ,smithwaterman) ("tabixpp" ,tabixpp) + ("vcflib" ,vcflib) ("zlib" ,zlib))) (native-inputs `(("bash-tap" ,bash-tap) @@ -15148,11 +15149,6 @@ manipulations on VCF files.") ("pkg-config" ,pkg-config) ("samtools" ,samtools) ("simde" ,simde) - ;; We need some binaries from vcflib, but we also need to link against a - ;; subset of the library. Vendor the parts we need until we have a shared library. - ("vcflib" ,vcflib) - ("vcflib-src" ,(package-source vcflib)) - ("intervaltree-src" ,(package-source intervaltree)) ;; This submodule is needed to run the tests. ("test-simple-bash-src" ,(origin @@ -15179,25 +15175,17 @@ manipulations on VCF files.") (substitute* "meson.build" ;; Some inputs aren't actually needed. ((".*bamtools/src.*") "") - ((".*multichoose.*") "") - (("'vcflib/filevercmp'") "")) + ((".*multichoose.*") "")) + (substitute* '("src/BedReader.cpp" + "src/BedReader.h") + (("../intervaltree/IntervalTree.h") "IntervalTree.h")) #t))) (add-after 'unpack 'unpack-submodule-sources (lambda* (#:key inputs #:allow-other-keys) - (let ((unpack (lambda (source target) - (unless (directory-exists? target) - (mkdir-p target)) - (with-directory-excursion target - (if (file-is-directory? (assoc-ref inputs source)) - (copy-recursively (assoc-ref inputs source) ".") - (invoke "tar" "xvf" - (assoc-ref inputs source) - "--strip-components=1")))))) - (and - (unpack "vcflib-src" "vcflib") - (unpack "intervaltree-src" "vcflib/intervaltree") - (unpack "test-simple-bash-src" "test/test-simple-bash")) - #t))) + (mkdir-p "test/test-simple-bash") + (copy-recursively (assoc-ref inputs "test-simple-bash-src") + "test/test-simple-bash") + #t)) ;; The slow tests take longer than the specified timeout. ,@(if (any (cute string=? <> (%current-system)) '("armhf-linux" "aarch64-linux")) diff --git a/gnu/packages/patches/freebayes-devendor-deps.patch b/gnu/packages/patches/freebayes-devendor-deps.patch index 580f53a3b1..7e84666b85 100644 --- a/gnu/packages/patches/freebayes-devendor-deps.patch +++ b/gnu/packages/patches/freebayes-devendor-deps.patch @@ -1,19 +1,19 @@ This patch is original to Guix, ongoing work to upstream bits as possible. -From 50833daba0b1dbe2ed364b1e980b67a09a312789 Mon Sep 17 00:00:00 2001 +From 9acc56db5e7469f5976be38b52ba4993de98ee38 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Sun, 17 Jan 2021 13:27:17 +0200 Subject: [PATCH] devendor-dependants --- - meson.build | 60 +++++++++++++++++++++++++++++++++++++++++------------ - 1 file changed, 47 insertions(+), 13 deletions(-) + meson.build | 84 +++++++++++++++++++++++++++++++++++++++++------------ + 1 file changed, 66 insertions(+), 18 deletions(-) diff --git a/meson.build b/meson.build -index f6bf242..7a3805e 100644 +index f6bf242..bded4af 100644 --- a/meson.build +++ b/meson.build -@@ -9,8 +9,12 @@ project('freebayes', ['cpp', 'c'], +@@ -9,8 +9,13 @@ project('freebayes', ['cpp', 'c'], zlib_dep = dependency('zlib') lzma_dep = dependency('liblzma') @@ -23,10 +23,11 @@ index f6bf242..7a3805e 100644 +tabixpp_dep = dependency('tabixpp', required : false) +fastahack_dep = dependency('fastahack', required : false) +smithwaterman_dep = dependency('smithwaterman', required : false) ++vcflib_dep = dependency('libvcflib', required: false) thread_dep = dependency('threads') if htslib_dep.found() -@@ -59,6 +63,41 @@ else +@@ -59,6 +64,56 @@ else ] endif @@ -42,11 +43,26 @@ index f6bf242..7a3805e 100644 + ] +endif + ++if vcflib_dep.found() ++ vcflib_includes = '' ++ vcflib_src = [] ++else ++ vcflib_includes = [ ++ 'vcflib/src', ++ 'vcflib/multichoose', ++ 'vcflib/filevercmp', ++ ] ++ vcflib_src = [ ++ 'vcflib/src/Variant.cpp', ++ ] ++endif ++ +if fastahack_dep.found() + fastahack_src = [] +else + fastahack_src = [ + 'vcflib/fastahack/Fasta.cpp', ++ 'vcflib/src/split.cpp', + ] +endif + @@ -68,17 +84,18 @@ index f6bf242..7a3805e 100644 # -@@ -105,22 +144,17 @@ seqlib_src = [ +@@ -105,23 +160,18 @@ seqlib_src = [ ] vcflib_src = [ - 'vcflib/tabixpp/tabix.cpp', - 'vcflib/src/Variant.cpp', +- 'vcflib/src/Variant.cpp', - 'vcflib/smithwaterman/SmithWatermanGotoh.cpp', - 'vcflib/smithwaterman/disorder.cpp', - 'vcflib/smithwaterman/Repeats.cpp', - 'vcflib/smithwaterman/LeftAlign.cpp', - 'vcflib/smithwaterman/IndelAllele.cpp', ++ vcflib_src, + tabixpp_src, + smithwaterman_src, ] @@ -90,37 +107,43 @@ index f6bf242..7a3805e 100644 - 'vcflib/fastahack/Fasta.cpp', - 'vcflib/smithwaterman/LeftAlign.cpp', - 'vcflib/smithwaterman/IndelAllele.cpp', +- 'vcflib/src/split.cpp', + fastahack_src, + smithwaterman_src, - 'vcflib/src/split.cpp', ++ vcflib_src, 'src/LeftAlign.cpp', ] -@@ -135,8 +169,8 @@ incdir = include_directories( + +@@ -134,11 +184,9 @@ incdir = include_directories( + 'ttmath', 'contrib', 'contrib/SeqLib', - 'vcflib/src', +- 'vcflib/src', - 'vcflib/tabixpp', - 'vcflib/smithwaterman', +- 'vcflib/multichoose', +- 'vcflib/filevercmp') + tabixpp_includes, + smithwaterman_includes, - 'vcflib/multichoose', - 'vcflib/filevercmp') ++ vcflib_includes) -@@ -152,7 +186,7 @@ executable('freebayes', + c_args = ['-fpermissive','-w'] + cpp_args = ['-fpermissive','-w','-Wc++14-compat'] +@@ -152,7 +200,7 @@ executable('freebayes', include_directories : incdir, cpp_args : cpp_args, c_args : c_args, - dependencies: [zlib_dep, lzma_dep, htslib_dep, thread_dep], -+ dependencies: [zlib_dep, lzma_dep, simde_dep, htslib_dep, tabixpp_dep, smithwaterman_dep, thread_dep], ++ dependencies: [zlib_dep, lzma_dep, simde_dep, htslib_dep, tabixpp_dep, smithwaterman_dep, vcflib_dep, thread_dep], install: true ) -@@ -165,7 +199,7 @@ executable('bamleftalign', +@@ -165,7 +213,7 @@ executable('bamleftalign', include_directories : incdir, cpp_args : cpp_args, c_args : c_args, - dependencies: [zlib_dep, lzma_dep, htslib_dep, thread_dep], -+ dependencies: [zlib_dep, lzma_dep, simde_dep, htslib_dep, tabixpp_dep, fastahack_dep, smithwaterman_dep, thread_dep], ++ dependencies: [zlib_dep, lzma_dep, simde_dep, htslib_dep, tabixpp_dep, fastahack_dep, smithwaterman_dep, vcflib_dep, thread_dep], install: true ) -- cgit v1.2.3 From 877ab0266c69858a9d4554dffba89dc5300a0736 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Mon, 1 Feb 2021 18:18:42 +0200 Subject: gnu: vcflib: Fix generated pkg-config file. * gnu/packages/bioinformatics.scm (vcflib)[arguments]: In custom generated pkg-config file, link with all needed libraries and fix linker library. * gnu/packages/patches/freebayes-devendor-deps.patch: Adjust accordingly. --- gnu/packages/bioinformatics.scm | 8 ++++---- gnu/packages/patches/freebayes-devendor-deps.patch | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'gnu/packages/patches/freebayes-devendor-deps.patch') diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm index 5b14e765de..39611d23f4 100644 --- a/gnu/packages/bioinformatics.scm +++ b/gnu/packages/bioinformatics.scm @@ -15209,18 +15209,18 @@ library automatically handles index file generation and use.") (let* ((out (assoc-ref outputs "out")) (pkgconfig (string-append out "/lib/pkgconfig"))) (mkdir-p pkgconfig) - (with-output-to-file (string-append pkgconfig "/libvcflib.pc") + (with-output-to-file (string-append pkgconfig "/vcflib.pc") (lambda _ (format #t "prefix=~a~@ exec_prefix=${prefix}~@ libdir=${exec_prefix}/lib~@ includedir=${prefix}/include~@ ~@ - Name: libvcflib~@ + Name: vcflib~@ Version: ~a~@ - Requires: smithwaterman, fastahack~@ + Requires: smithwaterman, fastahack, tabixpp~@ Description: C++ library for parsing and manipulating VCF files~@ - Libs: -L${libdir} -llibvcflib~@ + Libs: -L${libdir} -lvcflib~@ Cflags: -I${includedir}~%" out ,version))) #t)))))) diff --git a/gnu/packages/patches/freebayes-devendor-deps.patch b/gnu/packages/patches/freebayes-devendor-deps.patch index 7e84666b85..9886de11fb 100644 --- a/gnu/packages/patches/freebayes-devendor-deps.patch +++ b/gnu/packages/patches/freebayes-devendor-deps.patch @@ -23,7 +23,7 @@ index f6bf242..bded4af 100644 +tabixpp_dep = dependency('tabixpp', required : false) +fastahack_dep = dependency('fastahack', required : false) +smithwaterman_dep = dependency('smithwaterman', required : false) -+vcflib_dep = dependency('libvcflib', required: false) ++vcflib_dep = dependency('vcflib', required: false) thread_dep = dependency('threads') if htslib_dep.found() -- cgit v1.2.3