Merge pull request #225143 from lilyinstarlight/pkg/mopidy-spotify

This commit is contained in:
Sandro 2023-05-17 16:59:45 +02:00 committed by GitHub
commit 235373f0aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 4035 additions and 2 deletions

View file

@ -37,6 +37,8 @@ lib.makeScope newScope (self: with self; {
mopidy-soundcloud = callPackage ./soundcloud.nix { }; mopidy-soundcloud = callPackage ./soundcloud.nix { };
mopidy-spotify = callPackage ./spotify.nix { };
mopidy-tidal = callPackage ./tidal.nix { }; mopidy-tidal = callPackage ./tidal.nix { };
mopidy-tunein = callPackage ./tunein.nix { }; mopidy-tunein = callPackage ./tunein.nix { };

View file

@ -21,6 +21,7 @@ pythonPackages.buildPythonApplication rec {
gst-plugins-base gst-plugins-base
gst-plugins-good gst-plugins-good
gst-plugins-ugly gst-plugins-ugly
gst-plugins-rs
]; ];
propagatedBuildInputs = [ propagatedBuildInputs = [

View file

@ -0,0 +1,31 @@
{ lib, fetchFromGitHub, pythonPackages, mopidy }:
pythonPackages.buildPythonApplication rec {
pname = "mopidy-spotify";
version = "unstable-2023-04-21";
src = fetchFromGitHub {
owner = "mopidy";
repo = "mopidy-spotify";
rev = "984151ac96c5f9c35892055bff20cc11f46092d5";
hash = "sha256-4e9Aj0AOFR4/FK54gr1ZyPt0nYZDMrMetV4FPtBxapU=";
};
propagatedBuildInputs = [
mopidy
pythonPackages.responses
];
nativeBuildInputs = [
pythonPackages.pytestCheckHook
];
pythonImportsCheck = [ "mopidy_spotify" ];
meta = with lib; {
homepage = "https://github.com/mopidy/mopidy-spotify";
description = "Mopidy extension for playing music from Spotify";
license = licenses.asl20;
maintainers = with maintainers; [ lilyinstarlight ];
};
}

View file

@ -11,6 +11,7 @@
, IOKit , IOKit
, MediaToolbox , MediaToolbox
, OpenGL , OpenGL
, Security
, VideoToolbox , VideoToolbox
, ipu6ep-camera-hal , ipu6ep-camera-hal
}: }:
@ -30,6 +31,8 @@
gst-plugins-viperfx = callPackage ./viperfx { }; gst-plugins-viperfx = callPackage ./viperfx { };
gst-plugins-rs = callPackage ./rs { inherit Security; };
gst-rtsp-server = callPackage ./rtsp-server { }; gst-rtsp-server = callPackage ./rtsp-server { };
gst-libav = callPackage ./libav { }; gst-libav = callPackage ./libav { };

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,230 @@
{ lib
, stdenv
, fetchFromGitLab
, fetchpatch
, writeText
, rustPlatform
, meson
, ninja
, python3
, pkg-config
, rust
, rustc
, cargo
, cargo-c
, nasm
, gstreamer
, gst-plugins-base
, gst-plugins-bad
, gtk4
, cairo
, csound
, dav1d
, libsodium
, libwebp
, openssl
, pango
, Security
, gst-plugins-good
, nix-update-script
# TODO: required for case-insensitivity hack below
, yq
, moreutils
# specify a limited set of plugins to build if not all supported plugins
, plugins ? null
}:
let
# populated from meson_options.txt (manually for now, but that might change in the future)
validPlugins = {
# audio
audiofx = [ ];
claxon = [ ];
csound = [ csound ];
lewton = [ ];
spotify = [ ];
# generic
file = [ ];
sodium = [ libsodium ];
threadshare = [ ];
# mux
flavors = [ ];
fmp4 = [ ];
mp4 = [ ];
# net
aws = [ openssl ] ++ lib.optionals stdenv.isDarwin [ Security ];
hlssink3 = [ ];
ndi = [ ];
onvif = [ pango ];
raptorq = [ ];
reqwest = [ openssl ] ++ lib.optionals stdenv.isDarwin [ Security ];
rtp = [ ];
webrtc = [ gst-plugins-bad openssl ] ++ lib.optionals stdenv.isDarwin [ Security ];
webrtchttp = [ gst-plugins-bad openssl ] ++ lib.optionals stdenv.isDarwin [ Security ];
# text
textahead = [ ];
json = [ ];
regex = [ ];
textwrap = [ ];
# utils
fallbackswitch = [ gtk4 ];
livesync = [ gtk4 ];
togglerecord = [ gtk4 ];
tracers = [ ];
uriplaylistbin = [ ];
# video
cdg = [ ];
closedcaption = [ pango ];
dav1d = [ dav1d ];
ffv1 = [ ];
gif = [ ];
gtk4 = [ gtk4 ];
hsv = [ ];
png = [ ];
rav1e = [ ];
videofx = [ cairo ];
webp = [ libwebp ];
};
selectedPlugins = if plugins != null then lib.unique (lib.sort lib.lessThan plugins) else lib.subtractLists (
[
"audiofx" # tests have race-y failure, see https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/337
"csound" # tests have weird failure on x86, does not currently work on arm or darwin
] ++ lib.optionals stdenv.isDarwin [
"reqwest" # tests hang on darwin
"threadshare" # tests cannot bind to localhost on darwin
"webp" # not supported on darwin (upstream crate issue)
] ++ lib.optionals (stdenv.isDarwin && !stdenv.isAarch64) [
# these require gstreamer-gl which requires darwin sdk bump
"gtk4"
"livesync"
"fallbackswitch"
"togglerecord"
]
) (lib.attrNames validPlugins);
invalidPlugins = lib.subtractLists (lib.attrNames validPlugins) selectedPlugins;
in
assert lib.assertMsg (invalidPlugins == [])
"Invalid gst-plugins-rs plugin${lib.optionalString (lib.length invalidPlugins > 1) "s"}: ${lib.concatStringsSep ", " invalidPlugins}";
stdenv.mkDerivation rec {
pname = "gst-plugins-rs";
version = "0.10.7";
outputs = [ "out" "dev" ];
src = fetchFromGitLab {
domain = "gitlab.freedesktop.org";
owner = "gstreamer";
repo = "gst-plugins-rs";
rev = version;
hash = "sha256-b+j7nAMK66+msRnIaj1S1DSvES5Gid3QazXgqO1II/Q=";
# TODO: temporary workaround for case-insensitivity problems with color-name crate - https://github.com/annymosse/color-name/pull/2
nativeBuildInputs = [ yq moreutils ];
postFetch = ''
tomlq --toml-output '.package |= map(if .name == "color-name"
then (.source = "git+https://github.com/lilyinstarlight/color-name#cac0ed5b7d2e0682c08c9bfd13089d5494e81b9a" | del(.checksum))
else .
end)' $out/Cargo.lock | sponge $out/Cargo.lock
'';
};
cargoDeps = rustPlatform.importCargoLock {
lockFile = ./Cargo.lock;
outputHashes = {
"cairo-rs-0.17.9" = "sha256-LiIb6y/Ks/o+rZhU8RpXN7jSo7JzBGmcNumxyx/lZs0=";
"color-name-1.1.0" = "sha256-RfMStbe2wX5qjPARHIFHlSDKjzx8DwJ+RjzyltM5K7A=";
"ffv1-0.0.0" = "sha256-af2VD00tMf/hkfvrtGrHTjVJqbl+VVpLaR0Ry+2niJE=";
"flavors-0.2.0" = "sha256-zBa0X75lXnASDBam9Kk6w7K7xuH9fP6rmjWZBUB5hxk=";
"gdk4-0.6.6" = "sha256-TI4F9MjIpxFEZItoewP/Zem1vM4MsKNJTzfgah1vjmI=";
"gstreamer-0.20.5" = "sha256-IQ56Upe73egId1IJRfzvqrJIzTc1x5FgAEbva9kuqPE=";
};
};
strictDeps = true;
nativeBuildInputs = [
rustPlatform.cargoSetupHook
meson
ninja
python3
python3.pkgs.tomli
pkg-config
rustc
cargo
cargo-c
nasm
];
buildInputs = [
gstreamer
gst-plugins-base
] ++ lib.concatMap (plugin: lib.getAttr plugin validPlugins) selectedPlugins;
checkInputs = [
gst-plugins-good
gst-plugins-bad
];
mesonFlags = (
map (plugin: lib.mesonEnable plugin true) selectedPlugins
) ++ [
(lib.mesonOption "sodium-source" "system")
(lib.mesonEnable "doc" false) # `hotdoc` not packaged in nixpkgs as of writing
] ++ (let
crossFile = writeText "cross-file.conf" ''
[binaries]
rust = [ 'rustc', '--target', '${rust.toRustTargetSpec stdenv.hostPlatform}' ]
'';
in lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
"--cross-file=${crossFile}"
]);
# turn off all auto plugins if a list is specified
mesonAutoFeatures = "disabled";
doCheck = true;
# csound lib dir must be manually specified for it to build
# webrtc and webrtchttp plugins are the only that need gstreamer-webrtc (from gst-plugins-bad, a heavy set)
preConfigure = ''
export CARGO_BUILD_JOBS=$NIX_BUILD_CORES
patchShebangs dependencies.py
'' + lib.optionalString (lib.elem "csound" selectedPlugins) ''
export CSOUND_LIB_DIR=${lib.getLib csound}/lib
'' + lib.optionalString (lib.mutuallyExclusive [ "webrtc" "webrtchttp" ] selectedPlugins) ''
sed -i "/\['gstreamer-webrtc-1\.0', 'gst-plugins-bad', 'gstwebrtc_dep', 'gstwebrtc'\]/d" meson.build
'' + lib.optionalString (stdenv.isDarwin && !stdenv.isAarch64) ''
sed -i "/\['gstreamer-gl-1\.0', 'gst-plugins-base', 'gst_gl_dep', 'gstgl'\]/d" meson.build
'';
# run tests ourselves to avoid meson timing out by default
checkPhase = ''
runHook preCheck
meson test --no-rebuild --verbose --timeout-multiplier 6
runHook postCheck
'';
passthru.updateScript = nix-update-script {
# use numbered releases rather than gstreamer-* releases
extraArgs = [ "--version-regex" "([0-9.]+)" ];
};
meta = with lib; {
description = "GStreamer plugins written in Rust";
homepage = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs";
license = with licenses; [ mpl20 asl20 mit lgpl21Plus ];
platforms = platforms.unix;
maintainers = with maintainers; [ lilyinstarlight ];
};
}

