nixpkgs/pkgs/tools/misc/papis/default.nix

57 lines
1.5 KiB
Nix
Raw Normal View History

{ lib, fetchFromGitHub, bashInteractive
2018-06-29 19:13:33 +02:00
, python3, vim
2018-02-09 13:16:36 +01:00
}:
2018-06-29 19:13:33 +02:00
let
2018-07-08 10:44:21 +02:00
python = python3;
2018-06-29 19:13:33 +02:00
in python.pkgs.buildPythonApplication rec {
2018-02-09 13:16:36 +01:00
pname = "papis";
2018-07-08 10:47:59 +02:00
version = "0.6";
2018-02-09 13:16:36 +01:00
# Missing tests on Pypi
src = fetchFromGitHub {
2018-02-21 12:10:38 +01:00
owner = "papis";
2018-02-09 13:16:36 +01:00
repo = pname;
rev = "v${version}";
2018-07-08 10:47:59 +02:00
sha256 = "0zy8q154zhpqb75c775nwq3mdl1szhzhkfi0nvyjmzfgsv2g1wa2";
2018-02-09 13:16:36 +01:00
};
2018-02-21 12:10:38 +01:00
postPatch = ''
sed -i 's/configparser>=3.0.0/# configparser>=3.0.0/' setup.py
patchShebangs tests
'';
2018-02-09 13:16:36 +01:00
2018-06-29 19:13:33 +02:00
propagatedBuildInputs = with python.pkgs; [
2018-02-09 13:16:36 +01:00
argcomplete arxiv2bib beautifulsoup4 bibtexparser
2018-02-20 23:53:43 +01:00
configparser dmenu-python habanero papis-python-rofi
pylibgen prompt_toolkit pyparser python_magic pyyaml
2018-07-08 10:47:59 +02:00
requests unidecode urwid vobject tkinter whoosh
2018-02-09 13:16:36 +01:00
vim
];
2018-06-29 19:13:33 +02:00
checkInputs = with python.pkgs; [ pytest ];
2018-02-20 23:53:43 +01:00
2018-02-09 13:16:36 +01:00
# Papis tries to create the config folder under $HOME during the tests
2018-02-20 23:53:43 +01:00
checkPhase = ''
2018-02-09 13:16:36 +01:00
mkdir -p check-phase
2018-02-21 12:10:38 +01:00
export PATH=$out/bin:$PATH
# Still don't know why this fails
sed -i 's/--set dir=hello //' tests/bash/test_default.sh
2018-02-09 13:16:36 +01:00
2018-02-21 12:10:38 +01:00
# This test has been disabled since it requires a network connaction
sed -i 's/test_downloader_getter(self):/disabled_test_downloader_getter(self):/' papis/downloaders/tests/test_main.py
export HOME=$(pwd)/check-phase
2018-02-20 23:53:43 +01:00
make test
2018-02-21 12:10:38 +01:00
SH=${bashInteractive}/bin/bash make test-non-pythonic
2018-02-20 23:53:43 +01:00
'';
2018-02-09 13:16:36 +01:00
meta = {
description = "Powerful command-line document and bibliography manager";
homepage = http://papis.readthedocs.io/en/latest/;
license = lib.licenses.gpl3;
maintainers = [ lib.maintainers.nico202 ];
};
}