summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorzxp198210052024-03-15 19:10:53 +0800
committerzxp198210052024-03-15 19:10:53 +0800
commit25d811aa256b0e770bc2b9922a33adef8998452f (patch)
treeb183b04f90081630c7ac219c2980c045a497a635
parent12782505df49b2fcf495bd372cda4776e10dfff2 (diff)
downloadaur-25d811aa256b0e770bc2b9922a33adef8998452f.tar.gz
fix errors
-rw-r--r--.SRCINFO11
-rw-r--r--PKGBUILD36
-rw-r--r--switchhosts.sh8
3 files changed, 23 insertions, 32 deletions
diff --git a/.SRCINFO b/.SRCINFO
index f95e454e4c6a..18bb9a93e0db 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,23 +1,20 @@
pkgbase = switchhosts-git
pkgdesc = An app for managing hosts file,and switch hosts quickly!
- pkgver = 4.2.0.beta.r37.g4f10177
+ pkgver = 4.2.0.beta.r39.g6904119
pkgrel = 1
url = https://github.com/oldj/SwitchHosts
- arch = aarch64
- arch = armv7h
- arch = x86_64
+ arch = any
license = Apache-2.0
makedepends = gendesk
makedepends = git
makedepends = nvm
makedepends = npm
- depends = electron24
- depends = hicolor-icon-theme
+ depends = electron24-bin
provides = switchhosts
conflicts = switchhosts
source = switchhosts.git::git+https://github.com/oldj/SwitchHosts.git
source = switchhosts.sh
sha256sums = SKIP
- sha256sums = 0fb7b939a071f4a08476bdd5aa143d2aa8cd335c83309f9919be16cd5c3e2014
+ sha256sums = dc0c5ca385ad81a08315a91655c7c064b5bf110eada55e61265633ae198b39f8
pkgname = switchhosts-git
diff --git a/PKGBUILD b/PKGBUILD
index ef41e12862ae..9ecb4c785547 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,22 +1,17 @@
# Maintainer: zxp19821005 <zxp19821005 at 163 dot com>
pkgname=switchhosts-git
-pkgver=4.2.0.beta.r37.g4f10177
+pkgver=4.2.0.beta.r39.g6904119
_electronversion=24
_nodeversion=18
pkgrel=1
pkgdesc="An app for managing hosts file,and switch hosts quickly!"
-arch=(
- 'aarch64'
- 'armv7h'
- 'x86_64'
-)
+arch=('any')
url="https://github.com/oldj/SwitchHosts"
license=('Apache-2.0')
conflicts=("${pkgname%-git}")
provides=("${pkgname%-git}")
depends=(
- "electron${_electronversion}"
- 'hicolor-icon-theme'
+ "electron${_electronversion}-bin"
)
makedepends=(
'gendesk'
@@ -29,7 +24,7 @@ source=(
"${pkgname%-git}.sh"
)
sha256sums=('SKIP'
- '0fb7b939a071f4a08476bdd5aa143d2aa8cd335c83309f9919be16cd5c3e2014')
+ 'dc0c5ca385ad81a08315a91655c7c064b5bf110eada55e61265633ae198b39f8')
pkgver() {
cd "${srcdir}/${pkgname//-/.}"
#git describe --long --tags --exclude='*[a-z][a-z]*' | sed -E 's/^v//;s/([^-]*-g)/r\1/;s/-/./g'
@@ -45,6 +40,7 @@ build() {
sed -e "s|@electronversion@|${_electronversion}|" \
-e "s|@appname@|${pkgname%-git}|g" \
-e "s|@runname@|app.asar|g" \
+ -e "s|@options@||g" \
-i "${srcdir}/${pkgname%-git}.sh"
_ensure_local_nvm
gendesk -q -f -n --categories "Utility" --pkgname="${pkgname%-git}" --name="SwitchHosts" --exec="${pkgname%-git} %U"
@@ -57,25 +53,21 @@ build() {
export ELECTRONVERSION="${_electronversion}"
export npm_config_disturl=https://electronjs.org/headers
HOME="${srcdir}/.electron-gyp"
- sed '/deb:/d;s|app.icns|app.png|g;/npm.taobao.org/d' -i scripts/make.js
+ if [ `curl -s ipinfo.io/country | grep CN | wc -l ` -ge 1 ];then
+ echo 'registry="https://registry.npmmirror.com/"' >> .npmrc
+ echo 'electron_mirror="https://registry.npmmirror.com/-/binary/electron/"' >> .npmrc
+ echo 'electron_builder_binaries_mirror="https://registry.npmmirror.com/-/binary/electron-builder-binaries/"' >> .npmrc
+ else
+ echo "Your network is OK."
+ fi
+ sed '/deb:/d;s|app.icns|app.png|g;/npm.taobao.org/d;/AppImage:arm64/d;/AppImage:armv7l/d;s|AppImage:x64|AppImage|g' -i scripts/make.js
npm install
npm run build
npm run make:linux
}
package() {
install -Dm755 "${srcdir}/${pkgname%-git}.sh" "${pkgdir}/usr/bin/${pkgname%-git}"
- case "${CARCH}" in
- x86_64)
- _architecture="linux-unpacked"
- ;;
- aarch64)
- _architecture="linux-arm64-unpacked"
- ;;
- armv7h)
- _architecture="linux-armv7l-unpacked"
- ;;
- esac
- install -Dm644 "${srcdir}/${pkgname//-/.}/dist/${_architecture}/resources/app.asar" -t "${pkgdir}/usr/lib/${pkgname%-git}/"
+ install -Dm644 "${srcdir}/${pkgname//-/.}/dist/linux-"*/resources/app.asar -t "${pkgdir}/usr/lib/${pkgname%-git}/"
install -Dm644 "${srcdir}/${pkgname%-git}.desktop" -t "${pkgdir}/usr/share/applications"
install -Dm644 "${srcdir}/${pkgname//-/.}/assets/icon.png" "${pkgdir}/usr/share/pixmaps/${pkgname%-git}.png"
install -Dm644 "${srcdir}/${pkgname//-/.}/LICENSE" -t "${pkgdir}/usr/share/licenses/${pkgname}"
diff --git a/switchhosts.sh b/switchhosts.sh
index f9ced1432cfc..7ddcaab8d734 100644
--- a/switchhosts.sh
+++ b/switchhosts.sh
@@ -1,14 +1,16 @@
-#!/bin/sh
+#!/bin/bash
set -e
_APPDIR="/usr/lib/@appname@"
_RUNNAME="${_APPDIR}/@runname@"
+_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 NODE_ENV=production
cd "${_APPDIR}"
if [[ $EUID -ne 0 ]] || [[ $ELECTRON_RUN_AS_NODE ]]; then
- exec electron@electronversion@ "${_RUNNAME}" "$@" || exit $?
+ exec electron@electronversion@ "${_RUNNAME}" "${_OPTIONS}" "$@" || exit $?
else
- exec electron@electronversion@ "${_RUNNAME}" --no-sandbox "$@" || exit $?
+ exec electron@electronversion@ "${_RUNNAME}" "${_OPTIONS}" --no-sandbox "$@" || exit $?
fi \ No newline at end of file