# Maintainer: Carmine Paolino pkgname=spotifast-git pkgver=@VERSION@ pkgrel=1 pkgdesc="Native Spotify client" arch=('x86_64' 'aarch64') url="https://github.com/crmne/spotifast" license=('MIT') install="${pkgname}.install" depends=('dbus' 'alsa-lib' 'libpulse' 'libglvnd' 'libxkbcommon' 'wayland' 'libx11') # MilkDrop builds libprojectM from source at compile time: cmake drives # that build, and clang carries the libclang bindgen reads its headers # with. Build with --no-default-features to leave the visualiser out. makedepends=('git' 'cargo' 'cmake' 'clang') optdepends=('libxkbcommon-x11: keyboard handling in X11 sessions' 'pipewire-pulse: PipeWire as the PulseAudio server') provides=("spotifast=$pkgver") conflicts=('spotifast' 'spotifast-bin') # !lto because ring compiles its own C and Arch's default CFLAGS put LTO # objects in the archive, which lld then cannot resolve: the link fails on # undefined ring_core_* symbols. The stable package is prebuilt and never # meets this. options=('!debug' '!lto') source=("${pkgname}::git+https://github.com/crmne/spotifast.git") sha256sums=('SKIP') pkgver() { cd "${srcdir}/${pkgname}" # A pre-release tag (v0.4.0-rc1) keeps its suffix without the hyphen, # 0.4.0rc1, which pacman orders before 0.4.0; then the commits since the # tag and the hash, as before: 0.4.0rc1.r1.cb95384. git describe --long --tags --abbrev=7 | sed 's/^v//;s/-\(rc\|alpha\|beta\)\([0-9]*\)-/\1\2-/;s/-/.r/;s/-g/./' } prepare() { cd "${srcdir}/${pkgname}" export RUSTUP_TOOLCHAIN=stable cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')" } build() { cd "${srcdir}/${pkgname}" export RUSTUP_TOOLCHAIN=stable export CARGO_TARGET_DIR=target # Generated bindings inside glutin carry the path they were built at, which # ends up in the binary and makes makepkg warn about a reference to $srcdir. # Appended rather than assigned, so the distro's own flags survive. export RUSTFLAGS="${RUSTFLAGS:-} --remap-path-prefix=${srcdir}=/" cargo build --frozen --release } check() { cd "${srcdir}/${pkgname}" export RUSTUP_TOOLCHAIN=stable # The demo feature carries the headless render test, which lays out every # page without a display and talks to nothing. cargo test --frozen --features demo } package() { cd "${srcdir}/${pkgname}" install -Dm755 "target/release/spotifast" "${pkgdir}/usr/bin/spotifast" install -Dm644 "LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" install -Dm644 "README.md" "${pkgdir}/usr/share/doc/${pkgname}/README.md" install -Dm644 "packaging/applications/spotifast.desktop" \ "${pkgdir}/usr/share/applications/spotifast.desktop" install -Dm644 "packaging/icons/spotifast.svg" \ "${pkgdir}/usr/share/icons/hicolor/scalable/apps/spotifast.svg" install -Dm644 contrib/omarchy/spotifast.json.tpl "${pkgdir}/usr/share/spotifast/omarchy/spotifast.json.tpl" install -Dm755 contrib/omarchy/spotifast-theme "${pkgdir}/usr/share/spotifast/omarchy/spotifast-theme" }