From 8af09a731ba859a65d6db2515a82ad86c7f1d149 Mon Sep 17 00:00:00 2001 From: Chloris Date: Thu, 1 Sep 2022 06:50:50 +0200 Subject: [PATCH] New package: FreeTube-0.17.1 --- srcpkgs/FreeTube/files/FreeTube.desktop | 10 ++++ srcpkgs/FreeTube/files/FreeTube.sh | 3 ++ .../patches/do-not-download-electron.diff | 10 ++++ srcpkgs/FreeTube/patches/package-to-dir.diff | 20 ++++++++ srcpkgs/FreeTube/template | 51 +++++++++++++++++++ 5 files changed, 94 insertions(+) create mode 100644 srcpkgs/FreeTube/files/FreeTube.desktop create mode 100644 srcpkgs/FreeTube/files/FreeTube.sh create mode 100644 srcpkgs/FreeTube/patches/do-not-download-electron.diff create mode 100644 srcpkgs/FreeTube/patches/package-to-dir.diff create mode 100644 srcpkgs/FreeTube/template diff --git a/srcpkgs/FreeTube/files/FreeTube.desktop b/srcpkgs/FreeTube/files/FreeTube.desktop new file mode 100644 index 000000000000..c7625f4b0a2c --- /dev/null +++ b/srcpkgs/FreeTube/files/FreeTube.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=FreeTube +GenericName=YouTube Player +Comment=Open source desktop YouTube player built with privacy in mind +Exec=FreeTube %U +Terminal=false +Type=Application +Icon=FreeTube +MimeType=x-scheme-handler/freetube; +Categories=Network; diff --git a/srcpkgs/FreeTube/files/FreeTube.sh b/srcpkgs/FreeTube/files/FreeTube.sh new file mode 100644 index 000000000000..369291853a94 --- /dev/null +++ b/srcpkgs/FreeTube/files/FreeTube.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +exec electron19 /usr/lib/FreeTube/app.asar "$@" diff --git a/srcpkgs/FreeTube/patches/do-not-download-electron.diff b/srcpkgs/FreeTube/patches/do-not-download-electron.diff new file mode 100644 index 000000000000..2c2fe847d9f3 --- /dev/null +++ b/srcpkgs/FreeTube/patches/do-not-download-electron.diff @@ -0,0 +1,10 @@ +--- a/_scripts/build.js 2022-08-12 04:09:42.000000000 +0200 ++++ b/_scripts/build.js 2022-08-31 21:07:40.837066904 +0200 +@@ -39,6 +39,7 @@ + const config = { + appId: `io.freetubeapp.${name}`, + copyright: 'Copyleft © 2020-2021 freetubeapp@protonmail.com', ++ electronDist: '/usr/lib/non-existent-electron', + // asar: false, + // compression: 'store', + productName, diff --git a/srcpkgs/FreeTube/patches/package-to-dir.diff b/srcpkgs/FreeTube/patches/package-to-dir.diff new file mode 100644 index 000000000000..f92d50d82432 --- /dev/null +++ b/srcpkgs/FreeTube/patches/package-to-dir.diff @@ -0,0 +1,20 @@ +--- a/_scripts/build.js 2022-08-12 04:09:42.000000000 +0200 ++++ b/_scripts/build.js 2022-08-31 21:06:38.025503775 +0200 +@@ -33,7 +33,7 @@ + arch = Arch.armv7l + } + +- targets = Platform.LINUX.createTarget(['deb', 'zip', 'apk', 'rpm', 'AppImage', 'pacman'], arch) ++ targets = Platform.LINUX.createTarget(['dir'], arch) + } + + const config = { +@@ -97,7 +97,7 @@ + linux: { + category: 'Network', + icon: '_icons/icon.svg', +- target: ['deb', 'zip', 'apk', 'rpm', 'AppImage', 'pacman'], ++ target: ['dir'], + }, + // See the following issues for more information + // https://github.com/jordansissel/fpm/issues/1503 diff --git a/srcpkgs/FreeTube/template b/srcpkgs/FreeTube/template new file mode 100644 index 000000000000..46656c2bfd91 --- /dev/null +++ b/srcpkgs/FreeTube/template @@ -0,0 +1,51 @@ +# Template file for 'FreeTube' +pkgname=FreeTube +version=0.17.1 +revision=1 +wrksrc="${pkgname}-${version}-beta" +hostmakedepends="git nodejs yarn" +depends="electron19 gtk+3 nss" +short_desc="Open source desktop YouTube player built with privacy in mind" +maintainer="Chloris " +license="AGPL-3.0-or-later" +homepage="https://freetubeapp.io/" +changelog="https://github.com/FreeTubeApp/FreeTube/releases" +distfiles="https://github.com/FreeTubeApp/FreeTube/archive/refs/tags/v${version}-beta.tar.gz" +checksum=7ae2e27d38b200c3b9a421bb1b794ef330d21c3e2f1550e50e27ff02a10a7d07 + +do_build() { + yarn --cache-folder './yarn-cache' install + npm --cache './npm-cache' run build +} + +do_install() { + vmkdir "usr/lib/${pkgname}" + vinstall 'build/linux-unpacked/resources/app.asar' 644 "usr/lib/${pkgname}" + + vdoc 'README.md' + vlicense 'LICENSE' + + vinstall '_icons/icon.svg' 644 'usr/share/pixmaps' "${pkgname}.svg" + vinstall "${FILESDIR}/${pkgname}.desktop" 644 'usr/share/applications' + vbin "${FILESDIR}/${pkgname}.sh" "${pkgname}" +} + +# +# BUILD PROCESS NOTE +# +# npm will try to either download Electron or copy local Electron into into the +# build dir. Since one of the patches directs it to use an unexistent local +# installation of Electron, the 'copying Electron' step will fail with error +# 'Error: ENOENT: no such file or directory'. +# +# This error can be safely ignored - the only needed product of the build +# process is 'app.asar'. Once installed, system installation of Electron will +# be used to run the app. +# + +# +# DEPENDENCIES NOTE +# +# npm packages the app with Electron 16 by default. This version is not +# available in Void repos, so the package uses Electron 19 instead. +#