2023-11-16 04:20:00 +00:00
|
|
|
{ lib, python3Packages, fetchFromGitHub, fetchpatch }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
python3Packages.buildPythonApplication rec {
|
|
|
|
pname = "cpplint";
|
2021-12-06 16:07:01 +00:00
|
|
|
version = "1.5.5";
|
2023-11-16 04:20:00 +00:00
|
|
|
format = "setuptools";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# Fetch from github instead of pypi, since the test cases are not in the pypi archive
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-JXz2Ufo7JSceZVqYwCRkuAsOR08znZlIUk8GCLAyiI4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
patches = [
|
|
|
|
./0001-Remove-pytest-runner-version-pin.patch
|
|
|
|
|
|
|
|
# The patch below stops using the sre_compile module, which was deprecated
|
|
|
|
# in Python 3.11 and replaces it with re.compile. Upstream is unsure if it
|
|
|
|
# should use re.compile or re._compiler.compile, so we should monitor the
|
|
|
|
# thread for updates.
|
|
|
|
#
|
|
|
|
# https://github.com/cpplint/cpplint/pull/214
|
|
|
|
#
|
|
|
|
(fetchpatch {
|
|
|
|
name = "python-3.11-compatibility.patch";
|
|
|
|
url = "https://github.com/cpplint/cpplint/commit/e84e84f53915ae2a9214e756cf89c573a73bbcd3.patch";
|
|
|
|
hash = "sha256-u57AFWaVmGFSsvSGq1x9gZmTsuZPqXvTC7mTfyb2164=";
|
|
|
|
})
|
|
|
|
];
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
postPatch = ''
|
|
|
|
patchShebangs cpplint_unittest.py
|
|
|
|
'';
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = with python3Packages; [ pytest pytest-runner ];
|
2020-04-24 23:36:52 +00:00
|
|
|
checkPhase = ''
|
|
|
|
./cpplint_unittest.py
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/cpplint/cpplint";
|
|
|
|
description = "Static code checker for C++";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "cpplint";
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = [ maintainers.bhipple ];
|
|
|
|
license = [ licenses.bsd3 ];
|
|
|
|
};
|
|
|
|
}
|