python-pyclipr

LOW
maintainer jskier 0 votes scanned 2026-09-23 13:40:34.773403
View on AUR
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>
2pkgname=python-pyclipr
3_name=pyclipr
4pkgver=0.1.8
5pkgrel=1
6pkgdesc="Python library for polygon clipping and offsetting based on Clipper2"
7arch=('x86_64' 'aarch64')
8url="https://github.com/drlukeparry/pyclipr"
9license=('BSL-1.0')
10depends=('python' 'python-numpy' 'glibc' 'libgcc' 'libstdc++')
11makedepends=('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')
14source=("https://files.pythonhosted.org/packages/source/${_name::1}/$_name/$_name-$pkgver.tar.gz")
15sha256sums=('ff8360330f827dc4801a57cd18d3bc925814b6a9a05f14be1e0f8f72cc27488f')
16
17prepare() {
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
26build() {
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
34check() {
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 '
41import numpy as np, pyclipr
42pc = pyclipr.Clipper()
43pc.scaleFactor = 1000
44pc.addPath(np.array([[0., 0.], [0., 1.], [1., 1.], [1., 0.]]), pyclipr.Subject)
45pc.addPath(np.array([[.5, .5], [.5, 1.5], [1.5, 1.5], [1.5, .5]]), pyclipr.Clip)
46out = pc.execute(pyclipr.Intersection, pyclipr.FillRule.EvenOdd)
47assert len(out) == 1 and len(out[0]) == 4, out
48po = pyclipr.ClipperOffset()
49po.scaleFactor = 1000
50po.addPaths([np.array([[0., 0.], [0., 1.], [1., 1.], [1., 0.]])], pyclipr.JoinType.Miter, pyclipr.EndType.Polygon)
51assert len(po.execute(0.1)) == 1
52print("pyclipr smoke test OK")
53'
54}
55
56package() {
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)SeverityRules
2026-09-23 13:40:34 Low 1

Report a package

Reports go to the AURWatch maintainer (one person) and are read by hand. No login required.

0 / 4000
Your suggestion