From 8e4a27fa42e807211039099734979760a5a3a147 Mon Sep 17 00:00:00 2001 From: Artturi Date: Sun, 20 Jun 2021 22:20:08 +0300 Subject: [PATCH] veracrypt: 1.24-Hotfix1 -> 1.24-Update7 and hardcode mkfs paths (#127592) --- pkgs/applications/misc/veracrypt/default.nix | 40 ++++++++++++------- .../misc/veracrypt/fix-paths.patch | 22 ++++++++++ 2 files changed, 47 insertions(+), 15 deletions(-) create mode 100644 pkgs/applications/misc/veracrypt/fix-paths.patch diff --git a/pkgs/applications/misc/veracrypt/default.nix b/pkgs/applications/misc/veracrypt/default.nix index 5e5fda23d44..33d0da5c93a 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 00000000000..56b4fc48380 --- /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";