Files
nixpkgs/pkgs/development/ocaml-modules/zarith/default.nix
T
Ihar Hrachyshka 567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00

55 lines
1.3 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
ocaml,
findlib,
pkg-config,
gmp,
version ? if lib.versionAtLeast ocaml.version "4.08" then "1.14" else "1.13",
}:
stdenv.mkDerivation (finalAttrs: {
pname = "ocaml${ocaml.version}-zarith";
inherit version;
src = fetchFromGitHub {
owner = "ocaml";
repo = "Zarith";
rev = "release-${version}";
hash =
{
"1.13" = "sha256-CNVKoJeO3fsmWaV/dwnUA8lgI4ZlxR/LKCXpCXUrpSg=";
"1.14" = "sha256-xUrBDr+M8uW2KOy7DZieO/vDgsSOnyBnpOzQDlXJ0oE=";
}
."${finalAttrs.version}";
};
nativeBuildInputs = [
pkg-config
ocaml
findlib
];
propagatedBuildInputs = [ gmp ];
strictDeps = true;
dontAddPrefix = true;
dontAddStaticConfigureFlags = true;
configurePlatforms = [ ];
configureFlags = [ "-installdir ${placeholder "out"}/lib/ocaml/${ocaml.version}/site-lib" ];
preInstall = "mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib/stublibs";
meta = {
description = "Fast, arbitrary precision OCaml integers";
homepage = "https://github.com/ocaml/Zarith";
changelog = "https://github.com/ocaml/Zarith/raw/${finalAttrs.src.rev}/Changes";
license = lib.licenses.lgpl2;
inherit (ocaml.meta) platforms;
maintainers = with lib.maintainers; [
thoughtpolice
vbgl
];
broken = lib.versionOlder ocaml.version "4.04";
};
})