summary refs log tree commit diff
path: root/pkgs/development/compilers/mit-scheme
diff options
context:
space:
mode:
authorAlexander Foremny <alexanderforemny@gmail.com>2013-01-12 12:43:47 +0100
committerAlexander Foremny <alexanderforemny@gmail.com>2013-01-12 13:11:55 +0100
commit0500d1689950fd8abab9ec739b4f2fe4b7d9963b (patch)
tree9a027d0e2a480fc1dcf8accd0be7469ae7542c09 /pkgs/development/compilers/mit-scheme
parent96a834d42a1eaf663d5ba6a77fd3045554a77157 (diff)
downloadnixlib-0500d1689950fd8abab9ec739b4f2fe4b7d9963b.tar
nixlib-0500d1689950fd8abab9ec739b4f2fe4b7d9963b.tar.gz
nixlib-0500d1689950fd8abab9ec739b4f2fe4b7d9963b.tar.bz2
nixlib-0500d1689950fd8abab9ec739b4f2fe4b7d9963b.tar.lz
nixlib-0500d1689950fd8abab9ec739b4f2fe4b7d9963b.tar.xz
nixlib-0500d1689950fd8abab9ec739b4f2fe4b7d9963b.tar.zst
nixlib-0500d1689950fd8abab9ec739b4f2fe4b7d9963b.zip
Fix mit-scheme
These changes are necessary for me to use mit-scheme on i686 NixOS.
mit-scheme in the current state should be broken on x86_64 either and
these changes should fix, too. I however did not test this.
Diffstat (limited to 'pkgs/development/compilers/mit-scheme')
-rw-r--r--pkgs/development/compilers/mit-scheme/default.nix22
1 files changed, 18 insertions, 4 deletions
diff --git a/pkgs/development/compilers/mit-scheme/default.nix b/pkgs/development/compilers/mit-scheme/default.nix
index ef11c5b3baf2..7572dda77118 100644
--- a/pkgs/development/compilers/mit-scheme/default.nix
+++ b/pkgs/development/compilers/mit-scheme/default.nix
@@ -1,8 +1,12 @@
-{ fetchurl, stdenv, gnum4, texinfo, texLive, automake }:
+{ fetchurl, stdenv, makeWrapper, gnum4, texinfo, texLive, automake }:
 
 let
   version = "9.1.1";
   bootstrapFromC = ! (stdenv.isi686 || stdenv.isx86_64);
+
+  arch = if      stdenv.isi686   then "-i386"
+         else if stdenv.isx86_64 then "-x86-64"
+         else                         "";
 in
 stdenv.mkDerivation {
   name = "mit-scheme-${version}";
@@ -25,6 +29,11 @@ stdenv.mkDerivation {
       sha256 = "0pclakzwxbqgy6wqwvs6ml62wgby8ba8xzmwzdwhx1v8wv05yw1j";
     };
 
+  configurePhase =
+    '' (cd src && ./configure)
+       (cd doc && ./configure)
+    '';
+
   buildPhase =
     '' cd src
        ${if bootstrapFromC
@@ -42,11 +51,16 @@ stdenv.mkDerivation {
     '';
 
   installPhase =
-    '' make install -C src
-       make install -C doc
+    '' make prefix=$out install -C src
+       make prefix=$out install -C doc
+    '';
+
+  fixupPhase =
+    '' wrapProgram $out/bin/mit-scheme${arch} --set MITSCHEME_LIBRARY_PATH \
+         $out/lib/mit-scheme${arch}
     '';
 
-  buildNativeInputs = [ gnum4 texinfo texLive automake ];
+  buildNativeInputs = [ makeWrapper gnum4 texinfo texLive automake ];
 
   # XXX: The `check' target doesn't exist.
   doCheck = false;