summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: dd02a6a87784d087d75ad97e952873515df63323 (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
# Maintainer: shtrophic <aur at shtrophic dot net>

_pkgname=3dtk
pkgname="$_pkgname-svn"
pkgver=r2403
pkgrel=3
pkgdesc='3D Toolkit with algorithms and methods to process 3D point clouds'
url='https://slam6d.sourceforge.io'
license=(GPL-3.0-only)
arch=(x86_64)
provides=("$_pkgname")
makedepends=(subversion 
	     cmake)
depends=(findutils
	 boost 
	 opencv 
	 cgal 
	 eigen 
	 gmp 
	 mpfr 
	 onetbb
	 suitesparse
	 glu
	 glut
	 libzip
	 python
	 qt5-base
	 qt6-base
	 apriltag)
optdepends=(ann  
	    newmat 
	    cuda 
	    python)
source=("$pkgname::svn+https://svn.code.sf.net/p/slam6d/code/trunk"
	update.patch
	apriltag.patch
	3dtk.sh)
sha512sums=('SKIP'
            '8d25cc2c0e75b78ac42dfb2b7a7ef70840d2fbd335fb87e481edf38f739281857a28180566ba916f0830f82f399cdf7fd6fcb74d27821eff54b833802d0c43da'
            'e664ac962c1be443d64e6c385eee0c47429439a091407357e169fbfd4c7ca10a63e04f88f760c9f48450b83400f75d0fdd9a3da4e5c3d9d0b58c3b38d783efc9'
            'e352631c55938430af765948ef73a16c855f2147b5cab9ec33cbdc438ee0f28bb32cd96f4f2ff96f773de153de72d3b8ff0f51f5076227e181db9eac653b9e36')

pkgver() {
	cd "$pkgname"
	local ver="$(svnversion)"
  	printf "r%s" "${ver//[[:alpha:]]}"
}

prepare() {
	cd "$pkgname"
	
	svn patch "$srcdir/update.patch"
	svn patch "$srcdir/apriltag.patch"

	# set package binary paths to /opt/3dtk in every included script
	sed -i 's,\([^/]\)bin/,\1/opt/3dtk/,g' bin/*.sh
}

build() {
	cd "$pkgname"

	mkdir -p build
	cd build

	cmake \
		-DWITH_WXWIDGETS=OFF \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
		-Wno-dev \
		..

	make
}

package() {
	cd "$pkgname"
	
	# toolkit ships many binaries with generic names. 
	# thus putting them into /opt
	rm bin/test_*
	install -Dm 755 bin/* -t "$pkgdir/opt/$_pkgname"

	install -Dm 644 README.* -t "$pkgdir/usr/share/doc/$_pkgname"
	cp -r doc/* "$pkgdir/usr/share/doc/$_pkgname"

	install -Dm 644 LICENSING -t "$pkgdir/usr/share/licenses/$_pkgname"
	install -dm 755 "$pkgdir/usr/include/$_pkgname"
	cp -r include/* "$pkgdir/usr/include/$_pkgname"

	install -Dm 644 lib/* -t "$pkgdir/usr/lib"

	install -dm 755 "$pkgdir/usr/share/$_pkgname"
	cp -r dat "$pkgdir/usr/share/$_pkgname"

	install -Dm 755 "$srcdir/3dtk.sh" "$pkgdir/usr/bin/$_pkgname"
}