From 0796b38e13a596e32c5bfd968e868b8e8ec3c8de Mon Sep 17 00:00:00 2001 From: Karl von Randow Date: Thu, 15 Sep 2022 20:40:15 +1200 Subject: [PATCH] Disable building neon on Apple Silicon --- lib/install.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/install.js b/lib/install.js index ee06a8b..9e073d5 100644 --- a/lib/install.js +++ b/lib/install.js @@ -13,10 +13,15 @@ import bin from './index.js'; console.info('compiling from source'); try { + let buildFlags = '' + if (process.arch === 'arm64') { + buildFlags = 'CPPFLAGS="-DPNG_ARM_NEON_OPT=0" ' + } + const source = fileURLToPath(new URL('../vendor/source/optipng.tar.gz', import.meta.url)); // From https://sourceforge.net/projects/optipng/files/OptiPNG/ await binBuild.file(source, [ - `./configure --with-system-zlib --prefix="${bin.dest()}" --bindir="${bin.dest()}"`, + `${buildFlags}./configure --with-system-zlib --prefix="${bin.dest()}" --bindir="${bin.dest()}"`, 'make install', ]);