const fs = require('fs'); const path = require('path'); module.exports = { packagerConfig: { icon: 'appicons/icons/png/1024x1024.png', extraResource: ['resources/bin'], ignore: ['Readme.md', 'ToDo.txt', 'TrimSP.cfg', 'fortran/*'], }, hooks: { postPackage: async (_forgeConfig, packageResult) => { if (process.env.FORGE_FLATPAK !== '1') { return; } for (const outputPath of packageResult.outputPaths) { const sandboxHelper = path.join(outputPath, 'chrome-sandbox'); if (fs.existsSync(sandboxHelper)) { fs.rmSync(sandboxHelper, { force: true }); } } }, }, makers: [ { name: '@electron-forge/maker-squirrel', config: { name: 'TrimSP', }, }, { name: '@electron-forge/maker-zip', platforms: ['darwin'], }, { name: '@electron-forge/maker-deb', config: {}, }, { name: '@electron-forge/maker-rpm', config: {}, }, { name: '@electron-forge/maker-flatpak', config: { options: { id: 'ch.psi.lem.TrimSP', productName: 'TrimSP', genericName: 'Ion implantation simulator', description: 'TRIM.SP simulation GUI for ion implantation studies.', baseVersion: '24.08', runtimeVersion: '24.08', categories: ['Science'], finishArgs: [ '--share=ipc', '--share=network', '--socket=x11', '--socket=wayland', '--device=dri', '--filesystem=home', '--filesystem=/tmp', ], }, }, }, ], };