depot/third_party/nixpkgs/pkgs/development/tools/ocaml/ocamlbuild/default.nix
Default email e7ec2969af Project import generated by Copybara.
GitOrigin-RevId: 9b19f5e77dd906cb52dade0b7bd280339d2a1f3d
2024-01-13 09:15:51 +01:00

41 lines
1.1 KiB
Nix

{ lib, stdenv, fetchFromGitHub, ocaml, findlib }:
stdenv.mkDerivation rec {
pname = "ocaml${ocaml.version}-ocamlbuild";
version = "0.14.3";
src = fetchFromGitHub {
owner = "ocaml";
repo = "ocamlbuild";
rev = version;
sha256 = "sha256-dfcNu4ugOYu/M0rRQla7lXum/g1UzncdLGmpPYo0QUM=";
};
createFindlibDestdir = true;
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";
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 = with lib; {
description = "A build system with builtin rules to easily build most OCaml projects";
homepage = "https://github.com/ocaml/ocamlbuild/";
license = licenses.lgpl2;
maintainers = with maintainers; [ vbgl ];
mainProgram = "ocamlbuild";
inherit (ocaml.meta) platforms;
};
}