qt58.qtbase: clean up configuration

This commit is contained in:
Thomas Tuegel 2017-04-16 12:31:05 -05:00
parent e4fb41cc5b
commit a579e0129c
No known key found for this signature in database
GPG Key ID: 22CBF5249D4B4D59

View File

@ -95,110 +95,124 @@ stdenv.mkDerivation {
# -no-eglfs, -no-directfb, -no-linuxfb and -no-kms because of the current minimalist mesa # -no-eglfs, -no-directfb, -no-linuxfb and -no-kms because of the current minimalist mesa
# TODO Remove obsolete and useless flags once the build will be totally mastered # TODO Remove obsolete and useless flags once the build will be totally mastered
configureFlags = '' configureFlags =
-verbose [
-confirm-license "-verbose"
-opensource "-confirm-license"
"-opensource"
-release "-release"
-shared "-shared"
${lib.optionalString developerBuild "-developer-build"} "-accessibility"
-accessibility "-optimized-qmake"
-optimized-qmake "-strip"
-strip "-no-reduce-relocations"
-no-reduce-relocations "-system-proxies"
-system-proxies "-pkg-config"
-pkg-config ]
++ lib.optional developerBuild "-developer-build"
-gui ++ [
-widgets "-gui"
-opengl desktop "-widgets"
-qml-debug "-opengl desktop"
-icu "-qml-debug"
-pch "-icu"
"-pch"
]
${lib.optionalString (!system-x86_64) "-no-sse2"} ++ [
-no-sse3 ''${lib.optionalString (!system-x86_64) "-no"}-sse2''
-no-ssse3 "-no-sse3"
-no-sse4.1 "-no-ssse3"
-no-sse4.2 "-no-sse4.1"
-no-avx "-no-sse4.2"
-no-avx2 "-no-avx"
-no-mips_dsp "-no-avx2"
-no-mips_dspr2 "-no-mips_dsp"
"-no-mips_dspr2"
]
-system-zlib ++ [
-system-libjpeg "-system-zlib"
-system-harfbuzz "-system-libjpeg"
-system-pcre "-system-harfbuzz"
-openssl-linked "-system-pcre"
"-openssl-linked"
"-system-sqlite"
''-${if mysql != null then "plugin" else "no"}-sql-mysql''
''-${if postgresql != null then "plugin" else "no"}-sql-psql''
-system-sqlite "-make libs"
-${if mysql != null then "plugin" else "no"}-sql-mysql "-make tools"
-${if postgresql != null then "plugin" else "no"}-sql-psql ''-${lib.optionalString (buildExamples == false) "no"}make examples''
''-${lib.optionalString (buildTests == false) "no"}make tests''
"-v"
]
-make libs ++ lib.optionals (!stdenv.isDarwin) [
-make tools "-rpath"
-${lib.optionalString (buildExamples == false) "no"}make examples "-glib"
-${lib.optionalString (buildTests == false) "no"}make tests "-xcb"
-v "-qpa xcb"
'' + lib.optionalString (!stdenv.isDarwin) '' ''-${lib.optionalString (cups == null) "no-"}cups''
-rpath
-glib
-xcb
-qpa xcb
-${lib.optionalString (cups == null) "no-"}cups "-no-eglfs"
"-no-directfb"
"-no-linuxfb"
"-no-kms"
-no-eglfs "-libinput"
-no-directfb "-gtk"
-no-linuxfb "-system-libpng"
-no-kms "-system-xcb"
"-system-xkbcommon"
"-dbus-linked"
]
-libinput ++ lib.optionals stdenv.isDarwin [
-gtk "-platform macx-clang"
-system-libpng "-no-use-gold-linker"
-system-xcb "-no-fontconfig"
-system-xkbcommon "-qt-freetype"
-dbus-linked "-qt-libpng"
'' + lib.optionalString stdenv.isDarwin '' ];
-platform macx-clang
-no-use-gold-linker
-no-fontconfig
-qt-freetype
-qt-libpng
'';
# PostgreSQL autodetection fails sporadically because Qt omits the "-lpq" flag # PostgreSQL autodetection fails sporadically because Qt omits the "-lpq" flag
# if dependency paths contain the string "pq", which can occur in the hash. # if dependency paths contain the string "pq", which can occur in the hash.
# To prevent these failures, we need to override PostgreSQL detection. # To prevent these failures, we need to override PostgreSQL detection.
PSQL_LIBS = lib.optionalString (postgresql != null) "-L${postgresql.lib}/lib -lpq"; PSQL_LIBS = lib.optionalString (postgresql != null) "-L${postgresql.lib}/lib -lpq";
propagatedBuildInputs = [ propagatedBuildInputs =
libxml2 libxslt openssl pcre16 sqlite zlib [
libxml2 libxslt openssl pcre16 sqlite zlib
# Text rendering # Text rendering
harfbuzz icu harfbuzz icu
# Image formats # Image formats
libjpeg libpng libtiff libjpeg libpng libtiff
] ]
++ lib.optional mesaSupported mesa
++ lib.optionals (!stdenv.isDarwin) [
dbus glib udev
# Text rendering ++ lib.optional mesaSupported mesa
fontconfig freetype
# X11 libs ++ lib.optionals (!stdenv.isDarwin) [
libX11 libXcomposite libXext libXi libXrender libxcb libxkbcommon xcbutil dbus glib udev
xcbutilimage xcbutilkeysyms xcbutilrenderutil xcbutilwm
] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ # Text rendering
AGL AppKit ApplicationServices Carbon Cocoa fontconfig freetype
CoreAudio CoreBluetooth CoreLocation CoreServices
DiskArbitration Foundation OpenGL # X11 libs
darwin.cf-private darwin.libobjc libiconv libX11 libXcomposite libXext libXi libXrender libxcb libxkbcommon xcbutil
]); xcbutilimage xcbutilkeysyms xcbutilrenderutil xcbutilwm
]
++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
AGL AppKit ApplicationServices Carbon Cocoa
CoreAudio CoreBluetooth CoreLocation CoreServices
DiskArbitration Foundation OpenGL
darwin.cf-private darwin.libobjc libiconv
]);
buildInputs = [ ] buildInputs = [ ]
++ lib.optionals (!stdenv.isDarwin) [ gtk3 libinput ] ++ lib.optionals (!stdenv.isDarwin) [ gtk3 libinput ]
@ -207,7 +221,9 @@ stdenv.mkDerivation {
++ lib.optional (mysql != null) mysql.lib ++ lib.optional (mysql != null) mysql.lib
++ lib.optional (postgresql != null) postgresql; ++ lib.optional (postgresql != null) postgresql;
nativeBuildInputs = [ bison flex gperf lndir perl pkgconfig python2 ] ++ lib.optional (!stdenv.isDarwin) patchelf; nativeBuildInputs =
[ bison flex gperf lndir perl pkgconfig python2 ]
++ lib.optional (!stdenv.isDarwin) patchelf;
# freetype-2.5.4 changed signedness of some struct fields # freetype-2.5.4 changed signedness of some struct fields
NIX_CFLAGS_COMPILE = NIX_CFLAGS_COMPILE =
@ -222,8 +238,10 @@ stdenv.mkDerivation {
then ''-DNIXPKGS_LIBDBUS="${dbus.lib}/lib/libdbus-1"'' then ''-DNIXPKGS_LIBDBUS="${dbus.lib}/lib/libdbus-1"''
else ''-DNIXPKGS_LIBDBUS=""'') else ''-DNIXPKGS_LIBDBUS=""'')
] ]
++ lib.optional mesaSupported ++ lib.optional mesaSupported
''-DNIXPKGS_MESA_GL="${mesa.out}/lib/libGL"'' ''-DNIXPKGS_MESA_GL="${mesa.out}/lib/libGL"''
++ lib.optionals stdenv.isDarwin ++ lib.optionals stdenv.isDarwin
[ [
"-D__MAC_OS_X_VERSION_MAX_ALLOWED=1090" "-D__MAC_OS_X_VERSION_MAX_ALLOWED=1090"
@ -269,11 +287,13 @@ stdenv.mkDerivation {
popd popd
fi fi
'' ''
# fixup .pc file (where to find 'moc' etc.) # fixup .pc file (where to find 'moc' etc.)
+ lib.optionalString (!stdenv.isDarwin) '' + lib.optionalString (!stdenv.isDarwin) ''
sed -i "$dev/lib/pkgconfig/Qt5Core.pc" \ sed -i "$dev/lib/pkgconfig/Qt5Core.pc" \
-e "/^host_bins=/ c host_bins=$dev/bin" -e "/^host_bins=/ c host_bins=$dev/bin"
'' ''
# Don' move .prl files on darwin because they end up in # Don' move .prl files on darwin because they end up in
# "dev/lib/Foo.framework/Foo.prl" which interferes with subsequent # "dev/lib/Foo.framework/Foo.prl" which interferes with subsequent
# use of lndir in the qtbase setup-hook. On Linux, the .prl files # use of lndir in the qtbase setup-hook. On Linux, the .prl files