summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorbartus2020-06-18 18:27:17 +0200
committerbartus2020-06-18 18:28:42 +0200
commitced14b5df521dd1dcc18239bd45070dffee8ea01 (patch)
treee2391ee5ac87857b5b01705f0cd8b352f83b69dd /PKGBUILD
parent86516e9b4b88d2b086c81d053aa2dad62401e186 (diff)
downloadaur-ced14b5df521dd1dcc18239bd45070dffee8ea01.tar.gz
Refactor
* add underscore to user defined variables * remove unsafe cd * move CMAKE_FLAGS inside build() function * drop mkdir
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD52
1 files changed, 27 insertions, 25 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 1f37d7df2cf..03db8ad600f 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,10 +4,10 @@
#Configuration variables
# CUDA_ARCH : sm_50, sm_50 ...
-DISABLE_CHECK=${DISABLE_CHECK:-1}
+_DISABLE_CHECK=${DISABLE_CHECK:-1}
_name=popsift
-pkgname=(${_name} ${_name}-libs)
+pkgname=( "${_name}" "${_name}-libs" )
pkgver=1.0.0
pkgrel=2
pkgdesc="Realtime GPU implementation of SIFT, 25 fps on HD images on recent graphic cards. (DOI: 10.1145/3204949.3208136)"
@@ -23,24 +23,28 @@ checkdepends=('wget')
source=("${_name}::git+https://github.com/alicevision/popsift.git")
sha256sums=('SKIP')
-_CMAKE_FLAGS=( -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release )
-((DISABLE_CHECK)) && _CMAKE_FLAGS+=( -DPopSift_BUILD_EXAMPLES=OFF ) || _CMAKE_FLAGS+=( -DPopSift_BUILD_EXAMPLES=ON -DPopSift_USE_TEST_CMD=ON )
-
build() {
- cd ${srcdir}
- [[ -v CUDA_ARCH ]] && _CMAKE_FLAGS+=( -DPopSift_CUDA_CC_LIST="$CUDA_ARCH" )
+ CMAKE_FLAGS=( -DCMAKE_INSTALL_PREFIX=/usr
+ -DCMAKE_BUILD_TYPE=Release )
+ ((_DISABLE_CHECK)) && CMAKE_FLAGS+=( -DPopSift_BUILD_EXAMPLES=OFF ) \
+ || CMAKE_FLAGS+=( -DPopSift_BUILD_EXAMPLES=ON
+ -DPopSift_USE_TEST_CMD=ON )
+ [[ -v CUDA_ARCH ]] && CMAKE_FLAGS+=( -DPopSift_CUDA_CC_LIST="$CUDA_ARCH" )
msg2 "Build static ${_name} library"
- mkdir -p build_static && pushd build_static
- cmake ${_CMAKE_FLAGS[*]} -DBUILD_SHARED_LIBS=OFF -DCUDA_USE_STATIC_CUDA_RUNTIME=ON ${srcdir}/${_name}
- make
- popd
+ cmake "${CMAKE_FLAGS[@]}" \
+ -DBUILD_SHARED_LIBS=OFF \
+ -DCUDA_USE_STATIC_CUDA_RUNTIME=ON \
+ -S "${srcdir}/${_name}" \
+ -B build_static
+ make -C build_static
msg2 "Build static ${_name} library"
- mkdir -p build_shared && pushd build_shared
- cmake ${_CMAKE_FLAGS[*]} -DBUILD_SHARED_LIBS=ON ${srcdir}/${_name}
- make
- popd
+ cmake "${CMAKE_FLAGS[@]}" \
+ -DBUILD_SHARED_LIBS=ON \
+ -S "${srcdir}/${_name}" \
+ -B build_shared
+ make -C build_shared
}
@@ -49,23 +53,21 @@ package_popsift() {
depends=('boost')
optdepend=('cuda: for static cudart library')
options=('staticlibs')
- cd ${srcdir}/build_static
- make DESTDIR=${pkgdir} install
+ make -C "$srcdir/build_static" DESTDIR="${pkgdir}" install
}
package_popsift-libs() {
depends=('boost-libs>=1.55' 'libcudart.so')
- cd ${srcdir}/build_shared
- make DESTDIR=${pkgdir} install
- rm -rf ${pkgdir}/usr/{include,shared}
+ cd
+ make -C "${srcdir}/build_shared" DESTDIR="${pkgdir}" install
+ rm -rf "${pkgdir}"/usr/{include,shared}
}
check() {
- cd ${srcdir}/build_static
- if ! ((DISABLE_CHECK)); then
- make prepare-test
- make run-test-boat
+ ((_DISABLE_CHECK)) || {
+ make -C "${srcdir}/build_static" prepare-test
+ make -C "${srcdir}/build_static" run-test-boat
# make run-test
- fi
+ }
}
# vim:set ts=2 sw=2 et: