Package Details: polyclipping 6.4.2-4

Git Clone URL: https://aur.archlinux.org/polyclipping.git (read-only, click to copy)
Package Base: polyclipping
Description: Polygon clipping library
Upstream URL: https://sourceforge.net/projects/polyclipping/
Licenses: boost
Submitter: gromit
Maintainer: Bevan
Last Packager: gromit
Votes: 3
Popularity: 0.48
First Submitted: 2024-03-20 14:56 (UTC)
Last Updated: 2024-03-20 14:56 (UTC)

Latest Comments

Bevan commented on 2024-05-27 18:04 (UTC)

@flaviut: Thanks for those improvements! Would it be fine with you if I commit them under your name and mail address? Also, co-maintainers are always welcome :)

flaviut commented on 2024-05-26 18:44 (UTC)

Needed to make a few tweaks

  1. get it to build on modern versions of cmake ("Compatibility with CMake < 3.5 will be removed from a future version of CMake." error)
  2. get it to build when cmake uses ninja by default instead of make (see https://wiki.archlinux.org/title/CMake_package_guidelines#Template)
  3. fix the incorrect SPDX license ID & other namcap warnings
diff --git a/PKGBUILD b/PKGBUILD
index 4621dfe..0eab374 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,25 +2,30 @@

 pkgname=polyclipping
 pkgver=6.4.2
-pkgrel=4
+pkgrel=5
 pkgdesc="Polygon clipping library"
 arch=('x86_64')
 url="https://sourceforge.net/projects/polyclipping/"
-license=('Boost')
-depends=('gcc-libs')
-makedepends=('cmake')
-source=("https://downloads.sourceforge.net/polyclipping/clipper_ver${pkgver}.zip")
-sha256sums=('a14320d82194807c4480ce59c98aa71cd4175a5156645c4e2b3edd330b930627')
+license=('BSL-1.0')
+depends=('gcc-libs' 'glibc')
+makedepends=('cmake' 'dos2unix')
+source=("https://downloads.sourceforge.net/polyclipping/clipper_ver${pkgver}.zip"
+        "cmake_min_version.patch")
+sha256sums=('a14320d82194807c4480ce59c98aa71cd4175a5156645c4e2b3edd330b930627'
+            'SKIP')

-build() {
+prepare() {
   cd "${srcdir}"
-  mkdir -p build && cd build
-  cmake -DCMAKE_INSTALL_PREFIX=/usr -DVERSION=$pkgver ../cpp
-  make
+  dos2unix cpp/CMakeLists.txt
+  patch -p1 < "${srcdir}/cmake_min_version.patch"
+}
+
+build() {
+  cmake -B build -S cpp \
+     -DCMAKE_INSTALL_PREFIX=/usr -DVERSION=$pkgver
+  cmake --build build
 }

 package() {
-  cd "${srcdir}/build"
-  make install DESTDIR="$pkgdir"
-  install -d "$pkgdir/usr/share/licenses/$pkgname"
+  DESTDIR="$pkgdir" cmake --install build
 }
diff --git a/cmake_min_version.patch b/cmake_min_version.patch
new file mode 100644
index 0000000..1ca2884
--- /dev/null
+++ b/cmake_min_version.patch
@@ -0,0 +1,8 @@
+--- a/cpp/CMakeLists.txt
++++ b/cpp/CMakeLists.txt
+@@ -1,4 +1,4 @@
+-CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0)
++CMAKE_MINIMUM_REQUIRED(VERSION 3.5.0)
+ PROJECT(polyclipping)
+ 
+ SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "Release type")