From 1faa66a86e3904531a3c3eb274e1e500fa1a3111 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 19 Jan 2025 17:44:05 +0100 Subject: [PATCH] python313Packages.webrtc-noise-gain: fix cross builds Closes: #375092 --- .../python-modules/webrtc-noise-gain/default.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/development/python-modules/webrtc-noise-gain/default.nix b/pkgs/development/python-modules/webrtc-noise-gain/default.nix index adf82573edd9..c258cc774af1 100644 --- a/pkgs/development/python-modules/webrtc-noise-gain/default.nix +++ b/pkgs/development/python-modules/webrtc-noise-gain/default.nix @@ -28,6 +28,16 @@ buildPythonPackage rec { hash = "sha256-GbdG2XM11zgPk2VZ0mu7qMv256jaMyJDHdBCBUnynMY="; }; + postPatch = with stdenv.hostPlatform.uname; '' + # Configure the correct host platform for cross builds + substituteInPlace setup.py --replace-fail \ + "system = platform.system().lower()" \ + 'system = "${lib.toLower system}"' + substituteInPlace setup.py --replace-fail \ + "machine = platform.machine().lower()" \ + 'machine = "${lib.toLower processor}"' + ''; + nativeBuildInputs = [ pybind11 setuptools