From 03e575b0bb7d57cb31cc7346e3d2964d2e1f38aa Mon Sep 17 00:00:00 2001 From: lucasew Date: Tue, 29 Aug 2023 20:16:01 -0300 Subject: [PATCH] pulseaudio-module-xrdp: init at 0.7 Signed-off-by: lucasew --- .../xrdp/pulseaudio-module-xrdp/default.nix | 64 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 66 insertions(+) create mode 100644 pkgs/applications/networking/remote/xrdp/pulseaudio-module-xrdp/default.nix diff --git a/pkgs/applications/networking/remote/xrdp/pulseaudio-module-xrdp/default.nix b/pkgs/applications/networking/remote/xrdp/pulseaudio-module-xrdp/default.nix new file mode 100644 index 000000000000..86dc913b91e3 --- /dev/null +++ b/pkgs/applications/networking/remote/xrdp/pulseaudio-module-xrdp/default.nix @@ -0,0 +1,64 @@ +{ stdenv +, fetchFromGitHub +, lib +, nix-update-script +, pulseaudio +, autoreconfHook +, pkg-config +, nixosTests +}: + +stdenv.mkDerivation rec { + pname = "pulseaudio-module-xrdp"; + version = "0.7"; + + src = fetchFromGitHub { + owner = "neutrinolabs"; + repo = pname; + rev = "v${version}"; + hash = "sha256-GT0kBfq6KvuiX30B9JzCiUxgSm9E6IhdJuQKKKprDCE="; + }; + + preConfigure = '' + tar -xvf ${pulseaudio.src} + mv pulseaudio-* pulseaudio-src + chmod +w -Rv pulseaudio-src + cp ${pulseaudio.dev}/include/pulse/config.h pulseaudio-src + configureFlags="$configureFlags PULSE_DIR=$(realpath ./pulseaudio-src)" + ''; + + installPhase = '' + runHook preInstall + + mkdir -p $out/lib/pulseaudio/modules $out/libexec/pulsaudio-xrdp-module $out/etc/xdg/autostart + install -m 755 src/.libs/*${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/pulseaudio/modules + + install -m 755 instfiles/load_pa_modules.sh $out/libexec/pulsaudio-xrdp-module/pulseaudio_xrdp_init + substituteInPlace $out/libexec/pulsaudio-xrdp-module/pulseaudio_xrdp_init \ + --replace pactl ${pulseaudio}/bin/pactl + + runHook postInstall + ''; + + nativeBuildInputs = [ + autoreconfHook + pkg-config + pulseaudio.dev + ]; + + passthru = { + updateScript = nix-update-script { }; + tests = { + inherit (nixosTests) xrdp-with-audio-pulseaudio; + }; + }; + + meta = with lib; { + description = "xrdp sink/source pulseaudio modules"; + homepage = "https://github.com/neutrinolabs/pulseaudio-module-xrdp"; + license = licenses.lgpl21; + maintainers = with maintainers; [ lucasew ]; + platforms = platforms.linux; + sourceProvenance = [ sourceTypes.fromSource ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1d71b01523b2..1a5b304aa013 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -32007,6 +32007,8 @@ with pkgs; xrdp = callPackage ../applications/networking/remote/xrdp { }; + pulseaudio-module-xrdp = callPackage ../applications/networking/remote/xrdp/pulseaudio-module-xrdp { }; + freerdp = callPackage ../applications/networking/remote/freerdp { inherit (darwin.apple_sdk.frameworks) AudioToolbox AVFoundation Carbon Cocoa CoreMedia; inherit (gst_all_1) gstreamer gst-plugins-base gst-plugins-good;