git » musepack.git » main » tree

[main] / PKGBUILD

# Maintainer: Balló György <ballogyor+arch at gmail dot com>
# Contributor: Jan de Groot <jgc@archlinux.org>

pkgbase=musepack
pkgname=('musepack-tools' 'libmpcdec')
_revision=475
pkgver=0.1+r$_revision
pkgrel=5
epoch=1
pkgdesc='MusePack commandline utilities and decoder library'
arch=('x86_64' 'armv7h')
url='https://musepack.net/'
license=('BSD-3-Clause AND LGPL-2.1-or-later AND GPL-2.0-or-later')
depends=('glibc' 'libcue' 'libreplaygain')
source=("https://files.musepack.net/source/musepack_src_r$_revision.tar.gz"
	'01_am-maintainer-mode.patch'
	'02_link-libm.patch'
	'03_mpcchap.patch'
	'04_link-order.patch'
	'05_visibility.patch'
	'1001_missing_extern_kw.patch'
	'add_subdir-objects.patch')
b2sums=('601762738199bd67278d934d927c35d6ba1d286be9fd57ebf2e89dca271f563e85cf023f8860bfd30b501039bba5fd68eaf2d65dce65d0dcf5ce6d75a6e692aa'
        '940b71df9e4d582a0da733174048168aacd1f80c69d9cf2f163545cf1cdd83165eca5c18597c4f271c52f55b8085f69079a9df4e3fee3875d2853062afbbb1cd'
        '65a3b3c2fd6e265d88075834f8d479fc40c0bf11d674c4d2ffce12b595460327bcf33931ae7c16a5b78273de10e962144764e950f2cb0ae74ece01b892526456'
        '9c10c33bcf991facf959d41a4f24a32162631db26d2aa33e969e7d1884094cef39103bcd9d0422af2d29ca1f5963cd8d91137ffcdbb31f36c221a2c4d74715ef'
        'a5c96c5a80d76cbbb25a5647c6d754d82203936949f2720772776267f6752811f2c511e8df59a58570bba9ffe3b9482b0294eeed4364e2a4602a15d142759add'
        'e96e7928ad05bc0713ede3fbc8b5053cf1a456067faa481fa17f5156d61f6c1052b47ff27fe0e7e70d4e40fd62fae9cd0c57c5e28b149501a37dc323031a8bb5'
        '5204b8b9596ef5663f7678cdd533a227df9722f3d66f66ea9fe151a76de6070e3801f51be657588cb14839239d6d2ed8c5a5f7e80a61f79a1eda22b72026658a'
        '366e7a668d9c47be947b3ae785db7e0804d3d3537aa5df4c833386e8b04fc98f3c4dc1f32a0beaabf7721deae853ad6bce9acd7bae1ad1621dae1bb908a200c2')

prepare() {
  cd musepack_src_r$_revision
  patch -Np1 -i ../01_am-maintainer-mode.patch
  patch -Np1 -i ../02_link-libm.patch
  patch -Np1 -i ../03_mpcchap.patch
  patch -Np1 -i ../04_link-order.patch
  patch -Np1 -i ../05_visibility.patch
  patch -Np1 -i ../1001_missing_extern_kw.patch
  patch -Np1 -i ../add_subdir-objects.patch

  autoreconf -fi
}

build() {
  cd musepack_src_r$_revision
  ./configure --prefix=/usr --enable-mpcchap
  make CFLAGS="$CFLAGS -Wno-error=incompatible-pointer-types"
}

package_libmpcdec() {
  pkgdesc='MusePack decoding library'
  license=('BSD-3-Clause')
  depends=('glibc')

  cd musepack_src_r$_revision
  make -C include DESTDIR="$pkgdir" install
  make -C libmpcdec DESTDIR="$pkgdir" install
  install -Dm644 libmpcdec/COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
}

package_musepack-tools() {
  pkgdesc='MusePack commandline tools'
  depends+=("libmpcdec>=1:0.1+r$_revision")
  options=('!emptydirs')

  cd musepack_src_r$_revision
  make DESTDIR="$pkgdir" install
  make -C libmpcdec DESTDIR="$pkgdir" uninstall
  make -C include DESTDIR="$pkgdir" uninstall
  install -Dm644 libmpcdec/COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
}