2021-01-15 22:18:51 +00:00
|
|
|
|
{ lib, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
|
, buildPythonPackage
|
|
|
|
|
, fetchurl
|
|
|
|
|
, cffi
|
|
|
|
|
, pkgs
|
|
|
|
|
}:
|
|
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
|
pname = "pyspotify";
|
|
|
|
|
version = "2.1.3";
|
|
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
|
url = "https://github.com/mopidy/pyspotify/archive/v${version}.tar.gz";
|
|
|
|
|
sha256 = "1y1zqkqi9jz5m9bb2z7wmax7g40c1snm3c6di6b63726qrf26rb7";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ cffi ];
|
|
|
|
|
buildInputs = [ pkgs.libspotify ];
|
|
|
|
|
|
|
|
|
|
# python zip complains about old timestamps
|
|
|
|
|
preConfigure = ''
|
|
|
|
|
find -print0 | xargs -0 touch
|
|
|
|
|
'';
|
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
|
postInstall = lib.optionalString stdenv.isDarwin ''
|
2020-04-24 23:36:52 +00:00
|
|
|
|
find "$out" -name _spotify.so -exec \
|
|
|
|
|
install_name_tool -change \
|
|
|
|
|
@loader_path/../Frameworks/libspotify.framework/libspotify \
|
|
|
|
|
${pkgs.libspotify}/lib/libspotify.dylib \
|
|
|
|
|
{} \;
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
# There are no tests
|
|
|
|
|
doCheck = false;
|
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
|
homepage = "http://pyspotify.mopidy.com";
|
|
|
|
|
description = "A Python interface to Spotify’s online music streaming service";
|
|
|
|
|
license = licenses.unfree;
|
|
|
|
|
maintainers = with maintainers; [ lovek323 ];
|
|
|
|
|
platforms = platforms.unix;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|