2018-07-21 01:44:44 +01:00
|
|
|
{ stdenv, chicken, makeWrapper }:
|
2014-10-09 19:49:15 +01:00
|
|
|
{ name, src
|
|
|
|
, buildInputs ? []
|
|
|
|
, chickenInstallFlags ? []
|
|
|
|
, cscOptions ? []
|
|
|
|
, ...} @ args:
|
|
|
|
|
|
|
|
let
|
2014-10-09 21:01:21 +01:00
|
|
|
overrides = import ./overrides.nix;
|
2019-12-12 14:09:50 +00:00
|
|
|
baseName = stdenv.lib.getName name;
|
2014-10-09 21:01:21 +01:00
|
|
|
override = if builtins.hasAttr baseName overrides
|
2014-10-09 20:59:17 +01:00
|
|
|
then
|
2014-10-09 21:01:21 +01:00
|
|
|
builtins.getAttr baseName overrides
|
2014-10-09 20:59:17 +01:00
|
|
|
else
|
|
|
|
{};
|
2014-10-09 19:49:15 +01:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation ({
|
|
|
|
name = "chicken-${name}";
|
2018-11-14 03:17:50 +00:00
|
|
|
propagatedBuildInputs = buildInputs;
|
|
|
|
buildInputs = [ makeWrapper chicken ];
|
2014-10-09 19:49:15 +01:00
|
|
|
|
|
|
|
CSC_OPTIONS = stdenv.lib.concatStringsSep " " cscOptions;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
2018-11-14 03:17:50 +00:00
|
|
|
export CHICKEN_INSTALL_PREFIX=$out
|
|
|
|
export CHICKEN_INSTALL_REPOSITORY=$out/lib/chicken/${toString chicken.binaryVersion}
|
|
|
|
chicken-install ${stdenv.lib.concatStringsSep " " chickenInstallFlags}
|
2014-10-09 19:49:15 +01:00
|
|
|
|
|
|
|
for f in $out/bin/*
|
|
|
|
do
|
|
|
|
wrapProgram $f \
|
2020-02-29 22:02:11 +00:00
|
|
|
--prefix CHICKEN_REPOSITORY_PATH : "$out/lib/chicken/${toString chicken.binaryVersion}:$CHICKEN_REPOSITORY_PATH" \
|
|
|
|
--prefix CHICKEN_INCLUDE_PATH : "$CHICKEN_INCLUDE_PATH:$out/share" \
|
2018-11-14 03:17:50 +00:00
|
|
|
--prefix PATH : "$out/bin:${chicken}/bin:$CHICKEN_REPOSITORY_PATH"
|
2014-10-09 19:49:15 +01:00
|
|
|
done
|
2014-10-15 11:07:31 +01:00
|
|
|
|
|
|
|
runHook postInstall
|
2014-10-09 19:49:15 +01:00
|
|
|
'';
|
2014-10-09 21:01:21 +01:00
|
|
|
} // (builtins.removeAttrs args ["name" "buildInputs"]) // override)
|