about summary refs log tree commit diff
path: root/pkgs/applications/misc/keepass/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/misc/keepass/default.nix')
-rw-r--r--pkgs/applications/misc/keepass/default.nix21
1 files changed, 15 insertions, 6 deletions
diff --git a/pkgs/applications/misc/keepass/default.nix b/pkgs/applications/misc/keepass/default.nix
index 6914120f2967..8f16283d3911 100644
--- a/pkgs/applications/misc/keepass/default.nix
+++ b/pkgs/applications/misc/keepass/default.nix
@@ -8,19 +8,17 @@
 # plugin derivations in the Nix store and nowhere else.
 with builtins; buildDotnetPackage rec {
   baseName = "keepass";
-  version = "2.30";
+  version = "2.31";
 
   src = fetchurl {
     url = "mirror://sourceforge/keepass/KeePass-${version}-Source.zip";
-    sha256 = "1r792cikgvzj4hrxiv7xd3gx2zmn16dbh4inj2zi6ny0gchkqg2a";
+    sha256 = "10bqxpq30gzfq2ip6dkmqlzzsh3bnfdb01jry5xhgxvlycq1lnsm";
   };
 
   sourceRoot = ".";
 
   buildInputs = [ unzip makeWrapper ];
 
-  patches = [ ./keepass.patch ];
-
   pluginLoadPathsPatch =
     let outputLc = toString (add 8 (length plugins));
         patchTemplate = readFile ./keepass-plugins.patch;
@@ -34,10 +32,21 @@ with builtins; buildDotnetPackage rec {
 
   passAsFile = [ "pluginLoadPathsPatch" ];
   postPatch = ''
-    patch --binary -p1 <$pluginLoadPathsPatchPath
+    sed -i 's/\r*$//' KeePass/Forms/MainForm.cs
+    patch -p1 <$pluginLoadPathsPatchPath
   '';
 
-  preConfigure = "rm -rvf Build/*";
+  preConfigure = ''
+    rm -rvf Build/*
+    find . -name "*.sln" -print -exec sed -i 's/Format Version 10.00/Format Version 11.00/g' {} \;
+    find . -name "*.csproj" -print -exec sed -i '
+      s#ToolsVersion="3.5"#ToolsVersion="4.0"#g
+      s#<TargetFrameworkVersion>.*</TargetFrameworkVersion>##g
+      s#<PropertyGroup>#<PropertyGroup><TargetFrameworkVersion>v4.5</TargetFrameworkVersion>#g
+      s#<SignAssembly>.*$#<SignAssembly>false</SignAssembly>#g
+      s#<PostBuildEvent>.*sgen.exe.*$##
+    ' {} \;
+  '';
 
   desktopItem = makeDesktopItem {
     name = "keepass";