From db25406910cf8497f2e2211a9f6edfb28b95009e Mon Sep 17 00:00:00 2001 From: Karn Kallio Date: Wed, 16 Feb 2011 00:48:58 +0000 Subject: [PATCH] Advance racket to latest release version 5.1 svn path=/nixpkgs/trunk/; revision=25984 --- .../interpreters/racket/default.nix | 47 +++++++++++-------- pkgs/top-level/all-packages.nix | 5 +- 2 files changed, 31 insertions(+), 21 deletions(-) diff --git a/pkgs/development/interpreters/racket/default.nix b/pkgs/development/interpreters/racket/default.nix index 2568d3e50fe0..833f0d1c1577 100644 --- a/pkgs/development/interpreters/racket/default.nix +++ b/pkgs/development/interpreters/racket/default.nix @@ -1,34 +1,35 @@ -{ stdenv, fetchurl, cairo, file, libjpeg -, libpng, libtool, libXaw, libXext, libXft, libXrender -, libXt, libXmu, mesa, pkgconfig, which } : +{ stdenv, fetchurl, cairo, file, pango, glib, gtk +, which, libtool, makeWrapper, libjpeg, libpng +, fontconfig, liberation_ttf } : stdenv.mkDerivation rec { pname = "racket"; - version = "5.0.2"; + version = "5.1"; name = "${pname}-${version}"; src = fetchurl { url = "http://download.racket-lang.org/installers/${version}/${pname}/${name}-src-unix.tgz"; - sha256 = "1xx0gc935mvh9b1nch7p4xscx9hjd0401rl1sdpf291nj9vmpb3k"; + sha256 = "0k53jdsz0qf8jvydw29gnz1z8d9vs9ycfgilgqa6rcyp8i0f468k"; }; - buildInputs = [ cairo - file - libjpeg - libpng - libtool - libXaw - libXext - libXft - libXrender - libXt - libXmu - mesa - pkgconfig - which - ]; + # Various racket executables do run-time searches for these. + ffiSharedLibs = "${glib}/lib:${cairo}/lib:${pango}/lib:${gtk}/lib:${libjpeg}/lib:${libpng}/lib"; + + buildInputs = [ file libtool which makeWrapper fontconfig liberation_ttf ]; preConfigure = '' + export LD_LIBRARY_PATH=${ffiSharedLibs}:$LD_LIBRARY_PATH + + # Chroot builds do not have access to /etc/fonts/fonts.conf, but the Racket bootstrap + # needs a working fontconfig, so here a simple standin is used. + mkdir chroot-fontconfig + cat ${fontconfig}/etc/fonts/fonts.conf > chroot-fontconfig/fonts.conf + sed -e 's@@@' -i chroot-fontconfig/fonts.conf + echo "${liberation_ttf}" >> chroot-fontconfig/fonts.conf + echo "" >> chroot-fontconfig/fonts.conf + + export FONTCONFIG_FILE=$(pwd)/chroot-fontconfig/fonts.conf + cd src sed -e 's@/usr/bin/uname@'"$(which uname)"'@g' -i configure sed -e 's@/usr/bin/file@'"$(which file)"'@g' -i foreign/libffi/configure @@ -36,6 +37,12 @@ stdenv.mkDerivation rec { configureFlags = [ "--enable-shared" "--enable-lt=${libtool}/bin/libtool" ]; + postInstall = '' + for p in $(ls $out/bin/) ; do + wrapProgram $out/bin/$p --prefix LD_LIBRARY_PATH ":" "${ffiSharedLibs}" ; + done + ''; + meta = { description = "Racket (formerly called PLT Scheme) is a programming language derived from Scheme."; longDescription = '' diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 35fe920abf3d..1b60b9a84f4e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2362,7 +2362,10 @@ let qi = callPackage ../development/compilers/qi { }; - racket = callPackage ../development/interpreters/racket { }; + racket = callPackage ../development/interpreters/racket { + inherit (gtkLibs) pango glib gtk; + libjpeg = libjpeg62; + }; ruby18 = callPackage ../development/interpreters/ruby { }; #ruby19 = import ../development/interpreters/ruby/ruby-19.nix { inherit ruby18 fetchurl; };