nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib, stdenv, fetchFromGitHub, cmake, pkg-config
2, alsaSupport ? !stdenv.isDarwin, alsa-lib
3, dbusSupport ? !stdenv.isDarwin, dbus
4, pipewireSupport ? !stdenv.isDarwin, pipewire
5, pulseSupport ? !stdenv.isDarwin, libpulseaudio
6, CoreServices, AudioUnit, AudioToolbox
7}:
8
9stdenv.mkDerivation rec {
10 pname = "openal-soft";
11 version = "1.22.0";
12
13 src = fetchFromGitHub {
14 owner = "kcat";
15 repo = "openal-soft";
16 rev = version;
17 sha256 = "sha256-Y2KhPkwtG6tBzUhSqwV2DVnOjZwxPihidLKahjaIvyU=";
18 };
19
20 # this will make it find its own data files (e.g. HRTF profiles)
21 # without any other configuration
22 patches = [ ./search-out.patch ];
23 postPatch = ''
24 substituteInPlace core/helpers.cpp \
25 --replace "@OUT@" $out
26 '';
27
28 strictDeps = true;
29
30 nativeBuildInputs = [ cmake pkg-config ];
31
32 buildInputs = lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) stdenv.cc.libc
33 ++ lib.optional alsaSupport alsa-lib
34 ++ lib.optional dbusSupport dbus
35 ++ lib.optional pipewireSupport pipewire
36 ++ lib.optional pulseSupport libpulseaudio
37 ++ lib.optionals stdenv.isDarwin [ CoreServices AudioUnit AudioToolbox ];
38
39 cmakeFlags = [
40 # Automatically links dependencies without having to rely on dlopen, thus
41 # removes the need for NIX_LDFLAGS.
42 "-DALSOFT_DLOPEN=OFF"
43 ];
44
45 meta = with lib; {
46 description = "OpenAL alternative";
47 homepage = "https://kcat.strangesoft.net/openal.html";
48 license = licenses.lgpl2;
49 maintainers = with maintainers; [ftrvxmtrx];
50 platforms = platforms.unix;
51 };
52}