3
0
Fork 0
forked from mirrors/nixpkgs

ocamlPackages.cmdliner: Use the upstream Makefile build rules (#166150)

* ocamlPackages.cmdliner: remove at 1.0.2

Remove a legacy version.

* ocamlPackages.cmdliner: use the upstream Makefile build rules

According to
https://github.com/dbuenzli/cmdliner/pull/147#issuecomment-1081168328,
the topkg build is deprecated.  Switch to the new recommended build instructions.
This commit is contained in:
Aaron Zeng 2022-04-07 14:37:09 -04:00 committed by GitHub
parent 3a2c2dc3e8
commit 05fe9b54a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,35 +1,27 @@
{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg, result }:
let
pname = "cmdliner";
in
assert lib.versionAtLeast ocaml.version "4.01.0";
let param =
if lib.versionAtLeast ocaml.version "4.03" then {
version = "1.0.4";
sha256 = "1h04q0zkasd0mw64ggh4y58lgzkhg6yhzy60lab8k8zq9ba96ajw";
} else {
version = "1.0.2";
sha256 = "18jqphjiifljlh9jg8zpl6310p3iwyaqphdkmf89acyaix0s4kj1";
}
; in
assert (lib.versionAtLeast ocaml.version "4.03");
stdenv.mkDerivation rec {
name = "ocaml${ocaml.version}-${pname}-${version}";
inherit (param) version;
pname = "cmdliner";
version = "1.0.4";
src = fetchurl {
url = "https://erratique.ch/software/${pname}/releases/${pname}-${version}.tbz";
inherit (param) sha256;
sha256 = "1h04q0zkasd0mw64ggh4y58lgzkhg6yhzy60lab8k8zq9ba96ajw";
};
nativeBuildInputs = [ ocaml ocamlbuild findlib topkg ];
buildInputs = [ topkg ];
propagatedBuildInputs = [ result ];
nativeBuildInputs = [ ocaml ];
inherit (topkg) buildPhase installPhase;
makeFlags = [ "PREFIX=$(out)" ];
installTargets = "install install-doc";
installFlags = [
"LIBDIR=$(out)/lib/ocaml/${ocaml.version}/site-lib/${pname}"
"DOCDIR=$(out)/share/doc/${pname}"
];
postInstall = ''
mv $out/lib/ocaml/${ocaml.version}/site-lib/${pname}/{opam,${pname}.opam}
'';
meta = with lib; {
homepage = "https://erratique.ch/software/cmdliner";