mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 10:30:15 +02:00
Install: coerce libc version to semver (refactor)
This commit is contained in:
parent
4d7957a043
commit
90abd927c9
@ -140,17 +140,19 @@ try {
|
|||||||
throw new Error(`BSD/SunOS systems require manual installation of libvips >= ${minimumLibvipsVersion}`);
|
throw new Error(`BSD/SunOS systems require manual installation of libvips >= ${minimumLibvipsVersion}`);
|
||||||
}
|
}
|
||||||
// Linux libc version check
|
// Linux libc version check
|
||||||
const libcFamily = detectLibc.familySync();
|
|
||||||
const libcVersionRaw = detectLibc.versionSync();
|
const libcVersionRaw = detectLibc.versionSync();
|
||||||
const libcVersion = semverCoerce(libcVersionRaw).version;
|
if (libcVersionRaw) {
|
||||||
if (libcFamily === detectLibc.GLIBC && libcVersion && minimumGlibcVersionByArch[arch]) {
|
const libcFamily = detectLibc.familySync();
|
||||||
if (semverLessThan(libcVersion, semverCoerce(minimumGlibcVersionByArch[arch]).version)) {
|
const libcVersion = semverCoerce(libcVersionRaw).version;
|
||||||
handleError(new Error(`Use with glibc ${libcVersionRaw} requires manual installation of libvips >= ${minimumLibvipsVersion}`));
|
if (libcFamily === detectLibc.GLIBC && minimumGlibcVersionByArch[arch]) {
|
||||||
|
if (semverLessThan(libcVersion, semverCoerce(minimumGlibcVersionByArch[arch]).version)) {
|
||||||
|
handleError(new Error(`Use with glibc ${libcVersionRaw} requires manual installation of libvips >= ${minimumLibvipsVersion}`));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
if (libcFamily === detectLibc.MUSL) {
|
||||||
if (libcFamily === detectLibc.MUSL && libcVersion) {
|
if (semverLessThan(libcVersion, '1.1.24')) {
|
||||||
if (semverLessThan(libcVersion, '1.1.24')) {
|
handleError(new Error(`Use with musl ${libcVersionRaw} requires manual installation of libvips >= ${minimumLibvipsVersion}`));
|
||||||
handleError(new Error(`Use with musl ${libcVersionRaw} requires manual installation of libvips >= ${minimumLibvipsVersion}`));
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Node.js minimum version check
|
// Node.js minimum version check
|
||||||
|
Loading…
x
Reference in New Issue
Block a user