14 # See ./boot.nix for an explanation of the gprbuild setupHook,
15 # our custom knowledge base entry and the situation wrt a
16 # (future) gprbuild wrapper.
17 inherit (gprbuild-boot)
30 propagatedBuildInputs = [
35 "ENABLE_SHARED=${if stdenv.hostPlatform.isStatic then "no" else "yes"}"
36 "PROCESSORS=$(NIX_BUILD_CORES)"
37 # confusingly, for gprbuild --target is autoconf --host
38 "TARGET=${stdenv.hostPlatform.config}"
39 "prefix=${placeholder "out"}"
40 ] ++ lib.optionals (!stdenv.hostPlatform.isStatic) [
41 "LIBRARY_TYPE=relocatable"
44 env = lib.optionalAttrs stdenv.isDarwin {
45 # Ensure that there is enough space for the `fixDarwinDylibNames` hook to
46 # update the install names of the output dylibs.
47 NIX_LDFLAGS = "-headerpad_max_install_names";
50 # Fixes gprbuild being linked statically always. Based on the AUR's patch:
51 # https://aur.archlinux.org/cgit/aur.git/plain/0001-Makefile-build-relocatable-instead-of-static-binary.patch?h=gprbuild&id=bac524c76cd59c68fb91ef4dfcbe427357b9f850
52 patches = lib.optionals (!stdenv.hostPlatform.isStatic) [
53 ./gprbuild-relocatable-build.patch
56 buildFlags = [ "all" "libgpr.build" ];
58 installFlags = [ "all" "libgpr.install" ];
60 # link gprconfig_kb db from gprbuild-boot into build dir,
61 # the install process copies its contents to $out
63 # Use PATH to discover spliced gprbuild-boot from buildPackages,
64 # since path interpolation would give us gprbuild-boot from pkgsHostTarget
65 gprbuild_boot="$(dirname "$(type -p gprbuild)")/.."
66 ln -sf "$gprbuild_boot/share/gprconfig" share/gprconfig
69 # no need for the install script