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

78 lines
2.0 KiB
Nix
Raw Normal View History

2017-06-29 02:14:22 +00:00
{ stdenv, fetchurl, fetchgit, gambit,
coreutils, rsync, bash,
openssl, zlib, sqlite, libxml2, libyaml, mysql, lmdb, leveldb }:
2017-06-03 00:26:52 +00:00
# TODO: distinct packages for gerbil-release and gerbil-devel
2017-06-03 00:26:52 +00:00
stdenv.mkDerivation rec {
name = "gerbil-${version}";
version = "0.12-DEV-1030-gbbed3bc";
2017-06-29 02:14:22 +00:00
src = fetchgit {
url = "https://github.com/vyzo/gerbil.git";
rev = "bbed3bc4cf7bcaa64eaabdf097192bfcc2bfc928";
sha256 = "1dc0j143j860yq72lfjp71fin7hpsy1426azz7rl1szxvjfb7h4r";
2017-06-03 00:26:52 +00:00
};
2017-06-29 02:14:22 +00:00
buildInputs = [
gambit
2017-06-29 02:14:22 +00:00
coreutils rsync bash
openssl zlib sqlite libxml2 libyaml mysql.connector-c lmdb leveldb
2017-06-29 02:14:22 +00:00
];
2017-06-03 00:26:52 +00:00
NIX_CFLAGS_COMPILE = [ "-I${mysql.connector-c}/include/mysql" "-L${mysql.connector-c}/lib/mysql" ];
postPatch = ''
echo '(define (gerbil-version-string) "v${version}")' > src/gerbil/runtime/gx-version.scm
patchShebangs .
2017-06-03 00:26:52 +00:00
find . -type f -executable -print0 | while IFS= read -r -d ''$'\0' f; do
2017-06-03 00:26:52 +00:00
substituteInPlace "$f" --replace '#!/usr/bin/env' '#!${coreutils}/bin/env'
done
'';
buildPhase = ''
runHook preBuild
2017-06-29 02:14:22 +00:00
# Enable all optional libraries
substituteInPlace "src/std/build-features.ss" --replace '#f' '#t'
# gxprof testing uses $HOME/.cache/gerbil/gxc
export HOME=$$PWD
2017-06-29 02:14:22 +00:00
# Build, replacing make by build.sh
2017-06-03 00:26:52 +00:00
( cd src && sh build.sh )
2017-06-29 02:14:22 +00:00
runHook postBuild
2017-06-03 00:26:52 +00: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
exec ${gambit}/bin/gsi \$GSIOPTIONS \$GERBIL_HOME/lib/gxi-init \$GERBIL_HOME/lib/gxi-interactive - ;
else
exec ${gambit}/bin/gsi \$GSIOPTIONS \$GERBIL_HOME/lib/gxi-init "\$@"
fi
EOF
runHook postInstall
2017-06-03 00:26:52 +00:00
'';
dontStrip = true;
meta = {
2017-06-15 10:47:07 +00:00
description = "Gerbil Scheme";
2017-06-03 00:26:52 +00:00
homepage = "https://github.com/vyzo/gerbil";
license = stdenv.lib.licenses.lgpl2;
platforms = stdenv.lib.platforms.linux;
maintainers = with stdenv.lib.maintainers; [ fare ];
};
}