yochananmarqos

psst-git

Aug 24th, 2021 (edited)
204
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. pkgname=psst-git
  2. pkgver=r288.1e63d5f
  3. pkgrel=1
  4. pkgdesc="Fast and multi-platform Spotify client with native GUI"
  5. arch=("x86_64")
  6. url="https://github.com/jpochyla/psst"
  7. license=('MIT')
  8. depends=('gtk3' 'openssl')
  9. makedepends=('cargo' 'git')
  10. provides=("${pkgname%-git}")
  11. conflicts=("${pkgname%-git}")
  12. source=('git+https://github.com/jpochyla/psst.git'
  13.         'git+https://github.com/edubart/minivorbis.git')
  14. sha256sums=('SKIP'
  15.             'SKIP')
  16.  
  17. pkgver() {
  18.   cd "$srcdir/${pkgname%-git}"
  19.   printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
  20. }
  21.  
  22. prepare() {
  23.   cd "$srcdir/${pkgname%-git}"
  24.   git submodule init minivorbis-sys/minivorbis
  25.   git config submodule.minivorbis.url $srcdir/minivorbis
  26.   git submodule update
  27.  
  28.   cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
  29.  
  30.   # Add missing entries to desktop file
  31.   sed -i "$ a Icon=${pkgname%-git}-gui" ".pkg/${pkgname%-git}.desktop"
  32.   sed -i '$ a StartupWMClass=Psst-gui' ".pkg/${pkgname%-git}.desktop"
  33. }
  34.  
  35. build() {
  36.   cd "$srcdir/${pkgname%-git}"
  37.   export RUSTUP_TOOLCHAIN=stable
  38.   export CARGO_TARGET_DIR=target
  39.   cargo build --frozen --release --all-features
  40. }
  41.  
  42. check() {
  43.   cd "$srcdir/${pkgname%-git}"
  44.   export RUSTUP_TOOLCHAIN=stable
  45.   cargo test --frozen --all-features
  46. }
  47.  
  48. package() {
  49.   cd "$srcdir/${pkgname%-git}"
  50.   install -Dm755 "target/release/${pkgname%-git}"{-cli,-gui} -t "$pkgdir/usr/bin"
  51.   install -Dm644 ".pkg/${pkgname%-git}.desktop" -t"$pkgdir/usr/share/applications"
  52.   install -Dm644 "${pkgname%-git}-gui/assets/logo.svg" \
  53.     "$pkgdir/usr/share/icons/hicolor/scalable/apps/${pkgname%-git}-gui.svg"
  54.   install -Dm644 LICENSE.md -t "$pkgdir/usr/share/licenses/${pkgname%-git}"
  55. }
RAW Paste Data