grantlee: search profile library paths for plugins

This commit is contained in:
Thomas Tuegel 2017-05-10 16:20:11 -05:00
parent d5468a51fb
commit 7182709174
No known key found for this signature in database
GPG Key ID: 22CBF5249D4B4D59
4 changed files with 26 additions and 4 deletions

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, qtbase, qtscript, cmake }:
{ stdenv, lib, copyPathsToStore, fetchurl, qtbase, qtscript, cmake }:
stdenv.mkDerivation rec {
name = "grantlee-${version}";
@ -10,10 +10,12 @@ stdenv.mkDerivation rec {
name = "${name}.tar.gz";
};
patches = copyPathsToStore (lib.readPathsFromFile ./. ./series);
buildInputs = [ qtbase qtscript ];
nativeBuildInputs = [ cmake ];
meta = {
meta = with stdenv.lib; {
description = "Qt5 port of Django template system";
longDescription = ''
Grantlee is a plugin based String Template system written using the Qt
@ -25,7 +27,7 @@ stdenv.mkDerivation rec {
and the design of Django is reused in Grantlee.'';
homepage = http://gitorious.org/grantlee;
maintainers = [ ];
maintainers = [ maintainers.ttuegel ];
inherit (qtbase.meta) platforms;
};
}

View File

@ -0,0 +1,19 @@
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()

View File

@ -0,0 +1 @@
grantlee-nix-profiles.patch

View File

@ -9979,7 +9979,7 @@ with pkgs;
qgpgme = callPackage ../development/libraries/gpgme { };
grantlee = callPackage ../development/libraries/grantlee/5.x.nix { };
grantlee = callPackage ../development/libraries/grantlee/5 { };
inherit (callPackage ../development/libraries/kirigami { })
kirigami_1