depot/third_party/nixpkgs/pkgs/development/compilers/chicken/5/eggDerivation.nix
Default email 8ac5e011d6 Project import generated by Copybara.
GitOrigin-RevId: 2c3273caa153ee8eb5786bc8141b85b859e7efd7
2020-04-24 19:36:52 -04:00

41 lines
1.2 KiB
Nix

{ stdenv, chicken, makeWrapper }:
{ name, src
, buildInputs ? []
, chickenInstallFlags ? []
, cscOptions ? []
, ...} @ args:
let
overrides = import ./overrides.nix;
baseName = stdenv.lib.getName name;
override = if builtins.hasAttr baseName overrides
then
builtins.getAttr baseName overrides
else
{};
in
stdenv.mkDerivation ({
name = "chicken-${name}";
propagatedBuildInputs = buildInputs;
buildInputs = [ makeWrapper chicken ];
CSC_OPTIONS = stdenv.lib.concatStringsSep " " cscOptions;
installPhase = ''
runHook preInstall
export CHICKEN_INSTALL_PREFIX=$out
export CHICKEN_INSTALL_REPOSITORY=$out/lib/chicken/${toString chicken.binaryVersion}
chicken-install ${stdenv.lib.concatStringsSep " " chickenInstallFlags}
for f in $out/bin/*
do
wrapProgram $f \
--prefix CHICKEN_REPOSITORY_PATH : "$out/lib/chicken/${toString chicken.binaryVersion}:$CHICKEN_REPOSITORY_PATH" \
--prefix CHICKEN_INCLUDE_PATH : "$CHICKEN_INCLUDE_PATH:$out/share" \
--prefix PATH : "$out/bin:${chicken}/bin:$CHICKEN_REPOSITORY_PATH"
done
runHook postInstall
'';
} // (builtins.removeAttrs args ["name" "buildInputs"]) // override)