UNPKG

9.18 kBTypeScriptView Raw
1import { PlatformSpecificBuildOptions, TargetConfigType, TargetSpecificOptions } from "../index";
2export interface LinuxConfiguration extends CommonLinuxOptions, PlatformSpecificBuildOptions {
3 /**
4 * Target package type: list of `AppImage`, `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/integration-guide/stable/desktop-files.html.en) 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" | 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://github.com/jordansissel/fpm/wiki#usage) 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 [package category](https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Section).
96 */
97 readonly packageCategory?: string | null;
98 /**
99 * The [Priority](https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Priority) attribute.
100 */
101 readonly priority?: string | null;
102}
103export interface AppImageOptions extends CommonLinuxOptions, TargetSpecificOptions {
104 /**
105 * The path to EULA license file. Defaults to `license.txt` or `eula.txt` (or uppercase variants). Only plain text is supported.
106 */
107 readonly license?: string | null;
108}
109export interface FlatpakOptions extends CommonLinuxOptions, TargetSpecificOptions {
110 /**
111 * The path to EULA license file. Defaults to `license.txt` or `eula.txt` (or uppercase variants). Only plain text is supported.
112 */
113 readonly license?: string | null;
114 /**
115 * The name of the runtime that the application uses. Defaults to `org.freedesktop.Platform`.
116 *
117 * See [flatpak manifest documentation](https://docs.flatpak.org/en/latest/flatpak-builder-command-reference.html#flatpak-manifest).
118 */
119 readonly runtime?: string;
120 /**
121 * The version of the runtime that the application uses. Defaults to `20.08`.
122 *
123 * See [flatpak manifest documentation](https://docs.flatpak.org/en/latest/flatpak-builder-command-reference.html#flatpak-manifest).
124 */
125 readonly runtimeVersion?: string;
126 /**
127 * The name of the development runtime that the application builds with. Defaults to `org.freedesktop.Sdk`.
128 *
129 * See [flatpak manifest documentation](https://docs.flatpak.org/en/latest/flatpak-builder-command-reference.html#flatpak-manifest).
130 */
131 readonly sdk?: string;
132 /**
133 * Start with the files from the specified application. This can be used to create applications that extend another application.
134 * Defaults to [org.electronjs.Electron2.BaseApp](https://github.com/flathub/org.electronjs.Electron2.BaseApp).
135 *
136 * See [flatpak manifest documentation](https://docs.flatpak.org/en/latest/flatpak-builder-command-reference.html#flatpak-manifest).
137 */
138 readonly base?: string;
139 /**
140 * Use this specific version of the application specified in base. Defaults to `20.08`.
141 *
142 * See [flatpak manifest documentation](https://docs.flatpak.org/en/latest/flatpak-builder-command-reference.html#flatpak-manifest).
143 */
144 readonly baseVersion?: string;
145 /**
146 * The branch to use when exporting the application. Defaults to `master`.
147 *
148 * See [flatpak manifest documentation](https://docs.flatpak.org/en/latest/flatpak-builder-command-reference.html#flatpak-manifest).
149 */
150 readonly branch?: string;
151 /**
152 * An array of arguments passed to the flatpak build-finish command. Defaults to:
153 * ```json
154 * [
155 * // Wayland/X11 Rendering
156 * "--socket=wayland",
157 * "--socket=x11",
158 * "--share=ipc",
159 * // Open GL
160 * "--device=dri",
161 * // Audio output
162 * "--socket=pulseaudio",
163 * // Read/write home directory access
164 * "--filesystem=home",
165 * // Allow communication with network
166 * "--share=network",
167 * // System notifications with libnotify
168 * "--talk-name=org.freedesktop.Notifications",
169 * ]
170 * ```
171 *
172 * See [flatpak manifest documentation](https://docs.flatpak.org/en/latest/flatpak-builder-command-reference.html#flatpak-manifest).
173 */
174 readonly finishArgs?: string[];
175 /**
176 * An array of objects specifying the modules to be built in order.
177 *
178 * See [flatpak manifest documentation](https://docs.flatpak.org/en/latest/flatpak-builder-command-reference.html#flatpak-manifest).
179 */
180 readonly modules?: (string | any)[];
181 /**
182 * 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/).
183 *
184 * See [@malept/flatpak-bundler documentation](https://github.com/malept/flatpak-bundler#build-options).
185 */
186 readonly files?: [string, string][];
187 /**
188 * 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.
189 *
190 * See [@malept/flatpak-bundler documentation](https://github.com/malept/flatpak-bundler#build-options).
191 */
192 readonly symlinks?: [string, string][];
193 /**
194 * 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`.
195 */
196 readonly useWaylandFlags?: boolean;
197}