Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 88 lines 2.2 kB view raw
1{ 2 lib, 3 stdenv, 4 fetchFromGitHub, 5 pythonPackages, 6 wrapGAppsNoGuiHook, 7 gst_all_1, 8 glib-networking, 9 gobject-introspection, 10 pipewire, 11 nixosTests, 12}: 13 14pythonPackages.buildPythonApplication rec { 15 pname = "mopidy"; 16 version = "3.4.2"; 17 pyproject = true; 18 19 src = fetchFromGitHub { 20 owner = "mopidy"; 21 repo = "mopidy"; 22 tag = "v${version}"; 23 hash = "sha256-2OFav2HaQq/RphmZxLyL1n3suwzt1Y/d4h33EdbStjk="; 24 }; 25 26 nativeBuildInputs = [ wrapGAppsNoGuiHook ]; 27 28 buildInputs = 29 with gst_all_1; 30 [ 31 glib-networking 32 gst-plugins-bad 33 gst-plugins-base 34 gst-plugins-good 35 gst-plugins-ugly 36 # Required patches for the Spotify plugin (https://github.com/mopidy/mopidy-spotify/releases/tag/v5.0.0a3) 37 (gst-plugins-rs.overrideAttrs ( 38 newAttrs: oldAttrs: { 39 cargoDeps = oldAttrs.cargoDeps.overrideAttrs (oldAttrs': { 40 vendorStaging = oldAttrs'.vendorStaging.overrideAttrs { 41 inherit (newAttrs) patches; 42 outputHash = "sha256-urRYH5N1laBq1/SUEmwFKAtsHAC+KWYfYp+fmb7Ey7s="; 43 }; 44 }); 45 46 # https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1801/ 47 patches = oldAttrs.patches or [ ] ++ [ 48 ./spotify-access-token-auth.patch 49 ]; 50 } 51 )) 52 ] 53 ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ pipewire ]; 54 55 propagatedNativeBuildInputs = [ gobject-introspection ]; 56 57 propagatedBuildInputs = [ gobject-introspection ]; 58 59 build-system = [ pythonPackages.setuptools ]; 60 61 dependencies = 62 with pythonPackages; 63 [ 64 gst-python 65 pygobject3 66 pykka 67 requests 68 setuptools 69 tornado 70 ] 71 ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ dbus-python ]; 72 73 # There are no tests 74 doCheck = false; 75 76 passthru.tests = { 77 inherit (nixosTests) mopidy; 78 }; 79 80 meta = { 81 homepage = "https://www.mopidy.com/"; 82 description = "Extensible music server that plays music from local disk, Spotify, SoundCloud, and more"; 83 mainProgram = "mopidy"; 84 license = lib.licenses.asl20; 85 maintainers = [ lib.maintainers.fpletz ]; 86 hydraPlatforms = [ ]; 87 }; 88}