depot/third_party/nixpkgs/pkgs/development/libraries/grantlee/5/grantlee-nix-profiles.patch
Default email 8ac5e011d6 Project import generated by Copybara.
GitOrigin-RevId: 2c3273caa153ee8eb5786bc8141b85b859e7efd7
2020-04-24 19:36:52 -04:00

19 lines
727 B
Diff

Index: grantlee-5.1.0/templates/lib/engine.cpp
===================================================================
--- grantlee-5.1.0.orig/templates/lib/engine.cpp
+++ grantlee-5.1.0/templates/lib/engine.cpp
@@ -48,6 +48,14 @@ Engine::Engine(QObject *parent)
d_ptr->m_pluginDirs = QCoreApplication::instance()->libraryPaths();
d_ptr->m_pluginDirs << QString::fromLocal8Bit(GRANTLEE_PLUGIN_PATH);
+
+ // Add library paths derived from NIX_PROFILES.
+ const QByteArrayList profiles = qgetenv("NIX_PROFILES").split(' ');
+ for (const QByteArray &profile: profiles) {
+ if (!profile.isEmpty()) {
+ d_ptr->m_pluginDirs << (QFile::decodeName(profile) + QStringLiteral("/lib"));
+ }
+ }
}
Engine::~Engine()