DISA's STIG Viewer 3 doesn't ship a macOS ARM build, but as an electron app we can port one from the Linux version.
First build a darwin arm64 sqlite3 binary. That can be built using the command below.
npm install sqlite3 --build-from-source --target_arch=arm64 --fallback-to-build
Pull down the Linux version of STIG Viewer 3 and extract the ZIP.
Check which version of node was used to build the Linux app.
$ strings STIG\ Viewer\ 3| grep 'node.js/v'
node.js/v18.18.2
Download the same version of node for MacOS arm64. Extract this to node-v18.18.2-darwin-arm64
in the Linux app directory.
Next extract Electron's asar file, merge in unpacked files, and copy the sqlite3 binary in.
export PATH="`realpath node-v18.18.2-darwin-arm64/bin`:$PATH"
mkdir patched
npx asar extract resources/app.asar patched
cp -r resources/app.asar.unpacked/* patched
mkdir patched/node_modules/sqlite3-offline-next/binaries/sqlite3-darwin/napi-v3-darwin-arm64/
cp node_sqlite3.node patched/node_modules/sqlite3-offline-next/binaries/sqlite3-darwin/napi-v3-darwin-arm64/
Test the Electron app.
npx electron patched
Build the Electron app.
npx electron-packager patched "STIG Viewer 3" --platform=darwin --arch=arm64 --out=macbuild --overwrite --no-prune
This will produce macbuild/STIG Viewer 3-darwin-arm64/STIG Viewer 3.app
.
I had a couple issues