summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorzxp198210052024-07-11 11:15:16 +0800
committerzxp198210052024-07-11 11:15:16 +0800
commitfadcbb99d3614bfc61f478a40a4edcef27aea2c9 (patch)
tree446710322af0e41002bc4ce8fd9d073d4ba41e18
parent7dbebaba7910d79387a85ffebc6cbb93183d427c (diff)
downloadaur-fadcbb99d3614bfc61f478a40a4edcef27aea2c9.tar.gz
fix errors
-rw-r--r--.SRCINFO6
-rw-r--r--PKGBUILD16
-rw-r--r--youtube-music-next.sh21
3 files changed, 34 insertions, 9 deletions
diff --git a/.SRCINFO b/.SRCINFO
index c1e050863ed7..826b74517c18 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,19 +1,21 @@
pkgbase = youtube-music-next-bin
pkgdesc = YouTube Music Desktop App bundled with custom plugins (and built-in ad blocker / downloader). forked from th-ch/youtube-music.
pkgver = 2.1.0
- pkgrel = 1
+ pkgrel = 2
url = https://organization.github.io/youtube-music-next/
arch = x86_64
license = MIT
+ makedepends = asar
depends = electron29
provides = youtube-music=2.1.0
conflicts = youtube-music-next
conflicts = youtube-music
source = youtube-music-next-2.1.0.deb::https://github.com/organization/youtube-music-next/releases/download/v2.1.0/youtube-music_2.1.0_amd64.deb
source = LICENSE-2.1.0::https://raw.githubusercontent.com/organization/youtube-music-next/v2.1.0/license
+ source = error-2.1.0.html::https://github.com/organization/youtube-music-next/blob/v2.1.0/error.html
source = youtube-music-next.sh
sha256sums = 11b9e856d07f3408016cc38b6163ef55818b37cf255f2f16be9da0debcaf281a
sha256sums = e7e14b3b771ecadb23f6ee0b6f99d1553e385e35cdb44fc8e36ee7c878dacd08
- sha256sums = dc0c5ca385ad81a08315a91655c7c064b5bf110eada55e61265633ae198b39f8
+ sha256sums = 2b2e8aeed33fd71c521e49fd54fb2fa81218d16aef8bccb88d77909055ab8051
pkgname = youtube-music-next-bin
diff --git a/PKGBUILD b/PKGBUILD
index 01d05b046f51..dab6aa2e7a0e 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,7 +4,7 @@ pkgname="${_pkgname}-next-bin"
_appname="YouTube Music"
pkgver=2.1.0
_electronversion=29
-pkgrel=1
+pkgrel=2
pkgdesc="YouTube Music Desktop App bundled with custom plugins (and built-in ad blocker / downloader). forked from th-ch/youtube-music."
arch=("x86_64")
url="https://organization.github.io/youtube-music-next/"
@@ -18,27 +18,37 @@ conflicts=(
depends=(
"electron${_electronversion}"
)
+makedepends=(
+ 'asar'
+)
source=(
"${pkgname%-bin}-${pkgver}.deb::${_ghurl}/releases/download/v${pkgver}/${_pkgname}_${pkgver}_amd64.deb"
"LICENSE-${pkgver}::https://raw.githubusercontent.com/organization/youtube-music-next/v${pkgver}/license"
+ "error-${pkgver}.html::https://github.com/organization/youtube-music-next/blob/v2.1.0/error.html"
"${pkgname%-bin}.sh"
)
sha256sums=('11b9e856d07f3408016cc38b6163ef55818b37cf255f2f16be9da0debcaf281a'
'e7e14b3b771ecadb23f6ee0b6f99d1553e385e35cdb44fc8e36ee7c878dacd08'
- 'dc0c5ca385ad81a08315a91655c7c064b5bf110eada55e61265633ae198b39f8')
+ '2b2e8aeed33fd71c521e49fd54fb2fa81218d16aef8bccb88d77909055ab8051')
build() {
sed -e "s|@electronversion@|${_electronversion}|g" \
-e "s|@appname@|${pkgname%-bin}|g" \
-e "s|@runname@|app.asar|g" \
+ -e "s|@cfgdirname@|${_appname}|g" \
-e "s|@options@|env ELECTRON_OZONE_PLATFORM_HINT=auto|g" \
-i "${srcdir}/${pkgname%-bin}.sh"
bsdtar -xf "${srcdir}/data."*
sed "s|\"\/opt\/${_appname}\/${_pkgname}\"|${pkgname%-bin}|g;s|Icon=${_pkgname}|Icon=${pkgname%-bin}|g" \
-i "${srcdir}/usr/share/applications/${_pkgname}.desktop"
+ asar e "${srcdir}/opt/${_appname}/resources/app.asar" "${srcdir}/app.asar.unpacked"
+ sed "s|process.resourcesPath|\"\/usr\/lib\/${pkgname%-bin}\"|g" -i "${srcdir}/app.asar.unpacked/dist/index.js"
+ install -Dm644 "${srcdir}/error-${pkgver}.html" "${srcdir}/app.asar.unpacked/dist/error.html"
+ asar p "${srcdir}/app.asar.unpacked" "${srcdir}/app.asar"
}
package() {
install -Dm755 "${srcdir}/${pkgname%-bin}.sh" "${pkgdir}/usr/bin/${pkgname%-bin}"
- install -Dm644 "${srcdir}/opt/${_appname}/resources/app.asar" -t "${pkgdir}/usr/lib/${pkgname%-bin}"
+ install -Dm644 "${srcdir}/app.asar" -t "${pkgdir}/usr/lib/${pkgname%-bin}"
+ install -Dm644 "${srcdir}/opt/${_appname}/resources/app-update.yml" -t "${pkgdir}/usr/lib/${pkgname%-bin}"
for _icons in 16x16 24x24 32x32 48x48 64x64 128x128 256x256 512x512 1024x1024;do
install -Dm644 "${srcdir}/usr/share/icons/hicolor/${_icons}/apps/${_pkgname}.png" \
"${pkgdir}/usr/share/icons/hicolor/${_icons}/apps/${pkgname%-bin}.png"
diff --git a/youtube-music-next.sh b/youtube-music-next.sh
index 7ddcaab8d734..4cfe3ac09dd8 100644
--- a/youtube-music-next.sh
+++ b/youtube-music-next.sh
@@ -1,16 +1,29 @@
#!/bin/bash
-set -e
+set -o pipefail
_APPDIR="/usr/lib/@appname@"
_RUNNAME="${_APPDIR}/@runname@"
+_CFGDIR="@cfgdirname@/"
_OPTIONS="@options@"
export PATH="${_APPDIR}:${PATH}"
export LD_LIBRARY_PATH="${_APPDIR}/swiftshader:${_APPDIR}/lib:${LD_LIBRARY_PATH}"
export ELECTRON_IS_DEV=0
export ELECTRON_FORCE_IS_PACKAGED=true
+export ELECTRON_DISABLE_SECURITY_WARNINGS=true
+export ELECTRON_OVERRIDE_DIST_PATH="/usr/bin/electron@electronversion@"
export NODE_ENV=production
+export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
+export _FLAGS_FILE="${XDG_CONFIG_HOME}/${_CFGDIR}@appname@-flags.conf"
+declare -a _USER_FLAGS
+if [[ -f "${_FLAGS_FILE}" ]]; then
+ while read -r line; do
+ if [[ ! "${line}" =~ ^[[:space:]]*#.* ]]; then
+ _USER_FLAGS+=("${line}")
+ fi
+ done < "${_FLAGS_FILE}"
+fi
cd "${_APPDIR}"
-if [[ $EUID -ne 0 ]] || [[ $ELECTRON_RUN_AS_NODE ]]; then
- exec electron@electronversion@ "${_RUNNAME}" "${_OPTIONS}" "$@" || exit $?
+if [[ "${EUID}" -ne 0 ]] || [[ "${ELECTRON_RUN_AS_NODE}" ]]; then
+ exec electron@electronversion@ "${_RUNNAME}" ${_OPTIONS} "${_USER_FLAGS[@]}" "$@"
else
- exec electron@electronversion@ "${_RUNNAME}" "${_OPTIONS}" --no-sandbox "$@" || exit $?
+ exec electron@electronversion@ "${_RUNNAME}" ${_OPTIONS} --no-sandbox "${_USER_FLAGS[@]}" "$@"
fi \ No newline at end of file