1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-23 22:20:51 +00:00

racket: add missing libs and clean up

This commit is contained in:
Henry Till 2015-01-24 11:02:23 -05:00
parent 6bbec634a7
commit aa4abb7d9b

View file

@ -1,62 +1,68 @@
{ stdenv, fetchurl, cairo, file, fontconfig, glib, gtk, freefont_ttf { stdenv, fetchurl, makeFontsConf, makeWrapper
, libjpeg, libpng, libtool, makeWrapper, openssl, pango, sqlite, which, readline } : , cairo, coreutils, fontconfig, freefont_ttf
, glib, gmp, gtk, libffi, libjpeg, libpng
, libtool, mpfr, openssl, pango, poppler
, readline, sqlite
}:
let
fontsConf = makeFontsConf {
fontDirectories = [ freefont_ttf ];
};
libPath = stdenv.lib.makeLibraryPath [
cairo
fontconfig
glib
gmp
gtk
libjpeg
libpng
mpfr
openssl
pango
poppler
readline
sqlite
];
in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "racket"; name = "racket-${version}";
version = "6.1.1"; version = "6.1.1";
name = "${pname}-${version}";
src = fetchurl { src = fetchurl {
url = "http://mirror.racket-lang.org/installers/${version}/${name}-src.tgz"; url = "http://mirror.racket-lang.org/installers/${version}/${name}-src.tgz";
sha256 = "090269522d20e7a5ce85d2251a126745746ebf5e87554c05efe03f3b7173da75"; sha256 = "090269522d20e7a5ce85d2251a126745746ebf5e87554c05efe03f3b7173da75";
}; };
# Various Racket executables do runtime searches for these. FONTCONFIG_FILE = fontsConf;
ffiSharedLibs = "${cairo}/lib:${fontconfig}/lib:${glib}/lib:${gtk}/lib:${libjpeg}/lib:" LD_LIBRARY_PATH = libPath;
+ "${libpng}/lib:${openssl}/lib:${pango}/lib:${sqlite}/lib:" NIX_LDFLAGS = "-lgcc_s";
+ "${readline}/lib";
buildInputs = [ file fontconfig freefont_ttf libtool makeWrapper sqlite which ]; buildInputs = [ fontconfig libffi libtool makeWrapper sqlite ];
preConfigure = '' preConfigure = ''
export LD_LIBRARY_PATH=${ffiSharedLibs}:$LD_LIBRARY_PATH substituteInPlace src/configure --replace /usr/bin/uname ${coreutils}/bin/uname
mkdir src/build
# Chroot builds do not have access to /etc/fonts/fonts.conf, cd src/build
# but the Racket bootstrap needs a working fontconfig,
# so here a simple temporary stand-in is used.
mkdir chroot-fontconfig
cat ${fontconfig}/etc/fonts/fonts.conf > chroot-fontconfig/fonts.conf
sed -e 's@</fontconfig>@@' -i chroot-fontconfig/fonts.conf
echo "<dir>${freefont_ttf}</dir>" >> chroot-fontconfig/fonts.conf
echo "</fontconfig>" >> chroot-fontconfig/fonts.conf
# remove extraneous directories from temporary fonts.conf
sed -e 's@<dir></dir>@@g' \
-e 's@<dir prefix="xdg">fonts</dir>@@g' \
-e 's@<dir>~/.fonts</dir>@@g' \
-e 's@<cachedir prefix="xdg">fontconfig</cachedir>@@g' \
-e 's@<cachedir>~/.fontconfig</cachedir>@@g' \
-i 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
''; '';
configureFlags = [ "--enable-shared" "--enable-lt=${libtool}/bin/libtool" ]; configureFlags = [ "--enable-shared" "--enable-lt=${libtool}/bin/libtool" ];
NIX_LDFLAGS = "-lgcc_s"; configureScript = "../configure";
enableParallelBuilding = true;
enableParallelBuilding = false;
postInstall = '' postInstall = ''
for p in $(ls $out/bin/) ; do for p in $(ls $out/bin/) ; do
wrapProgram $out/bin/$p --prefix LD_LIBRARY_PATH ":" "${ffiSharedLibs}"; wrapProgram $out/bin/$p --set LD_LIBRARY_PATH "${LD_LIBRARY_PATH}";
done done
''; '';
meta = { meta = with stdenv.lib; {
description = "A programmable programming language"; description = "A programmable programming language";
longDescription = '' longDescription = ''
Racket is a full-spectrum programming language. It goes beyond Racket is a full-spectrum programming language. It goes beyond
@ -67,10 +73,9 @@ stdenv.mkDerivation rec {
libraries support applications from web servers and databases to libraries support applications from web servers and databases to
GUIs and charts. GUIs and charts.
''; '';
homepage = http://racket-lang.org/; homepage = http://racket-lang.org/;
license = stdenv.lib.licenses.lgpl3; license = licenses.lgpl3;
maintainers = with stdenv.lib.maintainers; [ kkallio henrytill ]; maintainers = with maintainers; [ kkallio henrytill ];
platforms = stdenv.lib.platforms.linux; platforms = platforms.linux;
}; };
} }