mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-21 02:05:16 +03:00
41 lines
1.7 KiB
Diff
41 lines
1.7 KiB
Diff
Upstream comes with its own copy of the Clipper C++ polygon clipping
|
|
library, which they compile into a static library that gets included
|
|
into the Python wheel. On Alpine Linux, we prefer to use the shared
|
|
library from package `clipper` so that the exact same implementation
|
|
gets called across the system. Also, linking to a system-wide shared
|
|
library reduces total installation size when Clipper gets called
|
|
from both Python and non-Python code.
|
|
|
|
diff --git a/setup.py b/setup.py
|
|
index b102124..6a8f43c 100755
|
|
--- a/setup.py
|
|
+++ b/setup.py
|
|
@@ -23,7 +23,7 @@ if dev_mode:
|
|
from Cython.Distutils import build_ext
|
|
|
|
print('Development mode: Compiling Cython modules from .pyx sources.')
|
|
- sources = ["src/pyclipper/_pyclipper.pyx", "src/clipper.cpp"]
|
|
+ sources = ["src/pyclipper/_pyclipper.pyx"]
|
|
|
|
from setuptools.command.sdist import sdist as _sdist
|
|
|
|
@@ -40,7 +40,7 @@ if dev_mode:
|
|
|
|
else:
|
|
print('Distribution mode: Compiling Cython generated .cpp sources.')
|
|
- sources = ["src/pyclipper/_pyclipper.cpp", "src/clipper.cpp"]
|
|
+ sources = ["src/pyclipper/_pyclipper.cpp"]
|
|
cmdclass = {}
|
|
|
|
|
|
@@ -51,7 +51,9 @@ pytest_runner = ['pytest_runner'] if needs_pytest else []
|
|
ext = Extension("pyclipper._pyclipper",
|
|
sources=sources,
|
|
language="c++",
|
|
- include_dirs=["src"],
|
|
+ include_dirs=["src", "/usr/include/polyclipping"],
|
|
+ libraries=['polyclipping'],
|
|
+ library_dirs=['/usr/lib'],
|
|
# define extra macro definitions that are used by clipper
|
|
# Available definitions that can be used with pyclipper:
|
|
# use_lines, use_int32
|