summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d6600fce75a744f9bc70712d23eabd35935be3fc (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
#!/hint/bash
# Maintainer : bartus <arch-user-repoᘓbartus.33mail.com>

#Configuration:
#Use: makepkg VAR1=0 VAR2=1 to enable(1) disable(0) a feature
#Use: {yay,paru} --mflags=VAR1=0,VAR2=1
#Use: aurutils --margs=VAR1=0,VAR2=1
#Use: VAR1=0 VAR2=1 pamac

# Use FRAGMENT=#{commit,tag,brach}=xxx for bisect build
_fragment="${FRAGMENT:-#branch=master}"

# Use CUDA_ARCH to build for specific GPU architecture
# Supports: single arch (5.2) and list of archs (5.2;6.0), arch name (Maxwell) or auto (Auto)
[[ -v CUDA_ARCH ]]	&& _cuda_arch="-DCCTAG_CUDA_CC_LIST_INIT=${CUDA_ARCH}"

((DISABLE_CUDA))	&& _with_cuda=OFF	|| _with_cuda=ON	# Build without cuda support
((ENABLE_APPS))		&& _build_apps=ON	|| _build_apps=OFF	# Build the sample applications
((ENABLE_AVX2))		&& _enable_avx=ON	|| _enable_avx=OFF	# Enable AVX2 optimizations
((ENABLE_SERIALIZE))	&& _serialize=ON	|| _serialize=OFF	# Store all the output
((ENABLE_VISUAL_DEBUG))	&& _visual_debug=ON	|| _visual_debug=OFF	# Enable visual debug
((GPU_DETECT))		&& _cc_current=ON	|| _cc_current=OFF	# Detect local GPU arch
((THRUST_COPY_IF))	&& _no_thrust=ON	|| _no_thrust=OFF	# Don't use thrust::copy_if() (bug on cuda:7 with GTX 980/1080)
((ENABLE_DOC))		&& _build_doc=ON	|| _build_doc=OFF	# Build doc

# Unused cmake flags.
#option(CCTAG_NO_COUT "Disable output stream" ON)
#option(CCTAG_EIGEN_NO_ALIGN "Disable Eigen alignment" ON)
#option(CCTAG_USE_POSITION_INDEPENDENT_CODE "Generate position independent code." ON)

pkgname=cctag
pkgver=1.0.3
_src_dir="CCTag-${pkgver}"
pkgrel=2
pkgdesc="Detection of CCTag markers made up of concentric circles."
arch=('i686' 'x86_64')
url="https://github.com/alicevision/CCTag"
license=('MPL2')
depends=(boost-libs tbb)
makedepends=(boost cmake eigen ninja opencv)
# Configuration specific dependencis:
((DISABLE_CUDA)) || { makedepends+=(cuda); optdepends+=('cuda: for cuda detector'); }
((ENABLE_APPS)) && depends+=(devil2 qt5-base)
((ENABLE_DOC)) && makedepends+=(python-sphinx doxygen)
source=("$pkgname-$pkgver.tar.gz::${url}/archive/refs/tags/v${pkgver}.tar.gz")
sha256sums=('25396b03c4aa3c1be241a2a8518a29511cb4fff695caa5126203fbba8e8e444d')


build() {
	cmake -S "${srcdir}/${_src_dir}" -B build -G Ninja \
		-DCUDA_HOST_COMPILER=/opt/cuda/bin/gcc \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_BUILD_TYPE=Release \
		-DBUILD_SHARED_LIBS=ON \
		-DCCTAG_WITH_CUDA="$_with_cuda" \
		-DCCTAG_BUILD_APPS="$_build_apps" \
		-DCCTAG_BUILD_DOC="$_build_doc" \
		-DCCTAG_ENABLE_SIMD_AVX2="$_enable_avx" \
		-DCCTAG_SERIALIZE="$_serialize" \
		-DCCTAG_VISUAL_DEBUG="$_visual_debug" \
		-DCCTAG_CUDA_CC_CURRENT_ONLY="$_cc_current" \
		-DCCTAG_NO_THRUST_COPY_IF="$_no_thrust" \
		$_cuda_arch
	ninja -C build
}

package() {
	DESTDIR="${pkgdir}" ninja -C build install
}
# vim:set ts=8: