summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d774c2175d66b39ab7c5a3420b88e4321f2af500 (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
# Maintainer: Damian Höster <damian dot hoester at posteo dot de>

_pkgname=zimtohrli
pkgname=${_pkgname}-git
pkgver=0.1.10.r65.8b64aaf
pkgrel=1
pkgdesc='A psychoacoustic perceptual metric for audio compression'
arch=(x86_64)
url=https://github.com/google/zimtohrli
license=(Apache-2.0)
depends=(
  glfw
  alsa-lib
  flac
  libvorbis
  opus
  mpg123
)
makedepends=(
  cmake
  pkgconf
  python
  ninja
)
provides=($_pkgname)
conflicts=($_pkgname)
source=($_pkgname::git+$url.git)
sha256sums=(SKIP)

pkgver() {
  git -C $_pkgname describe --long --tags | \
    sed -E 's/^v//; s/-([^-]*)-g([^-]*)$/-r\1.\2/; s/-/./g'
}

build() {
  export CFLAGS+=" -fPIC" CXXFLAGS+=" -fPIC"
  cmake -S $_pkgname -B build -G Ninja \
    -DCMAKE_BUILD_TYPE=Release
  rm -f $_pkgname/go/goohrli/goorhli.a
  ninja -C build
}

package() {
  install -Dvm755 build/compare "$pkgdir/usr/bin/zimtohrli_compare"

  install -dvm755 "$pkgdir/usr/share/licenses/$_pkgname/"
  install -Dvm644 $_pkgname/LICENSE "$pkgdir/usr/share/licenses/$_pkgname/"
}