libspotify

Make a PKGBUILD? Submit it here for user review and possible placement into the repository.

libspotify

Postby Alex2101 » Tue Mar 26, 2013 7:42 pm

Hi everyone,

I adapted libspotify PKGBUILD from aur.archlinux.org.

Only tested with mopidy on a raspberry.

Here it is :

Code: Select all
# Maintainer: Alexandre Petitjean <alpetitjean@ŋmail.com>
pkgname=libspotify

pkgver=12.1.51
pkgrel=1
pkgdesc="C API package allowing third-party developers to write applications that utilize the Spotify music streaming service"

arch=(armv5t armv6t armv6h armv7)
url="https://developer.spotify.com/technologies/libspotify/"
license=('custom')
depends=('glibc')
makedepends=('make')

_dlarch=
if test "$CARCH" == armv5t; then
  _dlarch=armv5
  md5sums=('a7fbd6e248dc4d350f044f0729f1dc40')
elif test "$CARCH" == armv6t; then
  _dlarch=armv6
  md5sums=('11c92c757ff316a46e64d518d6d45b05')
elif test "$CARCH" == armv6h; then
  _dlarch=armv6-bcm2708hardfp
  pkgver=12.1.103
  md5sums=('bf9afc8c7b966841735734b248f9c7a7')
elif test "$CARCH" == armv7; then
  _dlarch=armv7
  ms5sums=('eb7e98849b3bb6d364fa74034602afbf')
fi

source=(http://developer.spotify.com/download/libspotify/libspotify-${pkgver}-Linux-${_dlarch}-release.tar.gz)

build() {
  cd "$srcdir/$pkgname-$pkgver-Linux-${_dlarch}-release"

  # Don't do stupid things from a Makefile
  msg2 "Patching Makefile..."
  sed -i 's/ldconfig//' Makefile
}

package() {
  cd "$srcdir/$pkgname-$pkgver-Linux-${_dlarch}-release"

  make prefix="$pkgdir/usr" install

  # Install documentation
  cp -R share "$pkgdir"/usr/share
  mkdir -p "$pkgdir"/usr/share/man
  mv "$pkgdir"/usr/share/man3 "$pkgdir"/usr/share/man/man3

  # Correct pkgconfig file
  sed -e s:PKG_PREFIX:/usr:g \
          < lib/pkgconfig/libspotify.pc \
          > "$pkgdir"/usr/lib/pkgconfig/libspotify.pc

  # Custom license
  install -Dm644 LICENSE licenses.xhtml "$pkgdir"/usr/share/doc/libspotify
  mkdir -p "$pkgdir"/usr/share/licenses/libspotify
  ln -s ../../doc/libspotify/LICENSE "$pkgdir"/usr/share/licenses/libspotify/LICENSE
}
Alex2101
 
Posts: 1
Joined: Tue Mar 26, 2013 7:27 pm

Re: libspotify

Postby MajinJoko » Wed May 08, 2013 12:55 pm

thank you. I successfully compiled libspotify on my archlinux-raspberrypi.

now I am unable to build pyspotify-git (using packer to install mopidy), I get this error:
Code: Select all
==> Starting make...
running build
running build_py
creating build
creating build/lib.linux-armv6l-2.7
creating build/lib.linux-armv6l-2.7/spotify
copying spotify/settings.py -> build/lib.linux-armv6l-2.7/spotify
copying spotify/__init__.py -> build/lib.linux-armv6l-2.7/spotify
creating build/lib.linux-armv6l-2.7/spotify/manager
copying spotify/manager/session.py -> build/lib.linux-armv6l-2.7/spotify/manager
copying spotify/manager/playlist.py -> build/lib.linux-armv6l-2.7/spotify/manager
copying spotify/manager/container.py -> build/lib.linux-armv6l-2.7/spotify/manager
copying spotify/manager/__init__.py -> build/lib.linux-armv6l-2.7/spotify/manager
creating build/lib.linux-armv6l-2.7/spotify/audiosink
copying spotify/audiosink/portaudio.py -> build/lib.linux-armv6l-2.7/spotify/audiosink
copying spotify/audiosink/oss.py -> build/lib.linux-armv6l-2.7/spotify/audiosink
copying spotify/audiosink/gstreamer.py -> build/lib.linux-armv6l-2.7/spotify/audiosink
copying spotify/audiosink/alsa.py -> build/lib.linux-armv6l-2.7/spotify/audiosink
copying spotify/audiosink/__init__.py -> build/lib.linux-armv6l-2.7/spotify/audiosink
running build_ext
building 'spotify._spotify' extension
creating build/temp.linux-armv6l-2.7
creating build/temp.linux-armv6l-2.7/src
gcc -pthread -DNDEBUG -march=armv6 -mfloat-abi=hard -mfpu=vfp -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -march=armv6 -mfloat-abi=hard -mfpu=vfp -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -fPIC -Isrc -I/usr/include/python2.7 -c src/module.c -o build/temp.linux-armv6l-2.7/src/module.o
src/module.c:3:28: fatal error: libspotify/api.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
==> ERROR: A failure occurred in build().
    Aborting...
The build failed.


I am wandering why "libspotify/api.h" is missing.
Since you wrote that used this PKGBUILD for mopidy, may I ask you how you fixed this?



Thanks / MJ
MajinJoko
 
Posts: 1
Joined: Wed May 08, 2013 12:50 pm


Return to User-Submitted Packages

Who is online

Users browsing this forum: No registered users and 0 guests