blob: 76ff8cea82fdd4a64c825548ad65f52cad1e84a1 [file] [log] [blame]
Leo Repp58b9f112021-11-22 11:57:47 +01001'use strict';
2const path = require('path');
3const binBuild = require('bin-build');
4const log = require('logalot');
5const bin = require('.');
6
7bin.run(['--version']).then(() => {
8 log.success('gifsicle pre-build test passed successfully');
9}).catch(error => {
10 log.warn(error.message);
11 log.warn('gifsicle pre-build test failed');
12 log.info('compiling from source');
13
14 const cfg = [
15 './configure --disable-gifview --disable-gifdiff',
16 `--prefix="${bin.dest()}" --bindir="${bin.dest()}"`
17 ].join(' ');
18
19 binBuild.file(path.resolve(__dirname, '../vendor/source/gifsicle.tar.gz'), [
20 'autoreconf -ivf',
21 cfg,
22 'make install'
23 ]).then(() => {
24 log.success('gifsicle built successfully');
25 }).catch(error => {
26 log.error(error.stack);
27
28 // eslint-disable-next-line unicorn/no-process-exit
29 process.exit(1);
30 });
31});