tomb: clean up and use gnupg 2 instead of gnupg 1

+24 -20
+24 -20
pkgs/os-specific/linux/tomb/default.nix
··· 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 }: 6 2 7 3 stdenv.mkDerivation rec { 8 4 name = "tomb-${version}"; 5 + version = "2.4"; 9 6 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"; 13 12 }; 14 13 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 + ''; 16 21 17 22 buildPhase = '' 18 23 # manually patch the interpreter ··· 20 25 ''; 21 26 22 27 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 25 30 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 28 33 29 34 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 ]} 33 36 ''; 34 37 35 - meta = { 38 + meta = with stdenv.lib; { 36 39 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; 40 44 }; 41 45 }