Repository navigation
Expand file tree
/
Copy pathelectron-builder.json5
More file actions
214 lines (214 loc) · 9.33 KB
/
Copy pathelectron-builder.json5
File metadata and controls
214 lines (214 loc) · 9.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
/**
* @see https://www.electron.build/configuration/configuration
*/
{
productName: 'Platform.Bible',
appId: 'org.paranext.PlatformBible',
copyright: 'Copyright © 2017-2026 SIL Global and United Bible Societies',
protocols: {
name: 'platform-bible',
schemes: ['platform-bible'],
},
asar: true,
asarUnpack: '**\\*.{node,dll}',
files: ['dist', 'node_modules', 'package.json'],
afterSign: '.erb/scripts/notarize.js',
mac: {
notarize: false,
target: {
target: 'default',
arch: ['universal'],
},
// Rather than creating a universal .NET build, we create one for each architecture
extraResources: [
{
from: './c-sharp/bin/Release/net10.0/publish/osx-x64/',
to: './dotnet/osx-x64/',
},
{
from: './c-sharp/bin/Release/net10.0/publish/osx-arm64/',
to: './dotnet/osx-arm64/',
},
],
// https://github.com/electron/universal?tab=readme-ov-file#skip-lipo-for-certain-binaries-in-your-universal-app
// The documentation for this option didn't seem to match the results when it was used.
// To not specify a global pattern match on everything would require listing every single .NET
// executable and DLL file in the app bundle. That isn't practical, so a global match is used.
// In addition to the .NET files, it also was unhappy about node native modules which were not
// stitched together using lipo beforehand. It's rather confusing why this option even exists.
x64ArchFiles: '**/*',
type: 'distribution',
hardenedRuntime: true,
entitlements: 'assets/entitlements.mac.plist',
entitlementsInherit: 'assets/entitlements.mac.plist',
gatekeeperAssess: false,
icon: 'assets/icon-default.icns',
darkModeSupport: true,
},
dmg: {
sign: false,
contents: [
{
x: 130,
y: 220,
},
{
x: 410,
y: 220,
type: 'link',
path: '/Applications',
},
],
},
win: {
target: ['nsis', 'nsis-web', 'portable'],
extraResources: [
{
from: './c-sharp/bin/Release/net10.0/publish/win-x64/',
to: './dotnet/',
},
],
},
linux: {
executableName: 'platform-bible',
// The snap is still built on every release run and published nowhere - this repository
// distributes no built application (LICENSING.md, "The distributed application"), and Paratext
// 10 is released from `paranext/paratext-10-studio`. It is kept so that a broken Linux packaging
// path surfaces while the release is being cut rather than afterward, and because
// `package-main.yml` uploads this same target as a per-push artifact for internal Linux testing.
target: ['snap'],
category: 'Development',
extraResources: [
{
from: './c-sharp/bin/Release/net10.0/publish/linux-x64/',
to: './dotnet/',
},
],
},
directories: {
app: 'release/app',
buildResources: 'assets',
output: 'release/build',
},
extraResources: [
'./assets/**',
{ from: './extensions/dist/', to: './extensions' },
// Third-party attribution obligations - MIT, BSD, ISC and Apache-2.0 alike - apply to the
// distributed binary regardless of the terms the application itself ships under, so the notices
// travel with the installer. This is NOT the end-user license: nsis.license / dmg license is a
// separate artifact and stays unset, because the agreement box the Terms of Service name
// belongs to the Paratext account flow rather than to an installer license page (LICENSING.md).
'./THIRD-PARTY-NOTICES.md',
'./LICENSE',
// The installer otherwise carries two statements about the user's rights and nothing that
// reconciles them: `resources/LICENSE` is the full AGPL-3.0-or-later text, while the
// application is licensed to the user under the Terms of Service. Both are accurate - the
// SOURCE is AGPL and the BINARY is licensed under the Terms - but which one applies to what is
// stated only here. Shipping the document that draws that line, alongside both texts.
'./LICENSING.md',
// The terms the application itself is licensed to the user under (Terms of Service section
// 3.B.1). Referenced by `release/app/package.json`'s `SEE LICENSE IN TERMS-OF-SERVICE.html`, so
// it has to travel with the binary for a reader of that declaration to be able to find it.
// `extraResources` puts it in the installed `resources/` directory, BESIDE `app.asar` rather
// than inside it - so it is not in the package that declares it (`files` there is `dist`,
// `node_modules`, `package.json`) and the specifier does not resolve from within. NOT an
// installer EULA either: the agreement box the Terms name is the Paratext account flow's, which
// is why `nsis.license` and `dmg` stay unset.
'./TERMS-OF-SERVICE.html',
// An additional permission under section 7 of the AGPL. Section 7 expects such a permission to
// travel with the license text it modifies, so it ships beside `LICENSE` rather than only
// living in the repository - a recipient of the binary who goes on to build an extension needs
// to be able to read it from what they were given.
'./LICENSE-EXCEPTION.md',
],
publish: {
provider: 'github',
owner: 'paranext',
repo: 'paranext-core',
},
snap: {
// The base version needs to align with the Ubuntu runners in the GitHub Actions workflows.
// Some things are built in the host OS, and some are built in the snap environment. If they
// don't match, there will likely be compatibility issues.
//
// It must also align with the GNOME platform content snap mounted at $SNAP/gnome-platform,
// which is NOT configurable here: electron-builder's snapcraft template hardcodes that plug
// and config can replace a template plug entry but never rename or remove one. Renaming it is
// what matters -- snapd matches stored connections by plug NAME on refresh, so an attribute-only
// override leaves existing installs mounting the old platform. The pairing therefore lives in
// the `app-builder-lib` patch under `patches/`, and is enforced against this `base` value from
// both ends: .erb/scripts/electron-builder-snap-config.test.ts checks this config and the
// patched template, and .erb/scripts/assert-generated-snap-metadata.ts checks the snap those
// produced, in every workflow that builds one.
//
// Upstream knows: electron-builder issue #9452 root-caused the same stale `gnome-3-28-1804`
// runtime, and PR #9517 addressed it by migrating snap builds to the `snapcraft` CLI under a
// new root `snapcraft` config property, rather than by fixing this `snap` property's template.
//
// Removing the patch takes that new property AND `base: core24` -- the property alone is not
// enough, and stopping at it would silently reinstate this bug. Under `snapcraft`, core18,
// core20 and core22 all dispatch to `SnapCoreLegacy` (`LinuxTargetHelper.getSnapCore`), which
// loads this same template with the same hardcoded `gnome-3-28-1804` plug and merges config
// plugs by key exactly as the `snap` property does. Only core24 escapes, via the snapcraft
// `gnome` extension, which supplies `gnome-46-2404` itself. So migrating on core22 and deleting
// the patch would put every existing install back on the wrong platform snap -- and take the
// guard with it, since that test asserts against the patched template.
//
// core24 is its own project, not a flag flip: it was beta when #9517 merged, its reporter saw
// the built snap land in an lxd container path and not launch, and `libtinfo5` in
// `stagePackages` below does not exist on noble.
base: 'core22',
category: 'Development',
environment: {
// We copy the ICU libraries to the .NET app directory to avoid snap confinement issues
// We need to allow the ICU libraries to load their dependencies from the same directory
LD_LIBRARY_PATH: '$LD_LIBRARY_PATH:.',
// Workaround for .NET bug: https://github.com/dotnet/runtime/issues/57784
DOTNET_LTTNG: '0',
// Snap changes $HOME, but we want the original home directory for compatibility reasons
HOME: '$SNAP_REAL_HOME',
// Snap confinement prevents writing to `/var/lock` which GlobalMutex normally requires
SIL_CORE_MAKE_GLOBAL_MUTEX_LOCAL_ONLY: 'true',
},
// Stays "devel". This repository does not publish to the snap store - `publish.yml` builds the
// snap so the Linux leg is exercised and so it can be shared internally, and Paratext 10 is
// released from `paranext/paratext-10-studio` (see LICENSING.md, "The distributed application").
grade: 'devel',
stagePackages: [
'libappindicator3-1',
'libasound2',
'libdrm2',
'libdrm-nouveau2',
'libgbm1',
'libgl1',
'libgtk-3-0',
'libnspr4',
'libnss3',
'libsecret-1-0',
'libtinfo5',
'libxss1',
],
plugs: [
'audio-playback',
'browser-support',
'desktop',
'desktop-legacy',
'gsettings',
'home',
'network',
'opengl',
'password-manager-service',
'pulseaudio',
'unity7',
'wayland',
'x11',
{
'dot-platform-bible': {
interface: 'personal-files',
read: ['$HOME/.platform.bible'],
write: ['$HOME/.platform.bible'],
},
},
],
},
}