summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 550bf31ddde5c6ffceb83cd33a56dea641f6fb7d (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
pkgname=mingw-w64-libsndfile
pkgver=1.2.0
pkgrel=1
pkgdesc="A C library for reading and writing files containing sampled sound (mingw-w64)"
arch=(any)
url="https://libsndfile.github.io/libsndfile/"
license=(LGPL2.1)
makedepends=('mingw-w64-cmake' 'python')
depends=('mingw-w64-flac' 'mingw-w64-libvorbis' 'mingw-w64-lame' 'mingw-w64-opus')
options=('staticlibs' '!strip' '!buildflags')
source=(http://www.mega-nerd.com/libsndfile/files/libsndfile-${pkgver}.tar.gz)
source=(https://github.com/libsndfile/libsndfile/releases/download/$pkgver/libsndfile-$pkgver.tar.xz)
sha256sums=('0e30e7072f83dc84863e2e55f299175c7e04a5902ae79cfb99d4249ee8f6d60a')

_architectures="i686-w64-mingw32 x86_64-w64-mingw32"

build() {
  cd "${srcdir}/libsndfile-${pkgver}"
  for _arch in ${_architectures}; do
    mkdir -p build-${_arch} && pushd build-${_arch}
    ${_arch}-cmake -DENABLE_EXTERNAL_LIBS=ON -DENABLE_MPEG=ON -DINSTALL_MANPAGES=OFF \
      -DBUILD_PROGRAMS=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF ..
    make
    popd
  done
}

package() {
  for _arch in ${_architectures}; do
    cd ${srcdir}/libsndfile-${pkgver}/build-${_arch}
    make DESTDIR="${pkgdir}" install
    rm -r $pkgdir/usr/${_arch}/share/
    ${_arch}-strip --strip-unneeded "$pkgdir"/usr/${_arch}/bin/*.dll
    ${_arch}-strip -g "$pkgdir"/usr/${_arch}/lib/*.a
  done
}