nixpkgs/pkgs/development/compilers/chicken/4/eggDerivation.nix

45 lines
1.3 KiB
Nix
Raw Normal View History

{ stdenv, chicken, makeWrapper }:
2014-10-09 19:49:15 +01:00
{ name, src
, buildInputs ? []
, chickenInstallFlags ? []
, cscOptions ? []
, ...} @ args:
let
libPath = "${chicken}/var/lib/chicken/${toString chicken.binaryVersion}/";
2014-10-09 21:01:21 +01:00
overrides = import ./overrides.nix;
baseName = stdenv.lib.getName name;
2014-10-09 21:01:21 +01:00
override = if builtins.hasAttr baseName overrides
then
2014-10-09 21:01:21 +01:00
builtins.getAttr baseName overrides
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;
CHICKEN_REPOSITORY = libPath;
CHICKEN_INSTALL_PREFIX = "$out";
installPhase = ''
runHook preInstall
chicken-install -p $out ${stdenv.lib.concatStringsSep " " chickenInstallFlags}
for f in $out/bin/*
do
wrapProgram $f \
--set CHICKEN_REPOSITORY $CHICKEN_REPOSITORY \
--prefix CHICKEN_REPOSITORY_EXTRA : "$out/lib/chicken/${toString chicken.binaryVersion}/:$CHICKEN_REPOSITORY_EXTRA" \
--prefix CHICKEN_INCLUDE_PATH \; "$CHICKEN_INCLUDE_PATH;$out/share/" \
--prefix PATH : "$out/bin:${chicken}/bin:$CHICKEN_REPOSITORY_EXTRA:$CHICKEN_REPOSITORY"
2014-10-09 19:49:15 +01:00
done
runHook postInstall
2014-10-09 19:49:15 +01:00
'';
2014-10-09 21:01:21 +01:00
} // (builtins.removeAttrs args ["name" "buildInputs"]) // override)