mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 10:30:15 +02:00
Install: log Rosetta detection, improve related docs
This commit is contained in:
parent
6cda090ce2
commit
5be36c2deb
@ -115,7 +115,8 @@ and that it can be located using `pkg-config --modversion vips-cpp`.
|
|||||||
For help compiling libvips and its dependencies, please see
|
For help compiling libvips and its dependencies, please see
|
||||||
[building libvips from source](https://www.libvips.org/install.html#building-libvips-from-source).
|
[building libvips from source](https://www.libvips.org/install.html#building-libvips-from-source).
|
||||||
|
|
||||||
The use of a globally-installed libvips is unsupported on Windows.
|
The use of a globally-installed libvips is unsupported on Windows
|
||||||
|
and on macOS when running Node.js under Rosetta.
|
||||||
|
|
||||||
## Building from source
|
## Building from source
|
||||||
|
|
||||||
|
@ -128,9 +128,6 @@ try {
|
|||||||
if (arch === 'ia32' && !platformAndArch.startsWith('win32')) {
|
if (arch === 'ia32' && !platformAndArch.startsWith('win32')) {
|
||||||
throw new Error(`Intel Architecture 32-bit systems require manual installation of libvips >= ${minimumLibvipsVersion}`);
|
throw new Error(`Intel Architecture 32-bit systems require manual installation of libvips >= ${minimumLibvipsVersion}`);
|
||||||
}
|
}
|
||||||
if (platformAndArch === 'darwin-arm64') {
|
|
||||||
throw new Error("Please run 'brew install vips' to install libvips on Apple M1 (ARM64) systems");
|
|
||||||
}
|
|
||||||
if (platformAndArch === 'freebsd-x64' || platformAndArch === 'openbsd-x64' || platformAndArch === 'sunos-x64') {
|
if (platformAndArch === 'freebsd-x64' || platformAndArch === 'openbsd-x64' || platformAndArch === 'sunos-x64') {
|
||||||
throw new Error(`BSD/SunOS systems require manual installation of libvips >= ${minimumLibvipsVersion}`);
|
throw new Error(`BSD/SunOS systems require manual installation of libvips >= ${minimumLibvipsVersion}`);
|
||||||
}
|
}
|
||||||
@ -153,7 +150,6 @@ try {
|
|||||||
if (!semverSatisfies(process.versions.node, supportedNodeVersion)) {
|
if (!semverSatisfies(process.versions.node, supportedNodeVersion)) {
|
||||||
handleError(new Error(`Expected Node.js version ${supportedNodeVersion} but found ${process.versions.node}`));
|
handleError(new Error(`Expected Node.js version ${supportedNodeVersion} but found ${process.versions.node}`));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Download to per-process temporary file
|
// Download to per-process temporary file
|
||||||
const tarFilename = ['libvips', minimumLibvipsVersionLabelled, platformAndArch].join('-') + '.tar.br';
|
const tarFilename = ['libvips', minimumLibvipsVersionLabelled, platformAndArch].join('-') + '.tar.br';
|
||||||
const tarPathCache = path.join(libvips.cachePath(), tarFilename);
|
const tarPathCache = path.join(libvips.cachePath(), tarFilename);
|
||||||
|
@ -115,6 +115,7 @@ const useGlobalLibvips = function () {
|
|||||||
}
|
}
|
||||||
/* istanbul ignore next */
|
/* istanbul ignore next */
|
||||||
if (isRosetta()) {
|
if (isRosetta()) {
|
||||||
|
log('Detected Rosetta, skipping search for globally-installed libvips');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const globalVipsVersion = globalLibvipsVersion();
|
const globalVipsVersion = globalLibvipsVersion();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user