2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
setuptools,
|
|
|
|
ply,
|
|
|
|
python,
|
2021-06-28 23:13:55 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "calmjs-parse";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "1.3.1";
|
2022-06-16 17:23:12 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
pyproject = true;
|
2021-06-28 23:13:55 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "calmjs";
|
|
|
|
repo = "calmjs.parse";
|
|
|
|
rev = version;
|
2024-01-02 11:29:13 +00:00
|
|
|
hash = "sha256-xph+NuTkWfW0t/1vxWBSgsjU7YHQMnsm/W/XdkAnl7I=";
|
2021-06-28 23:13:55 +00:00
|
|
|
};
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "env['PYTHONPATH'] = 'src'" "env['PYTHONPATH'] += ':src'"
|
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ setuptools ];
|
2024-01-02 11:29:13 +00:00
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
ply
|
|
|
|
];
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
|
|
|
|
${python.interpreter} -m unittest calmjs.parse.tests.make_suite
|
|
|
|
|
|
|
|
runHook postCheck
|
|
|
|
'';
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"calmjs.parse"
|
|
|
|
"calmjs.parse.asttypes"
|
|
|
|
"calmjs.parse.parsers"
|
|
|
|
"calmjs.parse.rules"
|
|
|
|
"calmjs.parse.sourcemap"
|
|
|
|
"calmjs.parse.unparsers.es5"
|
|
|
|
"calmjs.parse.walkers"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
2024-01-02 11:29:13 +00:00
|
|
|
changelog = "https://github.com/calmjs/calmjs.parse/blob/${src.rev}/CHANGES.rst";
|
2021-06-28 23:13:55 +00:00
|
|
|
description = "Various parsers for ECMA standards";
|
|
|
|
homepage = "https://github.com/calmjs/calmjs.parse";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ dotlambda ];
|
|
|
|
};
|
|
|
|
}
|