2020-10-02 20:39:15 +01:00
|
|
|
{ stdenv, lib, config, fetchFromGitHub, cmake, pkg-config
|
2021-06-10 03:57:09 +01:00
|
|
|
, alsaSupport ? stdenv.isLinux, alsa-lib
|
2020-10-02 20:39:15 +01:00
|
|
|
, pulseSupport ? config.pulseaudio or stdenv.isLinux, libpulseaudio
|
2021-06-28 17:33:41 +01:00
|
|
|
, jackSupport ? false, libjack2
|
2020-10-02 20:39:15 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "scream";
|
2021-08-17 23:30:46 +01:00
|
|
|
version = "3.8";
|
2020-10-02 20:39:15 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "duncanthrax";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2021-08-17 23:30:46 +01:00
|
|
|
sha256 = "sha256-7UzwEoZujTN8i056Wf+0QtjyU+/UZlqcSompiAGHT54=";
|
2020-10-02 20:39:15 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = lib.optional pulseSupport libpulseaudio
|
2021-06-28 17:33:41 +01:00
|
|
|
++ lib.optional jackSupport libjack2
|
2021-06-10 03:57:09 +01:00
|
|
|
++ lib.optional alsaSupport alsa-lib;
|
2020-10-02 20:39:15 +01:00
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DPULSEAUDIO_ENABLE=${if pulseSupport then "ON" else "OFF"}"
|
|
|
|
"-DALSA_ENABLE=${if alsaSupport then "ON" else "OFF"}"
|
2021-06-28 17:33:41 +01:00
|
|
|
"-DJACK_ENABLE=${if jackSupport then "ON" else "OFF"}"
|
2020-10-02 20:39:15 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
cmakeDir = "../Receivers/unix";
|
|
|
|
|
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckPhase = ''
|
|
|
|
set +o pipefail
|
|
|
|
|
|
|
|
# Programs exit with code 1 when testing help, so grep for a string
|
|
|
|
$out/bin/scream -h 2>&1 | grep -q Usage:
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Audio receiver for the Scream virtual network sound card";
|
|
|
|
homepage = "https://github.com/duncanthrax/scream";
|
|
|
|
license = licenses.mspl;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ arcnmx ];
|
|
|
|
};
|
|
|
|
}
|