Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by nld3-dev1.alpinelinux.org (Postfix) with ESMTPS id BC4F4782AFC for ; Thu, 5 Mar 2020 18:55:49 +0000 (UTC) Received: by mail-wm1-f68.google.com with SMTP id g134so7556874wme.3 for ; Thu, 05 Mar 2020 10:55:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ksz3ODNHkV6eRf4eb/OGdDBbHqqoDDvyXlQwYz0xt4w=; b=OXgO9p8W7+wnSTMwNvQGdjf/YGCAfz1o+aUPmHYsYL64ehLQGogpN9gz1OH3zn/9Lt YfSxWYukfiQTDcb8VpODpb39itEgdYt/0WOZL1uvJhbb8JxFozM3ApVqh+CKzJv1pXf/ JjAL2hbBQynTuQP+o5Y6VC252XaNxHjwzBfw53+D76RB+4l8I2sVLrjEXgWPrDriCetY nRgZ3meKPsAoR0LyqvDfR69O0kP2THAHyXChPFtOuSmOfQkVh7IRwvQUaVFe7euifYRP ZlubcI2+pOeX2z/a/j8I5uL5nTVVXQosGwQjhV61ro5FY7BYd3dOxbczOSHadXXPiBDn sH+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=ksz3ODNHkV6eRf4eb/OGdDBbHqqoDDvyXlQwYz0xt4w=; b=rn1bp9sAXESmiSlhR5qcM68DGbjF9bZ+TYiuWANXu57CDfy7dFt4rgAoPKUgvFFLoD 8TdJC+ImmH3nPQikVy0BtBebci9C8lnnrjCoRBw6nikRigIDadm/j6IsER7s9Vd2jVhW p0fTG85cDmuQ+kwdYUdqfkZ0IUmXStxoP6ufwxlHhLI8FBYsMFep2hdd8hc3gGcbJD9m ZkYQBIsuJDkDC2drZC06X9cq83PGpSJ5zDTy8Do4M6Sk24NxWFtOGUX2/+vx2yjdgnlc l8dZKach0KnhakDpL/iJmoJILdIiJozuZSUQfWqpqVNsmw4jNFgxEdiW7gEJOCap5EuY q4ag== X-Gm-Message-State: ANhLgQ3YDq6paOTwypzhH9v2T/3hP0QScGvlGGLYGQ0LgquvD/7R5PRi A6UGyoRytC3NItQFBhwCxmY1zOyJPwJLQg== X-Google-Smtp-Source: ADFU+vtt4YlYrthxjUK42nk9OwFePOFwzKOgwCJMGQL9xjuQeFGuqUkzosdQWdqKxeVsJpbYdBJjlA== X-Received: by 2002:a1c:7c05:: with SMTP id x5mr170819wmc.67.1583434548336; Thu, 05 Mar 2020 10:55:48 -0800 (PST) Received: from localhost.localdomain (pool1-139.cgn.as8758.net. [212.25.6.139]) by smtp.gmail.com with ESMTPSA id c11sm44970372wrp.51.2020.03.05.10.55.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Mar 2020 10:55:47 -0800 (PST) Sender: Sascha Brawer From: Sascha Brawer To: alpine-aports@lists.alpinelinux.org Cc: Sascha Brawer Subject: [PATCH] community/py3-pyclipper: use clipper library from Alpine package Date: Thu, 5 Mar 2020 18:54:58 +0000 Message-Id: <20200305185458.7-1-sascha@brawer.ch> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To save installation space, and to use the exact same implementation of polygon clipping across the system. Also taking the source code from pypi instead of github, like most other Alpine py3 packages. Other than github, pypi is putting the git release tag into the zip bundles, which is then used by Python setuptools. When setuptools is installing a package, it is checking for the version tag, and the installation fails with a warning when the version tag cannot be inferred. Before this change, the `APKBUILD` would run `git init` to work around this setuptools check. After this change, that hack is not needed anymore. --- community/py3-pyclipper/10-system-libs.patch | 30 ++++++++++++++++++++ community/py3-pyclipper/APKBUILD | 29 ++++++++++++++----- 2 files changed, 52 insertions(+), 7 deletions(-) create mode 100644 community/py3-pyclipper/10-system-libs.patch diff --git a/community/py3-pyclipper/10-system-libs.patch b/community/py3-pyclipper/10-system-libs.patch new file mode 100644 index 0000000000..cc1c738856 --- /dev/null +++ b/community/py3-pyclipper/10-system-libs.patch @@ -0,0 +1,30 @@ +--- a/setup.py ++++ b/setup.py +@@ -23,7 +23,7 @@ + from Cython.Distutils import build_ext + + print('Development mode: Compiling Cython modules from .pyx sources.') +- sources = ["pyclipper/pyclipper.pyx", "pyclipper/clipper.cpp"] ++ sources = ["pyclipper/pyclipper.pyx"] + + from setuptools.command.sdist import sdist as _sdist + +@@ -40,7 +40,7 @@ + + else: + print('Distribution mode: Compiling Cython generated .cpp sources.') +- sources = ["pyclipper/pyclipper.cpp", "pyclipper/clipper.cpp"] ++ sources = ["pyclipper/pyclipper.cpp"] + cmdclass = {} + + +@@ -51,6 +51,9 @@ + ext = Extension("pyclipper", + sources=sources, + language="c++", ++ include_dirs=['/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 diff --git a/community/py3-pyclipper/APKBUILD b/community/py3-pyclipper/APKBUILD index c51d5c925c..87cd1163ba 100644 --- a/community/py3-pyclipper/APKBUILD +++ b/community/py3-pyclipper/APKBUILD @@ -1,20 +1,34 @@ # Contributor: Leo # Maintainer: Rasmus Thomsen pkgname=py3-pyclipper +_pyname=pyclipper pkgver=1.1.0 -pkgrel=0 +_pkgpostver="$pkgver.post3" +pkgrel=1 pkgdesc="Cython wrapper for clipper" url="https://github.com/fonttools/pyclipper" arch="all" license="MIT" -depends="python3" -makedepends="py3-setuptools python3-dev cython" +depends="python3 clipper libgcc libstdc++" +makedepends="py3-setuptools python3-dev cython clipper-dev" checkdepends="py3-pytest" -source="$pkgname-$pkgver.tar.gz::https://github.com/fonttools/pyclipper/archive/$pkgver.post2.tar.gz" -builddir="$srcdir/pyclipper-$pkgver.post2" +_pypiprefix="${_pyname%${_pyname#?}}" +source="https://files.pythonhosted.org/packages/source/$_pypiprefix/$_pyname/$_pyname-$_pkgpostver.zip + 10-system-libs.patch +" +builddir="$srcdir/$_pyname-$_pkgpostver" + +# For system-wide consistency, and to save installation space, +# we do not use the copy of the Clipper library that comes bundled +# with the pyclipper sources. Instead, we use the system-wide shared +# library. + +prepare() { + default_prepare + rm pyclipper/clipper.cpp pyclipper/clipper.hpp +} build() { - git init python3 setup.py build } @@ -26,4 +40,5 @@ package() { python3 setup.py install --prefix=/usr --root="$pkgdir" } -sha512sums="2c5044ef3a516e909a1f2e87a4824660bf02721f830a0dfb6a853eae02875b6e45a0aaaf3c3591ad7a5b6679364a366c5977f7ba1f44899f98a7c2f95f2f5061 py3-pyclipper-1.1.0.tar.gz" +sha512sums="303be17e498f1d9fc5cdd0ce7c3e4c92c5d6dae7c7be7003402baa8403ec06951ec4805401748689e429118484cebaa6a762b8c2f4fc6ec801b4fd4a891131d9 pyclipper-1.1.0.post3.zip +f15b927ce6b40413fa3f44b8e3a4bebc8799a981babaa7e69b73b525c155dbe60c46a373509df886709daaa8c15169a9f38239f34da9d1f886f90ca61247a034 10-system-libs.patch" -- 2.25.1