mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 10:30:15 +02:00
Upgrade to libvips v8.9.0-alpha2 prebuild
Improve tests for 32-bit ARM
This commit is contained in:
parent
258c9e86eb
commit
14dc7681ed
@ -193,6 +193,11 @@
|
||||
'-Wno-cast-function-type'
|
||||
]
|
||||
}],
|
||||
['target_arch == "arm"', {
|
||||
'cflags_cc': [
|
||||
'-Wno-psabi'
|
||||
]
|
||||
}],
|
||||
['OS == "win"', {
|
||||
'msvs_settings': {
|
||||
'VCCLCompilerTool': {
|
||||
|
@ -14,6 +14,12 @@ const agent = require('../lib/agent');
|
||||
const libvips = require('../lib/libvips');
|
||||
const platform = require('../lib/platform');
|
||||
|
||||
const minimumGlibcVersionByArch = {
|
||||
arm: '2.28',
|
||||
arm64: '2.29',
|
||||
x64: '2.17'
|
||||
};
|
||||
|
||||
const { minimumLibvipsVersion, minimumLibvipsVersionLabelled } = libvips;
|
||||
const distBaseUrl = process.env.npm_config_sharp_dist_base_url || process.env.SHARP_DIST_BASE_URL || `https://github.com/lovell/sharp-libvips/releases/download/v${minimumLibvipsVersionLabelled}/`;
|
||||
|
||||
@ -64,8 +70,7 @@ try {
|
||||
throw new Error(`BSD/SunOS systems require manual installation of libvips >= ${minimumLibvipsVersion}`);
|
||||
}
|
||||
if (detectLibc.family === detectLibc.GLIBC && detectLibc.version) {
|
||||
const minimumGlibcVersion = arch === 'arm64' ? '2.29.0' : '2.17.0';
|
||||
if (semver.lt(`${detectLibc.version}.0`, minimumGlibcVersion)) {
|
||||
if (semver.lt(`${detectLibc.version}.0`, `${minimumGlibcVersionByArch[arch]}.0`)) {
|
||||
throw new Error(`Use with glibc ${detectLibc.version} requires manual installation of libvips >= ${minimumLibvipsVersion}`);
|
||||
}
|
||||
}
|
||||
|
@ -118,15 +118,15 @@
|
||||
"tunnel-agent": "^0.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"async": "^3.1.1",
|
||||
"async": "^3.2.0",
|
||||
"cc": "^2.0.1",
|
||||
"decompress-zip": "^0.3.2",
|
||||
"documentation": "^12.1.4",
|
||||
"exif-reader": "^1.0.3",
|
||||
"icc": "^1.0.0",
|
||||
"license-checker": "^25.0.1",
|
||||
"mocha": "^7.0.1",
|
||||
"mock-fs": "^4.10.4",
|
||||
"mocha": "^7.1.0",
|
||||
"mock-fs": "^4.11.0",
|
||||
"nyc": "^15.0.0",
|
||||
"prebuild": "^10.0.0",
|
||||
"prebuild-ci": "^3.1.0",
|
||||
@ -135,7 +135,7 @@
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"config": {
|
||||
"libvips": "8.9.1-alpha1"
|
||||
"libvips": "8.9.1-alpha2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10.16.0"
|
||||
|
BIN
test/fixtures/expected/blur-0.3.jpg
vendored
BIN
test/fixtures/expected/blur-0.3.jpg
vendored
Binary file not shown.
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 14 KiB |
@ -5,7 +5,10 @@ const sharp = require('../../');
|
||||
|
||||
const usingCache = detectLibc.family !== detectLibc.MUSL;
|
||||
const usingSimd = !process.env.G_DEBUG;
|
||||
const concurrency = detectLibc.family === detectLibc.MUSL ? 1 : undefined;
|
||||
const concurrency =
|
||||
detectLibc.family === detectLibc.MUSL || process.arch === 'arm'
|
||||
? 1
|
||||
: undefined;
|
||||
|
||||
beforeEach(function () {
|
||||
sharp.cache(usingCache);
|
||||
|
@ -43,7 +43,10 @@ describe('Platform-detection', function () {
|
||||
|
||||
it('Defaults to ARMv6 for 32-bit', function () {
|
||||
process.env.npm_config_arch = 'arm';
|
||||
const armVersion = process.config.variables.arm_version;
|
||||
delete process.config.variables.arm_version;
|
||||
assert.strictEqual('armv6', platform().split('-')[1]);
|
||||
process.config.variables.arm_version = armVersion;
|
||||
delete process.env.npm_config_arch;
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user