diff --git a/.changeset/serious-news-own.md b/.changeset/serious-news-own.md new file mode 100644 index 00000000000..fd779b2c552 --- /dev/null +++ b/.changeset/serious-news-own.md @@ -0,0 +1,5 @@ +--- +"app-builder-lib": patch +--- + +chore: migrate default recommends and default depends for fpm from app-builder-bin to JS code diff --git a/packages/app-builder-lib/scheme.json b/packages/app-builder-lib/scheme.json index 9a438419de4..c558a2fb742 100644 --- a/packages/app-builder-lib/scheme.json +++ b/packages/app-builder-lib/scheme.json @@ -574,7 +574,18 @@ "type": "null" } ], - "description": "Package dependencies. Defaults to `[\"gconf2\", \"gconf-service\", \"libnotify4\", \"libappindicator1\", \"libxtst6\", \"libnss3\"]`.\nIf need to support Debian, `libappindicator1` should be removed, it is [deprecated in Debian](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=895037).\nIf 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)." + "default": [ + "libgtk-3-0", + "libnotify4", + "libnss3", + "libxss1", + "libxtst6", + "xdg-utils", + "libatspi2.0-0", + "libuuid1", + "libsecret-1-0" + ], + "description": "Package dependencies.\nIf need to support Debian, `libappindicator1` should be removed, it is [deprecated in Debian](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=895037).\nIf 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)." }, "description": { "description": "As [description](./configuration.md#description) from application package.json, but allows you to specify different for Linux.", @@ -718,7 +729,10 @@ "type": "null" } ], - "description": "The [recommended package dependencies](https://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps).." + "default": [ + "libappindicator3-1" + ], + "description": "The [recommended package dependencies](https://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps)." }, "synopsis": { "description": "The [short description](https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Description).", @@ -2105,7 +2119,7 @@ "type": "null" } ], - "description": "Package dependencies." + "description": "Package dependencies.\n`rpm` defaults to `[\"gtk3\", \"libnotify\", \"nss\", \"libXScrnSaver\", \"(libXtst or libXtst6)\", \"xdg-utils\", \"at-spi2-core\", \"(libuuid or libuuid1)\"]`\n`pacman` defaults to `[\"c-ares\", \"ffmpeg\", \"gtk3\", \"http-parser\", \"libevent\", \"libvpx\", \"libxslt\", \"libxss\", \"minizip\", \"nss\", \"re2\", \"snappy\", \"libnotify\", \"libappindicator-gtk3\"]`" }, "description": { "description": "As [description](./configuration.md#description) from application package.json, but allows you to specify different for Linux.", diff --git a/packages/app-builder-lib/src/options/linuxOptions.ts b/packages/app-builder-lib/src/options/linuxOptions.ts index 77e4882cb36..969afd08097 100644 --- a/packages/app-builder-lib/src/options/linuxOptions.ts +++ b/packages/app-builder-lib/src/options/linuxOptions.ts @@ -98,6 +98,8 @@ export interface CommonLinuxOptions { export interface LinuxTargetSpecificOptions extends CommonLinuxOptions, TargetSpecificOptions { /** * Package dependencies. + * `rpm` defaults to `["gtk3", "libnotify", "nss", "libXScrnSaver", "(libXtst or libXtst6)", "xdg-utils", "at-spi2-core", "(libuuid or libuuid1)"]` + * `pacman` defaults to `["c-ares", "ffmpeg", "gtk3", "http-parser", "libevent", "libvpx", "libxslt", "libxss", "minizip", "nss", "re2", "snappy", "libnotify", "libappindicator-gtk3"]` */ readonly depends?: Array | null @@ -134,14 +136,16 @@ export interface LinuxTargetSpecificOptions extends CommonLinuxOptions, TargetSp } export interface DebOptions extends LinuxTargetSpecificOptions { /** - * Package dependencies. Defaults to `["gconf2", "gconf-service", "libnotify4", "libappindicator1", "libxtst6", "libnss3"]`. + * Package dependencies. * If need to support Debian, `libappindicator1` should be removed, it is [deprecated in Debian](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=895037). * 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). + * @default ["libgtk-3-0", "libnotify4", "libnss3", "libxss1", "libxtst6", "xdg-utils", "libatspi2.0-0", "libuuid1", "libsecret-1-0"] */ readonly depends?: Array | null /** - * The [recommended package dependencies](https://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps).. + * The [recommended package dependencies](https://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps). + * @default ["libappindicator3-1"] */ readonly recommends?: Array | null diff --git a/packages/app-builder-lib/src/targets/FpmTarget.ts b/packages/app-builder-lib/src/targets/FpmTarget.ts index 46baf32e8c6..aa0fa4fbc9c 100644 --- a/packages/app-builder-lib/src/targets/FpmTarget.ts +++ b/packages/app-builder-lib/src/targets/FpmTarget.ts @@ -199,12 +199,16 @@ export default class FpmTarget extends Target { throw new Error(`depends must be Array or String, but specified as: ${depends}`) } } + } else { + fpmConfiguration.customDepends = this.getDefaultDepends(target) } if (target === "deb") { const recommends = (options as DebOptions).recommends if (recommends) { fpmConfiguration.customRecommends = asArray(recommends) + } else { + fpmConfiguration.customRecommends = this.getDefaultRecommends(target) } } @@ -280,6 +284,40 @@ export default class FpmTarget extends Target { private supportsAutoUpdate(target: string) { return ["deb", "rpm", "pacman"].includes(target) } + + private getDefaultDepends(target: string): string[] { + switch (target) { + case "deb": + return ["libgtk-3-0", "libnotify4", "libnss3", "libxss1", "libxtst6", "xdg-utils", "libatspi2.0-0", "libuuid1", "libsecret-1-0"] + + case "rpm": + return [ + "gtk3" /* for electron 2+ (electron 1 uses gtk2, but this old version is not supported anymore) */, + "libnotify", + "nss", + "libXScrnSaver", + "(libXtst or libXtst6)", + "xdg-utils", + "at-spi2-core" /* since 5.0.0 */, + "(libuuid or libuuid1)" /* since 4.0.0 */, + ] + + case "pacman": + return ["c-ares", "ffmpeg", "gtk3", "http-parser", "libevent", "libvpx", "libxslt", "libxss", "minizip", "nss", "re2", "snappy", "libnotify", "libappindicator-gtk3"] + + default: + return [] + } + } + + private getDefaultRecommends(target: string): string[] { + switch (target) { + case "deb": + return ["libappindicator3-1"] + default: + return [] + } + } } interface FpmConfiguration {