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-03-30 09:31:56 +00:00
|
|
|
version = "0.14.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ocaml";
|
|
|
|
repo = "ocamlbuild";
|
|
|
|
rev = version;
|
2022-03-30 09:31:56 +00:00
|
|
|
sha256 = "sha256-ZL0BwOCWTNDjNkrwNAmzHjHF1Rpg3CUuV4lSqcwDqgI=";
|
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
|
|
|
homepage = "https://github.com/ocaml/ocamlbuild/";
|
|
|
|
description = "A build system with builtin rules to easily build most OCaml projects";
|
|
|
|
license = licenses.lgpl2;
|
|
|
|
inherit (ocaml.meta) platforms;
|
|
|
|
maintainers = with maintainers; [ vbgl ];
|
|
|
|
};
|
|
|
|
}
|