diff options
author | Mark Wagie | 2021-11-09 18:43:20 -0700 |
---|---|---|
committer | Mark Wagie | 2021-11-09 18:43:20 -0700 |
commit | eb98832eb2c75f8c52d201d3883c6b30268b03ea (patch) | |
tree | 28021a707f6a5247bd8844803e9cf5a397bfd964 | |
parent | c0b78e43dd7e010b764d06421ed2a5d37b4d5f48 (diff) | |
download | aur-eb98832eb2c75f8c52d201d3883c6b30268b03ea.tar.gz |
fix build, use system Electron
-rw-r--r-- | .SRCINFO | 20 | ||||
-rw-r--r-- | .gitignore | 9 | ||||
-rw-r--r-- | PKGBUILD | 81 | ||||
-rw-r--r-- | youtube-music.desktop | 9 | ||||
-rw-r--r-- | youtube-music.sh | 4 |
5 files changed, 88 insertions, 35 deletions
@@ -1,18 +1,24 @@ pkgbase = youtube-music-git pkgdesc = YouTube Music Desktop App bundled with custom plugins (and built-in ad blocker / downloader) - pkgver = r898.a47c906 + pkgver = 1.14.0.r0.gf40ed04 pkgrel = 1 url = https://th-ch.github.io/youtube-music arch = x86_64 license = MIT - depends = gtk3 + makedepends = git + makedepends = nvm + makedepends = yarn + depends = electron depends = libsecret - depends = nss optdepends = libnotify: desktop notifications optdepends = libappindicator-gtk3: tray icon - provides = youtube-music-git - conflicts = youtube-music-bin - source = youtube-music-git::git+https://github.com/th-ch/youtube-music.git - md5sums = SKIP + provides = youtube-music + conflicts = youtube-music + source = git+https://github.com/th-ch/youtube-music.git + source = youtube-music.sh + source = youtube-music.desktop + sha256sums = SKIP + sha256sums = a1d30cedc17ede48b7d627a3797a0918b7bd3c9062e9ed83d61f153c001c1ef8 + sha256sums = 07af59376e13e5dae2e7e38fa09d734a5147d5c344b3aed84c2f3afe22b8af79 pkgname = youtube-music-git diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..af61e50a1e7f --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +# Ignore everything +* + +# But not these files... +!.gitignore +!PKGBUILD +!.SRCINFO +!youtube-music.sh +!youtube-music.desktop @@ -1,43 +1,68 @@ -# Maintainer: Mesmer <ldepaula at gmail dot com> pkgname=youtube-music-git -pkgver=r898.a47c906 -pkgver(){ - cd "$pkgname" - ( set -o pipefail - git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' || - printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" - ) -} +pkgver=1.14.0.r0.gf40ed04 pkgrel=1 +_nodeversion=14 pkgdesc="YouTube Music Desktop App bundled with custom plugins (and built-in ad blocker / downloader)" arch=('x86_64') url="https://th-ch.github.io/youtube-music" license=('MIT') -depends=('gtk3' 'libsecret' 'nss') +depends=('electron' 'libsecret') +makedepends=('git' 'nvm' 'yarn') optdepends=('libnotify: desktop notifications' 'libappindicator-gtk3: tray icon') -provides=("${pkgname}") -conflicts=("youtube-music-bin") -source=("$pkgname::git+https://github.com/th-ch/youtube-music.git") -md5sums=("SKIP") +provides=("${pkgname%-git}") +conflicts=("${pkgname%-git}") +source=('git+https://github.com/th-ch/youtube-music.git' + "${pkgname%-git}.sh" + "${pkgname%-git}.desktop") +sha256sums=('SKIP' + 'a1d30cedc17ede48b7d627a3797a0918b7bd3c9062e9ed83d61f153c001c1ef8' + '07af59376e13e5dae2e7e38fa09d734a5147d5c344b3aed84c2f3afe22b8af79') + +pkgver() { + cd "$srcdir/${pkgname%-git}" + git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' +} -build(){ +_ensure_local_nvm() { + # let's be sure we are starting clean + which nvm >/dev/null 2>&1 && nvm deactivate && nvm unload + export NVM_DIR="$srcdir/.nvm" - cd $srcdir/$pkgname - yarn - yarn build:linux tar.xz - version=$(cat package.json |grep version| cut -d'"' -f4) - bsdtar xfv dist/youtube-music-$version.tar.xz + # The init script returns 3 if version specified + # in ./.nvrc is not (yet) installed in $NVM_DIR + # but nvm itself still gets loaded ok + source /usr/share/nvm/init-nvm.sh || [[ $? != 1 ]] +} +prepare() { +# Use Node.js 14 + _ensure_local_nvm + nvm install "$_nodeversion" } -package(){ - version=$(cat $srcdir/$pkgname/package.json |grep version| cut -d'"' -f4) - - install -d "$pkgdir/opt/Youtube Music/" - install -d "$pkgdir/usr/bin/" - cp $srcdir/$pkgname/youtube-music-$version/* "$pkgdir/opt/Youtube Music/" -r - ln -s "$pkgdir/opt/Youtube Music/youtube-music" $pkgdir/usr/bin/youtube-music - install -Dm644 $srcdir/$pkgname/license -t "$pkgdir/$pkgname/usr/share/licenses/$pkgname" +build() { + cd "$srcdir/${pkgname%-git}" + electronDist=/usr/lib/electron + electronVer=$(sed s/^v// /usr/lib/electron/version) + _ensure_local_nvm + yarn config set cache-folder "$srcdir/yarn-cache" + yarn install + yarn run clean + npx electron-builder --linux dir \ + $dist -c.electronDist=$electronDist -c.electronVersion=$electronVer } +package() { + cd "$srcdir/${pkgname%-git}" + install -Dm644 dist/linux-unpacked/resources/app.asar -t "$pkgdir/usr/lib/${pkgname%-git}" + install -Dm755 "$srcdir/${pkgname%-git}.sh" "$pkgdir/usr/bin/${pkgname%-git}" + install -Dm644 "$srcdir/${pkgname%-git}.desktop" -t "$pkgdir/usr/share/applications" + install -Dm644 license -t "$pkgdir/usr/share/licenses/${pkgname%-git}" + + for icon_size in 16 24 32 48 64 128 256 512 1024; do + icons_dir=/usr/share/icons/hicolor/${icon_size}x${icon_size}/apps + install -Dm644 assets/generated/icons/png/${icon_size}x${icon_size}.png \ + $pkgdir$icons_dir/${pkgname%-git}.png + done +} diff --git a/youtube-music.desktop b/youtube-music.desktop new file mode 100644 index 000000000000..434c12a770e1 --- /dev/null +++ b/youtube-music.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Name=YouTube Music +Exec=youtube-music +Terminal=false +Type=Application +Icon=youtube-music +StartupWMClass=YouTube Music +Comment=YouTube Music Desktop App - including custom plugins +Categories=AudioVideo; diff --git a/youtube-music.sh b/youtube-music.sh new file mode 100644 index 000000000000..b67b77e3adfb --- /dev/null +++ b/youtube-music.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +export ELECTRON_IS_DEV=0 +exec electron /usr/lib/youtube-music/app.asar "$@" |