Skip to content

Commit

Permalink
qt-{3,4.8}: Clean up generally
Browse files Browse the repository at this point in the history
  • Loading branch information
Ericson2314 committed Aug 2, 2018
1 parent 25348b2 commit eeb9837
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 50 deletions.
51 changes: 29 additions & 22 deletions pkgs/development/libraries/qt-3/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
59 changes: 31 additions & 28 deletions pkgs/development/libraries/qt-4.x/4.8/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
-${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
${if mysql != null then "-plugin" else "-no"}-sql-mysql -system-sqlite
-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";
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"

(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"

"-exceptions" "-xmlpatterns"

"-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
Expand Down Expand Up @@ -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/;
Expand Down

0 comments on commit eeb9837

Please sign in to comment.