diff options
author | zxp19821005 | 2024-06-05 17:17:03 +0800 |
---|---|---|
committer | zxp19821005 | 2024-06-05 17:17:03 +0800 |
commit | 93591d00410e83516d2261215d0675ece6ee4d7e (patch) | |
tree | a48045dde5826519fa3854b7c927607132e058c2 | |
parent | 9ab82d2f6ecdc80822f9329013712788f4164f3d (diff) | |
download | aur-93591d00410e83516d2261215d0675ece6ee4d7e.tar.gz |
update to 0.41.0
-rw-r--r-- | .SRCINFO | 14 | ||||
-rw-r--r-- | PKGBUILD | 33 | ||||
-rw-r--r-- | swarm-desktop.sh | 21 |
3 files changed, 41 insertions, 27 deletions
@@ -1,6 +1,6 @@ pkgbase = swarm-desktop pkgdesc = Electron Desktop app that helps you easily spin up and manage Swarm node - pkgver = 0.37.0 + pkgver = 0.41.0 pkgrel = 1 url = https://desktop.ethswarm.org/ arch = aarch64 @@ -9,13 +9,13 @@ pkgbase = swarm-desktop license = BSD-3-Clause makedepends = gendesk makedepends = npm - makedepends = nodejs - makedepends = git - depends = electron18-bin + makedepends = nvm + makedepends = curl + depends = electron18 conflicts = swarm-desktop - source = swarm-desktop::git+https://github.com/ethersphere/swarm-desktop.git#tag=v0.37.0 + source = swarm-desktop-0.41.0.tar.gz::https://github.com/ethersphere/swarm-desktop/archive/refs/tags/v0.41.0.tar.gz source = swarm-desktop.sh - sha256sums = e6161869a2e0263a4967da6562b3dad85d650b3740c31832e3c98a52524e97a6 - sha256sums = dc0c5ca385ad81a08315a91655c7c064b5bf110eada55e61265633ae198b39f8 + sha256sums = 94785c24889e042defd1221916d17e45daae95735b6afd6f750cac2e5a8b308c + sha256sums = 2b2e8aeed33fd71c521e49fd54fb2fa81218d16aef8bccb88d77909055ab8051 pkgname = swarm-desktop @@ -1,7 +1,7 @@ # Maintainer: zxp19821005 <zxp19821005 at 163 dot com> pkgname=swarm-desktop _pkgname="Swarm Desktop" -pkgver=0.37.0 +pkgver=0.41.0 _electronversion=18 _nodeversion=18 pkgrel=1 @@ -16,20 +16,20 @@ _ghurl="https://github.com/ethersphere/swarm-desktop" license=('BSD-3-Clause') conflicts=("${pkgname}") depends=( - "electron${_electronversion}-bin" + "electron${_electronversion}" ) makedepends=( 'gendesk' 'npm' - 'nodejs' - 'git' + 'nvm' + 'curl' ) source=( - "${pkgname}::git+${_ghurl}.git#tag=v${pkgver}" + "${pkgname}-${pkgver}.tar.gz::${_ghurl}/archive/refs/tags/v${pkgver}.tar.gz" "${pkgname}.sh" ) -sha256sums=('e6161869a2e0263a4967da6562b3dad85d650b3740c31832e3c98a52524e97a6' - 'dc0c5ca385ad81a08315a91655c7c064b5bf110eada55e61265633ae198b39f8') +sha256sums=('94785c24889e042defd1221916d17e45daae95735b6afd6f750cac2e5a8b308c' + '2b2e8aeed33fd71c521e49fd54fb2fa81218d16aef8bccb88d77909055ab8051') _ensure_local_nvm() { export NVM_DIR="${srcdir}/.nvm" source /usr/share/nvm/init-nvm.sh || [[ $? != 1 ]] @@ -40,26 +40,27 @@ build() { sed -e "s|@electronversion@|${_electronversion}|" \ -e "s|@appname@|${pkgname}|g" \ -e "s|@runname@|app.asar|g" \ + -e "s|@cfgdirname@|${_pkgname}|g" \ -e "s|@options@||g" \ -i "${srcdir}/${pkgname}.sh" _ensure_local_nvm - gendesk -q -f -n --categories="Utility" --name="${_pkgname}" --exec="${pkgname} %U" + gendesk -q -f -n --pkgname="${pkgname}" --pkgdesc="${pkgdesc}" --categories="Utility" --name="${_pkgname}" --exec="${pkgname} %U" export npm_config_build_from_source=true export npm_config_cache="${srcdir}/.npm_cache" export ELECTRON_SKIP_BINARY_DOWNLOAD=1 - export SYSTEM_ELECTRON_VERSION="$(electron${_electronversion} -v | sed 's/v//g')" - export npm_config_target="${SYSTEM_ELECTRON_VERSION}" - export ELECTRONVERSION="${_electronversion}" - export npm_config_disturl=https://electronjs.org/headers + #export SYSTEM_ELECTRON_VERSION="$(electron${_electronversion} -v | sed 's/v//g')" + #export npm_config_target="${SYSTEM_ELECTRON_VERSION}" + #export ELECTRONVERSION="${_electronversion}" HOME="${srcdir}/.electron-gyp" if [ `curl -s ipinfo.io/country | grep CN | wc -l ` -ge 1 ];then export npm_config_registry=https://registry.npmmirror.com + export npm_config_disturl=https://registry.npmmirror.com/-/binary/node/ export npm_config_electron_mirror=https://registry.npmmirror.com/-/binary/electron/ export npm_config_electron_builder_binaries_mirror=https://registry.npmmirror.com/-/binary/electron-builder-binaries/ else echo "Your network is OK." fi - cd "${srcdir}/${pkgname}" + cd "${srcdir}/${pkgname}-${pkgver}" sed 's|cd ui \&\& npm run build|cd ui \&\& npm ci \&\& npm run build|g' -i package.json npm ci npm run build @@ -67,8 +68,8 @@ build() { } package() { install -Dm755 "${srcdir}/${pkgname}.sh" "${pkgdir}/usr/bin/${pkgname}" - install -Dm644 "${srcdir}/${pkgname}/out/${_pkgname}-linux-"*/resources/app.asar -t "${pkgdir}/usr/lib/${pkgname}" - install -Dm644 "${srcdir}/${pkgname}/assets/icon.png" "${pkgdir}/usr/share/pixmaps/${pkgname}.png" + install -Dm644 "${srcdir}/${pkgname}-${pkgver}/out/${_pkgname}-linux-"*/resources/app.asar -t "${pkgdir}/usr/lib/${pkgname}" + install -Dm644 "${srcdir}/${pkgname}-${pkgver}/assets/icon.png" "${pkgdir}/usr/share/pixmaps/${pkgname}.png" install -Dm644 "${srcdir}/${pkgname}.desktop" -t "${pkgdir}/usr/share/applications" - install -Dm644 "${srcdir}/${pkgname}/LICENSE" -t "${pkgdir}/usr/share/licenses/${pkgname}" + install -Dm644 "${srcdir}/${pkgname}-${pkgver}/LICENSE" -t "${pkgdir}/usr/share/licenses/${pkgname}" }
\ No newline at end of file diff --git a/swarm-desktop.sh b/swarm-desktop.sh index 7ddcaab8d734..4cfe3ac09dd8 100644 --- a/swarm-desktop.sh +++ b/swarm-desktop.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 |