mirror of
https://github.com/lovell/sharp.git
synced 2025-12-18 23:05:04 +01:00
Install: advanced option to force global libvips #4060
This commit is contained in:
@@ -162,15 +162,21 @@ const pkgConfigPath = () => {
|
||||
}
|
||||
};
|
||||
|
||||
const skipSearch = (status, reason) => {
|
||||
log(`Detected ${reason}, skipping search for globally-installed libvips`);
|
||||
return status;
|
||||
};
|
||||
|
||||
const useGlobalLibvips = () => {
|
||||
if (Boolean(process.env.SHARP_IGNORE_GLOBAL_LIBVIPS) === true) {
|
||||
log('Detected SHARP_IGNORE_GLOBAL_LIBVIPS, skipping search for globally-installed libvips');
|
||||
return false;
|
||||
return skipSearch(false, 'SHARP_IGNORE_GLOBAL_LIBVIPS');
|
||||
}
|
||||
if (Boolean(process.env.SHARP_FORCE_GLOBAL_LIBVIPS) === true) {
|
||||
return skipSearch(true, 'SHARP_FORCE_GLOBAL_LIBVIPS');
|
||||
}
|
||||
/* istanbul ignore next */
|
||||
if (isRosetta()) {
|
||||
log('Detected Rosetta, skipping search for globally-installed libvips');
|
||||
return false;
|
||||
return skipSearch(false, 'Rosetta');
|
||||
}
|
||||
const globalVipsVersion = globalLibvipsVersion();
|
||||
return !!globalVipsVersion && /* istanbul ignore next */
|
||||
|
||||
Reference in New Issue
Block a user