2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, ocaml, findlib }:
|
2021-07-18 21:22:44 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2022-01-26 04:04:25 +00:00
|
|
|
pname = "ocaml${ocaml.version}-ocamlbuild";
|
2022-10-21 18:38:19 +00:00
|
|
|
version = "0.14.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ocaml";
|
|
|
|
repo = "ocamlbuild";
|
|
|
|
rev = version;
|
2022-10-21 18:38:19 +00:00
|
|
|
sha256 = "sha256-QAqIMdi6M9V7RIX0kppKPSkCJE/pLx2iMdh5XYXQCJs=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
createFindlibDestdir = true;
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
nativeBuildInputs = [ ocaml findlib ];
|
|
|
|
strictDeps = true;
|
|
|
|
|
|
|
|
# x86_64-unknown-linux-musl-ld: -r and -pie may not be used together
|
|
|
|
hardeningDisable = lib.optional stdenv.hostPlatform.isStatic "pie";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
configurePhase = ''
|
2021-09-18 10:52:07 +00:00
|
|
|
runHook preConfigure
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
make -f configure.make Makefile.config \
|
|
|
|
"OCAMLBUILD_PREFIX=$out" \
|
|
|
|
"OCAMLBUILD_BINDIR=$out/bin" \
|
|
|
|
"OCAMLBUILD_MANDIR=$out/share/man" \
|
|
|
|
"OCAMLBUILD_LIBDIR=$OCAMLFIND_DESTDIR"
|
2021-09-18 10:52:07 +00:00
|
|
|
|
|
|
|
runHook postConfigure
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A build system with builtin rules to easily build most OCaml projects";
|
2022-06-16 17:23:12 +00:00
|
|
|
homepage = "https://github.com/ocaml/ocamlbuild/";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.lgpl2;
|
|
|
|
maintainers = with maintainers; [ vbgl ];
|
2022-06-16 17:23:12 +00:00
|
|
|
mainProgram = "ocamlbuild";
|
|
|
|
inherit (ocaml.meta) platforms;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|