2021-12-06 16:07:01 +00:00
|
|
|
|
{ lib
|
|
|
|
|
, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
|
, buildPythonPackage
|
2021-12-06 16:07:01 +00:00
|
|
|
|
, fetchFromGitHub
|
2020-04-24 23:36:52 +00:00
|
|
|
|
, cffi
|
2021-12-06 16:07:01 +00:00
|
|
|
|
, libspotify
|
2020-04-24 23:36:52 +00:00
|
|
|
|
}:
|
|
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
|
pname = "pyspotify";
|
|
|
|
|
version = "2.1.3";
|
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
|
owner = "mopidy";
|
|
|
|
|
repo = "pyspotify";
|
|
|
|
|
rev = "v${version}";
|
|
|
|
|
sha256 = "sha256-CjIRwSlR5HPOJ9tp7lrdcDPiKH3p/PxvEJ8sqVD5s3Q=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ cffi ];
|
2021-12-06 16:07:01 +00:00
|
|
|
|
buildInputs = [ libspotify ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
# 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 \
|
2021-12-06 16:07:01 +00:00
|
|
|
|
${libspotify}/lib/libspotify.dylib \
|
2020-04-24 23:36:52 +00:00
|
|
|
|
{} \;
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
# There are no tests
|
|
|
|
|
doCheck = false;
|
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
|
meta = with lib; {
|
2021-12-06 16:07:01 +00:00
|
|
|
|
homepage = "http://pyspotify.mopidy.com";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
description = "A Python interface to Spotify’s online music streaming service";
|
2021-12-06 16:07:01 +00:00
|
|
|
|
license = licenses.unfree;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
maintainers = with maintainers; [ lovek323 ];
|
|
|
|
|
};
|
|
|
|
|
}
|