2011-12-24 22:52:08 +01:00
|
|
|
{ stdenv, fetchurl, substituteAll
|
|
|
|
, libXrender, libXinerama, libXcursor, libXmu , libXv, libXext
|
|
|
|
, libXfixes, libXrandr, libSM, freetype, fontconfig
|
|
|
|
, zlib, libjpeg, libpng, libmng, which, mesa, openssl, dbus, cups, pkgconfig
|
|
|
|
, libtiff, glib, icu
|
|
|
|
, mysql, postgresql, sqlite
|
|
|
|
, perl, coreutils, libXi
|
2012-03-17 21:57:28 +01:00
|
|
|
, buildMultimedia ? true, alsaLib, gstreamer, gst_plugins_base
|
|
|
|
, buildWebkit ? true
|
2012-09-29 05:20:34 +02:00
|
|
|
, flashplayerFix ? false, gdk_pixbuf
|
2011-12-24 22:52:08 +01:00
|
|
|
, gtkStyle ? false, libgnomeui, gtk, GConf, gnome_vfs
|
2012-11-27 13:48:48 +01:00
|
|
|
, developerBuild ? false
|
2013-05-31 23:42:44 +02:00
|
|
|
, docs ? false
|
|
|
|
, examples ? false
|
|
|
|
, demos ? false
|
2011-12-24 22:52:08 +01:00
|
|
|
}:
|
|
|
|
|
2012-09-29 05:20:34 +02:00
|
|
|
with stdenv.lib;
|
|
|
|
|
2013-02-13 12:31:17 +01:00
|
|
|
let v = "4.8.4"; in
|
2011-12-24 22:52:08 +01:00
|
|
|
|
|
|
|
# TODO:
|
|
|
|
# * move some plugins (e.g., SQL plugins) to dedicated derivations to avoid
|
|
|
|
# false build-time dependencies
|
|
|
|
|
2013-06-09 10:59:23 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2011-12-24 22:52:08 +01:00
|
|
|
name = "qt-${v}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2012-06-10 02:51:46 +02:00
|
|
|
url = "http://releases.qt-project.org/qt4/source/qt-everywhere-opensource-src-${v}.tar.gz";
|
2013-02-13 12:31:17 +01:00
|
|
|
sha256 = "0w1j16q6glniv4hppdgcvw52w72gb2jab35ylkw0qjn5lj5y7c1k";
|
2011-12-24 22:52:08 +01:00
|
|
|
};
|
|
|
|
|
2013-06-09 10:59:23 +02:00
|
|
|
prePatch = ''
|
|
|
|
substituteInPlace configure --replace /bin/pwd pwd
|
|
|
|
substituteInPlace src/corelib/global/global.pri --replace /bin/ls ${coreutils}/bin/ls
|
|
|
|
sed -e 's@/\(usr\|opt\)/@/var/empty/@g' -i config.tests/*/*.test -i mkspecs/*/*.conf
|
|
|
|
'';
|
|
|
|
|
2012-09-29 05:20:34 +02:00
|
|
|
patches =
|
|
|
|
[ ./glib-2.32.patch
|
|
|
|
(substituteAll {
|
2011-12-24 22:52:08 +01:00
|
|
|
src = ./dlopen-absolute-paths.diff;
|
|
|
|
inherit cups icu libXfixes;
|
|
|
|
glibc = stdenv.gcc.libc;
|
|
|
|
})
|
2012-09-29 05:20:34 +02:00
|
|
|
] ++ stdenv.lib.optional gtkStyle (substituteAll {
|
2011-12-24 22:52:08 +01:00
|
|
|
src = ./dlopen-gtkstyle.diff;
|
|
|
|
# substituteAll ignores env vars starting with capital letter
|
2012-09-29 05:20:34 +02:00
|
|
|
gconf = GConf;
|
2011-12-24 22:52:08 +01:00
|
|
|
inherit gnome_vfs libgnomeui gtk;
|
2012-09-29 05:20:34 +02:00
|
|
|
})
|
|
|
|
++ stdenv.lib.optional flashplayerFix (substituteAll {
|
2011-12-24 22:52:08 +01:00
|
|
|
src = ./dlopen-webkit-nsplugin.diff;
|
|
|
|
inherit gtk gdk_pixbuf;
|
2012-09-29 05:20:34 +02:00
|
|
|
});
|
2011-12-24 22:52:08 +01:00
|
|
|
|
|
|
|
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/${name}
|
|
|
|
-translationdir $out/share/${name}/translations
|
|
|
|
"
|
|
|
|
'';
|
|
|
|
|
2013-06-09 10:59:23 +02:00
|
|
|
prefixKey = "-prefix ";
|
2011-12-24 22:52:08 +01:00
|
|
|
configureFlags =
|
|
|
|
''
|
|
|
|
-v -no-separate-debug-info -release -no-fast -confirm-license -opensource
|
|
|
|
|
|
|
|
-opengl -xrender -xrandr -xinerama -xcursor -xinput -xfixes -fontconfig
|
2012-03-17 21:57:28 +01:00
|
|
|
-qdbus -${if cups == null then "no-" else ""}cups -glib -dbus-linked -openssl-linked
|
2011-12-24 22:52:08 +01:00
|
|
|
|
2012-03-17 21:57:28 +01:00
|
|
|
${if mysql != null then "-plugin" else "-no"}-sql-mysql -system-sqlite
|
2011-12-24 22:52:08 +01:00
|
|
|
|
|
|
|
-exceptions -xmlpatterns
|
|
|
|
|
|
|
|
-make libs -make tools -make translations
|
2013-05-31 23:42:44 +02:00
|
|
|
-${if demos then "" else "no"}make demos
|
|
|
|
-${if examples then "" else "no"}make examples
|
|
|
|
-${if docs then "" else "no"}make docs
|
2011-12-24 22:52:08 +01:00
|
|
|
|
2012-03-17 21:57:28 +01:00
|
|
|
-no-phonon ${if buildWebkit then "" else "-no"}-webkit ${if buildMultimedia then "" else "-no"}-multimedia -audio-backend
|
2012-11-27 13:48:48 +01:00
|
|
|
${if developerBuild then "-developer-build" else ""}
|
2011-12-24 22:52:08 +01:00
|
|
|
'';
|
|
|
|
|
2013-06-09 10:59:23 +02:00
|
|
|
# fix underspecified dependency in a generated makefile
|
2013-06-13 19:17:01 +02:00
|
|
|
postConfigure = stdenv.lib.optional developerBuild ''
|
2013-06-13 12:51:00 +02:00
|
|
|
sed "1iqtgradientview.h: .uic/release-shared/ui_qtgradientview.h" \
|
|
|
|
-i tools/designer/src/lib/Makefile
|
2013-06-09 10:59:23 +02:00
|
|
|
'';
|
|
|
|
|
2011-12-24 22:52:08 +01:00
|
|
|
propagatedBuildInputs =
|
|
|
|
[ libXrender libXrandr libXinerama libXcursor libXext libXfixes
|
2012-06-11 11:31:43 +02:00
|
|
|
libXv libXi libSM
|
|
|
|
]
|
2012-09-29 05:20:34 +02:00
|
|
|
++ optional (stdenv.lib.lists.elem stdenv.system stdenv.lib.platforms.mesaPlatforms) mesa
|
|
|
|
++ optional (buildWebkit || buildMultimedia) alsaLib
|
2012-03-17 21:57:28 +01:00
|
|
|
++ [ zlib libpng openssl dbus.libs freetype fontconfig glib ]
|
2012-09-29 05:20:34 +02:00
|
|
|
++ optionals (buildWebkit || buildMultimedia) [ gstreamer gst_plugins_base ];
|
2011-12-24 22:52:08 +01:00
|
|
|
|
|
|
|
# The following libraries are only used in plugins
|
2012-09-29 05:20:34 +02:00
|
|
|
buildInputs =
|
|
|
|
[ cups # Qt dlopen's libcups instead of linking to it
|
|
|
|
mysql postgresql sqlite libjpeg libmng libtiff icu ]
|
|
|
|
++ optionals gtkStyle [ gtk gdk_pixbuf ];
|
2011-12-24 22:52:08 +01:00
|
|
|
|
2012-12-28 19:20:09 +01:00
|
|
|
nativeBuildInputs = [ perl pkgconfig which ];
|
2011-12-24 22:52:08 +01:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2012-06-05 23:21:21 +02:00
|
|
|
crossAttrs = let
|
|
|
|
isMingw = stdenv.cross.config == "i686-pc-mingw32" ||
|
|
|
|
stdenv.cross.config == "x86_64-w64-mingw32";
|
|
|
|
in {
|
|
|
|
# I've not tried any case other than i686-pc-mingw32.
|
|
|
|
# -nomake tools: it fails linking some asian language symbols
|
|
|
|
# -no-svg: it fails to build on mingw64
|
|
|
|
configureFlags = ''
|
|
|
|
-static -release -confirm-license -opensource
|
|
|
|
-no-opengl -no-phonon
|
|
|
|
-no-svg
|
|
|
|
-make qmake -make libs -nomake tools
|
|
|
|
-nomake demos -nomake examples -nomake docs
|
2012-09-29 05:20:34 +02:00
|
|
|
'' + optionalString isMingw " -xplatform win32-g++-4.6";
|
2012-06-05 23:21:21 +02:00
|
|
|
patches = [];
|
|
|
|
preConfigure = ''
|
|
|
|
sed -i -e 's/ g++/ ${stdenv.cross.config}-g++/' \
|
|
|
|
-e 's/ gcc/ ${stdenv.cross.config}-gcc/' \
|
|
|
|
-e 's/ ar/ ${stdenv.cross.config}-ar/' \
|
|
|
|
-e 's/ strip/ ${stdenv.cross.config}-strip/' \
|
|
|
|
-e 's/ windres/ ${stdenv.cross.config}-windres/' \
|
|
|
|
mkspecs/win32-g++/qmake.conf
|
|
|
|
'';
|
|
|
|
|
|
|
|
# I don't know why it does not install qmake
|
|
|
|
postInstall = ''
|
|
|
|
cp bin/qmake* $out/bin
|
|
|
|
'';
|
|
|
|
dontSetConfigureCross = true;
|
|
|
|
dontStrip = true;
|
2012-09-29 05:20:34 +02:00
|
|
|
} // optionalAttrs isMingw {
|
2012-06-05 23:21:21 +02:00
|
|
|
propagatedBuildInputs = [ ];
|
2012-09-29 05:20:34 +02:00
|
|
|
};
|
2012-06-05 23:21:21 +02:00
|
|
|
|
2012-09-29 05:20:34 +02:00
|
|
|
meta = {
|
2012-10-18 11:09:10 +02:00
|
|
|
homepage = http://qt-project.org/;
|
2011-12-24 22:52:08 +01:00
|
|
|
description = "A cross-platform application framework for C++";
|
|
|
|
license = "GPL/LGPL";
|
2013-05-07 08:57:10 +02:00
|
|
|
maintainers = with maintainers; [ urkud sander phreedom ];
|
2011-12-24 22:52:08 +01:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|