buildNpmPackage: fix cross builds
This commit is contained in:
@@ -104,6 +104,16 @@ lib.extendMkDerivation {
|
||||
# Stripping takes way too long with the amount of files required by a typical Node.js project.
|
||||
dontStrip = args.dontStrip or true;
|
||||
|
||||
env = {
|
||||
npm_config_arch =
|
||||
{
|
||||
"x86_64" = "x64";
|
||||
"aarch64" = "arm64";
|
||||
}
|
||||
.${stdenv.hostPlatform.parsed.cpu.name} or stdenv.hostPlatform.parsed.cpu.name;
|
||||
npm_config_platform = stdenv.hostPlatform.parsed.kernel.name;
|
||||
} // (args.env or { });
|
||||
|
||||
meta = (args.meta or { }) // {
|
||||
platforms = args.meta.platforms or nodejs.meta.platforms;
|
||||
};
|
||||
|
||||
@@ -21,7 +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
|
||||
substituteInPlace gyp/pylib/gyp/**.py --replace-fail sys.platform '"${stdenv.targetPlatform.parsed.kernel.name}"'
|
||||
'';
|
||||
|
||||
dontNpmBuild = true;
|
||||
|
||||
Reference in New Issue
Block a user