aboutsummaryrefslogtreecommitdiff
path: root/gnu.scm
blob: f9a13246c3963bb5d7460a3d300af83727170e98 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2014, 2015 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2015 Joshua S. Grant <jgrant@parenthetical.io>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu)
  #:export (use-package-modules
            use-service-modules
            use-system-modules))

;;; Commentary:
;;;
;;; This composite module re-exports core parts the (gnu …) public modules.
;;;
;;; Code:

(eval-when (eval load compile)
  (begin
    (define %public-modules
      '((gnu system)
        (gnu system file-systems)
        (gnu system grub)                         ; 'grub-configuration'
        (gnu system pam)
        (gnu system shadow)                       ; 'user-account'
        (gnu system linux-initrd)
        (gnu system nss)
        (gnu services)
        (gnu services base)
        (gnu packages)
        (gnu packages base)
        (guix gexp)))                             ; so gexps can be used

    (for-each (let ((i (module-public-interface (current-module))))
                (lambda (m)
                  (module-use! i (resolve-interface m))))
              %public-modules)))

(define-syntax-rule (use-package-modules module ...)
  (use-modules (gnu packages module) ...))

(define-syntax-rule (use-service-modules module ...)
  (use-modules (gnu services module) ...))

(define-syntax-rule (use-system-modules module ...)
  (use-modules (gnu system module) ...))

;;; gnu.scm ends here
ass='diff'>
diff --git a/gnu/local.mk b/gnu/local.mk
index 8d3916e26d..3eccc879b0 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -840,6 +840,7 @@ dist_patch_DATA = \
%D%/packages/patches/mesa-skip-disk-cache-test.patch \
%D%/packages/patches/mesa-wayland-egl-symbols-check-mips.patch \
%D%/packages/patches/metabat-remove-compilation-date.patch \
+ %D%/packages/patches/metabat-fix-compilation.patch \
%D%/packages/patches/mhash-keygen-test-segfault.patch \
%D%/packages/patches/mingw-w64-5.0rc2-gcc-4.9.3.patch \
%D%/packages/patches/mpc123-initialize-ao.patch \
diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index eab9d49e12..3b4cc359ee 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -3467,23 +3467,20 @@ form of assemblies or reads.")
license:cpl1.0)))) ; Open Bloom Filter
(define-public metabat
- ;; We package from a git commit because compilation of the released version
- ;; fails.
- (let ((commit "cbdca756993e66ae57e50a27970595dda9cbde1b"))
- (package
- (name "metabat")
- (version (string-append "0.32.4-1." (string-take commit 8)))
- (source
- (origin
- (method git-fetch)
- (uri (git-reference
- (url "https://bitbucket.org/berkeleylab/metabat.git")
- (commit commit)))
- (file-name (string-append name "-" version))
- (sha256
- (base32
- "0byia8nsip6zvc4ha0qkxkxxyjf4x7jcvy48q2dvb0pzr989syzr"))
- (patches (search-patches "metabat-remove-compilation-date.patch"))))
+ (package
+ (name "metabat")
+ (version "2.11.1")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "https://bitbucket.org/berkeleylab/metabat/get/v"
+ version ".tar.gz"))
+ (file-name (string-append name "-" version ".tar.gz"))
+ (sha256
+ (base32
+ "0ll00l81aflscgggs5nfhj12cbvdiz3gg7f7n5f537a3xhx60vn9"))
+ (patches (search-patches "metabat-remove-compilation-date.patch"
+ "metabat-fix-compilation.patch"))))
(build-system gnu-build-system)
(arguments
`(#:phases
@@ -3500,35 +3497,35 @@ form of assemblies or reads.")
"#include \"htslib/kseq.h\""))
#t))
(add-after 'unpack 'fix-scons
- (lambda* (#:key inputs #:allow-other-keys)
- (substitute* "SConstruct"
- (("^htslib_dir = 'samtools'")
- (string-append "hitslib_dir = '"
- (assoc-ref inputs "htslib")
- "'"))
- (("^samtools_dir = 'samtools'")
- (string-append "samtools_dir = '"
- (assoc-ref inputs "htslib")
- "'"))
- (("^findStaticOrShared\\('bam', hts_lib")
- (string-append "findStaticOrShared('bam', '"
- (assoc-ref inputs "samtools")
- "/lib'"))
- ;; Do not distribute README.
- (("^env\\.Install\\(idir_prefix, 'README\\.md'\\)") ""))
- #t))
+ (lambda* (#:key inputs #:allow-other-keys)
+ (substitute* "SConstruct"
+ (("^htslib_dir += 'samtools'")
+ (string-append "htslib_dir = '"
+ (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'\\)") ""))
+ #t))
(delete 'configure)
(replace 'build
- (lambda* (#:key inputs outputs #:allow-other-keys)
- (mkdir (assoc-ref outputs "out"))
- (zero? (system* "scons"
- (string-append
- "PREFIX="
- (assoc-ref outputs "out"))
- (string-append
- "BOOST_ROOT="
- (assoc-ref inputs "boost"))
- "install"))))
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (mkdir (assoc-ref outputs "out"))
+ (zero? (system* "scons"
+ (string-append
+ "PREFIX="
+ (assoc-ref outputs "out"))
+ (string-append
+ "BOOST_ROOT="
+ (assoc-ref inputs "boost"))
+ "install"))))
;; Check and install are carried out during build phase.
(delete 'check)
(delete 'install))))
@@ -3549,8 +3546,8 @@ sequences to deconvolute complex microbial communities, or metagenome binning,
enables the study of individual organisms and their interactions. MetaBAT is
an automated metagenome binning software, which integrates empirical
probabilistic distances of genome abundance and tetranucleotide frequency.")
- (license (license:non-copyleft "file://license.txt"
- "See license.txt in the distribution.")))))
+ (license (license:non-copyleft "file://license.txt"
+ "See license.txt in the distribution."))))
(define-public minced
(package
diff --git a/gnu/packages/patches/metabat-fix-compilation.patch b/gnu/packages/patches/metabat-fix-compilation.patch
new file mode 100644
index 0000000000..7086a96e86
--- /dev/null
+++ b/gnu/packages/patches/metabat-fix-compilation.patch
@@ -0,0 +1,39 @@
+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
+