about summary refs log tree commit diff
path: root/pkgs/applications/misc/veracrypt
diff options
context:
space:
mode:
authorJoachim Fasting <joachifm@fastmail.fm>2017-04-02 16:41:11 +0200
committerJoachim Fasting <joachifm@fastmail.fm>2017-04-02 16:41:13 +0200
commit2c81510a1aacce580a66912ab1b6c2a64c5d0bff (patch)
tree15693bd7e827ddc979a52b7121b4589d0701b60a /pkgs/applications/misc/veracrypt
parent2ae74f9f4f288e8ee79b0c1da3e4876f74a9eab3 (diff)
downloadnixlib-2c81510a1aacce580a66912ab1b6c2a64c5d0bff.tar
nixlib-2c81510a1aacce580a66912ab1b6c2a64c5d0bff.tar.gz
nixlib-2c81510a1aacce580a66912ab1b6c2a64c5d0bff.tar.bz2
nixlib-2c81510a1aacce580a66912ab1b6c2a64c5d0bff.tar.lz
nixlib-2c81510a1aacce580a66912ab1b6c2a64c5d0bff.tar.xz
nixlib-2c81510a1aacce580a66912ab1b6c2a64c5d0bff.tar.zst
nixlib-2c81510a1aacce580a66912ab1b6c2a64c5d0bff.zip
veracrypt: refactorings
- Conditionally add wxGTK30 to inputs to avoid
  eval'ing it regardless of wxGUI
- Patch full path to exe into desktop file
- Move some inputs to native
- Do not write intermediate tar file on unpack
Diffstat (limited to 'pkgs/applications/misc/veracrypt')
-rw-r--r--pkgs/applications/misc/veracrypt/default.nix21
1 files changed, 11 insertions, 10 deletions
diff --git a/pkgs/applications/misc/veracrypt/default.nix b/pkgs/applications/misc/veracrypt/default.nix
index 8e817b5a815b..a3fa8924df74 100644
--- a/pkgs/applications/misc/veracrypt/default.nix
+++ b/pkgs/applications/misc/veracrypt/default.nix
@@ -2,6 +2,8 @@
   wxGUI ? true
 }:
 
+with stdenv.lib;
+
 stdenv.mkDerivation rec {
   name = "veracrypt-${version}";
   version = "1.19";
@@ -11,18 +13,17 @@ stdenv.mkDerivation rec {
     sha256 = "111xs1zmic82lpn5spn0ca33q0g4za04a2k4cvjwdb7k3vcicq6v";
   };
 
-  # The source archive can't be extracted with "tar xfz"; I don't know why
-  # Using "gunzip" before "tar xf" works though
+  # The source archive appears to be compressed twice ...
   unpackPhase =
     ''
-      gunzip -c $src > src.tar
-      tar xf src.tar
+      gzip -dc $src | tar xz
       cd Vera*/src
     '';
 
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ fuse devicemapper wxGTK30 nasm makeself ];
-  makeFlags = if wxGUI then "" else "NOGUI=1";
+  nativeBuildInputs = [ makeself nasm pkgconfig ];
+  buildInputs = [ fuse devicemapper ]
+    ++ optional wxGUI wxGTK30;
+  makeFlags = optionalString (!wxGUI) "NOGUI=1";
 
   installPhase =
     ''
@@ -31,14 +32,14 @@ stdenv.mkDerivation rec {
       mkdir -p $out/share/$name
       cp License.txt $out/share/$name/LICENSE
       mkdir -p $out/share/applications
-      sed 's/\/usr\/bin\/veracrypt/veracrypt/' Setup/Linux/veracrypt.desktop > $out/share/applications/veracrypt.desktop
+      sed "s,Exec=.*,Exec=$out/bin/veracrypt," Setup/Linux/veracrypt.desktop > $out/share/applications/veracrypt.desktop
     '';
 
   meta = {
     description = "Free Open-Source filesystem on-the-fly encryption";
     homepage = https://veracrypt.codeplex.com/;
     license = "VeraCrypt License";
-    maintainers = with stdenv.lib.maintainers; [dsferruzza];
-    platforms = stdenv.lib.platforms.linux;
+    maintainers = with maintainers; [ dsferruzza ];
+    platforms = platforms.linux;
   };
 }