lol
1{ stdenv, fetchurl
2, xftSupport ? true, libXft ? null
3, xrenderSupport ? true, libXrender ? null
4, xrandrSupport ? true, libXrandr ? null, randrproto ? null
5, xineramaSupport ? true, libXinerama ? null
6, cursorSupport ? true, libXcursor ? null
7, threadSupport ? true
8, mysqlSupport ? false, mysql ? null
9, openglSupport ? false, mesa ? null, libXmu ? null
10, x11, xextproto, zlib, libjpeg, libpng, which
11}:
12
13assert xftSupport -> libXft != null;
14assert xrenderSupport -> xftSupport && libXrender != null;
15assert xrandrSupport -> libXrandr != null && randrproto != null;
16assert cursorSupport -> libXcursor != null;
17assert mysqlSupport -> mysql != null;
18assert openglSupport -> mesa != null && libXmu != null;
19
20stdenv.mkDerivation {
21 name = "qt-3.3.8";
22
23 builder = ./builder.sh;
24
25 setupHook = ./setup-hook.sh;
26
27 src = fetchurl {
28 url = ftp://ftp.trolltech.com/qt/source/qt-x11-free-3.3.8.tar.bz2;
29 sha256 = "0jd4g3bwkgk2s4flbmgisyihm7cam964gzb3pawjlkhas01zghz8";
30 };
31
32 nativeBuildInputs = [ which ];
33 propagatedBuildInputs = [libpng x11 libXft libXrender zlib libjpeg];
34
35 configureFlags = "
36 -v
37 -system-zlib -system-libpng -system-libjpeg
38 -qt-gif
39 -I${xextproto}/include
40 ${if openglSupport then "-dlopen-opengl
41 -L${mesa}/lib -I${mesa}/include
42 -L${libXmu}/lib -I${libXmu}/include" else ""}
43 ${if threadSupport then "-thread" else "-no-thread"}
44 ${if xrenderSupport then "-xrender -L${libXrender}/lib -I${libXrender}/include" else "-no-xrender"}
45 ${if xrandrSupport then "-xrandr
46 -L${libXrandr}/lib -I${libXrandr}/include
47 -I${randrproto}/include" else "-no-xrandr"}
48 ${if xineramaSupport then "-xinerama -L${libXinerama}/lib -I${libXinerama}/include" else "-no-xinerama"}
49 ${if cursorSupport then "-L${libXcursor}/lib -I${libXcursor}/include" else ""}
50 ${if mysqlSupport then "-qt-sql-mysql -L${mysql.lib}/lib/mysql -I${mysql.lib}/include/mysql" else ""}
51 ${if xftSupport then "-xft
52 -L${libXft}/lib -I${libXft}/include
53 -L${libXft.freetype}/lib -I${libXft.freetype}/include
54 -L${libXft.fontconfig}/lib -I${libXft.fontconfig}/include" else "-no-xft"}
55 ";
56
57 patches = [
58 # Don't strip everything so we can get useful backtraces.
59 ./strip.patch
60
61 # Build on NixOS.
62 ./qt-pwd.patch
63
64 # randr.h and Xrandr.h need not be in the same prefix.
65 ./xrandr.patch
66
67 # Make it build with gcc 4.6.0
68 ./qt3-gcc4.6.0.patch
69 ];
70
71 passthru = {inherit mysqlSupport;};
72}