NUR/pkgs/soundux/default.nix

75 lines
1.9 KiB
Nix
Raw Permalink Normal View History

2021-07-08 02:17:15 +02:00
{
2021-08-10 20:37:22 +02:00
lib, stdenv, fetchFromGitHub, cmake, ninja, pkg-config, makeWrapper, wrapGAppsHook, makeDesktopItem, copyDesktopItems,
2021-07-08 02:17:15 +02:00
libappindicator-gtk3, openssl, pipewire, pulseaudio, webkitgtk, xorg,
libpulseaudio, libwnck3,
downloaderSupport ? true, ffmpeg, youtube-dl
}:
let
downloaderPath = lib.makeBinPath [ffmpeg youtube-dl ];
in
stdenv.mkDerivation rec {
pname = "soundux";
version = "0.2.7";
src = fetchFromGitHub {
owner = "Soundux";
repo = "Soundux";
rev = "0.2.7";
fetchSubmodules = true;
sha256 = "15kd9vl7inn8zm5cqzjkb6zb9xk2xxwpkm7fx1za3dy9m61sq839";
};
cmakeFlags = [ "-DCMAKE_BUILD_TYPE=Release" ];
dontWrapGApps = true;
installPhase = ''
2021-08-10 22:52:13 +02:00
runHook preInstall
2021-07-08 02:17:15 +02:00
mkdir -p $out/opt $out/bin
cp -r dist soundux-${version} $out/opt
2021-08-10 22:52:13 +02:00
runHook postInstall
2021-07-08 02:17:15 +02:00
'';
# Soundux loads pipewire, pulse and libwnck optionally during runtime
postFixup = ''
makeWrapper $out/opt/soundux-${version} $out/bin/soundux \
--prefix LD_LIBRARY_PATH ":" ${lib.makeLibraryPath [libpulseaudio pipewire libwnck3 ]} \
"''${gappsWrapperArgs[@]}" \
${lib.optionalString downloaderSupport "--prefix PATH \":\" " + downloaderPath}
'';
2021-08-10 20:37:22 +02:00
nativeBuildInputs = [ cmake ninja pkg-config makeWrapper wrapGAppsHook copyDesktopItems ];
2021-07-08 02:17:15 +02:00
buildInputs = [
libappindicator-gtk3
openssl
pipewire
pulseaudio
webkitgtk
xorg.libX11
xorg.libXtst
];
2021-08-10 20:37:22 +02:00
desktopItems = makeDesktopItem {
name = "Soundux";
exec = pname;
desktopName = "Soundux";
genericName = "Soundboard";
categories = "Audio;Music;Player;AudioVideo;";
comment = "A universal soundboard that uses PulseAudio modules or PipeWire linking";
};
2021-07-08 02:17:15 +02:00
meta = with lib; {
homepage = "https://soundux.rocks/";
description = "cross-platform soundboard";
license = licenses.gpl3Only;
platforms = platforms.linux;
maintainers = with maintainers; [ dandellion ];
};
}