mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Add support for statically-linked dependencies (lovell/sharp-libvips#39) (#2223)
This commit is contained in:
committed by
GitHub
parent
85459e0ec6
commit
7c1c48327e
@@ -6,6 +6,8 @@ const path = require('path');
|
||||
const libvips = require('../lib/libvips');
|
||||
const npmLog = require('npmlog');
|
||||
|
||||
const minimumLibvipsVersion = libvips.minimumLibvipsVersion;
|
||||
|
||||
const platform = process.env.npm_config_platform || process.platform;
|
||||
if (platform === 'win32') {
|
||||
const buildDir = path.join(__dirname, '..', 'build');
|
||||
@@ -15,7 +17,7 @@ if (platform === 'win32') {
|
||||
libvips.mkdirSync(buildDir);
|
||||
libvips.mkdirSync(buildReleaseDir);
|
||||
} catch (err) {}
|
||||
const vendorLibDir = path.join(__dirname, '..', 'vendor', 'lib');
|
||||
const vendorLibDir = path.join(__dirname, '..', 'vendor', minimumLibvipsVersion, 'lib');
|
||||
npmLog.info('sharp', `Copying DLLs from ${vendorLibDir} to ${buildReleaseDir}`);
|
||||
try {
|
||||
fs
|
||||
|
||||
@@ -37,10 +37,12 @@ const fail = function (err) {
|
||||
const extractTarball = function (tarPath) {
|
||||
const vendorPath = path.join(__dirname, '..', 'vendor');
|
||||
libvips.mkdirSync(vendorPath);
|
||||
const versionedVendorPath = path.join(vendorPath, minimumLibvipsVersion);
|
||||
libvips.mkdirSync(versionedVendorPath);
|
||||
tar
|
||||
.extract({
|
||||
file: tarPath,
|
||||
cwd: vendorPath,
|
||||
cwd: versionedVendorPath,
|
||||
strict: true
|
||||
})
|
||||
.catch(function (err) {
|
||||
|
||||
Reference in New Issue
Block a user