From 52fcb875299710089eaed0752e00f6567a59ca8d Mon Sep 17 00:00:00 2001 From: Ivan Kozik Date: Wed, 7 Aug 2019 05:28:29 +0000 Subject: [PATCH] scream-receivers: init at 3.3 --- pkgs/misc/scream-receivers/default.nix | 56 ++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 4 ++ 2 files changed, 60 insertions(+) create mode 100644 pkgs/misc/scream-receivers/default.nix diff --git a/pkgs/misc/scream-receivers/default.nix b/pkgs/misc/scream-receivers/default.nix new file mode 100644 index 000000000000..aa88bd8a96c8 --- /dev/null +++ b/pkgs/misc/scream-receivers/default.nix @@ -0,0 +1,56 @@ +{ stdenv, lib, fetchFromGitHub, alsaLib +, pulseSupport ? false, libpulseaudio ? null +}: + +stdenv.mkDerivation rec { + pname = "scream-receivers"; + version = "3.3"; + + src = fetchFromGitHub { + owner = "duncanthrax"; + repo = "scream"; + rev = "${version}"; + sha256 = "1iqhs7m0fv3vfld7h288j5j0jc5xdihaghd0jd9qrk68mj2g6g9w"; + }; + + buildInputs = [ alsaLib ] ++ lib.optional pulseSupport libpulseaudio; + + buildPhase = '' + (cd Receivers/alsa && make) + (cd Receivers/alsa-ivshmem && make) + '' + lib.optionalString pulseSupport '' + (cd Receivers/pulseaudio && make) + (cd Receivers/pulseaudio-ivshmem && make) + ''; + + installPhase = '' + mkdir -p $out/bin + mv ./Receivers/alsa/scream-alsa $out/bin/ + mv ./Receivers/alsa-ivshmem/scream-ivshmem-alsa $out/bin/ + '' + lib.optionalString pulseSupport '' + mv ./Receivers/pulseaudio/scream-pulse $out/bin/ + mv ./Receivers/pulseaudio-ivshmem/scream-ivshmem-pulse $out/bin/ + ''; + + doInstallCheck = true; + installCheckPhase = '' + export PATH=$PATH:$out/bin + set -o verbose + set +o pipefail + + # Programs exit with code 1 when testing help, so grep for a string + scream-alsa -h 2>&1 | grep -q Usage: + scream-ivshmem-alsa 2>&1 | grep -q Usage: + '' + lib.optionalString pulseSupport '' + scream-pulse -h 2>&1 | grep -q Usage: + scream-ivshmem-pulse 2>&1 | grep -q Usage: + ''; + + meta = with lib; { + description = "Audio receivers for the Scream virtual network sound card"; + homepage = "https://github.com/duncanthrax/scream"; + license = licenses.mspl; + platforms = platforms.linux; + maintainers = [ maintainers.ivan ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index bf998cfd4eca..be9497ba3a5f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5881,6 +5881,10 @@ in scdoc = callPackage ../tools/typesetting/scdoc { }; + scream-receivers = callPackage ../misc/scream-receivers { + pulseSupport = config.pulseaudio or false; + }; + screen = callPackage ../tools/misc/screen { inherit (darwin.apple_sdk.libs) utmp; };