about summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
authorFrancois-Rene Rideau <fare@tunes.org>2019-12-23 17:35:10 -0500
committerFrancois-Rene Rideau <fare@tunes.org>2020-02-27 16:02:39 -0500
commit4ee219ef8ebf8f3b60106156d2f6a81a156b25fe (patch)
tree2d924fd3ca50de6d14dc1c3761707d2df830c467 /pkgs/development
parent32b3758b3d9fcb39094b44dc3114d86f712b0fb0 (diff)
downloadnixlib-4ee219ef8ebf8f3b60106156d2f6a81a156b25fe.tar
nixlib-4ee219ef8ebf8f3b60106156d2f6a81a156b25fe.tar.gz
nixlib-4ee219ef8ebf8f3b60106156d2f6a81a156b25fe.tar.bz2
nixlib-4ee219ef8ebf8f3b60106156d2f6a81a156b25fe.tar.lz
nixlib-4ee219ef8ebf8f3b60106156d2f6a81a156b25fe.tar.xz
nixlib-4ee219ef8ebf8f3b60106156d2f6a81a156b25fe.tar.zst
nixlib-4ee219ef8ebf8f3b60106156d2f6a81a156b25fe.zip
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.
Diffstat (limited to 'pkgs/development')
-rw-r--r--pkgs/development/compilers/gerbil/build.nix39
-rw-r--r--pkgs/development/compilers/gerbil/unstable.nix8
2 files changed, 28 insertions, 19 deletions
diff --git a/pkgs/development/compilers/gerbil/build.nix b/pkgs/development/compilers/gerbil/build.nix
index e2ab09764827..21c2936fa0f8 100644
--- a/pkgs/development/compilers/gerbil/build.nix
+++ b/pkgs/development/compilers/gerbil/build.nix
@@ -3,9 +3,6 @@
   openssl, zlib, sqlite, libxml2, libyaml, libmysqlclient, lmdb, leveldb, postgresql,
   version, git-version, gambit, src }:
 
-# TODO: distinct packages for gerbil-release and gerbil-devel
-# TODO: make static compilation work
-
 stdenv.mkDerivation rec {
   pname = "gerbil";
   inherit version;
@@ -32,19 +29,23 @@ stdenv.mkDerivation rec {
       substituteInPlace "$f" --replace '"gsc"' '"${gambit}/bin/gsc"'
     done
     substituteInPlace "etc/gerbil.el" --replace '"gxc"' "\"$out/bin/gxc\""
-
-    cat > etc/gerbil_static_libraries.sh <<EOF
-#OPENSSL_LIBCRYPTO=${makeStaticLibraries openssl}/lib/libcrypto.a # MISSING!
-#OPENSSL_LIBSSL=${makeStaticLibraries openssl}/lib/libssl.a # MISSING!
-ZLIB=${makeStaticLibraries zlib}/lib/libz.a
+'';
+
+## 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_LIBSSL=${makeStaticLibraries openssl}/lib/libssl.a # MISSING!
+# ZLIB=${makeStaticLibraries zlib}/lib/libz.a
 # SQLITE=${makeStaticLibraries sqlite}/lib/sqlite.a # MISSING!
 # LIBXML2=${makeStaticLibraries libxml2}/lib/libxml2.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!
-LEVELDB=${makeStaticLibraries lmdb}/lib/libleveldb.a
-EOF
-  '';
+# LEVELDB=${makeStaticLibraries leveldb}/lib/libleveldb.a
+# EOF
 
   buildPhase = ''
     runHook preBuild
@@ -52,6 +53,14 @@ EOF
     # Enable all optional libraries
     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
     export HOME=$$PWD
 
@@ -71,7 +80,7 @@ EOF
 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 - ;
+  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
@@ -85,8 +94,8 @@ EOF
     description = "Gerbil Scheme";
     homepage    = "https://github.com/vyzo/gerbil";
     license     = stdenv.lib.licenses.lgpl2;
-    # NB regarding platforms: only actually tested on Linux, *should* work everywhere,
-    # but *might* need adaptation e.g. on macOS. Please report success and/or failure to fare.
+    # NB regarding platforms: regularly tested on Linux, only occasionally on macOS.
+    # Please report success and/or failure to fare.
     platforms   = stdenv.lib.platforms.unix;
     maintainers = with stdenv.lib.maintainers; [ fare ];
   };
diff --git a/pkgs/development/compilers/gerbil/unstable.nix b/pkgs/development/compilers/gerbil/unstable.nix
index 5f0347aa9a66..eb78eed35ee9 100644
--- a/pkgs/development/compilers/gerbil/unstable.nix
+++ b/pkgs/development/compilers/gerbil/unstable.nix
@@ -1,15 +1,15 @@
 { stdenv, callPackage, fetchFromGitHub, gambit, gambit-unstable }:
 
 callPackage ./build.nix {
-  version = "unstable-2019-11-15";
-  git-version = "0.15.1-461-gee22de62";
+  version = "unstable-2020-02-27";
+  git-version = "0.16-DEV-493-g1ffb74db";
   #gambit = gambit-unstable;
   gambit = gambit;
   src = fetchFromGitHub {
     owner = "vyzo";
     repo = "gerbil";
-    rev = "ee22de628a656ee59c6c72bc25d7b2e25a4ece2f";
-    sha256 = "1n1j596b91k9xcmv22l72nga6wv20bka2q51ik2jw2vkcw8zkc1c";
+    rev = "1ffb74db5ffd49b4bad751586cef5e619c891d41";
+    sha256 = "1szmdp8lvy5gpcwn5bpa7x383m6vywl35xa7hz9a5vs1rq4w2097";
   };
   inherit stdenv;
 }