all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH 0/15]: Add pplacer and OCaml dependencies.
@ 2017-02-07 11:34 Ben Woodcroft
  2017-02-09 22:32 ` Ludovic Courtès
  0 siblings, 1 reply; 7+ messages in thread
From: Ben Woodcroft @ 2017-02-07 11:34 UTC (permalink / raw)
  To: guix-devel@gnu.org

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

Hi there.

I'm quite happy to send these patches in, pplacer has been near the top 
of my most wanted list since I started contributing. There's two parts 
that are a little out of the ordinary:

1) Unfortunately pplacer requires the outdated OCaml 4.01, so I adapted 
the package-with-python2 approach.

2) The pplacer package itself is made up of an OCaml part, plus some 
Python scripts, so I made the scripts a different package and propagated 
that package.

Thanks in advance for any review.

ben.


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

From c65a1ebb914e87849a93c056df9648895213a65b Mon Sep 17 00:00:00 2001
From: Ben Woodcroft <donttrustben@gmail.com>
Date: Mon, 2 Jan 2017 17:18:59 +1000
Subject: [PATCH 01/15] gnu: Add ocaml-4.01.

* gnu/packages/ocaml.scm (ocaml-4.01): New variable.
---
 gnu/packages/ocaml.scm | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index 9a0bc9112..2026def09 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -7,6 +7,7 @@
 ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016, 2017 Julien Lepiller <julien@lepiller.eu>
+;;; Copyright © 2017 Ben Woodcroft <donttrustben@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -211,6 +212,36 @@ functional, imperative and object-oriented styles of programming.")
     ;; distributed under lgpl2.0.
     (license (list license:qpl license:lgpl2.0))))
 
+(define-public ocaml-4.01
+  (package
+    (inherit ocaml)
+    (version "4.01.0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "http://caml.inria.fr/pub/distrib/ocaml-"
+                    (version-major+minor version)
+                    "/ocaml-" version ".tar.xz"))
+              (sha256
+               (base32
+                "03d7ida94s1gpr3gadf4jyhmh5rrszd5s4m4z59daaib25rvfyv7"))))
+    (arguments
+     (substitute-keyword-arguments (package-arguments ocaml)
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (replace 'build
+             (lambda _
+               ;; Specifying '-j' at all causes the build to fail.
+               (zero? (system* "make" "world.opt"))))
+           (replace 'check
+             (lambda _
+               (with-directory-excursion "testsuite"
+                 (zero? (system*
+                         "make"
+                         "all"
+                         (string-append
+                          "TOPDIR=" (getcwd) "/.."))))))))))))
+
 (define-public opam
   (package
     (name "opam")
-- 
2.11.0


From 59f91446e99562a290b86514b3c143b00c0ef053 Mon Sep 17 00:00:00 2001
From: Ben Woodcroft <donttrustben@gmail.com>
Date: Mon, 2 Jan 2017 22:29:28 +1000
Subject: [PATCH 02/15] gnu: Add ocaml4.01-findlib.

* gnu/packages/ocaml.scm (ocaml4.01-findlib): New variable.
---
 gnu/packages/ocaml.scm | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index 2026def09..00640cd4a 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -837,6 +837,14 @@ compilation and linkage, there are new frontends of the various OCaml
 compilers that can directly deal with packages.")
     (license license:x11)))
 
+(define-public ocaml4.01-findlib
+  (package
+    (inherit ocaml-findlib)
+    (name "ocaml4.01-findlib")
+    (native-inputs
+     `(("m4" ,m4)
+       ("ocaml" ,ocaml-4.01)))))
+
 ;; note that some tests may hang for no obvious reason.
 (define-public ocaml-ounit
   (package
-- 
2.11.0


From b236357c4dedfaa77fddcb2fdec3d7203ec72764 Mon Sep 17 00:00:00 2001
From: Ben Woodcroft <donttrustben@gmail.com>
Date: Mon, 2 Jan 2017 22:23:34 +1000
Subject: [PATCH 03/15] build-system: Add package-with-ocaml4.01.

* guix/build-system/ocaml.scm (default-ocaml4.01, default-ocaml4.01-findlib,
package-with-explicit-ocaml, package-with-ocaml4.01,
strip-ocaml4.01-variant): New variables.
---
 guix/build-system/ocaml.scm | 92 ++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 91 insertions(+), 1 deletion(-)

diff --git a/guix/build-system/ocaml.scm b/guix/build-system/ocaml.scm
index f4f57b5ad..7fba1c261 100644
--- a/guix/build-system/ocaml.scm
+++ b/guix/build-system/ocaml.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2016, 2017 Julien Lepiller <julien@lepiller.eu>
+;;; Copyright © 2017 Ben Woodcroft <donttrustben@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -15,7 +16,6 @@
 ;;;
 ;;; 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 (guix build-system ocaml)
   #:use-module (guix store)
   #:use-module (guix utils)
@@ -25,7 +25,10 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix packages)
   #:use-module (ice-9 match)
+  #:use-module (srfi srfi-1)
   #:export (%ocaml-build-system-modules
+            package-with-ocaml4.01
+            strip-ocaml4.01-variant
             ocaml-build
             ocaml-build-system))
 
