-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4009d7e
commit 497e394
Showing
3 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Maintainer: zxp19821005 <zxp19821005 at 163 dot com> | ||
pkgname=botgem-bin | ||
_pkgname=BotGem | ||
pkgver=1.5.1 | ||
_electronversion=22 | ||
pkgrel=1 | ||
pkgdesc="Your Al-Powered Toolbox for Tomorrow.Prebuilt version.Use system-wide electron." | ||
arch=('x86_64') | ||
url="https://botgem.com/" | ||
_ghurl="https://github.com/gaodeng/ama-discussions" | ||
license=('MIT') | ||
conflicts=("${pkgname%-bin}") | ||
prodives=("${pkgname%-bin}=${pkgver}") | ||
depends=( | ||
"electron${_electronversion}" | ||
) | ||
makedepends=( | ||
'asar' | ||
'gendesk' | ||
) | ||
source=( | ||
"${pkgname%-bin}-${pkgver}.appx::${_ghurl}/releases/download/v${pkgver}/${_pkgname}.${pkgver}.appx" | ||
"sqlite3-x86_64.tar.gz::https://github.com/TryGhost/node-sqlite3/releases/download/v5.1.7/sqlite3-v5.1.7-napi-v6-linux-x64.tar.gz" | ||
"${pkgname%-bin}.sh" | ||
) | ||
sha256sums=('2c2caaeac6642f2c4cecaccb6915cce3174a47431605c05fd565a6acf764409c' | ||
'6d1f7a95e5aca90db1fd6a2839380a021d5ee23d46f2d7c520ded094da813fed' | ||
'291f50480f5a61bc9c68db7d44cd0412071128706baa868a9cb854f8779a1980') | ||
build() { | ||
sed -e " | ||
s/@electronversion@/${_electronversion}/g | ||
s/@appname@/${pkgname%-bin}/g | ||
s/@runname@/app.asar/g | ||
s/@cfgdirname@/com.${pkgname}.ama/g | ||
s/@options@//g | ||
" -i "${srcdir}/${pkgname%-bin}.sh" | ||
gendesk -q -f -n --pkgname="${pkgname%-bin}" --pkgdesc="${pkgdesc}" --categories="Office" --name="${_pkgname}" --exec="${pkgname%-bin} %U" | ||
asar e "${srcdir}/app/resources/app.asar" "${srcdir}/app.asar.unpacked" | ||
find "${srcdir}/app.asar.unpacked/dist" -type f -exec sed -i "s/process.resourcesPath/\'\/usr\/lib\/${pkgname%-bin}\'/g" {} + | ||
install -Dm644 "${srcdir}/build/Release/node_sqlite3.node" -t "${srcdir}/app.asar.unpacked/node_modules/sqlite3/build/Release" | ||
asar p "${srcdir}/app.asar.unpacked" "${srcdir}/app.asar" | ||
} | ||
package() { | ||
install -Dm755 "${srcdir}/${pkgname%-bin}.sh" "${pkgdir}/usr/bin/${pkgname%-bin}" | ||
install -Dm644 "${srcdir}/app.asar" -t "${pkgdir}/usr/lib/${pkgname%-bin}" | ||
install -Dm644 "${srcdir}/build/Release/node_sqlite3.node" -t "${pkgdir}/usr/lib/${pkgname%-bin}/app.asar.unpacked/node_modules/sqlite3/build/Release" | ||
_icon_sizes=(16x16 24x24 32x32 48x48 64x64 96x96 128x128 256x256 512x512 1024x1024) | ||
for _icons in "${_icon_sizes[@]}";do | ||
install -Dm644 "${srcdir}/app/resources/assets/icons/${_icons}.png" \ | ||
"${pkgdir}/usr/share/icons/hicolor/${_icons}/apps/${pkgname%-bin}.png" | ||
done | ||
install -Dm644 "${srcdir}/${pkgname%-bin}.desktop" -t "${pkgdir}/usr/share/applications" | ||
install -Dm644 "${srcdir}/app.asar.unpacked/dist/main/main.js.LICENSE.txt" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
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}@[email protected]" | ||
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}" || { echo "Failed to change directory to ${_APPDIR}"; exit 1; } | ||
if [[ "${EUID}" -ne 0 ]] || [[ "${ELECTRON_RUN_AS_NODE}" ]]; then | ||
exec electron@electronversion@ "${_RUNNAME}" ${_OPTIONS} "${_USER_FLAGS[@]}" "$@" | ||
else | ||
exec electron@electronversion@ "${_RUNNAME}" ${_OPTIONS} --no-sandbox "${_USER_FLAGS[@]}" "$@" | ||
fi |