ocamlPackages.jsont: flags to turn off optional dependencies

Changed files
+18 -9
pkgs
development
ocaml-modules
jsont
+18 -9
pkgs/development/ocaml-modules/jsont/default.nix
···
{
lib,
fetchzip,
+
topkg,
buildTopkgPackage,
+
withBrr ? true,
brr,
+
withBytesrw ? true,
bytesrw,
+
withCmdliner ? true,
cmdliner,
}:
···
hash = "sha256-dXHl+bLuIrlrQ5Np37+uVuETFBb3j8XeDVEK9izoQFk=";
};
-
# docs say these dependendencies are optional, but buildTopkgPackage doesn’t
-
# handle missing dependencies
+
buildInputs = lib.optional withCmdliner cmdliner;
+
+
propagatedBuildInputs = lib.optional withBrr brr ++ lib.optional withBytesrw bytesrw;
+
+
buildPhase = "${topkg.run} build ${
+
lib.escapeShellArgs [
+
"--with-brr"
+
(lib.boolToString withBrr)
-
buildInputs = [
-
cmdliner
-
];
+
"--with-bytesrw"
+
(lib.boolToString withBytesrw)
-
propagatedBuildInputs = [
-
brr
-
bytesrw
-
];
+
"--with-cmdliner"
+
(lib.boolToString withCmdliner)
+
]
+
}";
meta = {
description = "Declarative JSON data manipulation";