From 5a94a29eec5194e1c8a968a4f1be1ee2e5761335 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Sat, 16 May 2020 17:05:38 +0300 Subject: [PATCH 1/4] mpd: use pkg-config instead of pkgconfig --- pkgs/servers/mpd/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/servers/mpd/default.nix b/pkgs/servers/mpd/default.nix index 8d862373b99..fdb73c7a5be 100644 --- a/pkgs/servers/mpd/default.nix +++ b/pkgs/servers/mpd/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub, meson, ninja, pkgconfig, glib, systemd, boost, darwin +{ stdenv, fetchFromGitHub, meson, ninja, pkg-config, glib, systemd, boost, darwin # Inputs , curl, libmms, libnfs, samba # Archive support @@ -116,7 +116,7 @@ let ++ (lib.concatLists (lib.attrVals features_ featureDependencies)) ++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.AudioToolbox darwin.apple_sdk.frameworks.AudioUnit ]; - nativeBuildInputs = [ meson ninja pkgconfig ]; + nativeBuildInputs = [ meson ninja pkg-config ]; enableParallelBuilding = true; From ecdbbdf181e95ee2f84b62d641f0a984418048ee Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Sat, 16 May 2020 17:06:55 +0300 Subject: [PATCH 2/4] mpd: format inputs --- pkgs/servers/mpd/default.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pkgs/servers/mpd/default.nix b/pkgs/servers/mpd/default.nix index fdb73c7a5be..294e36f3274 100644 --- a/pkgs/servers/mpd/default.nix +++ b/pkgs/servers/mpd/default.nix @@ -112,11 +112,18 @@ let sha256 = "0jnhjhm1ilpcwb4f58b8pgyzjq3dlr0j2xyk0zck0afwkdxyj9cb"; }; - buildInputs = [ glib boost ] + buildInputs = [ + glib + boost + ] ++ (lib.concatLists (lib.attrVals features_ featureDependencies)) ++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.AudioToolbox darwin.apple_sdk.frameworks.AudioUnit ]; - nativeBuildInputs = [ meson ninja pkg-config ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + ]; enableParallelBuilding = true; From 69aa4f379224876ca5cf38dc5c821fcee60101b4 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Sat, 16 May 2020 17:08:05 +0300 Subject: [PATCH 3/4] mpd: enable tests --- pkgs/servers/mpd/default.nix | 37 ++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/pkgs/servers/mpd/default.nix b/pkgs/servers/mpd/default.nix index 294e36f3274..bd28a7db383 100644 --- a/pkgs/servers/mpd/default.nix +++ b/pkgs/servers/mpd/default.nix @@ -19,6 +19,10 @@ # Tag support , libid3tag , nixosTests +# For tests +, gtest +, fetchpatch # used to fetch an upstream patch fixing a failing test +, zip }: let @@ -112,9 +116,28 @@ let sha256 = "0jnhjhm1ilpcwb4f58b8pgyzjq3dlr0j2xyk0zck0afwkdxyj9cb"; }; + # Won't be needed when 0.21.24 will be out + patches = [ + # Tests fail otherwise, see https://github.com/MusicPlayerDaemon/MPD/issues/844 + (fetchpatch { + url = "https://github.com/MusicPlayerDaemon/MPD/commit/7aea2853612743e111ae5e947c8d467049e291a8.patch"; + sha256 = "1bmxlsaiz3wlg1yyc4rkwsmgvc0pirv0s1vdxxsn91yssmh16c2g"; + excludes = [ + # The patch fails otherwise because it tries to update the NEWS + # file which doesn't have the title "ver 0.21.24" yet. + "NEWS" + ]; + }) + ]; + buildInputs = [ glib boost + # According to the configurePhase of meson, gtest is considered a + # runtime dependency. Quoting: + # + # Run-time dependency GTest found: YES 1.10.0 + gtest ] ++ (lib.concatLists (lib.attrVals features_ featureDependencies)) ++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.AudioToolbox darwin.apple_sdk.frameworks.AudioUnit ]; @@ -125,11 +148,21 @@ let pkg-config ]; + # Otherwise, the meson log says: + # + # Program zip found: NO + checkInputs = [ zip ]; + + doCheck = true; + enableParallelBuilding = true; mesonAutoFeatures = "disabled"; - mesonFlags = - map (x: "-D${x}=enabled") features_ + + mesonFlags = [ + "-Dtest=true" + ] + ++ map (x: "-D${x}=enabled") features_ ++ map (x: "-D${x}=disabled") (lib.subtractLists features_ knownFeatures) ++ lib.optional (builtins.elem "zeroconf" features_) "-Dzeroconf=avahi" From 08bdd8bc434ea0bd2c6eb4fb1a3a74870d7307c5 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Sat, 16 May 2020 17:08:25 +0300 Subject: [PATCH 4/4] mpd: Build and install docs and split outputs --- pkgs/servers/mpd/default.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/servers/mpd/default.nix b/pkgs/servers/mpd/default.nix index bd28a7db383..44118277a28 100644 --- a/pkgs/servers/mpd/default.nix +++ b/pkgs/servers/mpd/default.nix @@ -19,6 +19,9 @@ # Tag support , libid3tag , nixosTests +# For documentation +, doxygen +, python3Packages # for sphinx-build # For tests , gtest , fetchpatch # used to fetch an upstream patch fixing a failing test @@ -146,6 +149,8 @@ let meson ninja pkg-config + python3Packages.sphinx + doxygen ]; # Otherwise, the meson log says: @@ -159,7 +164,12 @@ let mesonAutoFeatures = "disabled"; + 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" ] ++ map (x: "-D${x}=enabled") features_