about summary refs log tree commit diff
path: root/pkgs/development/compilers/gerbil
diff options
context:
space:
mode:
authorFrancois-Rene Rideau2020-05-17 16:10:03 -0400
committerFrancois-Rene Rideau2020-05-17 16:14:22 -0400
commit0d0f475f27b0978490a44327bdd558947d62c1e9 (patch)
tree3e4c27cd20cf3ae0ba603c25a78863cadc123fe7 /pkgs/development/compilers/gerbil
parentf9360e7974e6cb57d99995dbffabaef863c3917d (diff)
gerbil: 0.15.1 -> 0.16
Now that v0.16 was released at last, make the configurePhase and instalPhase
the same again for default and unstable.
Diffstat (limited to 'pkgs/development/compilers/gerbil')
-rw-r--r--pkgs/development/compilers/gerbil/build.nix26
-rw-r--r--pkgs/development/compilers/gerbil/default.nix46
-rw-r--r--pkgs/development/compilers/gerbil/unstable.nix21
3 files changed, 27 insertions, 66 deletions
diff --git a/pkgs/development/compilers/gerbil/build.nix b/pkgs/development/compilers/gerbil/build.nix
index 0177e706af11..8297dafff8e2 100644
--- a/pkgs/development/compilers/gerbil/build.nix
+++ b/pkgs/development/compilers/gerbil/build.nix
@@ -1,9 +1,8 @@
-{ pkgs, gccStdenv, lib, coreutils, # makeStaticLibraries,
+{ pkgs, gccStdenv, lib, coreutils, bash, # makeStaticLibraries,
   openssl, zlib, sqlite, libxml2, libyaml, libmysqlclient, lmdb, leveldb, postgresql,
   version, git-version,
   gambit-support,
-  gambit ? pkgs.gambit, gambit-params ? pkgs.gambit-support.stable-params,
-  src, configurePhase, installPhase }:
+  gambit ? pkgs.gambit, gambit-params ? pkgs.gambit-support.stable-params, src }:
 
 # We use Gambit, that works 10x better with GCC than Clang. See ../gambit/build.nix
 let stdenv = gccStdenv; in
@@ -48,7 +47,18 @@ stdenv.mkDerivation rec {
 # LEVELDB=${makeStaticLibraries leveldb}/lib/libleveldb.a
 # EOF
 
-  inherit configurePhase installPhase;
+  configurePhase = ''
+    (cd src && ./configure \
+      --prefix=$out/gerbil \
+      --with-gambit=${gambit}/gambit \
+      --enable-libxml \
+      --enable-libyaml \
+      --enable-zlib \
+      --enable-sqlite \
+      --enable-mysql \
+      --enable-lmdb \
+      --enable-leveldb)
+  '';
 
   buildPhase = ''
     runHook preBuild
@@ -69,6 +79,14 @@ stdenv.mkDerivation rec {
     runHook postBuild
   '';
 
+  installPhase = ''
+    runHook preInstall
+    mkdir -p $out/gerbil $out/bin
+    (cd src; ./install)
+    (cd $out/bin ; ln -s ../gerbil/bin/* .)
+    runHook postInstall
+  '';
+
   dontStrip = true;
 
   meta = {
diff --git a/pkgs/development/compilers/gerbil/default.nix b/pkgs/development/compilers/gerbil/default.nix
index d7b1fe3cf5e2..3367ae581b2e 100644
--- a/pkgs/development/compilers/gerbil/default.nix
+++ b/pkgs/development/compilers/gerbil/default.nix
@@ -1,50 +1,12 @@
-{ callPackage, fetchFromGitHub, gambit, bash }:
+{ callPackage, fetchFromGitHub }:
 
 callPackage ./build.nix rec {
-  version = "0.15.1";
-  git-version = "0.15.1";
+  version = "0.16";
+  git-version = version;
   src = fetchFromGitHub {
     owner = "vyzo";
     repo = "gerbil";
     rev = "v${version}";
-    sha256 = "0qpqms66hz41wwhxb1z0fnzj96ivkm7qi9h9d7lhlr3fsxm1kp1n";
+    sha256 = "0vng0kxpnwsg8jbjdpyn4sdww36jz7zfpfbzayg9sdpz6bjxjy0f";
   };
-  configurePhase = ''
-    grep -Fl '"gsc"' `find . -type f -name '*.s*'` | while read f ; do
-      substituteInPlace "$f" --replace '"gsc"' '"${gambit}/bin/gsc"' ;
-    done ;
-    for f in etc/gerbil.el src/std/make.ss ; do
-      substituteInPlace "$f" --replace '"gxc"' "\"$out/bin/gxc\"" ;
-    done ;
-
-    # 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 '(define default-gerbil-home #f)' "(define default-gerbil-home \"$out/gerbil\")" ;
-      substituteInPlace "$i" --replace '(getenv "GERBIL_HOME" #f)' "(getenv \"GERBIL_HOME\" \"$out/gerbil\")" ;
-    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/gerbil\")" ;
-    done
-  '';
-  installPhase = ''
-    runHook preInstall
-    mkdir -p $out/gerbil $out/bin
-    cp -fa bin lib etc doc $out/gerbil
-    cat > $out/gerbil/bin/gxi <<EOF
-#!${bash}/bin/bash -e
-GERBIL_GSI=${gambit}/bin/gsi
-export GERBIL_HOME=$out/gerbil
-case "\$1" in -:*) GSIOPTIONS="\$1" ; shift ;; esac
-if [[ \$# = 0 ]] ; then
-  exec "\$GERBIL_GSI" \$GSIOPTIONS "\$GERBIL_HOME/lib/gxi-init" "\$GERBIL_HOME/lib/gxi-interactive" -
-else
-  exec "\$GERBIL_GSI" \$GSIOPTIONS "\$GERBIL_HOME/lib/gxi-init" "\$@"
-fi
-EOF
-    (cd $out/bin ; ln -s ../gerbil/bin/* .)
-    runHook postInstall
-  '';
 }
diff --git a/pkgs/development/compilers/gerbil/unstable.nix b/pkgs/development/compilers/gerbil/unstable.nix
index e8bf18a64299..9de6dc42907a 100644
--- a/pkgs/development/compilers/gerbil/unstable.nix
+++ b/pkgs/development/compilers/gerbil/unstable.nix
@@ -1,4 +1,4 @@
-{ callPackage, fetchFromGitHub, gambit-unstable, gambit-support, coreutils, bash }:
+{ callPackage, fetchFromGitHub, gambit-unstable, gambit-support }:
 
 callPackage ./build.nix rec {
   version = "unstable-2020-05-17";
@@ -12,23 +12,4 @@ callPackage ./build.nix rec {
   inherit gambit-support;
   gambit = gambit-unstable;
   gambit-params = gambit-support.unstable-params;
-  configurePhase = ''
-    (cd src && ./configure \
-      --prefix=$out/gerbil \
-      --with-gambit=${gambit}/gambit \
-      --enable-libxml \
-      --enable-libyaml \
-      --enable-zlib \
-      --enable-sqlite \
-      --enable-mysql \
-      --enable-lmdb \
-      --enable-leveldb)
-  '';
-  installPhase = ''
-    runHook preInstall
-    mkdir -p $out/gerbil $out/bin
-    (cd src; ./install)
-    (cd $out/bin ; ln -s ../gerbil/bin/* .)
-    runHook postInstall
-  '';
 }