at 24.11-pre 2.1 kB view raw
1{ 2 stdenv, 3 lib, 4 buildPythonPackage, 5 click, 6 colorama, 7 fetchPypi, 8 git, 9 gnugrep, 10 gnupg, 11 nose, 12 pbr, 13 pexpect, 14 pythonAtLeast, 15 substituteAll, 16 tree, 17 xclip, 18}: 19 20# Use the `pypass` top-level attribute, if you're interested in the 21# application 22buildPythonPackage rec { 23 pname = "pypass"; 24 version = "0.2.1"; 25 format = "setuptools"; 26 27 src = fetchPypi { 28 inherit pname version; 29 sha256 = "1nm4mj7pd7gz4ghic6b3wrnd1b59hd1f0axavdabfl79wy511l7r"; 30 }; 31 32 # Set absolute nix store paths to the executables that pypass uses 33 patches = [ 34 (substituteAll { 35 src = ./mark-executables.patch; 36 git_exec = "${git}/bin/git"; 37 grep_exec = "${gnugrep}/bin/grep"; 38 gpg_exec = "${gnupg}/bin/gpg2"; 39 tree_exec = "${tree}/bin/tree"; 40 xclip_exec = "${xclip}/bin/xclip"; 41 }) 42 ]; 43 44 # Remove enum34 requirement if Python >= 3.4 45 postPatch = lib.optionalString (pythonAtLeast "3.4") '' 46 substituteInPlace requirements.txt --replace "enum34" "" 47 ''; 48 49 nativeBuildInputs = [ pbr ]; 50 51 propagatedBuildInputs = [ 52 click 53 colorama 54 pexpect 55 ]; 56 57 nativeCheckInputs = [ nose ]; 58 59 # Configuration so that the tests work 60 preCheck = '' 61 HOME=$TEMP ${git}/bin/git config --global user.email "nix-builder@nixos.org" 62 HOME=$TEMP ${git}/bin/git config --global user.name "Nix Builder" 63 HOME=$TEMP ${git}/bin/git config --global pull.ff only 64 HOME=$TEMP make setup_gpg 65 ''; 66 67 # Run tests but exclude the test that uses clipboard as I wasn't able to make 68 # it work - probably the X clipboard just doesn't work in the build 69 # environment.. 70 checkPhase = '' 71 runHook preCheck 72 HOME=$TEMP GNUPGHOME=pypass/tests/gnupg nosetests -v --exclude=test_show_clip . 73 runHook postCheck 74 ''; 75 76 meta = with lib; { 77 broken = stdenv.isDarwin; 78 description = "Password manager pass in Python"; 79 mainProgram = "pypass"; 80 homepage = "https://github.com/aviau/python-pass"; 81 license = licenses.gpl3Plus; 82 platforms = platforms.all; 83 maintainers = with maintainers; [ jluttine ]; 84 }; 85}