Skip to content

Commit

Permalink
python312Packages.pcre2-py: init at 0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Tochiaha committed Jan 14, 2025
1 parent 69ac79b commit a6fd49d
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 0 deletions.
90 changes: 90 additions & 0 deletions pkgs/development/python-modules/pcre2-py/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
build,
bzip2,
cmake,
cython,
editline,
gitpython,
pytestCheckHook,
buildPythonPackage,
fetchFromGitHub,
haskellPackages,
lib,
libedit,
libz,
pcre2,
scikit-build,
setuptools,
twine,
readline,
requests,
}:

buildPythonPackage rec {
pname = "pcre2-py";
version = "0.4.0";
pyproject = true;

src = fetchFromGitHub {
owner = "grtetrault";
repo = "pcre2.py";
rev = "refs/tags/v${version}";
hash = "sha256-NPpI3IWg58num0MZjlEam37Qz9D3dDMhFjfVXB8ugOg=";
fetchSubmodules = false;
};

postPatch = ''
substituteInPlace CMakeLists.txt \
--replace-fail "add_subdirectory(src/libpcre2)" "" \
--replace-fail "install" "#install"
substituteInPlace src/pcre2/CMakeLists.txt \
--replace-fail "\''${PCRE2_INCLUDE_DIR}" "${pcre2.dev}/include" \
--replace-fail "pcre2-8-static" "pcre2-8"
'';

dontUseCmakeConfigure = true;

build-system = [
cmake
cython
scikit-build
setuptools
];

dependencies =
[
haskellPackages.bz2
haskellPackages.memfd
]
++ [
build
bzip2
editline
libedit
libz
pcre2
readline
requests
];

nativeCheckInputs = [
pytestCheckHook
twine
gitpython
];

pythonImportsCheck = [ "pcre2" ];

postCheck = ''
cd $out
rm -rf *.t* *.py requirements Makefile LICENSE *.md
'';

meta = {
description = "Python bindings for the PCRE2 library created by Philip Hazel";
homepage = "https://github.com/grtetrault/pcre2.py";
changelog = "https://github.com/grtetrault/pcre2.py/releases/tag/v{version}";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ tochiaha ];
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9286,6 +9286,8 @@ self: super: with self; {

pcpp = callPackage ../development/python-modules/pcpp { };

pcre2-py = callPackage ../development/python-modules/pcre2-py { };

pdb2pqr = callPackage ../development/python-modules/pdb2pqr { };

pdbfixer = callPackage ../development/python-modules/pdbfixer { };
Expand Down

0 comments on commit a6fd49d

Please sign in to comment.