diff --git a/pkgs/development/libraries/webrtc-audio-processing/default.nix b/pkgs/development/libraries/webrtc-audio-processing/default.nix index efd2ce3b1fcc..d757789fc268 100644 --- a/pkgs/development/libraries/webrtc-audio-processing/default.nix +++ b/pkgs/development/libraries/webrtc-audio-processing/default.nix @@ -8,6 +8,8 @@ stdenv.mkDerivation rec { sha256 = "1gsx7k77blfy171b6g3m0k0s0072v6jcawhmx1kjs9w5zlwdkzd0"; }; + patches = [ ./enable-riscv.patch ]; + buildInputs = lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ ApplicationServices ]); patchPhase = lib.optionalString stdenv.hostPlatform.isMusl '' diff --git a/pkgs/development/libraries/webrtc-audio-processing/enable-riscv.patch b/pkgs/development/libraries/webrtc-audio-processing/enable-riscv.patch new file mode 100644 index 000000000000..d61c33548a73 --- /dev/null +++ b/pkgs/development/libraries/webrtc-audio-processing/enable-riscv.patch @@ -0,0 +1,18 @@ +diff --git a/webrtc/typedefs.h b/webrtc/typedefs.h +index d875490..ce1f3e8 100644 +--- a/webrtc/typedefs.h ++++ b/webrtc/typedefs.h +@@ -26,6 +26,13 @@ + #elif defined(__aarch64__) + #define WEBRTC_ARCH_64_BITS + #define WEBRTC_ARCH_LITTLE_ENDIAN ++#elif defined(__riscv) || defined(__riscv__) ++#define WEBRTC_ARCH_LITTLE_ENDIAN ++#if __riscv_xlen == 64 ++#define WEBRTC_ARCH_64_BITS ++#else ++#define WEBRTC_ARCH_32_BITS ++#endif + #elif defined(_M_IX86) || defined(__i386__) + #define WEBRTC_ARCH_X86_FAMILY + #define WEBRTC_ARCH_X86