summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a0be1f2082de7a9012a7b9863f170f4e34e97431 (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
# Maintainer: Chocobo1 <chocobo1 AT archlinux DOT net>

pkgname=libsndfile-git
pkgver=1.2.0.r19.gd97f4666
pkgrel=2
pkgdesc="A C library for reading and writing files containing sampled sound"
arch=('i686' 'x86_64')
url="https://libsndfile.github.io/libsndfile/"
license=('LGPL')
depends=('glibc' 'libFLAC.so' 'libmp3lame.so' 'libmpg123.so' 'libogg.so' 'libvorbis.so' 'libvorbisenc.so' 'opus')
makedepends=('git' 'alsa-lib' 'cmake' 'flac' 'sqlite' 'lame' 'libogg' 'libvorbis' 'mpg123' 'python' 'sqlite')
optdepends=('alsa-lib: for sndfile-play')
provides=("libsndfile=$pkgver" 'libsndfile.so')
conflicts=('libsndfile')
source=("git+https://github.com/libsndfile/libsndfile.git")
sha256sums=('SKIP')


pkgver() {
  cd "libsndfile"

  git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cd "libsndfile"

  cmake \
    -B "_build" \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX="/usr" \
    -DCMAKE_INSTALL_LIBDIR="lib" \
    -DBUILD_SHARED_LIBS=ON \
    ./
  make -C "_build"
}

check() {
  cd "libsndfile"

  cmake \
    -B "_build_test" \
    -DCMAKE_INSTALL_PREFIX="/usr" \
    -DCMAKE_INSTALL_LIBDIR="lib" \
    ./
  make -C "_build_test"
  make -C "_build_test" test
}

package() {
  cd "libsndfile"

  make -C "_build" DESTDIR="$pkgdir" install
  install -Dm644 {AUTHORS,ChangeLog,README} -t "$pkgdir/usr/share/doc/libsndfile"
}