1 { fetchurl, fetchpatch, lib, stdenv, ncurses, gnupg }:
4 in stdenv.mkDerivation {
5 # mdp renamed to gpg-mdp because there is a mdp package already.
9 homepage = "https://tamentis.com/projects/mdp/";
10 license = [lib.licenses.isc];
11 description = "Manage your passwords with GnuPG and a text editor";
14 url = "https://tamentis.com/projects/mdp/files/mdp-${version}.tar.gz";
15 sha256 = "04mdnx4ccpxf9m2myy9nvpl9ma4jgzmv9bkrzv2b9affzss3r34g";
18 # Pull fix pending upstream inclusion for -fno-common toolchain support:
19 # https://github.com/tamentis/mdp/pull/9
21 name = "fno-common.patch";
22 url = "https://github.com/tamentis/mdp/commit/95c77de3beb96dc7c76ff36d3f3dfb18411d7c54.patch";
23 sha256 = "1j6yvjzkx31b758yav4arhlm5ig7phl8mgx4fcwj7lm2pfvzwcsz";
26 buildInputs = [ ncurses ];
28 substituteInPlace ./configure \
29 --replace "alias echo=/bin/echo" ""
31 substituteInPlace ./src/config.c \
32 --replace "/usr/bin/gpg" "${gnupg}/bin/gpg" \
33 --replace "/usr/bin/vi" "vi"
35 substituteInPlace ./mdp.1 \
36 --replace "/usr/bin/gpg" "${gnupg}/bin/gpg"
38 # we add symlinks to the binary and man page with the name 'gpg-mdp', in case
39 # the completely unrelated program also named 'mdp' is already installed.
41 ln -s $out/bin/mdp $out/bin/gpg-mdp
42 ln -s $out/share/man/man1/mdp.1.gz $out/share/man/man1/gpg-mdp.1.gz