gnu: metabat: Update to 2.15.

* gnu/packages/bioinformatics.scm (metabat): Update to 2.15.
[source]: Remove patch.
[build-system]: Use cmake-build-system.
[arguments]: Adjust to new build system.
* gnu/packages/patches/metabat-fix-compilation.patch: Remove file.
* gnu/local.mk (dist_patch_DATA): Remove it.
This commit is contained in:
Ricardo Wurmus 2021-12-09 11:48:15 +01:00
parent ab445eb4b7
commit 0bf3c9abaa
No known key found for this signature in database
GPG key ID: 197A5888235FACAC
3 changed files with 23 additions and 76 deletions

View file

@ -1457,7 +1457,6 @@ dist_patch_DATA = \
%D%/packages/patches/mesa-skip-tests.patch \ %D%/packages/patches/mesa-skip-tests.patch \
%D%/packages/patches/mescc-tools-boot.patch \ %D%/packages/patches/mescc-tools-boot.patch \
%D%/packages/patches/meson-allow-dirs-outside-of-prefix.patch \ %D%/packages/patches/meson-allow-dirs-outside-of-prefix.patch \
%D%/packages/patches/metabat-fix-compilation.patch \
%D%/packages/patches/mhash-keygen-test-segfault.patch \ %D%/packages/patches/mhash-keygen-test-segfault.patch \
%D%/packages/patches/minetest-add-MINETEST_MOD_PATH.patch \ %D%/packages/patches/minetest-add-MINETEST_MOD_PATH.patch \
%D%/packages/patches/mingw-w64-6.0.0-gcc.patch \ %D%/packages/patches/mingw-w64-6.0.0-gcc.patch \

View file

@ -60,7 +60,6 @@ (define-module (gnu packages bioinformatics)
#:use-module (guix build-system qt) #:use-module (guix build-system qt)
#:use-module (guix build-system r) #:use-module (guix build-system r)
#:use-module (guix build-system ruby) #:use-module (guix build-system ruby)
#:use-module (guix build-system scons)
#:use-module (guix build-system trivial) #:use-module (guix build-system trivial)
#:use-module (guix deprecation) #:use-module (guix deprecation)
#:use-module (gnu packages) #:use-module (gnu packages)
@ -5401,7 +5400,7 @@ (define-public mash
(define-public metabat (define-public metabat
(package (package
(name "metabat") (name "metabat")
(version "2.12.1") (version "2.15")
(source (source
(origin (origin
(method git-fetch) (method git-fetch)
@ -5411,44 +5410,32 @@ (define-public metabat
(file-name (git-file-name name version)) (file-name (git-file-name name version))
(sha256 (sha256
(base32 (base32
"0hyg2smw1nz69mfvjpk45xyyychmda92c80a0cv7baji84ri4iyn")) "0v3gsps0ypani14102z2y1a2wignhpf7s1h45mxmj5f783rkhqd9"))))
(patches (search-patches "metabat-fix-compilation.patch")))) (build-system cmake-build-system)
(build-system scons-build-system)
(arguments (arguments
`(#:scons ,scons-python2 `(#:configure-flags
#:scons-flags ,#~(list (string-append "-Dzlib_LIB=" #$(this-package-input "zlib")
(list (string-append "PREFIX=" (assoc-ref %outputs "out")) "/lib/libz.so")
(string-append "BOOST_ROOT=" (assoc-ref %build-inputs "boost"))) (string-append "-Dhtslib_LIB=" #$(this-package-input "htslib")
#:tests? #f ;; Tests are run during the build phase. "/lib/libhts.so")
(string-append "-DBOOST_ROOT=" #$(this-package-input "boost")))
#:phases #:phases
(modify-phases %standard-phases (modify-phases %standard-phases
(add-after 'unpack 'fix-includes (add-after 'unpack 'configure-version-file
(lambda _ (lambda _
(substitute* "src/BamUtils.h" (copy-file "metabat_version.h.in" "metabat_version.h")
(("^#include \"bam/bam\\.h\"") (substitute* "metabat_version.h"
"#include \"samtools/bam.h\"") (("@_time_stamp@") "19700101")
(("^#include \"bam/sam\\.h\"") (("@GIT_IS_DIRTY@") "0")
"#include \"samtools/sam.h\"")) (("@GIT_RETRIEVED_STATE@") "0")
(substitute* "src/KseqReader.h" (("@GIT_HEAD_SHA1@") (string-append "v" ,version)))))
(("^#include \"bam/kseq\\.h\"") (add-after 'unpack 'do-not-use-bundled-libraries
"#include \"htslib/kseq.h\"")))) (lambda _
(add-after 'unpack 'fix-scons (substitute* "CMakeLists.txt"
(lambda* (#:key inputs #:allow-other-keys) (("include\\(cmake.*") ""))
(substitute* "SConstruct" (substitute* "src/CMakeLists.txt"
(("^htslib_dir += 'samtools'") (("set\\(Boost.*") "")
(string-append "htslib_dir = '" (("add_dependencies.*") "")))))))
(assoc-ref inputs "htslib")
"'"))
(("^samtools_dir = 'samtools'")
(string-append "samtools_dir = '"
(assoc-ref inputs "samtools")
"'"))
(("^findStaticOrShared\\('bam', hts_lib")
(string-append "findStaticOrShared('bam', '"
(assoc-ref inputs "samtools")
"/lib'"))
;; Do not distribute README.
(("^env\\.Install\\(idir_prefix, 'README\\.md'\\)") "")))))))
(inputs (inputs
`(("zlib" ,zlib) `(("zlib" ,zlib)
("perl" ,perl) ("perl" ,perl)

View file

@ -1,39 +0,0 @@
This patch changes metabat so that (1) it is not build statically, (2) it uses
shared libraries rather than static libraries where possible.
diff --git a/SConstruct b/SConstruct
index 69cdc0a..ac99bcb 100644
--- a/SConstruct
+++ b/SConstruct
@@ -26,8 +26,6 @@ debug = ARGUMENTS.get('DEBUG', None)
build_flags = ['-Wall', '-g', '-std=c++11', '-fopenmp']
link_flags = ['-lstdc++', '-lm', '-fopenmp']
-if platform.platform(True, True).find('Darwin') == -1:
- link_flags.extend(['-static', '-static-libgcc', '-static-libstdc++'])
if debug is None:
build_flags.extend(['-O3', '-DNDEBUG', '-Wno-unknown-pragmas', '-Wno-deprecated-declarations', '-Wno-overflow', '-Wno-unused-variable'])
@@ -110,17 +108,17 @@ def findStaticOrShared( lib, testPaths, static_source_list, link_flag_list, stat
for path in testPaths:
if not os.path.isdir(path):
continue
+ for testfile in ('%s/lib%s.so' % (path, lib), '%s/lib%s.dylib' % (path, lib)):
+ if os.path.isfile(testfile):
+ print "Found shared library %s as %s" % (lib, testfile)
+ link_flag_list.extend( ["-L%s" % (path), "-l%s" % (lib) ] )
+ return
for suffix in staticSuffixes:
testfile = '%s/lib%s%s' % (path, lib, suffix)
if os.path.isfile(testfile):
static_source_list.append(testfile)
print "Found static library %s as %s" % (lib, testfile)
return
- for testfile in ('%s/lib%s.so' % (path, lib), '%s/lib%s.dylib' % (path, lib)):
- if os.path.isfile(testfile):
- print "Found shared library %s as %s" % (lib, testfile)
- link_flag_list.extend( ["-L%s" % (path), "-l%s" % (lib) ] )
- return
print "Could not find library for %s!!! Looked in %s" % (lib, testPaths)
return