summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 79ef12c803d30a041c107032d1c67427704627cf (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
# Maintainer: Christopher Arndt <aur -at- chrisarndt -dot- de>

_pkgname=audiotk
pkgname="${_pkgname}-git"
pkgver=1.2.0.r808.0af35fc
pkgrel=1
pkgdesc="A C++ library plus Python 3 bindings with a set of audio filters (git version)"
arch=('i686' 'x86_64')
license=('BSD')
url='https://github.com/mbrucher/AudioTK'
depends=('fftw' 'libsndfile' 'python')
makedepends=('git' 'cmake')
source=("${_pkgname}::git+https://github.com/mbrucher/AudioTK.git")
provides=("${_pkgname}")
conflicts=("${_pkgname}")
md5sums=('SKIP')


pkgver() {
  cd "${srcdir}/${_pkgname}"
  version="$(git describe --tags | sed -e 's/^[^-]*-//;s/-.*//')"
  revision=$(git rev-list --count HEAD)
  hash=$(git rev-parse --short HEAD)
  echo $version.r$revision.$hash
}

prepare() {
  cd "${srcdir}/${_pkgname}"

  if [[ -d build ]]; then
    rm -rf build
  fi

  mkdir build
  git checkout develop
}

build() {
  cd "${srcdir}/${_pkgname}/build"

  local py_ver=$(python -c 'import sys; print("%s.%s" % sys.version_info[:2])')
  cmake .. \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_CXX_FLAGS="-std=c++11" \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DENABLE_PYTHON=1 \
    -DPYTHON_INSTALL_FOLDER=/usr/lib/python${py_ver} \
    -DENABLE_TESTS=1
  make DESTDIR="${pkgdir}"
}

package() {
  cd "${srcdir}/${_pkgname}/build"

  make DESTDIR="${pkgdir}" install

  cd ..
  install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
  install -dm755 "${pkgdir}/usr/share/doc/${pkgname}"
  cp -r Examples "${pkgdir}/usr/share/doc/${pkgname}"
  cp -r Doxygen/html "${pkgdir}/usr/share/doc/${pkgname}/API"
}

# vim:set ts=2 sw=2 et: