2022-04-27 09:35:20 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, pkg-config
|
2021-09-18 10:52:07 +00:00
|
|
|
, alsaSupport ? !stdenv.isDarwin, alsa-lib
|
2022-04-27 09:35:20 +00:00
|
|
|
, dbusSupport ? !stdenv.isDarwin, dbus
|
|
|
|
, pipewireSupport ? !stdenv.isDarwin, pipewire
|
2021-09-18 10:52:07 +00:00
|
|
|
, pulseSupport ? !stdenv.isDarwin, libpulseaudio
|
2020-04-24 23:36:52 +00:00
|
|
|
, CoreServices, AudioUnit, AudioToolbox
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "openal-soft";
|
2022-04-27 09:35:20 +00:00
|
|
|
version = "1.22.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "kcat";
|
|
|
|
repo = "openal-soft";
|
2021-09-18 10:52:07 +00:00
|
|
|
rev = version;
|
2022-04-27 09:35:20 +00:00
|
|
|
sha256 = "sha256-Y2KhPkwtG6tBzUhSqwV2DVnOjZwxPihidLKahjaIvyU=";
|
2020-04-24 23:36:52 +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 09:35:20 +00:00
|
|
|
substituteInPlace core/helpers.cpp \
|
2020-04-24 23:36:52 +00:00
|
|
|
--replace "@OUT@" $out
|
|
|
|
'';
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
strictDeps = true;
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
buildInputs = lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) stdenv.cc.libc
|
|
|
|
++ lib.optional alsaSupport alsa-lib
|
2022-04-27 09:35:20 +00:00
|
|
|
++ lib.optional dbusSupport dbus
|
|
|
|
++ lib.optional pipewireSupport pipewire
|
2021-09-18 10:52:07 +00:00
|
|
|
++ lib.optional pulseSupport libpulseaudio
|
|
|
|
++ lib.optionals stdenv.isDarwin [ CoreServices AudioUnit AudioToolbox ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
# Automatically links dependencies without having to rely on dlopen, thus
|
|
|
|
# removes the need for NIX_LDFLAGS.
|
|
|
|
"-DALSOFT_DLOPEN=OFF"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "OpenAL alternative";
|
|
|
|
homepage = "https://kcat.strangesoft.net/openal.html";
|
|
|
|
license = licenses.lgpl2;
|
|
|
|
maintainers = with maintainers; [ftrvxmtrx];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|