diff --git a/pkgs/development/ocaml-modules/cmdliner/default.nix b/pkgs/development/ocaml-modules/cmdliner/default.nix index 9536cc25290e..779705561009 100644 --- a/pkgs/development/ocaml-modules/cmdliner/default.nix +++ b/pkgs/development/ocaml-modules/cmdliner/default.nix @@ -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";