diff --git a/docs/changelog.md b/docs/changelog.md index 1bb84e6e..e744e2fd 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -9,6 +9,9 @@ Requires libvips v8.12.2 * Improve performance and accuracy when compositing multiple images. [#2286](https://github.com/lovell/sharp/issues/2286) +* Expand pkgconfig search path for wider BSD support. + [#3106](https://github.com/lovell/sharp/issues/3106) + * Ensure Windows C++ runtime is linked statically (regression in 0.30.0). [#3110](https://github.com/lovell/sharp/pull/3110) [@kleisauke](https://github.com/kleisauke) diff --git a/lib/libvips.js b/lib/libvips.js index 566bc148..e13db207 100644 --- a/lib/libvips.js +++ b/lib/libvips.js @@ -86,9 +86,14 @@ const removeVendoredLibvips = function () { const pkgConfigPath = function () { if (process.platform !== 'win32') { const brewPkgConfigPath = spawnSync('which brew >/dev/null 2>&1 && eval $(brew --env) && echo $PKG_CONFIG_LIBDIR', spawnSyncOptions).stdout || ''; - return [brewPkgConfigPath.trim(), env.PKG_CONFIG_PATH, '/usr/local/lib/pkgconfig', '/usr/lib/pkgconfig'] - .filter(function (p) { return !!p; }) - .join(':'); + return [ + brewPkgConfigPath.trim(), + env.PKG_CONFIG_PATH, + '/usr/local/lib/pkgconfig', + '/usr/lib/pkgconfig', + '/usr/local/libdata/pkgconfig', + '/usr/libdata/pkgconfig' + ].filter(Boolean).join(':'); } else { return ''; }