summary refs log tree commit diff
path: root/pkgs/development/libraries/qt-4.x/4.7/default.nix
blob: cc6d3c8d513e3668521302cbe3b7b72bd523ffb8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
{ stdenv, fetchurl
, alsaLib, gstreamer, gstPluginsBase, pulseaudio
, libXft, libXrender, randrproto, xextproto, libXinerama, xineramaproto, libXcursor, libXmu
, libXv, libXext, libXfixes, inputproto, fixesproto, libXrandr, freetype, fontconfig
, zlib, libjpeg, libpng, libmng, which, mesa, openssl, dbus, cups, pkgconfig, libtiff, glib
, mysql, postgresql, sqlite
, perl, coreutils, libXi
, buildDemos ? false, buildExamples ? false, useDocs ? true}:

let
  v = "4.7.0-beta2";
in

stdenv.mkDerivation rec {
  name = "qt-${v}";

  src = fetchurl {
    url = "ftp://ftp.qt.nokia.com/qt/source/qt-everywhere-opensource-src-${v}.tar.gz";
    sha256 = "1gxckb5pxybnj5413dxk7dm8hm945ymm4ppqwg14wfk83zhnw6g0";
  };

  preConfigure = ''
    export LD_LIBRARY_PATH="`pwd`/lib:$LD_LIBRARY_PATH"
    configureFlags+="
      -docdir $out/share/doc/${name}
      -plugindir $out/lib/qt4/plugins
      -importdir $out/lib/qt4/imports
      -examplesdir $out/share/doc/${name}/examples
      -demosdir $out/share/doc/${name}/demos
      -datadir $out/share/qt4
    "
  '';

  propagatedBuildInputs = [
    alsaLib
    sqlite
    libXft
    libXrender
    libXrandr
    libXi
    randrproto
    xextproto
    libXinerama
    xineramaproto
    libXcursor
    zlib
    libjpeg
    libmng
    mysql
    postgresql
    libpng
    which
    mesa
    libXmu
    libXv
    openssl
    dbus.libs
    cups
    pkgconfig
    libXext
    freetype
    fontconfig
    inputproto
    fixesproto
    libXfixes
    glib
    libtiff
    gstreamer
    gstPluginsBase
    pulseaudio
  ];

  buildInputs = [ perl ];

  prefixKey = "-prefix ";

  configureFlags = ''
    -v -no-separate-debug-info -release -fast -confirm-license -opensource
    -system-zlib -system-libpng -system-libjpeg -qt-gif -system-libmng
    -opengl -xrender -xrandr -xinerama -xcursor
    -plugin-sql-mysql -system-sqlite
    -qdbus -cups -glib -xfixes -dbus-linked -openssl-linked
    -fontconfig -I${freetype}/include/freetype2
    -exceptions -xmlpatterns
    -multimedia -audio-backend -phonon -phonon-backend
    -webkit -javascript-jit
    -make libs -make tools -make translations
    ${if buildDemos == true then "-make demos" else "-nomake demos"}
    ${if buildExamples == true then "-make examples" else "-nomake examples"}
    ${if useDocs then "-make docs" else "-nomake docs"}'';

  patches = [ ./phonon-4.4.0.patch ];

  postPatch = ''
    substituteInPlace configure --replace /bin/pwd pwd
    substituteInPlace src/corelib/global/global.pri --replace /bin/ls ${coreutils}/bin/ls
    sed -e 's@/usr@/FOO@' -i config.tests/*/*.test -i mkspecs/*/*.conf
  '';

  postInstall = if useDocs then "rm -rf $out/share/doc/${name}/{html,src}" else "";

  enableParallelBuilding = true;

  meta = with stdenv.lib; {
    homepage = http://qt.nokia.com/products;
    description = "A cross-platform application framework for C++";
    license = "GPL/LGPL";
    maintainers = with maintainers; [ urkud sander ];
    platforms = platforms.linux;
    priority = 10;
  };
}