56 lines
1.4 KiB
Nix
Raw Normal View History

2017-06-02 20:26:52 -04:00
{ stdenv, fetchurl, fetchgit, gambit, openssl, zlib, coreutils, rsync, bash }:
stdenv.mkDerivation rec {
name = "gerbil-${version}";
2017-06-15 06:47:07 -04:00
version = "0.11";
2017-06-02 20:26:52 -04:00
src = fetchurl {
url = "https://github.com/vyzo/gerbil/archive/v${version}.tar.gz";
2017-06-15 06:47:07 -04:00
sha256 = "0mqg6cqdcf5qr7vk79x5zkls7z2wm8i3lhwn0b7i0g1m6yyyyff7";
2017-06-02 20:26:52 -04:00
};
buildInputs = [ gambit openssl zlib coreutils rsync bash ];
2017-06-02 20:26:52 -04:00
postPatch = ''
patchShebangs .
2017-06-02 20:26:52 -04:00
find . -type f -executable -print0 | while IFS= read -r -d ''$'\0' f; do
2017-06-02 20:26:52 -04:00
substituteInPlace "$f" --replace '#!/usr/bin/env' '#!${coreutils}/bin/env'
done
'';
buildPhase = ''
runHook preBuild
2017-06-02 20:26:52 -04:00
( cd src && sh build.sh )
runHook postBuild
2017-06-02 20:26:52 -04: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-02 20:26:52 -04:00
'';
dontStrip = true;
meta = {
2017-06-15 06:47:07 -04:00
description = "Gerbil Scheme";
2017-06-02 20:26:52 -04:00
homepage = "https://github.com/vyzo/gerbil";
license = stdenv.lib.licenses.lgpl2;
platforms = stdenv.lib.platforms.linux;
maintainers = with stdenv.lib.maintainers; [ fare ];
};
}