2018-06-14 02:25:58 +01:00
|
|
|
{ stdenv, fetchPypi, buildPythonPackage, pythonOlder, isPy3k
|
|
|
|
, pyperclip, six, pyparsing, vim, wcwidth, colorama
|
2018-08-30 18:12:47 +01:00
|
|
|
, contextlib2 ? null, setuptools_scm
|
2018-07-21 01:44:44 +01:00
|
|
|
, pytest, mock, which, glibcLocales
|
2018-02-28 13:55:02 +00:00
|
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "cmd2";
|
2018-08-25 06:44:12 +01:00
|
|
|
version = "0.9.4";
|
2018-02-28 13:55:02 +00:00
|
|
|
|
2018-06-14 02:25:58 +01:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2018-08-25 06:44:12 +01:00
|
|
|
sha256 = "0037dcf92331c63ae43e7e644536e646fff8be2fd5a83da06b3482f910f929c6";
|
2018-02-28 13:55:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
LC_ALL="en_US.UTF-8";
|
|
|
|
|
|
|
|
postPatch = stdenv.lib.optional stdenv.isDarwin ''
|
|
|
|
# Fake the impure dependencies pbpaste and pbcopy
|
|
|
|
mkdir bin
|
|
|
|
echo '#/bin/sh' > bin/pbpaste
|
|
|
|
echo '#/bin/sh' > bin/pbcopy
|
|
|
|
chmod +x bin/{pbcopy,pbpaste}
|
|
|
|
export PATH=$(realpath bin):$PATH
|
|
|
|
'';
|
|
|
|
|
|
|
|
checkInputs= [ pytest mock which vim glibcLocales ];
|
|
|
|
checkPhase = ''
|
|
|
|
# test_path_completion_user_expansion might be fixed in the next release
|
|
|
|
py.test -k 'not test_path_completion_user_expansion'
|
|
|
|
'';
|
|
|
|
doCheck = !stdenv.isDarwin;
|
2018-06-14 02:25:58 +01:00
|
|
|
disabled = !isPy3k;
|
2018-02-28 13:55:02 +00:00
|
|
|
|
2018-08-30 18:12:47 +01:00
|
|
|
buildInputs = [
|
|
|
|
setuptools_scm
|
|
|
|
];
|
|
|
|
|
2018-02-28 13:55:02 +00:00
|
|
|
propagatedBuildInputs = [
|
2018-06-14 02:25:58 +01:00
|
|
|
colorama
|
2018-02-28 13:55:02 +00:00
|
|
|
pyperclip
|
|
|
|
six
|
|
|
|
pyparsing
|
2018-06-14 02:25:58 +01:00
|
|
|
wcwidth
|
2018-02-28 13:55:02 +00:00
|
|
|
]
|
|
|
|
++ stdenv.lib.optional (pythonOlder "3.5") contextlib2
|
|
|
|
;
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Enhancements for standard library's cmd module";
|
|
|
|
homepage = https://github.com/python-cmd2/cmd2;
|
|
|
|
maintainers = with maintainers; [ teto ];
|
|
|
|
};
|
|
|
|
}
|