summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 9e58527aa8c0ec8288952c7b9fe00445332693e0 (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
# Maintainer: garionion <garionion@entr0py.de>
# contributor: yochananmarqos (thank you very much)
pkgname=psst-git
pkgver=r406.1627cd4
pkgrel=4
pkgdesc="Fast and multi-platform Spotify client with native GUI"
arch=("x86_64")
options=(!lto)
url="https://github.com/jpochyla/psst"
license=('MIT')
depends=('gtk3' 'openssl' 'alsa-lib')
makedepends=('rustup' 'cargo' 'git')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
source=('git+https://github.com/jpochyla/psst.git')
sha256sums=('SKIP')

pkgver() {
  cd "$srcdir/${pkgname%-git}"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
  cd "$srcdir/${pkgname%-git}"
  export RUSTUP_TOOLCHAIN=stable
  cargo fetch --locked --target "$CARCH-unknown-linux-gnu"

  # Add missing entries to desktop file
  sed -i "$ a Icon=${pkgname%-git}-gui" ".pkg/${pkgname%-git}.desktop"
  sed -i '$ a StartupWMClass=Psst-gui' ".pkg/${pkgname%-git}.desktop"
}

build() {
  cd "$srcdir/${pkgname%-git}"
  export RUSTUP_TOOLCHAIN=stable
  export CARGO_TARGET_DIR=target
  cargo build --frozen --release --all-features
}

check() {
  cd "$srcdir/${pkgname%-git}"
  export RUSTUP_TOOLCHAIN=stable
  cargo test --frozen --all-features
}

package() {
  cd "$srcdir/${pkgname%-git}"
  install -Dm755 "target/release/${pkgname%-git}"{-cli,-gui} -t "$pkgdir/usr/bin"
  install -Dm644 ".pkg/${pkgname%-git}.desktop" -t"$pkgdir/usr/share/applications"
  install -Dm644 "${pkgname%-git}-gui/assets/logo_256.png" \
    "$pkgdir/usr/share/icons/hicolor/scalable/apps/${pkgname%-git}-gui.svg"
  install -Dm644 LICENSE.md -t "$pkgdir/usr/share/licenses/${pkgname%-git}"
}