mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 10:30:15 +02:00
Install: pass PKG_CONFIG_PATH
via env rather than substitution
This commit is contained in:
parent
7bf6cbd669
commit
a6aeef612b
@ -6,6 +6,9 @@ Requires libvips v8.12.2
|
|||||||
|
|
||||||
### v0.30.5 - TBD
|
### v0.30.5 - TBD
|
||||||
|
|
||||||
|
* Install: pass `PKG_CONFIG_PATH` via env rather than substitution.
|
||||||
|
[@dwisiswant0](https://github.com/dwisiswant0)
|
||||||
|
|
||||||
* Allow installation of prebuilt libvips binaries from filesystem.
|
* Allow installation of prebuilt libvips binaries from filesystem.
|
||||||
[#3196](https://github.com/lovell/sharp/pull/3196)
|
[#3196](https://github.com/lovell/sharp/pull/3196)
|
||||||
[@ankurparihar](https://github.com/ankurparihar)
|
[@ankurparihar](https://github.com/ankurparihar)
|
||||||
|
@ -65,7 +65,12 @@ const isRosetta = function () {
|
|||||||
|
|
||||||
const globalLibvipsVersion = function () {
|
const globalLibvipsVersion = function () {
|
||||||
if (process.platform !== 'win32') {
|
if (process.platform !== 'win32') {
|
||||||
const globalLibvipsVersion = spawnSync(`PKG_CONFIG_PATH="${pkgConfigPath()}" pkg-config --modversion vips-cpp`, spawnSyncOptions).stdout;
|
const globalLibvipsVersion = spawnSync('pkg-config --modversion vips-cpp', {
|
||||||
|
...spawnSyncOptions,
|
||||||
|
env: {
|
||||||
|
PKG_CONFIG_PATH: pkgConfigPath()
|
||||||
|
}
|
||||||
|
}).stdout;
|
||||||
/* istanbul ignore next */
|
/* istanbul ignore next */
|
||||||
return (globalLibvipsVersion || '').trim();
|
return (globalLibvipsVersion || '').trim();
|
||||||
} else {
|
} else {
|
||||||
@ -85,7 +90,10 @@ const removeVendoredLibvips = function () {
|
|||||||
|
|
||||||
const pkgConfigPath = function () {
|
const pkgConfigPath = function () {
|
||||||
if (process.platform !== 'win32') {
|
if (process.platform !== 'win32') {
|
||||||
const brewPkgConfigPath = spawnSync('which brew >/dev/null 2>&1 && eval $(brew --env) && echo $PKG_CONFIG_LIBDIR', spawnSyncOptions).stdout || '';
|
const brewPkgConfigPath = spawnSync(
|
||||||
|
'which brew >/dev/null 2>&1 && brew environment --plain | grep PKG_CONFIG_LIBDIR | cut -d" " -f2',
|
||||||
|
spawnSyncOptions
|
||||||
|
).stdout || '';
|
||||||
return [
|
return [
|
||||||
brewPkgConfigPath.trim(),
|
brewPkgConfigPath.trim(),
|
||||||
env.PKG_CONFIG_PATH,
|
env.PKG_CONFIG_PATH,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user