summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorbartus2019-08-29 15:54:12 +0200
committerbartus2019-08-29 15:54:12 +0200
commitb282a458f8f5a2672aee5071ed15be01490e4a82 (patch)
tree49dd5103897b6939e9d2475b6ff7ea8988dbdd07 /PKGBUILD
parenta496cb310357f7a0d5dc093f411ca0eec398b25c (diff)
downloadaur-b282a458f8f5a2672aee5071ed15be01490e4a82.tar.gz
Split package into static/dynamic lib
popsift: headers and static library version popsift-libs: dynamic library
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD42
1 files changed, 27 insertions, 15 deletions
diff --git a/PKGBUILD b/PKGBUILD
index cdb02b69eca..dcda75b0724 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,7 +4,7 @@
DISABLE_CHECK=1
_name=popsift
-pkgname=${_name}
+pkgname=(${_name} ${_name}-libs)
pkgver=1.0.0
pkgrel=1
pkgdesc="Realtime GPU implementation of SIFT, 25 fps on HD images on recent graphic cards. (DOI: 10.1145/3204949.3208136)"
@@ -17,35 +17,47 @@ provides=()
makedepends=('boost' 'cmake' 'git')
makedepends+=('cuda>=7.0')
checkdepends=('wget')
-options=('staticlibs')
source=("${_name}::git+https://github.com/alicevision/popsift.git")
sha256sums=('SKIP')
-_CMAKE_FLAGS=(
- -DCMAKE_INSTALL_PREFIX=/usr
- -DCMAKE_BUILD_TYPE=Release
- )
-((BUILD_SHARED)) && _CMAKE_FLAGS+=( -DBUILD_SHARED_LIBS=ON ) || _CMAKE_FLAGS+=( -DBUILD_SHARED_LIBS=OFF -DCUDA_USE_STATIC_CUDA_RUNTIME=ON )
+_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}
- msg2 "Build PopSift library"
- mkdir -p build && cd build
- cmake ${_CMAKE_FLAGS[@]} ../${_name}
- make
+ 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
+
+ msg2 "Build static ${_name} library"
+ mkdir -p build_shared && pushd build_shared
+ cmake ${_CMAKE_FLAGS[*]} -DBUILD_SHARED_LIBS=ON ${srcdir}/${_name}
+ make
+ popd
}
-package() {
- cd ${srcdir}/build
- ((BUILD_SHARED)) && depends=('boost-libs>=1.55' 'libcudart.so')
+package_popsift() {
+ pkgdesc+=" [development headers and static libs]"
+ depends=('boost')
+ optdepend=('cuda: for static cudart library')
+ options=('staticlibs')
+ cd ${srcdir}/build_static
+ make 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}
}
check() {
- cd ${srcdir}/build
+ cd ${srcdir}/build_static
if ! ((DISABLE_CHECK)); then
make prepare-test
make run-test-boat