aboutsummaryrefslogtreecommitdiffstats
path: root/community/pdal/APKBUILD
blob: 95d61971e8df1156b8881efad6dd7b3560592373 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# Contributor: Bradley J Chambers <brad.chambers@gmail.com>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=pdal
pkgver=2.6.3
pkgrel=0
pkgdesc="PDAL is a C++ BSD library for translating and manipulating point cloud data."
url="https://pdal.io/"
arch="all"
license="BSD-2-Clause"
depends_dev="$pkgname=$pkgver-r$pkgrel"
makedepends="
	cmake
	cpd-dev
	curl-dev
	eigen-dev
	fgt-dev
	gdal-dev
	hdf5-dev
	libgeotiff-dev
	libpq-dev
	libxml2-dev
	linux-headers
	openscenegraph-dev
	openssl-dev>3
	proj-dev
	py3-numpy-dev
	python3-dev
	samurai
	sqlite-dev
	zstd-dev
	xerces-c-dev
	"
checkdepends="gdal-tools gdal-driver-PNG"
subpackages="
	$pkgname-dev
	libpdal-plugins
	"
source="https://github.com/PDAL/PDAL/releases/download/$pkgver/PDAL-$pkgver-src.tar.bz2"
builddir="$srcdir/PDAL-$pkgver-src"

case "$CARCH" in
	s390x)
		# 95% tests passed, 6 tests failed out of 110
		options="!check"
		;;
esac

# Optional dependency tiledb-dev is not available on s390x and 32-bit platforms
_with_tiledb="OFF"
case "$CARCH" in
armhf|armv7|x86|s390x) ;;
*)
	makedepends="$makedepends tiledb-dev"
	_with_tiledb="ON"
	;;
esac

build() {
	CFLAGS="$CFLAGS -O2" \
	CXXFLAGS="$CXXFLAGS -O2" \
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_BUILD_TYPE=None \
		-DBUILD_PLUGIN_CPD=ON \
		-DBUILD_PLUGIN_NITF=OFF \
		-DBUILD_PLUGIN_ICEBRIDGE=ON \
		-DBUILD_PLUGIN_HDF=ON \
		-DBUILD_PLUGIN_OPENSCENEGRAPH=ON \
		-DBUILD_PLUGIN_TILEDB=$_with_tiledb \
		-DBUILD_PLUGIN_E57=ON \
		-DBUILD_PLUGIN_PGPOINTCLOUD=ON \
		-DBUILD_PLUGIN_RIVLIB=OFF \
		-DBUILD_PLUGIN_RDBLIB=OFF \
		-DBUILD_PLUGIN_MBIO=ON \
		-DBUILD_PLUGIN_FBX=ON \
		-DBUILD_PLUGIN_TEASER=OFF \
		-DBUILD_PLUGIN_TRAJECTORY=OFF \
		-DBUILD_PGPOINTCLOUD_TESTS=OFF \
		-DWITH_ZSTD=ON \
		-DWITH_TESTS="$(want_check && echo ON || echo OFF)"
	cmake --build build
}

check() {
	# skipped tests are broken
	local skipped_tests="pdal_("
	local tests="
		filters_colorinterp
		filters_cpd
		filters_crop
		filters_overlay
		filters_stats
		io_bpf_base
		io_bpf_zlib
		io_ept_reader
		io_las_reader
		io_las_writer
		io_optech
		io_stac_reader
		io_tiledb_bit_fields
		io_tiledb_time_reader
		io_tiledb_time_writer
		io_tiledb_utils
		merge
		"
	case "$CARCH" in
		arm*|s390x|x86) tests="$tests
			utils
			filters_icp
			file_utils
			" ;;
	esac
	for test in $tests; do
		skipped_tests="$skipped_tests|$test"
	done
	skipped_tests="$skipped_tests)_test|icetest|random_test"
	msg "$skipped_tests"
	ctest --test-dir build --output-on-failure -j${JOBS:-1} -E "$skipped_tests"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
	cd $pkgdir/usr/lib
	rm libpdalcpp.so
	ln -s libpdalcpp.so.?? libpdalcpp.so
}

plugins() {
	amove usr/lib/libpdal_plugin_*.so.*
}

sha512sums="
8bf197d91d9cd986abbe6a5bf4ec054e1648beac2715de499f40db0f9735e5dbb686a63f55b03daeffed3e7ec3d5ee83adbb8572a7dc82d749c67c6c233acab5  PDAL-2.6.3-src.tar.bz2
"