aports/testing/freetube/ebuilder-config.patch

229 lines
5.1 KiB
Diff

From 407bcda0154931033362a875e783b742b79b178b Mon Sep 17 00:00:00 2001
From: "lauren n. liberda" <msgh@selfisekai.rocks>
Date: Sat, 9 Dec 2023 02:50:51 +0100
Subject: [PATCH] split electron-builder config to a separate file from build
script (#4431)
* split electron-builder config to a separate file from build script
* review changes
---
_scripts/build.js | 93 +-----------------------------------
_scripts/ebuilder.config.js | 94 +++++++++++++++++++++++++++++++++++++
2 files changed, 95 insertions(+), 92 deletions(-)
create mode 100644 _scripts/ebuilder.config.js
diff --git a/_scripts/build.js b/_scripts/build.js
index 035f986c97db..bee33667fbea 100644
--- a/_scripts/build.js
+++ b/_scripts/build.js
@@ -1,9 +1,9 @@
const os = require('os')
const builder = require('electron-builder')
+const config = require('./ebuilder.config.js')
const Platform = builder.Platform
const Arch = builder.Arch
-const { name, productName } = require('../package.json')
const args = process.argv
let targets
@@ -39,97 +39,6 @@ if (platform === 'darwin') {
targets = Platform.LINUX.createTarget(['deb', 'zip', '7z', 'apk', 'rpm', 'AppImage', 'pacman'], arch)
}
-const config = {
- appId: `io.freetubeapp.${name}`,
- copyright: 'Copyleft © 2020-2023 freetubeapp@protonmail.com',
- // asar: false,
- // compression: 'store',
- productName,
- directories: {
- output: './build/',
- },
- protocols: [
- {
- name: "FreeTube",
- schemes: [
- "freetube"
- ]
- }
- ],
- files: [
- '_icons/iconColor.*',
- 'icon.svg',
- './dist/**/*',
- '!dist/web/*',
- '!node_modules/**/*',
- ],
- dmg: {
- contents: [
- {
- path: '/Applications',
- type: 'link',
- x: 410,
- y: 230,
- },
- {
- type: 'file',
- x: 130,
- y: 230,
- },
- ],
- window: {
- height: 380,
- width: 540,
- }
- },
- linux: {
- category: 'Network',
- icon: '_icons/icon.svg',
- target: ['deb', 'zip', '7z', 'apk', 'rpm', 'AppImage', 'pacman'],
- },
- // See the following issues for more information
- // https://github.com/jordansissel/fpm/issues/1503
- // https://github.com/jgraph/drawio-desktop/issues/259
- rpm: {
- fpm: [`--rpm-rpmbuild-define=_build_id_links none`]
- },
- deb: {
- depends: [
- "libgtk-3-0",
- "libnotify4",
- "libnss3",
- "libxss1",
- "libxtst6",
- "xdg-utils",
- "libatspi2.0-0",
- "libuuid1",
- "libsecret-1-0"
- ]
- },
- mac: {
- category: 'public.app-category.utilities',
- icon: '_icons/iconMac.icns',
- target: ['dmg', 'zip', '7z'],
- type: 'distribution',
- extendInfo: {
- CFBundleURLTypes: [
- 'freetube'
- ],
- CFBundleURLSchemes: [
- 'freetube'
- ]
- }
- },
- win: {
- icon: '_icons/icon.ico',
- target: ['nsis', 'zip', '7z', 'portable'],
- },
- nsis: {
- allowToChangeInstallationDirectory: true,
- oneClick: false,
- },
-}
-
builder
.build({
targets,
diff --git a/_scripts/ebuilder.config.js b/_scripts/ebuilder.config.js
new file mode 100644
index 000000000000..0300e7581a3f
--- /dev/null
+++ b/_scripts/ebuilder.config.js
@@ -0,0 +1,94 @@
+const { name, productName } = require('../package.json')
+
+const config = {
+ appId: `io.freetubeapp.${name}`,
+ copyright: 'Copyleft © 2020-2023 freetubeapp@protonmail.com',
+ // asar: false,
+ // compression: 'store',
+ productName,
+ directories: {
+ output: './build/',
+ },
+ protocols: [
+ {
+ name: "FreeTube",
+ schemes: [
+ "freetube"
+ ]
+ }
+ ],
+ files: [
+ '_icons/iconColor.*',
+ 'icon.svg',
+ './dist/**/*',
+ '!dist/web/*',
+ '!node_modules/**/*',
+ ],
+ dmg: {
+ contents: [
+ {
+ path: '/Applications',
+ type: 'link',
+ x: 410,
+ y: 230,
+ },
+ {
+ type: 'file',
+ x: 130,
+ y: 230,
+ },
+ ],
+ window: {
+ height: 380,
+ width: 540,
+ }
+ },
+ linux: {
+ category: 'Network',
+ icon: '_icons/icon.svg',
+ target: ['deb', 'zip', '7z', 'apk', 'rpm', 'AppImage', 'pacman'],
+ },
+ // See the following issues for more information
+ // https://github.com/jordansissel/fpm/issues/1503
+ // https://github.com/jgraph/drawio-desktop/issues/259
+ rpm: {
+ fpm: [`--rpm-rpmbuild-define=_build_id_links none`]
+ },
+ deb: {
+ depends: [
+ "libgtk-3-0",
+ "libnotify4",
+ "libnss3",
+ "libxss1",
+ "libxtst6",
+ "xdg-utils",
+ "libatspi2.0-0",
+ "libuuid1",
+ "libsecret-1-0"
+ ]
+ },
+ mac: {
+ category: 'public.app-category.utilities',
+ icon: '_icons/iconMac.icns',
+ target: ['dmg', 'zip', '7z'],
+ type: 'distribution',
+ extendInfo: {
+ CFBundleURLTypes: [
+ 'freetube'
+ ],
+ CFBundleURLSchemes: [
+ 'freetube'
+ ]
+ }
+ },
+ win: {
+ icon: '_icons/icon.ico',
+ target: ['nsis', 'zip', '7z', 'portable'],
+ },
+ nsis: {
+ allowToChangeInstallationDirectory: true,
+ oneClick: false,
+ },
+}
+
+module.exports = config