1{ stdenv
2, buildPythonPackage
3, fetchurl
4, cffi
5, pkgs
6}:
7
8buildPythonPackage rec {
9 pname = "pyspotify";
10 version = "2.1.3";
11
12 src = fetchurl {
13 url = "https://github.com/mopidy/pyspotify/archive/v${version}.tar.gz";
14 sha256 = "1y1zqkqi9jz5m9bb2z7wmax7g40c1snm3c6di6b63726qrf26rb7";
15 };
16
17 propagatedBuildInputs = [ cffi ];
18 buildInputs = [ pkgs.libspotify ];
19
20 # python zip complains about old timestamps
21 preConfigure = ''
22 find -print0 | xargs -0 touch
23 '';
24
25 postInstall = stdenv.lib.optionalString stdenv.isDarwin ''
26 find "$out" -name _spotify.so -exec \
27 install_name_tool -change \
28 @loader_path/../Frameworks/libspotify.framework/libspotify \
29 ${pkgs.libspotify}/lib/libspotify.dylib \
30 {} \;
31 '';
32
33 # There are no tests
34 doCheck = false;
35
36 meta = with stdenv.lib; {
37 homepage = "http://pyspotify.mopidy.com";
38 description = "A Python interface to Spotify’s online music streaming service";
39 license = licenses.unfree;
40 maintainers = with maintainers; [ lovek323 ];
41 platforms = platforms.unix;
42 };
43
44}