python-fasttext/py-link-against-shared.patch
Matej Cepl b37c5fa6f2 Accepting request 1206651 from home:jirislaby:branches:devel:languages:python
- switch to cmake + ninja
  * the former builds a proper lib
- package the shared library, fasttext binary and -devel properly
  (create new %package's for those)
- add patches to fit our needs:
  * no-static-lib.patch
  * proper-lib-dir.patch
  * py-link-against-shared.patch

OBS-URL: https://build.opensuse.org/request/show/1206651
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-fasttext?expand=0&rev=11
2024-10-11 00:39:33 +00:00

35 lines
987 B
Diff

From: Jiri Slaby <jslaby@suse.cz>
Subject: [PATCH] py: link against shared
Patch-mainline: no
Link the python bindings to the now present libfasttext.so. It reduces
the duplication as well as the compilation time.
---
setup.py | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
--- a/setup.py
+++ b/setup.py
@@ -54,19 +54,13 @@ else:
del sys.argv[coverage_index]
coverage = True
-fasttext_src_files = map(str, os.listdir(FASTTEXT_SRC))
-fasttext_src_cc = list(filter(lambda x: x.endswith('.cc'), fasttext_src_files))
-
-fasttext_src_cc = list(
- map(lambda x: str(os.path.join(FASTTEXT_SRC, x)), fasttext_src_cc)
-)
-
ext_modules = [
Extension(
str('fasttext_pybind'),
[
str('python/fasttext_module/fasttext/pybind/fasttext_pybind.cc'),
- ] + fasttext_src_cc,
+ ],
+ libraries=[str('fasttext')],
include_dirs=[
# Path to pybind11 headers
get_pybind_include(),