about summary refs log tree commit diff
path: root/pkgs/applications/audio/mellowplayer
diff options
context:
space:
mode:
authorWael Nasreddine <wael.nasreddine@gmail.com>2020-07-13 09:23:55 -0700
committerGitHub <noreply@github.com>2020-07-13 09:23:55 -0700
commit21104fcabdb61366db4f9ac9cef0880e813c5ee0 (patch)
tree2a85761fde5265b3d1a6cb6a3ab403fca17d2fc9 /pkgs/applications/audio/mellowplayer
parentb8e3f277a83d5a98a2c7fe35a8fd2738f61baab0 (diff)
mellowplayer: init at 3.6.4 (#92653)
Diffstat (limited to 'pkgs/applications/audio/mellowplayer')
-rw-r--r--pkgs/applications/audio/mellowplayer/default.nix70
1 files changed, 70 insertions, 0 deletions
diff --git a/pkgs/applications/audio/mellowplayer/default.nix b/pkgs/applications/audio/mellowplayer/default.nix
new file mode 100644
index 0000000000000..c97c7cf1a2317
--- /dev/null
+++ b/pkgs/applications/audio/mellowplayer/default.nix
@@ -0,0 +1,70 @@
+{ cmake
+, fetchFromGitLab
+, lib
+, libnotify
+, mkDerivation
+, pkgconfig
+, qtbase
+, qtdeclarative
+, qtgraphicaleffects
+, qtquickcontrols2
+, qttools
+, qtwebengine
+}:
+
+mkDerivation rec {
+  pname = "MellowPlayer";
+  version = "3.6.4";
+
+  src = fetchFromGitLab {
+    owner = "ColinDuquesnoy";
+    repo = "MellowPlayer";
+    rev = version;
+    sha256 = "1ss7s3kal4vzhz7ld0yy2kvp1rk2w3i6fya0z3xd7nff9p31gqvw";
+  };
+
+  nativeBuildInputs = [ cmake pkgconfig ];
+
+  buildInputs = [
+    libnotify
+    qtbase
+    qtdeclarative
+    qtgraphicaleffects
+    qtquickcontrols2
+    qttools
+    qtwebengine
+  ];
+
+  doCheck = true;
+
+  cmakeFlags = [ "-DBUILD_TESTS=ON" ];
+
+  preCheck = ''
+    # Running the tests requires a location at the home directory for logging.
+    export HOME="$NIX_BUILD_TOP/home"
+    mkdir -p "$HOME/.local/share/MellowPlayer.Tests/MellowPlayer.Tests/Logs"
+
+    # Without this, the tests fail because they cannot create the QT Window
+    export QT_QPA_PLATFORM=offscreen
+  ''
+  # TODO: The tests are failing because it can't locate QT plugins. Is there a better way to do this?
+  + (builtins.concatStringsSep "\n" (lib.lists.flatten (builtins.map
+      (pkg: [
+        (lib.optionalString (pkg ? qtPluginPrefix) ''
+          export QT_PLUGIN_PATH="${pkg}/${pkg.qtPluginPrefix}"''${QT_PLUGIN_PATH:+':'}$QT_PLUGIN_PATH
+        '')
+
+        (lib.optionalString (pkg ? qtQmlPrefix) ''
+          export QML2_IMPORT_PATH="${pkg}/${pkg.qtQmlPrefix}"''${QML2_IMPORT_PATH:+':'}$QML2_IMPORT_PATH
+        '')
+      ]) buildInputs)));
+
+  meta = with lib; {
+    inherit (qtbase.meta) platforms;
+
+    description = "Cloud music integration for your desktop.";
+    homepage = "https://gitlab.com/ColinDuquesnoy/MellowPlayer";
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ kalbasit ];
+  };
+}