From a53f129c45d32752502faef2f649e95ec0f77a56 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Fri, 14 Apr 2017 06:31:19 -0500 Subject: [PATCH 01/32] kwin: install service type aliases for broken packages Some package(s) refer to kwin service types by the wrong names. I would prefer to patch those packages, but I cannot find them! --- pkgs/desktops/plasma-5/kwin/default.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/desktops/plasma-5/kwin/default.nix b/pkgs/desktops/plasma-5/kwin/default.nix index 01f90664276e..a14b6433a76e 100644 --- a/pkgs/desktops/plasma-5/kwin/default.nix +++ b/pkgs/desktops/plasma-5/kwin/default.nix @@ -30,4 +30,12 @@ plasmaPackage { --subst-var-by xwayland ${lib.getBin xwayland}/bin/Xwayland ''; cmakeFlags = [ "-DCMAKE_SKIP_BUILD_RPATH=OFF" ]; + postInstall = '' + # Some package(s) refer to these service types by the wrong name. + # I would prefer to patch those packages, but I cannot find them! + ln -s $out/share/kservicetypes5/kwineffect.desktop \ + $out/share/kservicetypes5/kwin-effect.desktop + ln -s $out/share/kservicetypes5/kwinscript.desktop \ + $out/share/kservicetypes5/kwin-script.desktop + ''; } From c4c614c23247a301bd1936faaaca38a38bfcc074 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Fri, 14 Apr 2017 05:39:38 -0500 Subject: [PATCH 02/32] libkscreen: hardcode backends path libkscreen provides all available kscreen backends, so there is no reason to search the environment for plugins. --- pkgs/desktops/plasma-5/default.nix | 2 +- pkgs/desktops/plasma-5/libkscreen.nix | 15 ----------- pkgs/desktops/plasma-5/libkscreen/default.nix | 19 +++++++++++++ .../libkscreen/libkscreen-backends-path.patch | 27 +++++++++++++++++++ pkgs/desktops/plasma-5/libkscreen/series | 1 + 5 files changed, 48 insertions(+), 16 deletions(-) delete mode 100644 pkgs/desktops/plasma-5/libkscreen.nix create mode 100644 pkgs/desktops/plasma-5/libkscreen/default.nix create mode 100644 pkgs/desktops/plasma-5/libkscreen/libkscreen-backends-path.patch create mode 100644 pkgs/desktops/plasma-5/libkscreen/series diff --git a/pkgs/desktops/plasma-5/default.nix b/pkgs/desktops/plasma-5/default.nix index 0cb25a315d6e..1a8f1ed064b0 100644 --- a/pkgs/desktops/plasma-5/default.nix +++ b/pkgs/desktops/plasma-5/default.nix @@ -62,7 +62,7 @@ let kwayland-integration = callPackage ./kwayland-integration.nix {}; kwin = callPackage ./kwin {}; kwrited = callPackage ./kwrited.nix {}; - libkscreen = callPackage ./libkscreen.nix {}; + libkscreen = callPackage ./libkscreen {}; libksysguard = callPackage ./libksysguard {}; milou = callPackage ./milou.nix {}; oxygen = callPackage ./oxygen.nix {}; diff --git a/pkgs/desktops/plasma-5/libkscreen.nix b/pkgs/desktops/plasma-5/libkscreen.nix deleted file mode 100644 index 4e04fd5ed1d9..000000000000 --- a/pkgs/desktops/plasma-5/libkscreen.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ plasmaPackage -, extra-cmake-modules -, kwayland, libXrandr -, qtx11extras -}: - -plasmaPackage { - name = "libkscreen"; - nativeBuildInputs = [ - extra-cmake-modules - ]; - propagatedBuildInputs = [ - kwayland libXrandr qtx11extras - ]; -} diff --git a/pkgs/desktops/plasma-5/libkscreen/default.nix b/pkgs/desktops/plasma-5/libkscreen/default.nix new file mode 100644 index 000000000000..afb2c20e90cc --- /dev/null +++ b/pkgs/desktops/plasma-5/libkscreen/default.nix @@ -0,0 +1,19 @@ +{ plasmaPackage, lib, copyPathsToStore +, extra-cmake-modules +, kwayland, libXrandr +, qtx11extras +}: + +plasmaPackage { + name = "libkscreen"; + nativeBuildInputs = [ + extra-cmake-modules + ]; + propagatedBuildInputs = [ + kwayland libXrandr qtx11extras + ]; + patches = copyPathsToStore (lib.readPathsFromFile ./. ./series); + preConfigure = '' + NIX_CFLAGS_COMPILE+=" -DNIXPKGS_LIBKSCREEN_BACKENDS=\"''${!outputLib}/lib/qt5/plugins/kf5/kscreen\"" + ''; +} diff --git a/pkgs/desktops/plasma-5/libkscreen/libkscreen-backends-path.patch b/pkgs/desktops/plasma-5/libkscreen/libkscreen-backends-path.patch new file mode 100644 index 000000000000..9d3cf49b9cd1 --- /dev/null +++ b/pkgs/desktops/plasma-5/libkscreen/libkscreen-backends-path.patch @@ -0,0 +1,27 @@ +Index: libkscreen-5.9.4/src/backendmanager.cpp +=================================================================== +--- libkscreen-5.9.4.orig/src/backendmanager.cpp ++++ libkscreen-5.9.4/src/backendmanager.cpp +@@ -178,17 +178,11 @@ QFileInfo BackendManager::preferredBacke + QFileInfoList BackendManager::listBackends() + { + // Compile a list of installed backends first +- const QString backendFilter = QStringLiteral("KSC_*"); +- const QStringList paths = QCoreApplication::libraryPaths(); +- QFileInfoList finfos; +- for (const QString &path : paths) { +- const QDir dir(path + QLatin1String("/kf5/kscreen/"), +- backendFilter, +- QDir::SortFlags(QDir::QDir::Name), +- QDir::NoDotAndDotDot | QDir::Files); +- finfos.append(dir.entryInfoList()); +- } +- return finfos; ++ const QDir dir(QStringLiteral(NIXPKGS_LIBKSCREEN_BACKENDS), ++ QStringLiteral("KSC_*"), ++ QDir::SortFlags(QDir::QDir::Name), ++ QDir::NoDotAndDotDot | QDir::Files); ++ return dir.entryInfoList(); + } + + KScreen::AbstractBackend *BackendManager::loadBackendPlugin(QPluginLoader *loader, const QString &name, diff --git a/pkgs/desktops/plasma-5/libkscreen/series b/pkgs/desktops/plasma-5/libkscreen/series new file mode 100644 index 000000000000..86bf4ab10602 --- /dev/null +++ b/pkgs/desktops/plasma-5/libkscreen/series @@ -0,0 +1 @@ +libkscreen-backends-path.patch From 44eb84feb66d0ea52fb31796917c30f8f8d154bb Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Sat, 15 Apr 2017 11:11:32 -0500 Subject: [PATCH 03/32] qt58.qtbase: Update patch offsets --- .../qt-5/5.8/qtbase/compose-search-path.patch | 10 +++++----- .../libraries/qt-5/5.8/qtbase/dlopen-openssl.patch | 10 +++++----- .../libraries/qt-5/5.8/qtbase/dlopen-resolv.patch | 14 +++++++------- .../libraries/qt-5/5.8/qtbase/libressl.patch | 10 +++++----- .../5.8/qtbase/nix-profiles-library-paths.patch | 8 ++++---- .../libraries/qt-5/5.8/qtbase/tzdir.patch | 10 +++++----- .../qt-5/5.8/qtbase/xdg-config-dirs.patch | 14 +++++++------- 7 files changed, 38 insertions(+), 38 deletions(-) diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/compose-search-path.patch b/pkgs/development/libraries/qt-5/5.8/qtbase/compose-search-path.patch index a0e344a7bc68..5b212c099650 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtbase/compose-search-path.patch +++ b/pkgs/development/libraries/qt-5/5.8/qtbase/compose-search-path.patch @@ -1,9 +1,9 @@ -Index: qtbase-opensource-src-5.7.0/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp +Index: qtbase-opensource-src-5.8.0/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp =================================================================== ---- qtbase-opensource-src-5.7.0.orig/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp -+++ qtbase-opensource-src-5.7.0/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp -@@ -257,10 +257,7 @@ void TableGenerator::initPossibleLocatio - // the QTCOMPOSE environment variable +--- qtbase-opensource-src-5.8.0.orig/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp ++++ qtbase-opensource-src-5.8.0/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp +@@ -258,10 +258,7 @@ void TableGenerator::initPossibleLocatio + m_possibleLocations.reserve(7); if (qEnvironmentVariableIsSet("QTCOMPOSE")) m_possibleLocations.append(QString::fromLocal8Bit(qgetenv("QTCOMPOSE"))); - m_possibleLocations.append(QStringLiteral("/usr/share/X11/locale")); diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/dlopen-openssl.patch b/pkgs/development/libraries/qt-5/5.8/qtbase/dlopen-openssl.patch index 9891bfeac5bf..46600e7f4262 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtbase/dlopen-openssl.patch +++ b/pkgs/development/libraries/qt-5/5.8/qtbase/dlopen-openssl.patch @@ -1,8 +1,8 @@ -Index: qtbase-opensource-src-5.7.0/src/network/ssl/qsslsocket_openssl_symbols.cpp +Index: qtbase-opensource-src-5.8.0/src/network/ssl/qsslsocket_openssl_symbols.cpp =================================================================== ---- qtbase-opensource-src-5.7.0.orig/src/network/ssl/qsslsocket_openssl_symbols.cpp -+++ qtbase-opensource-src-5.7.0/src/network/ssl/qsslsocket_openssl_symbols.cpp -@@ -658,8 +658,8 @@ static QPair loadO +--- qtbase-opensource-src-5.8.0.orig/src/network/ssl/qsslsocket_openssl_symbols.cpp ++++ qtbase-opensource-src-5.8.0/src/network/ssl/qsslsocket_openssl_symbols.cpp +@@ -681,8 +681,8 @@ static QPair loadO #endif #if defined(SHLIB_VERSION_NUMBER) && !defined(Q_OS_QNX) // on QNX, the libs are always libssl.so and libcrypto.so // first attempt: the canonical name is libssl.so. @@ -13,7 +13,7 @@ Index: qtbase-opensource-src-5.7.0/src/network/ssl/qsslsocket_openssl_symbols.cp if (libcrypto->load() && libssl->load()) { // libssl.so. and libcrypto.so. found return pair; -@@ -676,8 +676,8 @@ static QPair loadO +@@ -699,8 +699,8 @@ static QPair loadO // OS X's /usr/lib/libssl.dylib, /usr/lib/libcrypto.dylib will be picked up in the third // attempt, _after_ /Contents/Frameworks has been searched. // iOS does not ship a system libssl.dylib, libcrypto.dylib in the first place. diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/dlopen-resolv.patch b/pkgs/development/libraries/qt-5/5.8/qtbase/dlopen-resolv.patch index 98a3610f5fbd..1df27377658d 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtbase/dlopen-resolv.patch +++ b/pkgs/development/libraries/qt-5/5.8/qtbase/dlopen-resolv.patch @@ -1,8 +1,8 @@ -Index: qtbase-opensource-src-5.7.0/src/network/kernel/qdnslookup_unix.cpp +Index: qtbase-opensource-src-5.8.0/src/network/kernel/qdnslookup_unix.cpp =================================================================== ---- qtbase-opensource-src-5.7.0.orig/src/network/kernel/qdnslookup_unix.cpp -+++ qtbase-opensource-src-5.7.0/src/network/kernel/qdnslookup_unix.cpp -@@ -85,7 +85,7 @@ static bool resolveLibraryInternal() +--- qtbase-opensource-src-5.8.0.orig/src/network/kernel/qdnslookup_unix.cpp ++++ qtbase-opensource-src-5.8.0/src/network/kernel/qdnslookup_unix.cpp +@@ -90,7 +90,7 @@ static bool resolveLibraryInternal() if (!lib.load()) #endif { @@ -11,10 +11,10 @@ Index: qtbase-opensource-src-5.7.0/src/network/kernel/qdnslookup_unix.cpp if (!lib.load()) return false; } -Index: qtbase-opensource-src-5.7.0/src/network/kernel/qhostinfo_unix.cpp +Index: qtbase-opensource-src-5.8.0/src/network/kernel/qhostinfo_unix.cpp =================================================================== ---- qtbase-opensource-src-5.7.0.orig/src/network/kernel/qhostinfo_unix.cpp -+++ qtbase-opensource-src-5.7.0/src/network/kernel/qhostinfo_unix.cpp +--- qtbase-opensource-src-5.8.0.orig/src/network/kernel/qhostinfo_unix.cpp ++++ qtbase-opensource-src-5.8.0/src/network/kernel/qhostinfo_unix.cpp @@ -100,7 +100,7 @@ static bool resolveLibraryInternal() if (!lib.load()) #endif diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/libressl.patch b/pkgs/development/libraries/qt-5/5.8/qtbase/libressl.patch index 4390db977a71..e9c60e7ab076 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtbase/libressl.patch +++ b/pkgs/development/libraries/qt-5/5.8/qtbase/libressl.patch @@ -9,11 +9,11 @@ is defined in openssl, but not in libressl. src/network/ssl/qsslcontext_openssl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -Index: qtbase-opensource-src-5.7.0/src/network/ssl/qsslcontext_openssl.cpp +Index: qtbase-opensource-src-5.8.0/src/network/ssl/qsslcontext_openssl.cpp =================================================================== ---- qtbase-opensource-src-5.7.0.orig/src/network/ssl/qsslcontext_openssl.cpp -+++ qtbase-opensource-src-5.7.0/src/network/ssl/qsslcontext_openssl.cpp -@@ -347,7 +347,7 @@ init_context: +--- qtbase-opensource-src-5.8.0.orig/src/network/ssl/qsslcontext_openssl.cpp ++++ qtbase-opensource-src-5.8.0/src/network/ssl/qsslcontext_openssl.cpp +@@ -351,7 +351,7 @@ init_context: const QVector qcurves = sslContext->sslConfiguration.ellipticCurves(); if (!qcurves.isEmpty()) { @@ -22,7 +22,7 @@ Index: qtbase-opensource-src-5.7.0/src/network/ssl/qsslcontext_openssl.cpp // Set the curves to be used if (q_SSLeay() >= 0x10002000L) { // SSL_CTX_ctrl wants a non-const pointer as last argument, -@@ -360,7 +360,7 @@ init_context: +@@ -364,7 +364,7 @@ init_context: sslContext->errorCode = QSslError::UnspecifiedError; } } else diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/nix-profiles-library-paths.patch b/pkgs/development/libraries/qt-5/5.8/qtbase/nix-profiles-library-paths.patch index ebaf3651a6d0..c5d91066d8f6 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtbase/nix-profiles-library-paths.patch +++ b/pkgs/development/libraries/qt-5/5.8/qtbase/nix-profiles-library-paths.patch @@ -1,8 +1,8 @@ -Index: qtbase-opensource-src-5.7.0/src/corelib/kernel/qcoreapplication.cpp +Index: qtbase-opensource-src-5.8.0/src/corelib/kernel/qcoreapplication.cpp =================================================================== ---- qtbase-opensource-src-5.7.0.orig/src/corelib/kernel/qcoreapplication.cpp -+++ qtbase-opensource-src-5.7.0/src/corelib/kernel/qcoreapplication.cpp -@@ -2487,7 +2487,17 @@ QStringList QCoreApplication::libraryPat +--- qtbase-opensource-src-5.8.0.orig/src/corelib/kernel/qcoreapplication.cpp ++++ qtbase-opensource-src-5.8.0/src/corelib/kernel/qcoreapplication.cpp +@@ -2476,7 +2476,17 @@ QStringList QCoreApplication::libraryPat QStringList *app_libpaths = new QStringList; coreappdata()->app_libpaths.reset(app_libpaths); diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/tzdir.patch b/pkgs/development/libraries/qt-5/5.8/qtbase/tzdir.patch index f4056dd9cc97..f48ac761ccf2 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtbase/tzdir.patch +++ b/pkgs/development/libraries/qt-5/5.8/qtbase/tzdir.patch @@ -1,8 +1,8 @@ -Index: qtbase-opensource-src-5.7.0/src/corelib/tools/qtimezoneprivate_tz.cpp +Index: qtbase-opensource-src-5.8.0/src/corelib/tools/qtimezoneprivate_tz.cpp =================================================================== ---- qtbase-opensource-src-5.7.0.orig/src/corelib/tools/qtimezoneprivate_tz.cpp -+++ qtbase-opensource-src-5.7.0/src/corelib/tools/qtimezoneprivate_tz.cpp -@@ -68,7 +68,10 @@ typedef QHash Q +--- qtbase-opensource-src-5.8.0.orig/src/corelib/tools/qtimezoneprivate_tz.cpp ++++ qtbase-opensource-src-5.8.0/src/corelib/tools/qtimezoneprivate_tz.cpp +@@ -70,7 +70,10 @@ typedef QHash Q // Parse zone.tab table, assume lists all installed zones, if not will need to read directories static QTzTimeZoneHash loadTzTimeZones() { @@ -14,7 +14,7 @@ Index: qtbase-opensource-src-5.7.0/src/corelib/tools/qtimezoneprivate_tz.cpp if (!QFile::exists(path)) path = QStringLiteral("/usr/lib/zoneinfo/zone.tab"); -@@ -566,12 +569,18 @@ void QTzTimeZonePrivate::init(const QByt +@@ -642,12 +645,18 @@ void QTzTimeZonePrivate::init(const QByt if (!tzif.open(QIODevice::ReadOnly)) return; } else { diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/xdg-config-dirs.patch b/pkgs/development/libraries/qt-5/5.8/qtbase/xdg-config-dirs.patch index 1f2f316c5b26..b5c21f064a42 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtbase/xdg-config-dirs.patch +++ b/pkgs/development/libraries/qt-5/5.8/qtbase/xdg-config-dirs.patch @@ -1,8 +1,8 @@ -Index: qtbase-opensource-src-5.7.0/src/corelib/io/qsettings.cpp +Index: qtbase-opensource-src-5.8.0/src/corelib/io/qsettings.cpp =================================================================== ---- qtbase-opensource-src-5.7.0.orig/src/corelib/io/qsettings.cpp -+++ qtbase-opensource-src-5.7.0/src/corelib/io/qsettings.cpp -@@ -1161,6 +1161,23 @@ QConfFileSettingsPrivate::QConfFileSetti +--- qtbase-opensource-src-5.8.0.orig/src/corelib/io/qsettings.cpp ++++ qtbase-opensource-src-5.8.0/src/corelib/io/qsettings.cpp +@@ -1134,6 +1134,23 @@ QConfFileSettingsPrivate::QConfFileSetti confFiles[F_System | F_Application].reset(QConfFile::fromName(systemPath + appFile, false)); confFiles[F_System | F_Organization].reset(QConfFile::fromName(systemPath + orgFile, false)); @@ -26,10 +26,10 @@ Index: qtbase-opensource-src-5.7.0/src/corelib/io/qsettings.cpp for (i = 0; i < NumConfFiles; ++i) { if (confFiles[i]) { spec = i; -Index: qtbase-opensource-src-5.7.0/src/corelib/io/qsettings_p.h +Index: qtbase-opensource-src-5.8.0/src/corelib/io/qsettings_p.h =================================================================== ---- qtbase-opensource-src-5.7.0.orig/src/corelib/io/qsettings_p.h -+++ qtbase-opensource-src-5.7.0/src/corelib/io/qsettings_p.h +--- qtbase-opensource-src-5.8.0.orig/src/corelib/io/qsettings_p.h ++++ qtbase-opensource-src-5.8.0/src/corelib/io/qsettings_p.h @@ -246,7 +246,7 @@ public: F_Organization = 0x1, F_User = 0x0, From 2ce3fe0a7143737f0f42ddda92676a6169101ae8 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Sat, 15 Apr 2017 11:12:11 -0500 Subject: [PATCH 04/32] qt58.qtbase: Fix QT_QPA_PLATFORM_PLUGIN_PATH The default installation path for QPA plugins is appended to QT_QPA_PLATFORM_PLUGIN_PATH, making it unnecessary to wrap some applications and preventing applications from loading platform plugins from the wrong Qt version. --- .../libraries/qt-5/5.8/qtbase/default.nix | 19 ++++++++++++++----- .../qt-5/5.8/qtbase/qpa-plugin-path.patch | 15 +++++++++++++++ .../libraries/qt-5/5.8/qtbase/series | 1 + 3 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 pkgs/development/libraries/qt-5/5.8/qtbase/qpa-plugin-path.patch diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix b/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix index be35032785d9..570d61b4420e 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix +++ b/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix @@ -106,6 +106,8 @@ stdenv.mkDerivation { -importdir $out/lib/qt5/imports \ -qmldir $out/lib/qt5/qml \ -docdir $out/share/doc/qt5" + + NIX_CFLAGS_COMPILE+=" -DNIXPKGS_QPA_PLATFORM_PLUGIN_PATH=\"''${!outputLib}/lib/qt5/plugins\"" ''; prefixKey = "-prefix "; @@ -227,11 +229,18 @@ stdenv.mkDerivation { nativeBuildInputs = [ bison flex gperf lndir perl pkgconfig python2 ] ++ lib.optional (!stdenv.isDarwin) patchelf; # freetype-2.5.4 changed signedness of some struct fields - NIX_CFLAGS_COMPILE = "-Wno-error=sign-compare" - + lib.optionalString stdenv.isDarwin " -D__MAC_OS_X_VERSION_MAX_ALLOWED=1090 -D__AVAILABILITY_INTERNAL__MAC_10_10=__attribute__((availability(macosx,introduced=10.10)))"; - # Note that nixpkgs's objc4 is from macOS 10.11 while the SDK is - # 10.9 which necessitates the above macro definition that mentions - # 10.10 + NIX_CFLAGS_COMPILE = + [ + "-Wno-error=sign-compare" + ] + ++ lib.optionals stdenv.isDarwin + [ + "-D__MAC_OS_X_VERSION_MAX_ALLOWED=1090" + "-D__AVAILABILITY_INTERNAL__MAC_10_10=__attribute__((availability(macosx,introduced=10.10)))" + # Note that nixpkgs's objc4 is from macOS 10.11 while the SDK is + # 10.9 which necessitates the above macro definition that mentions + # 10.10 + ]; postInstall = '' find "$out" -name "*.cmake" | while read file; do diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/qpa-plugin-path.patch b/pkgs/development/libraries/qt-5/5.8/qtbase/qpa-plugin-path.patch new file mode 100644 index 000000000000..6d40ed19c00a --- /dev/null +++ b/pkgs/development/libraries/qt-5/5.8/qtbase/qpa-plugin-path.patch @@ -0,0 +1,15 @@ +Index: qtbase-opensource-src-5.8.0/src/gui/kernel/qguiapplication.cpp +=================================================================== +--- qtbase-opensource-src-5.8.0.orig/src/gui/kernel/qguiapplication.cpp ++++ qtbase-opensource-src-5.8.0/src/gui/kernel/qguiapplication.cpp +@@ -1217,6 +1217,10 @@ void QGuiApplicationPrivate::createPlatf + + // Load the platform integration + QString platformPluginPath = QString::fromLocal8Bit(qgetenv("QT_QPA_PLATFORM_PLUGIN_PATH")); ++ if (!platformPluginPath.isEmpty()) { ++ platformPluginPath.append(QStringLiteral(":")); ++ } ++ platformPluginPath.append(QStringLiteral(NIXPKGS_QPA_PLATFORM_PLUGIN_PATH)); + + + QByteArray platformName; diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/series b/pkgs/development/libraries/qt-5/5.8/qtbase/series index 2196d8383752..72882a47942c 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtbase/series +++ b/pkgs/development/libraries/qt-5/5.8/qtbase/series @@ -7,3 +7,4 @@ xdg-config-dirs.patch nix-profiles-library-paths.patch compose-search-path.patch libressl.patch +qpa-plugin-path.patch From 12c981d4b7486147f8c00a504409ac957b9511ed Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Sat, 15 Apr 2017 11:23:48 -0500 Subject: [PATCH 05/32] qt58.qtbase: Fix QTCOMPOSE search patch --- .../libraries/qt-5/5.8/qtbase/compose-search-path.patch | 6 ++++-- pkgs/development/libraries/qt-5/5.8/qtbase/default.nix | 5 +---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/compose-search-path.patch b/pkgs/development/libraries/qt-5/5.8/qtbase/compose-search-path.patch index 5b212c099650..d0bea4afaa32 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtbase/compose-search-path.patch +++ b/pkgs/development/libraries/qt-5/5.8/qtbase/compose-search-path.patch @@ -2,7 +2,7 @@ Index: qtbase-opensource-src-5.8.0/src/plugins/platforminputcontexts/compose/gen =================================================================== --- qtbase-opensource-src-5.8.0.orig/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp +++ qtbase-opensource-src-5.8.0/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp -@@ -258,10 +258,7 @@ void TableGenerator::initPossibleLocatio +@@ -258,12 +258,9 @@ void TableGenerator::initPossibleLocatio m_possibleLocations.reserve(7); if (qEnvironmentVariableIsSet("QTCOMPOSE")) m_possibleLocations.append(QString::fromLocal8Bit(qgetenv("QTCOMPOSE"))); @@ -10,7 +10,9 @@ Index: qtbase-opensource-src-5.8.0/src/plugins/platforminputcontexts/compose/gen - m_possibleLocations.append(QStringLiteral("/usr/local/share/X11/locale")); - m_possibleLocations.append(QStringLiteral("/usr/lib/X11/locale")); - m_possibleLocations.append(QStringLiteral("/usr/local/lib/X11/locale")); -+ m_possibleLocations.append(QStringLiteral("${libX11}/share/X11/locale")); m_possibleLocations.append(QStringLiteral(X11_PREFIX "/share/X11/locale")); m_possibleLocations.append(QStringLiteral(X11_PREFIX "/lib/X11/locale")); ++ m_possibleLocations.append(QStringLiteral(NIXPKGS_QTCOMPOSE)); } + + QString TableGenerator::findComposeFile() diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix b/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix index 570d61b4420e..11e5119ce134 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix +++ b/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix @@ -66,10 +66,6 @@ stdenv.mkDerivation { substituteInPlace src/dbus/qdbus_symbols.cpp \ --replace "@dbus_libs@" "${dbus.lib}" - - substituteInPlace \ - src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp \ - --replace "@libX11@" "${libX11.out}" '' + lib.optionalString mesaSupported '' substituteInPlace \ @@ -232,6 +228,7 @@ stdenv.mkDerivation { NIX_CFLAGS_COMPILE = [ "-Wno-error=sign-compare" + ''-DNIXPKGS_QTCOMPOSE="${libX11.out}/share/X11/locale"'' ] ++ lib.optionals stdenv.isDarwin [ From 6169bd98f51429d7da4f2fc296357d8e6d828751 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Sat, 8 Apr 2017 19:54:06 -0500 Subject: [PATCH 06/32] qt58: ignore NIX_PROFILES environment variable --- .../qtbase/nix-profiles-library-paths.patch | 22 ------------------- .../libraries/qt-5/5.6/qtbase/series | 1 - .../qtbase/nix-profiles-library-paths.patch | 22 ------------------- .../libraries/qt-5/5.8/qtbase/series | 1 - 4 files changed, 46 deletions(-) delete mode 100644 pkgs/development/libraries/qt-5/5.6/qtbase/nix-profiles-library-paths.patch delete mode 100644 pkgs/development/libraries/qt-5/5.8/qtbase/nix-profiles-library-paths.patch diff --git a/pkgs/development/libraries/qt-5/5.6/qtbase/nix-profiles-library-paths.patch b/pkgs/development/libraries/qt-5/5.6/qtbase/nix-profiles-library-paths.patch deleted file mode 100644 index d454a74109ae..000000000000 --- a/pkgs/development/libraries/qt-5/5.6/qtbase/nix-profiles-library-paths.patch +++ /dev/null @@ -1,22 +0,0 @@ -Index: qtbase-opensource-src-5.6.0/src/corelib/kernel/qcoreapplication.cpp -=================================================================== ---- qtbase-opensource-src-5.6.0.orig/src/corelib/kernel/qcoreapplication.cpp -+++ qtbase-opensource-src-5.6.0/src/corelib/kernel/qcoreapplication.cpp -@@ -2533,7 +2533,17 @@ QStringList QCoreApplication::libraryPat - QStringList *app_libpaths = new QStringList; - coreappdata()->app_libpaths.reset(app_libpaths); - -+ // Add library paths derived from NIX_PROFILES. -+ const QByteArrayList profiles = qgetenv("NIX_PROFILES").split(' '); -+ const QString plugindir = QString::fromLatin1("/lib/qt5/plugins"); -+ Q_FOREACH (const QByteArray &profile, profiles) { -+ if (!profile.isEmpty()) { -+ app_libpaths->append(QFile::decodeName(profile) + plugindir); -+ } -+ } -+ - const QByteArray libPathEnv = qgetenv("QT_PLUGIN_PATH"); -+ qunsetenv("QT_PLUGIN_PATH"); // do not propagate to child processes - if (!libPathEnv.isEmpty()) { - QStringList paths = QFile::decodeName(libPathEnv).split(QDir::listSeparator(), QString::SkipEmptyParts); - for (QStringList::const_iterator it = paths.constBegin(); it != paths.constEnd(); ++it) { diff --git a/pkgs/development/libraries/qt-5/5.6/qtbase/series b/pkgs/development/libraries/qt-5/5.6/qtbase/series index 2196d8383752..9ef8c998c661 100644 --- a/pkgs/development/libraries/qt-5/5.6/qtbase/series +++ b/pkgs/development/libraries/qt-5/5.6/qtbase/series @@ -4,6 +4,5 @@ dlopen-libXcursor.patch dlopen-openssl.patch dlopen-dbus.patch xdg-config-dirs.patch -nix-profiles-library-paths.patch compose-search-path.patch libressl.patch diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/nix-profiles-library-paths.patch b/pkgs/development/libraries/qt-5/5.8/qtbase/nix-profiles-library-paths.patch deleted file mode 100644 index c5d91066d8f6..000000000000 --- a/pkgs/development/libraries/qt-5/5.8/qtbase/nix-profiles-library-paths.patch +++ /dev/null @@ -1,22 +0,0 @@ -Index: qtbase-opensource-src-5.8.0/src/corelib/kernel/qcoreapplication.cpp -=================================================================== ---- qtbase-opensource-src-5.8.0.orig/src/corelib/kernel/qcoreapplication.cpp -+++ qtbase-opensource-src-5.8.0/src/corelib/kernel/qcoreapplication.cpp -@@ -2476,7 +2476,17 @@ QStringList QCoreApplication::libraryPat - QStringList *app_libpaths = new QStringList; - coreappdata()->app_libpaths.reset(app_libpaths); - -+ // Add library paths derived from NIX_PROFILES. -+ const QByteArrayList profiles = qgetenv("NIX_PROFILES").split(' '); -+ const QString plugindir = QString::fromLatin1("/lib/qt5/plugins"); -+ for (const QByteArray &profile: profiles) { -+ if (!profile.isEmpty()) { -+ app_libpaths->append(QFile::decodeName(profile) + plugindir); -+ } -+ } -+ - const QByteArray libPathEnv = qgetenv("QT_PLUGIN_PATH"); -+ qunsetenv("QT_PLUGIN_PATH"); // do not propagate to child processes - if (!libPathEnv.isEmpty()) { - QStringList paths = QFile::decodeName(libPathEnv).split(QDir::listSeparator(), QString::SkipEmptyParts); - for (QStringList::const_iterator it = paths.constBegin(); it != paths.constEnd(); ++it) { diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/series b/pkgs/development/libraries/qt-5/5.8/qtbase/series index 72882a47942c..f0b1bfa674d8 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtbase/series +++ b/pkgs/development/libraries/qt-5/5.8/qtbase/series @@ -4,7 +4,6 @@ dlopen-libXcursor.patch dlopen-openssl.patch dlopen-dbus.patch xdg-config-dirs.patch -nix-profiles-library-paths.patch compose-search-path.patch libressl.patch qpa-plugin-path.patch From 40aa757898cba35090bdece5cb1949315a366232 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Sat, 15 Apr 2017 11:33:47 -0500 Subject: [PATCH 07/32] qt58.qtbase: Fix path to libresolv --- pkgs/development/libraries/qt-5/5.8/qtbase/default.nix | 6 +----- .../libraries/qt-5/5.8/qtbase/dlopen-resolv.patch | 4 ++-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix b/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix index 11e5119ce134..3e667d5cc40d 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix +++ b/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix @@ -53,11 +53,6 @@ stdenv.mkDerivation { sed -i 's/NO_DEFAULT_PATH//' "src/gui/Qt5GuiConfigExtras.cmake.in" sed -i 's/PATHS.*NO_DEFAULT_PATH//' "mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in" - substituteInPlace src/network/kernel/qdnslookup_unix.cpp \ - --replace "@glibc@" "${stdenv.cc.libc.out}" - substituteInPlace src/network/kernel/qhostinfo_unix.cpp \ - --replace "@glibc@" "${stdenv.cc.libc.out}" - substituteInPlace src/network/ssl/qsslsocket_openssl_symbols.cpp \ --replace "@openssl@" "${openssl.out}" '' + lib.optionalString stdenv.isLinux '' @@ -229,6 +224,7 @@ stdenv.mkDerivation { [ "-Wno-error=sign-compare" ''-DNIXPKGS_QTCOMPOSE="${libX11.out}/share/X11/locale"'' + ''-DNIXPKGS_LIBRESOLV="${stdenv.cc.libc.out}/lib/libresolv"'' ] ++ lib.optionals stdenv.isDarwin [ diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/dlopen-resolv.patch b/pkgs/development/libraries/qt-5/5.8/qtbase/dlopen-resolv.patch index 1df27377658d..ef7cd4a910a2 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtbase/dlopen-resolv.patch +++ b/pkgs/development/libraries/qt-5/5.8/qtbase/dlopen-resolv.patch @@ -7,7 +7,7 @@ Index: qtbase-opensource-src-5.8.0/src/network/kernel/qdnslookup_unix.cpp #endif { - lib.setFileName(QLatin1String("resolv")); -+ lib.setFileName(QLatin1String("@glibc@/lib/resolv")); ++ lib.setFileName(QLatin1String(NIXPKGS_LIBRESOLV)); if (!lib.load()) return false; } @@ -20,7 +20,7 @@ Index: qtbase-opensource-src-5.8.0/src/network/kernel/qhostinfo_unix.cpp #endif { - lib.setFileName(QLatin1String("resolv")); -+ lib.setFileName(QLatin1String("@glibc@/lib/libresolv")); ++ lib.setFileName(QLatin1String(NIXPKGS_LIBRESOLV)); if (!lib.load()) return false; } From ff8fa7e397a92faaeb60e78fdc1bcef5a3eab8bf Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Sat, 15 Apr 2017 11:34:00 -0500 Subject: [PATCH 08/32] qt58.qtbase: Fix path to libXcursor --- .../libraries/qt-5/5.8/qtbase/default.nix | 4 +--- .../qt-5/5.8/qtbase/dlopen-libXcursor.patch | 15 +++++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix b/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix index 3e667d5cc40d..3bcbf0caf406 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix +++ b/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix @@ -56,9 +56,6 @@ stdenv.mkDerivation { substituteInPlace src/network/ssl/qsslsocket_openssl_symbols.cpp \ --replace "@openssl@" "${openssl.out}" '' + lib.optionalString stdenv.isLinux '' - substituteInPlace src/plugins/platforms/xcb/qxcbcursor.cpp \ - --replace "@libXcursor@" "${libXcursor.out}" - substituteInPlace src/dbus/qdbus_symbols.cpp \ --replace "@dbus_libs@" "${dbus.lib}" '' @@ -225,6 +222,7 @@ stdenv.mkDerivation { "-Wno-error=sign-compare" ''-DNIXPKGS_QTCOMPOSE="${libX11.out}/share/X11/locale"'' ''-DNIXPKGS_LIBRESOLV="${stdenv.cc.libc.out}/lib/libresolv"'' + ''-DNIXPKGS_LIBXCURSOR="${libXcursor.out}/lib/libXcursor"'' ] ++ lib.optionals stdenv.isDarwin [ diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/dlopen-libXcursor.patch b/pkgs/development/libraries/qt-5/5.8/qtbase/dlopen-libXcursor.patch index 02b7efb73d22..d0e82cf122ac 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtbase/dlopen-libXcursor.patch +++ b/pkgs/development/libraries/qt-5/5.8/qtbase/dlopen-libXcursor.patch @@ -1,17 +1,20 @@ -Index: qtbase-opensource-src-5.7.0/src/plugins/platforms/xcb/qxcbcursor.cpp +Index: qtbase-opensource-src-5.8.0/src/plugins/platforms/xcb/qxcbcursor.cpp =================================================================== ---- qtbase-opensource-src-5.7.0.orig/src/plugins/platforms/xcb/qxcbcursor.cpp -+++ qtbase-opensource-src-5.7.0/src/plugins/platforms/xcb/qxcbcursor.cpp -@@ -309,10 +309,10 @@ QXcbCursor::QXcbCursor(QXcbConnection *c +--- qtbase-opensource-src-5.8.0.orig/src/plugins/platforms/xcb/qxcbcursor.cpp ++++ qtbase-opensource-src-5.8.0/src/plugins/platforms/xcb/qxcbcursor.cpp +@@ -309,13 +309,13 @@ QXcbCursor::QXcbCursor(QXcbConnection *c #if defined(XCB_USE_XLIB) && !defined(QT_NO_LIBRARY) static bool function_ptrs_not_initialized = true; if (function_ptrs_not_initialized) { - QLibrary xcursorLib(QLatin1String("Xcursor"), 1); -+ QLibrary xcursorLib(QLatin1String("@libXcursor@/lib/libXcursor"), 1); ++ QLibrary xcursorLib(QLatin1String(NIXPKGS_LIBXCURSOR), 1); bool xcursorFound = xcursorLib.load(); if (!xcursorFound) { // try without the version number - xcursorLib.setFileName(QLatin1String("Xcursor")); -+ xcursorLib.setFileName(QLatin1String("@libXcursor@/lib/Xcursor")); ++ xcursorLib.setFileName(QLatin1String(NIXPKGS_LIBXCURSOR)); xcursorFound = xcursorLib.load(); } if (xcursorFound) { + ptrXcursorLibraryLoadCursor = + (PtrXcursorLibraryLoadCursor) xcursorLib.resolve("XcursorLibraryLoadCursor"); + ptrXcursorLibraryGetTheme = From f45f2635e15e49172a3d73a5ba99d2935492e5c2 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Sat, 15 Apr 2017 11:37:04 -0500 Subject: [PATCH 09/32] qt58.qtbase: Fix path to libssl and libcrypto --- pkgs/development/libraries/qt-5/5.8/qtbase/default.nix | 5 ++--- .../libraries/qt-5/5.8/qtbase/dlopen-openssl.patch | 8 ++++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix b/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix index 3bcbf0caf406..f137984862a5 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix +++ b/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix @@ -52,9 +52,6 @@ stdenv.mkDerivation { sed -i 's/PATHS.*NO_DEFAULT_PATH//' "src/corelib/Qt5CoreMacros.cmake" sed -i 's/NO_DEFAULT_PATH//' "src/gui/Qt5GuiConfigExtras.cmake.in" sed -i 's/PATHS.*NO_DEFAULT_PATH//' "mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in" - - substituteInPlace src/network/ssl/qsslsocket_openssl_symbols.cpp \ - --replace "@openssl@" "${openssl.out}" '' + lib.optionalString stdenv.isLinux '' substituteInPlace src/dbus/qdbus_symbols.cpp \ --replace "@dbus_libs@" "${dbus.lib}" @@ -223,6 +220,8 @@ stdenv.mkDerivation { ''-DNIXPKGS_QTCOMPOSE="${libX11.out}/share/X11/locale"'' ''-DNIXPKGS_LIBRESOLV="${stdenv.cc.libc.out}/lib/libresolv"'' ''-DNIXPKGS_LIBXCURSOR="${libXcursor.out}/lib/libXcursor"'' + ''-DNIXPKGS_LIBSSL="${openssl.out}/lib/libssl"'' + ''-DNIXPKGS_LIBCRYPTO="${openssl.out}/lib/libcrypto"'' ] ++ lib.optionals stdenv.isDarwin [ diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/dlopen-openssl.patch b/pkgs/development/libraries/qt-5/5.8/qtbase/dlopen-openssl.patch index 46600e7f4262..943b1c569fd1 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtbase/dlopen-openssl.patch +++ b/pkgs/development/libraries/qt-5/5.8/qtbase/dlopen-openssl.patch @@ -8,8 +8,8 @@ Index: qtbase-opensource-src-5.8.0/src/network/ssl/qsslsocket_openssl_symbols.cp // first attempt: the canonical name is libssl.so. - libssl->setFileNameAndVersion(QLatin1String("ssl"), QLatin1String(SHLIB_VERSION_NUMBER)); - libcrypto->setFileNameAndVersion(QLatin1String("crypto"), QLatin1String(SHLIB_VERSION_NUMBER)); -+ libssl->setFileNameAndVersion(QLatin1String("@openssl@/lib/libssl"), QLatin1String(SHLIB_VERSION_NUMBER)); -+ libcrypto->setFileNameAndVersion(QLatin1String("@openssl@/lib/libcrypto"), QLatin1String(SHLIB_VERSION_NUMBER)); ++ libssl->setFileNameAndVersion(QStringLiteral(NIXPKGS_LIBSSL), QLatin1String(SHLIB_VERSION_NUMBER)); ++ libcrypto->setFileNameAndVersion(QStringLiteral(NIXPKGS_LIBCRYPTO), QLatin1String(SHLIB_VERSION_NUMBER)); if (libcrypto->load() && libssl->load()) { // libssl.so. and libcrypto.so. found return pair; @@ -19,8 +19,8 @@ Index: qtbase-opensource-src-5.8.0/src/network/ssl/qsslsocket_openssl_symbols.cp // iOS does not ship a system libssl.dylib, libcrypto.dylib in the first place. - libssl->setFileNameAndVersion(QLatin1String("ssl"), -1); - libcrypto->setFileNameAndVersion(QLatin1String("crypto"), -1); -+ libssl->setFileNameAndVersion(QLatin1String("@openssl@/lib/libssl"), -1); -+ libcrypto->setFileNameAndVersion(QLatin1String("@openssl@/lib/libcrypto"), -1); ++ libssl->setFileNameAndVersion(QStringLiteral(NIXPKGS_LIBSSL), -1); ++ libcrypto->setFileNameAndVersion(QStringLiteral(NIXPKGS_LIBCRYPTO), -1); if (libcrypto->load() && libssl->load()) { // libssl.so.0 and libcrypto.so.0 found return pair; From 8e2b6a90c09d39de5f43eb94376000f1776e0657 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Sat, 15 Apr 2017 11:39:50 -0500 Subject: [PATCH 10/32] qt58.qtbase: Fix path to libdbus --- pkgs/development/libraries/qt-5/5.8/qtbase/default.nix | 6 +++--- .../development/libraries/qt-5/5.8/qtbase/dlopen-dbus.patch | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix b/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix index f137984862a5..62ff9c2ea515 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix +++ b/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix @@ -52,9 +52,6 @@ stdenv.mkDerivation { sed -i 's/PATHS.*NO_DEFAULT_PATH//' "src/corelib/Qt5CoreMacros.cmake" sed -i 's/NO_DEFAULT_PATH//' "src/gui/Qt5GuiConfigExtras.cmake.in" sed -i 's/PATHS.*NO_DEFAULT_PATH//' "mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in" - '' + lib.optionalString stdenv.isLinux '' - substituteInPlace src/dbus/qdbus_symbols.cpp \ - --replace "@dbus_libs@" "${dbus.lib}" '' + lib.optionalString mesaSupported '' substituteInPlace \ @@ -222,6 +219,9 @@ stdenv.mkDerivation { ''-DNIXPKGS_LIBXCURSOR="${libXcursor.out}/lib/libXcursor"'' ''-DNIXPKGS_LIBSSL="${openssl.out}/lib/libssl"'' ''-DNIXPKGS_LIBCRYPTO="${openssl.out}/lib/libcrypto"'' + (if stdenv.isLinux + then ''-DNIXPKGS_LIBDBUS="${dbus.lib}/lib/libdbus-1"'' + else ''-DNIXPKGS_LIBDBUS=""'') ] ++ lib.optionals stdenv.isDarwin [ diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/dlopen-dbus.patch b/pkgs/development/libraries/qt-5/5.8/qtbase/dlopen-dbus.patch index 10b0b6701ddc..067d898cda42 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtbase/dlopen-dbus.patch +++ b/pkgs/development/libraries/qt-5/5.8/qtbase/dlopen-dbus.patch @@ -1,7 +1,7 @@ -Index: qtbase-opensource-src-5.7.0/src/dbus/qdbus_symbols.cpp +Index: qtbase-opensource-src-5.8.0/src/dbus/qdbus_symbols.cpp =================================================================== ---- qtbase-opensource-src-5.7.0.orig/src/dbus/qdbus_symbols.cpp -+++ qtbase-opensource-src-5.7.0/src/dbus/qdbus_symbols.cpp +--- qtbase-opensource-src-5.8.0.orig/src/dbus/qdbus_symbols.cpp ++++ qtbase-opensource-src-5.8.0/src/dbus/qdbus_symbols.cpp @@ -97,7 +97,7 @@ bool qdbus_loadLibDBus() #ifdef Q_OS_WIN QLatin1String("dbus-1"), From 1f62bf01d340967ec2a1600108d6686a3804c114 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Sun, 16 Apr 2017 09:45:27 -0500 Subject: [PATCH 11/32] qt58.qtbase: Fix path to fallback libGL --- .../libraries/qt-5/5.8/qtbase/default.nix | 7 +++---- .../libraries/qt-5/5.8/qtbase/dlopen-gl.patch | 16 +++++++++------- .../development/libraries/qt-5/5.8/qtbase/series | 1 + 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix b/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix index 62ff9c2ea515..6d11927d6ce8 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix +++ b/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix @@ -40,7 +40,7 @@ stdenv.mkDerivation { copyPathsToStore (lib.readPathsFromFile ./. ./series) ++ [(if stdenv.isDarwin then ./cmake-paths-darwin.patch else ./cmake-paths.patch)] ++ lib.optional decryptSslTraffic ./decrypt-ssl-traffic.patch - ++ lib.optionals mesaSupported [ ./dlopen-gl.patch ./mkspecs-libgl.patch ]; + ++ lib.optionals mesaSupported [ ./mkspecs-libgl.patch ]; postPatch = '' @@ -54,9 +54,6 @@ stdenv.mkDerivation { sed -i 's/PATHS.*NO_DEFAULT_PATH//' "mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in" '' + lib.optionalString mesaSupported '' - substituteInPlace \ - src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp \ - --replace "@mesa_lib@" "${mesa.out}" substituteInPlace mkspecs/common/linux.conf \ --replace "@mesa_lib@" "${mesa.out}" \ --replace "@mesa_inc@" "${mesa.dev or mesa}" @@ -223,6 +220,8 @@ stdenv.mkDerivation { then ''-DNIXPKGS_LIBDBUS="${dbus.lib}/lib/libdbus-1"'' else ''-DNIXPKGS_LIBDBUS=""'') ] + ++ lib.optional mesaSupported + ''-DNIXPKGS_MESA_GL="${mesa.out}/lib/libGL"'' ++ lib.optionals stdenv.isDarwin [ "-D__MAC_OS_X_VERSION_MAX_ALLOWED=1090" diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/dlopen-gl.patch b/pkgs/development/libraries/qt-5/5.8/qtbase/dlopen-gl.patch index ea3073ced50a..c835f2bfe441 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtbase/dlopen-gl.patch +++ b/pkgs/development/libraries/qt-5/5.8/qtbase/dlopen-gl.patch @@ -1,17 +1,19 @@ -Index: qtbase-opensource-src-5.5.1/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp +Index: qtbase-opensource-src-5.8.0/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp =================================================================== ---- qtbase-opensource-src-5.5.1.orig/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp -+++ qtbase-opensource-src-5.5.1/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp -@@ -563,7 +563,12 @@ void (*QGLXContext::getProcAddress(const - { +--- qtbase-opensource-src-5.8.0.orig/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp ++++ qtbase-opensource-src-5.8.0/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp +@@ -576,7 +576,14 @@ QFunctionPointer QGLXContext::getProcAdd + #ifndef QT_NO_LIBRARY extern const QString qt_gl_library_name(); // QLibrary lib(qt_gl_library_name()); + // Check system library paths first QLibrary lib(QLatin1String("GL")); ++#ifdef NIXPKGS_MESA_GL + if (!lib.load()) { + // Fallback to Mesa driver -+ lib.setFileName(QLatin1String("@mesa_lib@/lib/libGL")); ++ lib.setFileName(QLatin1String(NIXPKGS_MESA_GL)); + } ++#endif // NIXPKGS_MESA_GL glXGetProcAddressARB = (qt_glXGetProcAddressARB) lib.resolve("glXGetProcAddressARB"); + #endif } - } diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/series b/pkgs/development/libraries/qt-5/5.8/qtbase/series index f0b1bfa674d8..9939aea74003 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtbase/series +++ b/pkgs/development/libraries/qt-5/5.8/qtbase/series @@ -7,3 +7,4 @@ xdg-config-dirs.patch compose-search-path.patch libressl.patch qpa-plugin-path.patch +dlopen-gl.patch From 9d9ab3de98b31a234185261e22d45cec0e92fb36 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Sun, 16 Apr 2017 09:58:27 -0500 Subject: [PATCH 12/32] qt58.qtbase: replace mkspecs patch with sed script --- .../libraries/qt-5/5.8/qtbase/default.nix | 14 ++++++++------ .../libraries/qt-5/5.8/qtbase/mkspecs-libgl.patch | 15 --------------- 2 files changed, 8 insertions(+), 21 deletions(-) delete mode 100644 pkgs/development/libraries/qt-5/5.8/qtbase/mkspecs-libgl.patch diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix b/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix index 6d11927d6ce8..0ad353d96816 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix +++ b/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix @@ -39,8 +39,7 @@ stdenv.mkDerivation { patches = copyPathsToStore (lib.readPathsFromFile ./. ./series) ++ [(if stdenv.isDarwin then ./cmake-paths-darwin.patch else ./cmake-paths.patch)] - ++ lib.optional decryptSslTraffic ./decrypt-ssl-traffic.patch - ++ lib.optionals mesaSupported [ ./mkspecs-libgl.patch ]; + ++ lib.optional decryptSslTraffic ./decrypt-ssl-traffic.patch; postPatch = '' @@ -53,11 +52,14 @@ stdenv.mkDerivation { sed -i 's/NO_DEFAULT_PATH//' "src/gui/Qt5GuiConfigExtras.cmake.in" sed -i 's/PATHS.*NO_DEFAULT_PATH//' "mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in" '' + + lib.optionalString mesaSupported '' - substituteInPlace mkspecs/common/linux.conf \ - --replace "@mesa_lib@" "${mesa.out}" \ - --replace "@mesa_inc@" "${mesa.dev or mesa}" - ''+ lib.optionalString stdenv.isDarwin '' + sed -i mkspecs/common/linux.conf \ + -e "/^QMAKE_INCDIR_OPENGL/ s|$|${mesa.dev or mesa}/include|" \ + -e "/^QMAKE_LIBDIR_OPENGL/ s|$|${mesa.out}/lib|" + '' + + + lib.optionalString stdenv.isDarwin '' sed -i \ -e 's|! /usr/bin/xcode-select --print-path >/dev/null 2>&1;|false;|' \ -e 's|! /usr/bin/xcrun -find xcodebuild >/dev/null 2>&1;|false;|' \ diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/mkspecs-libgl.patch b/pkgs/development/libraries/qt-5/5.8/qtbase/mkspecs-libgl.patch deleted file mode 100644 index fda3d3e36533..000000000000 --- a/pkgs/development/libraries/qt-5/5.8/qtbase/mkspecs-libgl.patch +++ /dev/null @@ -1,15 +0,0 @@ -Index: qtbase-opensource-src-5.5.1/mkspecs/common/linux.conf -=================================================================== ---- qtbase-opensource-src-5.5.1.orig/mkspecs/common/linux.conf -+++ qtbase-opensource-src-5.5.1/mkspecs/common/linux.conf -@@ -12,8 +12,8 @@ QMAKE_INCDIR = - QMAKE_LIBDIR = - QMAKE_INCDIR_X11 = - QMAKE_LIBDIR_X11 = --QMAKE_INCDIR_OPENGL = --QMAKE_LIBDIR_OPENGL = -+QMAKE_INCDIR_OPENGL = @mesa_inc@/include -+QMAKE_LIBDIR_OPENGL = @mesa_lib@/lib - QMAKE_INCDIR_OPENGL_ES2 = $$QMAKE_INCDIR_OPENGL - QMAKE_LIBDIR_OPENGL_ES2 = $$QMAKE_LIBDIR_OPENGL - QMAKE_INCDIR_EGL = From e4fb41cc5bf7c9685466a13dfcbeaba7e3030287 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Sun, 16 Apr 2017 09:58:55 -0500 Subject: [PATCH 13/32] qt58.qtbase: clean up CMake path sed scripts --- pkgs/development/libraries/qt-5/5.8/qtbase/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix b/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix index 0ad353d96816..b0f79af0d093 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix +++ b/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix @@ -47,10 +47,10 @@ stdenv.mkDerivation { 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 - sed -i 's/PATHS.*NO_DEFAULT_PATH//' "src/corelib/Qt5Config.cmake.in" - sed -i 's/PATHS.*NO_DEFAULT_PATH//' "src/corelib/Qt5CoreMacros.cmake" - sed -i 's/NO_DEFAULT_PATH//' "src/gui/Qt5GuiConfigExtras.cmake.in" - sed -i 's/PATHS.*NO_DEFAULT_PATH//' "mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in" + sed -i '/PATHS.*NO_DEFAULT_PATH/ d' src/corelib/Qt5Config.cmake.in + sed -i '/PATHS.*NO_DEFAULT_PATH/ d' src/corelib/Qt5CoreMacros.cmake + sed -i 's/NO_DEFAULT_PATH//' src/gui/Qt5GuiConfigExtras.cmake.in + sed -i '/PATHS.*NO_DEFAULT_PATH/ d' mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in '' + lib.optionalString mesaSupported '' From a579e0129c56c822afca2b201c22b00917d02915 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Sun, 16 Apr 2017 12:31:05 -0500 Subject: [PATCH 14/32] qt58.qtbase: clean up configuration --- .../libraries/qt-5/5.8/qtbase/default.nix | 192 ++++++++++-------- 1 file changed, 106 insertions(+), 86 deletions(-) diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix b/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix index b0f79af0d093..a7d4cab86c3d 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix +++ b/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix @@ -95,110 +95,124 @@ stdenv.mkDerivation { # -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 - configureFlags = '' - -verbose - -confirm-license - -opensource + configureFlags = + [ + "-verbose" + "-confirm-license" + "-opensource" - -release - -shared - ${lib.optionalString developerBuild "-developer-build"} - -accessibility - -optimized-qmake - -strip - -no-reduce-relocations - -system-proxies - -pkg-config + "-release" + "-shared" + "-accessibility" + "-optimized-qmake" + "-strip" + "-no-reduce-relocations" + "-system-proxies" + "-pkg-config" + ] + ++ lib.optional developerBuild "-developer-build" - -gui - -widgets - -opengl desktop - -qml-debug - -icu - -pch + ++ [ + "-gui" + "-widgets" + "-opengl desktop" + "-qml-debug" + "-icu" + "-pch" + ] - ${lib.optionalString (!system-x86_64) "-no-sse2"} - -no-sse3 - -no-ssse3 - -no-sse4.1 - -no-sse4.2 - -no-avx - -no-avx2 - -no-mips_dsp - -no-mips_dspr2 + ++ [ + ''${lib.optionalString (!system-x86_64) "-no"}-sse2'' + "-no-sse3" + "-no-ssse3" + "-no-sse4.1" + "-no-sse4.2" + "-no-avx" + "-no-avx2" + "-no-mips_dsp" + "-no-mips_dspr2" + ] - -system-zlib - -system-libjpeg - -system-harfbuzz - -system-pcre - -openssl-linked + ++ [ + "-system-zlib" + "-system-libjpeg" + "-system-harfbuzz" + "-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 - -${if mysql != null then "plugin" else "no"}-sql-mysql - -${if postgresql != null then "plugin" else "no"}-sql-psql + "-make libs" + "-make tools" + ''-${lib.optionalString (buildExamples == false) "no"}make examples'' + ''-${lib.optionalString (buildTests == false) "no"}make tests'' + "-v" + ] - -make libs - -make tools - -${lib.optionalString (buildExamples == false) "no"}make examples - -${lib.optionalString (buildTests == false) "no"}make tests - -v - '' + lib.optionalString (!stdenv.isDarwin) '' - -rpath - -glib - -xcb - -qpa xcb + ++ lib.optionals (!stdenv.isDarwin) [ + "-rpath" + "-glib" + "-xcb" + "-qpa xcb" + ''-${lib.optionalString (cups == null) "no-"}cups'' - -${lib.optionalString (cups == null) "no-"}cups + "-no-eglfs" + "-no-directfb" + "-no-linuxfb" + "-no-kms" - -no-eglfs - -no-directfb - -no-linuxfb - -no-kms + "-libinput" + "-gtk" + "-system-libpng" + "-system-xcb" + "-system-xkbcommon" + "-dbus-linked" + ] - -libinput - -gtk - -system-libpng - -system-xcb - -system-xkbcommon - -dbus-linked - '' + lib.optionalString stdenv.isDarwin '' - -platform macx-clang - -no-use-gold-linker - -no-fontconfig - -qt-freetype - -qt-libpng - ''; + ++ lib.optionals 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 # if dependency paths contain the string "pq", which can occur in the hash. # To prevent these failures, we need to override PostgreSQL detection. PSQL_LIBS = lib.optionalString (postgresql != null) "-L${postgresql.lib}/lib -lpq"; - propagatedBuildInputs = [ - libxml2 libxslt openssl pcre16 sqlite zlib + propagatedBuildInputs = + [ + libxml2 libxslt openssl pcre16 sqlite zlib - # Text rendering - harfbuzz icu + # Text rendering + harfbuzz icu - # Image formats - libjpeg libpng libtiff - ] - ++ lib.optional mesaSupported mesa - ++ lib.optionals (!stdenv.isDarwin) [ - dbus glib udev + # Image formats + libjpeg libpng libtiff + ] - # Text rendering - fontconfig freetype + ++ lib.optional mesaSupported mesa - # X11 libs - 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 - ]); + ++ lib.optionals (!stdenv.isDarwin) [ + dbus glib udev + + # Text rendering + fontconfig freetype + + # X11 libs + 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 = [ ] ++ lib.optionals (!stdenv.isDarwin) [ gtk3 libinput ] @@ -207,7 +221,9 @@ stdenv.mkDerivation { ++ lib.optional (mysql != null) mysql.lib ++ 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 NIX_CFLAGS_COMPILE = @@ -222,8 +238,10 @@ stdenv.mkDerivation { then ''-DNIXPKGS_LIBDBUS="${dbus.lib}/lib/libdbus-1"'' else ''-DNIXPKGS_LIBDBUS=""'') ] + ++ lib.optional mesaSupported ''-DNIXPKGS_MESA_GL="${mesa.out}/lib/libGL"'' + ++ lib.optionals stdenv.isDarwin [ "-D__MAC_OS_X_VERSION_MAX_ALLOWED=1090" @@ -269,11 +287,13 @@ stdenv.mkDerivation { popd fi '' + # fixup .pc file (where to find 'moc' etc.) + lib.optionalString (!stdenv.isDarwin) '' sed -i "$dev/lib/pkgconfig/Qt5Core.pc" \ -e "/^host_bins=/ c host_bins=$dev/bin" '' + # Don' move .prl files on darwin because they end up in # "dev/lib/Foo.framework/Foo.prl" which interferes with subsequent # use of lndir in the qtbase setup-hook. On Linux, the .prl files From 30620805725b3afb817d34c94a3e0c079a2ebc2f Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Sun, 16 Apr 2017 12:32:20 -0500 Subject: [PATCH 15/32] qt58.qtbase: remove SSL decryption patch This option does not require a patch; it can be enabled through NIX_CFLAGS_COMPILE. --- .../qt-5/5.8/qtbase/decrypt-ssl-traffic.patch | 13 ------------- .../libraries/qt-5/5.8/qtbase/default.nix | 7 ++++--- 2 files changed, 4 insertions(+), 16 deletions(-) delete mode 100644 pkgs/development/libraries/qt-5/5.8/qtbase/decrypt-ssl-traffic.patch diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/decrypt-ssl-traffic.patch b/pkgs/development/libraries/qt-5/5.8/qtbase/decrypt-ssl-traffic.patch deleted file mode 100644 index 495db07cfbb5..000000000000 --- a/pkgs/development/libraries/qt-5/5.8/qtbase/decrypt-ssl-traffic.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: qtbase-opensource-src-5.5.1/src/network/ssl/qsslsocket_openssl.cpp -=================================================================== ---- qtbase-opensource-src-5.5.1.orig/src/network/ssl/qsslsocket_openssl.cpp -+++ qtbase-opensource-src-5.5.1/src/network/ssl/qsslsocket_openssl.cpp -@@ -48,7 +48,7 @@ - ****************************************************************************/ - - //#define QSSLSOCKET_DEBUG --//#define QT_DECRYPT_SSL_TRAFFIC -+#define QT_DECRYPT_SSL_TRAFFIC - - #include "qssl_p.h" - #include "qsslsocket_openssl_p.h" diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix b/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix index a7d4cab86c3d..8c666c95bec7 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix +++ b/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix @@ -38,8 +38,7 @@ stdenv.mkDerivation { patches = copyPathsToStore (lib.readPathsFromFile ./. ./series) - ++ [(if stdenv.isDarwin then ./cmake-paths-darwin.patch else ./cmake-paths.patch)] - ++ lib.optional decryptSslTraffic ./decrypt-ssl-traffic.patch; + ++ [(if stdenv.isDarwin then ./cmake-paths-darwin.patch else ./cmake-paths.patch)]; postPatch = '' @@ -249,7 +248,9 @@ stdenv.mkDerivation { # Note that nixpkgs's objc4 is from macOS 10.11 while the SDK is # 10.9 which necessitates the above macro definition that mentions # 10.10 - ]; + ] + + ++ lib.optional decryptSslTraffic "-DQT_DECRYPT_SSL_TRAFFIC"; postInstall = '' find "$out" -name "*.cmake" | while read file; do From 4bd911dcd68bdb5747beea47f4e962239438244e Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Mon, 17 Apr 2017 08:02:48 -0500 Subject: [PATCH 16/32] qtbase: fill in configure flags --- .../libraries/qt-5/5.8/qtbase/default.nix | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix b/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix index 8c666c95bec7..719afe75a536 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix +++ b/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix @@ -105,7 +105,6 @@ stdenv.mkDerivation { "-accessibility" "-optimized-qmake" "-strip" - "-no-reduce-relocations" "-system-proxies" "-pkg-config" ] @@ -151,22 +150,27 @@ stdenv.mkDerivation { ++ lib.optionals (!stdenv.isDarwin) [ "-rpath" - "-glib" + + "-system-xcb" "-xcb" "-qpa xcb" - ''-${lib.optionalString (cups == null) "no-"}cups'' + + "-system-xkbcommon" + "-libinput" + "-xkbcommon-evdev" "-no-eglfs" - "-no-directfb" - "-no-linuxfb" + "-no-gbm" "-no-kms" + "-no-linuxfb" - "-libinput" - "-gtk" - "-system-libpng" - "-system-xcb" - "-system-xkbcommon" + ''-${lib.optionalString (cups == null) "no-"}cups'' "-dbus-linked" + "-glib" + "-gtk" + "-inotify" + "-system-libjpeg" + "-system-libpng" ] ++ lib.optionals stdenv.isDarwin [ From 0d0858202c4bd202eac4623c023a8764ee7a0149 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Mon, 17 Apr 2017 08:04:19 -0500 Subject: [PATCH 17/32] qtbase: unify Linux and Darwin patchsets --- .../qt-5/5.8/qtbase/cmake-paths-darwin.patch | 384 ------------------ .../qt-5/5.8/qtbase/cmake-paths.patch | 180 ++++---- .../libraries/qt-5/5.8/qtbase/default.nix | 38 +- .../libraries/qt-5/5.8/qtbase/series | 1 + 4 files changed, 103 insertions(+), 500 deletions(-) delete mode 100644 pkgs/development/libraries/qt-5/5.8/qtbase/cmake-paths-darwin.patch diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/cmake-paths-darwin.patch b/pkgs/development/libraries/qt-5/5.8/qtbase/cmake-paths-darwin.patch deleted file mode 100644 index da7f36542ef9..000000000000 --- a/pkgs/development/libraries/qt-5/5.8/qtbase/cmake-paths-darwin.patch +++ /dev/null @@ -1,384 +0,0 @@ -Index: qtbase-opensource-src-5.8.0/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in -=================================================================== ---- qtbase-opensource-src-5.8.0.orig/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in -+++ qtbase-opensource-src-5.8.0/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in -@@ -9,30 +9,6 @@ if (CMAKE_VERSION VERSION_LESS 3.0.0) - endif() - !!ENDIF - --!!IF !isEmpty(CMAKE_USR_MOVE_WORKAROUND) --!!IF !isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) --set(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"$$[QT_INSTALL_PREFIX]\") --!!ELSE --get_filename_component(_IMPORT_PREFIX \"${CMAKE_CURRENT_LIST_FILE}\" PATH) --# Use original install prefix when loaded through a --# cross-prefix symbolic link such as /lib -> /usr/lib. --get_filename_component(_realCurr \"${_IMPORT_PREFIX}\" REALPATH) --get_filename_component(_realOrig \"$$CMAKE_INSTALL_LIBS_DIR/cmake/Qt5$${CMAKE_MODULE_NAME}\" REALPATH) --if(_realCurr STREQUAL _realOrig) -- get_filename_component(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"$$CMAKE_INSTALL_LIBS_DIR/$${CMAKE_RELATIVE_INSTALL_LIBS_DIR}\" ABSOLUTE) --else() -- get_filename_component(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"${CMAKE_CURRENT_LIST_DIR}/$${CMAKE_RELATIVE_INSTALL_DIR}\" ABSOLUTE) --endif() --unset(_realOrig) --unset(_realCurr) --unset(_IMPORT_PREFIX) --!!ENDIF --!!ELIF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) --get_filename_component(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"${CMAKE_CURRENT_LIST_DIR}/$${CMAKE_RELATIVE_INSTALL_DIR}\" ABSOLUTE) --!!ELSE --set(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"$$[QT_INSTALL_PREFIX]\") --!!ENDIF -- - !!IF !equals(TEMPLATE, aux) - # For backwards compatibility only. Use Qt5$${CMAKE_MODULE_NAME}_VERSION instead. - set(Qt5$${CMAKE_MODULE_NAME}_VERSION_STRING "$$eval(QT.$${MODULE}.MAJOR_VERSION).$$eval(QT.$${MODULE}.MINOR_VERSION).$$eval(QT.$${MODULE}.PATCH_VERSION)") -@@ -59,7 +35,10 @@ macro(_populate_$${CMAKE_MODULE_NAME}_ta - set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration}) - - !!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE) -- set(imported_location \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_DLL_DIR}${LIB_LOCATION}\") -+ set(imported_location \"@NIX_OUT@/$${CMAKE_DLL_DIR}${LIB_LOCATION}\") -+ if(NOT EXISTS \"${imported_location}\") -+ set(imported_location \"@NIX_DEV@/$${CMAKE_DLL_DIR}${LIB_LOCATION}\") -+ endif() - !!ELSE - set(imported_location \"$${CMAKE_DLL_DIR}${LIB_LOCATION}\") - !!ENDIF -@@ -74,45 +53,17 @@ macro(_populate_$${CMAKE_MODULE_NAME}_ta - \"IMPORTED_LINK_INTERFACE_LIBRARIES_${Configuration}\" \"${_Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES}\" - ) - --!!IF !isEmpty(CMAKE_WINDOWS_BUILD) --!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) -- set(imported_implib \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\") --!!ELSE -- set(imported_implib \"IMPORTED_IMPLIB_${Configuration}\" \"$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\") --!!ENDIF -- _qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${imported_implib}) -- if(NOT \"${IMPLIB_LOCATION}\" STREQUAL \"\") -- set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES -- \"IMPORTED_IMPLIB_${Configuration}\" ${imported_implib} -- ) -- endif() --!!ENDIF - endmacro() - !!ENDIF - - if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME}) - - !!IF !no_module_headers --!!IF !isEmpty(CMAKE_BUILD_IS_FRAMEWORK) -- set(_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS -- \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}Qt$${CMAKE_MODULE_NAME}.framework\" -- \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}Qt$${CMAKE_MODULE_NAME}.framework/Headers\" -- ) --!!IF isEmpty(CMAKE_NO_PRIVATE_INCLUDES) -- set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS -- \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}Qt$${CMAKE_MODULE_NAME}.framework/Versions/$$section(VERSION, ., 0, 0)/Headers/$$VERSION/\" -- \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}Qt$${CMAKE_MODULE_NAME}.framework/Versions/$$section(VERSION, ., 0, 0)/Headers/$$VERSION/$${MODULE_INCNAME}\" -- ) --!!ELSE -- set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"\") --!!ENDIF --!!ELSE - !!IF isEmpty(CMAKE_INCLUDE_DIR_IS_ABSOLUTE) -- set(_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$$CMAKE_INCLUDE_DIR\" \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}\") -+ set(_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS \"@NIX_OUT@/lib\" \"@NIX_OUT@/lib/$${MODULE_INCNAME}.framework/Headers\") - !!IF isEmpty(CMAKE_NO_PRIVATE_INCLUDES) - set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS -- \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}/$$VERSION\" -- \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}/$$VERSION/$${MODULE_INCNAME}\" -+ \"\" - ) - !!ELSE - set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"\") -@@ -128,7 +80,7 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME - set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"\") - !!ENDIF - !!ENDIF --!!ENDIF -+ - !!IF !isEmpty(CMAKE_ADD_SOURCE_INCLUDE_DIRS) - include(\"${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake\" OPTIONAL) - !!ENDIF -@@ -253,28 +205,19 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME - - !!IF !isEmpty(CMAKE_FIND_OTHER_LIBRARY_BUILD) - !!IF isEmpty(CMAKE_DEBUG_TYPE) --!!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD) --!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) -- if (EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) --!!ELSE // CMAKE_LIB_DIR_IS_ABSOLUTE -- if (EXISTS \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) --!!ENDIF // CMAKE_LIB_DIR_IS_ABSOLUTE -- _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" \"\" ) --!!ELSE // CMAKE_STATIC_WINDOWS_BUILD - if (EXISTS - !!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE) -- \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_DLL_DIR}$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" -+ \"@NIX_OUT@/$${CMAKE_DLL_DIR}$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" - !!ELSE - \"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" - !!ENDIF - AND EXISTS - !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) -- \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) -+ \"@NIX_DEV@/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) - !!ELSE - \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) - !!ENDIF - _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) --!!ENDIF // CMAKE_STATIC_WINDOWS_BUILD - endif() - !!ENDIF // CMAKE_DEBUG_TYPE - !!ENDIF // CMAKE_FIND_OTHER_LIBRARY_BUILD -@@ -282,36 +225,23 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME - !!ENDIF // CMAKE_RELEASE_TYPE - - !!IF !isEmpty(CMAKE_DEBUG_TYPE) --!!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD) -- _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" \"\" ) --!!ELSE - _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) --!!ENDIF // CMAKE_STATIC_WINDOWS_BUILD - - !!IF !isEmpty(CMAKE_FIND_OTHER_LIBRARY_BUILD) - !!IF isEmpty(CMAKE_RELEASE_TYPE) --!!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD) --!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) -- if (EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" ) --!!ELSE // CMAKE_LIB_DIR_IS_ABSOLUTE -- if (EXISTS \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" ) --!!ENDIF // CMAKE_LIB_DIR_IS_ABSOLUTE -- _populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" \"\" ) --!!ELSE // CMAKE_STATIC_WINDOWS_BUILD - if (EXISTS - !!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE) -- \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_DLL_DIR}$${CMAKE_LIB_FILE_LOCATION_RELEASE}\" -+ \"@NIX_OUT@/$${CMAKE_DLL_DIR}$${CMAKE_LIB_FILE_LOCATION_RELEASE}\" - !!ELSE - \"$${CMAKE_LIB_FILE_LOCATION_RELEASE}\" - !!ENDIF - AND EXISTS - !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) -- \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" ) -+ \"@NIX_DEV@/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" ) - !!ELSE - \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" ) - !!ENDIF - _populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_LIB_FILE_LOCATION_RELEASE}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" ) --!!ENDIF // CMAKE_STATIC_WINDOWS_BUILD - endif() - !!ENDIF // CMAKE_RELEASE_TYPE - !!ENDIF // CMAKE_FIND_OTHER_LIBRARY_BUILD -@@ -328,11 +258,7 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME - macro(_populate_$${CMAKE_MODULE_NAME}_plugin_properties Plugin Configuration PLUGIN_LOCATION) - set_property(TARGET Qt5::${Plugin} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration}) - --!!IF isEmpty(CMAKE_PLUGIN_DIR_IS_ABSOLUTE) -- set(imported_location \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_PLUGIN_DIR}${PLUGIN_LOCATION}\") --!!ELSE -- set(imported_location \"$${CMAKE_PLUGIN_DIR}${PLUGIN_LOCATION}\") --!!ENDIF -+ set(imported_location \"${PLUGIN_LOCATION}\") - _qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${imported_location}) - set_target_properties(Qt5::${Plugin} PROPERTIES - \"IMPORTED_LOCATION_${Configuration}\" ${imported_location} -Index: qtbase-opensource-src-5.8.0/src/gui/Qt5GuiConfigExtras.cmake.in -=================================================================== ---- qtbase-opensource-src-5.8.0.orig/src/gui/Qt5GuiConfigExtras.cmake.in -+++ qtbase-opensource-src-5.8.0/src/gui/Qt5GuiConfigExtras.cmake.in -@@ -2,7 +2,7 @@ - !!IF !isEmpty(CMAKE_ANGLE_EGL_DLL_RELEASE) - - !!IF isEmpty(CMAKE_INCLUDE_DIR_IS_ABSOLUTE) --set(Qt5Gui_EGL_INCLUDE_DIRS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$$CMAKE_INCLUDE_DIR/QtANGLE\") -+set(Qt5Gui_EGL_INCLUDE_DIRS \"@NIX_DEV@/$$CMAKE_INCLUDE_DIR/QtANGLE\") - !!ELSE - set(Qt5Gui_EGL_INCLUDE_DIRS \"$$CMAKE_INCLUDE_DIR/QtANGLE\") - !!ENDIF -@@ -17,13 +17,13 @@ macro(_populate_qt5gui_gl_target_propert - set_property(TARGET Qt5::${TargetName} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration}) - - !!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE) -- set(imported_location \"${_qt5Gui_install_prefix}/$${CMAKE_DLL_DIR}${LIB_LOCATION}\") -+ set(imported_location \"@NIX_OUT@/$${CMAKE_DLL_DIR}${LIB_LOCATION}\") - !!ELSE - set(imported_location \"$${CMAKE_DLL_DIR}${LIB_LOCATION}\") - !!ENDIF - - !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) -- set(imported_implib \"${_qt5Gui_install_prefix}/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\") -+ set(imported_implib \"@NIX_DEV@/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\") - !!ELSE - set(imported_implib \"$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\") - !!ENDIF -Index: qtbase-opensource-src-5.8.0/src/widgets/Qt5WidgetsConfigExtras.cmake.in -=================================================================== ---- qtbase-opensource-src-5.8.0.orig/src/widgets/Qt5WidgetsConfigExtras.cmake.in -+++ qtbase-opensource-src-5.8.0/src/widgets/Qt5WidgetsConfigExtras.cmake.in -@@ -3,7 +3,7 @@ if (NOT TARGET Qt5::uic) - add_executable(Qt5::uic IMPORTED) - - !!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE) -- set(imported_location \"${_qt5Widgets_install_prefix}/$${CMAKE_BIN_DIR}uic$$CMAKE_BIN_SUFFIX\") -+ set(imported_location \"@NIX_DEV@/$${CMAKE_BIN_DIR}uic$$CMAKE_BIN_SUFFIX\") - !!ELSE - set(imported_location \"$${CMAKE_BIN_DIR}uic$$CMAKE_BIN_SUFFIX\") - !!ENDIF -Index: qtbase-opensource-src-5.8.0/src/corelib/Qt5CoreConfigExtras.cmake.in -=================================================================== ---- qtbase-opensource-src-5.8.0.orig/src/corelib/Qt5CoreConfigExtras.cmake.in -+++ qtbase-opensource-src-5.8.0/src/corelib/Qt5CoreConfigExtras.cmake.in -@@ -3,7 +3,7 @@ if (NOT TARGET Qt5::qmake) - add_executable(Qt5::qmake IMPORTED) - - !!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE) -- set(imported_location \"${_qt5Core_install_prefix}/$${CMAKE_BIN_DIR}qmake$$CMAKE_BIN_SUFFIX\") -+ set(imported_location \"@NIX_DEV@/$${CMAKE_BIN_DIR}qmake$$CMAKE_BIN_SUFFIX\") - !!ELSE - set(imported_location \"$${CMAKE_BIN_DIR}qmake$$CMAKE_BIN_SUFFIX\") - !!ENDIF -@@ -18,7 +18,7 @@ if (NOT TARGET Qt5::moc) - add_executable(Qt5::moc IMPORTED) - - !!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE) -- set(imported_location \"${_qt5Core_install_prefix}/$${CMAKE_BIN_DIR}moc$$CMAKE_BIN_SUFFIX\") -+ set(imported_location \"@NIX_DEV@/$${CMAKE_BIN_DIR}moc$$CMAKE_BIN_SUFFIX\") - !!ELSE - set(imported_location \"$${CMAKE_BIN_DIR}moc$$CMAKE_BIN_SUFFIX\") - !!ENDIF -@@ -35,7 +35,7 @@ if (NOT TARGET Qt5::rcc) - add_executable(Qt5::rcc IMPORTED) - - !!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE) -- set(imported_location \"${_qt5Core_install_prefix}/$${CMAKE_BIN_DIR}rcc$$CMAKE_BIN_SUFFIX\") -+ set(imported_location \"@NIX_DEV@/$${CMAKE_BIN_DIR}rcc$$CMAKE_BIN_SUFFIX\") - !!ELSE - set(imported_location \"$${CMAKE_BIN_DIR}rcc$$CMAKE_BIN_SUFFIX\") - !!ENDIF -@@ -131,7 +131,7 @@ if (NOT TARGET Qt5::WinMain) - !!IF !isEmpty(CMAKE_RELEASE_TYPE) - set_property(TARGET Qt5::WinMain APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) - !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) -- set(imported_location \"${_qt5Core_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_RELEASE}\") -+ set(imported_location \"@NIX_DEV@/$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_RELEASE}\") - !!ELSE - set(imported_location \"$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_RELEASE}\") - !!ENDIF -@@ -145,7 +145,7 @@ if (NOT TARGET Qt5::WinMain) - set_property(TARGET Qt5::WinMain APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) - - !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) -- set(imported_location \"${_qt5Core_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_DEBUG}\") -+ set(imported_location \"@NIX_DEV@/$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_DEBUG}\") - !!ELSE - set(imported_location \"$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_DEBUG}\") - !!ENDIF -Index: qtbase-opensource-src-5.8.0/src/corelib/Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in -=================================================================== ---- qtbase-opensource-src-5.8.0.orig/src/corelib/Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in -+++ qtbase-opensource-src-5.8.0/src/corelib/Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in -@@ -1,6 +1,6 @@ - - !!IF isEmpty(CMAKE_INSTALL_DATA_DIR_IS_ABSOLUTE) --set(_qt5_corelib_extra_includes \"${_qt5Core_install_prefix}/$${CMAKE_INSTALL_DATA_DIR}/mkspecs/$${CMAKE_MKSPEC}\") -+set(_qt5_corelib_extra_includes \"@NIX_DEV@/$${CMAKE_INSTALL_DATA_DIR}/mkspecs/$${CMAKE_MKSPEC}\") - !!ELSE - set(_qt5_corelib_extra_includes \"$${CMAKE_INSTALL_DATA_DIR}mkspecs/$${CMAKE_MKSPEC}\") - !!ENDIF -Index: qtbase-opensource-src-5.8.0/src/corelib/Qt5CoreConfigExtrasMkspecDir.cmake.in -=================================================================== ---- qtbase-opensource-src-5.8.0.orig/src/corelib/Qt5CoreConfigExtrasMkspecDir.cmake.in -+++ qtbase-opensource-src-5.8.0/src/corelib/Qt5CoreConfigExtrasMkspecDir.cmake.in -@@ -1,6 +1,6 @@ - - !!IF isEmpty(CMAKE_HOST_DATA_DIR_IS_ABSOLUTE) --set(_qt5_corelib_extra_includes \"${_qt5Core_install_prefix}/$${CMAKE_HOST_DATA_DIR}/mkspecs/$${CMAKE_MKSPEC}\") -+set(_qt5_corelib_extra_includes \"@NIX_DEV@/$${CMAKE_HOST_DATA_DIR}/mkspecs/$${CMAKE_MKSPEC}\") - !!ELSE - set(_qt5_corelib_extra_includes \"$${CMAKE_HOST_DATA_DIR}mkspecs/$${CMAKE_MKSPEC}\") - !!ENDIF -Index: qtbase-opensource-src-5.8.0/src/dbus/Qt5DBusConfigExtras.cmake.in -=================================================================== ---- qtbase-opensource-src-5.8.0.orig/src/dbus/Qt5DBusConfigExtras.cmake.in -+++ qtbase-opensource-src-5.8.0/src/dbus/Qt5DBusConfigExtras.cmake.in -@@ -3,7 +3,7 @@ if (NOT TARGET Qt5::qdbuscpp2xml) - add_executable(Qt5::qdbuscpp2xml IMPORTED) - - !!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE) -- set(imported_location \"${_qt5DBus_install_prefix}/$${CMAKE_BIN_DIR}qdbuscpp2xml$$CMAKE_BIN_SUFFIX\") -+ set(imported_location \"@NIX_DEV@/$${CMAKE_BIN_DIR}qdbuscpp2xml$$CMAKE_BIN_SUFFIX\") - !!ELSE - set(imported_location \"$${CMAKE_BIN_DIR}qdbuscpp2xml$$CMAKE_BIN_SUFFIX\") - !!ENDIF -@@ -18,7 +18,7 @@ if (NOT TARGET Qt5::qdbusxml2cpp) - add_executable(Qt5::qdbusxml2cpp IMPORTED) - - !!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE) -- set(imported_location \"${_qt5DBus_install_prefix}/$${CMAKE_BIN_DIR}qdbusxml2cpp$$CMAKE_BIN_SUFFIX\") -+ set(imported_location \"@NIX_DEV@/$${CMAKE_BIN_DIR}qdbusxml2cpp$$CMAKE_BIN_SUFFIX\") - !!ELSE - set(imported_location \"$${CMAKE_BIN_DIR}qdbusxml2cpp$$CMAKE_BIN_SUFFIX\") - !!ENDIF -Index: qtbase-opensource-src-5.8.0/mkspecs/features/create_cmake.prf -=================================================================== ---- qtbase-opensource-src-5.8.0.orig/mkspecs/features/create_cmake.prf -+++ qtbase-opensource-src-5.8.0/mkspecs/features/create_cmake.prf -@@ -136,28 +136,28 @@ contains(CONFIG, plugin) { - - win32 { - isEmpty(CMAKE_STATIC_TYPE) { -- CMAKE_PLUGIN_LOCATION_RELEASE = $$PLUGIN_TYPE/$${TARGET}.dll -- CMAKE_PLUGIN_LOCATION_DEBUG = $$PLUGIN_TYPE/$${TARGET}d.dll -+ CMAKE_PLUGIN_LOCATION_RELEASE = $${CMAKE_PLUGIN_DIR}$$PLUGIN_TYPE/$${TARGET}.dll -+ CMAKE_PLUGIN_LOCATION_DEBUG = $${CMAKE_PLUGIN_DIR}$$PLUGIN_TYPE/$${TARGET}d.dll - } else:mingw { -- CMAKE_PLUGIN_LOCATION_RELEASE = $$PLUGIN_TYPE/lib$${TARGET}.a -- CMAKE_PLUGIN_LOCATION_DEBUG = $$PLUGIN_TYPE/lib$${TARGET}d.a -+ CMAKE_PLUGIN_LOCATION_RELEASE = $${CMAKE_PLUGIN_DIR}/$$PLUGIN_TYPE/lib$${TARGET}.a -+ CMAKE_PLUGIN_LOCATION_DEBUG = $${CMAKE_PLUGIN_DIR}$$PLUGIN_TYPE/lib$${TARGET}d.a - } else { # MSVC static -- CMAKE_PLUGIN_LOCATION_RELEASE = $$PLUGIN_TYPE/$${TARGET}.lib -- CMAKE_PLUGIN_LOCATION_DEBUG = $$PLUGIN_TYPE/$${TARGET}d.lib -+ CMAKE_PLUGIN_LOCATION_RELEASE = $${CMAKE_PLUGIN_DIR}$$PLUGIN_TYPE/$${TARGET}.lib -+ CMAKE_PLUGIN_LOCATION_DEBUG = $${CMAKE_PLUGIN_DIR}$$PLUGIN_TYPE/$${TARGET}d.lib - } - } else { - mac { - isEmpty(CMAKE_STATIC_TYPE): CMAKE_PlUGIN_EXT = .dylib - else: CMAKE_PlUGIN_EXT = .a - -- CMAKE_PLUGIN_LOCATION_RELEASE = $$PLUGIN_TYPE/lib$${TARGET}$${CMAKE_PlUGIN_EXT} -- CMAKE_PLUGIN_LOCATION_DEBUG = $$PLUGIN_TYPE/lib$${TARGET}$${CMAKE_PlUGIN_EXT} -+ CMAKE_PLUGIN_LOCATION_RELEASE = $${CMAKE_PLUGIN_DIR}$$PLUGIN_TYPE/lib$${TARGET}$${CMAKE_PlUGIN_EXT} -+ CMAKE_PLUGIN_LOCATION_DEBUG = $${CMAKE_PLUGIN_DIR}$$PLUGIN_TYPE/lib$${TARGET}$${CMAKE_PlUGIN_EXT} - } else { - isEmpty(CMAKE_STATIC_TYPE): CMAKE_PlUGIN_EXT = .so - else: CMAKE_PlUGIN_EXT = .a - -- CMAKE_PLUGIN_LOCATION_RELEASE = $$PLUGIN_TYPE/lib$${TARGET}$${CMAKE_PlUGIN_EXT} -- CMAKE_PLUGIN_LOCATION_DEBUG = $$PLUGIN_TYPE/lib$${TARGET}$${CMAKE_PlUGIN_EXT} -+ CMAKE_PLUGIN_LOCATION_RELEASE = $${CMAKE_PLUGIN_DIR}$$PLUGIN_TYPE/lib$${TARGET}$${CMAKE_PlUGIN_EXT} -+ CMAKE_PLUGIN_LOCATION_DEBUG = $${CMAKE_PLUGIN_DIR}$$PLUGIN_TYPE/lib$${TARGET}$${CMAKE_PlUGIN_EXT} - } - } - cmake_target_file.input = $$PWD/data/cmake/Qt5PluginTarget.cmake.in -Index: qtbase-opensource-src-5.8.0/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in -=================================================================== ---- qtbase-opensource-src-5.8.0.orig/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in -+++ qtbase-opensource-src-5.8.0/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in -@@ -2,10 +2,10 @@ - add_library(Qt5::$$CMAKE_PLUGIN_NAME MODULE IMPORTED) - - !!IF !isEmpty(CMAKE_RELEASE_TYPE) --_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME RELEASE \"$${CMAKE_PLUGIN_LOCATION_RELEASE}\") -+_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME RELEASE \"@NIX_OUT@/$${CMAKE_PLUGIN_LOCATION_RELEASE}\") - !!ENDIF - !!IF !isEmpty(CMAKE_DEBUG_TYPE) --_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME DEBUG \"$${CMAKE_PLUGIN_LOCATION_DEBUG}\") -+_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME DEBUG \"@NIX_OUT@/$${CMAKE_PLUGIN_LOCATION_DEBUG}\") - !!ENDIF - - list(APPEND Qt5$${CMAKE_MODULE_NAME}_PLUGINS Qt5::$$CMAKE_PLUGIN_NAME) diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/cmake-paths.patch b/pkgs/development/libraries/qt-5/5.8/qtbase/cmake-paths.patch index 0d5c2d510929..c43653558e32 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtbase/cmake-paths.patch +++ b/pkgs/development/libraries/qt-5/5.8/qtbase/cmake-paths.patch @@ -1,7 +1,7 @@ -Index: qtbase-opensource-src-5.7.0/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in +Index: qtbase-opensource-src-5.8.0/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in =================================================================== ---- qtbase-opensource-src-5.7.0.orig/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in -+++ qtbase-opensource-src-5.7.0/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in +--- qtbase-opensource-src-5.8.0.orig/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in ++++ qtbase-opensource-src-5.8.0/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in @@ -9,30 +9,6 @@ if (CMAKE_VERSION VERSION_LESS 3.0.0) endif() !!ENDIF @@ -45,7 +45,7 @@ Index: qtbase-opensource-src-5.7.0/mkspecs/features/data/cmake/Qt5BasicConfig.cm !!ELSE set(imported_location \"$${CMAKE_DLL_DIR}${LIB_LOCATION}\") !!ENDIF -@@ -74,45 +53,18 @@ macro(_populate_$${CMAKE_MODULE_NAME}_ta +@@ -74,19 +53,6 @@ macro(_populate_$${CMAKE_MODULE_NAME}_ta \"IMPORTED_LINK_INTERFACE_LIBRARIES_${Configuration}\" \"${_Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES}\" ) @@ -65,23 +65,26 @@ Index: qtbase-opensource-src-5.7.0/mkspecs/features/data/cmake/Qt5BasicConfig.cm endmacro() !!ENDIF - if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME}) - +@@ -95,24 +61,24 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME !!IF !no_module_headers --!!IF !isEmpty(CMAKE_BUILD_IS_FRAMEWORK) -- set(_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS + !!IF !isEmpty(CMAKE_BUILD_IS_FRAMEWORK) + set(_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS - \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}Qt$${CMAKE_MODULE_NAME}.framework\" - \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}Qt$${CMAKE_MODULE_NAME}.framework/Headers\" -- ) --!!IF isEmpty(CMAKE_NO_PRIVATE_INCLUDES) -- set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS ++ \"@NIX_OUT@/$${CMAKE_LIB_DIR}Qt$${CMAKE_MODULE_NAME}.framework\" ++ \"@NIX_OUT@/$${CMAKE_LIB_DIR}Qt$${CMAKE_MODULE_NAME}.framework/Headers\" + ) + !!IF isEmpty(CMAKE_NO_PRIVATE_INCLUDES) + set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS - \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}Qt$${CMAKE_MODULE_NAME}.framework/Versions/$$section(VERSION, ., 0, 0)/Headers/$$VERSION/\" - \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}Qt$${CMAKE_MODULE_NAME}.framework/Versions/$$section(VERSION, ., 0, 0)/Headers/$$VERSION/$${MODULE_INCNAME}\" -- ) --!!ELSE -- set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"\") --!!ENDIF --!!ELSE ++ \"@NIX_OUT@/$${CMAKE_LIB_DIR}Qt$${CMAKE_MODULE_NAME}.framework/Versions/$$section(VERSION, ., 0, 0)/Headers/$$VERSION/\" ++ \"@NIX_OUT@/$${CMAKE_LIB_DIR}Qt$${CMAKE_MODULE_NAME}.framework/Versions/$$section(VERSION, ., 0, 0)/Headers/$$VERSION/$${MODULE_INCNAME}\" + ) + !!ELSE + set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"\") + !!ENDIF + !!ELSE !!IF isEmpty(CMAKE_INCLUDE_DIR_IS_ABSOLUTE) - set(_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$$CMAKE_INCLUDE_DIR\" \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}\") + set(_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS \"@NIX_DEV@/$$CMAKE_INCLUDE_DIR\" \"@NIX_DEV@/$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}\") @@ -94,27 +97,17 @@ Index: qtbase-opensource-src-5.7.0/mkspecs/features/data/cmake/Qt5BasicConfig.cm ) !!ELSE set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"\") -@@ -128,7 +80,7 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME - set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"\") - !!ENDIF - !!ENDIF --!!ENDIF -+ - !!IF !isEmpty(CMAKE_ADD_SOURCE_INCLUDE_DIRS) - include(\"${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake\" OPTIONAL) - !!ENDIF -@@ -253,28 +205,19 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME - - !!IF !isEmpty(CMAKE_FIND_OTHER_LIBRARY_BUILD) +@@ -255,7 +221,7 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME !!IF isEmpty(CMAKE_DEBUG_TYPE) --!!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD) --!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) + !!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD) + !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) - if (EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) --!!ELSE // CMAKE_LIB_DIR_IS_ABSOLUTE -- if (EXISTS \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) --!!ENDIF // CMAKE_LIB_DIR_IS_ABSOLUTE -- _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" \"\" ) --!!ELSE // CMAKE_STATIC_WINDOWS_BUILD ++ if (EXISTS \"@NIX_OUT@/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) + !!ELSE // CMAKE_LIB_DIR_IS_ABSOLUTE + if (EXISTS \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) + !!ENDIF // CMAKE_LIB_DIR_IS_ABSOLUTE +@@ -263,13 +229,13 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME + !!ELSE // CMAKE_STATIC_WINDOWS_BUILD if (EXISTS !!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE) - \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_DLL_DIR}$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" @@ -129,31 +122,17 @@ Index: qtbase-opensource-src-5.7.0/mkspecs/features/data/cmake/Qt5BasicConfig.cm !!ELSE \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) !!ENDIF - _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) --!!ENDIF // CMAKE_STATIC_WINDOWS_BUILD - endif() - !!ENDIF // CMAKE_DEBUG_TYPE - !!ENDIF // CMAKE_FIND_OTHER_LIBRARY_BUILD -@@ -282,36 +225,23 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME - !!ENDIF // CMAKE_RELEASE_TYPE - - !!IF !isEmpty(CMAKE_DEBUG_TYPE) --!!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD) -- _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" \"\" ) --!!ELSE - _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) --!!ENDIF // CMAKE_STATIC_WINDOWS_BUILD - - !!IF !isEmpty(CMAKE_FIND_OTHER_LIBRARY_BUILD) +@@ -292,7 +258,7 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME !!IF isEmpty(CMAKE_RELEASE_TYPE) --!!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD) --!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) + !!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD) + !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) - if (EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" ) --!!ELSE // CMAKE_LIB_DIR_IS_ABSOLUTE -- if (EXISTS \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" ) --!!ENDIF // CMAKE_LIB_DIR_IS_ABSOLUTE -- _populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" \"\" ) --!!ELSE // CMAKE_STATIC_WINDOWS_BUILD ++ if (EXISTS \"@NIX_DEV@/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" ) + !!ELSE // CMAKE_LIB_DIR_IS_ABSOLUTE + if (EXISTS \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" ) + !!ENDIF // CMAKE_LIB_DIR_IS_ABSOLUTE +@@ -300,13 +266,13 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME + !!ELSE // CMAKE_STATIC_WINDOWS_BUILD if (EXISTS !!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE) - \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_DLL_DIR}$${CMAKE_LIB_FILE_LOCATION_RELEASE}\" @@ -168,12 +147,7 @@ Index: qtbase-opensource-src-5.7.0/mkspecs/features/data/cmake/Qt5BasicConfig.cm !!ELSE \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" ) !!ENDIF - _populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_LIB_FILE_LOCATION_RELEASE}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" ) --!!ENDIF // CMAKE_STATIC_WINDOWS_BUILD - endif() - !!ENDIF // CMAKE_RELEASE_TYPE - !!ENDIF // CMAKE_FIND_OTHER_LIBRARY_BUILD -@@ -328,11 +258,7 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME +@@ -328,11 +294,7 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME macro(_populate_$${CMAKE_MODULE_NAME}_plugin_properties Plugin Configuration PLUGIN_LOCATION) set_property(TARGET Qt5::${Plugin} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration}) @@ -186,10 +160,10 @@ Index: qtbase-opensource-src-5.7.0/mkspecs/features/data/cmake/Qt5BasicConfig.cm _qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${imported_location}) set_target_properties(Qt5::${Plugin} PROPERTIES \"IMPORTED_LOCATION_${Configuration}\" ${imported_location} -Index: qtbase-opensource-src-5.7.0/src/gui/Qt5GuiConfigExtras.cmake.in +Index: qtbase-opensource-src-5.8.0/src/gui/Qt5GuiConfigExtras.cmake.in =================================================================== ---- qtbase-opensource-src-5.7.0.orig/src/gui/Qt5GuiConfigExtras.cmake.in -+++ qtbase-opensource-src-5.7.0/src/gui/Qt5GuiConfigExtras.cmake.in +--- qtbase-opensource-src-5.8.0.orig/src/gui/Qt5GuiConfigExtras.cmake.in ++++ qtbase-opensource-src-5.8.0/src/gui/Qt5GuiConfigExtras.cmake.in @@ -2,7 +2,7 @@ !!IF !isEmpty(CMAKE_ANGLE_EGL_DLL_RELEASE) @@ -215,10 +189,10 @@ Index: qtbase-opensource-src-5.7.0/src/gui/Qt5GuiConfigExtras.cmake.in !!ELSE set(imported_implib \"$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\") !!ENDIF -Index: qtbase-opensource-src-5.7.0/src/widgets/Qt5WidgetsConfigExtras.cmake.in +Index: qtbase-opensource-src-5.8.0/src/widgets/Qt5WidgetsConfigExtras.cmake.in =================================================================== ---- qtbase-opensource-src-5.7.0.orig/src/widgets/Qt5WidgetsConfigExtras.cmake.in -+++ qtbase-opensource-src-5.7.0/src/widgets/Qt5WidgetsConfigExtras.cmake.in +--- qtbase-opensource-src-5.8.0.orig/src/widgets/Qt5WidgetsConfigExtras.cmake.in ++++ qtbase-opensource-src-5.8.0/src/widgets/Qt5WidgetsConfigExtras.cmake.in @@ -3,7 +3,7 @@ if (NOT TARGET Qt5::uic) add_executable(Qt5::uic IMPORTED) @@ -228,10 +202,10 @@ Index: qtbase-opensource-src-5.7.0/src/widgets/Qt5WidgetsConfigExtras.cmake.in !!ELSE set(imported_location \"$${CMAKE_BIN_DIR}uic$$CMAKE_BIN_SUFFIX\") !!ENDIF -Index: qtbase-opensource-src-5.7.0/src/corelib/Qt5CoreConfigExtras.cmake.in +Index: qtbase-opensource-src-5.8.0/src/corelib/Qt5CoreConfigExtras.cmake.in =================================================================== ---- qtbase-opensource-src-5.7.0.orig/src/corelib/Qt5CoreConfigExtras.cmake.in -+++ qtbase-opensource-src-5.7.0/src/corelib/Qt5CoreConfigExtras.cmake.in +--- qtbase-opensource-src-5.8.0.orig/src/corelib/Qt5CoreConfigExtras.cmake.in ++++ qtbase-opensource-src-5.8.0/src/corelib/Qt5CoreConfigExtras.cmake.in @@ -3,7 +3,7 @@ if (NOT TARGET Qt5::qmake) add_executable(Qt5::qmake IMPORTED) @@ -277,10 +251,10 @@ Index: qtbase-opensource-src-5.7.0/src/corelib/Qt5CoreConfigExtras.cmake.in !!ELSE set(imported_location \"$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_DEBUG}\") !!ENDIF -Index: qtbase-opensource-src-5.7.0/src/corelib/Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in +Index: qtbase-opensource-src-5.8.0/src/corelib/Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in =================================================================== ---- qtbase-opensource-src-5.7.0.orig/src/corelib/Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in -+++ qtbase-opensource-src-5.7.0/src/corelib/Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in +--- qtbase-opensource-src-5.8.0.orig/src/corelib/Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in ++++ qtbase-opensource-src-5.8.0/src/corelib/Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in @@ -1,6 +1,6 @@ !!IF isEmpty(CMAKE_INSTALL_DATA_DIR_IS_ABSOLUTE) @@ -289,10 +263,10 @@ Index: qtbase-opensource-src-5.7.0/src/corelib/Qt5CoreConfigExtrasMkspecDirForIn !!ELSE set(_qt5_corelib_extra_includes \"$${CMAKE_INSTALL_DATA_DIR}mkspecs/$${CMAKE_MKSPEC}\") !!ENDIF -Index: qtbase-opensource-src-5.7.0/src/corelib/Qt5CoreConfigExtrasMkspecDir.cmake.in +Index: qtbase-opensource-src-5.8.0/src/corelib/Qt5CoreConfigExtrasMkspecDir.cmake.in =================================================================== ---- qtbase-opensource-src-5.7.0.orig/src/corelib/Qt5CoreConfigExtrasMkspecDir.cmake.in -+++ qtbase-opensource-src-5.7.0/src/corelib/Qt5CoreConfigExtrasMkspecDir.cmake.in +--- qtbase-opensource-src-5.8.0.orig/src/corelib/Qt5CoreConfigExtrasMkspecDir.cmake.in ++++ qtbase-opensource-src-5.8.0/src/corelib/Qt5CoreConfigExtrasMkspecDir.cmake.in @@ -1,6 +1,6 @@ !!IF isEmpty(CMAKE_HOST_DATA_DIR_IS_ABSOLUTE) @@ -301,10 +275,10 @@ Index: qtbase-opensource-src-5.7.0/src/corelib/Qt5CoreConfigExtrasMkspecDir.cmak !!ELSE set(_qt5_corelib_extra_includes \"$${CMAKE_HOST_DATA_DIR}mkspecs/$${CMAKE_MKSPEC}\") !!ENDIF -Index: qtbase-opensource-src-5.7.0/src/dbus/Qt5DBusConfigExtras.cmake.in +Index: qtbase-opensource-src-5.8.0/src/dbus/Qt5DBusConfigExtras.cmake.in =================================================================== ---- qtbase-opensource-src-5.7.0.orig/src/dbus/Qt5DBusConfigExtras.cmake.in -+++ qtbase-opensource-src-5.7.0/src/dbus/Qt5DBusConfigExtras.cmake.in +--- qtbase-opensource-src-5.8.0.orig/src/dbus/Qt5DBusConfigExtras.cmake.in ++++ qtbase-opensource-src-5.8.0/src/dbus/Qt5DBusConfigExtras.cmake.in @@ -3,7 +3,7 @@ if (NOT TARGET Qt5::qdbuscpp2xml) add_executable(Qt5::qdbuscpp2xml IMPORTED) @@ -323,10 +297,27 @@ Index: qtbase-opensource-src-5.7.0/src/dbus/Qt5DBusConfigExtras.cmake.in !!ELSE set(imported_location \"$${CMAKE_BIN_DIR}qdbusxml2cpp$$CMAKE_BIN_SUFFIX\") !!ENDIF -Index: qtbase-opensource-src-5.7.0/mkspecs/features/create_cmake.prf +Index: qtbase-opensource-src-5.8.0/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in =================================================================== ---- qtbase-opensource-src-5.7.0.orig/mkspecs/features/create_cmake.prf -+++ qtbase-opensource-src-5.7.0/mkspecs/features/create_cmake.prf +--- qtbase-opensource-src-5.8.0.orig/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in ++++ qtbase-opensource-src-5.8.0/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in +@@ -2,10 +2,10 @@ + add_library(Qt5::$$CMAKE_PLUGIN_NAME MODULE IMPORTED) + + !!IF !isEmpty(CMAKE_RELEASE_TYPE) +-_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME RELEASE \"$${CMAKE_PLUGIN_LOCATION_RELEASE}\") ++_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME RELEASE \"@NIX_OUT@/$${CMAKE_PLUGIN_LOCATION_RELEASE}\") + !!ENDIF + !!IF !isEmpty(CMAKE_DEBUG_TYPE) +-_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME DEBUG \"$${CMAKE_PLUGIN_LOCATION_DEBUG}\") ++_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME DEBUG \"@NIX_OUT@/$${CMAKE_PLUGIN_LOCATION_DEBUG}\") + !!ENDIF + + list(APPEND Qt5$${CMAKE_MODULE_NAME}_PLUGINS Qt5::$$CMAKE_PLUGIN_NAME) +Index: qtbase-opensource-src-5.8.0/mkspecs/features/create_cmake.prf +=================================================================== +--- qtbase-opensource-src-5.8.0.orig/mkspecs/features/create_cmake.prf ++++ qtbase-opensource-src-5.8.0/mkspecs/features/create_cmake.prf @@ -136,28 +136,28 @@ contains(CONFIG, plugin) { win32 { @@ -338,7 +329,7 @@ Index: qtbase-opensource-src-5.7.0/mkspecs/features/create_cmake.prf } else:mingw { - CMAKE_PLUGIN_LOCATION_RELEASE = $$PLUGIN_TYPE/lib$${TARGET}.a - CMAKE_PLUGIN_LOCATION_DEBUG = $$PLUGIN_TYPE/lib$${TARGET}d.a -+ CMAKE_PLUGIN_LOCATION_RELEASE = $${CMAKE_PLUGIN_DIR}/$$PLUGIN_TYPE/lib$${TARGET}.a ++ CMAKE_PLUGIN_LOCATION_RELEASE = $${CMAKE_PLUGIN_DIR}$$PLUGIN_TYPE/lib$${TARGET}.a + CMAKE_PLUGIN_LOCATION_DEBUG = $${CMAKE_PLUGIN_DIR}$$PLUGIN_TYPE/lib$${TARGET}d.a } else { # MSVC static - CMAKE_PLUGIN_LOCATION_RELEASE = $$PLUGIN_TYPE/$${TARGET}.lib @@ -366,20 +357,3 @@ Index: qtbase-opensource-src-5.7.0/mkspecs/features/create_cmake.prf } } cmake_target_file.input = $$PWD/data/cmake/Qt5PluginTarget.cmake.in -Index: qtbase-opensource-src-5.7.0/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in -=================================================================== ---- qtbase-opensource-src-5.7.0.orig/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in -+++ qtbase-opensource-src-5.7.0/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in -@@ -2,10 +2,10 @@ - add_library(Qt5::$$CMAKE_PLUGIN_NAME MODULE IMPORTED) - - !!IF !isEmpty(CMAKE_RELEASE_TYPE) --_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME RELEASE \"$${CMAKE_PLUGIN_LOCATION_RELEASE}\") -+_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME RELEASE \"@NIX_OUT@/$${CMAKE_PLUGIN_LOCATION_RELEASE}\") - !!ENDIF - !!IF !isEmpty(CMAKE_DEBUG_TYPE) --_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME DEBUG \"$${CMAKE_PLUGIN_LOCATION_DEBUG}\") -+_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME DEBUG \"@NIX_OUT@/$${CMAKE_PLUGIN_LOCATION_DEBUG}\") - !!ENDIF - - list(APPEND Qt5$${CMAKE_MODULE_NAME}_PLUGINS Qt5::$$CMAKE_PLUGIN_NAME) diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix b/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix index 719afe75a536..52e24eceea98 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix +++ b/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix @@ -37,8 +37,7 @@ stdenv.mkDerivation { outputs = [ "out" "dev" ]; patches = - copyPathsToStore (lib.readPathsFromFile ./. ./series) - ++ [(if stdenv.isDarwin then ./cmake-paths-darwin.patch else ./cmake-paths.patch)]; + copyPathsToStore (lib.readPathsFromFile ./. ./series); postPatch = '' @@ -280,15 +279,33 @@ stdenv.mkDerivation { '' # Don't retain build-time dependencies like gdb. sed '/QMAKE_DEFAULT_.*DIRS/ d' -i $dev/mkspecs/qconfig.pri + '' - # Move libtool archives and qmake projects + # Move libtool archives into $dev + + '' if [ "z''${!outputLib}" != "z''${!outputDev}" ]; then pushd "''${!outputLib}" - find lib -name '*.a' -o -name '*.la'${if stdenv.isDarwin then "" else "-o -name '*.prl'"} | \ - while read -r file; do - mkdir -p "''${!outputDev}/$(dirname "$file")" - mv "''${!outputLib}/$file" "''${!outputDev}/$file" - done + find lib -name '*.a' -o -name '*.la' | while read -r file; do + mkdir -p "''${!outputDev}/$(dirname "$file")" + mv "''${!outputLib}/$file" "''${!outputDev}/$file" + done + popd + fi + '' + + # Move qmake project files into $dev. + # Don't move .prl files on darwin because they end up in + # "dev/lib/Foo.framework/Foo.prl" which interferes with subsequent + # use of lndir in the qtbase setup-hook. On Linux, the .prl files + # are in lib, and so do not cause a subsequent recreation of deep + # framework directory trees. + + lib.optionalString (!stdenv.isDarwin) '' + if [ "z''${!outputLib}" != "z''${!outputDev}" ]; then + pushd "''${!outputLib}" + find lib -name '*.prl' | while read -r file; do + mkdir -p "''${!outputDev}/$(dirname "$file")" + mv "''${!outputLib}/$file" "''${!outputDev}/$file" + done popd fi '' @@ -299,11 +316,6 @@ stdenv.mkDerivation { -e "/^host_bins=/ c host_bins=$dev/bin" '' - # Don' move .prl files on darwin because they end up in - # "dev/lib/Foo.framework/Foo.prl" which interferes with subsequent - # use of lndir in the qtbase setup-hook. On Linux, the .prl files - # are in lib, and so do not cause a subsequent recreation of deep - # framework directory trees. + lib.optionalString stdenv.isDarwin '' fixDarwinDylibNames_rpath() { local flags=() diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/series b/pkgs/development/libraries/qt-5/5.8/qtbase/series index 9939aea74003..afce06826c69 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtbase/series +++ b/pkgs/development/libraries/qt-5/5.8/qtbase/series @@ -8,3 +8,4 @@ compose-search-path.patch libressl.patch qpa-plugin-path.patch dlopen-gl.patch +cmake-paths.patch From bd92780b4c8b1803b570491eb40e4d4d8dbfaad5 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Tue, 18 Apr 2017 05:47:39 -0500 Subject: [PATCH 18/32] sddm: include dependency on Qt5::Test module --- pkgs/applications/display-managers/sddm/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/applications/display-managers/sddm/default.nix b/pkgs/applications/display-managers/sddm/default.nix index f675febafb56..d1f487b37acf 100644 --- a/pkgs/applications/display-managers/sddm/default.nix +++ b/pkgs/applications/display-managers/sddm/default.nix @@ -25,6 +25,12 @@ let }) ]; + postPatch = + # Module Qt5::Test must be included in `find_package` before it is used. + '' + sed -i CMakeLists.txt -e '/find_package(Qt5/ s|)| Test)|' + ''; + nativeBuildInputs = [ cmake extra-cmake-modules pkgconfig qttools ]; buildInputs = [ From c37220fcf92f590be66bfc7289e498044d429640 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Tue, 18 Apr 2017 08:11:17 -0500 Subject: [PATCH 19/32] kwindowsystem: purify platform plugin detection --- .../libraries/kde-frameworks/default.nix | 2 +- .../default.nix} | 6 ++++- .../kwindowsystem/platform-plugins-path.patch | 22 +++++++++++++++++++ .../kde-frameworks/kwindowsystem/series | 1 + 4 files changed, 29 insertions(+), 2 deletions(-) rename pkgs/development/libraries/kde-frameworks/{kwindowsystem.nix => kwindowsystem/default.nix} (61%) create mode 100644 pkgs/development/libraries/kde-frameworks/kwindowsystem/platform-plugins-path.patch create mode 100644 pkgs/development/libraries/kde-frameworks/kwindowsystem/series diff --git a/pkgs/development/libraries/kde-frameworks/default.nix b/pkgs/development/libraries/kde-frameworks/default.nix index 2906dc788865..221fba628ba9 100644 --- a/pkgs/development/libraries/kde-frameworks/default.nix +++ b/pkgs/development/libraries/kde-frameworks/default.nix @@ -96,7 +96,7 @@ let kwallet = callPackage ./kwallet.nix {}; kwayland = callPackage ./kwayland.nix {}; kwidgetsaddons = callPackage ./kwidgetsaddons.nix {}; - kwindowsystem = callPackage ./kwindowsystem.nix {}; + kwindowsystem = callPackage ./kwindowsystem {}; kxmlgui = callPackage ./kxmlgui.nix {}; kxmlrpcclient = callPackage ./kxmlrpcclient.nix {}; modemmanager-qt = callPackage ./modemmanager-qt.nix {}; diff --git a/pkgs/development/libraries/kde-frameworks/kwindowsystem.nix b/pkgs/development/libraries/kde-frameworks/kwindowsystem/default.nix similarity index 61% rename from pkgs/development/libraries/kde-frameworks/kwindowsystem.nix rename to pkgs/development/libraries/kde-frameworks/kwindowsystem/default.nix index 4bfd813ff932..8a91bdbac528 100644 --- a/pkgs/development/libraries/kde-frameworks/kwindowsystem.nix +++ b/pkgs/development/libraries/kde-frameworks/kwindowsystem/default.nix @@ -1,5 +1,5 @@ { - kdeFramework, lib, + kdeFramework, lib, copyPathsToStore, extra-cmake-modules, qtbase, qttools, qtx11extras }: @@ -12,4 +12,8 @@ kdeFramework { }; nativeBuildInputs = [ extra-cmake-modules qttools ]; propagatedBuildInputs = [ qtx11extras ]; + patches = copyPathsToStore (lib.readPathsFromFile ./. ./series); + preConfigure = '' + NIX_CFLAGS_COMPILE+=" -DNIXPKGS_QT_PLUGIN_PATH=\"$out/lib/qt5/plugins\"" + ''; } diff --git a/pkgs/development/libraries/kde-frameworks/kwindowsystem/platform-plugins-path.patch b/pkgs/development/libraries/kde-frameworks/kwindowsystem/platform-plugins-path.patch new file mode 100644 index 000000000000..ed24897d342a --- /dev/null +++ b/pkgs/development/libraries/kde-frameworks/kwindowsystem/platform-plugins-path.patch @@ -0,0 +1,22 @@ +Index: kwindowsystem-5.32.0/src/pluginwrapper.cpp +=================================================================== +--- kwindowsystem-5.32.0.orig/src/pluginwrapper.cpp ++++ kwindowsystem-5.32.0/src/pluginwrapper.cpp +@@ -37,14 +37,9 @@ Q_GLOBAL_STATIC(KWindowSystemPluginWrapp + static QStringList pluginCandidates() + { + QStringList ret; +- foreach (const QString &path, QCoreApplication::libraryPaths()) { +- QDir pluginDir(path + QLatin1Literal("/kf5/org.kde.kwindowsystem.platforms")); +- if (!pluginDir.exists()) { +- continue; +- } +- foreach (const QString &entry, pluginDir.entryList(QDir::Files | QDir::NoDotAndDotDot)) { +- ret << pluginDir.absoluteFilePath(entry); +- } ++ QDir pluginDir(QStringLiteral(NIXPKGS_QT_PLUGIN_PATH) + QLatin1Literal("/kf5/org.kde.kwindowsystem.platforms")); ++ foreach (const QString &entry, pluginDir.entryList(QDir::Files | QDir::NoDotAndDotDot)) { ++ ret << pluginDir.absoluteFilePath(entry); + } + return ret; + } diff --git a/pkgs/development/libraries/kde-frameworks/kwindowsystem/series b/pkgs/development/libraries/kde-frameworks/kwindowsystem/series new file mode 100644 index 000000000000..2cd02056ff81 --- /dev/null +++ b/pkgs/development/libraries/kde-frameworks/kwindowsystem/series @@ -0,0 +1 @@ +platform-plugins-path.patch From b70837e054e61c77c7238e04641a83eade50017d Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Sat, 22 Apr 2017 12:24:32 -0500 Subject: [PATCH 20/32] nixos/plasma5: set system-wide QT_PLUGIN_PATH --- nixos/modules/services/x11/desktop-managers/plasma5.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nixos/modules/services/x11/desktop-managers/plasma5.nix b/nixos/modules/services/x11/desktop-managers/plasma5.nix index d981cd5328e1..2216104be31a 100644 --- a/nixos/modules/services/x11/desktop-managers/plasma5.nix +++ b/nixos/modules/services/x11/desktop-managers/plasma5.nix @@ -183,6 +183,7 @@ in environment.variables = { # Enable GTK applications to load SVG icons GDK_PIXBUF_MODULE_FILE = "${pkgs.librsvg.out}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache"; + QT_PLUGIN_PATH = "/run/current-system/sw/lib/qt5/plugins"; }; fonts.fonts = with pkgs; [ noto-fonts hack-font ]; From 5735edb894396f80d6703cf181fd0e05f2b9a69c Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Sat, 22 Apr 2017 12:29:14 -0500 Subject: [PATCH 21/32] qt58.qtbase: remove OpenSSL library paths patch Qt is configure with `-openssl-linked` which causes the library paths to be resolved at build time and added to RPATH. --- .../libraries/qt-5/5.8/qtbase/default.nix | 2 -- .../qt-5/5.8/qtbase/dlopen-openssl.patch | 26 ------------------- .../libraries/qt-5/5.8/qtbase/series | 1 - 3 files changed, 29 deletions(-) delete mode 100644 pkgs/development/libraries/qt-5/5.8/qtbase/dlopen-openssl.patch diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix b/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix index 52e24eceea98..ab696d280213 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix +++ b/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix @@ -234,8 +234,6 @@ stdenv.mkDerivation { ''-DNIXPKGS_QTCOMPOSE="${libX11.out}/share/X11/locale"'' ''-DNIXPKGS_LIBRESOLV="${stdenv.cc.libc.out}/lib/libresolv"'' ''-DNIXPKGS_LIBXCURSOR="${libXcursor.out}/lib/libXcursor"'' - ''-DNIXPKGS_LIBSSL="${openssl.out}/lib/libssl"'' - ''-DNIXPKGS_LIBCRYPTO="${openssl.out}/lib/libcrypto"'' (if stdenv.isLinux then ''-DNIXPKGS_LIBDBUS="${dbus.lib}/lib/libdbus-1"'' else ''-DNIXPKGS_LIBDBUS=""'') diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/dlopen-openssl.patch b/pkgs/development/libraries/qt-5/5.8/qtbase/dlopen-openssl.patch deleted file mode 100644 index 943b1c569fd1..000000000000 --- a/pkgs/development/libraries/qt-5/5.8/qtbase/dlopen-openssl.patch +++ /dev/null @@ -1,26 +0,0 @@ -Index: qtbase-opensource-src-5.8.0/src/network/ssl/qsslsocket_openssl_symbols.cpp -=================================================================== ---- qtbase-opensource-src-5.8.0.orig/src/network/ssl/qsslsocket_openssl_symbols.cpp -+++ qtbase-opensource-src-5.8.0/src/network/ssl/qsslsocket_openssl_symbols.cpp -@@ -681,8 +681,8 @@ static QPair loadO - #endif - #if defined(SHLIB_VERSION_NUMBER) && !defined(Q_OS_QNX) // on QNX, the libs are always libssl.so and libcrypto.so - // first attempt: the canonical name is libssl.so. -- libssl->setFileNameAndVersion(QLatin1String("ssl"), QLatin1String(SHLIB_VERSION_NUMBER)); -- libcrypto->setFileNameAndVersion(QLatin1String("crypto"), QLatin1String(SHLIB_VERSION_NUMBER)); -+ libssl->setFileNameAndVersion(QStringLiteral(NIXPKGS_LIBSSL), QLatin1String(SHLIB_VERSION_NUMBER)); -+ libcrypto->setFileNameAndVersion(QStringLiteral(NIXPKGS_LIBCRYPTO), QLatin1String(SHLIB_VERSION_NUMBER)); - if (libcrypto->load() && libssl->load()) { - // libssl.so. and libcrypto.so. found - return pair; -@@ -699,8 +699,8 @@ static QPair loadO - // OS X's /usr/lib/libssl.dylib, /usr/lib/libcrypto.dylib will be picked up in the third - // attempt, _after_ /Contents/Frameworks has been searched. - // iOS does not ship a system libssl.dylib, libcrypto.dylib in the first place. -- libssl->setFileNameAndVersion(QLatin1String("ssl"), -1); -- libcrypto->setFileNameAndVersion(QLatin1String("crypto"), -1); -+ libssl->setFileNameAndVersion(QStringLiteral(NIXPKGS_LIBSSL), -1); -+ libcrypto->setFileNameAndVersion(QStringLiteral(NIXPKGS_LIBCRYPTO), -1); - if (libcrypto->load() && libssl->load()) { - // libssl.so.0 and libcrypto.so.0 found - return pair; diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/series b/pkgs/development/libraries/qt-5/5.8/qtbase/series index afce06826c69..37278bd5dba0 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtbase/series +++ b/pkgs/development/libraries/qt-5/5.8/qtbase/series @@ -1,7 +1,6 @@ dlopen-resolv.patch tzdir.patch dlopen-libXcursor.patch -dlopen-openssl.patch dlopen-dbus.patch xdg-config-dirs.patch compose-search-path.patch From 577c4f543b53bb921a61e54e73c95436db2a29cf Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Sat, 22 Apr 2017 12:30:41 -0500 Subject: [PATCH 22/32] qt58.qtbase: remove D-Bus library paths patch Qt is configured with `-dbus-linked` which causes the library paths to be resolved at compile time and added to RPATH. --- .../libraries/qt-5/5.8/qtbase/default.nix | 3 --- .../libraries/qt-5/5.8/qtbase/dlopen-dbus.patch | 13 ------------- pkgs/development/libraries/qt-5/5.8/qtbase/series | 1 - 3 files changed, 17 deletions(-) delete mode 100644 pkgs/development/libraries/qt-5/5.8/qtbase/dlopen-dbus.patch diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix b/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix index ab696d280213..c0454e91add9 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix +++ b/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix @@ -234,9 +234,6 @@ stdenv.mkDerivation { ''-DNIXPKGS_QTCOMPOSE="${libX11.out}/share/X11/locale"'' ''-DNIXPKGS_LIBRESOLV="${stdenv.cc.libc.out}/lib/libresolv"'' ''-DNIXPKGS_LIBXCURSOR="${libXcursor.out}/lib/libXcursor"'' - (if stdenv.isLinux - then ''-DNIXPKGS_LIBDBUS="${dbus.lib}/lib/libdbus-1"'' - else ''-DNIXPKGS_LIBDBUS=""'') ] ++ lib.optional mesaSupported diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/dlopen-dbus.patch b/pkgs/development/libraries/qt-5/5.8/qtbase/dlopen-dbus.patch deleted file mode 100644 index 067d898cda42..000000000000 --- a/pkgs/development/libraries/qt-5/5.8/qtbase/dlopen-dbus.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: qtbase-opensource-src-5.8.0/src/dbus/qdbus_symbols.cpp -=================================================================== ---- qtbase-opensource-src-5.8.0.orig/src/dbus/qdbus_symbols.cpp -+++ qtbase-opensource-src-5.8.0/src/dbus/qdbus_symbols.cpp -@@ -97,7 +97,7 @@ bool qdbus_loadLibDBus() - #ifdef Q_OS_WIN - QLatin1String("dbus-1"), - #endif -- QLatin1String("libdbus-1") -+ QLatin1String("@dbus_libs@/lib/libdbus-1") - }; - - lib->unload(); diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/series b/pkgs/development/libraries/qt-5/5.8/qtbase/series index 37278bd5dba0..dfe9575d8b2b 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtbase/series +++ b/pkgs/development/libraries/qt-5/5.8/qtbase/series @@ -1,7 +1,6 @@ dlopen-resolv.patch tzdir.patch dlopen-libXcursor.patch -dlopen-dbus.patch xdg-config-dirs.patch compose-search-path.patch libressl.patch From be6a7da8e74d56f334400b92b41a4753bb9e721f Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Sat, 22 Apr 2017 16:29:32 -0500 Subject: [PATCH 23/32] kdeDerivation: make overridable --- pkgs/top-level/all-packages.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 70c7de19d43b..bad55455b234 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -273,7 +273,8 @@ with pkgs; inherit kernel rootModules allowMissing; }; - kdeDerivation = import ../build-support/kde/derivation.nix { inherit stdenv lib; }; + kdeDerivation = makeOverridable (import ../build-support/kde/derivation.nix) + { inherit stdenv lib; }; kdeWrapper = callPackage ../build-support/kde/wrapper.nix { inherit (gnome3) dconf; From 394885daec4d9bb4e189a4a4042e442067573bba Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Sun, 23 Apr 2017 08:55:01 -0500 Subject: [PATCH 24/32] kdeWrapper: prefix Qt search paths --- pkgs/build-support/kde/wrapper.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/build-support/kde/wrapper.nix b/pkgs/build-support/kde/wrapper.nix index 228eb696bd9a..4442b111d790 100644 --- a/pkgs/build-support/kde/wrapper.nix +++ b/pkgs/build-support/kde/wrapper.nix @@ -48,9 +48,9 @@ stdenv.mkDerivation { --suffix PATH : "$env/bin" \ --prefix XDG_CONFIG_DIRS : "$env/etc/xdg" \ --prefix XDG_DATA_DIRS : "$env/share:${gtk3}/share/gsettings-schemas/${gtk3.name}" \ - --set QML_IMPORT_PATH "$env/lib/qt5/imports" \ - --set QML2_IMPORT_PATH "$env/lib/qt5/qml" \ - --set QT_PLUGIN_PATH "$env/lib/qt5/plugins" \ + --prefix QML_IMPORT_PATH : "$env/lib/qt5/imports" \ + --prefix QML2_IMPORT_PATH : "$env/lib/qt5/qml" \ + --prefix QT_PLUGIN_PATH : "$env/lib/qt5/plugins" \ --prefix GIO_EXTRA_MODULES : "${dconf.lib}/lib/gio/modules" good="1" break From 594ee6d570f1962eb7cdd66862e001373bfa440e Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Sun, 23 Apr 2017 10:27:31 -0500 Subject: [PATCH 25/32] kinit: set absolute path to extra libraries --- .../kde-frameworks/kinit/default.nix | 10 +++- .../kinit/kdeinit-extra_libs.patch | 49 +++++++++++++++++++ .../libraries/kde-frameworks/kinit/series | 1 + 3 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/libraries/kde-frameworks/kinit/kdeinit-extra_libs.patch diff --git a/pkgs/development/libraries/kde-frameworks/kinit/default.nix b/pkgs/development/libraries/kde-frameworks/kinit/default.nix index b965f761e922..f5cfa166e911 100644 --- a/pkgs/development/libraries/kde-frameworks/kinit/default.nix +++ b/pkgs/development/libraries/kde-frameworks/kinit/default.nix @@ -1,9 +1,12 @@ { kdeFramework, lib, copyPathsToStore, extra-cmake-modules, kdoctools, - kconfig, kcrash, ki18n, kio, kservice, kwindowsystem + kconfig, kcrash, ki18n, kio, kparts, kservice, kwindowsystem, plasma-framework }: +let + inherit (lib) getLib; +in kdeFramework { name = "kinit"; meta = { maintainers = [ lib.maintainers.ttuegel ]; }; @@ -12,4 +15,9 @@ kdeFramework { kconfig kcrash ki18n kio kservice kwindowsystem ]; patches = copyPathsToStore (lib.readPathsFromFile ./. ./series); + NIX_CFLAGS_COMPILE = [ + ''-DNIXPKGS_KF5_KIOCORE="${getLib kio}/lib/libKF5KIOCore.so.5"'' + ''-DNIXPKGS_KF5_PARTS="${getLib kparts}/lib/libKF5Parts.so.5"'' + ''-DNIXPKGS_KF5_PLASMA="${getLib plasma-framework}/lib/libKF5Plasma.so.5"'' + ]; } diff --git a/pkgs/development/libraries/kde-frameworks/kinit/kdeinit-extra_libs.patch b/pkgs/development/libraries/kde-frameworks/kinit/kdeinit-extra_libs.patch new file mode 100644 index 000000000000..75e632d41292 --- /dev/null +++ b/pkgs/development/libraries/kde-frameworks/kinit/kdeinit-extra_libs.patch @@ -0,0 +1,49 @@ +Index: kinit-5.32.0/src/kdeinit/kinit.cpp +=================================================================== +--- kinit-5.32.0.orig/src/kdeinit/kinit.cpp ++++ kinit-5.32.0/src/kdeinit/kinit.cpp +@@ -96,11 +96,9 @@ static const char *extra_libs[] = { + "libKF5Parts.5.dylib", + "libKF5Plasma.5.dylib" + #else +- "libKF5KIOCore.so.5", +- "libKF5Parts.so.5", +-//#ifdef __KDE_HAVE_GCC_VISIBILITY // Removed for KF5, we'll see. +- "libKF5Plasma.so.5" +-//#endif ++ NIXPKGS_KF5_KIOCORE, ++ NIXPKGS_KF5_PARTS, ++ NIXPKGS_KF5_PLASMA + #endif + }; + #endif +@@ -1533,20 +1531,6 @@ static int initXconnection() + } + #endif + +-#ifndef Q_OS_OSX +-// Find a shared lib in the lib dir, e.g. libkio.so. +-// Completely unrelated to plugins. +-static QString findSharedLib(const QString &lib) +-{ +- QString path = QFile::decodeName(CMAKE_INSTALL_PREFIX "/" LIB_INSTALL_DIR "/") + lib; +- if (QFile::exists(path)) { +- return path; +- } +- // We could also look in LD_LIBRARY_PATH, but really, who installs the main libs in different prefixes? +- return QString(); +-} +-#endif +- + extern "C" { + + static void secondary_child_handler(int) +@@ -1692,7 +1676,7 @@ int main(int argc, char **argv) + if (!d.suicide && qEnvironmentVariableIsEmpty("KDE_IS_PRELINKED")) { + const int extrasCount = sizeof(extra_libs) / sizeof(extra_libs[0]); + for (int i = 0; i < extrasCount; i++) { +- const QString extra = findSharedLib(QString::fromLatin1(extra_libs[i])); ++ const QString extra = QString::fromLatin1(extra_libs[i]); + if (!extra.isEmpty()) { + QLibrary l(extra); + l.setLoadHints(QLibrary::ExportExternalSymbolsHint); diff --git a/pkgs/development/libraries/kde-frameworks/kinit/series b/pkgs/development/libraries/kde-frameworks/kinit/series index 576b8a935bf1..9195a4e8e6b0 100644 --- a/pkgs/development/libraries/kde-frameworks/kinit/series +++ b/pkgs/development/libraries/kde-frameworks/kinit/series @@ -1,2 +1,3 @@ kinit-libpath.patch start_kdeinit-path.patch +kdeinit-extra_libs.patch From 52ac15953e77cb2b1bff48789d1eb73411d7107b Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Sun, 23 Apr 2017 10:28:03 -0500 Subject: [PATCH 26/32] makeQtWrapper: prefix Qt search paths --- pkgs/development/libraries/qt-5/make-qt-wrapper.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/development/libraries/qt-5/make-qt-wrapper.sh b/pkgs/development/libraries/qt-5/make-qt-wrapper.sh index 8f42682fa23e..4a5651f74c9b 100644 --- a/pkgs/development/libraries/qt-5/make-qt-wrapper.sh +++ b/pkgs/development/libraries/qt-5/make-qt-wrapper.sh @@ -2,9 +2,9 @@ wrapQtProgram() { local prog="$1" shift wrapProgram "$prog" \ - --set QT_PLUGIN_PATH "$QT_PLUGIN_PATH" \ - --set QML_IMPORT_PATH "$QML_IMPORT_PATH" \ - --set QML2_IMPORT_PATH "$QML2_IMPORT_PATH" \ + --prefix QT_PLUGIN_PATH : "$QT_PLUGIN_PATH" \ + --prefix QML_IMPORT_PATH : "$QML_IMPORT_PATH" \ + --prefix QML2_IMPORT_PATH : "$QML2_IMPORT_PATH" \ --prefix XDG_DATA_DIRS : "$RUNTIME_XDG_DATA_DIRS" \ --prefix XDG_CONFIG_DIRS : "$RUNTIME_XDG_CONFIG_DIRS" \ --prefix GIO_EXTRA_MODULES : "$GIO_EXTRA_MODULES" \ @@ -17,9 +17,9 @@ makeQtWrapper() { shift shift makeWrapper "$old" "$new" \ - --set QT_PLUGIN_PATH "$QT_PLUGIN_PATH" \ - --set QML_IMPORT_PATH "$QML_IMPORT_PATH" \ - --set QML2_IMPORT_PATH "$QML2_IMPORT_PATH" \ + --prefix QT_PLUGIN_PATH : "$QT_PLUGIN_PATH" \ + --prefix QML_IMPORT_PATH : "$QML_IMPORT_PATH" \ + --prefix QML2_IMPORT_PATH : "$QML2_IMPORT_PATH" \ --prefix XDG_DATA_DIRS : "$RUNTIME_XDG_DATA_DIRS" \ --prefix XDG_CONFIG_DIRS : "$RUNTIME_XDG_CONFIG_DIRS" \ --prefix GIO_EXTRA_MODULES : "$GIO_EXTRA_MODULES" \ From 64418af8c524888377ec8e94ba7a7c18b82cb3d5 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Sun, 23 Apr 2017 17:52:48 -0500 Subject: [PATCH 27/32] qt58.qtbase: fix developer build --- .../libraries/qt-5/5.8/qtbase/default.nix | 6 ++++-- .../5.8/qtbase/qnativesocketengine-type-pun.patch | 14 ++++++++++++++ pkgs/development/libraries/qt-5/5.8/qtbase/series | 2 +- 3 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 pkgs/development/libraries/qt-5/5.8/qtbase/qnativesocketengine-type-pun.patch diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix b/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix index c0454e91add9..855db57688b1 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix +++ b/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix @@ -107,8 +107,10 @@ stdenv.mkDerivation { "-system-proxies" "-pkg-config" ] - ++ lib.optional developerBuild "-developer-build" - + ++ lib.optionals developerBuild [ + "-developer-build" + "-no-warnings-are-errors" + ] ++ [ "-gui" "-widgets" diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/qnativesocketengine-type-pun.patch b/pkgs/development/libraries/qt-5/5.8/qtbase/qnativesocketengine-type-pun.patch new file mode 100644 index 000000000000..ad40dfab2f7b --- /dev/null +++ b/pkgs/development/libraries/qt-5/5.8/qtbase/qnativesocketengine-type-pun.patch @@ -0,0 +1,14 @@ +Index: qtbase-opensource-src-5.8.0/src/network/socket/qnativesocketengine_unix.cpp +=================================================================== +--- qtbase-opensource-src-5.8.0.orig/src/network/socket/qnativesocketengine_unix.cpp ++++ qtbase-opensource-src-5.8.0/src/network/socket/qnativesocketengine_unix.cpp +@@ -979,7 +979,8 @@ qint64 QNativeSocketEnginePrivate::nativ + if (cmsgptr->cmsg_len == CMSG_LEN(sizeof(int)) + && ((cmsgptr->cmsg_level == IPPROTO_IPV6 && cmsgptr->cmsg_type == IPV6_HOPLIMIT) + || (cmsgptr->cmsg_level == IPPROTO_IP && cmsgptr->cmsg_type == IP_TTL))) { +- header->hopLimit = *reinterpret_cast(CMSG_DATA(cmsgptr)); ++ int *ttl = reinterpret_cast(CMSG_DATA(cmsgptr)); ++ header->hopLimit = *ttl; + } + + #ifndef QT_NO_SCTP diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/series b/pkgs/development/libraries/qt-5/5.8/qtbase/series index dfe9575d8b2b..0378ca1f5035 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtbase/series +++ b/pkgs/development/libraries/qt-5/5.8/qtbase/series @@ -2,8 +2,8 @@ dlopen-resolv.patch tzdir.patch dlopen-libXcursor.patch xdg-config-dirs.patch -compose-search-path.patch libressl.patch qpa-plugin-path.patch dlopen-gl.patch +compose-search-path.patch cmake-paths.patch From 9f00e2be1805e8940e950cf144351f53bbd364ed Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Tue, 25 Apr 2017 06:05:45 -0500 Subject: [PATCH 28/32] qt58.qtbase: fix warnings in TZDIR patch --- .../libraries/qt-5/5.8/qtbase/tzdir.patch | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/tzdir.patch b/pkgs/development/libraries/qt-5/5.8/qtbase/tzdir.patch index f48ac761ccf2..b8c05815a784 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtbase/tzdir.patch +++ b/pkgs/development/libraries/qt-5/5.8/qtbase/tzdir.patch @@ -2,28 +2,27 @@ Index: qtbase-opensource-src-5.8.0/src/corelib/tools/qtimezoneprivate_tz.cpp =================================================================== --- qtbase-opensource-src-5.8.0.orig/src/corelib/tools/qtimezoneprivate_tz.cpp +++ qtbase-opensource-src-5.8.0/src/corelib/tools/qtimezoneprivate_tz.cpp -@@ -70,7 +70,10 @@ typedef QHash Q +@@ -70,7 +70,11 @@ typedef QHash Q // Parse zone.tab table, assume lists all installed zones, if not will need to read directories static QTzTimeZoneHash loadTzTimeZones() { - QString path = QStringLiteral("/usr/share/zoneinfo/zone.tab"); -+ QString path = qgetenv("TZDIR"); -+ path += "/zone.tab"; ++ // Try TZDIR first, in case we're running on NixOS. ++ QString path = QFile::decodeName(qgetenv("TZDIR")) + QStringLiteral("/zone.tab"); ++ // Fallback to traditional paths in case we are not on NixOS. + if (!QFile::exists(path)) + path = QStringLiteral("/usr/share/zoneinfo/zone.tab"); if (!QFile::exists(path)) path = QStringLiteral("/usr/lib/zoneinfo/zone.tab"); -@@ -642,12 +645,18 @@ void QTzTimeZonePrivate::init(const QByt +@@ -642,12 +646,16 @@ void QTzTimeZonePrivate::init(const QByt if (!tzif.open(QIODevice::ReadOnly)) return; } else { - // Open named tz, try modern path first, if fails try legacy path - tzif.setFileName(QLatin1String("/usr/share/zoneinfo/") + QString::fromLocal8Bit(ianaId)); -+ // Try TZDIR first -+ QString zoneinfoDir = qgetenv("TZDIR"); -+ zoneinfoDir += "/" + QString::fromLocal8Bit(ianaId); -+ tzif.setFileName(zoneinfoDir); ++ // Try TZDIR first, in case we're running on NixOS ++ tzif.setFileName(QFile::decodeName(qgetenv("TZDIR")) + QStringLiteral("/") + QString::fromLocal8Bit(ianaId)); if (!tzif.open(QIODevice::ReadOnly)) { - tzif.setFileName(QLatin1String("/usr/lib/zoneinfo/") + QString::fromLocal8Bit(ianaId)); - if (!tzif.open(QIODevice::ReadOnly)) From 18f95ce5d94919c4c3d17b1b9537daa0505f9b40 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Tue, 25 Apr 2017 06:06:05 -0500 Subject: [PATCH 29/32] kinit: don't use obsolete macros in library paths patch --- .../kde-frameworks/kinit/kinit-libpath.patch | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/pkgs/development/libraries/kde-frameworks/kinit/kinit-libpath.patch b/pkgs/development/libraries/kde-frameworks/kinit/kinit-libpath.patch index a5c76fca2481..b949723fb543 100644 --- a/pkgs/development/libraries/kde-frameworks/kinit/kinit-libpath.patch +++ b/pkgs/development/libraries/kde-frameworks/kinit/kinit-libpath.patch @@ -1,8 +1,8 @@ -Index: kinit-5.24.0/src/kdeinit/kinit.cpp +Index: kinit-5.32.0/src/kdeinit/kinit.cpp =================================================================== ---- kinit-5.24.0.orig/src/kdeinit/kinit.cpp -+++ kinit-5.24.0/src/kdeinit/kinit.cpp -@@ -672,19 +672,16 @@ static pid_t launch(int argc, const char +--- kinit-5.32.0.orig/src/kdeinit/kinit.cpp ++++ kinit-5.32.0/src/kdeinit/kinit.cpp +@@ -623,19 +623,15 @@ static pid_t launch(int argc, const char if (!libpath.isEmpty()) { if (libpath_relative) { @@ -23,10 +23,9 @@ Index: kinit-5.24.0/src/kdeinit/kinit.cpp + QByteArrayList profiles = qgetenv("NIX_PROFILES").split(' '); + // Reverse the profile list. + std::reverse(profiles.begin(), profiles.end()); -+ const QString libdir = QString::fromLatin1("/lib/"); -+ Q_FOREACH (const QByteArray &profile, profiles) { ++ for (const QByteArray &profile: profiles) { + if (!profile.isEmpty()) { -+ l.setFileName(QFile::decodeName(profile) + libdir + libpath); ++ l.setFileName(QFile::decodeName(profile) + QStringLiteral("/lib/") + libpath); + if (l.load()) break; + } } From 2716e5bd80878cb5c4cf47ed2424e644dc8a62cf Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Tue, 25 Apr 2017 07:12:11 -0500 Subject: [PATCH 30/32] qt58.qtbase: cleanup: sort attributes --- .../libraries/qt-5/5.8/qtbase/default.nix | 142 +++++++++--------- 1 file changed, 71 insertions(+), 71 deletions(-) diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix b/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix index 855db57688b1..e11d9dd1f29b 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix +++ b/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix @@ -34,6 +34,48 @@ stdenv.mkDerivation { name = "qtbase-${version}"; inherit src version; + propagatedBuildInputs = + [ + libxml2 libxslt openssl pcre16 sqlite zlib + + # Text rendering + harfbuzz icu + + # Image formats + libjpeg libpng libtiff + ] + + ++ lib.optional mesaSupported mesa + + ++ lib.optionals (!stdenv.isDarwin) [ + dbus glib udev + + # Text rendering + fontconfig freetype + + # X11 libs + 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.apple_sdk.sdk darwin.libobjc libiconv + ]); + + buildInputs = [ ] + ++ lib.optionals (!stdenv.isDarwin) [ gtk3 libinput ] + ++ lib.optional developerBuild gdb + ++ lib.optional (cups != null) cups + ++ lib.optional (mysql != null) mysql.lib + ++ lib.optional (postgresql != null) postgresql; + + nativeBuildInputs = + [ bison flex gperf lndir perl pkgconfig python2 ] + ++ lib.optional (!stdenv.isDarwin) patchelf; + outputs = [ "out" "dev" ]; patches = @@ -89,8 +131,36 @@ stdenv.mkDerivation { NIX_CFLAGS_COMPILE+=" -DNIXPKGS_QPA_PLATFORM_PLUGIN_PATH=\"''${!outputLib}/lib/qt5/plugins\"" ''; + + NIX_CFLAGS_COMPILE = + [ + "-Wno-error=sign-compare" # freetype-2.5.4 changed signedness of some struct fields + ''-DNIXPKGS_QTCOMPOSE="${libX11.out}/share/X11/locale"'' + ''-DNIXPKGS_LIBRESOLV="${stdenv.cc.libc.out}/lib/libresolv"'' + ''-DNIXPKGS_LIBXCURSOR="${libXcursor.out}/lib/libXcursor"'' + ] + + ++ lib.optional mesaSupported + ''-DNIXPKGS_MESA_GL="${mesa.out}/lib/libGL"'' + + ++ lib.optionals stdenv.isDarwin + [ + "-D__MAC_OS_X_VERSION_MAX_ALLOWED=1090" + "-D__AVAILABILITY_INTERNAL__MAC_10_10=__attribute__((availability(macosx,introduced=10.10)))" + # Note that nixpkgs's objc4 is from macOS 10.11 while the SDK is + # 10.9 which necessitates the above macro definition that mentions + # 10.10 + ] + + ++ lib.optional decryptSslTraffic "-DQT_DECRYPT_SSL_TRAFFIC"; + prefixKey = "-prefix "; + # PostgreSQL autodetection fails sporadically because Qt omits the "-lpq" flag + # if dependency paths contain the string "pq", which can occur in the hash. + # To prevent these failures, we need to override PostgreSQL detection. + PSQL_LIBS = lib.optionalString (postgresql != null) "-L${postgresql.lib}/lib -lpq"; + # -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 configureFlags = @@ -182,75 +252,7 @@ stdenv.mkDerivation { "-qt-libpng" ]; - # PostgreSQL autodetection fails sporadically because Qt omits the "-lpq" flag - # if dependency paths contain the string "pq", which can occur in the hash. - # To prevent these failures, we need to override PostgreSQL detection. - PSQL_LIBS = lib.optionalString (postgresql != null) "-L${postgresql.lib}/lib -lpq"; - - propagatedBuildInputs = - [ - libxml2 libxslt openssl pcre16 sqlite zlib - - # Text rendering - harfbuzz icu - - # Image formats - libjpeg libpng libtiff - ] - - ++ lib.optional mesaSupported mesa - - ++ lib.optionals (!stdenv.isDarwin) [ - dbus glib udev - - # Text rendering - fontconfig freetype - - # X11 libs - 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 = [ ] - ++ lib.optionals (!stdenv.isDarwin) [ gtk3 libinput ] - ++ lib.optional developerBuild gdb - ++ lib.optional (cups != null) cups - ++ lib.optional (mysql != null) mysql.lib - ++ lib.optional (postgresql != null) postgresql; - - nativeBuildInputs = - [ bison flex gperf lndir perl pkgconfig python2 ] - ++ lib.optional (!stdenv.isDarwin) patchelf; - - # freetype-2.5.4 changed signedness of some struct fields - NIX_CFLAGS_COMPILE = - [ - "-Wno-error=sign-compare" - ''-DNIXPKGS_QTCOMPOSE="${libX11.out}/share/X11/locale"'' - ''-DNIXPKGS_LIBRESOLV="${stdenv.cc.libc.out}/lib/libresolv"'' - ''-DNIXPKGS_LIBXCURSOR="${libXcursor.out}/lib/libXcursor"'' - ] - - ++ lib.optional mesaSupported - ''-DNIXPKGS_MESA_GL="${mesa.out}/lib/libGL"'' - - ++ lib.optionals stdenv.isDarwin - [ - "-D__MAC_OS_X_VERSION_MAX_ALLOWED=1090" - "-D__AVAILABILITY_INTERNAL__MAC_10_10=__attribute__((availability(macosx,introduced=10.10)))" - # Note that nixpkgs's objc4 is from macOS 10.11 while the SDK is - # 10.9 which necessitates the above macro definition that mentions - # 10.10 - ] - - ++ lib.optional decryptSslTraffic "-DQT_DECRYPT_SSL_TRAFFIC"; + enableParallelBuilding = true; postInstall = '' find "$out" -name "*.cmake" | while read file; do @@ -334,8 +336,6 @@ stdenv.mkDerivation { then ../../qtbase-setup-hook-darwin.sh else ../../qtbase-setup-hook.sh; - enableParallelBuilding = true; - meta = with lib; { homepage = http://www.qt.io; description = "A cross-platform application framework for C++"; From 901a778c7744b25013168dde1a2a548ad531fd78 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Tue, 25 Apr 2017 07:30:15 -0500 Subject: [PATCH 31/32] makeScope: prevent name collision with makeOverridable --- lib/customisation.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/customisation.nix b/lib/customisation.nix index 4853290db542..cf28137cb8a2 100644 --- a/lib/customisation.nix +++ b/lib/customisation.nix @@ -177,7 +177,7 @@ rec { let self = f self // { newScope = scope: newScope (self // scope); callPackage = self.newScope {}; - override = g: + overrideScope = g: makeScope newScope (self_: let super = f self_; in super // g super self_); packages = f; From 6fa2979ebcaa98be0d978474cfbaa68d8d19a896 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Tue, 25 Apr 2017 07:32:51 -0500 Subject: [PATCH 32/32] qt5: make package sets overridable --- pkgs/top-level/all-packages.nix | 44 +++++++++++++++++---------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index bad55455b234..0e79ff1d8624 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9526,30 +9526,32 @@ with pkgs; developerBuild = true; }); - qt56 = recurseIntoAttrs (import ../development/libraries/qt-5/5.6 { - inherit newScope; - inherit stdenv fetchurl makeSetupHook makeWrapper; - bison = bison2; # error: too few arguments to function 'int yylex(... - inherit cups; - harfbuzz = harfbuzz-icu; - mesa = mesa_noglu; - inherit perl; - inherit (gst_all_1) gstreamer gst-plugins-base; - }); + qt56 = recurseIntoAttrs (makeOverridable + (import ../development/libraries/qt-5/5.6) { + inherit newScope; + inherit stdenv fetchurl makeSetupHook makeWrapper; + bison = bison2; # error: too few arguments to function 'int yylex(... + inherit cups; + harfbuzz = harfbuzz-icu; + mesa = mesa_noglu; + inherit perl; + inherit (gst_all_1) gstreamer gst-plugins-base; + }); libsForQt56 = recurseIntoAttrs (lib.makeScope qt56.newScope mkLibsForQt5); - qt58 = recurseIntoAttrs (import ../development/libraries/qt-5/5.8 { - inherit newScope; - inherit stdenv fetchurl makeSetupHook makeWrapper; - bison = bison2; # error: too few arguments to function 'int yylex(... - inherit cups; - harfbuzz = harfbuzz-icu; - mesa = mesa_noglu; - inherit perl; - inherit (gst_all_1) gstreamer gst-plugins-base; - inherit (gnome3) gtk3 dconf; - }); + qt58 = recurseIntoAttrs (makeOverridable + (import ../development/libraries/qt-5/5.8) { + inherit newScope; + inherit stdenv fetchurl makeSetupHook makeWrapper; + bison = bison2; # error: too few arguments to function 'int yylex(... + inherit cups; + harfbuzz = harfbuzz-icu; + mesa = mesa_noglu; + inherit perl; + inherit (gst_all_1) gstreamer gst-plugins-base; + inherit (gnome3) gtk3 dconf; + }); libsForQt58 = recurseIntoAttrs (lib.makeScope qt58.newScope mkLibsForQt5);