nixpkgs-suyu/pkgs/development/ocaml-modules/cmdliner/default.nix
Aaron Zeng 05fe9b54a5
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.
2022-04-07 20:37:09 +02:00

33 lines
1,007 B
Nix

{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg, result }:
assert (lib.versionAtLeast ocaml.version "4.03");
stdenv.mkDerivation rec {
pname = "cmdliner";
version = "1.0.4";
src = fetchurl {
url = "https://erratique.ch/software/${pname}/releases/${pname}-${version}.tbz";
sha256 = "1h04q0zkasd0mw64ggh4y58lgzkhg6yhzy60lab8k8zq9ba96ajw";
};
nativeBuildInputs = [ ocaml ];
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";
description = "An OCaml module for the declarative definition of command line interfaces";
license = licenses.bsd3;
platforms = ocaml.meta.platforms or [];
maintainers = [ maintainers.vbgl ];
};
}