From 382a5a021f3278b79711cac076ed7180eee28afc Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Sat, 3 Aug 2024 19:15:02 +0700 Subject: [PATCH 01/16] add: youtube-music --- anda/apps/youtube-music/anda.hcl | 5 ++ anda/apps/youtube-music/update.rhai | 1 + anda/apps/youtube-music/youtube-music.desktop | 10 +++ anda/apps/youtube-music/youtube-music.spec | 78 +++++++++++++++++++ 4 files changed, 94 insertions(+) create mode 100644 anda/apps/youtube-music/anda.hcl create mode 100644 anda/apps/youtube-music/update.rhai create mode 100644 anda/apps/youtube-music/youtube-music.desktop create mode 100644 anda/apps/youtube-music/youtube-music.spec diff --git a/anda/apps/youtube-music/anda.hcl b/anda/apps/youtube-music/anda.hcl new file mode 100644 index 0000000000..6d24c891fe --- /dev/null +++ b/anda/apps/youtube-music/anda.hcl @@ -0,0 +1,5 @@ +project pkg { + rpm { + spec = "youtube-music.spec" + } +} diff --git a/anda/apps/youtube-music/update.rhai b/anda/apps/youtube-music/update.rhai new file mode 100644 index 0000000000..97c0f91837 --- /dev/null +++ b/anda/apps/youtube-music/update.rhai @@ -0,0 +1 @@ +rpm.version(gh("th-ch/youtube-music")); diff --git a/anda/apps/youtube-music/youtube-music.desktop b/anda/apps/youtube-music/youtube-music.desktop new file mode 100644 index 0000000000..b4bad28404 --- /dev/null +++ b/anda/apps/youtube-music/youtube-music.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=YouTube Music +Exec=/usr/bin/youtube-music --no-sandbox %U +TryExec=/usr/bin/youtube-music +Icon=youtube-music +Terminal=false +Type=Application +StartupWMClass=YouTube Music +Comment=YouTube Music Desktop App - including custom plugins +Categories=AudioVideo; diff --git a/anda/apps/youtube-music/youtube-music.spec b/anda/apps/youtube-music/youtube-music.spec new file mode 100644 index 0000000000..9e684693b2 --- /dev/null +++ b/anda/apps/youtube-music/youtube-music.spec @@ -0,0 +1,78 @@ +%global pnpm_version 8 +%define debug_package %nil + + +# macro shorthand for calling pnpm +%global pnpm npx pnpm@%{pnpm_version} + +Name: youtube-music +Version: 3.5.1 +Release: 1%{?dist} +Summary: YouTube Music Desktop App bundled with custom plugins (and built-in ad blocker / downloader) +Source1: youtube-music.desktop +License: MIT +URL: https://github.com/th-ch/youtube-music + + +BuildRequires: nodejs +BuildRequires: npm +BuildRequires: git-core gcc make +BuildRequires: python3 gcc-c++ # Required for usocket native module built with node-gyp + +%description +YouTube Music Desktop App bundled with custom plugins (and built-in ad blocker / downloader) + + +%prep +rm -rf ./* +git clone --recursive %{url} . +git checkout v%{version} + + + +%build +%pnpm install --no-frozen-lockfile +%pnpm build +%pnpm electron-builder --linux --dir + + + +%install + +# Install assets +install -d -m 0755 %{buildroot}%{_datadir}/icons/hicolor/1024x1024/apps +install -d -m 0755 %{buildroot}%{_datadir}/icons/hicolor/scalable/apps + +# Copy icon files +pushd pack/linux-unpacked/resources/app.asar.unpacked/assets +install -m 0644 youtube-music.png %{buildroot}%{_datadir}/icons/hicolor/1024x1024/apps/youtube-music.png +install -m 0644 youtube-music.svg %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/youtube-music.svg +install -m 0644 youtube-music-tray-paused.png %{buildroot}%{_datadir}/icons/hicolor/1024x1024/apps/youtube-music-tray-paused.png +install -m 0644 youtube-music-tray.png %{buildroot}%{_datadir}/icons/hicolor/1024x1024/apps/youtube-music-tray.png +popd + +# Actually install the app + +install -d -m 0755 %{buildroot}%{_datadir}/youtube-music +# Delete unpacked asar files before copying +rm -rfv pack/linux-unpacked/resources/app.asar.unpacked +cp -rv pack/linux-unpacked/* %{buildroot}%{_datadir}/youtube-music +install -d -m 0755 %{buildroot}%{_bindir} +ln -svf %{_datadir}/youtube-music/youtube-music %{buildroot}%{_bindir}/youtube-music + +# Install desktop file +install -D -m 0644 %{SOURCE1} %{buildroot}%{_datadir}/applications/youtube-music.desktop + +%files +%license license +%doc README.md +%doc docs +%{_bindir}/youtube-music +%{_datadir}/youtube-music +%{_datadir}/icons/hicolor/*/apps/youtube-music* + + + +%changelog +* Sat Aug 03 2024 Cappy Ishihara +- From d49e7f404279bb5ec6267130003d441d87f09843 Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Sat, 3 Aug 2024 19:21:43 +0700 Subject: [PATCH 02/16] fix buildrequires line? --- anda/apps/youtube-music/youtube-music.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/anda/apps/youtube-music/youtube-music.spec b/anda/apps/youtube-music/youtube-music.spec index 9e684693b2..fc3d0cc58b 100644 --- a/anda/apps/youtube-music/youtube-music.spec +++ b/anda/apps/youtube-music/youtube-music.spec @@ -17,7 +17,8 @@ URL: https://github.com/th-ch/youtube-music BuildRequires: nodejs BuildRequires: npm BuildRequires: git-core gcc make -BuildRequires: python3 gcc-c++ # Required for usocket native module built with node-gyp +# Required for usocket native module built with node-gyp +BuildRequires: python3 gcc-c++ %description YouTube Music Desktop App bundled with custom plugins (and built-in ad blocker / downloader) From 55c0cd3823c77e26e2f7ac5e42c34a016cfea848 Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Sat, 3 Aug 2024 19:26:17 +0700 Subject: [PATCH 03/16] oops --- anda/apps/youtube-music/youtube-music.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/anda/apps/youtube-music/youtube-music.spec b/anda/apps/youtube-music/youtube-music.spec index fc3d0cc58b..ec8ee3918a 100644 --- a/anda/apps/youtube-music/youtube-music.spec +++ b/anda/apps/youtube-music/youtube-music.spec @@ -71,6 +71,7 @@ install -D -m 0644 %{SOURCE1} %{buildroot}%{_datadir}/applications/youtube-music %{_bindir}/youtube-music %{_datadir}/youtube-music %{_datadir}/icons/hicolor/*/apps/youtube-music* +%{_datadir}/applications/youtube-music.desktop From 58d3c16dd07267ba180ee5f95b741cdaae16b89d Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Sat, 3 Aug 2024 19:58:15 +0700 Subject: [PATCH 04/16] use NodeJS 22 for build? --- anda/apps/youtube-music/youtube-music.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/anda/apps/youtube-music/youtube-music.spec b/anda/apps/youtube-music/youtube-music.spec index ec8ee3918a..a46dfbfc1b 100644 --- a/anda/apps/youtube-music/youtube-music.spec +++ b/anda/apps/youtube-music/youtube-music.spec @@ -14,8 +14,8 @@ License: MIT URL: https://github.com/th-ch/youtube-music -BuildRequires: nodejs -BuildRequires: npm +BuildRequires: nodejs22 +BuildRequires: nodejs22-npm BuildRequires: git-core gcc make # Required for usocket native module built with node-gyp BuildRequires: python3 gcc-c++ From ba9940fea5cfb4dd3f4d4143dcefa8126e3e9b77 Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Sat, 3 Aug 2024 20:01:32 +0700 Subject: [PATCH 05/16] use pnpm 9 --- anda/apps/youtube-music/youtube-music.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/anda/apps/youtube-music/youtube-music.spec b/anda/apps/youtube-music/youtube-music.spec index a46dfbfc1b..0dd34ffac3 100644 --- a/anda/apps/youtube-music/youtube-music.spec +++ b/anda/apps/youtube-music/youtube-music.spec @@ -1,4 +1,4 @@ -%global pnpm_version 8 +%global pnpm_version 9 %define debug_package %nil From 3601c778027c8b1428bd2aaddb854d27a318fe28 Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Sat, 3 Aug 2024 20:23:08 +0700 Subject: [PATCH 06/16] use pnpm package from fedora and normal nodejs to see if it would still faikl --- anda/apps/youtube-music/youtube-music.spec | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/anda/apps/youtube-music/youtube-music.spec b/anda/apps/youtube-music/youtube-music.spec index 0dd34ffac3..729d700072 100644 --- a/anda/apps/youtube-music/youtube-music.spec +++ b/anda/apps/youtube-music/youtube-music.spec @@ -1,4 +1,3 @@ -%global pnpm_version 9 %define debug_package %nil @@ -14,8 +13,8 @@ License: MIT URL: https://github.com/th-ch/youtube-music -BuildRequires: nodejs22 -BuildRequires: nodejs22-npm +BuildRequires: nodejs +BuildRequires: nodejs-npm pnpm BuildRequires: git-core gcc make # Required for usocket native module built with node-gyp BuildRequires: python3 gcc-c++ @@ -32,9 +31,9 @@ git checkout v%{version} %build -%pnpm install --no-frozen-lockfile -%pnpm build -%pnpm electron-builder --linux --dir +pnpm install --no-frozen-lockfile +pnpm build +pnpm electron-builder --linux --dir From dea3994f2877e1ffce7e0565f0d057d5144fcdaa Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Sun, 4 Aug 2024 00:06:39 +0700 Subject: [PATCH 07/16] try node 18 --- anda/apps/youtube-music/youtube-music.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/anda/apps/youtube-music/youtube-music.spec b/anda/apps/youtube-music/youtube-music.spec index 729d700072..1c76dca93c 100644 --- a/anda/apps/youtube-music/youtube-music.spec +++ b/anda/apps/youtube-music/youtube-music.spec @@ -13,8 +13,8 @@ License: MIT URL: https://github.com/th-ch/youtube-music -BuildRequires: nodejs -BuildRequires: nodejs-npm pnpm +BuildRequires: nodejs18 +BuildRequires: nodejs18-npm pnpm BuildRequires: git-core gcc make # Required for usocket native module built with node-gyp BuildRequires: python3 gcc-c++ From 01b32d284a5c9f18395d785b0f2012947aca1e5c Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Thu, 8 Aug 2024 18:13:26 +0700 Subject: [PATCH 08/16] attempt to conflict node 22 on build --- anda/apps/youtube-music/youtube-music.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/anda/apps/youtube-music/youtube-music.spec b/anda/apps/youtube-music/youtube-music.spec index 1c76dca93c..f96d5479ac 100644 --- a/anda/apps/youtube-music/youtube-music.spec +++ b/anda/apps/youtube-music/youtube-music.spec @@ -18,6 +18,7 @@ BuildRequires: nodejs18-npm pnpm BuildRequires: git-core gcc make # Required for usocket native module built with node-gyp BuildRequires: python3 gcc-c++ +BuildConflicts: nodejs >= 22 %description YouTube Music Desktop App bundled with custom plugins (and built-in ad blocker / downloader) From fa73a060629f0dab53e17de320e906dddff87e34 Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Thu, 8 Aug 2024 18:33:44 +0700 Subject: [PATCH 09/16] wtf --- anda/apps/youtube-music/youtube-music.spec | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/anda/apps/youtube-music/youtube-music.spec b/anda/apps/youtube-music/youtube-music.spec index f96d5479ac..41b997a820 100644 --- a/anda/apps/youtube-music/youtube-music.spec +++ b/anda/apps/youtube-music/youtube-music.spec @@ -12,13 +12,15 @@ Source1: youtube-music.desktop License: MIT URL: https://github.com/th-ch/youtube-music +# For some unknown reason, PNPM is not working with Node.js 22 on Aarch64 devices. +# todo: investigate why +#ExclusiveArch: x86_64 BuildRequires: nodejs18 BuildRequires: nodejs18-npm pnpm BuildRequires: git-core gcc make # Required for usocket native module built with node-gyp BuildRequires: python3 gcc-c++ -BuildConflicts: nodejs >= 22 %description YouTube Music Desktop App bundled with custom plugins (and built-in ad blocker / downloader) @@ -32,7 +34,7 @@ git checkout v%{version} %build -pnpm install --no-frozen-lockfile +pnpm install pnpm build pnpm electron-builder --linux --dir From a5b5c3dd073467d758afaf8bdcdaf4bad1e9e7ea Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Thu, 8 Aug 2024 18:37:11 +0700 Subject: [PATCH 10/16] forgot to add changelog --- anda/apps/youtube-music/youtube-music.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/anda/apps/youtube-music/youtube-music.spec b/anda/apps/youtube-music/youtube-music.spec index 41b997a820..8515caaa7b 100644 --- a/anda/apps/youtube-music/youtube-music.spec +++ b/anda/apps/youtube-music/youtube-music.spec @@ -79,4 +79,4 @@ install -D -m 0644 %{SOURCE1} %{buildroot}%{_datadir}/applications/youtube-music %changelog * Sat Aug 03 2024 Cappy Ishihara -- +- Initial Release From fdc705e87c7c16746f878daa59f5e18349206504 Mon Sep 17 00:00:00 2001 From: madonuko Date: Thu, 8 Aug 2024 19:42:03 +0800 Subject: [PATCH 11/16] try vendoring pnpm with nodejs18 --- anda/apps/youtube-music/youtube-music.spec | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/anda/apps/youtube-music/youtube-music.spec b/anda/apps/youtube-music/youtube-music.spec index 8515caaa7b..fd74bbaa20 100644 --- a/anda/apps/youtube-music/youtube-music.spec +++ b/anda/apps/youtube-music/youtube-music.spec @@ -1,5 +1,5 @@ %define debug_package %nil - +%define pnpm_version 9 # macro shorthand for calling pnpm %global pnpm npx pnpm@%{pnpm_version} @@ -17,7 +17,7 @@ URL: https://github.com/th-ch/youtube-music #ExclusiveArch: x86_64 BuildRequires: nodejs18 -BuildRequires: nodejs18-npm pnpm +BuildRequires: nodejs18-npm BuildRequires: git-core gcc make # Required for usocket native module built with node-gyp BuildRequires: python3 gcc-c++ @@ -34,9 +34,9 @@ git checkout v%{version} %build -pnpm install -pnpm build -pnpm electron-builder --linux --dir +%pnpm install +%pnpm build +%pnpm electron-builder --linux --dir From 65300cd0cd0d39e7e20980cc5888cf7d716a0ec7 Mon Sep 17 00:00:00 2001 From: madonuko Date: Thu, 8 Aug 2024 19:47:32 +0800 Subject: [PATCH 12/16] Revert "try vendoring pnpm with nodejs18" This reverts commit fdc705e87c7c16746f878daa59f5e18349206504. --- anda/apps/youtube-music/youtube-music.spec | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/anda/apps/youtube-music/youtube-music.spec b/anda/apps/youtube-music/youtube-music.spec index fd74bbaa20..8515caaa7b 100644 --- a/anda/apps/youtube-music/youtube-music.spec +++ b/anda/apps/youtube-music/youtube-music.spec @@ -1,5 +1,5 @@ %define debug_package %nil -%define pnpm_version 9 + # macro shorthand for calling pnpm %global pnpm npx pnpm@%{pnpm_version} @@ -17,7 +17,7 @@ URL: https://github.com/th-ch/youtube-music #ExclusiveArch: x86_64 BuildRequires: nodejs18 -BuildRequires: nodejs18-npm +BuildRequires: nodejs18-npm pnpm BuildRequires: git-core gcc make # Required for usocket native module built with node-gyp BuildRequires: python3 gcc-c++ @@ -34,9 +34,9 @@ git checkout v%{version} %build -%pnpm install -%pnpm build -%pnpm electron-builder --linux --dir +pnpm install +pnpm build +pnpm electron-builder --linux --dir From ee82eb294184d13aa861932f0f0d03283550f53f Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Thu, 8 Aug 2024 18:51:07 +0700 Subject: [PATCH 13/16] vendor pnpm and node on buildtime --- anda/apps/youtube-music/youtube-music.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/anda/apps/youtube-music/youtube-music.spec b/anda/apps/youtube-music/youtube-music.spec index 8515caaa7b..d80dc555b9 100644 --- a/anda/apps/youtube-music/youtube-music.spec +++ b/anda/apps/youtube-music/youtube-music.spec @@ -16,8 +16,6 @@ URL: https://github.com/th-ch/youtube-music # todo: investigate why #ExclusiveArch: x86_64 -BuildRequires: nodejs18 -BuildRequires: nodejs18-npm pnpm BuildRequires: git-core gcc make # Required for usocket native module built with node-gyp BuildRequires: python3 gcc-c++ @@ -34,6 +32,11 @@ git checkout v%{version} %build +# Vendor PNPM directly instead of installing from packages, because we need to somehow force PNPM to use Node.js 20 +# We are not using Fedora's PNPM because we need to use `pnpm env`, which PNPM does not support when not vendored directly from upstream +curl -fsSL https://get.pnpm.io/install.sh | sh - +source /builddir/.bashrc +pnpm env use --global 20 pnpm install pnpm build pnpm electron-builder --linux --dir From fe4a4c136278913d34045f58ea87232791f96a9e Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Thu, 8 Aug 2024 18:57:41 +0700 Subject: [PATCH 14/16] add packager line --- anda/apps/youtube-music/youtube-music.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/anda/apps/youtube-music/youtube-music.spec b/anda/apps/youtube-music/youtube-music.spec index d80dc555b9..11f5fc598d 100644 --- a/anda/apps/youtube-music/youtube-music.spec +++ b/anda/apps/youtube-music/youtube-music.spec @@ -11,6 +11,7 @@ Summary: YouTube Music Desktop App bundled with custom plugins (and built Source1: youtube-music.desktop License: MIT URL: https://github.com/th-ch/youtube-music +Packager: Cappy Ishihara # For some unknown reason, PNPM is not working with Node.js 22 on Aarch64 devices. # todo: investigate why From 09d5db4a84ba093b79c104d094f9ff7b529f98e3 Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Thu, 8 Aug 2024 18:59:56 +0700 Subject: [PATCH 15/16] debug dir tree --- anda/apps/youtube-music/youtube-music.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/anda/apps/youtube-music/youtube-music.spec b/anda/apps/youtube-music/youtube-music.spec index 11f5fc598d..ec2d69dada 100644 --- a/anda/apps/youtube-music/youtube-music.spec +++ b/anda/apps/youtube-music/youtube-music.spec @@ -51,6 +51,7 @@ install -d -m 0755 %{buildroot}%{_datadir}/icons/hicolor/1024x1024/apps install -d -m 0755 %{buildroot}%{_datadir}/icons/hicolor/scalable/apps # Copy icon files +ls -laR pack pushd pack/linux-unpacked/resources/app.asar.unpacked/assets install -m 0644 youtube-music.png %{buildroot}%{_datadir}/icons/hicolor/1024x1024/apps/youtube-music.png install -m 0644 youtube-music.svg %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/youtube-music.svg From d9b3e45a13f698bb30126abb10dee068454e46a7 Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Thu, 8 Aug 2024 19:11:48 +0700 Subject: [PATCH 16/16] arch-specific directories fix --- anda/apps/youtube-music/youtube-music.spec | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/anda/apps/youtube-music/youtube-music.spec b/anda/apps/youtube-music/youtube-music.spec index ec2d69dada..a86a6c4e21 100644 --- a/anda/apps/youtube-music/youtube-music.spec +++ b/anda/apps/youtube-music/youtube-music.spec @@ -52,7 +52,11 @@ install -d -m 0755 %{buildroot}%{_datadir}/icons/hicolor/scalable/apps # Copy icon files ls -laR pack +%ifarch aarch64 +pushd pack/linux-arm64-unpacked/resources/app.asar.unpacked/assets +%else pushd pack/linux-unpacked/resources/app.asar.unpacked/assets +%endif install -m 0644 youtube-music.png %{buildroot}%{_datadir}/icons/hicolor/1024x1024/apps/youtube-music.png install -m 0644 youtube-music.svg %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/youtube-music.svg install -m 0644 youtube-music-tray-paused.png %{buildroot}%{_datadir}/icons/hicolor/1024x1024/apps/youtube-music-tray-paused.png @@ -63,8 +67,8 @@ popd install -d -m 0755 %{buildroot}%{_datadir}/youtube-music # Delete unpacked asar files before copying -rm -rfv pack/linux-unpacked/resources/app.asar.unpacked -cp -rv pack/linux-unpacked/* %{buildroot}%{_datadir}/youtube-music +rm -rfv pack/linux*-unpacked/resources/app.asar.unpacked +cp -rv pack/linux*-unpacked/* %{buildroot}%{_datadir}/youtube-music install -d -m 0755 %{buildroot}%{_bindir} ln -svf %{_datadir}/youtube-music/youtube-music %{buildroot}%{_bindir}/youtube-music