Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / applications / misc / veracrypt / default.nix
blob43537db9cc63e613efd62a572787accbefade6ca
1 { lib
2 , stdenv
3 , fetchurl
4 , pkg-config
5 , makeself
6 , yasm
7 , fuse
8 , wxGTK
9 , lvm2
10 , substituteAll
11 , e2fsprogs
12 , exfat
13 , ntfs3g
14 , btrfs-progs
15 , wrapGAppsHook
18 stdenv.mkDerivation rec {
19   pname = "veracrypt";
20   version = "1.25.9";
22   src = fetchurl {
23     url = "https://launchpad.net/${pname}/trunk/${lib.toLower version}/+download/VeraCrypt_${version}_Source.tar.bz2";
24     sha256 = "sha256-drbhgYS8IaQdKUn/Y9ch1JBUpxbO/zpL13tcNRC3lK8=";
25   };
27   patches = [
28     (substituteAll {
29       src = ./fix-paths.patch;
30       ext2 = "${e2fsprogs}/bin/mkfs.ext2";
31       ext3 = "${e2fsprogs}/bin/mkfs.ext3";
32       ext4 = "${e2fsprogs}/bin/mkfs.ext4";
33       exfat = "${exfat}/bin/mkfs.exfat";
34       ntfs = "${ntfs3g}/bin/mkfs.ntfs";
35       btrfs = "${btrfs-progs}/bin/mkfs.btrfs";
36     })
37   ];
39   sourceRoot = "src";
41   nativeBuildInputs = [ makeself pkg-config yasm wrapGAppsHook ];
42   buildInputs = [ fuse lvm2 wxGTK ];
44   enableParallelBuilding = true;
46   installPhase = ''
47     install -Dm 755 Main/${pname} "$out/bin/${pname}"
48     install -Dm 444 Resources/Icons/VeraCrypt-256x256.xpm "$out/share/pixmaps/${pname}.xpm"
49     install -Dm 444 License.txt -t "$out/share/doc/${pname}/"
50     install -d $out/share/applications
51     substitute Setup/Linux/${pname}.desktop $out/share/applications/${pname}.desktop \
52       --replace "Exec=/usr/bin/veracrypt" "Exec=$out/bin/veracrypt" \
53       --replace "Icon=veracrypt" "Icon=veracrypt.xpm"
54   '';
56   meta = with lib; {
57     description = "Free Open-Source filesystem on-the-fly encryption";
58     homepage = "https://www.veracrypt.fr/";
59     license = with licenses; [ asl20 /* and */ unfree /* TrueCrypt License version 3.0 */ ];
60     maintainers = with maintainers; [ dsferruzza ];
61     platforms = platforms.linux;
62   };