python3Packages.marisa-trie: unvendor marisa

Changed files
+45 -6
pkgs
development
python-modules
top-level
+12 -5
pkgs/development/python-modules/marisa-trie/default.nix
···
lib,
buildPythonPackage,
fetchPypi,
+
replaceVars,
+
marisa-cpp,
cython,
setuptools,
pytestCheckHook,
···
hash = "sha256-OifECOKu/APg8dJbL/KvuFqsNWj2+iripTtXouh84p0=";
};
+
patches = [
+
(replaceVars ./unvendor-marisa.patch {
+
marisa = lib.getDev marisa-cpp;
+
})
+
];
+
build-system = [
cython
setuptools
];
+
buildInputs = [
+
marisa-cpp
+
];
+
nativeCheckInputs = [
pytestCheckHook
readme-renderer
hypothesis
];
-
-
postPatch = ''
-
substituteInPlace setup.py \
-
--replace "hypothesis==" "hypothesis>="
-
'';
preBuild = ''
./update_cpp.sh
+30
pkgs/development/python-modules/marisa-trie/unvendor-marisa.patch
···
+
diff --git a/setup.py b/setup.py
+
index c0c5c03..6373a2a 100755
+
--- a/setup.py
+
+++ b/setup.py
+
@@ -71,15 +71,6 @@ setup(
+
license=LICENSE,
+
url="https://github.com/pytries/marisa-trie",
+
classifiers=CLASSIFIERS,
+
- libraries=[
+
- (
+
- "libmarisa-trie",
+
- {
+
- "sources": MARISA_FILES,
+
- "include_dirs": [MARISA_SOURCE_DIR, MARISA_INCLUDE_DIR],
+
- },
+
- )
+
- ],
+
ext_modules=[
+
Extension(
+
"marisa_trie",
+
@@ -94,7 +85,8 @@ setup(
+
"src/std_iostream.cpp",
+
"src/trie.cpp",
+
],
+
- include_dirs=[MARISA_INCLUDE_DIR],
+
+ include_dirs=["@marisa@/include"],
+
+ libraries=["marisa"],
+
)
+
],
+
python_requires=">=3.8",
+3 -1
pkgs/top-level/python-packages.nix
···
marisa = callPackage ../development/python-modules/marisa { inherit (pkgs) marisa; };
-
marisa-trie = callPackage ../development/python-modules/marisa-trie { };
+
marisa-trie = callPackage ../development/python-modules/marisa-trie {
+
marisa-cpp = pkgs.marisa;
+
};
markdown = callPackage ../development/python-modules/markdown { };