View file

@ -1057,7 +1057,6 @@ mapAliases ({
mopidy-gmusic = throw "mopidy-gmusic has been removed because Google Play Music was discontinued"; # Added 2021-03-07 mopidy-gmusic = throw "mopidy-gmusic has been removed because Google Play Music was discontinued"; # Added 2021-03-07
mopidy-local-images = throw "mopidy-local-images has been removed as it's unmaintained. Its functionality has been merged into the mopidy-local extension"; # Added 2020-10-18 mopidy-local-images = throw "mopidy-local-images has been removed as it's unmaintained. Its functionality has been merged into the mopidy-local extension"; # Added 2020-10-18
mopidy-local-sqlite = throw "mopidy-local-sqlite has been removed as it's unmaintained. Its functionality has been merged into the mopidy-local extension"; # Added 2020-10-18 mopidy-local-sqlite = throw "mopidy-local-sqlite has been removed as it's unmaintained. Its functionality has been merged into the mopidy-local extension"; # Added 2020-10-18
mopidy-spotify = throw "mopidy-spotify has been removed because Spotify stopped supporting libspotify"; # added 2022-05-29
mopidy-spotify-tunigo = throw "mopidy-spotify-tunigo has been removed because Spotify stopped supporting libspotify"; # added 2022-05-29 mopidy-spotify-tunigo = throw "mopidy-spotify-tunigo has been removed because Spotify stopped supporting libspotify"; # added 2022-05-29
morituri = throw "'morituri' has been renamed to/replaced by 'whipper'"; # Converted to throw 2022-02-22 morituri = throw "'morituri' has been renamed to/replaced by 'whipper'"; # Converted to throw 2022-02-22

View file

@ -20724,7 +20724,7 @@ with pkgs;
gst_all_1 = recurseIntoAttrs(callPackage ../development/libraries/gstreamer { gst_all_1 = recurseIntoAttrs(callPackage ../development/libraries/gstreamer {
callPackage = newScope (gst_all_1 // { libav = pkgs.ffmpeg-headless; }); callPackage = newScope (gst_all_1 // { libav = pkgs.ffmpeg-headless; });
inherit (darwin.apple_sdk.frameworks) AudioToolbox AVFoundation Cocoa CoreFoundation CoreMedia CoreServices CoreVideo DiskArbitration Foundation IOKit MediaToolbox OpenGL VideoToolbox; inherit (darwin.apple_sdk.frameworks) AudioToolbox AVFoundation Cocoa CoreFoundation CoreMedia CoreServices CoreVideo DiskArbitration Foundation IOKit MediaToolbox OpenGL Security VideoToolbox;
}); });
gusb = callPackage ../development/libraries/gusb { }; gusb = callPackage ../development/libraries/gusb { };
@ -32442,6 +32442,7 @@ with pkgs;
mopidy-scrobbler mopidy-scrobbler
mopidy-somafm mopidy-somafm
mopidy-soundcloud mopidy-soundcloud
mopidy-spotify
mopidy-subidy mopidy-subidy
mopidy-tidal mopidy-tidal
mopidy-tunein mopidy-tunein