Skip to content

Commit 574f3c3

Browse files
committedJul 12, 2017
ocamlPackages.csv: 1.5 -> 1.7
1 parent 6620e00 commit 574f3c3

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed
 

‎pkgs/development/ocaml-modules/csv/default.nix

+22-6
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,35 @@
1-
{ stdenv, fetchzip, ocaml, findlib, ocamlbuild }:
1+
{ stdenv, fetchzip, ocaml, findlib, ocamlbuild, ocaml_lwt }:
2+
3+
let param =
4+
if stdenv.lib.versionAtLeast ocaml.version "4.2"
5+
then {
6+
version = "1.7";
7+
url = https://math.umons.ac.be/anum/software/csv/csv-1.7.tar.gz;
8+
sha256 = "1mmcjiiz0jppgipavpph5kn04xcpalw4scbjrw2z3drghvr3qqwf";
9+
lwtSupport = true;
10+
} else {
11+
version = "1.5";
12+
url = https://github.com/Chris00/ocaml-csv/releases/download/1.5/csv-1.5.tar.gz;
13+
sha256 = "1ca7jgg58j24pccs5fshis726s06fdcjshnwza5kwxpjgdbvc63g";
14+
lwtSupport = false;
15+
};
16+
in
217

318
stdenv.mkDerivation {
419

5-
name = "ocaml-csv-1.5";
20+
name = "ocaml${ocaml.version}-csv-${param.version}";
621

722
src = fetchzip {
8-
url = https://github.com/Chris00/ocaml-csv/releases/download/1.5/csv-1.5.tar.gz;
9-
sha256 = "1ca7jgg58j24pccs5fshis726s06fdcjshnwza5kwxpjgdbvc63g";
23+
inherit (param) url sha256;
1024
};
1125

12-
buildInputs = [ ocaml findlib ocamlbuild ];
26+
buildInputs = [ ocaml findlib ocamlbuild ]
27+
++ stdenv.lib.optional param.lwtSupport ocaml_lwt;
1328

1429
createFindlibDestdir = true;
1530

16-
configurePhase = "ocaml setup.ml -configure --prefix $out --enable-tests";
31+
configurePhase = "ocaml setup.ml -configure --prefix $out --enable-tests"
32+
+ stdenv.lib.optionalString param.lwtSupport " --enable-lwt";
1733

1834
buildPhase = "ocaml setup.ml -build";
1935

0 commit comments

Comments
 (0)