567e8dfd8e
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>
55 lines
1.2 KiB
Nix
55 lines
1.2 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
fetchFromGitHub,
|
|
ocaml,
|
|
findlib,
|
|
version ? if lib.versionAtLeast ocaml.version "4.08" then "0.16.1" else "0.14.3",
|
|
}:
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
pname = "ocaml${ocaml.version}-ocamlbuild";
|
|
inherit version;
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "ocaml";
|
|
repo = "ocamlbuild";
|
|
rev = finalAttrs.version;
|
|
hash =
|
|
{
|
|
"0.14.3" = "sha256-dfcNu4ugOYu/M0rRQla7lXum/g1UzncdLGmpPYo0QUM=";
|
|
"0.16.1" = "sha256-RpHVX0o4QduN73j+omlZlycRJaGZWfwHO5kq/WsEGZE=";
|
|
}
|
|
."${finalAttrs.version}";
|
|
};
|
|
|
|
createFindlibDestdir = true;
|
|
|
|
nativeBuildInputs = [
|
|
ocaml
|
|
findlib
|
|
];
|
|
strictDeps = true;
|
|
|
|
configurePhase = ''
|
|
runHook preConfigure
|
|
|
|
make -f configure.make Makefile.config \
|
|
"OCAMLBUILD_PREFIX=$out" \
|
|
"OCAMLBUILD_BINDIR=$out/bin" \
|
|
"OCAMLBUILD_MANDIR=$out/share/man" \
|
|
"OCAMLBUILD_LIBDIR=$OCAMLFIND_DESTDIR"
|
|
|
|
runHook postConfigure
|
|
'';
|
|
|
|
meta = {
|
|
description = "Build system with builtin rules to easily build most OCaml projects";
|
|
homepage = "https://github.com/ocaml/ocamlbuild/";
|
|
license = lib.licenses.lgpl2;
|
|
maintainers = with lib.maintainers; [ vbgl ];
|
|
mainProgram = "ocamlbuild";
|
|
inherit (ocaml.meta) platforms;
|
|
};
|
|
})
|