1{ stdenv, fetchurl, makeFontsConf, makeWrapper
2, cairo, coreutils, fontconfig, freefont_ttf
3, glib, gmp, gtk2, libedit, libffi, libjpeg
4, libpng, libtool, mpfr, openssl, pango, poppler
5, readline, sqlite
6, disableDocs ? true
7}:
8
9let
10
11 fontsConf = makeFontsConf {
12 fontDirectories = [ freefont_ttf ];
13 };
14
15 libPath = stdenv.lib.makeLibraryPath [
16 cairo
17 fontconfig
18 glib
19 gmp
20 gtk2
21 libedit
22 libjpeg
23 libpng
24 mpfr
25 openssl
26 pango
27 poppler
28 readline
29 sqlite
30 ];
31
32in
33
34stdenv.mkDerivation rec {
35 name = "racket-${version}";
36 version = "6.10.1";
37
38 src = fetchurl {
39 url = "http://mirror.racket-lang.org/installers/${version}/${name}-src.tgz";
40 sha256 = "0v3z6x277lq1y7wkqdf6mj3826z5vq0yadygspx9h4r0f1dnmafc";
41 };
42
43 FONTCONFIG_FILE = fontsConf;
44 LD_LIBRARY_PATH = libPath;
45 NIX_LDFLAGS = stdenv.lib.optionalString stdenv.cc.isGNU "-lgcc_s";
46
47 buildInputs = [ fontconfig libffi libtool makeWrapper sqlite ];
48
49 preConfigure = ''
50 unset AR
51 substituteInPlace src/configure --replace /usr/bin/uname ${coreutils}/bin/uname
52 mkdir src/build
53 cd src/build
54 '';
55
56 shared = if stdenv.isDarwin then "dylib" else "shared";
57 configureFlags = [ "--enable-${shared}" "--enable-lt=${libtool}/bin/libtool" ]
58 ++ stdenv.lib.optional disableDocs [ "--disable-docs" ]
59 ++ stdenv.lib.optional stdenv.isDarwin [ "--enable-xonx" ];
60
61 configureScript = "../configure";
62
63 enableParallelBuilding = false;
64
65 postInstall = ''
66 for p in $(ls $out/bin/) ; do
67 wrapProgram $out/bin/$p --set LD_LIBRARY_PATH "${LD_LIBRARY_PATH}";
68 done
69 '';
70
71 meta = with stdenv.lib; {
72 description = "A programmable programming language";
73 longDescription = ''
74 Racket is a full-spectrum programming language. It goes beyond
75 Lisp and Scheme with dialects that support objects, types,
76 laziness, and more. Racket enables programmers to link
77 components written in different dialects, and it empowers
78 programmers to create new, project-specific dialects. Racket's
79 libraries support applications from web servers and databases to
80 GUIs and charts.
81 '';
82 homepage = http://racket-lang.org/;
83 license = licenses.lgpl3;
84 maintainers = with maintainers; [ kkallio henrytill vrthra ];
85 platforms = platforms.x86_64;
86 };
87}