2017-06-05 12:02:03 +02:00
|
|
|
{ stdenv, lib, fetchFromGitHub, gettext, zsh, pinentry, cryptsetup, gnupg, makeWrapper }:
|
2016-04-22 17:42:40 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "tomb-${version}";
|
2017-06-05 12:02:03 +02:00
|
|
|
version = "2.4";
|
2016-04-22 17:42:40 +02:00
|
|
|
|
2017-06-05 12:02:03 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "dyne";
|
|
|
|
repo = "Tomb";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "192jpgn02mvi4d4inbq2q11zl7xw6njymvali7al8wmygkkycrw4";
|
2016-04-22 17:42:40 +02:00
|
|
|
};
|
|
|
|
|
2017-06-05 12:02:03 +02:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# if not, it shows .tomb-wrapped when running
|
|
|
|
substituteInPlace tomb \
|
|
|
|
--replace 'TOMBEXEC=$0' 'TOMBEXEC=tomb'
|
|
|
|
'';
|
2016-04-22 17:42:40 +02:00
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
# manually patch the interpreter
|
|
|
|
sed -i -e "1s|.*|#!${zsh}/bin/zsh|g" tomb
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2017-06-05 12:02:03 +02:00
|
|
|
install -Dm755 tomb $out/bin/tomb
|
|
|
|
install -Dm644 doc/tomb.1 $out/share/man/man1/tomb.1
|
2016-04-22 17:42:40 +02:00
|
|
|
|
2017-08-10 11:43:48 +02:00
|
|
|
ln -s ${gnupg}/bin/gpg $out/bin/gpg
|
2016-04-22 17:42:40 +02:00
|
|
|
|
|
|
|
wrapProgram $out/bin/tomb \
|
2017-06-05 12:02:03 +02:00
|
|
|
--prefix PATH : $out/bin:${lib.makeBinPath [ cryptsetup gettext pinentry ]}
|
2016-04-22 17:42:40 +02:00
|
|
|
'';
|
|
|
|
|
2017-06-05 12:02:03 +02:00
|
|
|
meta = with stdenv.lib; {
|
2016-04-22 17:42:40 +02:00
|
|
|
description = "File encryption on GNU/Linux";
|
2017-06-05 12:02:03 +02:00
|
|
|
homepage = https://www.dyne.org/software/tomb/;
|
|
|
|
license = licenses.gpl3;
|
|
|
|
maintainers = with maintainers; [ peterhoeg ];
|
|
|
|
platforms = platforms.linux;
|
2016-04-22 17:42:40 +02:00
|
|
|
};
|
|
|
|
}
|