git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #26286 from romildo/fix.cmdliner

Keep older versions of cmdliner and ocp-indent

commitc73355506acd89330ecb621768a785e94447e942 authorvbgl <vbgl@users.noreply.github.com> dateFri 2 Jun 2017, 19:04 (9 years ago) parente37f9704103994
4 files changed+93−14
pkgs/development/ocaml-modules/cmdliner/1.0.nix+42 pkgs/development/ocaml-modules/cmdliner/default.nix+9−12 pkgs/development/tools/ocaml/ocp-indent/1.5.2.nix+37 pkgs/top-level/ocaml-packages.nix+5−2
pkgs/development/ocaml-modules/cmdliner/1.0.nixnew file+42
@@ -0,0 +1,42 @@
1+{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, opam, topkg, result }:
2+
3+let
4+ pname = "cmdliner";
5+in
6+
7+assert stdenv.lib.versionAtLeast ocaml.version "4.01.0";
8+
9+stdenv.mkDerivation rec {
10+ name = "ocaml-${pname}-${version}";
11+ version = "1.0.0";
12+
13+ src = fetchurl {
14+ url = "http://erratique.ch/software/${pname}/releases/${pname}-${version}.tbz";
15+ sha256 = "1ryn7qis0izg0wcal8zdlikzzl689l75y6f4zc6blrm93y5agy9x";
16+ };
17+
18+ unpackCmd = "tar xjf $src";
19+
20+ nativeBuildInputs = [ ocamlbuild opam topkg ];
21+ buildInputs = [ ocaml findlib ];
22+ propagatedBuildInputs = [ result ];
23+
24+ createFindlibDestdir = true;
25+
26+ buildPhase = ''
27+ ocaml -I ${findlib}/lib/ocaml/${ocaml.version}/site-lib pkg/pkg.ml build
28+ '';
29+
30+ installPhase = ''
31+ opam-installer --script --prefix=$out | sh
32+ ln -s $out/lib/${pname} $out/lib/ocaml/${ocaml.version}/site-lib/
33+ '';
34+
35+ meta = with stdenv.lib; {
36+ homepage = http://erratique.ch/software/cmdliner;
37+ description = "An OCaml module for the declarative definition of command line interfaces";
38+ license = licenses.bsd3;
39+ platforms = ocaml.meta.platforms or [];
40+ maintainers = [ maintainers.vbgl ];
41+ };
42+}
pkgs/development/ocaml-modules/cmdliner/default.nix+9−12
@@ -1,33 +1,30 @@
1−{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, opam, topkg, result }:
1+{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, opam }:
22
33let
44 pname = "cmdliner";
55in
66
7−assert stdenv.lib.versionAtLeast ocaml.version "4.01.0";
7+assert stdenv.lib.versionAtLeast ocaml.version "3.12";
88
99stdenv.mkDerivation rec {
10+
1011 name = "ocaml-${pname}-${version}";
11− version = "1.0.0";
12+ version = "0.9.8";
1213
1314 src = fetchurl {
1415 url = "http://erratique.ch/software/${pname}/releases/${pname}-${version}.tbz";
15− sha256 = "1ryn7qis0izg0wcal8zdlikzzl689l75y6f4zc6blrm93y5agy9x";
16+ sha256 = "0hdxlkgiwjml9dpaa80282a8350if7mc1m6yz2mrd7gci3fszykx";
1617 };
1718
1819 unpackCmd = "tar xjf $src";
19−
20− nativeBuildInputs = [ ocamlbuild opam topkg ];
20+ nativeBuildInputs = [ ocamlbuild opam ];
2121 buildInputs = [ ocaml findlib ];
22− propagatedBuildInputs = [ result ];
2322
2423 createFindlibDestdir = true;
2524
26− buildPhase = ''
27− ocaml -I ${findlib}/lib/ocaml/${ocaml.version}/site-lib pkg/pkg.ml build
28− '';
29−
30− installPhase = ''
25+ configurePhase = "ocaml pkg/git.ml";
26+ buildPhase = "ocaml pkg/build.ml native=true native-dynlink=true";
27+ installPhase = ''
3128 opam-installer --script --prefix=$out | sh
3229 ln -s $out/lib/${pname} $out/lib/ocaml/${ocaml.version}/site-lib/
3330 '';
pkgs/development/tools/ocaml/ocp-indent/1.5.2.nixnew file+37
@@ -0,0 +1,37 @@
1+{ stdenv, fetchzip, ocaml, findlib, ocpBuild, opam, cmdliner }:
2+
3+let inherit (stdenv.lib) getVersion versionAtLeast; in
4+
5+assert versionAtLeast (getVersion ocaml) "3.12.1";
6+assert versionAtLeast (getVersion ocpBuild) "1.99.6-beta";
7+assert versionAtLeast "0.9.8" (getVersion cmdliner);
8+
9+stdenv.mkDerivation {
10+
11+ name = "ocp-indent-1.5.2";
12+
13+ src = fetchzip {
14+ url = "https://github.com/OCamlPro/ocp-indent/archive/1.5.2.tar.gz";
15+ sha256 = "0ynv2yhm7akpvqp72pdabhddwr352s1k85q8m1khsvspgg1mkiqz";
16+ };
17+
18+ nativeBuildInputs = [ ocpBuild opam ];
19+
20+ buildInputs = [ ocaml findlib cmdliner ];
21+
22+ createFindlibDestdir = true;
23+
24+ preConfigure = "patchShebangs ./install.sh";
25+
26+ postInstall = ''
27+ mv $out/lib/{ocp-indent,ocaml/${getVersion ocaml}/site-lib/}
28+ '';
29+
30+ meta = with stdenv.lib; {
31+ homepage = "http://typerex.ocamlpro.com/ocp-indent.html";
32+ description = "A customizable tool to indent OCaml code";
33+ license = licenses.gpl3;
34+ platforms = ocaml.meta.platforms or [];
35+ maintainers = [ maintainers.jirkamarsik ];
36+ };
37+}
pkgs/top-level/ocaml-packages.nix+5−2
@@ -130,6 +130,8 @@ let
130130
131131 cmdliner = callPackage ../development/ocaml-modules/cmdliner { };
132132
133+ cmdliner_1_0 = callPackage ../development/ocaml-modules/cmdliner/1.0.nix { };
134+
133135 cohttp = callPackage ../development/ocaml-modules/cohttp {
134136 lwt = ocaml_lwt;
135137 };
@@ -386,9 +388,10 @@ let
386388
387389 ocpBuild = callPackage ../development/tools/ocaml/ocp-build { };
388390
389− ocpIndent = callPackage ../development/tools/ocaml/ocp-indent { };
391+ ocpIndent = callPackage ../development/tools/ocaml/ocp-indent { cmdliner = cmdliner_1_0; };
392+ ocpIndent_1_5_2 = callPackage ../development/tools/ocaml/ocp-indent/1.5.2.nix { };
390393
391− ocp-index = callPackage ../development/tools/ocaml/ocp-index { };
394+ ocp-index = callPackage ../development/tools/ocaml/ocp-index { ocpIndent = ocpIndent_1_5_2; };
392395
393396 ocplib-endian = callPackage ../development/ocaml-modules/ocplib-endian { };
394397