git » librespot.git » commit 354083e

Build all features

author txtsd
2024-12-14 04:50:09 UTC
committer txtsd
2024-12-14 04:50:09 UTC
parent 2809a3972641369e467d3a338ea73aa8f9e7d99b

Build all features

Signed-off-by: txtsd <code@ihavea.quest>

.SRCINFO +16 -3
.gitignore +5 -0
.nvchecker.toml +4 -0
PKGBUILD +46 -46

diff --git a/.SRCINFO b/.SRCINFO
index cbb8e54..df7c36e 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,19 +1,32 @@
 pkgbase = librespot
 	pkgdesc = Open source client library for Spotify
 	pkgver = 0.6.0
-	pkgrel = 1
+	pkgrel = 2
 	url = https://github.com/librespot-org/librespot
 	arch = x86_64
+	arch = armv7h
+	arch = aarch64
 	license = MIT
 	makedepends = cargo
+	makedepends = git
+	makedepends = jack2
+	makedepends = libpulse
+	makedepends = portaudio
+	makedepends = sdl2
 	depends = alsa-lib
+	depends = avahi
+	depends = gcc-libs
+	depends = glibc
+	depends = gst-plugins-base-libs
+	depends = gstreamer
 	optdepends = gst-plugins-base: Audio playback using GStreamer
 	optdepends = gst-plugins-good: Audio playback using GStreamer
 	optdepends = jack2: Audio playback using JACK
 	optdepends = libpulse: Audio playback using PulseAudio
 	optdepends = portaudio: Audio playback using PortAudio
 	optdepends = sdl2: Audio playback using SDL2
-	source = librespot-0.6.0.tar.gz::https://github.com/librespot-org/librespot/archive/v0.6.0.tar.gz
-	sha256sums = 9ec881edb11e37d31a2b41dd30d56a3413445eedb720e1b0d278567dccfca8fc
+	options = !lto
+	source = git+https://github.com/librespot-org/librespot#tag=v0.6.0
+	sha256sums = d3c81a50769223bf120689b9c7654a2d25fb5e4b03648149562c1c702ca3b467
 
 pkgname = librespot
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..218cc90
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+*
+!PKGBUILD
+!.SRCINFO
+!.gitignore
+!.nvchecker.toml
diff --git a/.nvchecker.toml b/.nvchecker.toml
new file mode 100644
index 0000000..d3a8665
--- /dev/null
+++ b/.nvchecker.toml
@@ -0,0 +1,4 @@
+[librespot]
+source = "git"
+git = "https://github.com/librespot-org/librespot.git"
+prefix = "v"
diff --git a/PKGBUILD b/PKGBUILD
index 3bdbe94..4a86825 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,71 +1,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=1
+pkgrel=2
 pkgdesc='Open source client library for Spotify'
-arch=('x86_64')
+arch=(x86_64 armv7h aarch64)
 url='https://github.com/librespot-org/librespot'
 license=('MIT')
 depends=(
-    'alsa-lib'
+  alsa-lib
+  avahi
+  gcc-libs
+  glibc
+  gst-plugins-base-libs
+  gstreamer
 )
 makedepends=(
-    'cargo'
+  cargo
+  git
+  jack2
+  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'
+  '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'
 )
-source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
-sha256sums=('9ec881edb11e37d31a2b41dd30d56a3413445eedb720e1b0d278567dccfca8fc')
+options=(!lto)
+source=("git+${url}#tag=v${pkgver}")
+sha256sums=('d3c81a50769223bf120689b9c7654a2d25fb5e4b03648149562c1c702ca3b467')
 
 prepare() {
-    cd "$pkgname-$pkgver"
-    export RUSTUP_TOOLCHAIN=stable
-    export PKG_FEATURES=alsa-backend
-    declare -rA PKG_FEATURE_MAP=(
-        [jack2]='jackaudio-backend'
-        [gst-plugins-good]='gstreamer-backend'
-        [gst-plugins-base]='gstreamer-backend'
-        [sdl2]='sdl-backend'
-        [libpulse]='pulseaudio-backend'
-        [portaudio]='portaudio-backend'
-    )
-    for pkg in "${!PKG_FEATURE_MAP[@]}"; do
-        if [[ -n `pacman -Qsq "$pkg" | sed -E "/^$pkg\$/b; /.+/d"` ]]; then
-            export PKG_FEATURES="$PKG_FEATURES,${PKG_FEATURE_MAP[$pkg]}"
-        fi 2>/dev/null >&2
-    done
-    cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
+  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-$pkgver"
-    export RUSTUP_TOOLCHAIN=stable
-    export CARGO_TARGET_DIR=target
-    export CARGO_BUILD_JOBS="$(nproc --ignore $(($(nproc) / 2)))"
-    export CFLAGS="$CFLAGS -ffat-lto-objects"
-    echo >&2 "Building $pkgname-$pkgver with the following features: $PKG_FEATURES"
-    cargo build --release --frozen --no-default-features --features "$PKG_FEATURES"
+  cd "${pkgname}"
+
+  export RUSTUP_TOOLCHAIN=stable
+  export CARGO_TARGET_DIR=target
+  cargo build --frozen --release --all-features --workspace
 }
 
-# check() {
-#   cd "$pkgname-$pkgver"
-#     export RUSTUP_TOOLCHAIN=stable
-#     cargo test --frozen --no-default-features --features "$PKG_FEATURES"
-# }
+check() {
+  cd "${pkgname}"
+
+  export RUSTUP_TOOLCHAIN=stable
+  cargo test --frozen --release --all-features --workspace
+}
 
 package() {
-    cd "$pkgname-$pkgver"
-    install -Dvm0755 -t "$pkgdir/usr/bin/" "target/release/$pkgname"
-    install -Dvm644 "contrib/$pkgname.service" -t "$pkgdir/usr/lib/systemd/system/"
-    install -Dvm644 "contrib/$pkgname.user.service" "$pkgdir/usr/lib/systemd/user/$pkgname.service"
-    install -Dvm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
+  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"
 }