summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b5000d91934b106c0f5686124ed0fe43a96bfea4 (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
# Maintainer: FirstAirBender <noblechuk5[at]gmail[dot]com>
# Maintainer: txtsd <aur.archlinux@ihaveea.quest>
# Contributor: Luis Martinez <luis dot martinez at disroot dot org>
# Contributor: Philip Goto <philip.goto@gmail.com>

pkgname=librespot
pkgver=0.6.0
pkgrel=3
pkgdesc='Open source client library for Spotify'
arch=(x86_64 armv7h aarch64)
url='https://github.com/librespot-org/librespot'
license=('MIT')
depends=(
  alsa-lib
  avahi
  gcc-libs
  glibc
  gst-plugins-base-libs
  gstreamer
)
makedepends=(
  cargo
  git
  jack
  libpulse
  portaudio
  sdl2
)
optdepends=(
  'gst-plugins-base: Audio playback using GStreamer'
  'gst-plugins-good: Audio playback using GStreamer'
  'jack2: Audio playback using JACK'
  'libpulse: Audio playback using PulseAudio'
  'portaudio: Audio playback using PortAudio'
  'sdl2: Audio playback using SDL2'
)
options=(!lto)
source=("git+${url}#tag=v${pkgver}")
sha256sums=('d3c81a50769223bf120689b9c7654a2d25fb5e4b03648149562c1c702ca3b467')

prepare() {
  cd "${pkgname}"

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

build() {
  cd "${pkgname}"

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

check() {
  cd "${pkgname}"

  export RUSTUP_TOOLCHAIN=stable
  cargo test --frozen --release --all-features --workspace
}

package() {
  cd "${pkgname}"

  install -Dm755 "target/release/${pkgname}" "${pkgdir}/usr/bin/${pkgname}"
  install -Dm644 "contrib/${pkgname}.service" "${pkgdir}/usr/lib/systemd/system/${pkgname}.service"
  install -Dm644 "contrib/${pkgname}.user.service" "${pkgdir}/usr/lib/systemd/user/${pkgname}.service"
  install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}