nixpkgs/pkgs/development/libraries/openal-soft/default.nix

50 lines
1.3 KiB
Nix
Raw Normal View History

{ stdenv, fetchFromGitHub, cmake
2016-02-29 18:47:12 +00:00
, alsaSupport ? !stdenv.isDarwin, alsaLib ? null
, pulseSupport ? !stdenv.isDarwin, libpulseaudio ? null
, CoreServices, AudioUnit, AudioToolbox
}:
2015-02-20 23:43:40 +00:00
with stdenv.lib;
assert alsaSupport -> alsaLib != null;
assert pulseSupport -> libpulseaudio != null;
stdenv.mkDerivation rec {
version = "1.19.1";
pname = "openal-soft";
src = fetchFromGitHub {
owner = "kcat";
repo = "openal-soft";
rev = "${pname}-${version}";
sha256 = "0b0g0q1c36nfb289xcaaj3cmyfpiswvvgky3qyalsf9n4dj7vnzi";
};
# this will make it find its own data files (e.g. HRTF profiles)
# without any other configuration
patches = [ ./search-out.patch ];
postPatch = ''
substituteInPlace Alc/helpers.c \
--replace "@OUT@" $out
'';
nativeBuildInputs = [ cmake ];
buildInputs = []
2015-02-20 23:43:40 +00:00
++ optional alsaSupport alsaLib
2016-02-29 18:47:12 +00:00
++ optional pulseSupport libpulseaudio
++ optionals stdenv.isDarwin [ CoreServices AudioUnit AudioToolbox ];
2019-10-29 23:53:51 +00:00
NIX_LDFLAGS = toString ([]
2015-02-20 23:43:40 +00:00
++ optional alsaSupport "-lasound"
2019-10-29 23:53:51 +00:00
++ optional pulseSupport "-lpulse");
meta = {
description = "OpenAL alternative";
homepage = "https://kcat.strangesoft.net/openal.html";
2015-02-20 23:43:40 +00:00
license = licenses.lgpl2;
maintainers = with maintainers; [ftrvxmtrx];
2016-02-29 18:47:12 +00:00
platforms = platforms.unix;
};
}