first commit
This commit is contained in:
17
build/node_modules/optipng-bin/lib/index.js
generated
vendored
Normal file
17
build/node_modules/optipng-bin/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
'use strict';
|
||||
var path = require('path');
|
||||
var BinWrapper = require('bin-wrapper');
|
||||
var pkg = require('../package.json');
|
||||
var url = 'https://raw.githubusercontent.com/imagemin/optipng-bin/v' + pkg.version + '/vendor/';
|
||||
|
||||
module.exports = new BinWrapper()
|
||||
.src(url + 'macos/optipng', 'darwin')
|
||||
.src(url + 'linux/x86/optipng', 'linux', 'x86')
|
||||
.src(url + 'linux/x64/optipng', 'linux', 'x64')
|
||||
.src(url + 'freebsd/x86/optipng', 'freebsd', 'x86')
|
||||
.src(url + 'freebsd/x64/optipng', 'freebsd', 'x64')
|
||||
.src(url + 'sunos/x86/optipng', 'sunos', 'x86')
|
||||
.src(url + 'sunos/x64/optipng', 'sunos', 'x64')
|
||||
.src(url + 'win/optipng.exe', 'win32')
|
||||
.dest(path.join(__dirname, '../vendor'))
|
||||
.use(process.platform === 'win32' ? 'optipng.exe' : 'optipng');
|
||||
32
build/node_modules/optipng-bin/lib/install.js
generated
vendored
Normal file
32
build/node_modules/optipng-bin/lib/install.js
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
'use strict';
|
||||
var BinBuild = require('bin-build');
|
||||
var log = require('logalot');
|
||||
var bin = require('./');
|
||||
|
||||
bin.run(function (err) {
|
||||
if (err) {
|
||||
log.warn(err.message);
|
||||
log.warn('optipng pre-build test failed');
|
||||
log.info('compiling from source');
|
||||
|
||||
new BinBuild()
|
||||
.src('https://downloads.sourceforge.net/project/optipng/OptiPNG/optipng-0.7.6/optipng-0.7.6.tar.gz')
|
||||
.cmd([
|
||||
'./configure --with-system-zlib --prefix="' + bin.dest() + '"',
|
||||
'--bindir="' + bin.dest() + '"'
|
||||
].join(' '))
|
||||
.cmd('make install')
|
||||
.run(function (err) {
|
||||
if (err) {
|
||||
log.error(err.stack);
|
||||
return;
|
||||
}
|
||||
|
||||
log.success('optipng built successfully');
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
log.success('optipng pre-build test passed successfully');
|
||||
});
|
||||
Reference in New Issue
Block a user