aboutsummaryrefslogtreecommitdiff
path: root/pkgs/os-specific/linux/tomb/default.nix
diff options
context:
space:
mode:
authorPeter Hoeg <peter@hoeg.com>2017-06-05 18:02:03 +0800
committerPeter Hoeg <peter@hoeg.com>2017-06-05 18:02:12 +0800
commita0598f9b347c197f979c513d6d3034aeb1855780 (patch)
treecb34592c76b02c3f8fe797d1877e6f8fa31dc4c2 /pkgs/os-specific/linux/tomb/default.nix
parent1890b1fe9f1470d07f1649d5e142e3947ea44c8a (diff)
tomb: clean up and use gnupg 2 instead of gnupg 1
Diffstat (limited to 'pkgs/os-specific/linux/tomb/default.nix')
-rw-r--r--pkgs/os-specific/linux/tomb/default.nix44
1 files changed, 24 insertions, 20 deletions
diff --git a/pkgs/os-specific/linux/tomb/default.nix b/pkgs/os-specific/linux/tomb/default.nix
index 141af86a337b..f1347c197bf6 100644
--- a/pkgs/os-specific/linux/tomb/default.nix
+++ b/pkgs/os-specific/linux/tomb/default.nix
@@ -1,18 +1,23 @@
-{ stdenv, fetchurl, zsh, pinentry, cryptsetup, gnupg1orig, makeWrapper }:
-
-let
- version = "2.4";
-in
+{ stdenv, lib, fetchFromGitHub, gettext, zsh, pinentry, cryptsetup, gnupg, makeWrapper }:
stdenv.mkDerivation rec {
name = "tomb-${version}";
+ version = "2.4";
- src = fetchurl {
- url = "https://files.dyne.org/tomb/Tomb-${version}.tar.gz";
- sha256 = "1hv1w79as7swqj0n137vz8n8mwvcgwlvd91sdyssz41jarg7f1vr";
+ src = fetchFromGitHub {
+ owner = "dyne";
+ repo = "Tomb";
+ rev = "v${version}";
+ sha256 = "192jpgn02mvi4d4inbq2q11zl7xw6njymvali7al8wmygkkycrw4";
};
- buildInputs = [ makeWrapper ];
+ nativeBuildInputs = [ makeWrapper ];
+
+ postPatch = ''
+ # if not, it shows .tomb-wrapped when running
+ substituteInPlace tomb \
+ --replace 'TOMBEXEC=$0' 'TOMBEXEC=tomb'
+ '';
buildPhase = ''
# manually patch the interpreter
@@ -20,22 +25,21 @@ stdenv.mkDerivation rec {
'';
installPhase = ''
- mkdir -p $out/bin
- mkdir -p $out/share/man/man1
+ install -Dm755 tomb $out/bin/tomb
+ install -Dm644 doc/tomb.1 $out/share/man/man1/tomb.1
- cp tomb $out/bin/tomb
- cp doc/tomb.1 $out/share/man/man1
+ # it works fine with gnupg v2, but it looks for an executable named gpg
+ ln -s ${gnupg}/bin/gpg2 $out/bin/gpg
wrapProgram $out/bin/tomb \
- --prefix PATH : "${pinentry}/bin" \
- --prefix PATH : "${cryptsetup}/bin" \
- --prefix PATH : "${gnupg1orig}/bin"
+ --prefix PATH : $out/bin:${lib.makeBinPath [ cryptsetup gettext pinentry ]}
'';
- meta = {
+ meta = with stdenv.lib; {
description = "File encryption on GNU/Linux";
- homepage = https://www.dyne.org/software/tomb/;
- license = stdenv.lib.licenses.gpl3;
- platforms = stdenv.lib.platforms.linux;
+ homepage = https://www.dyne.org/software/tomb/;
+ license = licenses.gpl3;
+ maintainers = with maintainers; [ peterhoeg ];
+ platforms = platforms.linux;
};
}