unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] Various samtools patches.
@ 2015-04-28  9:35 Ricardo Wurmus
  2015-05-03 19:37 ` Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Ricardo Wurmus @ 2015-04-28  9:35 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 422 bytes --]

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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-samtools-Remove-patch-makefile-curses-phase.patch --]
[-- Type: text/x-patch, Size: 3033 bytes --]

From 5153c937e39cfeb59275594047fcccec6859f250 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-gnu-samtools-Install-libbam.a-library.patch --]
[-- Type: text/x-patch, Size: 1429 bytes --]

From f33a1acd0d882068520f85ad73c985492ee0b16b Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: 0003-gnu-Add-samtools-0.1.19.patch --]
[-- Type: text/x-patch, Size: 1739 bytes --]

From f4ea1dbbb22b191c27f8bb1beb3af591855b9162 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-05-04  8:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-28  9:35 [PATCH] Various samtools patches Ricardo Wurmus
2015-05-03 19:37 ` Ludovic Courtès
2015-05-04  8:30   ` Ricardo Wurmus

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).