diff options
author | Lev Velykoivanenko | 2019-12-05 10:52:35 +0100 |
---|---|---|
committer | Lev Velykoivanenko | 2019-12-05 10:52:35 +0100 |
commit | c441e84b3e782e5f7eb692f1ed9241d2d7ae1c70 (patch) | |
tree | c83b27bffe54a8418b852feb8886d1b0f818657e /PKGBUILD | |
parent | b519ae2ff6ec78256fd000478739cadb163f807c (diff) | |
download | aur-c441e84b3e782e5f7eb692f1ed9241d2d7ae1c70.tar.gz |
Updated package version to 19.18
Added check() function.
Added optional dependencies for check() function.
Diffstat (limited to 'PKGBUILD')
-rwxr-xr-x | PKGBUILD | 25 |
1 files changed, 20 insertions, 5 deletions
@@ -9,7 +9,7 @@ pkgname=('python-dlib-cuda' 'python2-dlib-cuda') _pkgname='dlib' -pkgver=19.17 +pkgver=19.18 pkgrel=1 pkgdesc="Dlib is a general purpose cross-platform C++ library designed using contract programming and modern C++ techniques." arch=('x86_64') @@ -24,9 +24,11 @@ optdepends=('cblas: for BLAS support' 'libpng: for PNG support' 'neon: for neon support' 'sqlite: for sqlite support' - 'ccache-ext: for ccache support during compiling') + 'ccache-ext: for ccache support during compiling' + 'python-numpy: for running numpy based tests' + 'python2-numpy: for running numpy based tests') source=("http://dlib.net/files/${_pkgname}-${pkgver}.tar.bz2") -sha256sums=('24772f9b2b99cf59a85fd1243ca1327cbf7340d83395b32a6c16a3a16136327b') +sha256sums=('521b9fbcb90c328063c439f6ccb3c95d9ababd25b208cbd1b915d9f5c4d2ab9b') build() { cd "${srcdir}/${_pkgname}-${pkgver}" @@ -34,7 +36,7 @@ build() { _compiler_opts=() # Detecting whether certain cpu optimisations can be made # Note: from dlib version 19.17 the default is to enable all options, so this - # is a check if they need to be turned off + # is a check if they need to be turned off if ! grep -q avx /proc/cpuinfo; then _compiler_opts+=( '--no' 'USE_AVX_INSTRUCTIONS' ) fi @@ -58,7 +60,7 @@ build() { _compiler_vars=() if [[ -f "/usr/lib/ccache/bin/nvcc-ccache" ]]; then _compiler_vars+=( '--set' 'CUDA_NVCC_EXECUTABLE=/usr/lib/ccache/bin/nvcc-ccache' ) - _compiler_vars+=( '--set' 'CUDA_HOST_COMPILER=/usr/lib/ccache/bin/gcc-7' ) + _compiler_vars+=( '--set' 'CUDA_HOST_COMPILER=/usr/lib/ccache/bin/gcc' ) else _compiler_vars+=( '--set' 'CUDA_HOST_COMPILER=/opt/cuda/bin/gcc' ) fi @@ -70,6 +72,19 @@ build() { python2 setup.py build "${_compiler_opts[@]}" "${_compiler_vars[@]}" } + +check() { + cd "${srcdir}/${_pkgname}-${pkgver}" + + # The PYTHONPATH is cleared to avoid custom user paths getting in the way + # of importing the right versions of packages + # Tests for Python 3 + PYTHONPATH="" python setup.py test + + # Tests for Python 2 + PYTHONPATH="" python2 setup.py test +} + package_python-dlib-cuda() { depends=('python' 'cuda' 'cudnn' 'libx11') provides=("python-dlib=$pkgver") |