nixpkgs/pkgs/development/compilers/gerbil/default.nix

56 lines
1.4 KiB
Nix
Raw Normal View History

2017-06-03 02:26:52 +02:00
{ stdenv, fetchurl, fetchgit, gambit, openssl, zlib, coreutils, rsync, bash }:
stdenv.mkDerivation rec {
name = "gerbil-${version}";
version = "0.10";
src = fetchurl {
url = "https://github.com/vyzo/gerbil/archive/v${version}.tar.gz";
sha256 = "14wzdnifr99g1mvm2xwks97nhaq62hfx43pxcw9gs647i7cymbly";
};
buildInputs = [ gambit openssl zlib coreutils rsync bash ];
2017-06-03 02:26:52 +02:00
postPatch = ''
patchShebangs .
2017-06-03 02:26:52 +02:00
find . -type f -executable -print0 | while IFS= read -r -d ''$'\0' f; do
2017-06-03 02:26:52 +02:00
substituteInPlace "$f" --replace '#!/usr/bin/env' '#!${coreutils}/bin/env'
done
'';
buildPhase = ''
runHook preBuild
2017-06-03 02:26:52 +02:00
( cd src && sh build.sh )
runHook postBuild
2017-06-03 02:26:52 +02:00
'';
installPhase = ''
runHook preInstall
mkdir -p $out/
cp -fa bin lib etc doc $out/
cat > $out/bin/gxi <<EOF
#!${bash}/bin/bash -e
export GERBIL_HOME=$out
case "\$1" in -:*) GSIOPTIONS=\$1 ; shift ;; esac
if [[ \$# = 0 ]] ; then
${gambit}/bin/gsi \$GSIOPTIONS \$GERBIL_HOME/lib/gxi-init \$GERBIL_HOME/lib/gxi-interactive - ;
else
${gambit}/bin/gsi \$GSIOPTIONS \$GERBIL_HOME/lib/gxi-init "\$@"
fi
EOF
runHook postInstall
2017-06-03 02:26:52 +02:00
'';
dontStrip = true;
meta = {
description = "Gerbil";
homepage = "https://github.com/vyzo/gerbil";
license = stdenv.lib.licenses.lgpl2;
platforms = stdenv.lib.platforms.linux;
maintainers = with stdenv.lib.maintainers; [ fare ];
};
}