about summary refs log tree commit diff
path: root/pkgs/applications/misc/veracrypt
diff options
context:
space:
mode:
authorArtturi <Artturin@artturin.com>2021-06-20 22:20:08 +0300
committerGitHub <noreply@github.com>2021-06-20 21:20:08 +0200
commit8e4a27fa42e807211039099734979760a5a3a147 (patch)
tree9473b498ff03a0a79082dd8fc8200e0d0c0a83c7 /pkgs/applications/misc/veracrypt
parent10ae47c37984393353c478d95f4796e30888ba22 (diff)
veracrypt: 1.24-Hotfix1 -> 1.24-Update7 and hardcode mkfs paths (#127592)
Diffstat (limited to 'pkgs/applications/misc/veracrypt')
-rw-r--r--pkgs/applications/misc/veracrypt/default.nix40
-rw-r--r--pkgs/applications/misc/veracrypt/fix-paths.patch22
2 files changed, 47 insertions, 15 deletions
diff --git a/pkgs/applications/misc/veracrypt/default.nix b/pkgs/applications/misc/veracrypt/default.nix
index 5e5fda23d442d..33d0da5c93a4f 100644
--- a/pkgs/applications/misc/veracrypt/default.nix
+++ b/pkgs/applications/misc/veracrypt/default.nix
@@ -1,29 +1,39 @@
-{ lib, stdenv, fetchurl, fetchpatch, pkg-config, makeself, yasm, fuse, wxGTK, lvm2 }:
+{ lib
+, stdenv
+, fetchurl
+, pkg-config
+, makeself
+, yasm
+, fuse
+, wxGTK
+, lvm2
+, substituteAll
+, e2fsprogs
+, exfat
+, ntfs3g
+, btrfs-progs
+}:
 
 with lib;
 
 stdenv.mkDerivation rec {
   pname = "veracrypt";
-  version = "1.24-Hotfix1";
+  version = "1.24-Update7";
 
   src = fetchurl {
     url = "https://launchpad.net/${pname}/trunk/${toLower version}/+download/VeraCrypt_${version}_Source.tar.bz2";
-    sha256 = "8b40ece805b216843d7a71b1a30069c4057931341b030bf65caace59263c5c8c";
+    sha256 = "0i7h44zn2mjzgh416l7kfs0dk6qc7b1bxsaxqqqcvgrpl453n7bc";
   };
 
-
   patches = [
-    # https://github.com/veracrypt/VeraCrypt/issues/529 - fix build on non-x86
-    (fetchpatch {
-      url = "https://github.com/veracrypt/VeraCrypt/commit/afe6b2f45b15393026a1159e5f3d165ac7d0b94a.patch";
-      sha256 = "1xm9cl6zinlr0vah5xr9bvh0y9gw4331zl7d2n5xvqrcdxw3ww1y";
-      stripLen = 1;
-    })
-    # https://github.com/veracrypt/VeraCrypt/issues/529 - fix build on non-x86
-    (fetchpatch {
-      url = "https://github.com/veracrypt/VeraCrypt/commit/3fa636d477119fff6e372074568edb42d038f508.patch";
-      sha256 = "0qsccilip0ksnlzxina38a052gb533r4s422lxhrj3wv9zgpp7l3";
-      stripLen = 1;
+    (substituteAll {
+      src = ./fix-paths.patch;
+      ext2 = "${e2fsprogs}/bin/mkfs.ext2";
+      ext3 = "${e2fsprogs}/bin/mkfs.ext3";
+      ext4 = "${e2fsprogs}/bin/mkfs.ext4";
+      exfat = "${exfat}/bin/mkfs.exfat";
+      ntfs = "${ntfs3g}/bin/mkfs.ntfs";
+      btrfs = "${btrfs-progs}/bin/mkfs.btrfs";
     })
   ];
 
diff --git a/pkgs/applications/misc/veracrypt/fix-paths.patch b/pkgs/applications/misc/veracrypt/fix-paths.patch
new file mode 100644
index 0000000000000..56b4fc483804a
--- /dev/null
+++ b/pkgs/applications/misc/veracrypt/fix-paths.patch
@@ -0,0 +1,22 @@
+diff --color --unified --recursive --text a/Core/VolumeCreator.h b/Core/VolumeCreator.h
+--- a/Core/VolumeCreator.h	2021-06-20 20:54:50.725210056 +0300
++++ b/Core/VolumeCreator.h	2021-06-20 20:58:46.117742419 +0300
+@@ -77,12 +77,12 @@
+ 				switch (fsType)
+ 				{
+ 	#if defined (TC_LINUX)
+-				case VolumeCreationOptions::FilesystemType::Ext2:		return "mkfs.ext2";
+-				case VolumeCreationOptions::FilesystemType::Ext3:		return "mkfs.ext3";
+-				case VolumeCreationOptions::FilesystemType::Ext4:		return "mkfs.ext4";
+-				case VolumeCreationOptions::FilesystemType::NTFS:		return "mkfs.ntfs";
+-				case VolumeCreationOptions::FilesystemType::exFAT:		return "mkfs.exfat";
+-				case VolumeCreationOptions::FilesystemType::Btrfs:		return "mkfs.btrfs";
++				case VolumeCreationOptions::FilesystemType::Ext2:		return "@ext2@";
++				case VolumeCreationOptions::FilesystemType::Ext3:		return "@ext3@";
++				case VolumeCreationOptions::FilesystemType::Ext4:		return "@ext4@";
++				case VolumeCreationOptions::FilesystemType::NTFS:		return "@ntfs@";
++				case VolumeCreationOptions::FilesystemType::exFAT:		return "@exfat@";
++				case VolumeCreationOptions::FilesystemType::Btrfs:		return "@btrfs@";
+ 	#elif defined (TC_MACOSX)
+ 				case VolumeCreationOptions::FilesystemType::MacOsExt:	return "newfs_hfs";
+ 				case VolumeCreationOptions::FilesystemType::exFAT:		return "newfs_exfat";