2018-10-21 22:38:49 -07:00
|
|
|
{ stdenv, fetchFromGitHub, cmake
|
2016-02-29 10:47:12 -08:00
|
|
|
, alsaSupport ? !stdenv.isDarwin, alsaLib ? null
|
|
|
|
, pulseSupport ? !stdenv.isDarwin, libpulseaudio ? null
|
|
|
|
, CoreServices, AudioUnit, AudioToolbox
|
2014-06-15 02:39:25 -07:00
|
|
|
}:
|
2010-07-28 04:55:54 -07:00
|
|
|
|
2015-02-20 15:43:40 -08:00
|
|
|
with stdenv.lib;
|
|
|
|
|
2014-06-15 02:39:25 -07:00
|
|
|
assert alsaSupport -> alsaLib != null;
|
2015-05-27 12:42:15 -07:00
|
|
|
assert pulseSupport -> libpulseaudio != null;
|
2007-11-30 21:56:58 -08:00
|
|
|
|
2014-06-15 02:39:25 -07:00
|
|
|
stdenv.mkDerivation rec {
|
2018-10-21 22:38:49 -07:00
|
|
|
version = "1.19.1";
|
2019-08-15 05:41:18 -07:00
|
|
|
pname = "openal-soft";
|
2007-11-30 21:56:58 -08:00
|
|
|
|
2018-10-21 22:38:49 -07:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "kcat";
|
|
|
|
repo = "openal-soft";
|
2019-08-15 05:41:18 -07:00
|
|
|
rev = "${pname}-${version}";
|
2018-10-21 22:38:49 -07:00
|
|
|
sha256 = "0b0g0q1c36nfb289xcaaj3cmyfpiswvvgky3qyalsf9n4dj7vnzi";
|
2007-11-30 21:56:58 -08:00
|
|
|
};
|
|
|
|
|
2019-06-21 11:14:06 -07:00
|
|
|
# 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
|
|
|
|
'';
|
|
|
|
|
2017-05-01 15:19:00 -07:00
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
|
|
|
buildInputs = []
|
2015-02-20 15:43:40 -08:00
|
|
|
++ optional alsaSupport alsaLib
|
2016-02-29 10:47:12 -08:00
|
|
|
++ optional pulseSupport libpulseaudio
|
2016-10-01 13:38:06 -07:00
|
|
|
++ optionals stdenv.isDarwin [ CoreServices AudioUnit AudioToolbox ];
|
2014-06-15 02:39:25 -07:00
|
|
|
|
2019-10-29 16:53:51 -07:00
|
|
|
NIX_LDFLAGS = toString ([]
|
2015-02-20 15:43:40 -08:00
|
|
|
++ optional alsaSupport "-lasound"
|
2019-10-29 16:53:51 -07:00
|
|
|
++ optional pulseSupport "-lpulse");
|
2014-06-15 02:39:25 -07:00
|
|
|
|
2007-11-30 21:56:58 -08:00
|
|
|
meta = {
|
2010-07-28 04:55:54 -07:00
|
|
|
description = "OpenAL alternative";
|
2020-03-31 18:11:51 -07:00
|
|
|
homepage = "https://kcat.strangesoft.net/openal.html";
|
2015-02-20 15:43:40 -08:00
|
|
|
license = licenses.lgpl2;
|
|
|
|
maintainers = with maintainers; [ftrvxmtrx];
|
2016-02-29 10:47:12 -08:00
|
|
|
platforms = platforms.unix;
|
2007-11-30 21:56:58 -08:00
|
|
|
};
|
|
|
|
}
|