mpd: move to pkgs/by-name (#430697)

Changed files
+333 -342
pkgs
by-name
mp
mpd
mpd-small
servers
top-level
+43
pkgs/by-name/mp/mpd-small/package.nix
···
+
{
+
lib,
+
stdenv,
+
mpd,
+
}:
+
+
mpd.override {
+
features = [
+
"webdav"
+
"curl"
+
"mms"
+
"bzip2"
+
"zzip"
+
"nfs"
+
"audiofile"
+
"faad"
+
"flac"
+
"gme"
+
"mpg123"
+
"opus"
+
"vorbis"
+
"vorbisenc"
+
"lame"
+
"libsamplerate"
+
"shout"
+
"libmpdclient"
+
"id3tag"
+
"expat"
+
"pcre"
+
"sqlite"
+
"qobuz"
+
]
+
++ lib.optionals stdenv.hostPlatform.isLinux [
+
"alsa"
+
"systemd"
+
"syslog"
+
"io_uring"
+
]
+
++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
+
"mad"
+
"jack"
+
];
+
}
+289
pkgs/by-name/mp/mpd/package.nix
···
+
{
+
lib,
+
stdenv,
+
fetchFromGitHub,
+
meson,
+
ninja,
+
pkg-config,
+
glib,
+
systemd,
+
fmt,
+
buildPackages,
+
# Inputs
+
curl,
+
libcdio,
+
libcdio-paranoia,
+
libmms,
+
libnfs,
+
liburing,
+
samba,
+
# Archive support
+
bzip2,
+
zziplib,
+
# Codecs
+
audiofile,
+
faad2,
+
ffmpeg,
+
flac,
+
fluidsynth,
+
game-music-emu,
+
libmad,
+
libmikmod,
+
mpg123,
+
libopus,
+
libvorbis,
+
lame,
+
# Filters
+
libsamplerate,
+
soxr,
+
# Outputs
+
alsa-lib,
+
libao,
+
libjack2,
+
libpulseaudio,
+
libshout,
+
pipewire,
+
# Misc
+
icu,
+
sqlite,
+
avahi,
+
dbus,
+
pcre2,
+
libgcrypt,
+
expat,
+
nlohmann_json,
+
zlib,
+
libupnp,
+
# Client support
+
libmpdclient,
+
# Tag support
+
libid3tag,
+
nixosTests,
+
# For documentation
+
doxygen,
+
python3Packages, # for sphinx-build
+
# For tests
+
gtest,
+
zip,
+
# Features list
+
features ? null,
+
}:
+
+
let
+
concatAttrVals = nameList: set: lib.concatMap (x: set.${x} or [ ]) nameList;
+
+
featureDependencies = {
+
# Storage plugins
+
udisks = [ dbus ];
+
webdav = [
+
curl
+
expat
+
];
+
# Input plugins
+
cdio_paranoia = [
+
libcdio
+
libcdio-paranoia
+
];
+
curl = [ curl ];
+
io_uring = [ liburing ];
+
mms = [ libmms ];
+
nfs = [ libnfs ];
+
smbclient = [ samba ];
+
# Archive support
+
bzip2 = [ bzip2 ];
+
zzip = [ zziplib ];
+
# Decoder plugins
+
audiofile = [ audiofile ];
+
faad = [ faad2 ];
+
ffmpeg = [ ffmpeg ];
+
flac = [ flac ];
+
fluidsynth = [ fluidsynth ];
+
gme = [ game-music-emu ];
+
mad = [ libmad ];
+
mikmod = [ libmikmod ];
+
mpg123 = [
+
libid3tag
+
mpg123
+
];
+
opus = [ libopus ];
+
vorbis = [ libvorbis ];
+
# Encoder plugins
+
vorbisenc = [ libvorbis ];
+
lame = [ lame ];
+
# Filter plugins
+
libsamplerate = [ libsamplerate ];
+
soxr = [ soxr ];
+
# Output plugins
+
alsa = [ alsa-lib ];
+
ao = [ libao ];
+
jack = [ libjack2 ];
+
pipewire = [ pipewire ];
+
pulse = [ libpulseaudio ];
+
shout = [ libshout ];
+
# Commercial services
+
qobuz = [
+
curl
+
libgcrypt
+
nlohmann_json
+
];
+
# Client support
+
libmpdclient = [ libmpdclient ];
+
# Tag support
+
id3tag = [
+
libid3tag
+
zlib
+
];
+
# Misc
+
dbus = [ dbus ];
+
expat = [ expat ];
+
icu = [ icu ];
+
pcre = [ pcre2 ];
+
sqlite = [ sqlite ];
+
syslog = [ ];
+
systemd = [ systemd ];
+
zeroconf = [
+
avahi
+
dbus
+
];
+
};
+
+
nativeFeatureDependencies = {
+
documentation = [
+
doxygen
+
python3Packages.sphinx
+
];
+
};
+
+
# Disable platform specific features if needed
+
# using libmad to decode mp3 files on darwin is causing a segfault -- there
+
# is probably a solution, but I'm disabling it for now
+
platformMask =
+
lib.optionals stdenv.hostPlatform.isDarwin [
+
"mad"
+
"pulse"
+
"jack"
+
"smbclient"
+
]
+
++ lib.optionals (!stdenv.hostPlatform.isLinux) [
+
"alsa"
+
"pipewire"
+
"io_uring"
+
"systemd"
+
"syslog"
+
];
+
+
knownFeatures =
+
builtins.attrNames featureDependencies ++ builtins.attrNames nativeFeatureDependencies;
+
platformFeatures = lib.subtractLists platformMask knownFeatures;
+
+
features_ =
+
if (features == null) then
+
platformFeatures
+
else
+
let
+
unknown = lib.subtractLists knownFeatures features;
+
in
+
if (unknown != [ ]) then
+
throw "Unknown feature(s): ${lib.concatStringsSep " " unknown}"
+
else
+
let
+
unsupported = lib.subtractLists platformFeatures features;
+
in
+
if (unsupported != [ ]) then
+
throw "Feature(s) ${lib.concatStringsSep " " unsupported} are not supported on ${stdenv.hostPlatform.system}"
+
else
+
features;
+
+
in
+
stdenv.mkDerivation (finalAttrs: {
+
pname = "mpd";
+
version = "0.24.5";
+
+
src = fetchFromGitHub {
+
owner = "MusicPlayerDaemon";
+
repo = "MPD";
+
rev = "v${finalAttrs.version}";
+
sha256 = "sha256-MgepOQeOl+n65+7b8zXe2u0fCHFAviSqL1aNu2iSXiM=";
+
};
+
+
buildInputs = [
+
glib
+
fmt
+
# According to the configurePhase of meson, gtest is considered a
+
# runtime dependency. Quoting:
+
#
+
# Run-time dependency GTest found: YES 1.10.0
+
gtest
+
libupnp
+
]
+
++ concatAttrVals features_ featureDependencies;
+
+
nativeBuildInputs = [
+
meson
+
ninja
+
pkg-config
+
]
+
++ concatAttrVals features_ nativeFeatureDependencies;
+
+
depsBuildBuild = [ buildPackages.stdenv.cc ];
+
+
postPatch =
+
lib.optionalString
+
(stdenv.hostPlatform.isDarwin && lib.versionOlder stdenv.hostPlatform.darwinSdkVersion "12.0")
+
''
+
substituteInPlace src/output/plugins/OSXOutputPlugin.cxx \
+
--replace kAudioObjectPropertyElement{Main,Master} \
+
--replace kAudioHardwareServiceDeviceProperty_Virtual{Main,Master}Volume
+
'';
+
+
# Otherwise, the meson log says:
+
#
+
# Program zip found: NO
+
nativeCheckInputs = [ zip ];
+
+
doCheck = true;
+
+
mesonAutoFeatures = "disabled";
+
+
outputs = [
+
"out"
+
"doc"
+
]
+
++ lib.optional (builtins.elem "documentation" features_) "man";
+
+
CXXFLAGS = lib.optionals stdenv.hostPlatform.isDarwin [
+
"-D__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES=0"
+
];
+
+
mesonFlags = [
+
"-Dtest=true"
+
"-Dmanpages=true"
+
"-Dhtml_manual=true"
+
]
+
++ map (x: "-D${x}=enabled") features_
+
++ map (x: "-D${x}=disabled") (lib.subtractLists features_ knownFeatures)
+
++ lib.optional (builtins.elem "zeroconf" features_) (
+
"-Dzeroconf=" + (if stdenv.hostPlatform.isDarwin then "bonjour" else "avahi")
+
)
+
++ lib.optional (builtins.elem "systemd" features_) "-Dsystemd_system_unit_dir=etc/systemd/system"
+
++ lib.optional (builtins.elem "qobuz" features_) "-Dnlohmann_json=enabled";
+
+
passthru.tests.nixos = nixosTests.mpd;
+
+
meta = {
+
description = "Flexible, powerful daemon for playing music";
+
homepage = "https://www.musicpd.org/";
+
license = lib.licenses.gpl2Only;
+
maintainers = with lib.maintainers; [
+
tobim
+
];
+
platforms = lib.platforms.unix;
+
mainProgram = "mpd";
+
+
longDescription = ''
+
Music Player Daemon (MPD) is a flexible, powerful daemon for playing
+
music. Through plugins and libraries it can play a variety of sound
+
files while being controlled by its network protocol.
+
'';
+
};
+
})
-334
pkgs/servers/mpd/default.nix
···
-
{
-
lib,
-
stdenv,
-
fetchFromGitHub,
-
meson,
-
ninja,
-
pkg-config,
-
glib,
-
systemd,
-
fmt,
-
buildPackages,
-
# Inputs
-
curl,
-
libcdio,
-
libcdio-paranoia,
-
libmms,
-
libnfs,
-
liburing,
-
samba,
-
# Archive support
-
bzip2,
-
zziplib,
-
# Codecs
-
audiofile,
-
faad2,
-
ffmpeg,
-
flac,
-
fluidsynth,
-
game-music-emu,
-
libmad,
-
libmikmod,
-
mpg123,
-
libopus,
-
libvorbis,
-
lame,
-
# Filters
-
libsamplerate,
-
soxr,
-
# Outputs
-
alsa-lib,
-
libao,
-
libjack2,
-
libpulseaudio,
-
libshout,
-
pipewire,
-
# Misc
-
icu,
-
sqlite,
-
avahi,
-
dbus,
-
pcre2,
-
libgcrypt,
-
expat,
-
nlohmann_json,
-
zlib,
-
libupnp,
-
# Client support
-
libmpdclient,
-
# Tag support
-
libid3tag,
-
nixosTests,
-
# For documentation
-
doxygen,
-
python3Packages, # for sphinx-build
-
# For tests
-
gtest,
-
zip,
-
}:
-
-
let
-
concatAttrVals = nameList: set: lib.concatMap (x: set.${x} or [ ]) nameList;
-
-
featureDependencies = {
-
# Storage plugins
-
udisks = [ dbus ];
-
webdav = [
-
curl
-
expat
-
];
-
# Input plugins
-
cdio_paranoia = [
-
libcdio
-
libcdio-paranoia
-
];
-
curl = [ curl ];
-
io_uring = [ liburing ];
-
mms = [ libmms ];
-
nfs = [ libnfs ];
-
smbclient = [ samba ];
-
# Archive support
-
bzip2 = [ bzip2 ];
-
zzip = [ zziplib ];
-
# Decoder plugins
-
audiofile = [ audiofile ];
-
faad = [ faad2 ];
-
ffmpeg = [ ffmpeg ];
-
flac = [ flac ];
-
fluidsynth = [ fluidsynth ];
-
gme = [ game-music-emu ];
-
mad = [ libmad ];
-
mikmod = [ libmikmod ];
-
mpg123 = [
-
libid3tag
-
mpg123
-
];
-
opus = [ libopus ];
-
vorbis = [ libvorbis ];
-
# Encoder plugins
-
vorbisenc = [ libvorbis ];
-
lame = [ lame ];
-
# Filter plugins
-
libsamplerate = [ libsamplerate ];
-
soxr = [ soxr ];
-
# Output plugins
-
alsa = [ alsa-lib ];
-
ao = [ libao ];
-
jack = [ libjack2 ];
-
pipewire = [ pipewire ];
-
pulse = [ libpulseaudio ];
-
shout = [ libshout ];
-
# Commercial services
-
qobuz = [
-
curl
-
libgcrypt
-
nlohmann_json
-
];
-
# Client support
-
libmpdclient = [ libmpdclient ];
-
# Tag support
-
id3tag = [
-
libid3tag
-
zlib
-
];
-
# Misc
-
dbus = [ dbus ];
-
expat = [ expat ];
-
icu = [ icu ];
-
pcre = [ pcre2 ];
-
sqlite = [ sqlite ];
-
syslog = [ ];
-
systemd = [ systemd ];
-
zeroconf = [
-
avahi
-
dbus
-
];
-
};
-
-
nativeFeatureDependencies = {
-
documentation = [
-
doxygen
-
python3Packages.sphinx
-
];
-
};
-
-
run =
-
{
-
features ? null,
-
}:
-
let
-
# Disable platform specific features if needed
-
# using libmad to decode mp3 files on darwin is causing a segfault -- there
-
# is probably a solution, but I'm disabling it for now
-
platformMask =
-
lib.optionals stdenv.hostPlatform.isDarwin [
-
"mad"
-
"pulse"
-
"jack"
-
"smbclient"
-
]
-
++ lib.optionals (!stdenv.hostPlatform.isLinux) [
-
"alsa"
-
"pipewire"
-
"io_uring"
-
"systemd"
-
"syslog"
-
];
-
-
knownFeatures =
-
builtins.attrNames featureDependencies ++ builtins.attrNames nativeFeatureDependencies;
-
platformFeatures = lib.subtractLists platformMask knownFeatures;
-
-
features_ =
-
if (features == null) then
-
platformFeatures
-
else
-
let
-
unknown = lib.subtractLists knownFeatures features;
-
in
-
if (unknown != [ ]) then
-
throw "Unknown feature(s): ${lib.concatStringsSep " " unknown}"
-
else
-
let
-
unsupported = lib.subtractLists platformFeatures features;
-
in
-
if (unsupported != [ ]) then
-
throw "Feature(s) ${lib.concatStringsSep " " unsupported} are not supported on ${stdenv.hostPlatform.system}"
-
else
-
features;
-
-
in
-
stdenv.mkDerivation rec {
-
pname = "mpd";
-
version = "0.24.5";
-
-
src = fetchFromGitHub {
-
owner = "MusicPlayerDaemon";
-
repo = "MPD";
-
rev = "v${version}";
-
sha256 = "sha256-MgepOQeOl+n65+7b8zXe2u0fCHFAviSqL1aNu2iSXiM=";
-
};
-
-
buildInputs = [
-
glib
-
fmt
-
# According to the configurePhase of meson, gtest is considered a
-
# runtime dependency. Quoting:
-
#
-
# Run-time dependency GTest found: YES 1.10.0
-
gtest
-
libupnp
-
]
-
++ concatAttrVals features_ featureDependencies;
-
-
nativeBuildInputs = [
-
meson
-
ninja
-
pkg-config
-
]
-
++ concatAttrVals features_ nativeFeatureDependencies;
-
-
depsBuildBuild = [ buildPackages.stdenv.cc ];
-
-
postPatch =
-
lib.optionalString
-
(stdenv.hostPlatform.isDarwin && lib.versionOlder stdenv.hostPlatform.darwinSdkVersion "12.0")
-
''
-
substituteInPlace src/output/plugins/OSXOutputPlugin.cxx \
-
--replace kAudioObjectPropertyElement{Main,Master} \
-
--replace kAudioHardwareServiceDeviceProperty_Virtual{Main,Master}Volume
-
'';
-
-
# Otherwise, the meson log says:
-
#
-
# Program zip found: NO
-
nativeCheckInputs = [ zip ];
-
-
doCheck = true;
-
-
mesonAutoFeatures = "disabled";
-
-
outputs = [
-
"out"
-
"doc"
-
]
-
++ lib.optional (builtins.elem "documentation" features_) "man";
-
-
CXXFLAGS = lib.optionals stdenv.hostPlatform.isDarwin [
-
"-D__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES=0"
-
];
-
-
mesonFlags = [
-
"-Dtest=true"
-
"-Dmanpages=true"
-
"-Dhtml_manual=true"
-
]
-
++ map (x: "-D${x}=enabled") features_
-
++ map (x: "-D${x}=disabled") (lib.subtractLists features_ knownFeatures)
-
++ lib.optional (builtins.elem "zeroconf" features_) (
-
"-Dzeroconf=" + (if stdenv.hostPlatform.isDarwin then "bonjour" else "avahi")
-
)
-
++ lib.optional (builtins.elem "systemd" features_) "-Dsystemd_system_unit_dir=etc/systemd/system"
-
++ lib.optional (builtins.elem "qobuz" features_) "-Dnlohmann_json=enabled";
-
-
passthru.tests.nixos = nixosTests.mpd;
-
-
meta = with lib; {
-
description = "Flexible, powerful daemon for playing music";
-
homepage = "https://www.musicpd.org/";
-
license = licenses.gpl2Only;
-
maintainers = with maintainers; [
-
tobim
-
];
-
platforms = platforms.unix;
-
mainProgram = "mpd";
-
-
longDescription = ''
-
Music Player Daemon (MPD) is a flexible, powerful daemon for playing
-
music. Through plugins and libraries it can play a variety of sound
-
files while being controlled by its network protocol.
-
'';
-
};
-
};
-
in
-
{
-
mpd = run { };
-
mpd-small = run {
-
features = [
-
"webdav"
-
"curl"
-
"mms"
-
"bzip2"
-
"zzip"
-
"nfs"
-
"audiofile"
-
"faad"
-
"flac"
-
"gme"
-
"mpg123"
-
"opus"
-
"vorbis"
-
"vorbisenc"
-
"lame"
-
"libsamplerate"
-
"shout"
-
"libmpdclient"
-
"id3tag"
-
"expat"
-
"pcre"
-
"sqlite"
-
"qobuz"
-
]
-
++ lib.optionals stdenv.hostPlatform.isLinux [
-
"alsa"
-
"systemd"
-
"syslog"
-
"io_uring"
-
]
-
++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
-
"mad"
-
"jack"
-
];
-
};
-
mpdWithFeatures = run;
-
}
+1
pkgs/top-level/aliases.nix
···
mpc-cli = mpc; # Added 2024-10-14
mpc_cli = mpc; # Added 2024-10-14
mpd_clientlib = throw "'mpd_clientlib' has been renamed to/replaced by 'libmpdclient'"; # Converted to throw 2024-10-17
+
mpdWithFeatures = lib.warnOnInstantiate "mpdWithFeatures has been replaced by mpd.override" mpd.override; # Added 2025-08-08
mpdevil = plattenalbum; # Added 2024-05-22
mpg321 = throw "'mpg321' has been removed due to it being unmaintained by upstream. Consider using mpg123 instead."; # Added 2024-05-10
mq-cli = throw "'mq-cli' has been removed due to lack of upstream maintenance"; # Added 2025-01-25
-8
pkgs/top-level/all-packages.nix
···
mkchromecast = libsForQt5.callPackage ../applications/networking/mkchromecast { };
-
inherit
-
(callPackages ../servers/mpd {
-
})
-
mpd
-
mpd-small
-
mpdWithFeatures
-
;
-
mtprotoproxy = python3.pkgs.callPackage ../servers/mtprotoproxy { };
moodle = callPackage ../servers/web-apps/moodle { };