2021-01-21 17:00:13 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake
|
2021-08-21 15:42:07 +00:00
|
|
|
, alsaSupport ? !stdenv.isDarwin, alsa-lib
|
|
|
|
, pulseSupport ? !stdenv.isDarwin, libpulseaudio
|
2016-02-29 18:47:12 +00:00
|
|
|
, CoreServices, AudioUnit, AudioToolbox
|
2014-06-15 09:39:25 +00:00
|
|
|
}:
|
2010-07-28 11:55:54 +00:00
|
|
|
|
2014-06-15 09:39:25 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "openal-soft";
|
2021-08-21 15:42:07 +00:00
|
|
|
version = "1.21.1";
|
2007-12-01 05:56:58 +00:00
|
|
|
|
2018-10-22 05:38:49 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "kcat";
|
|
|
|
repo = "openal-soft";
|
2021-08-21 15:00:51 +00:00
|
|
|
rev = version;
|
|
|
|
sha256 = "sha256-rgc6kjXaZb6sCR+e9Gu7BEEHIiCHMygpLIeSqgWkuAg=";
|
2007-12-01 05:56:58 +00:00
|
|
|
};
|
|
|
|
|
2019-06-21 18:14:06 +00:00
|
|
|
# this will make it find its own data files (e.g. HRTF profiles)
|
|
|
|
# without any other configuration
|
|
|
|
patches = [ ./search-out.patch ];
|
|
|
|
postPatch = ''
|
2021-08-21 15:00:51 +00:00
|
|
|
substituteInPlace alc/helpers.cpp \
|
2019-06-21 18:14:06 +00:00
|
|
|
--replace "@OUT@" $out
|
|
|
|
'';
|
|
|
|
|
2021-11-17 07:53:45 +00:00
|
|
|
strictDeps = true;
|
|
|
|
|
2017-05-01 22:19:00 +00:00
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
2021-11-17 07:53:45 +00:00
|
|
|
buildInputs = lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) stdenv.cc.libc
|
|
|
|
++ lib.optional alsaSupport alsa-lib
|
2021-08-21 15:42:07 +00:00
|
|
|
++ lib.optional pulseSupport libpulseaudio
|
|
|
|
++ lib.optionals stdenv.isDarwin [ CoreServices AudioUnit AudioToolbox ];
|
2014-06-15 09:39:25 +00:00
|
|
|
|
2021-08-21 15:42:07 +00:00
|
|
|
NIX_LDFLAGS = toString (
|
|
|
|
lib.optional alsaSupport "-lasound"
|
|
|
|
++ lib.optional pulseSupport "-lpulse");
|
2014-06-15 09:39:25 +00:00
|
|
|
|
2021-08-21 15:42:07 +00:00
|
|
|
meta = with lib; {
|
2010-07-28 11:55:54 +00:00
|
|
|
description = "OpenAL alternative";
|
2020-04-01 01:11:51 +00:00
|
|
|
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;
|
2007-12-01 05:56:58 +00:00
|
|
|
};
|
|
|
|
}
|