Merge pull request #98869 from tobim/pkgs/mpd-0.22

This commit is contained in:
Doron Behar 2020-10-01 19:01:06 +03:00 committed by GitHub
commit 0a7157119d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 41 additions and 29 deletions

View File

@ -14,24 +14,32 @@ stdenv.mkDerivation rec {
separateDebugInfo = true;
enableParallelBuilding = true;
outputs = [ "out" "lib" "dev" "man" ];
configurePhase = ''
./configure \
--prefix=$out \
--includedir=$dev/include \
--libdir=$lib/lib \
--mandir=$man/share/man \
# Upstream's configure script is not autoconf generated, but a hand written one.
setOutputFlags = false;
preConfigure =
# We cannot use configureFlags or configureFlagsArray directly, since we
# don't have structuredAttrs yet and using placeholder causes permissions
# denied errors. Using $dev / $man in configureFlags causes bash evaluation
# errors
''
configureFlagsArray+=(
"--includedir=$dev/include"
"--mandir=$man/share/man"
)
'';
# Copy the examples into $out.
postInstall = ''
mkdir -p $out/bin
cp ./examples/io_uring-cp examples/io_uring-test $out/bin
cp ./examples/link-cp $out/bin/io_uring-link-cp
cp ./examples/ucontext-cp $out/bin/io_uring-ucontext-cp
'';
outputs = [ "out" "bin" "dev" "man" ];
postInstall =
# Copy the examples into $bin. Most reverse dependency of this package should
# reference only the $out output
''
mkdir -p $bin/bin
cp ./examples/io_uring-cp examples/io_uring-test $bin/bin
cp ./examples/link-cp $bin/bin/io_uring-link-cp
cp ./examples/ucontext-cp $bin/bin/io_uring-ucontext-cp
''
;
meta = with stdenv.lib; {
description = "Userspace library for the Linux io_uring API";

View File

@ -1,6 +1,6 @@
{ stdenv, fetchFromGitHub, meson, ninja, pkg-config, glib, systemd, boost, darwin
# Inputs
, curl, libmms, libnfs, samba
, curl, libmms, libnfs, liburing, samba
# Archive support
, bzip2, zziplib
# Codecs
@ -30,6 +30,7 @@
let
lib = stdenv.lib;
concatAttrVals = nameList: set: lib.concatMap (x: set.${x} or []) nameList;
featureDependencies = {
# Storage plugins
@ -37,6 +38,7 @@ let
webdav = [ curl expat ];
# Input plugins
curl = [ curl ];
io_uring = [ liburing ];
mms = [ libmms ];
nfs = [ libnfs ];
smbclient = [ samba ];
@ -85,15 +87,19 @@ let
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.isDarwin [ "mad" "pulse" "jack" "nfs" "smbclient" ]
++ lib.optionals (!stdenv.isLinux) [ "alsa" "systemd" "syslog" ];
++ lib.optionals (!stdenv.isLinux) [ "alsa" "io_uring" "systemd" "syslog" ];
knownFeatures = builtins.attrNames featureDependencies;
knownFeatures = builtins.attrNames featureDependencies ++ builtins.attrNames nativeFeatureDependencies;
platformFeatures = lib.subtractLists platformMask knownFeatures;
features_ = if (features == null )
@ -110,13 +116,13 @@ let
in stdenv.mkDerivation rec {
pname = "mpd";
version = "0.21.25";
version = "0.22";
src = fetchFromGitHub {
owner = "MusicPlayerDaemon";
repo = "MPD";
rev = "v${version}";
sha256 = "1yjp8pwr2zn0mp39ls1w0pl37zrjn5m9ycgjmcsw2wpa4709r356";
sha256 = "1lsi4fgrarabkahfhf5zbmppg7jba7m362gxyqhv54hmqprl1qff";
};
buildInputs = [
@ -128,16 +134,15 @@ let
# Run-time dependency GTest found: YES 1.10.0
gtest
]
++ (lib.concatLists (lib.attrVals features_ featureDependencies))
++ concatAttrVals features_ featureDependencies
++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.AudioToolbox darwin.apple_sdk.frameworks.AudioUnit ];
nativeBuildInputs = [
meson
ninja
pkg-config
python3Packages.sphinx
doxygen
];
]
++ concatAttrVals features_ nativeFeatureDependencies;
# Otherwise, the meson log says:
#
@ -153,10 +158,9 @@ let
outputs = [ "out" "doc" "man" ];
mesonFlags = [
# Documentation is enabled unconditionally but it's not installed
# unconditionally thanks to the outputs being split
"-Ddocumentation=true"
"-Dtest=true"
"-Dmanpages=true"
"-Dhtml_manual=true"
]
++ map (x: "-D${x}=enabled") features_
++ map (x: "-D${x}=disabled") (lib.subtractLists features_ knownFeatures)
@ -193,7 +197,7 @@ in
"yajl" "sqlite"
"soundcloud" "qobuz" "tidal"
] ++ lib.optionals stdenv.isLinux [
"alsa" "systemd" "syslog"
"alsa" "systemd" "syslog" "io_uring"
] ++ lib.optionals (!stdenv.isDarwin) [
"mad" "jack" "nfs"
]; };