1{ stdenv, buildPythonPackage, fetchPypi, gnupg1 }:
2
3buildPythonPackage rec {
4 name = "${pname}-${version}";
5 pname = "python-gnupg";
6 version = "0.4.1";
7
8 src = fetchPypi {
9 inherit pname version;
10 sha256 = "06hfw9cmiw5306fyisp3kzg1hww260qzip829g7y7pj1mwpb0izg";
11 };
12
13 propagatedBuildInputs = [ gnupg1 ];
14
15 # Let's make the library default to our gpg binary
16 patchPhase = ''
17 substituteInPlace gnupg.py \
18 --replace "gpgbinary='gpg'" "gpgbinary='${gnupg1}/bin/gpg'"
19 substituteInPlace test_gnupg.py \
20 --replace "gpgbinary=GPGBINARY" "gpgbinary='${gnupg1}/bin/gpg'" \
21 --replace "test_search_keys" "disabled__test_search_keys"
22 '';
23
24 meta = with stdenv.lib; {
25 description = "A wrapper for the Gnu Privacy Guard";
26 homepage = https://pypi.python.org/pypi/python-gnupg;
27 license = licenses.bsd3;
28 maintainers = with maintainers; [ copumpkin ];
29 platforms = platforms.unix;
30 };
31}