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>

+37 -8
+37 -8
pkgs/development/compilers/chez/default.nix
··· 2 2 3 3 stdenv.mkDerivation rec { 4 4 name = "chez-scheme-${version}"; 5 - version = "9.5-${dver}"; 6 - dver = "20171109"; 5 + version = "9.5.1"; 7 6 8 7 src = fetchgit { 9 8 url = "https://github.com/cisco/chezscheme.git"; ··· 13 12 }; 14 13 15 14 nativeBuildInputs = [ coreutils ] ++ stdenv.lib.optional stdenv.isDarwin cctools; 16 - 17 15 buildInputs = [ ncurses libiconv libX11 ]; 18 16 19 - /* We patch out a very annoying 'feature' in ./configure, which 17 + enableParallelBuilding = true; 18 + 19 + /* 20 + ** We patch out a very annoying 'feature' in ./configure, which 20 21 ** tries to use 'git' to update submodules. 21 22 ** 22 23 ** We have to also fix a few occurrences to tools with absolute ··· 38 39 --replace "/usr/bin/libtool" libtool 39 40 ''; 40 41 41 - /* Don't use configureFlags, since that just implicitly appends 42 + /* 43 + ** Don't use configureFlags, since that just implicitly appends 42 44 ** everything onto a --prefix flag, which ./configure gets very angry 43 45 ** about. 46 + ** 47 + ** Also, carefully set a manual workarea argument, so that we 48 + ** can later easily find the machine type that we built Chez 49 + ** for. 44 50 */ 45 51 configurePhase = '' 46 - ./configure --threads --installprefix=$out --installman=$out/share/man 52 + ./configure --threads \ 53 + --installprefix=$out --installman=$out/share/man \ 54 + --workarea=work 47 55 ''; 48 56 49 - enableParallelBuilding = true; 57 + /* 58 + ** Install the kernel.o file, so we can compile C applications that 59 + ** link directly to the Chez runtime (for booting their own files, or 60 + ** embedding.) 61 + ** 62 + ** Ideally in the future this would be less of a hack and could be 63 + ** done by Chez itself. Alternatively, there could just be a big 64 + ** case statement matching to the different stdenv.platform values... 65 + */ 66 + postInstall = '' 67 + m="$(ls ./work/boot)" 68 + if [ "x''${m[1]}" != "x" ]; then 69 + >&2 echo "ERROR: more than one bootfile build found; this is a nixpkgs error" 70 + exit 1 71 + fi 72 + 73 + kernel=./work/boot/$m/kernel.o 74 + kerneldest=$out/lib/csv${version}/$m/ 75 + 76 + echo installing $kernel to $kerneldest 77 + cp $kernel $kerneldest/kernel.o 78 + ''; 50 79 51 80 meta = { 52 81 description = "A powerful and incredibly fast R6RS Scheme compiler"; 53 - homepage = "http://www.scheme.com"; 82 + homepage = https://cisco.github.io/ChezScheme/; 54 83 license = stdenv.lib.licenses.asl20; 55 84 platforms = stdenv.lib.platforms.unix; 56 85 maintainers = with stdenv.lib.maintainers; [ thoughtpolice ];