mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 10:30:15 +02:00
Ensure prebuilt binaries for ARM default to v7 when using Electron
This commit is contained in:
parent
77c861b74b
commit
45653ca2e7
@ -23,6 +23,10 @@ Requires libvips v8.10.0
|
|||||||
[#2259](https://github.com/lovell/sharp/pull/2259)
|
[#2259](https://github.com/lovell/sharp/pull/2259)
|
||||||
[@vouillon](https://github.com/vouillon)
|
[@vouillon](https://github.com/vouillon)
|
||||||
|
|
||||||
|
* Ensure prebuilt binaries for ARM default to v7 when using Electron.
|
||||||
|
[#2292](https://github.com/lovell/sharp/pull/2292)
|
||||||
|
[@diegodev3](https://github.com/diegodev3)
|
||||||
|
|
||||||
## v0.25 - *yield*
|
## v0.25 - *yield*
|
||||||
|
|
||||||
Requires libvips v8.9.1
|
Requires libvips v8.9.1
|
||||||
|
@ -13,7 +13,8 @@ module.exports = function () {
|
|||||||
const platformId = [`${platform}${libc}`];
|
const platformId = [`${platform}${libc}`];
|
||||||
|
|
||||||
if (arch === 'arm') {
|
if (arch === 'arm') {
|
||||||
platformId.push(`armv${env.npm_config_arm_version || process.config.variables.arm_version || '6'}`);
|
const fallback = process.versions.electron ? '7' : '6';
|
||||||
|
platformId.push(`armv${env.npm_config_arm_version || process.config.variables.arm_version || fallback}`);
|
||||||
} else if (arch === 'arm64') {
|
} else if (arch === 'arm64') {
|
||||||
platformId.push(`arm64v${env.npm_config_arm_version || '8'}`);
|
platformId.push(`arm64v${env.npm_config_arm_version || '8'}`);
|
||||||
} else {
|
} else {
|
||||||
|
@ -55,4 +55,12 @@ describe('Platform-detection', function () {
|
|||||||
assert.strictEqual('arm64v8', platform().split('-')[1]);
|
assert.strictEqual('arm64v8', platform().split('-')[1]);
|
||||||
delete process.env.npm_config_arch;
|
delete process.env.npm_config_arch;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('Can ensure version ARMv7 if electron version is present', function () {
|
||||||
|
process.env.npm_config_arch = 'arm';
|
||||||
|
process.versions.electron = 'test';
|
||||||
|
assert.strictEqual('armv7', platform().split('-')[1]);
|
||||||
|
delete process.env.npm_config_arch;
|
||||||
|
delete process.versions.electron;
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user