node-gyp: fix cross builds

gyp was never designed for cross compiling. However, it works perfectly
fine if you just replace all uses of `sys.platform` with a constant.
This commit is contained in:
Audrey Dutcher
2025-03-18 13:59:55 -07:00
parent e8240407b0
commit d93bc55f85
+2
View File
@@ -1,4 +1,5 @@
{
stdenv,
buildNpmPackage,
fetchFromGitHub,
lib,
@@ -20,6 +21,7 @@
postPatch = ''
ln -s ${./package-lock.json} package-lock.json
sed -E -i -e 's/sys.platform/"${stdenv.targetPlatform.parsed.kernel.name}"/g' gyp/pylib/gyp/**.py
'';
dontNpmBuild = true;