2021-01-23 12:26:19 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, ocaml, findlib }:
|
2021-07-17 17:56:23 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2022-01-24 12:23:22 +00:00
|
|
|
pname = "ocaml${ocaml.version}-ocamlbuild";
|
2022-10-06 05:18:34 +00:00
|
|
|
version = "0.14.2";
|
2016-07-13 12:56:05 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ocaml";
|
|
|
|
repo = "ocamlbuild";
|
|
|
|
rev = version;
|
2022-10-06 05:18:34 +00:00
|
|
|
sha256 = "sha256-QAqIMdi6M9V7RIX0kppKPSkCJE/pLx2iMdh5XYXQCJs=";
|
2016-07-13 12:56:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
createFindlibDestdir = true;
|
|
|
|
|
2021-08-14 12:00:00 +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";
|
2016-07-13 12:56:05 +00:00
|
|
|
|
|
|
|
configurePhase = ''
|
2021-08-19 12:00:00 +00:00
|
|
|
runHook preConfigure
|
|
|
|
|
2016-07-13 12:56:05 +00:00
|
|
|
make -f configure.make Makefile.config \
|
|
|
|
"OCAMLBUILD_PREFIX=$out" \
|
|
|
|
"OCAMLBUILD_BINDIR=$out/bin" \
|
2017-03-21 18:13:32 +00:00
|
|
|
"OCAMLBUILD_MANDIR=$out/share/man" \
|
2016-07-13 12:56:05 +00:00
|
|
|
"OCAMLBUILD_LIBDIR=$OCAMLFIND_DESTDIR"
|
2021-08-19 12:00:00 +00:00
|
|
|
|
|
|
|
runHook postConfigure
|
2016-07-13 12:56:05 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-23 12:26:19 +00:00
|
|
|
meta = with lib; {
|
2016-12-04 11:25:37 +00:00
|
|
|
description = "A build system with builtin rules to easily build most OCaml projects";
|
2022-05-18 00:57:46 +00:00
|
|
|
homepage = "https://github.com/ocaml/ocamlbuild/";
|
2016-12-04 11:25:37 +00:00
|
|
|
license = licenses.lgpl2;
|
|
|
|
maintainers = with maintainers; [ vbgl ];
|
2022-05-18 00:57:46 +00:00
|
|
|
mainProgram = "ocamlbuild";
|
|
|
|
inherit (ocaml.meta) platforms;
|
2016-12-04 11:25:37 +00:00
|
|
|
};
|
2016-07-13 12:56:05 +00:00
|
|
|
}
|