summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 9695e838b5422a153b159625b1dc53574777edce (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
62
# Maintainer: Davide Gerhard <rainbow@irh.it>
# Contributor: Joshua Rubin <me at jawa dot dev>

pkgname=pihpsdr-git
_pkgname=pihpsdr
pkgver=r2891.b34a018
pkgrel=1
pkgdesc='SDR software for HPSDR radios like Anan and Hermes Lite 2'
arch=('x86_64' 'aarch64')
url='https://github.com/dl1ycf/pihpsdr'
license=('GPL2')
# we use the internal 'libspecbleach'
# since pihpsdr requires the git version and I don't want
# to maintain it in aur
depends=('fftw' 'libpipewire' 'gtk3' 'soapysdr' 'alsa-lib' 'rnnoise' 'libwebsockets' 'zlib' 'opus' 'curl' 'sqlite')
makedepends=('git')
buildflags=()
provides=("${_pkgname}")
conflicts=("${_pkgname}")
source=(
  "${_pkgname}::git+https://github.com/dl1ycf/${_pkgname}"
  "desktop_file.patch"
  # we don't like to install the full Latex to build the manual
  "${url}/releases/download/v2.5/piHPSDR-Manual.pdf"
)
sha512sums=('SKIP'
            '88c32a4329c92230cd31431b1cea4754cf578cc28eea134eada34dc739e0243146e1045dcd2d0f8ee94dd84bcd1ff6cd5bac79f56acfa42c41cceb1201b17a7e'
            # probably the manual is uploaded every time he does a change
            'SKIP')

pkgver() {
    cd "$_pkgname"
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
}

prepare() {
  patch --directory="$_pkgname" --forward --strip=1 --input="${srcdir}/desktop_file.patch"
}

build() {
  cd "$_pkgname"
  export CFLAGS="${CFLAGS} -D_GNU_SOURCE -march=native -O3"
  make \
    GPIO= \
    MIDI=ON \
    SATURN=ON \
    SOAPYSDR=ON \
    USBOZY=OFF \
    STEMLAB=ON \
    NR34LIB=OFF \
    PORTFORWARD=OFF \
    AUDIO=PIPEWIRE
}

package() {
  cd "$_pkgname"
  install -D "${_pkgname}" "${pkgdir}/usr/bin/${_pkgname}"
  install -D release/pihpsdr/hpsdr.png -m 0644 "${pkgdir}/usr/share/pihpsdr/hpsdr.png"
  install -D release/pihpsdr/piHPSDR_logo.png -m 0644 "${pkgdir}/usr/share/pihpsdr/piHPSDR_logo.png"
  install -m 0644 -D pihpsdr.desktop "${pkgdir}/usr/share/applications/pihpsdr.desktop"
  install -m 0644 -D "${srcdir}/piHPSDR-Manual.pdf" "${pkgdir}/usr/share/doc/pihpsdr/manual.pdf"
}