guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Various samtools patches.


From: Ricardo Wurmus
Subject: [PATCH] Various samtools patches.
Date: Tue, 28 Apr 2015 11:35:14 +0200

Hi Guix,

the first patch replaces a Makefile-patching build phase with
make-flags.  The second patch makes samtools install its libbam
library.

The third patch adds the most recent version of the 0.1 line of
samtools.  The input and output formats differ greatly from that used
and produced by samtools 1.x (which has already been packaged as
"samtools") and is still used in many bioinformatics pipelines.

~~ Ricardo

>From 5153c937e39cfeb59275594047fcccec6859f250 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <address@hidden>
Date: Thu, 23 Apr 2015 15:23:26 +0200
Subject: [PATCH 1/3] gnu: samtools: Remove patch-makefile-curses phase.

* gnu/packages/bioinformatics.scm (samtools)[arguments]: Remove
  patch-makefile-curses phase, use make-flags instead.
---
 gnu/packages/bioinformatics.scm | 41 ++++++++++++++++++-----------------------
 1 file changed, 18 insertions(+), 23 deletions(-)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index b654e05..65cf37f 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -1123,32 +1123,27 @@ distribution, coverage uniformity, strand specificity, 
etc.")
        ;; systems.
        #:tests? ,(string=? (or (%current-system) (%current-target-system))
                            "x86_64-linux")
-       #:make-flags (list (string-append "prefix=" (assoc-ref %outputs "out")))
+       #:make-flags (list "LIBCURSES=-lncurses"
+                          (string-append "prefix=" (assoc-ref %outputs "out")))
        #:phases
        (alist-cons-after
         'unpack
-        'patch-makefile-curses
-        (lambda _
-          (substitute* "Makefile"
-            (("-lcurses") "-lncurses")))
-        (alist-cons-after
-         'unpack
-         'patch-tests
-         (lambda* (#:key inputs #:allow-other-keys)
-           (let ((bash (assoc-ref inputs "bash")))
-             (substitute* "test/test.pl"
-               ;; The test script calls out to /bin/bash
-               (("/bin/bash")
-                (string-append bash "/bin/bash"))
-               ;; There are two failing tests upstream relating to the "stats"
-               ;; subcommand in test_usage_subcommand ("did not have Usage"
-               ;; and "usage did not mention samtools stats"), so we disable
-               ;; them.
-               (("(test_usage_subcommand\\(.*\\);)" cmd)
-                (string-append "unless ($subcommand eq 'stats') {" cmd 
"};")))))
-         (alist-delete
-          'configure
-          %standard-phases)))))
+        'patch-tests
+        (lambda* (#:key inputs #:allow-other-keys)
+          (let ((bash (assoc-ref inputs "bash")))
+            (substitute* "test/test.pl"
+              ;; The test script calls out to /bin/bash
+              (("/bin/bash")
+               (string-append bash "/bin/bash"))
+              ;; There are two failing tests upstream relating to the "stats"
+              ;; subcommand in test_usage_subcommand ("did not have Usage"
+              ;; and "usage did not mention samtools stats"), so we disable
+              ;; them.
+              (("(test_usage_subcommand\\(.*\\);)" cmd)
+               (string-append "unless ($subcommand eq 'stats') {" cmd "};")))))
+        (alist-delete
+         'configure
+         %standard-phases))))
     (native-inputs `(("pkg-config" ,pkg-config)))
     (inputs `(("ncurses" ,ncurses)
               ("perl" ,perl)
-- 
2.1.0

>From f33a1acd0d882068520f85ad73c985492ee0b16b Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <address@hidden>
Date: Thu, 23 Apr 2015 16:42:50 +0200
Subject: [PATCH 2/3] gnu: samtools: Install libbam.a library.

* gnu/packages/bioinformatics.scm (samtools)[arguments]: Add phase
  "install-library" to install the libbam.a library.
---
 gnu/packages/bioinformatics.scm | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 65cf37f..42b1f4f 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -1141,9 +1141,13 @@ distribution, coverage uniformity, strand specificity, 
etc.")
               ;; them.
               (("(test_usage_subcommand\\(.*\\);)" cmd)
                (string-append "unless ($subcommand eq 'stats') {" cmd "};")))))
-        (alist-delete
-         'configure
-         %standard-phases))))
+        (alist-cons-after
+         'install 'install-library
+         (lambda* (#:key outputs #:allow-other-keys)
+           (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
+             (mkdir-p lib)
+             (copy-file "libbam.a" (string-append lib "/libbam.a"))))
+         (alist-delete 'configure %standard-phases)))))
     (native-inputs `(("pkg-config" ,pkg-config)))
     (inputs `(("ncurses" ,ncurses)
               ("perl" ,perl)
-- 
2.1.0

>From f4ea1dbbb22b191c27f8bb1beb3af591855b9162 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <address@hidden>
Date: Tue, 28 Apr 2015 11:28:16 +0200
Subject: [PATCH 3/3] gnu: Add samtools-0.1.19.

* gnu/packages/bioinformatics.scm (samtools-0.1): New variable.
---
 gnu/packages/bioinformatics.scm | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 42b1f4f..bd673ac 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -1162,6 +1162,31 @@ variant calling (in conjunction with bcftools), and a 
simple alignment
 viewer.")
     (license license:expat)))
 
+(define-public samtools-0.1
+  (package (inherit samtools)
+    (version "0.1.19")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append "mirror://sourceforge/samtools/"
+                       version "/samtools-" version ".tar.bz2"))
+       (sha256
+        (base32 "1m33xsfwz0s8qi45lylagfllqg7fphf4dr0780rsvw75av9wk06h"))))
+    (arguments
+     (substitute-keyword-arguments (package-arguments samtools)
+       ((#:tests? tests) #f) ;no "check" target
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (replace 'install
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      (let ((bin (string-append
+                                  (assoc-ref outputs "out") "/bin")))
+                        (mkdir-p bin)
+                        (copy-file "samtools"
+                                   (string-append bin "/samtools")))))
+           (delete 'patch-tests)))))))
+
 (define-public ngs-sdk
   (package
     (name "ngs-sdk")
-- 
2.1.0


reply via email to

[Prev in Thread] Current Thread [Next in Thread]