diff --git a/.nix/cmdliner.nix b/.nix/cmdliner.nix new file mode 100644 index 00000000..7745db14 --- /dev/null +++ b/.nix/cmdliner.nix @@ -0,0 +1,38 @@ +{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg, result }: + +let + pname = "cmdliner"; +in + +assert lib.versionAtLeast ocaml.version "4.01.0"; + +let param = + { + version = "1.1.0"; + hash = "sha256-irWd4HTlJSYuz3HMgi1de2GVL2qus0QjeCe1WdsSs8Q="; + } +; in + +stdenv.mkDerivation rec { + name = "ocaml${ocaml.version}-${pname}-${version}"; + inherit (param) version; + + src = fetchurl { + url = "https://erratique.ch/software/${pname}/releases/${pname}-${version}.tbz"; + inherit (param) hash; + }; + + nativeBuildInputs = [ ocaml ocamlbuild findlib ]; + buildInputs = [ topkg ]; + propagatedBuildInputs = [ result ]; + + inherit (topkg) buildPhase installPhase; + + 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 = [ ]; + }; +} \ No newline at end of file diff --git a/release.nix b/release.nix index f1859d38..a21f81e2 100644 --- a/release.nix +++ b/release.nix @@ -4,4 +4,5 @@ with pkgs; ocamlPackages.callPackage ./. { bindlib = ocamlPackages.callPackage ./.nix/bindlib.nix { }; unionfind = ocamlPackages.callPackage ./.nix/unionfind.nix { }; + cmdliner = ocamlPackages.callPackage ./.nix/cmdliner.nix { }; } diff --git a/shell.nix b/shell.nix index 9470086e..89656da8 100644 --- a/shell.nix +++ b/shell.nix @@ -5,6 +5,7 @@ let pkg = ocamlPackages.callPackage ./. { bindlib = ocamlPackages.callPackage ./.nix/bindlib.nix { }; unionfind = ocamlPackages.callPackage ./.nix/unionfind.nix { }; + cmdliner = ocamlPackages.callPackage ./.nix/cmdliner.nix { }; }; in mkShell { inputsFrom = [ pkg ];