2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
2022-03-30 09:31:56 +00:00
|
|
|
, fetchFromGitHub
|
2020-04-24 23:36:52 +00:00
|
|
|
, cmake
|
|
|
|
}:
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
let
|
|
|
|
tests = fetchFromGitHub {
|
|
|
|
owner = "editorconfig";
|
|
|
|
repo = "editorconfig-core-test";
|
|
|
|
rev = "e407c1592df0f8e91664835324dea85146f20189";
|
|
|
|
sha256 = "sha256-9WSEkMJOewPqJjB6f7J6Ir0L+U712hkaN+GszjnGw7c=";
|
|
|
|
};
|
|
|
|
in
|
2020-04-24 23:36:52 +00:00
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "editorconfig";
|
2021-07-04 02:40:35 +00:00
|
|
|
version = "0.12.3";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "editorconfig";
|
|
|
|
repo = "editorconfig-core-py";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "sha256-ZwoTMgk18+BpPNtXKQUMXGcl2Lp+1RQVyPHgk6gHWh8=";
|
|
|
|
# workaround until https://github.com/editorconfig/editorconfig-core-py/pull/40 is merged
|
|
|
|
# fetchSubmodules = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
postUnpack = ''
|
|
|
|
cp -r ${tests}/* source/tests
|
|
|
|
chmod +w -R source/tests
|
|
|
|
'';
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
checkInputs = [
|
2021-07-04 02:40:35 +00:00
|
|
|
cmake
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
dontUseCmakeConfigure = true;
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
cmake .
|
2021-07-04 02:40:35 +00:00
|
|
|
# utf_8_char fails with Python 3
|
2020-04-24 23:36:52 +00:00
|
|
|
ctest -E "utf_8_char" .
|
|
|
|
'';
|
|
|
|
|
2021-07-04 02:40:35 +00:00
|
|
|
pythonImportsCheck = [ "editorconfig" ];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "EditorConfig File Locator and Interpreter for Python";
|
2022-05-18 14:49:53 +00:00
|
|
|
homepage = "https://github.com/editorconfig/editorconfig-core-py";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.psfl;
|
2022-05-18 14:49:53 +00:00
|
|
|
maintainers = with maintainers; [ SuperSandro2000 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|