summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b26636e356e8e5fafb81ad50020e46051b4b4438 (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
# $Id: PKGBUILD 278874 2016-10-17 09:20:23Z arojas $
# Maintainer: Eric BĂ©langer <eric@archlinux.org>

_pkgname=libsamplerate
pkgname=mingw-w64-libsamplerate
pkgver=0.2.2
pkgrel=2
pkgdesc="Secret Rabbit Code - aka Sample Rate Converter for audio (mingw-w64)"
arch=('any')
url="https://libsndfile.github.io/libsamplerate/index.html"
license=('BSD')
makedepends=('mingw-w64-cmake' 'mingw-w64-libsndfile' 'mingw-w64-opus')
depends=()
options=('!strip' '!buildflags' '!staticlibs')
source=("https://github.com/libsndfile/$_pkgname/releases/download/$pkgver/$_pkgname-$pkgver.tar.xz")
b2sums=('71b1e8a1644a94fff019abc6bf98c557df84994293f1e9bc651ad3ad3f0afeb24f54b8c75fc26e5202ae7c3a3e34e783fd1be7f7c6fdefe9eac9a5dfe7100b91')
validpgpkeys=('73571E85C19F4281D8C97AA86CA41A7743B8D6C8')

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

prepare() {
  cd ${_pkgname}-${pkgver}

  for patch in ../*.patch; do
    if [ ! -f "$patch" ]; then
      break;
    else
      patch -p1 -i "$patch"
    fi
  done
}

build() {
  cd ${_pkgname}-${pkgver}
  for _arch in ${_architectures}; do
    mkdir shared-${_arch} && pushd shared-${_arch}
      ${_arch}-cmake -DBUILD_SHARED_LIBS=ON ..
      make
    popd
    mkdir static-${_arch} && pushd static-${_arch}
      ${_arch}-cmake -DBUILD_SHARED_LIBS=OFF ..
      make
    popd
  done
}

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

  install -Dm644 COPYING "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}