diff options
author | Thomas Tuegel <ttuegel@mailbox.org> | 2017-05-15 06:44:33 -0500 |
---|---|---|
committer | Thomas Tuegel <ttuegel@mailbox.org> | 2017-06-18 08:41:57 -0500 |
commit | 3f3d33a07867116446ec9b5e2675ef1c8de8127d (patch) | |
tree | b0c362b10bb8e908c2be61aadae8f9cdb69a8c6e /pkgs/development/libraries/qt-5/5.8/qtbase | |
parent | 08d25152b85fb24f7b5b85efe25d6be4deb12227 (diff) | |
download | nixlib-3f3d33a07867116446ec9b5e2675ef1c8de8127d.tar nixlib-3f3d33a07867116446ec9b5e2675ef1c8de8127d.tar.gz nixlib-3f3d33a07867116446ec9b5e2675ef1c8de8127d.tar.bz2 nixlib-3f3d33a07867116446ec9b5e2675ef1c8de8127d.tar.lz nixlib-3f3d33a07867116446ec9b5e2675ef1c8de8127d.tar.xz nixlib-3f3d33a07867116446ec9b5e2675ef1c8de8127d.tar.zst nixlib-3f3d33a07867116446ec9b5e2675ef1c8de8127d.zip |
qt5: use distinct `lib/qt-5.x` prefix for each minor version
Using a distinct prefix for plugins and QML libraries allows multiple Qt 5 minor versions to coexist in the same environment.
Diffstat (limited to 'pkgs/development/libraries/qt-5/5.8/qtbase')
-rw-r--r-- | pkgs/development/libraries/qt-5/5.8/qtbase/default.nix | 18 | ||||
-rw-r--r-- | pkgs/development/libraries/qt-5/5.8/qtbase/nix-profiles-library-paths.patch | 8 |
2 files changed, 15 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 ee6399c2bd46..008eb1e37098 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix +++ b/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix @@ -1,6 +1,6 @@ { stdenv, lib, copyPathsToStore, - src, version, + src, version, qtCompatVersion, coreutils, bison, flex, gdb, gperf, lndir, patchelf, perl, pkgconfig, python2, ruby, @@ -32,7 +32,7 @@ in stdenv.mkDerivation { name = "qtbase-${version}"; - inherit src version; + inherit qtCompatVersion src version; propagatedBuildInputs = [ @@ -117,18 +117,22 @@ stdenv.mkDerivation { # Note on the above: \x27 is a way if including a single-quote # character in the sed string arguments. + qtPluginPrefix = "lib/qt-${qtCompatVersion}/plugins"; + qtQmlPrefix = "lib/qt-${qtCompatVersion}/qml"; + qtDocPrefix = "share/doc/qt-${qtCompatVersion}"; + setOutputFlags = false; preConfigure = '' export LD_LIBRARY_PATH="$PWD/lib:$PWD/plugins/platforms:$LD_LIBRARY_PATH" export MAKEFLAGS=-j$NIX_BUILD_CORES configureFlags+="\ - -plugindir $out/lib/qt5/plugins \ - -importdir $out/lib/qt5/imports \ - -qmldir $out/lib/qt5/qml \ - -docdir $out/share/doc/qt5" + -plugindir $out/$qtPluginPrefix \ + -qmldir $out/$qtQmlPrefix \ + -docdir $out/$qtDocPrefix" - NIX_CFLAGS_COMPILE+=" -DNIXPKGS_QPA_PLATFORM_PLUGIN_PATH=\"''${!outputLib}/lib/qt5/plugins/platforms\"" + NIX_CFLAGS_COMPILE+=" -DNIXPKGS_QT_PLUGIN_PREFIX=\"$qtPluginPrefix\"" + NIX_CFLAGS_COMPILE+=" -DNIXPKGS_QPA_PLATFORM_PLUGIN_PATH=\"''${!outputLib}/$qtPluginPrefix/platforms\"" ''; 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 553c71d0ace3..f626e399288a 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 @@ -7,11 +7,11 @@ Index: qtbase-opensource-src-5.8.0/src/corelib/kernel/qcoreapplication.cpp 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) { ++ const QStringList profiles = QFile::decodeName(qgetenv("NIX_PROFILES")).split(' '); ++ const QString plugindir = QStringLiteral(NIXPKGS_QT_PLUGIN_PREFIX); ++ for (const QString &profile: profiles) { + if (!profile.isEmpty()) { -+ app_libpaths->append(QFile::decodeName(profile) + plugindir); ++ app_libpaths->append(profile + QDir::separator() + plugindir); + } + } + |