Upgrade Electron and Forge tooling

This commit is contained in:
2026-08-28 14:41:32 +02:00
parent 74cf36eeac
commit 8792ed3541
4 changed files with 2042 additions and 1318 deletions
+30 -15
View File
@@ -1,4 +1,5 @@
const path = require('path');
const redhatInstaller = require('electron-installer-redhat');
const redhatDependencies = require('electron-installer-redhat/src/dependencies');
const linuxIconSet = {
@@ -13,12 +14,20 @@ const linuxIconSet = {
};
const linuxDesktopTemplate = path.resolve(__dirname, 'packaging/linux/trimsp.desktop.ejs');
const linuxRpmSpecTemplate = path.resolve(__dirname, 'packaging/linux/trimsp.spec.ejs');
const includeFlatpak = process.env.FORGE_FLATPAK === '1';
// The upstream RPM maker assumes Fedora-style package names. Mageia provides
// GTK 3 under lib64gtk+3_0, so allow either name in the generated Requires.
redhatDependencies.dependencyMap.gtk3 = '(gtk3 or lib64gtk+3_0)';
// RPM 4.20 runs %install from an automatically generated build directory.
// Use our absolute-path template instead of the installer's relative usr/* copy.
redhatInstaller.Installer.prototype.createSpec = function () {
this.options.logger(`Creating package spec at ${this.specPath}`);
return this.createTemplatedFile(linuxRpmSpecTemplate, this.specPath);
};
const makers = [
{
name: '@electron-forge/maker-squirrel',
@@ -33,25 +42,29 @@ const makers = [
{
name: '@electron-forge/maker-deb',
config: {
name: 'trimsp',
productName: 'TRIMSP-NL Workbench',
genericName: 'Ion implantation simulator',
description: 'Workbench for low-energy muon and ion implantation simulations with TRIM.SP-NL.',
categories: ['Science'],
icon: linuxIconSet,
desktopTemplate: linuxDesktopTemplate,
options: {
name: 'trimsp',
productName: 'TRIMSP-NL Workbench',
genericName: 'Ion implantation simulator',
description: 'Workbench for low-energy muon and ion implantation simulations with TRIM.SP-NL.',
categories: ['Science'],
icon: linuxIconSet,
desktopTemplate: linuxDesktopTemplate,
},
},
},
{
name: '@electron-forge/maker-rpm',
config: {
name: 'trimsp',
productName: 'TRIMSP-NL Workbench',
genericName: 'Ion implantation simulator',
description: 'Workbench for low-energy muon and ion implantation simulations with TRIM.SP-NL.',
categories: ['Science'],
icon: linuxIconSet,
desktopTemplate: linuxDesktopTemplate,
options: {
name: 'trimsp',
productName: 'TRIMSP-NL Workbench',
genericName: 'Ion implantation simulator',
description: 'Workbench for low-energy muon and ion implantation simulations with TRIM.SP-NL.',
categories: ['Science'],
icon: linuxIconSet,
desktopTemplate: linuxDesktopTemplate,
},
},
},
];
@@ -93,9 +106,11 @@ module.exports = {
'Readme.md',
'ToDo.txt',
'TrimSP.cfg',
'^/trimspNL$',
'fortran/*',
'(^|/)packaging($|/)',
'(^|/)resources/bin($|/)',
'(^|/)tests?($|/)',
'(^|/)tests?[^/]*($|/)',
'(^|/)__tests__($|/)',
'(^|/)(test|spec)($|/)',
'\\.flatpak-builder($|/)',
+1943 -1296
View File
File diff suppressed because it is too large Load Diff
+7 -7
View File
@@ -29,13 +29,13 @@
"author": "Zaher Salman",
"license": "GPL-3.0-or-later",
"devDependencies": {
"@electron-forge/cli": "^6.0.0-beta.57",
"@electron-forge/maker-deb": "^6.0.0-beta.57",
"@electron-forge/maker-flatpak": "^7.11.1",
"@electron-forge/maker-rpm": "^6.0.0-beta.57",
"@electron-forge/maker-squirrel": "^6.0.0-beta.57",
"@electron-forge/maker-zip": "^6.0.0-beta.57",
"electron": "40.6.0"
"@electron-forge/cli": "7.11.2",
"@electron-forge/maker-deb": "7.11.2",
"@electron-forge/maker-flatpak": "7.11.2",
"@electron-forge/maker-rpm": "7.11.2",
"@electron-forge/maker-squirrel": "7.11.2",
"@electron-forge/maker-zip": "7.11.2",
"electron": "44.0.0"
},
"dependencies": {
"plotly.js-dist": "^1.58.4"
+62
View File
@@ -0,0 +1,62 @@
%define _binary_payload w<%= compressionLevel %>.xzdio
%if "%{_host_cpu}" != "%{_target_cpu}"
%global __strip /bin/true
%endif
Name: <%= name %>
Version: <%= version %>
Release: <%= revision %>%{?dist}
<% if (description) { print(`Summary: ${description}\n`) }
%>
<% if (license) { print(`License: ${license}\n`) }
if (homepage) { print(`URL: ${homepage}\n`) }
if (license || homepage) { print('\n') }
%>Requires: <%= requires.join(', ') %>
AutoReqProv: no
<% if (productDescription) {
%>%description
<% print(productDescription)
print('\n\n\n') }
%>%install
mkdir -p %{buildroot}/usr/
cp -R "%{_topdir}/BUILD/usr/." "%{buildroot}/usr/"
%files
/usr/bin/<%= name %>
/usr/lib/<%= name %>/
/usr/share/applications/<%= name %>.desktop
/usr/share/doc/<%= name %>/
<% if (_.isObject(icon)) {
_.forEach(icon, function (iconPath, resolution) {
%>/usr/share/icons/hicolor/<%= resolution %>/apps/<%= name %><%= resolution === 'symbolic' ? '-symbolic' : '' %>.<%= ['scalable', 'symbolic'].includes(resolution) ? 'svg' : 'png' %>
<% }) } else {
%>/usr/share/pixmaps/<%= name %>.png
<% } %>
<% if (pre) {
%>%pre
<% print(pre)
if (preun || post || postun) print('\n\n\n') }
%><% if (preun) {
%>%preun
<% print(preun)
if (post || postun) print('\n\n\n') }
%><% if (post) {
%>%post
<% print(post)
if (postun) print('\n\n\n') }
%><% if (postun) {
%>%postun
<% print(postun) } %>