2022-04-27 13:54:16 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, pkg-config
|
2021-08-21 15:42:07 +00:00
|
|
|
, alsaSupport ? !stdenv.isDarwin, alsa-lib
|
2022-04-27 13:54:16 +00:00
|
|
|
, dbusSupport ? !stdenv.isDarwin, dbus
|
|
|
|
, pipewireSupport ? !stdenv.isDarwin, pipewire
|
2021-08-21 15:42:07 +00:00
|
|
|
, 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";
|
2022-04-27 13:54:16 +00:00
|
|
|
version = "1.22.0";
|
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;
|
2022-04-27 13:54:16 +00:00
|
|
|
sha256 = "sha256-Y2KhPkwtG6tBzUhSqwV2DVnOjZwxPihidLKahjaIvyU=";
|
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 = ''
|
2022-04-27 13:54:16 +00:00
|
|
|
substituteInPlace core/helpers.cpp \
|
2019-06-21 18:14:06 +00:00
|
|
|
--replace "@OUT@" $out
|
|
|
|
'';
|
|
|
|
|
2021-11-17 07:53:45 +00:00
|
|
|
strictDeps = true;
|
|
|
|
|
2022-04-27 13:54:16 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
2017-05-01 22:19:00 +00:00
|
|
|
|
2021-11-17 07:53:45 +00:00
|
|
|
buildInputs = lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) stdenv.cc.libc
|
|
|
|
++ lib.optional alsaSupport alsa-lib
|
2022-04-27 13:54:16 +00:00
|
|
|
++ lib.optional dbusSupport dbus
|
|
|
|
++ lib.optional pipewireSupport pipewire
|
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
|
|
|
|
2022-04-27 13:54:16 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
# Automatically links dependencies without having to rely on dlopen, thus
|
|
|
|
# removes the need for NIX_LDFLAGS.
|
|
|
|
"-DALSOFT_DLOPEN=OFF"
|
|
|
|
];
|
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
|
|
|
};
|
|
|
|
}
|