UNPKG

9.42 kBTypeScriptView Raw
1import { PlatformSpecificBuildOptions, TargetConfigType, TargetSpecificOptions } from "../index";
2export interface LinuxConfiguration extends CommonLinuxOptions, PlatformSpecificBuildOptions {
3 /**
4 * Target package type: list of `AppImage`, `flatpak`, `snap`, `deb`, `rpm`, `freebsd`, `pacman`, `p5p`, `apk`, `7z`, `zip`, `tar.xz`, `tar.lz`, `tar.gz`, `tar.bz2`, `dir`.
5 *
6 * electron-builder [docker image](/multi-platform-build#docker) can be used to build Linux targets on any platform.
7 *
8 * Please [do not put an AppImage into another archive](https://github.com/probonopd/AppImageKit/wiki/Creating-AppImages#common-mistake) like a .zip or .tar.gz.
9 * @default AppImage
10 */
11 readonly target?: TargetConfigType;
12 /**
13 * The maintainer. Defaults to [author](/configuration/configuration#Metadata-author).
14 */
15 readonly maintainer?: string | null;
16 /**
17 * The vendor. Defaults to [author](/configuration/configuration#Metadata-author).
18 */
19 readonly vendor?: string | null;
20 /**
21 * The path to icon set directory or one png file, relative to the [build resources](/configuration/configuration#MetadataDirectories-buildResources) or to the project directory. The icon filename must contain the size (e.g. 32x32.png) of the icon.
22 * By default will be generated automatically based on the macOS icns file.
23 */
24 readonly icon?: string;
25 /**
26 * backward compatibility + to allow specify fpm-only category for all possible fpm targets in one place
27 * @private
28 */
29 readonly packageCategory?: string | null;
30}
31export interface CommonLinuxOptions {
32 /**
33 * The [short description](https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Description).
34 */
35 readonly synopsis?: string | null;
36 /**
37 * As [description](/configuration/configuration#Metadata-description) from application package.json, but allows you to specify different for Linux.
38 */
39 readonly description?: string | null;
40 /**
41 * The [application category](https://specifications.freedesktop.org/menu-spec/latest/apa.html#main-category-registry).
42 */
43 readonly category?: string | null;
44 /**
45 * The mime types in addition to specified in the file associations. Use it if you don't want to register a new mime type, but reuse existing.
46 */
47 readonly mimeTypes?: Array<string> | null;
48 /**
49 * The [Desktop file](https://developer.gnome.org/documentation/guidelines/maintainer/integrating.html#desktop-files) entries (name to value).
50 */
51 readonly desktop?: any | null;
52 /**
53 * The executable parameters. Pass to executableName
54 */
55 readonly executableArgs?: Array<string> | null;
56}
57export interface LinuxTargetSpecificOptions extends CommonLinuxOptions, TargetSpecificOptions {
58 /**
59 * Package dependencies.
60 */
61 readonly depends?: Array<string> | null;
62 /**
63 * The compression type.
64 * @default xz
65 */
66 readonly compression?: "gz" | "bzip2" | "xz" | "lzo" | null;
67 readonly icon?: string;
68 /**
69 * The package category.
70 */
71 readonly packageCategory?: string | null;
72 /**
73 * The name of the package.
74 */
75 readonly packageName?: string | null;
76 readonly vendor?: string | null;
77 readonly maintainer?: string | null;
78 readonly afterInstall?: string | null;
79 readonly afterRemove?: string | null;
80 /**
81 * *Advanced only* The [fpm](https://fpm.readthedocs.io/en/latest/cli-reference.html) options.
82 *
83 * Example: `["--before-install=build/deb-preinstall.sh", "--after-upgrade=build/deb-postinstall.sh"]`
84 */
85 readonly fpm?: Array<string> | null;
86}
87export interface DebOptions extends LinuxTargetSpecificOptions {
88 /**
89 * Package dependencies. Defaults to `["gconf2", "gconf-service", "libnotify4", "libappindicator1", "libxtst6", "libnss3"]`.
90 * If need to support Debian, `libappindicator1` should be removed, it is [deprecated in Debian](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=895037).
91 * If need to support KDE, `gconf2` and `gconf-service` should be removed as it's no longer used by GNOME](https://packages.debian.org/bullseye/gconf2).
92 */
93 readonly depends?: Array<string> | null;
94 /**
95 * The [recommended package dependencies](https://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps)..
96 */
97 readonly recommends?: Array<string> | null;
98 /**
99 * The [package category](https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Section).
100 */
101 readonly packageCategory?: string | null;
102 /**
103 * The [Priority](https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Priority) attribute.
104 */
105 readonly priority?: string | null;
106}
107export interface AppImageOptions extends CommonLinuxOptions, TargetSpecificOptions {
108 /**
109 * The path to EULA license file. Defaults to `license.txt` or `eula.txt` (or uppercase variants). Only plain text is supported.
110 */
111 readonly license?: string | null;
112}
113export interface FlatpakOptions extends CommonLinuxOptions, TargetSpecificOptions {
114 /**
115 * The path to EULA license file. Defaults to `license.txt` or `eula.txt` (or uppercase variants). Only plain text is supported.
116 */
117 readonly license?: string | null;
118 /**
119 * The name of the runtime that the application uses. Defaults to `org.freedesktop.Platform`.
120 *
121 * See [flatpak manifest documentation](https://docs.flatpak.org/en/latest/flatpak-builder-command-reference.html#flatpak-manifest).
122 */
123 readonly runtime?: string;
124 /**
125 * The version of the runtime that the application uses. Defaults to `20.08`.
126 *
127 * See [flatpak manifest documentation](https://docs.flatpak.org/en/latest/flatpak-builder-command-reference.html#flatpak-manifest).
128 */
129 readonly runtimeVersion?: string;
130 /**
131 * The name of the development runtime that the application builds with. Defaults to `org.freedesktop.Sdk`.
132 *
133 * See [flatpak manifest documentation](https://docs.flatpak.org/en/latest/flatpak-builder-command-reference.html#flatpak-manifest).
134 */
135 readonly sdk?: string;
136 /**
137 * Start with the files from the specified application. This can be used to create applications that extend another application.
138 * Defaults to [org.electronjs.Electron2.BaseApp](https://github.com/flathub/org.electronjs.Electron2.BaseApp).
139 *
140 * See [flatpak manifest documentation](https://docs.flatpak.org/en/latest/flatpak-builder-command-reference.html#flatpak-manifest).
141 */
142 readonly base?: string;
143 /**
144 * Use this specific version of the application specified in base. Defaults to `20.08`.
145 *
146 * See [flatpak manifest documentation](https://docs.flatpak.org/en/latest/flatpak-builder-command-reference.html#flatpak-manifest).
147 */
148 readonly baseVersion?: string;
149 /**
150 * The branch to use when exporting the application. Defaults to `master`.
151 *
152 * See [flatpak manifest documentation](https://docs.flatpak.org/en/latest/flatpak-builder-command-reference.html#flatpak-manifest).
153 */
154 readonly branch?: string;
155 /**
156 * An array of arguments passed to the flatpak build-finish command. Defaults to:
157 * ```json
158 * [
159 * // Wayland/X11 Rendering
160 * "--socket=wayland",
161 * "--socket=x11",
162 * "--share=ipc",
163 * // Open GL
164 * "--device=dri",
165 * // Audio output
166 * "--socket=pulseaudio",
167 * // Read/write home directory access
168 * "--filesystem=home",
169 * // Allow communication with network
170 * "--share=network",
171 * // System notifications with libnotify
172 * "--talk-name=org.freedesktop.Notifications",
173 * ]
174 * ```
175 *
176 * See [flatpak manifest documentation](https://docs.flatpak.org/en/latest/flatpak-builder-command-reference.html#flatpak-manifest).
177 */
178 readonly finishArgs?: string[];
179 /**
180 * An array of objects specifying the modules to be built in order.
181 *
182 * See [flatpak manifest documentation](https://docs.flatpak.org/en/latest/flatpak-builder-command-reference.html#flatpak-manifest).
183 */
184 readonly modules?: (string | any)[];
185 /**
186 * Files to copy directly into the app. Should be a list of [source, dest] tuples. Source should be a relative/absolute path to a file/directory to copy into the flatpak, and dest should be the path inside the app install prefix (e.g. /share/applications/).
187 *
188 * See [@malept/flatpak-bundler documentation](https://github.com/malept/flatpak-bundler#build-options).
189 */
190 readonly files?: [string, string][];
191 /**
192 * Symlinks to create in the app files. Should be a list of [target, location] symlink tuples. Target can be either a relative or absolute path inside the app install prefix, and location should be a absolute path inside the prefix to create the symlink at.
193 *
194 * See [@malept/flatpak-bundler documentation](https://github.com/malept/flatpak-bundler#build-options).
195 */
196 readonly symlinks?: [string, string][];
197 /**
198 * Whether to enable the Wayland specific flags (`--enable-features=UseOzonePlatform --ozone-platform=wayland`) in the wrapper script. These flags are only available starting with Electron version 12. Defaults to `false`.
199 */
200 readonly useWaylandFlags?: boolean;
201}