From cc4fa379cb12ac7d84b4a79c8f6b683815bb9664 Mon Sep 17 00:00:00 2001 From: David Sferruzza Date: Sun, 2 Apr 2017 16:37:11 +0200 Subject: [PATCH 1/3] maintainers: add dsferruzza --- lib/maintainers.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/maintainers.nix b/lib/maintainers.nix index 087c2463957..4e62799373a 100644 --- a/lib/maintainers.nix +++ b/lib/maintainers.nix @@ -142,6 +142,7 @@ dpaetzel = "David Pätzel "; drets = "Dmytro Rets "; drewkett = "Andrew Burkett "; + dsferruzza = "David Sferruzza "; dtzWill = "Will Dietz "; e-user = "Alexander Kahl "; ebzzry = "Rommel Martinez "; From 2ae74f9f4f288e8ee79b0c1da3e4876f74a9eab3 Mon Sep 17 00:00:00 2001 From: David Sferruzza Date: Sun, 2 Apr 2017 16:38:08 +0200 Subject: [PATCH 2/3] veracrypt: init at 1.19 --- pkgs/applications/misc/veracrypt/default.nix | 44 ++++++++++++++++++++ pkgs/top-level/all-packages.nix | 4 ++ 2 files changed, 48 insertions(+) create mode 100644 pkgs/applications/misc/veracrypt/default.nix diff --git a/pkgs/applications/misc/veracrypt/default.nix b/pkgs/applications/misc/veracrypt/default.nix new file mode 100644 index 00000000000..8e817b5a815 --- /dev/null +++ b/pkgs/applications/misc/veracrypt/default.nix @@ -0,0 +1,44 @@ +{ fetchurl, stdenv, pkgconfig, nasm, fuse, wxGTK30, devicemapper, makeself, + wxGUI ? true +}: + +stdenv.mkDerivation rec { + name = "veracrypt-${version}"; + version = "1.19"; + + src = fetchurl { + url = "https://launchpad.net/veracrypt/trunk/${version}/+download/VeraCrypt_${version}_Source.tar.gz"; + sha256 = "111xs1zmic82lpn5spn0ca33q0g4za04a2k4cvjwdb7k3vcicq6v"; + }; + + # The source archive can't be extracted with "tar xfz"; I don't know why + # Using "gunzip" before "tar xf" works though + unpackPhase = + '' + gunzip -c $src > src.tar + tar xf src.tar + cd Vera*/src + ''; + + nativeBuildInputs = [ pkgconfig ]; + buildInputs = [ fuse devicemapper wxGTK30 nasm makeself ]; + makeFlags = if wxGUI then "" else "NOGUI=1"; + + installPhase = + '' + mkdir -p $out/bin + cp Main/veracrypt $out/bin + 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 + ''; + + 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; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9484dc06bc1..92ebdb0194b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4532,6 +4532,10 @@ with pkgs; python = python27; }; + veracrypt = callPackage ../applications/misc/veracrypt { + wxGUI = true; + }; + vlan = callPackage ../tools/networking/vlan { }; vmtouch = callPackage ../tools/misc/vmtouch { }; From 2c81510a1aacce580a66912ab1b6c2a64c5d0bff Mon Sep 17 00:00:00 2001 From: Joachim Fasting Date: Sun, 2 Apr 2017 16:41:11 +0200 Subject: [PATCH 3/3] 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 --- pkgs/applications/misc/veracrypt/default.nix | 21 ++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/pkgs/applications/misc/veracrypt/default.nix b/pkgs/applications/misc/veracrypt/default.nix index 8e817b5a815..a3fa8924df7 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; }; }