nixpkgs/pkgs/development/libraries/openal-soft/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

61 lines
1.7 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, removeReferencesTo
, alsaSupport ? !stdenv.isDarwin, alsa-lib
2022-04-27 13:54:16 +00:00
, dbusSupport ? !stdenv.isDarwin, dbus
, pipewireSupport ? !stdenv.isDarwin, pipewire
, pulseSupport ? !stdenv.isDarwin, libpulseaudio
2016-02-29 18:47:12 +00:00
, CoreServices, AudioUnit, AudioToolbox
}:
stdenv.mkDerivation rec {
pname = "openal-soft";
2022-07-26 08:01:36 +00:00
version = "1.22.2";
src = fetchFromGitHub {
owner = "kcat";
repo = "openal-soft";
2021-08-21 15:00:51 +00:00
rev = version;
2022-07-26 08:01:36 +00:00
sha256 = "sha256-MVM0qCZDWcO7/Hnco+0dBqzBLcWD279xjx0slxxlc4w=";
};
patches = [
# this will make it find its own data files (e.g. HRTF profiles)
# without any other configuration
./search-out.patch
];
postPatch = ''
2022-04-27 13:54:16 +00:00
substituteInPlace core/helpers.cpp \
--replace "@OUT@" $out
'';
strictDeps = true;
nativeBuildInputs = [ cmake pkg-config removeReferencesTo ];
buildInputs = lib.optional alsaSupport alsa-lib
2022-04-27 13:54:16 +00:00
++ lib.optional dbusSupport dbus
++ lib.optional pipewireSupport pipewire
++ lib.optional pulseSupport libpulseaudio
++ lib.optionals stdenv.isDarwin [ CoreServices AudioUnit AudioToolbox ];
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"
] ++ 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
];
postInstall = lib.optional pipewireSupport ''
remove-references-to -t ${pipewire.dev} $(readlink -f $out/lib/*.so)
'';
meta = with lib; {
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;
};
}