PKGBUILDs/community/vigra/PKGBUILD

79 lines
2.6 KiB
Bash
Raw Normal View History

2018-01-06 21:05:54 +00:00
# Maintainer: Bruno Pagani <archange@archlinux.org>
# Contributor: AndyRTR <andyrtr@archlinux.org>
2016-07-07 01:31:22 +00:00
# Contributor: Lukas Jirkovsky <l.jirkovsky@gmail.com>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - build v5 with -DCMAKE_CXX_FLAGS=-std=c++11 -DWITH_BOOST_THREAD=1 to fix FTBFS
pkgbase=vigra
2020-04-26 16:42:10 +00:00
pkgname=(vigra vigra-doc)
2017-05-30 23:37:48 +00:00
pkgver=1.11.1
2020-12-13 18:56:00 +00:00
pkgrel=30
2018-01-06 21:05:54 +00:00
pkgdesc="Computer vision library"
2020-04-26 16:42:10 +00:00
arch=(x86_64)
2017-05-30 23:37:48 +00:00
url="https://ukoethe.github.io/vigra/"
2020-04-26 16:42:10 +00:00
license=(custom:MIT)
2016-07-07 01:31:22 +00:00
makedepends=(# runtime deps
2020-04-26 16:42:10 +00:00
libpng libtiff openexr gcc-libs sh hdf5 fftw
2018-06-08 05:07:09 +00:00
# additional makedeps
2020-04-26 16:42:10 +00:00
cmake boost python-numpy)
checkdepends=(python-nose)
2018-06-08 05:07:09 +00:00
source=("https://github.com/ukoethe/vigra/releases/download/Version-${pkgver//./-}/vigra-${pkgver}-src.tar.gz"
2020-04-26 16:42:10 +00:00
fix-incorrect-template-parameter-type.patch py3.7.diff)
2018-06-08 05:07:09 +00:00
sha256sums=('a5564e1083f6af6a885431c1ee718bad77d11f117198b277557f8558fa461aaf'
2018-08-06 13:17:05 +00:00
'f151f902483dfa2b1f3d431f54bb161300cf184158c9f416fa653d19ab363cc4'
'8fcdcce50c377be44387cbd4a001dadf5e03b32483de55c05a359c887e95a05b')
2016-07-07 01:31:22 +00:00
2018-01-06 21:05:54 +00:00
prepare() {
2018-06-08 05:07:09 +00:00
cd ${pkgbase}-${pkgver}
# https://github.com/ukoethe/vigra/issues/414
patch -Np1 -i ../fix-incorrect-template-parameter-type.patch
2018-08-06 13:17:05 +00:00
# python 3.7 compat
patch -Np1 -i ../py3.7.diff
2018-01-06 21:05:54 +00:00
}
2016-07-07 01:31:22 +00:00
build() {
2020-04-26 16:42:10 +00:00
cmake -B build -S ${pkgbase}-${pkgver} \
2018-01-06 21:05:54 +00:00
-DCMAKE_INSTALL_PREFIX=/usr \
2016-07-07 01:31:22 +00:00
-DPYTHON_EXECUTABLE=/usr/bin/python \
-DWITH_OPENEXR=true \
-DWITH_VIGRANUMPY=1 \
-DDOCINSTALL=share/doc \
2020-04-26 16:42:10 +00:00
-DCMAKE_C_FLAGS="-DH5_USE_110_API" \
-DCMAKE_CXX_FLAGS="-DH5_USE_110_API" \
2016-07-07 01:31:22 +00:00
$([ $CARCH == arm ] && echo "-DCMAKE_CXX_FLAGS=-std=c++11 -DWITH_BOOST_THREAD=1")
2020-04-26 16:42:10 +00:00
make -C build
2016-07-07 01:31:22 +00:00
}
2018-01-06 21:05:54 +00:00
check() {
2020-12-02 19:37:02 +00:00
make -C build -j1 -k check || echo "Tests failed" # https://github.com/ukoethe/vigra/issues/409
2018-01-06 21:05:54 +00:00
}
2016-07-07 01:31:22 +00:00
package_vigra() {
pkgdesc="Computer vision library"
2020-07-12 18:49:25 +00:00
depends=(libpng libtiff openexr gcc-libs sh hdf5 fftw)
2016-07-07 01:31:22 +00:00
optdepends=('python: for python bindings'
'boost-libs: for python bindings')
2020-04-26 16:42:10 +00:00
make -C build DESTDIR="${pkgdir}" install
2018-01-06 21:05:54 +00:00
2020-07-12 18:49:25 +00:00
install -Dm644 ${pkgbase}-${pkgver}/LICENSE.txt -t "${pkgdir}"/usr/share/licenses/${pkgname}/
2016-07-07 01:31:22 +00:00
2018-01-06 21:05:54 +00:00
# Remove doc
2020-07-12 18:49:25 +00:00
rm -r "${pkgdir}"/usr/share/doc
2016-07-07 01:31:22 +00:00
}
package_vigra-doc() {
pkgdesc="Computer vision library - documentation and examples"
2018-01-06 21:05:54 +00:00
#arch=('any') # Not supported for now, maybe later
2016-07-07 01:31:22 +00:00
2020-04-26 16:42:10 +00:00
make -C build DESTDIR="${pkgdir}" install
2018-01-06 21:05:54 +00:00
# Remove vigra package content
2020-07-12 18:49:25 +00:00
rm -r "${pkgdir}"/usr/{bin,include,lib}
# Remove doctrees https://github.com/ukoethe/vigra/pull/477
rm -r "${pkgdir}"/usr/share/doc/vigranumpy/doctrees/
2016-07-07 01:31:22 +00:00
2020-07-12 18:49:25 +00:00
install -Dm644 ${pkgbase}-${pkgver}/LICENSE.txt -t "${pkgdir}"/usr/share/licenses/${pkgname}/
2016-07-07 01:31:22 +00:00
}