keepass: bring back and update plugins load patches
Plugins loading was broken as those patches were removed in latest release. I brought patches back and updated them onto 2.38 release code base. This closes #35446.
This commit is contained in:
parent
c8b1b34123
commit
e3c5cf39bc
@ -1,12 +1,6 @@
|
|||||||
{ stdenv, lib, fetchurl, buildDotnetPackage, substituteAll, makeWrapper, makeDesktopItem,
|
{ stdenv, lib, fetchurl, buildDotnetPackage, substituteAll, makeWrapper, makeDesktopItem,
|
||||||
unzip, icoutils, gtk2, xorg, xdotool, xsel, plugins ? [] }:
|
unzip, icoutils, gtk2, xorg, xdotool, xsel, plugins ? [] }:
|
||||||
|
|
||||||
# KeePass looks for plugins in under directory in which KeePass.exe is
|
|
||||||
# located. It follows symlinks where looking for that directory, so
|
|
||||||
# buildEnv is not enough to bring KeePass and plugins together.
|
|
||||||
#
|
|
||||||
# This derivation patches KeePass to search for plugins in specified
|
|
||||||
# plugin derivations in the Nix store and nowhere else.
|
|
||||||
with builtins; buildDotnetPackage rec {
|
with builtins; buildDotnetPackage rec {
|
||||||
baseName = "keepass";
|
baseName = "keepass";
|
||||||
version = "2.38";
|
version = "2.38";
|
||||||
@ -29,6 +23,29 @@ with builtins; buildDotnetPackage rec {
|
|||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# KeePass looks for plugins in under directory in which KeePass.exe is
|
||||||
|
# located. It follows symlinks where looking for that directory, so
|
||||||
|
# buildEnv is not enough to bring KeePass and plugins together.
|
||||||
|
#
|
||||||
|
# This derivation patches KeePass to search for plugins in specified
|
||||||
|
# plugin derivations in the Nix store and nowhere else.
|
||||||
|
pluginLoadPathsPatch =
|
||||||
|
let outputLc = toString (add 7 (length plugins));
|
||||||
|
patchTemplate = readFile ./keepass-plugins.patch;
|
||||||
|
loadTemplate = readFile ./keepass-plugins-load.patch;
|
||||||
|
loads =
|
||||||
|
lib.concatStrings
|
||||||
|
(map
|
||||||
|
(p: replaceStrings ["$PATH$"] [ (unsafeDiscardStringContext (toString p)) ] loadTemplate)
|
||||||
|
plugins);
|
||||||
|
in replaceStrings ["$OUTPUT_LC$" "$DO_LOADS$"] [outputLc loads] patchTemplate;
|
||||||
|
|
||||||
|
passAsFile = [ "pluginLoadPathsPatch" ];
|
||||||
|
postPatch = ''
|
||||||
|
sed -i 's/\r*$//' KeePass/Forms/MainForm.cs
|
||||||
|
patch -p1 <$pluginLoadPathsPatchPath
|
||||||
|
'';
|
||||||
|
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
rm -rvf Build/*
|
rm -rvf Build/*
|
||||||
find . -name "*.sln" -print -exec sed -i 's/Format Version 10.00/Format Version 11.00/g' {} \;
|
find . -name "*.sln" -print -exec sed -i 's/Format Version 10.00/Format Version 11.00/g' {} \;
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
+ m_pluginManager.LoadAllPlugins("$PATH$/lib/dotnet/keepass", SearchOption.TopDirectoryOnly, new string[] {});
|
13
pkgs/applications/misc/keepass/keepass-plugins.patch
Normal file
13
pkgs/applications/misc/keepass/keepass-plugins.patch
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
diff --git a/KeePass/Forms/MainForm.cs b/KeePass/Forms/MainForm.cs
|
||||||
|
index 3d5fca0..4c3f3d4 100644
|
||||||
|
--- a/KeePass/Forms/MainForm.cs
|
||||||
|
+++ b/KeePass/Forms/MainForm.cs
|
||||||
|
@@ -406,7 +406,$OUTPUT_LC$ @@ namespace KeePass.Forms
|
||||||
|
m_pluginManager.Initialize(m_pluginDefaultHost);
|
||||||
|
|
||||||
|
m_pluginManager.UnloadAllPlugins();
|
||||||
|
- if(AppPolicy.Current.Plugins) m_pluginManager.LoadAllPlugins();
|
||||||
|
$DO_LOADS$+
|
||||||
|
|
||||||
|
// Delete old files *after* loading plugins (when timestamps
|
||||||
|
// of loaded plugins have been updated already)
|
Loading…
x
Reference in New Issue
Block a user