Merge pull request #119126 from fabaff/pycomfoconnect
[NixPkgs.git] / pkgs / development / python-modules / pyspotify / default.nix
blob302eb12de5a181913d19edcbb57f48d86feda7aa
1 { lib, stdenv
2 , buildPythonPackage
3 , fetchurl
4 , cffi
5 , pkgs
6 }:
8 buildPythonPackage rec {
9   pname = "pyspotify";
10   version = "2.1.3";
12   src = fetchurl {
13     url = "https://github.com/mopidy/pyspotify/archive/v${version}.tar.gz";
14     sha256 = "1y1zqkqi9jz5m9bb2z7wmax7g40c1snm3c6di6b63726qrf26rb7";
15   };
17   propagatedBuildInputs = [ cffi ];
18   buildInputs = [ pkgs.libspotify ];
20   # python zip complains about old timestamps
21   preConfigure = ''
22     find -print0 | xargs -0 touch
23   '';
25   postInstall = 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   '';
33   # There are no tests
34   doCheck = false;
36   meta = with 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   };