python-pyclipr
LOW
maintainer jskier
0 votes
scanned 2026-09-23 13:40:34.773403
Why flagged
Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.
Triggered rules
Low
Few votes, recently uploaded
zero_votes_recent
Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.
PKGBUILD
1
# Maintainer: Jeremy MountainJohnson <jay@jskier.com>
2
pkgname=python-pyclipr
3
_name=pyclipr
4
pkgver=0.1.8
5
pkgrel=1
6
pkgdesc="Python library for polygon clipping and offsetting based on Clipper2"
7
arch=('x86_64' 'aarch64')
8
url="https://github.com/drlukeparry/pyclipr"
9
license=('BSL-1.0')
10
depends=('python' 'python-numpy' 'glibc' 'libgcc' 'libstdc++')
11
makedepends=('python-build' 'python-installer' 'python-hatchling' 'python-hatch-build-scripts'
12
'python-scikit-build' 'python-scikit-build-core' 'python-pybind11-stubgen' 'python-wheel'
13
'pybind11' 'eigen' 'cmake' 'ninja')
14
source=("https://files.pythonhosted.org/packages/source/${_name::1}/$_name/$_name-$pkgver.tar.gz")
15
sha256sums=('ff8360330f827dc4801a57cd18d3bc925814b6a9a05f14be1e0f8f72cc27488f')
16
17
prepare() {
18
cd "$_name-$pkgver"
19
# Use system pybind11 and eigen instead of the bundled copies (Clipper2 stays
20
# bundled: it is compiled statically with USINGZ, which the AUR clipper2 lacks)
21
sed -i 's|add_subdirectory(external/pybind11)|find_package(pybind11 CONFIG REQUIRED)|' CMakeLists.txt
22
sed -i 's|set(EIGEN3_INCLUDE_DIR external/eigen)|set(EIGEN3_INCLUDE_DIR /usr/include/eigen3)|' CMakeLists.txt
23
rm -rf external/pybind11 external/eigen
24
}
25
26
build() {
27
cd "$_name-$pkgver"
28
# scikit-build-core falls back to Python's sysconfig CXX when unset; on Arch Linux ARM
29
# that is /usr/lib/distcc/bin/g++, which does not exist without distcc installed
30
export CC="${CC:-gcc}" CXX="${CXX:-g++}"
31
python -m build --wheel --no-isolation
32
}
33
34
check() {
35
cd "$_name-$pkgver"
36
local _site="$PWD/test-site"
37
rm -rf "$_site"
38
python -m installer --destdir="$_site" dist/*.whl
39
local _pydir=$(python -c 'import site; print(site.getsitepackages()[0])')
40
PYTHONPATH="$_site$_pydir" python -c '
41
import numpy as np, pyclipr
42
pc = pyclipr.Clipper()
43
pc.scaleFactor = 1000
44
pc.addPath(np.array([[0., 0.], [0., 1.], [1., 1.], [1., 0.]]), pyclipr.Subject)
45
pc.addPath(np.array([[.5, .5], [.5, 1.5], [1.5, 1.5], [1.5, .5]]), pyclipr.Clip)
46
out = pc.execute(pyclipr.Intersection, pyclipr.FillRule.EvenOdd)
47
assert len(out) == 1 and len(out[0]) == 4, out
48
po = pyclipr.ClipperOffset()
49
po.scaleFactor = 1000
50
po.addPaths([np.array([[0., 0.], [0., 1.], [1., 1.], [1., 0.]])], pyclipr.JoinType.Miter, pyclipr.EndType.Polygon)
51
assert len(po.execute(0.1)) == 1
52
print("pyclipr smoke test OK")
53
'
54
}
55
56
package() {
57
cd "$_name-$pkgver"
58
python -m installer --destdir="$pkgdir" dist/*.whl
59
# CMake also installs a build-time export header into site-packages/include; not useful
60
local _pydir=$(python -c 'import site; print(site.getsitepackages()[0])')
61
rm -r "$pkgdir$_pydir/include"
62
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
63
}
64
Scan history
| Scanned at (UTC) | Severity | Rules |
|---|---|---|
| 2026-09-23 13:40:34 | Low | 1 |