Skip to content

Commit b475d5f

Browse files
committedJun 27, 2017
ocamlPackages.atd: 1.1.2 -> 1.12.0
1 parent 8791cad commit b475d5f

File tree

1 file changed

+26
-11
lines changed

1 file changed

+26
-11
lines changed
 

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

+26-11
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,36 @@
1-
{stdenv, menhir, easy-format, buildOcaml, fetchurl, which}:
1+
{ stdenv, menhir, easy-format, ocaml, findlib, fetchurl, jbuilder, which }:
22

3-
buildOcaml rec {
4-
name = "atd";
5-
version = "1.1.2";
3+
let param =
4+
if stdenv.lib.versionAtLeast ocaml.version "4.02"
5+
then {
6+
version = "1.12.0";
7+
sha256 = "1pcd4fqbilv8zm2mc1nj2s26vc5y8vnisg1q1y6bjx23wxidb09y";
8+
buildPhase = "jbuilder build -p atd";
9+
inherit (jbuilder) installPhase;
10+
} else {
11+
version = "1.1.2";
12+
sha256 = "0ef10c63192aed75e9a4274e89c5f9ca27efb1ef230d9949eda53ad4a9a37291";
13+
buildPhase = "";
14+
installPhase = ''
15+
mkdir -p $out/bin
16+
make PREFIX=$out install
17+
'';
18+
};
19+
in
20+
21+
stdenv.mkDerivation rec {
22+
inherit (param) version buildPhase installPhase;
23+
name = "ocaml${ocaml.version}-atd-${version}";
624

725
src = fetchurl {
826
url = "https://github.com/mjambon/atd/archive/v${version}.tar.gz";
9-
sha256 = "0ef10c63192aed75e9a4274e89c5f9ca27efb1ef230d9949eda53ad4a9a37291";
27+
inherit (param) sha256;
1028
};
1129

12-
installPhase = ''
13-
mkdir -p $out/bin
14-
make PREFIX=$out install
15-
'';
30+
createFindlibDestdir = true;
1631

17-
buildInputs = [ which ];
18-
propagatedBuildInputs = [ menhir easy-format ];
32+
buildInputs = [ which jbuilder ocaml findlib menhir ];
33+
propagatedBuildInputs = [ easy-format ];
1934

2035
meta = with stdenv.lib; {
2136
homepage = https://github.com/mjambon/atd;

0 commit comments

Comments
 (0)
Please sign in to comment.