summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorzxp198210052024-02-06 12:04:22 +0800
committerzxp198210052024-02-06 12:04:22 +0800
commitab65f683e0ddb35c64eb137dffee60f09f6303f9 (patch)
tree3a4be3bbccd197f5e347a4596848e2671cc96f54
parent22d1e81a5a2b718babb9e3b42c83a77718891b55 (diff)
downloadaur-ab65f683e0ddb35c64eb137dffee60f09f6303f9.tar.gz
fix errors
-rw-r--r--.SRCINFO26
-rw-r--r--PKGBUILD48
-rw-r--r--nft-tool.sh14
3 files changed, 41 insertions, 47 deletions
diff --git a/.SRCINFO b/.SRCINFO
index d1293f8e80ae..f682e363bf73 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,35 +1,19 @@
pkgbase = nft-tool-bin
pkgdesc = A tool for creating and editing NFTs on the Bitshares blockchain
pkgver = 1.7.2
- pkgrel = 5
+ pkgrel = 6
url = https://github.com/BTS-CM/Bitshares_NFT_Issuance_Tool
arch = x86_64
license = MIT
- depends = libxdamage
- depends = libxrandr
- depends = nss
- depends = alsa-lib
- depends = libxcomposite
- depends = libxfixes
- depends = gtk3
- depends = at-spi2-core
- depends = cairo
- depends = libxcb
- depends = expat
- depends = libxext
- depends = libx11
- depends = nspr
- depends = libxkbcommon
- depends = libcups
- depends = libdrm
- depends = mesa
- depends = dbus
- depends = pango
+ makedepends = asar
+ depends = electron25
provides = nft-tool=1.7.2
conflicts = nft-tool
source = nft-tool-1.7.2.deb::https://github.com/BTS-CM/Bitshares_NFT_Issuance_Tool/releases/download/v1.7.2/nft_tool.deb
source = LICENSE-1.7.2::https://raw.githubusercontent.com/BTS-CM/Bitshares_NFT_Issuance_Tool/v1.7.2/License.md
+ source = nft-tool.sh
sha256sums = 87323c333009c7c19b9e904342f180ec9cc66f1d26ac6776fff5806a6193af68
sha256sums = 48ecd55adc52c7a1ad9e3f699b9e2348bca9bb6797ce8ad4e9cbe38f7aa11c8a
+ sha256sums = 0fb7b939a071f4a08476bdd5aa143d2aa8cd335c83309f9919be16cd5c3e2014
pkgname = nft-tool-bin
diff --git a/PKGBUILD b/PKGBUILD
index 939bc397b9f6..d04f3ed0aae2 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,7 +3,8 @@ _pkgname=nft_tool
pkgname="${_pkgname//_/-}-bin"
_appname="Bitshares NFT issuance tool"
pkgver=1.7.2
-pkgrel=5
+_electronversion=25
+pkgrel=6
pkgdesc="A tool for creating and editing NFTs on the Bitshares blockchain"
arch=('x86_64')
url="https://github.com/BTS-CM/Bitshares_NFT_Issuance_Tool"
@@ -11,42 +12,37 @@ license=('MIT')
provides=("${pkgname%-bin}=${pkgver}")
conflicts=("${pkgname%-bin}")
depends=(
- 'libxdamage'
- 'libxrandr'
- 'nss'
- 'alsa-lib'
- 'libxcomposite'
- 'libxfixes'
- 'gtk3'
- 'at-spi2-core'
- 'cairo'
- 'libxcb'
- 'expat'
- 'libxext'
- 'libx11'
- 'nspr'
- 'libxkbcommon'
- 'libcups'
- 'libdrm'
- 'mesa'
- 'dbus'
- 'pango'
+ "electron${_electronversion}"
+)
+makedepends=(
+ 'asar'
)
source=(
"${pkgname%-bin}-${pkgver}.deb::${url}/releases/download/v${pkgver}/${_pkgname}.deb"
"LICENSE-${pkgver}::https://raw.githubusercontent.com/BTS-CM/Bitshares_NFT_Issuance_Tool/v${pkgver}/License.md"
+ "${pkgname%-bin}.sh"
)
sha256sums=('87323c333009c7c19b9e904342f180ec9cc66f1d26ac6776fff5806a6193af68'
- '48ecd55adc52c7a1ad9e3f699b9e2348bca9bb6797ce8ad4e9cbe38f7aa11c8a')
+ '48ecd55adc52c7a1ad9e3f699b9e2348bca9bb6797ce8ad4e9cbe38f7aa11c8a'
+ '0fb7b939a071f4a08476bdd5aa143d2aa8cd335c83309f9919be16cd5c3e2014')
build() {
+ sed -e "s|@electronversion@|${_electronversion}|g" \
+ -e "s|@appname@|${pkgname%-bin}|g" \
+ -e "s|@runname@|app.asar|g" \
+ -i "${srcdir}/${pkgname%-bin}.sh"
bsdtar -xf "${srcdir}/data.tar.xz"
- sed "s|\"/opt/${_appname}/${_pkgname}\"|${pkgname%-bin} --no-sandbox|g;s|=${_pkgname}|=${pkgname%-bin}|g" \
+ sed "s|\"/opt/${_appname}/${_pkgname}\"|${pkgname%-bin}|g;s|=${_pkgname}|=${pkgname%-bin}|g" \
-i "${srcdir}/usr/share/applications/${_pkgname}.desktop"
+ asar e "${srcdir}/opt/${_appname}/resources/app.asar" "${srcdir}/app.asar.unpacked"
+ sed -e "s|indexURL = app.isPackaged|indexURL = !app.isPackaged|g" \
+ -e "s|(!app.isPackaged)|(app.isPackaged)|g" \
+ -i "${srcdir}/app.asar.unpacked/dist/electron.js"
+ asar p "${srcdir}/app.asar.unpacked" "${srcdir}/app.asar"
}
package() {
- install -Dm755 -d "${pkgdir}/"{opt/"${pkgname%-bin}",usr/bin}
- cp -r "${srcdir}/opt/${_appname}/"* "${pkgdir}/opt/${pkgname%-bin}"
- ln -sf "/opt/${pkgname%-bin}/${_pkgname}" "${pkgdir}/usr/bin/${pkgname%-bin}"
+ install -Dm755 "${srcdir}/${pkgname%-bin}.sh" "${pkgdir}/usr/bin/${pkgname%-bin}"
+ install -Dm644 "${srcdir}/app.asar" -t "${pkgdir}/usr/lib/${pkgname%-bin}"
+ cp -r "${srcdir}/opt/${_appname}/resources/app.asar.unpacked" "${pkgdir}/usr/lib/${pkgname%-bin}"
install -Dm644 "${srcdir}/usr/share/applications/${_pkgname}.desktop" "${pkgdir}/usr/share/applications/${pkgname%-bin}.desktop"
install -Dm644 "${srcdir}/usr/share/icons/hicolor/0x0/apps/${_pkgname}.png" "${pkgdir}/usr/share/pixmaps/${pkgname%-bin}.png"
install -Dm644 "${srcdir}/LICENSE-${pkgver}" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
diff --git a/nft-tool.sh b/nft-tool.sh
new file mode 100644
index 000000000000..f9ced1432cfc
--- /dev/null
+++ b/nft-tool.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+set -e
+_APPDIR="/usr/lib/@appname@"
+_RUNNAME="${_APPDIR}/@runname@"
+export PATH="${_APPDIR}:${PATH}"
+export LD_LIBRARY_PATH="${_APPDIR}/swiftshader:${_APPDIR}/lib:${LD_LIBRARY_PATH}"
+export ELECTRON_IS_DEV=0
+export NODE_ENV=production
+cd "${_APPDIR}"
+if [[ $EUID -ne 0 ]] || [[ $ELECTRON_RUN_AS_NODE ]]; then
+ exec electron@electronversion@ "${_RUNNAME}" "$@" || exit $?
+else
+ exec electron@electronversion@ "${_RUNNAME}" --no-sandbox "$@" || exit $?
+fi \ No newline at end of file