Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pkgs/development/libraries/qt-6/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ let
./patches/0009-qtbase-allow-translations-outside-prefix.patch
./patches/0010-qtbase-find-qmlimportscanner-in-macdeployqt-via-envi.patch
./patches/0011-qtbase-check-in-the-QML-folder-of-this-library-does-.patch
./patches/0012-qtbase-derive-plugin-load-path-from-PATH.patch
];
};
env = callPackage ./qt-env.nix { };
Expand Down
13 changes: 7 additions & 6 deletions pkgs/development/libraries/qt-6/modules/qtbase.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@
, lndir
, perl
, pkg-config
, python3
, which
, cmake
, ninja
, ccache
, xmlstarlet
, libproxy
, xorg
Expand Down Expand Up @@ -236,10 +234,13 @@ stdenv.mkDerivation rec {
"-DQT_FEATURE_cxx17_filesystem=OFF"
] ++ lib.optional (qttranslations != null) "-DINSTALL_TRANSLATIONSDIR=${qttranslations}/translations";

NIX_LDFLAGS = toString (lib.optionals stdenv.isDarwin [
# Undefined symbols for architecture arm64: "___gss_c_nt_hostbased_service_oid_desc"
"-framework GSS"
]);
env = {
NIX_CFLAGS_COMPILE = "-DNIXPKGS_QT_PLUGIN_PREFIX=\"${qtPluginPrefix}\"";
NIX_LDFLAGS = toString (lib.optionals stdenv.isDarwin [
# Undefined symbols for architecture arm64: "___gss_c_nt_hostbased_service_oid_desc"
"-framework GSS"
]);
};

outputs = [ "out" "dev" ];

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
From 989697dc8cdcefca1abecfec1316fdce7dc3bf10 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Milan=20P=C3=A4ssler?= <me@pbb.lc>
Date: Sun, 10 May 2020 12:47:28 +0200
Subject: [PATCH 12/12] qtbase: derive plugin load path from PATH

---
src/corelib/kernel/qcoreapplication.cpp | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index cf773a2328e..44f539390fb 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -2988,6 +2988,16 @@ QStringList QCoreApplication::libraryPathsLocked()
QStringList *app_libpaths = new QStringList;
coreappdata()->app_libpaths.reset(app_libpaths);

+ // Add library paths derived from PATH
+ const QStringList paths = QFile::decodeName(qgetenv("PATH")).split(QStringLiteral(":"));
+ const QString plugindir = QStringLiteral("../" NIXPKGS_QT_PLUGIN_PREFIX);
+ for (const QString &path: paths) {
+ if (!path.isEmpty()) {
+ app_libpaths->append(QDir::cleanPath(path + QDir::separator() + plugindir));
+ }
+ }
+
+
auto setPathsFromEnv = [&](QString libPathEnv) {
if (!libPathEnv.isEmpty()) {
QStringList paths = libPathEnv.split(QDir::listSeparator(), Qt::SkipEmptyParts);
--
2.42.0