qt-{3,4.8}: Clean up generally

This commit is contained in:
John Ericson 2018-07-24 16:25:18 -04:00
parent 25348b27c5
commit eeb9837beb
2 changed files with 56 additions and 46 deletions

View File

@ -30,31 +30,38 @@ stdenv.mkDerivation {
};
nativeBuildInputs = [ which ];
propagatedBuildInputs = [libpng xlibsWrapper libXft libXrender zlib libjpeg];
buildInputs = [
xextproto
] ++ stdenv.lib.optionals openglSupport [
libGLU_combined libXmu
] ++ stdenv.lib.optionals xftSupport [
libXft libXft.freetype libXft.fontconfig
] ++ stdenv.lib.optional xrenderSupport libXrender
++ stdenv.lib.optional xineramaSupport libXinerama
++ stdenv.lib.optional xrandrSupport libXrandr
++ stdenv.lib.optional xineramaSupport libXinerama;
propagatedBuildInputs = [ libpng xlibsWrapper libXft libXrender zlib libjpeg ];
hardeningDisable = [ "format" ];
configureFlags = "
-v
-system-zlib -system-libpng -system-libjpeg
-qt-gif
-I${xextproto}/include
${if openglSupport then "-dlopen-opengl
-L${libGLU_combined}/lib -I${libGLU_combined}/include
-L${libXmu.out}/lib -I${libXmu.dev}/include" else ""}
${if threadSupport then "-thread" else "-no-thread"}
${if xrenderSupport then "-xrender -L${libXrender.out}/lib -I${libXrender.dev}/include" else "-no-xrender"}
${if xrandrSupport then "-xrandr
-L${libXrandr.out}/lib -I${libXrandr.dev}/include
-I${randrproto}/include" else "-no-xrandr"}
${if xineramaSupport then "-xinerama -L${libXinerama.out}/lib -I${libXinerama.dev}/include" else "-no-xinerama"}
${if cursorSupport then "-L${libXcursor.out}/lib -I${libXcursor.dev}/include" else ""}
${if mysqlSupport then "-qt-sql-mysql -L${mysql.connector-c}/lib/mysql -I${mysql.connector-c}/include/mysql" else ""}
${if xftSupport then "-xft
-L${libXft.out}/lib -I${libXft.dev}/include
-L${libXft.freetype.out}/lib -I${libXft.freetype.dev}/include
-L${libXft.fontconfig.lib}/lib -I${libXft.fontconfig.dev}/include" else "-no-xft"}
";
configurePlatforms = [];
configureFlags = let
mk = cond: name: "-${stdenv.lib.optionalString cond "no-"}${name}";
in [
"-v"
"-system-zlib" "-system-libpng" "-system-libjpeg"
"-qt-gif"
(mk xftSupport "xft")
(mk xrenderSupport "xrender")
(mk xrandrSupport "xrandr")
(mk xineramaSupport "xinerama")
(mk threadSupport "thread")
] ++ stdenv.lib.optionals mysqlSupport [
"-qt-sql-mysql"
"-L${mysql.connector-c}/lib/mysql"
"-I${mysql.connector-c}/include/mysql"
] ++ stdenv.lib.optional openglSupport "-dlopen-opengl";
patches = [
# Don't strip everything so we can get useful backtraces.

View File

@ -6,7 +6,7 @@
, buildMultimedia ? stdenv.isLinux, alsaLib, gstreamer, gst-plugins-base
, buildWebkit ? (stdenv.isLinux || stdenv.isDarwin)
, flashplayerFix ? false, gdk_pixbuf
, gtkStyle ? true, gtk2
, gtkStyle ? stdenv.hostPlatform == stdenv.buildPlatform, gtk2
, gnomeStyle ? false, libgnomeui, GConf, gnome_vfs
, developerBuild ? false
, docs ? false
@ -139,37 +139,40 @@ stdenv.mkDerivation rec {
prefixKey = "-prefix ";
${if stdenv.hostPlatform == stdenv.buildPlatform then null else "configurePlatforms"} = [];
configurePlatforms = [];
configureFlags = let
mk = cond: name: "-${lib.optionalString cond "no-"}${name}";
platformFlag =
if stdenv.hostPlatform != stdenv.buildPlatform
then "-xplatform"
else "-platform";
in (if stdenv.hostPlatform == stdenv.buildPlatform then ''
-v -no-separate-debug-info -release -fast -confirm-license -opensource
in (if stdenv.hostPlatform != stdenv.buildPlatform then [
# 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
"-static" "-release" "-confirm-license" "-opensource"
"-no-opengl" "-no-phonon"
"-no-svg"
"-make" "qmake" "-make" "libs" "-nomake" "tools"
] else [
"-v" "-no-separate-debug-info" "-release" "-fast" "-confirm-license" "-opensource"
-${if stdenv.isFreeBSD then "no-" else ""}opengl -xrender -xrandr -xinerama -xcursor -xinput -xfixes -fontconfig
-qdbus -${if cups == null then "no-" else ""}cups -glib -dbus-linked -openssl-linked
(mk (!stdenv.isFreeBSD) "opengl") "-xrender" "-xrandr" "-xinerama" "-xcursor" "-xinput" "-xfixes" "-fontconfig"
"-qdbus" (mk (cups != null) "cups") "-glib" "-dbus-linked" "-openssl-linked"
${if mysql != null then "-plugin" else "-no"}-sql-mysql -system-sqlite
"-${if mysql != null then "plugin" else "no"}-sql-mysql" "-system-sqlite"
-exceptions -xmlpatterns
"-exceptions" "-xmlpatterns"
-make libs -make tools -make translations
-${if demos then "" else "no"}make demos
-${if examples then "" else "no"}make examples
-${if docs then "" else "no"}make docs
-no-phonon ${if buildWebkit then "" else "-no"}-webkit ${if buildMultimedia then "" else "-no"}-multimedia -audio-backend
${if developerBuild then "-developer-build" else ""}
'' else ''
-static -release -confirm-license -opensource
-no-opengl -no-phonon
-no-svg
-make qmake -make libs -nomake tools
-nomake demos -nomake examples -nomake docs
'') + lib.optionalString stdenv.hostPlatform.isDarwin "${platformFlag} unsupported/macx-clang-libc++"
+ lib.optionalString stdenv.hostPlatform.isMinGW "${platformFlag} win32-g++-4.6";
"-make" "libs" "-make" "tools" "-make" "translations"
"-no-phonon" (mk buildWebkit "webkit") (mk buildMultimedia "multimedia") "-audio-backend"
]) ++ [
(mk demos "make") "demos"
(mk examples "make") "examples"
(mk docs "make") "docs"
] ++ lib.optional developerBuild "-developer-build"
++ lib.optionals stdenv.hostPlatform.isDarwin [ platformFlag "unsupported/macx-clang-libc++" ]
++ lib.optionals stdenv.hostPlatform.isWindows [ platformFlag "win32-g++-4.6" ];
propagatedBuildInputs =
[ libXrender libXrandr libXinerama libXcursor libXext libXfixes libXv libXi
@ -219,7 +222,7 @@ stdenv.mkDerivation rec {
cp bin/qmake* $out/bin
'';
dontStrip = if stdenv.hostPlatform == stdenv.buildPlatform then null else true;
dontStrip = stdenv.hostPlatform != stdenv.buildPlatform;
meta = {
homepage = http://qt-project.org/;