summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO20
-rw-r--r--PKGBUILD46
-rw-r--r--thorium-reader.sh10
3 files changed, 76 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 0000000..8b04a76
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,20 @@
1pkgbase = thorium-reader-bin
2 pkgdesc = Cross-platform desktop reading app based on the Readium Desktop toolkit
3 pkgver = 2.3.0
4 pkgrel = 1
5 url = https://www.edrlab.org/software/thorium-reader/
6 arch = x86_64
7 license = BSD
8 depends = bash
9 depends = electron25
10 depends = hicolor-icon-theme
11 provides = thorium-reader=2.3.0
12 conflicts = thorium-reader
13 source = thorium-reader-2.3.0.deb::https://github.com/edrlab/thorium-reader/releases/download/v2.3.0/EDRLab.ThoriumReader_2.3.0_amd64.deb
14 source = LICENSE::https://raw.githubusercontent.com/edrlab/thorium-reader/v2.3.0/LICENSE
15 source = thorium-reader.sh
16 sha256sums = 1007cd9083715d32427e4d39f8a4cac69cf428cfc4521950571dc2290a308f23
17 sha256sums = e95e504f42685015445b4a0a80dfdaa86e5b2b2c0e317bca2bcbb51330ec61e5
18 sha256sums = c6376c7762d524d36e463659d1b1a15870e8a57b1d8b257a8395072f04f97456
19
20pkgname = thorium-reader-bin
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 0000000..ffd9a55
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,46 @@
1# Maintainer: zxp19821005 <zxp19821005 at 163 dot com>
2_pkgname=thorium
3pkgname="${_pkgname}-reader-bin"
4_appname=Thorium
5_fullname="${_appname}Reader"
6pkgver=2.3.0
7pkgrel=1
8pkgdesc="Cross-platform desktop reading app based on the Readium Desktop toolkit"
9arch=('x86_64')
10url="https://www.edrlab.org/software/thorium-reader/"
11_ghurl="https://github.com/edrlab/thorium-reader"
12license=('BSD')
13conflicts=("${pkgname%-bin}")
14provides=("${pkgname%-bin}=${pkgver}")
15depends=(
16 'bash'
17 'electron25'
18 'hicolor-icon-theme'
19)
20source=(
21 "${pkgname%-bin}-${pkgver}.deb::${_ghurl}/releases/download/v${pkgver}/EDRLab.${_fullname}_${pkgver}_amd64.deb"
22 "LICENSE::https://raw.githubusercontent.com/edrlab/thorium-reader/v${pkgver}/LICENSE"
23 "${pkgname%-bin}.sh"
24)
25sha256sums=('1007cd9083715d32427e4d39f8a4cac69cf428cfc4521950571dc2290a308f23'
26 'e95e504f42685015445b4a0a80dfdaa86e5b2b2c0e317bca2bcbb51330ec61e5'
27 'c6376c7762d524d36e463659d1b1a15870e8a57b1d8b257a8395072f04f97456')
28build() {
29 bsdtar -xf "${srcdir}/data.tar.xz"
30 sed -e "s|Name=${_appname}|Name=${_fullname}|g" \
31 -e "s|/opt/${_appname}/${_pkgname} %U|${pkgname%-bin}|g" \
32 -e "s|Icon=${_pkgname}|Icon=${pkgname%-bin}|g" \
33 -i "${srcdir}/usr/share/applications/${_pkgname}.desktop"
34}
35package() {
36 install -Dm755 "${srcdir}/${pkgname%-bin}.sh" "${pkgdir}/usr/bin/${pkgname%-bin}"
37 install -Dm755 "${srcdir}/opt/${_appname}/resources/app.asar" -t "${pkgdir}/usr/lib/${pkgname%-bin}"
38 install -Dm644 "${srcdir}/opt/${_appname}/resources/app.asar.unpacked/external-assets/lcp.node" \
39 -t "${pkgdir}/usr/lib/${pkgname%-bin}app.asar.unpacked/external-assets"
40 for _icons in 256x256 512x512 1024x1024;do
41 install -Dm644 "${srcdir}/usr/share/icons/hicolor/${_icons}/apps/${_pkgname}.png" \
42 "${pkgdir}/usr/share/icons/hicolor/${_icons}/apps/${pkgname%-bin}.png"
43 done
44 install -Dm644 "${srcdir}/usr/share/applications/${_pkgname}.desktop" "${pkgdir}/usr/share/applications/${pkgname%-bin}.desktop"
45 install -Dm644 "${srcdir}/LICENSE" -t "${pkgdir}/usr/share/licenses/${pkgname}"
46} \ No newline at end of file
diff --git a/thorium-reader.sh b/thorium-reader.sh
new file mode 100644
index 0000000..61a96a6
--- /dev/null
+++ b/thorium-reader.sh
@@ -0,0 +1,10 @@
1#!/bin/bash
2_ELECTRON=/usr/bin/electron25
3APPDIR="/usr/lib/thorium-reader"
4export PATH="${APPDIR}:${PATH}"
5_ASAR="${APPDIR}/app.asar"
6if [[ $EUID -ne 0 ]] || [[ $ELECTRON_RUN_AS_NODE ]]; then
7 exec ${_ELECTRON} ${_ASAR} "$@"
8else
9 exec ${_ELECTRON} ${_ASAR} --no-sandbox "$@"
10fi \ No newline at end of file