summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: f78ba53c7d99e347170eb827b8cbbcb59d9cd8ca (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
# Maintainer: OSAMC <https://github.com/osam-cologne/archlinux-proaudio>
# Contributor: Florian Hülsmann <fh@cbix.de>

pkgname=hpklinux
pkgver=4.20.46
pkgrel=2
pkgdesc='AudioScience HPI (ASIHPI) user space libraries and tools'
arch=(aarch64 x86_64)
url='https://www.audioscience.com/internet/download/linux_drivers.htm'
license=(GPL-2.0-only Zlib)
groups=(pro-audio)
provides=(python-audioscience)
depends=(glibc)
makedepends=(python-setuptools)
optdepends=('python: for python bindings'
            'python-docopt: for dab_data and dabtest scripts')
source=("https://www.audioscience.com/internet/download/drivers/released/v${pkgver//./\/}/${pkgname}_$pkgver.tar.gz"
        'python.patch')
sha256sums=('7fb89509c5de487d33ac1fdff6adaa95215712613b841784954d546ca82b969c'
            '922832e6c35ed4f55ad7de6138d9fe92fb6add684646471d0b9e616f96802cd7')

prepare() {
  cd ${pkgname}_$pkgver
  # fix python2 call in asi-python Makefile
  patch -p1 -i ../python.patch
}

build() {
  cd ${pkgname}_$pkgver
  make -C hpi-lib
  make -C hpi-cli-apps
  make -C asi-python build
}

package() {
  cd ${pkgname}_$pkgver
  make DESTDIR="$pkgdir" install-prefix=/usr -C hpi-lib install
  make DESTDIR="$pkgdir" install-prefix=/usr -C hpi-cli-apps install
  make CMD_OPTS="--root='$pkgdir' --skip-build --optimize=1" -C asi-python install
  # write custom ZLIB license header to file
  sed -n '/Copyright/,/GPLCompatibleLicenses/p' hpi-lib/hpi.h | install -Dvm644 /dev/stdin \
    "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}