about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDoron Behar <doron.behar@gmail.com>2020-05-16 17:08:05 +0300
committerDoron Behar <doron.behar@gmail.com>2020-05-16 17:08:05 +0300
commit69aa4f379224876ca5cf38dc5c821fcee60101b4 (patch)
tree4239ce1e13d1393121f7519fc1916ef7b31f05ed
parentecdbbdf181e95ee2f84b62d641f0a984418048ee (diff)
downloadnixlib-69aa4f379224876ca5cf38dc5c821fcee60101b4.tar
nixlib-69aa4f379224876ca5cf38dc5c821fcee60101b4.tar.gz
nixlib-69aa4f379224876ca5cf38dc5c821fcee60101b4.tar.bz2
nixlib-69aa4f379224876ca5cf38dc5c821fcee60101b4.tar.lz
nixlib-69aa4f379224876ca5cf38dc5c821fcee60101b4.tar.xz
nixlib-69aa4f379224876ca5cf38dc5c821fcee60101b4.tar.zst
nixlib-69aa4f379224876ca5cf38dc5c821fcee60101b4.zip
mpd: enable tests
-rw-r--r--pkgs/servers/mpd/default.nix37
1 files changed, 35 insertions, 2 deletions
diff --git a/pkgs/servers/mpd/default.nix b/pkgs/servers/mpd/default.nix
index 294e36f32741..bd28a7db3835 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"