| Leo Repp | 58b9f11 | 2021-11-22 11:57:47 +0100 | [diff] [blame^] | 1 | 'use strict'; |
| 2 | const path = require('path'); |
| 3 | const binBuild = require('bin-build'); |
| 4 | const log = require('logalot'); |
| 5 | const bin = require('.'); |
| 6 | |
| 7 | bin.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 | }); |