Merge pull request #26286 from romildo/fix.cmdliner
Keep older versions of cmdliner and ocp-indent
This commit is contained in:
commit
c73355506a
42
pkgs/development/ocaml-modules/cmdliner/1.0.nix
Normal file
42
pkgs/development/ocaml-modules/cmdliner/1.0.nix
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, opam, topkg, result }:
|
||||||
|
|
||||||
|
let
|
||||||
|
pname = "cmdliner";
|
||||||
|
in
|
||||||
|
|
||||||
|
assert stdenv.lib.versionAtLeast ocaml.version "4.01.0";
|
||||||
|
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
name = "ocaml-${pname}-${version}";
|
||||||
|
version = "1.0.0";
|
||||||
|
|
||||||
|
src = fetchurl {
|
||||||
|
url = "http://erratique.ch/software/${pname}/releases/${pname}-${version}.tbz";
|
||||||
|
sha256 = "1ryn7qis0izg0wcal8zdlikzzl689l75y6f4zc6blrm93y5agy9x";
|
||||||
|
};
|
||||||
|
|
||||||
|
unpackCmd = "tar xjf $src";
|
||||||
|
|
||||||
|
nativeBuildInputs = [ ocamlbuild opam topkg ];
|
||||||
|
buildInputs = [ ocaml findlib ];
|
||||||
|
propagatedBuildInputs = [ result ];
|
||||||
|
|
||||||
|
createFindlibDestdir = true;
|
||||||
|
|
||||||
|
buildPhase = ''
|
||||||
|
ocaml -I ${findlib}/lib/ocaml/${ocaml.version}/site-lib pkg/pkg.ml build
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
opam-installer --script --prefix=$out | sh
|
||||||
|
ln -s $out/lib/${pname} $out/lib/ocaml/${ocaml.version}/site-lib/
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = with stdenv.lib; {
|
||||||
|
homepage = http://erratique.ch/software/cmdliner;
|
||||||
|
description = "An OCaml module for the declarative definition of command line interfaces";
|
||||||
|
license = licenses.bsd3;
|
||||||
|
platforms = ocaml.meta.platforms or [];
|
||||||
|
maintainers = [ maintainers.vbgl ];
|
||||||
|
};
|
||||||
|
}
|
@ -1,32 +1,29 @@
|
|||||||
{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, opam, topkg, result }:
|
{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, opam }:
|
||||||
|
|
||||||
let
|
let
|
||||||
pname = "cmdliner";
|
pname = "cmdliner";
|
||||||
in
|
in
|
||||||
|
|
||||||
assert stdenv.lib.versionAtLeast ocaml.version "4.01.0";
|
assert stdenv.lib.versionAtLeast ocaml.version "3.12";
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
|
|
||||||
name = "ocaml-${pname}-${version}";
|
name = "ocaml-${pname}-${version}";
|
||||||
version = "1.0.0";
|
version = "0.9.8";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "http://erratique.ch/software/${pname}/releases/${pname}-${version}.tbz";
|
url = "http://erratique.ch/software/${pname}/releases/${pname}-${version}.tbz";
|
||||||
sha256 = "1ryn7qis0izg0wcal8zdlikzzl689l75y6f4zc6blrm93y5agy9x";
|
sha256 = "0hdxlkgiwjml9dpaa80282a8350if7mc1m6yz2mrd7gci3fszykx";
|
||||||
};
|
};
|
||||||
|
|
||||||
unpackCmd = "tar xjf $src";
|
unpackCmd = "tar xjf $src";
|
||||||
|
nativeBuildInputs = [ ocamlbuild opam ];
|
||||||
nativeBuildInputs = [ ocamlbuild opam topkg ];
|
|
||||||
buildInputs = [ ocaml findlib ];
|
buildInputs = [ ocaml findlib ];
|
||||||
propagatedBuildInputs = [ result ];
|
|
||||||
|
|
||||||
createFindlibDestdir = true;
|
createFindlibDestdir = true;
|
||||||
|
|
||||||
buildPhase = ''
|
configurePhase = "ocaml pkg/git.ml";
|
||||||
ocaml -I ${findlib}/lib/ocaml/${ocaml.version}/site-lib pkg/pkg.ml build
|
buildPhase = "ocaml pkg/build.ml native=true native-dynlink=true";
|
||||||
'';
|
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
opam-installer --script --prefix=$out | sh
|
opam-installer --script --prefix=$out | sh
|
||||||
ln -s $out/lib/${pname} $out/lib/ocaml/${ocaml.version}/site-lib/
|
ln -s $out/lib/${pname} $out/lib/ocaml/${ocaml.version}/site-lib/
|
||||||
|
37
pkgs/development/tools/ocaml/ocp-indent/1.5.2.nix
Normal file
37
pkgs/development/tools/ocaml/ocp-indent/1.5.2.nix
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
{ stdenv, fetchzip, ocaml, findlib, ocpBuild, opam, cmdliner }:
|
||||||
|
|
||||||
|
let inherit (stdenv.lib) getVersion versionAtLeast; in
|
||||||
|
|
||||||
|
assert versionAtLeast (getVersion ocaml) "3.12.1";
|
||||||
|
assert versionAtLeast (getVersion ocpBuild) "1.99.6-beta";
|
||||||
|
assert versionAtLeast "0.9.8" (getVersion cmdliner);
|
||||||
|
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
|
||||||
|
name = "ocp-indent-1.5.2";
|
||||||
|
|
||||||
|
src = fetchzip {
|
||||||
|
url = "https://github.com/OCamlPro/ocp-indent/archive/1.5.2.tar.gz";
|
||||||
|
sha256 = "0ynv2yhm7akpvqp72pdabhddwr352s1k85q8m1khsvspgg1mkiqz";
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = [ ocpBuild opam ];
|
||||||
|
|
||||||
|
buildInputs = [ ocaml findlib cmdliner ];
|
||||||
|
|
||||||
|
createFindlibDestdir = true;
|
||||||
|
|
||||||
|
preConfigure = "patchShebangs ./install.sh";
|
||||||
|
|
||||||
|
postInstall = ''
|
||||||
|
mv $out/lib/{ocp-indent,ocaml/${getVersion ocaml}/site-lib/}
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = with stdenv.lib; {
|
||||||
|
homepage = "http://typerex.ocamlpro.com/ocp-indent.html";
|
||||||
|
description = "A customizable tool to indent OCaml code";
|
||||||
|
license = licenses.gpl3;
|
||||||
|
platforms = ocaml.meta.platforms or [];
|
||||||
|
maintainers = [ maintainers.jirkamarsik ];
|
||||||
|
};
|
||||||
|
}
|
@ -130,6 +130,8 @@ let
|
|||||||
|
|
||||||
cmdliner = callPackage ../development/ocaml-modules/cmdliner { };
|
cmdliner = callPackage ../development/ocaml-modules/cmdliner { };
|
||||||
|
|
||||||
|
cmdliner_1_0 = callPackage ../development/ocaml-modules/cmdliner/1.0.nix { };
|
||||||
|
|
||||||
cohttp = callPackage ../development/ocaml-modules/cohttp {
|
cohttp = callPackage ../development/ocaml-modules/cohttp {
|
||||||
lwt = ocaml_lwt;
|
lwt = ocaml_lwt;
|
||||||
};
|
};
|
||||||
@ -386,9 +388,10 @@ let
|
|||||||
|
|
||||||
ocpBuild = callPackage ../development/tools/ocaml/ocp-build { };
|
ocpBuild = callPackage ../development/tools/ocaml/ocp-build { };
|
||||||
|
|
||||||
ocpIndent = callPackage ../development/tools/ocaml/ocp-indent { };
|
ocpIndent = callPackage ../development/tools/ocaml/ocp-indent { cmdliner = cmdliner_1_0; };
|
||||||
|
ocpIndent_1_5_2 = callPackage ../development/tools/ocaml/ocp-indent/1.5.2.nix { };
|
||||||
|
|
||||||
ocp-index = callPackage ../development/tools/ocaml/ocp-index { };
|
ocp-index = callPackage ../development/tools/ocaml/ocp-index { ocpIndent = ocpIndent_1_5_2; };
|
||||||
|
|
||||||
ocplib-endian = callPackage ../development/ocaml-modules/ocplib-endian { };
|
ocplib-endian = callPackage ../development/ocaml-modules/ocplib-endian { };
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user