summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorBlair Bonnett2023-06-10 15:08:49 +0200
committerBlair Bonnett2023-06-10 15:08:49 +0200
commit9ac0ac398f7f20e3fe4f3a23b6fb74c1f1b7ce01 (patch)
treed327ac29e05b5838c294a97c974477869e9625b6
downloadaur-9ac0ac398f7f20e3fe4f3a23b6fb74c1f1b7ce01.tar.gz
Initial package: 0.2.3
-rw-r--r--.SRCINFO23
-rw-r--r--.gitignore5
-rw-r--r--PKGBUILD48
-rw-r--r--add_headers.patch24
-rw-r--r--pyproject_toml_deps.patch11
5 files changed, 111 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..652235e167d6
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,23 @@
+pkgbase = python-laszip
+ pkgdesc = Python bindings for the LASzip compression library
+ pkgver = 0.2.3
+ pkgrel = 1
+ url = https://github.com/tmontaigu/laszip-python
+ arch = x86_64
+ license = MIT
+ makedepends = pybind11
+ makedepends = python-build
+ makedepends = python-installer
+ makedepends = python-scikit-build-core
+ makedepends = python-wheel
+ depends = gcc-libs
+ depends = glibc
+ depends = laszip
+ source = laszip-python-0.2.3.tar.gz::https://github.com/tmontaigu/laszip-python/archive/refs/tags/0.2.3.tar.gz
+ source = pyproject_toml_deps.patch
+ source = add_headers.patch
+ sha256sums = 6c74ef5597b7c441d398cee73e0b6fc249eac51d1253afefa05089fe596cb375
+ sha256sums = 96b2417c81b1a2ba28804568c607bb947576327c1721189fc06b7d5492488dad
+ sha256sums = 3400d5091b0d78e838b95d2103d50cc4a21e7d3278a55044ec01b15985d7c2fd
+
+pkgname = python-laszip
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..08d150390653
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+laszip-python-*.tar.gz
+src/
+pkg/
+python-laszip-*.pkg.tar*
+*.log
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..3f11145cc463
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,48 @@
+# Maintainer: Blair Bonnett <blair.bonnett@gmail.com>
+
+pkgname=python-laszip
+pkgdesc='Python bindings for the LASzip compression library'
+pkgver=0.2.3
+pkgrel=1
+url='https://github.com/tmontaigu/laszip-python'
+license=('MIT')
+arch=('x86_64')
+
+depends=('gcc-libs' 'glibc' 'laszip')
+makedepends=('pybind11' 'python-build' 'python-installer' 'python-scikit-build-core' 'python-wheel')
+
+_pyname=laszip-python
+source=(
+ "$_pyname-$pkgver.tar.gz::https://github.com/tmontaigu/laszip-python/archive/refs/tags/$pkgver.tar.gz"
+ 'pyproject_toml_deps.patch'
+ 'add_headers.patch'
+)
+sha256sums=(
+ '6c74ef5597b7c441d398cee73e0b6fc249eac51d1253afefa05089fe596cb375'
+ '96b2417c81b1a2ba28804568c607bb947576327c1721189fc06b7d5492488dad'
+ '3400d5091b0d78e838b95d2103d50cc4a21e7d3278a55044ec01b15985d7c2fd'
+)
+
+prepare() {
+ cd "$_pyname-$pkgver"
+ patch -p0 -i "$srcdir/pyproject_toml_deps.patch"
+ patch -p0 -i "$srcdir/add_headers.patch"
+}
+
+build() {
+ cd "$_pyname-$pkgver"
+ python -m build --wheel --no-isolation
+}
+
+check() {
+ cd "$_pyname-$pkgver"
+ python -m venv --system-site-packages test-env
+ test-env/bin/python -m installer "dist/laszip-$pkgver-"*.whl
+ test-env/bin/python -c 'import laszip'
+}
+
+package() {
+ cd "$_pyname-$pkgver"
+ python -m installer --destdir="$pkgdir" "dist/laszip-$pkgver-"*.whl
+ install -Dm644 -t "$pkgdir/usr/share/licenses/$pkgname" License.txt
+}
diff --git a/add_headers.patch b/add_headers.patch
new file mode 100644
index 000000000000..87a194ac7d06
--- /dev/null
+++ b/add_headers.patch
@@ -0,0 +1,24 @@
+--- src/laszipper.cpp
++++ src/laszipper.cpp
+
+@@ -1,7 +1,8 @@ Fix 'numeric_limits' is not a member of 'std'
+ #include "laszipper.h"
++#include <limits>
+
+ #include "laszip_error.h"
+
+ LasZipper::LasZipper(py::object &file_obj, py::bytes &header_bytes)
+ : m_is(), m_b(file_obj), m_output_stream(&m_b)
+ {
+
+--- src/lasunzipper.cpp
++++ src/lasunzipper.cpp
+
+@@ -2,6 +2,7 @@ Fix 'numeric_limits' is not a member of 'std'
+ #include "laszip_error.h"
+ #include <laszip/laszip_api.h>
+
+ #include <algorithm>
++#include <limits>
+
+ LasUnZipper::LasUnZipper(py::object &file_obj) : LasUnZipper(file_obj, laszip_DECOMPRESS_SELECTIVE_ALL) {}
diff --git a/pyproject_toml_deps.patch b/pyproject_toml_deps.patch
new file mode 100644
index 000000000000..739361f50e19
--- /dev/null
+++ b/pyproject_toml_deps.patch
@@ -0,0 +1,11 @@
+--- pyproject.toml
++++ pyproject.toml
+
+@@ -2,7 +2,5 @@ Installed through PKGBUILD but cause an error here.
+ requires = [
+ "scikit-build-core>=0.1.5",
+- "cmake>=3.20",
+- "ninja",
+ "pybind11>=2.10",
+ ]
+ build-backend = "scikit_build_core.build"