2022-09-21 01:56:07 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, removeReferencesTo
|
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";
|
2023-04-27 09:20:13 +00:00
|
|
|
version = "1.23.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;
|
2023-04-27 09:20:13 +00:00
|
|
|
sha256 = "sha256-jwY1NzNJdWIvVv7TvJyg4cIGFLWGZhL3BkMI1NbOEG0=";
|
2007-12-01 05:56:58 +00:00
|
|
|
};
|
|
|
|
|
2022-05-09 07:01:28 +00:00
|
|
|
patches = [
|
|
|
|
# this will make it find its own data files (e.g. HRTF profiles)
|
|
|
|
# without any other configuration
|
|
|
|
./search-out.patch
|
|
|
|
];
|
2019-06-21 18:14:06 +00:00
|
|
|
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-09-21 01:56:07 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config removeReferencesTo ];
|
2017-05-01 22:19:00 +00:00
|
|
|
|
2022-07-30 01:31:24 +00:00
|
|
|
buildInputs = 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"
|
2022-07-30 01:31:24 +00:00
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isLinux [
|
|
|
|
# https://github.com/NixOS/nixpkgs/issues/183774
|
|
|
|
"-DOSS_INCLUDE_DIR=${stdenv.cc.libc}/include"
|
2022-04-27 13:54:16 +00:00
|
|
|
];
|
2014-06-15 09:39:25 +00:00
|
|
|
|
2022-09-21 01:56:07 +00:00
|
|
|
postInstall = lib.optional pipewireSupport ''
|
|
|
|
remove-references-to -t ${pipewire.dev} $(readlink -f $out/lib/*.so)
|
|
|
|
'';
|
|
|
|
|
2021-08-21 15:42:07 +00:00
|
|
|
meta = with lib; {
|
2010-07-28 11:55:54 +00:00
|
|
|
description = "OpenAL alternative";
|
2022-05-09 06:52:43 +00:00
|
|
|
homepage = "https://openal-soft.org/";
|
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
|
|
|
};
|
|
|
|
}
|