Skip to content

Commit

Permalink
asha-pipewire-sink: init at 0-unstable-2024-10-22
Browse files Browse the repository at this point in the history
  • Loading branch information
onny committed Dec 26, 2024
1 parent 1557114 commit 77a3165
Showing 1 changed file with 81 additions and 0 deletions.
81 changes: 81 additions & 0 deletions pkgs/by-name/as/asha-pipewire-sink/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{
cmake,
stdenv,
fetchFromGitHub,
lib,
libnotify,
mkDerivation,
pkg-config,
qtbase,
qtdeclarative,
qtgraphicaleffects,
qtquickcontrols2,
qttools,
qtwebengine,
}:

stdenv.mkDerivation rec {
pname = "asha-pipewire-sink";
version = "0-unstable-2024-10-22";

src = fetchFromGitHub {
owner = "thewierdnut";
repo = "asha_pipewire_sink";
rev = "bbf665b9a3b90fcdbaeb092799ea3c5ba4347e31";
hash = "";
};

nativeBuildInputs = [
cmake
pkg-config
];

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;
broken = stdenv.hostPlatform.isDarwin; # test build fails, but the project is not maintained anymore

description = "Cloud music integration for your desktop";
mainProgram = "MellowPlayer";
homepage = "https://gitlab.com/ColinDuquesnoy/MellowPlayer";
license = licenses.gpl2;
maintainers = with maintainers; [ kalbasit ];
};
}

0 comments on commit 77a3165

Please sign in to comment.