@@ -1,18 +1,23 @@
1−{ stdenv, fetchurl, zsh, pinentry, cryptsetup, gnupg1orig, makeWrapper }:
2−
3−let
4− version = "2.4";
5−in
1+{ stdenv, lib, fetchFromGitHub, gettext, zsh, pinentry, cryptsetup, gnupg, makeWrapper }:
62
73stdenv.mkDerivation rec {
84 name = "tomb-${version}";
5+ version = "2.4";
96
10− src = fetchurl {
11− url = "https://files.dyne.org/tomb/Tomb-${version}.tar.gz";
12− sha256 = "1hv1w79as7swqj0n137vz8n8mwvcgwlvd91sdyssz41jarg7f1vr";
7+ src = fetchFromGitHub {
8+ owner = "dyne";
9+ repo = "Tomb";
10+ rev = "v${version}";
11+ sha256 = "192jpgn02mvi4d4inbq2q11zl7xw6njymvali7al8wmygkkycrw4";
1312 };
1413
15− buildInputs = [ makeWrapper ];
14+ nativeBuildInputs = [ makeWrapper ];
15+
16+ postPatch = ''
17+ # if not, it shows .tomb-wrapped when running
18+ substituteInPlace tomb \
19+ --replace 'TOMBEXEC=$0' 'TOMBEXEC=tomb'
20+ '';
1621
1722 buildPhase = ''
1823 # manually patch the interpreter
@@ -20,22 +25,21 @@ stdenv.mkDerivation rec {
2025 '';
2126
2227 installPhase = ''
23− mkdir -p $out/bin
24− mkdir -p $out/share/man/man1
28+ install -Dm755 tomb $out/bin/tomb
29+ install -Dm644 doc/tomb.1 $out/share/man/man1/tomb.1
2530
26− cp tomb $out/bin/tomb
27− cp doc/tomb.1 $out/share/man/man1
31+ # it works fine with gnupg v2, but it looks for an executable named gpg
32+ ln -s ${gnupg}/bin/gpg2 $out/bin/gpg
2833
2934 wrapProgram $out/bin/tomb \
30− --prefix PATH : "${pinentry}/bin" \
31− --prefix PATH : "${cryptsetup}/bin" \
32− --prefix PATH : "${gnupg1orig}/bin"
35+ --prefix PATH : $out/bin:${lib.makeBinPath [ cryptsetup gettext pinentry ]}
3336 '';
3437
35− meta = {
38+ meta = with stdenv.lib; {
3639 description = "File encryption on GNU/Linux";
37− homepage = https://www.dyne.org/software/tomb/;
38− license = stdenv.lib.licenses.gpl3;
39− platforms = stdenv.lib.platforms.linux;
40+ homepage = https://www.dyne.org/software/tomb/;
41+ license = licenses.gpl3;
42+ maintainers = with maintainers; [ peterhoeg ];
43+ platforms = platforms.linux;
4044 };
4145}