summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 34df8071d12e066f321608b401129d438f18d201 (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=libatrac9-git
pkgver=r18.0fb7069
pkgrel=1
pkgdesc="A library for decoding audio in Sony's ATRAC9 format"
arch=(x86_64)
url='https://github.com/Thealexbarney/LibAtrac9'
license=(MIT)
depends=()
makedepends=(git)
source=(${pkgname}::git+https://github.com/Thealexbarney/LibAtrac9.git)
sha256sums=('SKIP')

pkgver() {
  cd "$srcdir/$pkgname"
  ( set -o pipefail
    git describe --long 2>/dev/null | sed -r 's/([^-]*-g)/r\1/;y/-/./' ||
      printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
  )
}

prepare() {
  cd "$srcdir/$pkgname"/C
  sed -i 's/^\(LFLAGS =.*\)/\1 -lm '"$LDFLAGS"/ Makefile
}

build() {
  cd "$srcdir/$pkgname"/C
  make shared CC="gcc $CFLAGS $CPPFLAGS"
}

package() {
  cd "$srcdir/$pkgname"
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  cd C
  install -Dm644 src/libatrac9.h "$pkgdir/usr/include/libatrac9.h"
  install -Dm755 bin/libatrac9.so "$pkgdir/usr/lib/libatrac9.so"
}