From 8151b508dc3550bde6ad00d9997f16673999b5b2 Mon Sep 17 00:00:00 2001 From: Ben Woodcroft Date: Mon, 2 Jan 2017 17:18:59 +1000 Subject: [PATCH 01/13] 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 93020f1c0..de15926ca 100644 --- a/gnu/packages/ocaml.scm +++ b/gnu/packages/ocaml.scm @@ -7,6 +7,7 @@ ;;; Copyright © 2016 Jan Nieuwenhuizen ;;; Copyright © 2016 Efraim Flashner ;;; Copyright © 2016, 2017 Julien Lepiller +;;; Copyright © 2017 Ben Woodcroft ;;; ;;; This file is part of GNU Guix. ;;; @@ -167,6 +168,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 544536c5ee33119fc9f8ed680aaa72b62e2228f5 Mon Sep 17 00:00:00 2001 From: Ben Woodcroft Date: Mon, 2 Jan 2017 22:29:28 +1000 Subject: [PATCH 02/13] 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 de15926ca..4d0737797 100644 --- a/gnu/packages/ocaml.scm +++ b/gnu/packages/ocaml.scm @@ -793,6 +793,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 22fd7a5a1fbe09416dd151db3fab5eb450e984bb Mon Sep 17 00:00:00 2001 From: Ben Woodcroft Date: Mon, 2 Jan 2017 22:23:34 +1000 Subject: [PATCH 03/13] 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 +;;; Copyright © 2017 Ben Woodcroft ;;; ;;; 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 . - (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 f7403598b564a408b31256486ea37675a6e1b547 Mon Sep 17 00:00:00 2001 From: Ben Woodcroft Date: Fri, 6 Jan 2017 21:01:05 +1000 Subject: [PATCH 04/13] 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 4d0737797..433d9b875 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) @@ -1199,6 +1200,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 90e69c8fe9ca3622d1fe8e272280987b889a741c Mon Sep 17 00:00:00 2001 From: Ben Woodcroft Date: Fri, 6 Jan 2017 21:31:07 +1000 Subject: [PATCH 05/13] 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 433d9b875..ae94138a1 100644 --- a/gnu/packages/ocaml.scm +++ b/gnu/packages/ocaml.scm @@ -1233,6 +1233,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 90937983017eb0637fa40b040ae7a2872304f772 Mon Sep 17 00:00:00 2001 From: Ben Woodcroft Date: Fri, 6 Jan 2017 21:37:06 +1000 Subject: [PATCH 06/13] gnu: Add ocaml-gsl. * gnu/packages/ocaml.scm (ocaml-gsl, ocaml4.01-gsl): New variables. --- gnu/packages/ocaml.scm | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm index ae94138a1..6e6dea71c 100644 --- a/gnu/packages/ocaml.scm +++ b/gnu/packages/ocaml.scm @@ -38,6 +38,7 @@ #:use-module (gnu packages gtk) #:use-module (gnu packages lynx) #:use-module (gnu packages m4) + #:use-module (gnu packages maths) #:use-module (gnu packages multiprecision) #:use-module (gnu packages ncurses) #:use-module (gnu packages perl) @@ -1261,6 +1262,34 @@ manipulate such data.") (define-public ocaml4.01-csv (package-with-ocaml4.01 (strip-ocaml4.01-variant ocaml-csv))) +(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 ocaml-mtime (package (name "ocaml-mtime") -- 2.11.0 From 4bfa6e3473f27c2f125662abaec0f02762cb8a6a Mon Sep 17 00:00:00 2001 From: Ben Woodcroft Date: Fri, 6 Jan 2017 21:52:34 +1000 Subject: [PATCH 07/13] gnu: Add ocaml-mcl. * gnu/packages/machine-learning.scm (ocaml-mcl, ocaml4.01-mcl): New variables. --- gnu/packages/machine-learning.scm | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index 8f1f8ee53..ed63c6065 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,42 @@ 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 2501809d57b36317d30c323f55c1b9c0c67006c8 Mon Sep 17 00:00:00 2001 From: Ben Woodcroft Date: Fri, 6 Jan 2017 22:11:00 +1000 Subject: [PATCH 08/13] 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 6e6dea71c..3206dbfbf 100644 --- a/gnu/packages/ocaml.scm +++ b/gnu/packages/ocaml.scm @@ -1050,8 +1050,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 74aa2c3b759c3986974b90f922aac5b9e64f3ae6 Mon Sep 17 00:00:00 2001 From: Ben Woodcroft Date: Fri, 6 Jan 2017 22:15:12 +1000 Subject: [PATCH 09/13] 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 3206dbfbf..0d0688dc0 100644 --- a/gnu/packages/ocaml.scm +++ b/gnu/packages/ocaml.scm @@ -859,8 +859,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 4e991766742313c1022c16c045895758ac39f4ac Mon Sep 17 00:00:00 2001 From: Ben Woodcroft Date: Fri, 6 Jan 2017 22:17:34 +1000 Subject: [PATCH 10/13] 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 0d0688dc0..4c75c87cf 100644 --- a/gnu/packages/ocaml.scm +++ b/gnu/packages/ocaml.scm @@ -1004,8 +1004,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 4071f6d9efd03b5bf99e93e7856daa05be38e1c5 Mon Sep 17 00:00:00 2001 From: Ben Woodcroft Date: Fri, 6 Jan 2017 22:34:01 +1000 Subject: [PATCH 11/13] 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 4c75c87cf..0ae8b36af 100644 --- a/gnu/packages/ocaml.scm +++ b/gnu/packages/ocaml.scm @@ -826,8 +826,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 253bb2d3bdc15b3df4216318b44e0eea964485e1 Mon Sep 17 00:00:00 2001 From: Ben Woodcroft Date: Fri, 6 Jan 2017 22:29:29 +1000 Subject: [PATCH 12/13] gnu: Add ocaml-qcheck. * gnu/packages/ocaml.scm (ocaml-qcheck, ocaml4.01-qcheck): New variables. --- gnu/packages/ocaml.scm | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm index 0ae8b36af..9bf89c49c 100644 --- a/gnu/packages/ocaml.scm +++ b/gnu/packages/ocaml.scm @@ -1014,6 +1014,39 @@ to use -- to sophisticated random generation of test cases.") (define-public ocaml4.01-qtest (package-with-ocaml4.01 (strip-ocaml4.01-variant ocaml-qtest))) +(define-public ocaml-qcheck + (package + (name "ocaml-qcheck") + (version "0.5") + (source + (origin + (method url-fetch) + (uri + (string-append + "http://github.com/c-cube/qcheck/archive/" + version ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "0gxvh3yr2016m2i7xm4lc08vklj12z2jhhhhyz3if5mrh5ch63ck")))) + (build-system ocaml-build-system) + (inputs + `(("ocaml-ounit" ,ocaml-ounit))) + (home-page "https://c-cube.github.io/qcheck") + (synopsis "QuickCheck inspired property-based testing for OCaml") + (description + "The OCaml library takes inspiration from Haskell's QuickCheck library. +The rough idea is that the programer describes invariants that values of a +certain type need to satisfy (\"properties\"), as functions from this type to +@code{bool}. She also needs to desribe how to generate random values of the +type, so that the property is tried and checked on a number of random +instances.") + (properties `((ocaml4.01-variant . ,(delay ocaml4.01-qcheck)))) + (license license:x11))) ;? + +(define-public ocaml4.01-qcheck + (package-with-ocaml4.01 (strip-ocaml4.01-variant ocaml-qcheck))) + (define-public ocaml-stringext (package (name "ocaml-stringext") -- 2.11.0 From cb73c5f668664231bcbeec283f6e6f88c452acfc Mon Sep 17 00:00:00 2001 From: Ben Woodcroft Date: Sun, 8 Jan 2017 22:12:29 +1000 Subject: [PATCH 13/13] WIP: final pplacer addition --- gnu/packages/ocaml.scm | 154 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 153 insertions(+), 1 deletion(-) diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm index 9bf89c49c..1e3313fee 100644 --- a/gnu/packages/ocaml.scm +++ b/gnu/packages/ocaml.scm @@ -39,6 +39,7 @@ #:use-module (gnu packages lynx) #:use-module (gnu packages m4) #:use-module (gnu packages maths) + #:use-module (gnu packages machine-learning) #:use-module (gnu packages multiprecision) #:use-module (gnu packages ncurses) #:use-module (gnu packages perl) @@ -852,7 +853,7 @@ other XUnit testing frameworks.") (add-before 'install 'fix-install-name (lambda* (#:key #:allow-other-keys) (substitute* "Makefile" - (("install zip") "install camlzip"))))) + (("install zip") "install zip"))))) #:install-target "install-findlib" #:make-flags (list "all" "allopt" @@ -884,6 +885,157 @@ files in these formats.") (base32 "0syh72jk9s0qwjmmfrkqchaj98m020ii082jn38pwnmb6v3p02wk"))))))) +(define-public ocaml-batteries + (package + (name "ocaml-batteries") + (version "2.5.3") + (home-page "http://batteries.forge.ocamlcore.org/") + (source + (origin + (method url-fetch) + (uri + (string-append + "https://github.com/ocaml-batteries-team/batteries-included/archive/v" + version ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "1fbhafjdqarppp54nmzalng577s9wk1753qw11f449shwv4cydyl")))) + (build-system ocaml-build-system) + (native-inputs `(("qtest" ,ocaml-qtest) + ("bisect" ,ocaml-bisect) + ("ounit" ,ocaml-ounit))) + (arguments `(#:phases (modify-phases %standard-phases + (delete 'check); tests are run by the build phase + (replace 'build + (lambda* (#:key outputs #:allow-other-keys) + (zero? (system* "ocaml" "setup.ml" "-build"))))))) + (synopsis "Development platform for the OCaml programming language") + (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.") + (license license:lgpl2.1+))) + +(define-public ocaml4.01-batteries + (package-with-ocaml4.01 (strip-ocaml4.01-variant ocaml-batteries))) + + +(define-public ocaml-xmlm + (package + (name "ocaml-xmlm") + (version "1.2.0") + (source + (origin + (method url-fetch) + (uri (string-append + "http://erratique.ch/software/xmlm/releases/xmlm-" + version ".tbz")) + (sha256 + (base32 + "1jywcrwn5z3gkgvicr004cxmdaqfmq8wh72f81jqz56iyn5024nh")))) + (build-system ocaml-build-system) + (arguments + `(#:tests? #f ; There are no tests, maybe? + #:phases + (modify-phases %standard-phases + (delete 'configure) + (replace 'build + (lambda _ + (zero? (system* "pkg/build" "true")))) + (add-before 'install 'setup-install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (destdir (string-append out "/lib/ocaml"))) + (mkdir-p destdir) + (setenv "OCAMLFIND_DESTDIR" destdir) + (setenv "OCAMLFIND_LDCONF" (string-append destdir "/ld.conf")) + #t))) + (replace 'install + (lambda _ + ;(system* "ls" "_build/**/*") + (zero? (system* "ocamlfind" "install" "xmlm" + ;; List of files was compiled from _build/pkg/META. + "_build/pkg/META" + "_build/src/xmlm.a" + "_build/src/xmlm.annot" + "_build/src/xmlm.cma" + "_build/src/xmlm.cmi" + "_build/src/xmlm.cmt" + "_build/src/xmlm.cmx" + "_build/src/xmlm.cmxa" + "_build/src/xmlm.cmxs" + "_build/src/xmlm.mli")) + ))))) + (native-inputs + `(("ocaml" ,ocaml) + ("ocaml-findlib" ,ocaml-findlib))) + (home-page "") + (synopsis "") + (description + "") + (properties `((ocaml4.01-variant . ,(delay ocaml4.01-xmlm)))) + (license license:x11))) ;? + +(define-public ocaml4.01-xmlm + (package-with-ocaml4.01 (strip-ocaml4.01-variant ocaml-xmlm))) + +(define-public pplacer + (package + (name "pplacer") + (version "1.1.alpha19") + (source + (origin + (method url-fetch) + (uri (string-append "https://github.com/matsen/pplacer/archive/v" + version ".tar.gz")) + (sha256 + (base32 "0z1lnd2s8sh6kpzg106wzbh2szw7h0hvq8syd5a6wv4rmyyz6x0f")))) + (build-system ocaml-build-system) + (arguments + `(#:ocaml ,ocaml-4.01 + #:findlib ,ocaml4.01-findlib + ;; #:test-target "test" + #:phases + (modify-phases %standard-phases + (delete 'configure) + (add-after 'unpack 'fix-makefile + (lambda _ + (substitute* "Makefile" + (("DESCRIPT:=pplacer-.*") "DESCRIPT:=pplacer-test\n")) ;fixme + #t)) + (replace 'build + (lambda _ (zero? (system* "make" "all")))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin"))) + (copy-recursively "bin" bin) + ;; TODO: Install scripts. + ) + #t)) + ))) + (inputs + `(("zlib" ,zlib) + ("ocaml-gsl" ,ocaml4.01-gsl) + ("gsl" ,gsl) + ("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) + ;("python" ,python-2) + ;("python-biopython" ,python2-biopython) + )) + (native-inputs + `(("ocaml-ounit" ,ocaml4.01-ounit))) + (synopsis "") + (description + "") + (home-page "") + (license license:gpl3))) + + (define-public ocamlmod (package (name "ocamlmod") -- 2.11.0