From 5a61d189974198bcf61b494f11aabb65a77cb03e Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Mon, 25 Apr 2022 19:19:57 +0200 Subject: [PATCH] ocamlPackages.cmdliner_1_1: init at 1.1.1 Add the latest version of cmdliner. This release broke many packages and have more constraining dependencies so the previous version cannot be removed from nixpkgs for now. The previous version is still available as ocamlPackages.cmdliner_1_0 and ocamlPackages.cmdliner points to it for now. --- .../cmdliner/{default.nix => 1_0.nix} | 0 .../ocaml-modules/cmdliner/1_1.nix | 32 +++++++++++++++++++ pkgs/top-level/ocaml-packages.nix | 8 ++++- 3 files changed, 39 insertions(+), 1 deletion(-) rename pkgs/development/ocaml-modules/cmdliner/{default.nix => 1_0.nix} (100%) create mode 100644 pkgs/development/ocaml-modules/cmdliner/1_1.nix diff --git a/pkgs/development/ocaml-modules/cmdliner/default.nix b/pkgs/development/ocaml-modules/cmdliner/1_0.nix similarity index 100% rename from pkgs/development/ocaml-modules/cmdliner/default.nix rename to pkgs/development/ocaml-modules/cmdliner/1_0.nix diff --git a/pkgs/development/ocaml-modules/cmdliner/1_1.nix b/pkgs/development/ocaml-modules/cmdliner/1_1.nix new file mode 100644 index 000000000000..001d967fca1b --- /dev/null +++ b/pkgs/development/ocaml-modules/cmdliner/1_1.nix @@ -0,0 +1,32 @@ +{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg, result }: + +stdenv.mkDerivation rec { + pname = "cmdliner"; + version = "1.1.1"; + + src = fetchurl { + url = "https://erratique.ch/software/${pname}/releases/${pname}-${version}.tbz"; + sha256 = "sha256-oa6Hw6eZQO+NHdWfdED3dtHckm4BmEbdMiAuRkYntfs="; + }; + + minimalOCamlVersion = "4.08"; + 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.isc; + inherit (ocaml.meta) platforms; + maintainers = [ maintainers.vbgl ]; + }; +} diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index a1effc538b60..3bbfd736f7f0 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -177,7 +177,13 @@ let cil = callPackage ../development/ocaml-modules/cil { }; - cmdliner = callPackage ../development/ocaml-modules/cmdliner { }; + cmdliner_1_0 = callPackage ../development/ocaml-modules/cmdliner/1_0.nix { }; + + cmdliner_1_1 = callPackage ../development/ocaml-modules/cmdliner/1_1.nix { }; + + # The 1.1.0 release broke a lot of packages and is not compatible with + # OCaml < 4.08. + cmdliner = cmdliner_1_0; cohttp = callPackage ../development/ocaml-modules/cohttp { };