2021-09-18 10:52:07 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, attrs
|
|
|
|
, buildPythonPackage
|
|
|
|
, colorama
|
|
|
|
, fetchPypi
|
|
|
|
, glibcLocales
|
|
|
|
, importlib-metadata
|
|
|
|
, pyperclip
|
|
|
|
, pytest-mock
|
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
|
|
|
, setuptools-scm
|
|
|
|
, typing-extensions
|
|
|
|
, vim
|
|
|
|
, wcwidth
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
2021-09-18 10:52:07 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "cmd2";
|
2021-09-18 10:52:07 +00:00
|
|
|
version = "2.1.2";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.6";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-09-18 10:52:07 +00:00
|
|
|
sha256 = "25dbb2e9847aaa686a8a21e84e3d101db8b79f5cb992e044fc54210ab8c0ad41";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
LC_ALL = "en_US.UTF-8";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
2021-06-04 09:07:49 +00:00
|
|
|
setuptools-scm
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2021-09-18 10:52:07 +00:00
|
|
|
attrs
|
2020-04-24 23:36:52 +00:00
|
|
|
colorama
|
|
|
|
pyperclip
|
|
|
|
wcwidth
|
2021-09-18 10:52:07 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.8") [
|
|
|
|
typing-extensions
|
|
|
|
importlib-metadata
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
glibcLocales
|
|
|
|
pytest-mock
|
|
|
|
vim
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
postPatch = ''
|
|
|
|
sed -i "/--cov/d" setup.cfg
|
|
|
|
'' + lib.optionalString stdenv.isDarwin ''
|
|
|
|
# Fake the impure dependencies pbpaste and pbcopy
|
|
|
|
mkdir bin
|
|
|
|
echo '#!${stdenv.shell}' > bin/pbpaste
|
|
|
|
echo '#!${stdenv.shell}' > bin/pbcopy
|
|
|
|
chmod +x bin/{pbcopy,pbpaste}
|
|
|
|
export PATH=$(realpath bin):$PATH
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
doCheck = !stdenv.isDarwin;
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "cmd2" ];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Enhancements for standard library's cmd module";
|
|
|
|
homepage = "https://github.com/python-cmd2/cmd2";
|
|
|
|
maintainers = with maintainers; [ teto ];
|
|
|
|
};
|
|
|
|
}
|