summary refs log tree commit diff
path: root/pkgs/development/compilers/chez
diff options
context:
space:
mode:
authorAustin Seipp <aseipp@pobox.com>2018-02-10 14:03:48 -0600
committerAustin Seipp <aseipp@pobox.com>2018-02-10 14:14:04 -0600
commitdf689d142b04f5bf8958ba585ff850ee44a0f8eb (patch)
treefdc14abd8dd7ef06b16f972822396cbec85380e3 /pkgs/development/compilers/chez
parent3b4bd3ea9f04a2b9d172af0fda4f19dc1c74e825 (diff)
downloadnixpkgs-df689d142b04f5bf8958ba585ff850ee44a0f8eb.tar
nixpkgs-df689d142b04f5bf8958ba585ff850ee44a0f8eb.tar.gz
nixpkgs-df689d142b04f5bf8958ba585ff850ee44a0f8eb.tar.bz2
nixpkgs-df689d142b04f5bf8958ba585ff850ee44a0f8eb.tar.lz
nixpkgs-df689d142b04f5bf8958ba585ff850ee44a0f8eb.tar.xz
nixpkgs-df689d142b04f5bf8958ba585ff850ee44a0f8eb.tar.zst
nixpkgs-df689d142b04f5bf8958ba585ff850ee44a0f8eb.zip
chez-scheme: 9.5-20171109 -> 9.5.1
  - Add a new postInstall hook that installs Chez's kernel.o file into
the library directory. This library /should/ be installed by Chez, but
isn't, and it's the only way to properly embed Chez in your applications
or write your own shell/bootfile harness directly.

  - Fixes the version number for Nix to properly reflect the one Chez
shows the user.

  - Loose odds and ends (fix homepage URL, tidy up comments)

Signed-off-by: Austin Seipp <aseipp@pobox.com>
Diffstat (limited to 'pkgs/development/compilers/chez')
-rw-r--r--pkgs/development/compilers/chez/default.nix45
1 files changed, 37 insertions, 8 deletions
diff --git a/pkgs/development/compilers/chez/default.nix b/pkgs/development/compilers/chez/default.nix
index f238e5f8fb5..3ffd024305d 100644
--- a/pkgs/development/compilers/chez/default.nix
+++ b/pkgs/development/compilers/chez/default.nix
@@ -2,8 +2,7 @@
 
 stdenv.mkDerivation rec {
   name    = "chez-scheme-${version}";
-  version = "9.5-${dver}";
-  dver    = "20171109";
+  version = "9.5.1";
 
   src = fetchgit {
     url    = "https://github.com/cisco/chezscheme.git";
@@ -13,10 +12,12 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [ coreutils ] ++ stdenv.lib.optional stdenv.isDarwin cctools;
-
   buildInputs = [ ncurses libiconv libX11 ];
 
-  /* We patch out a very annoying 'feature' in ./configure, which
+  enableParallelBuilding = true;
+
+  /*
+  ** We patch out a very annoying 'feature' in ./configure, which
   ** tries to use 'git' to update submodules.
   **
   ** We have to also fix a few occurrences to tools with absolute
@@ -38,19 +39,47 @@ stdenv.mkDerivation rec {
       --replace "/usr/bin/libtool" libtool
   '';
 
-  /* Don't use configureFlags, since that just implicitly appends
+  /*
+  ** Don't use configureFlags, since that just implicitly appends
   ** everything onto a --prefix flag, which ./configure gets very angry
   ** about.
+  **
+  ** Also, carefully set a manual workarea argument, so that we
+  ** can later easily find the machine type that we built Chez
+  ** for.
   */
   configurePhase = ''
-    ./configure --threads --installprefix=$out --installman=$out/share/man
+    ./configure --threads \
+      --installprefix=$out --installman=$out/share/man \
+      --workarea=work
   '';
 
-  enableParallelBuilding = true;
+  /*
+  ** Install the kernel.o file, so we can compile C applications that
+  ** link directly to the Chez runtime (for booting their own files, or
+  ** embedding.)
+  **
+  ** Ideally in the future this would be less of a hack and could be
+  ** done by Chez itself. Alternatively, there could just be a big
+  ** case statement matching to the different stdenv.platform values...
+  */
+  postInstall = ''
+    m="$(ls ./work/boot)"
+    if [ "x''${m[1]}" != "x" ]; then
+      >&2 echo "ERROR: more than one bootfile build found; this is a nixpkgs error"
+      exit 1
+    fi
+
+    kernel=./work/boot/$m/kernel.o
+    kerneldest=$out/lib/csv${version}/$m/
+
+    echo installing $kernel to $kerneldest
+    cp $kernel $kerneldest/kernel.o
+  '';
 
   meta = {
     description = "A powerful and incredibly fast R6RS Scheme compiler";
-    homepage    = "http://www.scheme.com";
+    homepage    = https://cisco.github.io/ChezScheme/;
     license     = stdenv.lib.licenses.asl20;
     platforms   = stdenv.lib.platforms.unix;
     maintainers = with stdenv.lib.maintainers; [ thoughtpolice ];