@@ -71,6 +74,93 @@
   (let ((module (resolve-interface '(gnu packages ocaml))))
     (module-ref module 'ocaml-findlib)))
 
+(define (default-ocaml4.01)
+  (let ((ocaml (resolve-interface '(gnu packages ocaml))))
+    (module-ref ocaml 'ocaml-4.01)))
+
+(define (default-ocaml4.01-findlib)
+  (let ((module (resolve-interface '(gnu packages ocaml))))
+    (module-ref module 'ocaml4.01-findlib)))
+
+(define* (package-with-explicit-ocaml ocaml findlib old-prefix new-prefix
+                                       #:key variant-property)
+  "Return a procedure of one argument, P.  The procedure creates a package
+with the same fields as P, which is assumed to use OCAML-BUILD-SYSTEM, such
+that it is compiled with OCAML and FINDLIB instead.  The inputs are changed
+recursively accordingly.  If the name of P starts with OLD-PREFIX, this is
+replaced by NEW-PREFIX; otherwise, NEW-PREFIX is prepended to the name.
+
+When VARIANT-PROPERTY is present, it is used as a key to search for
+pre-defined variants of this transformation recorded in the 'properties' field
+of packages.  The property value must be the promise of a package.  This is a
+convenient way for package writers to force the transformation to use
+pre-defined variants."
+  (define transform
+    ;; Memoize the transformations.  Failing to do that, we would build a huge
+    ;; object graph with lots of duplicates, which in turns prevents us from
+    ;; benefiting from memoization in 'package-derivation'.
+    (memoize                                      ;FIXME: use 'eq?'
+     (lambda (p)
+       (let* ((rewrite-if-package
+               (lambda (content)
+                 ;; CONTENT may be a file name, in which case it is returned,
+                 ;; or a package, which is rewritten with the new OCAML and
+                 ;; NEW-PREFIX.
+                 (if (package? content)
+                     (transform content)
+                     content)))
+              (rewrite
+               (match-lambda
+                 ((name content . rest)
+                  (append (list name (rewrite-if-package content)) rest)))))
+
+         (cond
+          ;; If VARIANT-PROPERTY is present, use that.
+          ((and variant-property
+                (assoc-ref (package-properties p) variant-property))
+           => force)
+
+          ;; Otherwise build the new package object graph.
+          ((eq? (package-build-system p) ocaml-build-system)
+           (package
+             (inherit p)
+             (location (package-location p))
+             (name (let ((name (package-name p)))
+                     (string-append new-prefix
+                                    (if (string-prefix? old-prefix name)
+                                        (substring name
+                                                   (string-length old-prefix))
+                                        name))))
+             (arguments
+              (let ((ocaml (if (promise? ocaml)
+                               (force ocaml)
+                               ocaml))
+                    (findlib (if (promise? findlib)
+                                 (force findlib)
+                                 findlib)))
+                (ensure-keyword-arguments (package-arguments p)
+                                          `(#:ocaml ,ocaml
+                                            #:findlib ,findlib))))
+             (inputs (map rewrite (package-inputs p)))
+             (propagated-inputs (map rewrite (package-propagated-inputs p)))
+             (native-inputs (map rewrite (package-native-inputs p)))))
+          (else
+           p))))))
+
+  transform)
+
+(define package-with-ocaml4.01
+  (package-with-explicit-ocaml (delay (default-ocaml4.01))
+                               (delay (default-ocaml4.01-findlib))
+                                "ocaml-" "ocaml4.01-"
+                                #:variant-property 'ocaml4.01-variant))
+
+(define (strip-ocaml4.01-variant p)
+  "Remove the 'ocaml4.01-variant' property from P."
+  (package
+    (inherit p)
+    (properties (alist-delete 'ocaml4.01-variant (package-properties p)))))
+
 (define* (lower name
                 #:key source inputs native-inputs outputs system target
                 (ocaml (default-ocaml))
-- 
2.11.0


From 7b50b26fcec2b19726032dee0a72595016f90a89 Mon Sep 17 00:00:00 2001
From: Ben Woodcroft <donttrustben@gmail.com>
Date: Fri, 6 Jan 2017 21:01:05 +1000
Subject: [PATCH 04/15] gnu: Add ocaml-sqlite3.

* gnu/packages/ocaml.scm (ocaml-sqlite3, ocaml4.01-sqlite3): New variables.
---
 gnu/packages/ocaml.scm | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index 00640cd4a..fb7a26908 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -30,6 +30,7 @@
   #:use-module (gnu packages base)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages curl)
+  #:use-module (gnu packages databases)
   #:use-module (gnu packages emacs)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages ghostscript)
@@ -1252,6 +1253,39 @@ to operate on the result type available from OCaml 4.03 in the standard
 library.")
     (license license:isc)))
 
+(define-public ocaml-sqlite3
+  (package
+    (name "ocaml-sqlite3")
+    (version "4.1.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://github.com/mmottl/sqlite3-ocaml/releases/download/v"
+             version "/sqlite3-ocaml-" version ".tar.gz"))
+       (sha256
+        (base32
+         "14c1nir7c6bivajg0vyx853y7la7r5d25g1v5hjb2wfi73r15p1m"))))
+    (build-system ocaml-build-system)
+    (native-inputs
+     `(("pkg-config" ,pkg-config)))
+    (inputs
+     `(("sqlite" ,sqlite)))
+    (home-page "https://mmottl.github.io/sqlite3-ocaml")
+    (synopsis "SQLite3 Bindings for OCaml")
+    (description
+     "SQLite3-OCaml is an OCaml library with bindings to the SQLite3 client
+API.  Sqlite3 is a self-contained, serverless, zero-configuration,
+transactional SQL database engine with outstanding performance for many use
+cases.  These bindings are written in a way that enables a friendly
+coexistence with the old (version 2) SQLite and its OCaml wrapper
+@code{ocaml-sqlite}.")
+    (properties `((ocaml4.01-variant . ,(delay ocaml4.01-sqlite3))))
+    (license license:expat)))
+
+(define-public ocaml4.01-sqlite3
+  (package-with-ocaml4.01 (strip-ocaml4.01-variant ocaml-sqlite3)))
+
 (define-public ocaml-mtime
   (package
     (name "ocaml-mtime")
-- 
2.11.0


From 2cda111e3532737cc0aaf5072b7632e4c8cb813d Mon Sep 17 00:00:00 2001
From: Ben Woodcroft <donttrustben@gmail.com>
Date: Fri, 6 Jan 2017 21:31:07 +1000
Subject: [PATCH 05/15] gnu: Add ocaml-csv.

* gnu/packages/ocaml.scm (ocaml-csv, ocaml4.01-csv): New variables.
---
 gnu/packages/ocaml.scm | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index fb7a26908..7b3ad80ed 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -1286,6 +1286,34 @@ coexistence with the old (version 2) SQLite and its OCaml wrapper
 (define-public ocaml4.01-sqlite3
   (package-with-ocaml4.01 (strip-ocaml4.01-variant ocaml-sqlite3)))
 
+(define-public ocaml-csv
+  (package
+    (name "ocaml-csv")
+    (version "1.5")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append
+         "http://github.com/Chris00/ocaml-csv//download/"
+         version "/csv-" version ".tar.gz"))
+       (sha256
+        (base32
+         "13zm5g390i741qwhvd25xn0aq3gmnd0qipqgp5j3vzpmwls7cc7n"))))
+    (build-system ocaml-build-system)
+    (home-page "https://github.com/Chris00/ocaml-csv")
+    (synopsis "Pure OCaml functions to read and write CSV")
+    (description
+     "@dfn{Comma separated values} (CSV) is a simple tabular format supported
+by all major spreadsheets.  This library implements pure OCaml functions to
+read and write files in this format as well as some convenience functions to
+manipulate such data.")
+    (properties `((ocaml4.01-variant . ,(delay ocaml4.01-csv))))
+    (license (package-license camlp4))))
+
+(define-public ocaml4.01-csv
+  (package-with-ocaml4.01 (strip-ocaml4.01-variant ocaml-csv)))
+
 (define-public ocaml-mtime
   (package
     (name "ocaml-mtime")
-- 
2.11.0


From cdc165bce0fb5312b2775f87564e2e753d2b4715 Mon Sep 17 00:00:00 2001
From: Ben Woodcroft <donttrustben@gmail.com>
Date: Fri, 6 Jan 2017 21:37:06 +1000
Subject: [PATCH 06/15] gnu: Add ocaml-gsl.

* gnu/packages/ocaml.scm (ocaml-gsl, ocaml4.01-gsl): New variables.
---
 gnu/packages/maths.scm | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index c9de4f421..5620fe735 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -17,6 +17,7 @@
 ;;; Copyright © 2016 Thomas Danckaert <post@thomasdanckaert.be>
 ;;; Copyright © 2017 Paul Garlick <pgarlick@tourbillion-technology.com>
 ;;; Copyright © 2017 ng0 <contact.ng0@cryptolab.net>
+;;; Copyright © 2017 Ben Woodcroft <donttrustben@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -44,6 +45,7 @@
   #:use-module (guix build utils)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system ocaml)
   #:use-module (guix build-system r)
   #:use-module (gnu packages algebra)
   #:use-module (gnu packages bison)
@@ -76,6 +78,7 @@
   #:use-module (gnu packages mpi)
   #:use-module (gnu packages multiprecision)
   #:use-module (gnu packages netpbm)
+  #:use-module (gnu packages ocaml)
   #:use-module (gnu packages pcre)
   #:use-module (gnu packages popt)
   #:use-module (gnu packages perl)
@@ -252,6 +255,34 @@ differential equations, linear algebra, Fast Fourier Transforms and random
 numbers.")
     (license license:gpl3+)))
 
+(define-public ocaml-gsl
+  (package
+    (name "ocaml-gsl")
+    (version "1.19.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append
+         "https://github.com/mmottl/gsl-ocaml/releases/download/v"
+         version"/gsl-ocaml-" version ".tar.gz"))
+       (sha256
+        (base32
+         "0rjbng1540kn33c7dfhqga9hna71zkm1llq1yb1a0kivxna1b285"))))
+    (build-system ocaml-build-system)
+    (inputs
+     `(("gsl" ,gsl)))
+    (home-page "https://mmottl.github.io/gsl-ocaml")
+    (synopsis "Bindings to the GNU Scientific Library")
+    (description
+     "GSL-OCaml is an interface to the @dfn{GNU scientific library} (GSL) for
+the OCaml language.")
+    (properties `((ocaml4.01-variant . ,(delay ocaml4.01-gsl))))
+    (license license:gpl3+)))
+
+(define-public ocaml4.01-gsl
+  (package-with-ocaml4.01 (strip-ocaml4.01-variant ocaml-gsl)))
+
 (define-public glpk
   (package
     (name "glpk")
-- 
2.11.0


From a3e04efe37c7393c1c00eee54a57ee5e99646a1e Mon Sep 17 00:00:00 2001
From: Ben Woodcroft <donttrustben@gmail.com>
Date: Fri, 6 Jan 2017 21:52:34 +1000
Subject: [PATCH 07/15] gnu: Add ocaml-mcl.

* gnu/packages/machine-learning.scm (ocaml-mcl, ocaml4.01-mcl): New
variables.
---
 gnu/packages/machine-learning.scm | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 8f1f8ee53..3c2891280 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -26,6 +26,7 @@
   #:use-module (guix svn-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system ocaml)
   #:use-module (guix build-system r)
   #:use-module (gnu packages)
   #:use-module (gnu packages autotools)
@@ -35,6 +36,7 @@
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages image)
   #:use-module (gnu packages maths)
+  #:use-module (gnu packages ocaml)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
@@ -239,6 +241,43 @@ networks) based on simulation of (stochastic) flow in graphs.")
     ;; http://listserver.ebi.ac.uk/pipermail/mcl-users/2016/000376.html
     (license license:gpl3)))
 
+(define-public ocaml-mcl
+  (package
+    (name "ocaml-mcl")
+    (version "12-068oasis4")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://github.com/fhcrc/mcl/archive/"
+             version ".tar.gz"))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32
+         "1l5jbhwjpsj38x8b9698hfpkv75h8hn3kj0gihjhn8ym2cwwv110"))))
+    (build-system ocaml-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before 'configure 'patch-paths
+           (lambda _
+             (substitute* "configure"
+               (("SHELL = /bin/sh") (string-append "SHELL = "(which "sh"))))
+             (substitute* "setup.ml"
+               (("LDFLAGS=-fPIC")
+                (string-append "LDFLAGS=-fPIC\"; \"SHELL=" (which "sh"))))
+             #t)))))
+    (home-page "https://github.com/fhcrc/mcl")
+    (synopsis "OCaml wrappers around MCL")
+    (description
+     "This package provides OCaml bindings for the MCL graph clustering
+algorithm.")
+    (properties `((ocaml4.01-variant . ,(delay ocaml4.01-mcl))))
+    (license license:gpl3)))
+
+(define-public ocaml4.01-mcl
+  (package-with-ocaml4.01 (strip-ocaml4.01-variant ocaml-mcl)))
+
 (define-public randomjungle
   (package
     (name "randomjungle")
-- 
2.11.0


From 3a8a7d03b7124793326d8b784f75578365374ed4 Mon Sep 17 00:00:00 2001
From: Ben Woodcroft <donttrustben@gmail.com>
Date: Fri, 6 Jan 2017 22:11:00 +1000
Subject: [PATCH 08/15] gnu: Add ocaml4.01-bisect.

* gnu/packages/ocaml.scm (ocaml4.01-bisect): New variable.
(ocaml-bisect)[properties]: New field.
---
 gnu/packages/ocaml.scm | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index 7b3ad80ed..577c1ad81 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -1102,8 +1102,21 @@ a camlp4-based tool that allows to instrument your application before running
 tests.  After application execution, it is possible to generate a report in HTML
 format that is the replica of the application source code annotated with code
 coverage information.")
+    (properties `((ocaml4.01-variant . ,(delay ocaml4.01-bisect))))
     (license license:gpl3+)))
 
+(define-public ocaml4.01-bisect
+  (let ((base (package-with-ocaml4.01 (strip-ocaml4.01-variant ocaml-bisect))))
+    (package
+      (inherit base)
+      (arguments
+       (substitute-keyword-arguments (package-arguments base)
+         ;; In OCaml 4.01.0, camlp4 is bundled with OCaml.
+         ((#:make-flags _) '(list "all"))))
+      (native-inputs
+       `(("which" ,which)))
+      (propagated-inputs '()))))
+
 (define-public ocaml-bitstring
   (package
     (name "ocaml-bitstring")
-- 
2.11.0


From 7a9ea0a12348adba5a446f737b0424e108745e89 Mon Sep 17 00:00:00 2001
From: Ben Woodcroft <donttrustben@gmail.com>
Date: Fri, 6 Jan 2017 22:15:12 +1000
Subject: [PATCH 09/15] gnu: Add ocaml4.01-camlzip.

* gnu/packages/ocaml.scm (ocaml4.01-camlzip): New variable.
---
 gnu/packages/ocaml.scm | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index 577c1ad81..44cf15164 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -911,8 +911,27 @@ other XUnit testing frameworks.")
     (description "Provides easy access to compressed files in ZIP, GZIP and
 JAR format.  It provides functions for reading from and writing to compressed
 files in these formats.")
+    (properties `((ocaml4.01-variant . ,(delay ocaml4.01-camlzip))))
     (license license:lgpl2.1+)))
 
+(define-public ocaml4.01-camlzip
+  (let ((base (package-with-ocaml4.01 (strip-ocaml4.01-variant camlzip))))
+    (package
+      (inherit base)
+      (name "ocaml4.01-camlzip")
+      ;; Version 1.05 is the last version to support OCaml 4.01.0.
+      (version "1.05")
+      (source
+       (origin
+         (method url-fetch)
+         (uri
+          (string-append
+           "http://forge.ocamlcore.org/frs/download.php/1037/camlzip-"
+           version ".tar.gz"))
+         (sha256
+          (base32
+           "0syh72jk9s0qwjmmfrkqchaj98m020ii082jn38pwnmb6v3p02wk")))))))
+
 (define-public ocamlmod
   (package
     (name "ocamlmod")
-- 
2.11.0


From 8fbcd06223a4d0ee0eb030a8f1ed9a188d568dbd Mon Sep 17 00:00:00 2001
From: Ben Woodcroft <donttrustben@gmail.com>
Date: Fri, 6 Jan 2017 22:17:34 +1000
Subject: [PATCH 10/15] gnu: Add ocaml4.01-qtest.

* gnu/packages/ocaml.scm (ocaml4.01-qtest): New variable.
(ocaml-qtest)[properties]: New field.
---
 gnu/packages/ocaml.scm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index 44cf15164..43b899d73 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -1056,8 +1056,12 @@ GNU CC attributes.  It provides also a C pretty printer as an example of use.")
 syntax in comments.  Those tests are then run using the oUnit framework and the
 qcheck library.  The possibilities range from trivial tests -- extremely simple
 to use -- to sophisticated random generation of test cases.")
+    (properties `((ocaml4.01-variant . ,(delay ocaml4.01-qtest))))
     (license license:lgpl3+)))
 
+(define-public ocaml4.01-qtest
+  (package-with-ocaml4.01 (strip-ocaml4.01-variant ocaml-qtest)))
+
 (define-public ocaml-stringext
   (package
     (name "ocaml-stringext")
-- 
2.11.0


From 3986b1dd5f80db99511aa920bd86ae6acf5c77b7 Mon Sep 17 00:00:00 2001
From: Ben Woodcroft <donttrustben@gmail.com>
Date: Fri, 6 Jan 2017 22:34:01 +1000
Subject: [PATCH 11/15] gnu: Add ocaml4.01-ounit.

* gnu/packages/ocaml.scm (ocaml4.01-ounit): New variable.
(ocaml-ounit)[properties]: New field.
---
 gnu/packages/ocaml.scm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index 43b899d73..014ae26e9 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -869,8 +869,12 @@ compilers that can directly deal with packages.")
     (synopsis "Unit testing framework for OCaml")
     (description "Unit testing framework for OCaml.  It is similar to JUnit and
 other XUnit testing frameworks.")
+    (properties `((ocaml4.01-variant . ,(delay ocaml4.01-ounit))))
     (license license:expat)))
 
+(define-public ocaml4.01-ounit
+  (package-with-ocaml4.01 (strip-ocaml4.01-variant ocaml-ounit)))
+
 (define-public camlzip
   (package
     (name "camlzip")
-- 
2.11.0


From 8d52b2419b989e29f335cc1fd168a642811178b2 Mon Sep 17 00:00:00 2001
From: Ben Woodcroft <donttrustben@gmail.com>
Date: Sat, 4 Feb 2017 12:15:39 +1000
Subject: [PATCH 12/15] gnu: Add ocaml4.01-xmlm.

* gnu/packages/ocaml.scm (ocaml4.01-xmlm): New variable.
(ocaml-xmlm)[properties]: New field.
---
 gnu/packages/ocaml.scm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index 014ae26e9..4ed63497b 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -1741,8 +1741,12 @@ run command line programs.")
     (description "Xmlm is a streaming codec to decode and encode the XML data
 format.  It can process XML documents without a complete in-memory
 representation of the data.")
+    (properties `((ocaml4.01-variant . ,(delay ocaml4.01-xmlm))))
     (license license:isc)))
 
+(define-public ocaml4.01-xmlm
+  (package-with-ocaml4.01 (strip-ocaml4.01-variant ocaml-xmlm)))
+
 (define-public ocaml-ulex
   (package
     (name "ocaml-ulex")
-- 
2.11.0


From 22e62810c21f055fea27199c59e773ef5087a014 Mon Sep 17 00:00:00 2001
From: Ben Woodcroft <donttrustben@gmail.com>
Date: Sat, 4 Feb 2017 12:16:50 +1000
Subject: [PATCH 13/15] gnu: Add ocaml4.01-batteries.

* gnu/packages/ocaml.scm (ocaml4.01-batteries): New variable.
(ocaml-batteries)[properties]: New field.
---
 gnu/packages/ocaml.scm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index 4ed63497b..9b33856d8 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -2010,8 +2010,12 @@ many additional enhancements, including:
     (description "Define a standard set of libraries which may be expected on
 every compliant installation of OCaml and organize these libraries into a
 hierarchy of modules.")
+    (properties `((ocaml4.01-variant . ,(delay ocaml4.01-batteries))))
     (license license:lgpl2.1+)))
 
+(define-public ocaml4.01-batteries
+  (package-with-ocaml4.01 (strip-ocaml4.01-variant ocaml-batteries)))
+
 (define-public ocaml-pcre
   (package
     (name "ocaml-pcre")
-- 
2.11.0


From e5835d46ab9620f88489cbcbe7d12d2c39e31417 Mon Sep 17 00:00:00 2001
From: Ben Woodcroft <donttrustben@gmail.com>
Date: Sat, 4 Feb 2017 15:23:45 +1000
Subject: [PATCH 14/15] gnu: Add taxtastic.

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

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index d7089959e..0c5124a2b 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -5198,6 +5198,42 @@ between experiments, StringTie's output can be processed either by the
 Cuffdiff or Ballgown programs.")
     (license license:artistic2.0)))
 
+(define-public taxtastic
+  (package
+    (name "taxtastic")
+    (version "0.5.7")
+    ;; Versions after 0.5.4 do not appear to be distributed on PyPI so we
+    ;; download the package from GitHub.
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "https://github.com/fhcrc/taxtastic/archive/v"
+                    version ".tar.gz"))
+              (file-name (string-append name "-" version ".tar.gz"))
+              (sha256
+               (base32
+                "1s0h5y1lds1c40jhir5585ffm6yjyn8h5aqimpgv64rhqhfv56xx"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:python ,python-2
+       #:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda _
+             (zero? (system* "python" "-m" "unittest" "discover" "-v")))))))
+    (propagated-inputs
+     `(("python-sqlalchemy" ,python2-sqlalchemy)
+       ("python-decorator" ,python2-decorator)
+       ("python-biopython" ,python2-biopython)
+       ("python-pandas" ,python2-pandas)))
+    (home-page "https://github.com/fhcrc/taxtastic")
+    (synopsis "Tools for taxonomic naming and annotation")
+    (description
+     "Taxtastic is software written in python used to build and maintain
+reference packages i.e. collections of reference trees, reference alignments,
+profiles, and associated taxonomic information.")
+    (license license:gpl3+)))
+
 (define-public vcftools
   (package
     (name "vcftools")
-- 
2.11.0


From dd5e8d21bc418a36d58db1441116c80841600391 Mon Sep 17 00:00:00 2001
From: Ben Woodcroft <donttrustben@gmail.com>
Date: Sat, 4 Feb 2017 15:25:29 +1000
Subject: [PATCH 15/15] gnu: Add pplacer.

* gnu/packages/bioinformatics.scm (pplacer, pplacer-scripts): New
variables.
---
 gnu/packages/bioinformatics.scm | 126 +++++++++++++++++++++++++++++++++++++++-
 1 file changed, 125 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 0c5124a2b..e15625dbc 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -1,6 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2014, 2015, 2016, 2017 Ricardo Wurmus <rekado@elephly.net>
-;;; Copyright © 2015, 2016 Ben Woodcroft <donttrustben@gmail.com>
+;;; Copyright © 2015, 2016, 2017 Ben Woodcroft <donttrustben@gmail.com>
 ;;; Copyright © 2015, 2016 Pjotr Prins <pjotr.guix@thebird.nl>
 ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
@@ -33,6 +33,7 @@
   #:use-module (guix build-system ant)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system cmake)
+  #:use-module (guix build-system ocaml)
   #:use-module (guix build-system perl)
   #:use-module (guix build-system python)
   #:use-module (guix build-system r)
@@ -70,6 +71,7 @@
   #:use-module (gnu packages maths)
   #:use-module (gnu packages mpi)
   #:use-module (gnu packages ncurses)
+  #:use-module (gnu packages ocaml)
   #:use-module (gnu packages pcre)
   #:use-module (gnu packages parallel)
   #:use-module (gnu packages pdf)
@@ -3593,6 +3595,128 @@ interrupted by stop codons.  OrfM finds and prints these ORFs.")
     (home-page "https://github.com/wwood/OrfM")
     (license license:lgpl3+)))
 
+(define-public pplacer
+  (let ((commit "g807f6f3"))
+    (package
+      (name "pplacer")
+      ;; The commit should be updated with each version change.
+      (version "1.1.alpha19")
+      (source
+       (origin
+         (method url-fetch)
+         (uri (string-append "https://github.com/matsen/pplacer/archive/v"
+                             version ".tar.gz"))
+         (file-name (string-append name "-" version ".tar.gz"))
+         (sha256
+          (base32 "0z1lnd2s8sh6kpzg106wzbh2szw7h0hvq8syd5a6wv4rmyyz6x0f"))))
+      (build-system ocaml-build-system)
+      (arguments
+       `(#:ocaml ,ocaml-4.01
+         #:findlib ,ocaml4.01-findlib
+         #:modules ((guix build ocaml-build-system)
+                    (guix build utils)
+                    (ice-9 ftw))
+         #:phases
+         (modify-phases %standard-phases
+           (delete 'configure)
+           (add-after 'unpack 'replace-bundled-cddlib
+             (lambda* (#:key inputs #:allow-other-keys)
+               (let* ((cddlib-src (assoc-ref inputs "cddlib-src"))
+                      (local-dir "cddlib_guix"))
+                 (mkdir local-dir)
+                 (with-directory-excursion local-dir
+                   (system* "tar" "xvf" cddlib-src))
+                 (let ((cddlib-src-folder
+                        (string-append local-dir "/"
+                                       (list-ref (scandir local-dir) 2)
+                                       "/lib-src")))
+                   (for-each
+                    (lambda (file)
+                      (copy-file file
+                                 (string-append "cdd_src/" (basename file))))
+                    (find-files cddlib-src-folder ".*[ch]$")))
+                 #t)))
+           (add-after 'unpack 'fix-makefile
+             (lambda _
+               ;; Remove system calls to 'git'.
+               (substitute* "Makefile"
+                 (("^DESCRIPT:=pplacer-.*")
+                  (string-append
+                   "DESCRIPT:=pplacer-$(shell uname)-v" ,version "\n")))
+               (substitute* "myocamlbuild.ml"
+                 (("git describe --tags --long .*\\\" with")
+                  (string-append
+                   "echo -n v" ,version "-" ,commit "\" with")))
+               #t))
+           (replace 'install
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let* ((out (assoc-ref outputs "out"))
+                      (bin (string-append out "/bin")))
+                 (copy-recursively "bin" bin))
+               #t)))))
+      (native-inputs
+       `(("zlib" ,zlib)
+         ("gsl" ,gsl)
+         ("ocaml-ounit" ,ocaml4.01-ounit)
+         ("ocaml-batteries" ,ocaml4.01-batteries)
+         ("ocaml-camlzip" ,ocaml4.01-camlzip)
+         ("ocaml-csv" ,ocaml4.01-csv)
+         ("ocaml-sqlite3" ,ocaml4.01-sqlite3)
+         ("ocaml-xmlm" ,ocaml4.01-xmlm)
+         ("ocaml-mcl" ,ocaml4.01-mcl)
+         ("ocaml-gsl" ,ocaml4.01-gsl)
+         ("cddlib-src" ,(package-source cddlib))))
+      (propagated-inputs
+       `(("pplacer-scripts" ,pplacer-scripts)))
+      (synopsis "Phylogenetic placement of biological sequences")
+      (description
+       "Pplacer places query sequences on a fixed reference phylogenetic tree
+to maximize phylogenetic likelihood or posterior probability according to a
+reference alignment.  Pplacer is designed to be fast, to give useful
+information about uncertainty, and to offer advanced visualization and
+downstream analysis.")
+      (home-page "http://matsen.fhcrc.org/pplacer")
+      (license license:gpl3))))
+
+;; This package is installed alongside 'pplacer'.  It is a separate package so
+;; that it can use the python-build-system for the scripts that are
+;; distributed alongside the main OCaml binaries.
+(define pplacer-scripts
+  (package
+    (inherit pplacer)
+    (name "pplacer-scripts")
+    (build-system python-build-system)
+    (arguments
+     `(#:python ,python-2
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'enter-scripts-dir
+           (lambda _ (chdir "scripts")))
+         (replace 'check
+           (lambda _
+             (zero? (system* "python" "-m" "unittest" "discover" "-v"))))
+         (add-after 'install 'wrap-executables
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (bin (string-append out "/bin")))
+               (let ((path (string-append
+                            (assoc-ref inputs "hmmer") "/bin:"
+                            (assoc-ref inputs "infernal") "/bin")))
+                 (display path)
+                 (wrap-program (string-append bin "/refpkg_align.py")
+                   `("PATH" ":" prefix (,path))))
+               (let ((path (string-append
+                            (assoc-ref inputs "hmmer") "/bin")))
+                 (wrap-program (string-append bin "/hrefpkg_query.py")
+                   `("PATH" ":" prefix (,path)))))
+             #t)))))
+    (inputs
+     `(("infernal" ,infernal)
+       ("hmmer" ,hmmer)))
+    (propagated-inputs
+     `(("python-biopython" ,python2-biopython)
+       ("taxtastic" ,taxtastic)))))
+
 (define-public python2-pbcore
   (package
     (name "python2-pbcore")
-- 
2.11.0


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

end of thread, other threads:[~2017-05-10 21:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-07 11:34 [PATCH 0/15]: Add pplacer and OCaml dependencies Ben Woodcroft
2017-02-09 22:32 ` Ludovic Courtès
2017-03-02 11:51   ` Ben Woodcroft
2017-03-06  9:16     ` Ludovic Courtès
     [not found]       ` <d4cc770f-f2d0-4a93-cc54-8302eed1d4c7@uq.edu.au>
2017-04-05 21:18         ` bug#26150: " Ludovic Courtès
2017-05-10 20:28           ` Ben Woodcroft
2017-05-10 21:44             ` Ludovic Courtès

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.