diff options
author | zxp19821005 | 2024-05-29 09:02:13 +0800 |
---|---|---|
committer | zxp19821005 | 2024-05-29 09:02:13 +0800 |
commit | 28edfbf5cb95f8d8d3ec41cf3ec9feea2b79bbc8 (patch) | |
tree | 98b185469109049cf39f8373bdf50266c9b9c43f | |
parent | 399ba4cd2514f6fca729121576562b97133afeee (diff) | |
download | aur-m3u8-downloader-bin.tar.gz |
fix errors
-rw-r--r-- | .SRCINFO | 7 | ||||
-rw-r--r-- | PKGBUILD | 10 | ||||
-rw-r--r-- | m3u8-downloader.sh | 21 |
3 files changed, 25 insertions, 13 deletions
@@ -1,19 +1,18 @@ pkgbase = m3u8-downloader-bin pkgdesc = M3U8-Downloader, electron, multi-threading, resumable upload, encrypted video download cache. pkgver = 2.2.8 - pkgrel = 5 + pkgrel = 6 url = https://github.com/12343954/M3U8-Downloader arch = x86_64 license = MIT makedepends = asar - depends = electron24-bin - depends = hicolor-icon-theme + depends = electron24 depends = nodejs provides = m3u8-downloader=2.2.8 conflicts = m3u8-downloader source = m3u8-downloader-2.2.8.deb::https://github.com/12343954/M3U8-Downloader/releases/download/2.2.8/M3U8-Downloader-linux_amd64-2.2.8.deb source = m3u8-downloader.sh sha256sums = 834231de86efb0d346ab90ea6195ea783b63b7dc719139c19ba7e30764049bd3 - sha256sums = dc0c5ca385ad81a08315a91655c7c064b5bf110eada55e61265633ae198b39f8 + sha256sums = 2b2e8aeed33fd71c521e49fd54fb2fa81218d16aef8bccb88d77909055ab8051 pkgname = m3u8-downloader-bin @@ -3,7 +3,7 @@ pkgname=m3u8-downloader-bin _pkgname=M3U8-Downloader pkgver=2.2.8 _electronversion=24 -pkgrel=5 +pkgrel=6 pkgdesc="M3U8-Downloader, electron, multi-threading, resumable upload, encrypted video download cache." arch=("x86_64") url="https://github.com/12343954/M3U8-Downloader" @@ -11,8 +11,7 @@ license=("MIT") provides=("${pkgname%-bin}=${pkgver}") conflicts=("${pkgname%-bin}") depends=( - "electron${_electronversion}-bin" - 'hicolor-icon-theme' + "electron${_electronversion}" 'nodejs' ) makedepends=( @@ -23,16 +22,17 @@ source=( "${pkgname%-bin}.sh" ) sha256sums=('834231de86efb0d346ab90ea6195ea783b63b7dc719139c19ba7e30764049bd3' - 'dc0c5ca385ad81a08315a91655c7c064b5bf110eada55e61265633ae198b39f8') + '2b2e8aeed33fd71c521e49fd54fb2fa81218d16aef8bccb88d77909055ab8051') build() { sed -e "s|@electronversion@|${_electronversion}|" \ -e "s|@appname@|${pkgname%-bin}|g" \ -e "s|@runname@|app.asar|g" \ + -e "s|@cfgdirname@|${_pkgname}|g" \ -e "s|@options@||g" \ -i "${srcdir}/${pkgname%-bin}.sh" bsdtar -xf "${srcdir}/data."* asar e "${srcdir}/opt/${_pkgname}/resources/app.asar" "${srcdir}/app.asar.unpacked" - cp -r "${srcdir}/opt/${_pkgname}/resources/locales" "${srcdir}/app.asar.unpacked" + sed "s|process.resourcesPath|\"\/usr\/lib\/${pkgname%-bin}\"|g" -i "${srcdir}/app.asar.unpacked/locales/i18n.js" asar p "${srcdir}/app.asar.unpacked" "${srcdir}/app.asar" sed "s|/opt/${_pkgname}/${pkgname%-bin}|${pkgname%-bin}|g" -i "${srcdir}/usr/share/applications/${pkgname%-bin}.desktop" } diff --git a/m3u8-downloader.sh b/m3u8-downloader.sh index 7ddcaab8d734..4cfe3ac09dd8 100644 --- a/m3u8-downloader.sh +++ b/m3u8-downloader.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 |