openalSoft: 1.21.1 -> 1.22.0

This commit is contained in:
Mihai Fufezan 2022-04-27 16:54:16 +03:00
parent 8e9dc9e619
commit 8410b41acb
No known key found for this signature in database
GPG key ID: 5899325F2F120900
2 changed files with 16 additions and 10 deletions

View file

@ -1,40 +1,46 @@
{ lib, stdenv, fetchFromGitHub, cmake { lib, stdenv, fetchFromGitHub, cmake, pkg-config
, alsaSupport ? !stdenv.isDarwin, alsa-lib , alsaSupport ? !stdenv.isDarwin, alsa-lib
, dbusSupport ? !stdenv.isDarwin, dbus
, pipewireSupport ? !stdenv.isDarwin, pipewire
, pulseSupport ? !stdenv.isDarwin, libpulseaudio , pulseSupport ? !stdenv.isDarwin, libpulseaudio
, CoreServices, AudioUnit, AudioToolbox , CoreServices, AudioUnit, AudioToolbox
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "openal-soft"; pname = "openal-soft";
version = "1.21.1"; version = "1.22.0";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "kcat"; owner = "kcat";
repo = "openal-soft"; repo = "openal-soft";
rev = version; rev = version;
sha256 = "sha256-rgc6kjXaZb6sCR+e9Gu7BEEHIiCHMygpLIeSqgWkuAg="; sha256 = "sha256-Y2KhPkwtG6tBzUhSqwV2DVnOjZwxPihidLKahjaIvyU=";
}; };
# this will make it find its own data files (e.g. HRTF profiles) # this will make it find its own data files (e.g. HRTF profiles)
# without any other configuration # without any other configuration
patches = [ ./search-out.patch ]; patches = [ ./search-out.patch ];
postPatch = '' postPatch = ''
substituteInPlace alc/helpers.cpp \ substituteInPlace core/helpers.cpp \
--replace "@OUT@" $out --replace "@OUT@" $out
''; '';
strictDeps = true; strictDeps = true;
nativeBuildInputs = [ cmake ]; nativeBuildInputs = [ cmake pkg-config ];
buildInputs = lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) stdenv.cc.libc buildInputs = lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) stdenv.cc.libc
++ lib.optional alsaSupport alsa-lib ++ lib.optional alsaSupport alsa-lib
++ lib.optional dbusSupport dbus
++ lib.optional pipewireSupport pipewire
++ lib.optional pulseSupport libpulseaudio ++ lib.optional pulseSupport libpulseaudio
++ lib.optionals stdenv.isDarwin [ CoreServices AudioUnit AudioToolbox ]; ++ lib.optionals stdenv.isDarwin [ CoreServices AudioUnit AudioToolbox ];
NIX_LDFLAGS = toString ( cmakeFlags = [
lib.optional alsaSupport "-lasound" # Automatically links dependencies without having to rely on dlopen, thus
++ lib.optional pulseSupport "-lpulse"); # removes the need for NIX_LDFLAGS.
"-DALSOFT_DLOPEN=OFF"
];
meta = with lib; { meta = with lib; {
description = "OpenAL alternative"; description = "OpenAL alternative";

View file

@ -1,7 +1,7 @@
diff --git a/alc/helpers.cpp b/alc/helpers.cpp diff --git a/alc/helpers.cpp b/alc/helpers.cpp
index 8c1c856..19bbc0f 100644 index 8c1c856..19bbc0f 100644
--- a/alc/helpers.cpp --- a/core/helpers.cpp
+++ b/alc/helpers.cpp +++ b/core/helpers.cpp
@@ -402,6 +402,7 @@ al::vector<std::string> SearchDataFiles(const char *ext, const char *subdir) @@ -402,6 +402,7 @@ al::vector<std::string> SearchDataFiles(const char *ext, const char *subdir)
DirectorySearch(path.c_str(), ext, &results); DirectorySearch(path.c_str(), ext, &results);