# Contributor: Patrycja Rosa # Maintainer: Patrycja Rosa pkgname=spotify pkgver=1.1.84.716 _pkgver="1.1.84.716.gc5f8b819" pkgrel=0 pkgdesc="Spotify desktop player" url="https://www.spotify.com/us/download/linux/" arch="x86_64" license="custom" makedepends="binutils patchelf" # needs latest gcompat for __mbrlen, __close and fixed random_r _gcompat_commit="4d6a5156a6eb7f56b30d93853a872e36dadde81b" source="https://repository-origin.spotify.com/pool/non-free/s/spotify-client/spotify-client_${_pkgver}_amd64.deb https://git.adelielinux.org/adelie/gcompat/-/archive/$_gcompat_commit/gcompat-$_gcompat_commit.tar.gz launcher " options="!check !strip" unpack() { cd "$srcdir" ar x spotify-client_"$_pkgver"_amd64.deb data.tar.gz mkdir "$pkgname-$pkgver" tar -xzf data.tar.gz -C "$pkgname-$pkgver/" default_unpack } build() { cd "$srcdir"/gcompat-"$_gcompat_commit" sed -i '/readlink/d' Makefile make mv libgcompat.so.0 "$builddir"/usr/share/spotify/libgcompat-spotify.so.0 cd "$builddir"/usr/share/spotify # replace glibc with gcompat patchelf --set-interpreter /lib/ld-musl-x86_64.so.1 spotify patchelf --add-needed libgcompat-spotify.so.0 spotify patchelf --remove-needed libdl.so.2 spotify patchelf --remove-needed libm.so.6 spotify # fix curl library name patchelf --remove-needed libcurl-gnutls.so.4 spotify patchelf --add-needed libcurl.so.4 spotify # remove glibc references scanelf --nobanner --recursive --needed . | grep ld-linux | awk '{ print $3 }' \ | while read -r soname; do patchelf --remove-needed ld-linux-x86-64.so.2 $soname done rm "$builddir"/usr/bin/spotify } package() { mkdir -p "$pkgdir" # TODO: move files to "correct" places (is it even doable?) cp -r usr "$pkgdir" install -Dm755 "$srcdir"/launcher "$pkgdir"/usr/bin/spotify } sha512sums=" 3cc25f28ae791ac26607117a5df668f803ed8e58f0ace085010a6242fdde97766bdc1c752560850795c9b4324f3e019937fe9af2788a1946ebb70ee781f50d99 spotify-client_1.1.84.716.gc5f8b819_amd64.deb eed0f2a8cb7fae898096139f3e3b481c3eb21bced8810fc7cef7bf25e2a6cccce6a4b93ed88d52bc11ffc0748eb89bd29ee6f36c8c860ceef1052f1bb924fef4 gcompat-4d6a5156a6eb7f56b30d93853a872e36dadde81b.tar.gz c5f22dffd9c2bca50331dda04bcaae30d035c60bdfb4c40c1f248e0a973233fb9d934c881df7cae04e79b963a204a55b533dc3f476377dbdc4ab265afa63ea10 launcher "