unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] Add diamond
@ 2015-06-17  1:56 Ben Woodcroft
  2015-06-17  4:13 ` Mark H Weaver
  2015-06-17  4:54 ` Mark H Weaver
  0 siblings, 2 replies; 5+ messages in thread
From: Ben Woodcroft @ 2015-06-17  1:56 UTC (permalink / raw)
  To: guix-devel@gnu.org

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

Hi,

I'm quite new, so I strongly suspect there might be fixups required, but 
it works on my box. Well, it works on my setup in an isolated .scm file, 
but I wasn't sure how to test after I had patched bioinformatics.scm 
i.e. I expected the following to work. Thanks, there's a couple more 
patches (and questions..) to submit once I've learned from this one.

ben@u:~/git/guix$ GUIX_PACKAGE_PATH=/home/ben/git/guix guix package -i 
diamond --verbose -K
warning: failed to install locale: Invalid argument
;;; note: source file /home/ben/git/guix/gnu/packages/base.scm
;;;       newer than compiled 
/home/ben/.config/guix/latest/gnu/packages/base.go
;;; note: source file /home/ben/git/guix/gnu/packages/acl.scm
;;;       newer than compiled 
/home/ben/.config/guix/latest/gnu/packages/acl.go
...
guix package: warning: failed to load '(build-aux build-self)':
ERROR: no code for module (build-aux build-self)
guix package: warning: failed to load '(build-aux 
check-available-binaries)': exception thrown: #<condition &message 
[message: "python-disable-ssl-test.patch: patch not found"] 23501e0>
checking final inputs for 'x86_64-linux'...
substitute: warning: failed to install locale: Invalid argument
checking final inputs for 'i686-linux'...
checking final inputs for 'mips64el-linux'...
guix package: warning: failed to load '(build-aux 
check-final-inputs-self-contained)':
ERROR: no code for module (build-aux check-final-inputs-self-contained)
guix package: warning: failed to load '(build-aux download)':
guix package: warning: failed to load '(build-aux build-self)':
ERROR: Wrong number of arguments to #<procedure display-error (_ _ _ _ _ _)>
guix package: warning: failed to load '(build-aux 
check-available-binaries)': exception thrown: #<condition &message 
[message: "python-disable-ssl-test.patch: patch not found"] 689fda0>
guix package: warning: failed to load '(build-aux 
check-final-inputs-self-contained)':
ERROR: no code for module (build-aux check-final-inputs-self-contained)
guix package: warning: failed to load '(build-aux download)':
Backtrace:
In ice-9/boot-9.scm:
1724: 19 [%start-stack load-stack ...]
1729: 18 [#<procedure 13aeea0 ()>]
In unknown file:
    ?: 17 [primitive-load "/usr/local/bin/guix"]
In guix/ui.scm:
1015: 16 [run-guix-command package "-i" "diamond" "--verbose" "-K"]
In ice-9/boot-9.scm:
  157: 15 [catch srfi-34 #<procedure 404b3a0 at guix/ui.scm:377:2 ()> ...]
  157: 14 [catch system-error ...]
In guix/scripts/package.scm:
1045: 13 [#<procedure 4378f30 at guix/scripts/package.scm:1034:4 ()>]
  904: 12 [process-actions (# # # # ...)]
  656: 11 [options->installable (# # # # ...) #<<manifest> entries: #>]
In srfi/srfi-1.scm:
  664: 10 [filter-map #<procedure 40432a0 at 
guix/scripts/package.scm:656:16 (expr)> ...]
In guix/scripts/package.scm:
  662: 9 [#<procedure 40432a0 at guix/scripts/package.scm:656:16 (expr)> #]
  347: 8 [specification->package+output "diamond" "out"]
In gnu/packages.scm:
  259: 7 [find-best-packages-by-name "diamond" #f]
In guix/utils.scm:
  428: 6 [#<procedure 1d80ba0 at guix/utils.scm:424:4 args>]
In gnu/packages.scm:
  208: 5 [fold-packages #<procedure 1ac62a0 at gnu/packages.scm:241:20 
(p r)> #]
In srfi/srfi-1.scm:
  481: 4 [fold-right #<procedure 1ac6740 at gnu/packages.scm:179:14 
(spec result)> ...]
In gnu/packages.scm:
  182: 3 [#<procedure 1ac6740 at gnu/packages.scm:179:14 (spec result)> 
"/home/ben/git/guix" ...]
In srfi/srfi-1.scm:
  664: 2 [filter-map #<procedure 28823a0 at gnu/packages.scm:162:14 
(file)> #]
In gnu/packages.scm:
  170: 1 [#<procedure 68bea80 at gnu/packages.scm:168:20 args> 
match-error ...]
In unknown file:
    ?: 0 [display-error #f #<output: file /dev/pts/20> ...]

ERROR: In procedure display-error:
ERROR: Wrong number of arguments to #<procedure display-error (_ _ _ _ _ _)>


[-- Attachment #2: 0001-gnu-Add-diamond.patch --]
[-- Type: text/x-patch, Size: 2732 bytes --]

From e24f4de21ee3c367c38e431626f4796795eb9e18 Mon Sep 17 00:00:00 2001
From: Ben Woodcroft <donttrustben@gmail.com>
Date: Wed, 17 Jun 2015 11:49:27 +1000
Subject: [PATCH] gnu: Add diamond.

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

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 0d8a6d5..94db812 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -28,6 +28,7 @@
   #:use-module (guix build-system python)
   #:use-module (guix build-system trivial)
   #:use-module (gnu packages)
+  #:use-module (gnu packages algebra)
   #:use-module (gnu packages base)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages compression)
@@ -615,6 +616,51 @@ file formats including SAM/BAM, Wiggle/BigWig, BED, GFF/GTF, VCF.")
 other types of unwanted sequence from high-throughput sequencing reads.")
     (license license:expat)))
 
+(define-public diamond
+  (package
+    (name "diamond")
+    (version "0.7.9")
+    (source (origin
+              (method url-fetch)
+              (uri
+               (string-append
+                "https://github.com/bbuchfink/diamond/archive/v" version ".tar.gz"))
+              (sha256
+               (base32
+                "0hfkcfv9f76h5brbyw9fyvmc0l9cmbsxrcdqk0fa9xv82zj47p15"))))
+    (build-system gnu-build-system)
+    (arguments
+     '(#:tests? #f ;no "check" target
+		#:phases
+		(alist-cons-after
+		 'unpack 'enter-source-dir
+		 (lambda _ (chdir "src"))
+		 (alist-replace
+		  'install
+		  (lambda* (#:key outputs #:allow-other-keys)
+			   (let ((bin (string-append
+				       (assoc-ref outputs "out") "/bin")))
+			     (mkdir-p bin)
+			     (copy-file "../bin/diamond" (string-append bin "/diamond"))))
+		  (alist-delete 'configure %standard-phases)))))
+    (native-inputs
+     `(("bc" ,bc)))
+    (inputs
+     `(("boost" ,boost)
+       ("zlib" ,zlib)))
+    (home-page "https://github.com/bbuchfink/diamond")
+    (synopsis "Accelerated BLAST compatible local sequence aligner")
+    (description
+     "DIAMOND is a BLAST-compatible local aligner for mapping protein and
+translated DNA query sequences against a protein reference database (BLASTP
+and BLASTX alignment mode). The speedup over BLAST is up to 20,000 on short
+reads at a typical sensitivity of 90-99% relative to BLAST depending on the
+data and settings.")
+    (license (license:non-copyleft (string-append "https://github.com/bbuchfink"
+						  "/diamond/blob/v"
+						  version
+						  "/src/COPYING")))))
+
 (define-public edirect
   (package
     (name "edirect")
-- 
2.1.4


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

* Re: [PATCH] Add diamond
  2015-06-17  1:56 [PATCH] Add diamond Ben Woodcroft
@ 2015-06-17  4:13 ` Mark H Weaver
  2015-06-17  4:54 ` Mark H Weaver
  1 sibling, 0 replies; 5+ messages in thread
From: Mark H Weaver @ 2015-06-17  4:13 UTC (permalink / raw)
  To: Ben Woodcroft; +Cc: guix-devel@gnu.org

Ben Woodcroft <b.woodcroft@uq.edu.au> writes:

> I'm quite new, so I strongly suspect there might be fixups required,
> but it works on my box. Well, it works on my setup in an isolated .scm
> file, but I wasn't sure how to test after I had patched
> bioinformatics.scm i.e. I expected the following to work. Thanks,
> there's a couple more patches (and questions..) to submit once I've
> learned from this one.
>
> ben@u:~/git/guix$ GUIX_PACKAGE_PATH=/home/ben/git/guix guix package -i 
> diamond --verbose -K

If you modified the files in the git repo directly, then just do this:

  ./pre-inst-env guix build -K diamond

and if that succeeds:

  ./pre-inst-env guix package -i diamond

GUIX_PACKAGE_PATH is only needed if you're _not_ working from a git
repo, and in that case you want to point it to a directory that contains
_only_ *.scm files with your out-of-tree package descriptions, nothing
else.

The problem you ran into is that Guix will attempt to load every *.scm
file in that directory tree looking for package descriptions, and it
does not cope well with other things being in there like build-aux/*.scm

      Mark

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

* Re: [PATCH] Add diamond
  2015-06-17  1:56 [PATCH] Add diamond Ben Woodcroft
  2015-06-17  4:13 ` Mark H Weaver
@ 2015-06-17  4:54 ` Mark H Weaver
  2015-06-17  9:25   ` Ben Woodcroft
  1 sibling, 1 reply; 5+ messages in thread
From: Mark H Weaver @ 2015-06-17  4:54 UTC (permalink / raw)
  To: Ben Woodcroft; +Cc: guix-devel@gnu.org

Ben Woodcroft <b.woodcroft@uq.edu.au> writes:

> From e24f4de21ee3c367c38e431626f4796795eb9e18 Mon Sep 17 00:00:00 2001
> From: Ben Woodcroft <donttrustben@gmail.com>
> Date: Wed, 17 Jun 2015 11:49:27 +1000
> Subject: [PATCH] gnu: Add diamond.
>
> * gnu/packages/bioinformatics.scm (diamond): New variable.
> ---
>  gnu/packages/bioinformatics.scm | 46 +++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 46 insertions(+)
>
> diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
> index 0d8a6d5..94db812 100644
> --- a/gnu/packages/bioinformatics.scm
> +++ b/gnu/packages/bioinformatics.scm

Please add a copyright line for yourself to the top of the file.

> @@ -28,6 +28,7 @@
>    #:use-module (guix build-system python)
>    #:use-module (guix build-system trivial)
>    #:use-module (gnu packages)
> +  #:use-module (gnu packages algebra)
>    #:use-module (gnu packages base)
>    #:use-module (gnu packages boost)
>    #:use-module (gnu packages compression)
> @@ -615,6 +616,51 @@ file formats including SAM/BAM, Wiggle/BigWig, BED, GFF/GTF, VCF.")
>  other types of unwanted sequence from high-throughput sequencing reads.")
>      (license license:expat)))
>  
> +(define-public diamond
> +  (package
> +    (name "diamond")
> +    (version "0.7.9")
> +    (source (origin
> +              (method url-fetch)
> +              (uri
> +               (string-append
> +                "https://github.com/bbuchfink/diamond/archive/v" version ".tar.gz"))

Please add:

              (file-name (string-append name "-" version ".tar.gz"))

to this 'origin' form, because otherwise the filename of the source
tarball in the store will be /gnu/store/…-v0.7.9.tar.gz without the name
of the package.  By default it is named based on the last path component
of the source URI.

> +              (sha256
> +               (base32
> +                "0hfkcfv9f76h5brbyw9fyvmc0l9cmbsxrcdqk0fa9xv82zj47p15"))))

It would be good to remove the pre-compiled binary by adding the
following snippet to the 'origin' form:

--8<---------------cut here---------------start------------->8---
              (snippet '(begin
                          (delete-file "bin/diamond")
                          #t))
--8<---------------cut here---------------end--------------->8---

> +    (build-system gnu-build-system)
> +    (arguments
> +     '(#:tests? #f ;no "check" target
> +		#:phases

Please use spaces instead of tabs, and align "#:phases" directly under
"#:tests?".

> +		(alist-cons-after
> +		 'unpack 'enter-source-dir
> +		 (lambda _ (chdir "src"))

Phase procedures should return a boolean indicating whether the phase
succeeded, but the return value of 'chdir' is unspecified.  So you
should add #t after (chdir "src").

> +		 (alist-replace
> +		  'install
> +		  (lambda* (#:key outputs #:allow-other-keys)
> +			   (let ((bin (string-append
> +				       (assoc-ref outputs "out") "/bin")))
> +			     (mkdir-p bin)
> +			     (copy-file "../bin/diamond" (string-append bin "/diamond"))))

Our convention is to have the body of a lambda indented two columns more
than the lambda itself, so the open paren of the 'let' should be under
the 'a' in 'lambda'.  Add #t to the end.  Please try to keep lines <= 80
columns.

> +		  (alist-delete 'configure %standard-phases)))))

It would also be good to use our new and improved 'modify-phases'
syntax.  Search for it in gnu/packages/*.scm for examples.

> +    (native-inputs
> +     `(("bc" ,bc)))
> +    (inputs
> +     `(("boost" ,boost)
> +       ("zlib" ,zlib)))
> +    (home-page "https://github.com/bbuchfink/diamond")
> +    (synopsis "Accelerated BLAST compatible local sequence aligner")
> +    (description
> +     "DIAMOND is a BLAST-compatible local aligner for mapping protein and
> +translated DNA query sequences against a protein reference database (BLASTP
> +and BLASTX alignment mode). The speedup over BLAST is up to 20,000 on short

Please put two spaces between sentences.

> +reads at a typical sensitivity of 90-99% relative to BLAST depending on the
> +data and settings.")
> +    (license (license:non-copyleft (string-append "https://github.com/bbuchfink"
> +						  "/diamond/blob/v"
> +						  version
> +						  "/src/COPYING")))))

    (license (license:non-copyleft "file://src/COPYING"
                                   "See src/COPYING in the distribution."))))

I wouldn't normally do this, but I went ahead and tested it with these
changes and here's what it comes out to:

--8<---------------cut here---------------start------------->8---
(define-public diamond
  (package
    (name "diamond")
    (version "0.7.9")
    (source (origin
              (method url-fetch)
              (uri (string-append
                    "https://github.com/bbuchfink/diamond/archive/v"
                    version ".tar.gz"))
              (file-name (string-append name "-" version ".tar.gz"))
              (sha256
               (base32
                "0hfkcfv9f76h5brbyw9fyvmc0l9cmbsxrcdqk0fa9xv82zj47p15"))
              (snippet '(begin
                          (delete-file "bin/diamond")
                          #t))))
    (build-system gnu-build-system)
    (arguments
     '(#:tests? #f  ;no "check" target
       #:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'enter-source-dir
                    (lambda _
                      (chdir "src")
                      #t))
         (delete 'configure)
         (replace 'install
                  (lambda* (#:key outputs #:allow-other-keys)
                    (let ((bin (string-append (assoc-ref outputs "out")
                                              "/bin")))
                      (mkdir-p bin)
                      (copy-file "../bin/diamond"
                                 (string-append bin "/diamond"))
                      #t))))))
    (native-inputs
     `(("bc" ,bc)))
    (inputs
     `(("boost" ,boost)
       ("zlib" ,zlib)))
    (home-page "https://github.com/bbuchfink/diamond")
    (synopsis "Accelerated BLAST compatible local sequence aligner")
    (description
     "DIAMOND is a BLAST-compatible local aligner for mapping protein and
translated DNA query sequences against a protein reference database (BLASTP
and BLASTX alignment mode).  The speedup over BLAST is up to 20,000 on short
reads at a typical sensitivity of 90-99% relative to BLAST depending on the
data and settings.")
    (license (license:non-copyleft "file://src/COPYING"
                                   "See src/COPYING in the distribution."))))
--8<---------------cut here---------------end--------------->8---

but feel free to do it a bit differently :)  Anyway, can you send an
updated patch?  Don't forget your copyright notice.

     Thanks!
       Mark

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

* Re: [PATCH] Add diamond
  2015-06-17  4:54 ` Mark H Weaver
@ 2015-06-17  9:25   ` Ben Woodcroft
  2015-06-17 23:48     ` Mark H Weaver
  0 siblings, 1 reply; 5+ messages in thread
From: Ben Woodcroft @ 2015-06-17  9:25 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: guix-devel@gnu.org

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

On 17/06/15 14:54, Mark H Weaver wrote:
> I wouldn't normally do this, but I went ahead and tested it with these
> changes and here's what it comes out to:
Thanks very much for taking the time to do this. I've attached the 
updated patch. Wasn't sure if there a standard way to thank you in the 
commit message?

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Add-diamond.patch --]
[-- Type: text/x-patch; name="0001-gnu-Add-diamond.patch", Size: 3483 bytes --]

From 7542d5eac8b8c813569f57a223f34de45f47edf6 Mon Sep 17 00:00:00 2001
From: Ben Woodcroft <donttrustben@gmail.com>
Date: Wed, 17 Jun 2015 19:21:22 +1000
Subject: [PATCH] gnu: Add diamond.

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

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 0d8a6d5..5c75374 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2014, 2015 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2015 Ben Woodcroft <donttrustben@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -28,6 +29,7 @@
   #:use-module (guix build-system python)
   #:use-module (guix build-system trivial)
   #:use-module (gnu packages)
+  #:use-module (gnu packages algebra)
   #:use-module (gnu packages base)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages compression)
@@ -615,6 +617,56 @@ file formats including SAM/BAM, Wiggle/BigWig, BED, GFF/GTF, VCF.")
 other types of unwanted sequence from high-throughput sequencing reads.")
     (license license:expat)))
 
+(define-public diamond
+  (package
+    (name "diamond")
+    (version "0.7.9")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "https://github.com/bbuchfink/diamond/archive/v"
+                    version ".tar.gz"))
+              (file-name (string-append name "-" version ".tar.gz"))
+              (sha256
+               (base32
+                "0hfkcfv9f76h5brbyw9fyvmc0l9cmbsxrcdqk0fa9xv82zj47p15"))
+              (snippet '(begin
+                          (delete-file "bin/diamond")
+                          #t))))
+    (build-system gnu-build-system)
+    (arguments
+     '(#:tests? #f  ;no "check" target
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'enter-source-dir
+                    (lambda _
+                      (chdir "src")
+                      #t))
+         (delete 'configure)
+         (replace 'install
+                  (lambda* (#:key outputs #:allow-other-keys)
+                    (let ((bin (string-append (assoc-ref outputs "out")
+                                              "/bin")))
+                      (mkdir-p bin)
+                      (copy-file "../bin/diamond"
+                                 (string-append bin "/diamond"))
+                      #t))))))
+    (native-inputs
+     `(("bc" ,bc)))
+    (inputs
+     `(("boost" ,boost)
+       ("zlib" ,zlib)))
+    (home-page "https://github.com/bbuchfink/diamond")
+    (synopsis "Accelerated BLAST compatible local sequence aligner")
+    (description
+     "DIAMOND is a BLAST-compatible local aligner for mapping protein and
+translated DNA query sequences against a protein reference database (BLASTP
+and BLASTX alignment mode).  The speedup over BLAST is up to 20,000 on short
+reads at a typical sensitivity of 90-99% relative to BLAST depending on the
+data and settings.")
+    (license (license:non-copyleft "file://src/COPYING"
+                                   "See src/COPYING in the distribution."))))
+
 (define-public edirect
   (package
     (name "edirect")
-- 
2.1.4


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

* Re: [PATCH] Add diamond
  2015-06-17  9:25   ` Ben Woodcroft
@ 2015-06-17 23:48     ` Mark H Weaver
  0 siblings, 0 replies; 5+ messages in thread
From: Mark H Weaver @ 2015-06-17 23:48 UTC (permalink / raw)
  To: Ben Woodcroft; +Cc: guix-devel@gnu.org

Ben Woodcroft <b.woodcroft@uq.edu.au> writes:

> On 17/06/15 14:54, Mark H Weaver wrote:
>> I wouldn't normally do this, but I went ahead and tested it with these
>> changes and here's what it comes out to:
> Thanks very much for taking the time to do this. I've attached the
> updated patch.

Pushed, thanks!

> Wasn't sure if there a standard way to thank you in the
> commit message?

No need, but thanks for asking.

     Mark

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

end of thread, other threads:[~2015-06-17 23:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-17  1:56 [PATCH] Add diamond Ben Woodcroft
2015-06-17  4:13 ` Mark H Weaver
2015-06-17  4:54 ` Mark H Weaver
2015-06-17  9:25   ` Ben Woodcroft
2015-06-17 23:48     ` Mark H Weaver

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).