gerbil-unstable: 2019-11-15 -> 2020-02-27
Let Gerbil Scheme find its GERBIL_HOME where Nix put it when the environment variable is left unspecified. Comment out work in progress for static linking. Notes about working on macOS.
This commit is contained in:
parent
32b3758b3d
commit
4ee219ef8e
|
@ -3,9 +3,6 @@
|
||||||
openssl, zlib, sqlite, libxml2, libyaml, libmysqlclient, lmdb, leveldb, postgresql,
|
openssl, zlib, sqlite, libxml2, libyaml, libmysqlclient, lmdb, leveldb, postgresql,
|
||||||
version, git-version, gambit, src }:
|
version, git-version, gambit, src }:
|
||||||
|
|
||||||
# TODO: distinct packages for gerbil-release and gerbil-devel
|
|
||||||
# TODO: make static compilation work
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "gerbil";
|
pname = "gerbil";
|
||||||
inherit version;
|
inherit version;
|
||||||
|
@ -32,19 +29,23 @@ stdenv.mkDerivation rec {
|
||||||
substituteInPlace "$f" --replace '"gsc"' '"${gambit}/bin/gsc"'
|
substituteInPlace "$f" --replace '"gsc"' '"${gambit}/bin/gsc"'
|
||||||
done
|
done
|
||||||
substituteInPlace "etc/gerbil.el" --replace '"gxc"' "\"$out/bin/gxc\""
|
substituteInPlace "etc/gerbil.el" --replace '"gxc"' "\"$out/bin/gxc\""
|
||||||
|
'';
|
||||||
|
|
||||||
cat > etc/gerbil_static_libraries.sh <<EOF
|
## TODO: make static compilation work.
|
||||||
|
## For that, get all the packages below to somehow expose static libraries,
|
||||||
|
## so we can offer users the option to statically link them into Gambit and/or Gerbil.
|
||||||
|
## Then add the following to the postPatch script above:
|
||||||
|
# cat > etc/gerbil_static_libraries.sh <<EOF
|
||||||
# OPENSSL_LIBCRYPTO=${makeStaticLibraries openssl}/lib/libcrypto.a # MISSING!
|
# OPENSSL_LIBCRYPTO=${makeStaticLibraries openssl}/lib/libcrypto.a # MISSING!
|
||||||
# OPENSSL_LIBSSL=${makeStaticLibraries openssl}/lib/libssl.a # MISSING!
|
# OPENSSL_LIBSSL=${makeStaticLibraries openssl}/lib/libssl.a # MISSING!
|
||||||
ZLIB=${makeStaticLibraries zlib}/lib/libz.a
|
# ZLIB=${makeStaticLibraries zlib}/lib/libz.a
|
||||||
# SQLITE=${makeStaticLibraries sqlite}/lib/sqlite.a # MISSING!
|
# SQLITE=${makeStaticLibraries sqlite}/lib/sqlite.a # MISSING!
|
||||||
# LIBXML2=${makeStaticLibraries libxml2}/lib/libxml2.a # MISSING!
|
# LIBXML2=${makeStaticLibraries libxml2}/lib/libxml2.a # MISSING!
|
||||||
# YAML=${makeStaticLibraries libyaml}/lib/libyaml.a # MISSING!
|
# YAML=${makeStaticLibraries libyaml}/lib/libyaml.a # MISSING!
|
||||||
MYSQL=${makeStaticLibraries libmysqlclient}/lib/mariadb/libmariadb.a
|
# MYSQL=${makeStaticLibraries libmysqlclient}/lib/mariadb/libmariadb.a
|
||||||
# LMDB=${makeStaticLibraries lmdb}/lib/mysql/libmysqlclient_r.a # MISSING!
|
# LMDB=${makeStaticLibraries lmdb}/lib/mysql/libmysqlclient_r.a # MISSING!
|
||||||
LEVELDB=${makeStaticLibraries lmdb}/lib/libleveldb.a
|
# LEVELDB=${makeStaticLibraries leveldb}/lib/libleveldb.a
|
||||||
EOF
|
# EOF
|
||||||
'';
|
|
||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
runHook preBuild
|
runHook preBuild
|
||||||
|
@ -52,6 +53,14 @@ EOF
|
||||||
# Enable all optional libraries
|
# Enable all optional libraries
|
||||||
substituteInPlace "src/std/build-features.ss" --replace '#f' '#t'
|
substituteInPlace "src/std/build-features.ss" --replace '#f' '#t'
|
||||||
|
|
||||||
|
# Enable autodetection of a default GERBIL_HOME
|
||||||
|
for i in src/gerbil/boot/gx-init-exe.scm src/gerbil/boot/gx-init.scm ; do
|
||||||
|
substituteInPlace "$i" --replace '(getenv "GERBIL_HOME" #f)' "(getenv \"GERBIL_HOME\" \"$out\")"
|
||||||
|
done
|
||||||
|
for i in src/gerbil/boot/gxi-init.scm src/gerbil/compiler/driver.ss src/gerbil/runtime/gx-gambc.scm src/std/build.ss src/tools/build.ss ; do
|
||||||
|
substituteInPlace "$i" --replace '(getenv "GERBIL_HOME")' "(getenv \"GERBIL_HOME\" \"$out\")"
|
||||||
|
done
|
||||||
|
|
||||||
# gxprof testing uses $HOME/.cache/gerbil/gxc
|
# gxprof testing uses $HOME/.cache/gerbil/gxc
|
||||||
export HOME=$$PWD
|
export HOME=$$PWD
|
||||||
|
|
||||||
|
@ -71,7 +80,7 @@ EOF
|
||||||
export GERBIL_HOME=$out
|
export GERBIL_HOME=$out
|
||||||
case "\$1" in -:*) GSIOPTIONS=\$1 ; shift ;; esac
|
case "\$1" in -:*) GSIOPTIONS=\$1 ; shift ;; esac
|
||||||
if [[ \$# = 0 ]] ; then
|
if [[ \$# = 0 ]] ; then
|
||||||
exec ${gambit}/bin/gsi \$GSIOPTIONS \$GERBIL_HOME/lib/gxi-init \$GERBIL_HOME/lib/gxi-interactive - ;
|
exec ${gambit}/bin/gsi \$GSIOPTIONS \$GERBIL_HOME/lib/gxi-init \$GERBIL_HOME/lib/gxi-interactive -
|
||||||
else
|
else
|
||||||
exec ${gambit}/bin/gsi \$GSIOPTIONS \$GERBIL_HOME/lib/gxi-init "\$@"
|
exec ${gambit}/bin/gsi \$GSIOPTIONS \$GERBIL_HOME/lib/gxi-init "\$@"
|
||||||
fi
|
fi
|
||||||
|
@ -85,8 +94,8 @@ EOF
|
||||||
description = "Gerbil Scheme";
|
description = "Gerbil Scheme";
|
||||||
homepage = "https://github.com/vyzo/gerbil";
|
homepage = "https://github.com/vyzo/gerbil";
|
||||||
license = stdenv.lib.licenses.lgpl2;
|
license = stdenv.lib.licenses.lgpl2;
|
||||||
# NB regarding platforms: only actually tested on Linux, *should* work everywhere,
|
# NB regarding platforms: regularly tested on Linux, only occasionally on macOS.
|
||||||
# but *might* need adaptation e.g. on macOS. Please report success and/or failure to fare.
|
# Please report success and/or failure to fare.
|
||||||
platforms = stdenv.lib.platforms.unix;
|
platforms = stdenv.lib.platforms.unix;
|
||||||
maintainers = with stdenv.lib.maintainers; [ fare ];
|
maintainers = with stdenv.lib.maintainers; [ fare ];
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
{ stdenv, callPackage, fetchFromGitHub, gambit, gambit-unstable }:
|
{ stdenv, callPackage, fetchFromGitHub, gambit, gambit-unstable }:
|
||||||
|
|
||||||
callPackage ./build.nix {
|
callPackage ./build.nix {
|
||||||
version = "unstable-2019-11-15";
|
version = "unstable-2020-02-27";
|
||||||
git-version = "0.15.1-461-gee22de62";
|
git-version = "0.16-DEV-493-g1ffb74db";
|
||||||
#gambit = gambit-unstable;
|
#gambit = gambit-unstable;
|
||||||
gambit = gambit;
|
gambit = gambit;
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "vyzo";
|
owner = "vyzo";
|
||||||
repo = "gerbil";
|
repo = "gerbil";
|
||||||
rev = "ee22de628a656ee59c6c72bc25d7b2e25a4ece2f";
|
rev = "1ffb74db5ffd49b4bad751586cef5e619c891d41";
|
||||||
sha256 = "1n1j596b91k9xcmv22l72nga6wv20bka2q51ik2jw2vkcw8zkc1c";
|
sha256 = "1szmdp8lvy5gpcwn5bpa7x383m6vywl35xa7hz9a5vs1rq4w2097";
|
||||||
};
|
};
|
||||||
inherit stdenv;
|
inherit stdenv;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue