lol

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.

authored by

Aaron Zeng and committed by
GitHub
05fe9b54 3a2c2dc3

+14 -22
+14 -22
pkgs/development/ocaml-modules/cmdliner/default.nix
··· 1 1 { lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg, result }: 2 2 3 - let 4 - pname = "cmdliner"; 5 - in 6 - 7 - assert lib.versionAtLeast ocaml.version "4.01.0"; 8 - 9 - let param = 10 - if lib.versionAtLeast ocaml.version "4.03" then { 11 - version = "1.0.4"; 12 - sha256 = "1h04q0zkasd0mw64ggh4y58lgzkhg6yhzy60lab8k8zq9ba96ajw"; 13 - } else { 14 - version = "1.0.2"; 15 - sha256 = "18jqphjiifljlh9jg8zpl6310p3iwyaqphdkmf89acyaix0s4kj1"; 16 - } 17 - ; in 3 + assert (lib.versionAtLeast ocaml.version "4.03"); 18 4 19 5 stdenv.mkDerivation rec { 20 - name = "ocaml${ocaml.version}-${pname}-${version}"; 21 - inherit (param) version; 6 + pname = "cmdliner"; 7 + version = "1.0.4"; 22 8 23 9 src = fetchurl { 24 10 url = "https://erratique.ch/software/${pname}/releases/${pname}-${version}.tbz"; 25 - inherit (param) sha256; 11 + sha256 = "1h04q0zkasd0mw64ggh4y58lgzkhg6yhzy60lab8k8zq9ba96ajw"; 26 12 }; 27 13 28 - nativeBuildInputs = [ ocaml ocamlbuild findlib topkg ]; 29 - buildInputs = [ topkg ]; 30 - propagatedBuildInputs = [ result ]; 14 + nativeBuildInputs = [ ocaml ]; 31 15 32 - inherit (topkg) buildPhase installPhase; 16 + makeFlags = [ "PREFIX=$(out)" ]; 17 + installTargets = "install install-doc"; 18 + installFlags = [ 19 + "LIBDIR=$(out)/lib/ocaml/${ocaml.version}/site-lib/${pname}" 20 + "DOCDIR=$(out)/share/doc/${pname}" 21 + ]; 22 + postInstall = '' 23 + mv $out/lib/ocaml/${ocaml.version}/site-lib/${pname}/{opam,${pname}.opam} 24 + ''; 33 25 34 26 meta = with lib; { 35 27 homepage = "https://erratique.ch/software/cmdliner";