summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6f3fbffdd051377f43a13f3597c151891f5cd766 (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
63
64
65
66
67
68
69
70
71
72
73
74
# Maintainer: Michael Serajnik <m at mser dot at>
# Maintainer: txtsd <aur.archlinux@ihavea.quest>

pkgname=soundsense-rs-git
_pkgname=soundsense-rs
pkgver=1.5.1.travis.r12.gf701020
pkgrel=4
pkgdesc="A Rust version of SoundSense"
arch=(x86_64)
url="https://github.com/prixt/${_pkgname}"
license=('MIT')
depends=(
  gcc-libs
  glib2
  glibc
  gtk3
  alsa-lib
  webkit2gtk
)
makedepends=(
  alsa-lib
  git
  rust
)
options=(!lto)
source=(
  "git+https://github.com/prixt/${_pkgname}.git"
  soundsense-rs.desktop
  linux_web_fix.patch
)
sha256sums=('SKIP'
            'ced141bf8441d271ee610beebe79cdd5bfe287b1d157d79a7c470d0e44673e5f'
            'd427efa76714279f114b3b88dd584dc3b3fe55236c361fbaf09a77358e25afc8')

prepare() {
  cd "${_pkgname}"

  patch -Np1 -i "${srcdir}/linux_web_fix.patch"

  export RUSTUP_TOOLCHAIN=stable
  cargo fetch --target "$(rustc -vV | sed -n 's/host: //p')"
}

pkgver() {
  cd "${_pkgname}"

  git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cd "${_pkgname}"

  export RUSTUP_TOOLCHAIN=stable
  export CARGO_TARGET_DIR=target
  cargo build --frozen --release
}

check() {
  cd "${_pkgname}"

  export RUSTUP_TOOLCHAIN=stable
  export CARGO_TARGET_DIR=target
  cargo test --frozen --release
}

package() {
  cd "${_pkgname}"
  install -Dm755 "target/release/${_pkgname}" "${pkgdir}/usr/bin/${_pkgname}"
  install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
  install -Dm644 icons/icon.png "${pkgdir}/usr/share/pixmaps/${_pkgname}.png"

  cd "${srcdir}"
  install -Dm644 "${_pkgname}.desktop" "${pkgdir}/usr/share/applications/${_pkgname}.desktop"
}