From 787dcd16dbf73e81d62cb1d73990ba7f778cfa9c Mon Sep 17 00:00:00 2001 From: zxp19821005 Date: Wed, 8 Nov 2023 11:34:14 +0800 Subject: update to 2.3.0 --- .SRCINFO | 20 ++++++++++++++++++++ PKGBUILD | 46 ++++++++++++++++++++++++++++++++++++++++++++++ thorium-reader.sh | 10 ++++++++++ 3 files changed, 76 insertions(+) create mode 100644 .SRCINFO create mode 100644 PKGBUILD create mode 100644 thorium-reader.sh diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 0000000..8b04a76 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,20 @@ +pkgbase = thorium-reader-bin + pkgdesc = Cross-platform desktop reading app based on the Readium Desktop toolkit + pkgver = 2.3.0 + pkgrel = 1 + url = https://www.edrlab.org/software/thorium-reader/ + arch = x86_64 + license = BSD + depends = bash + depends = electron25 + depends = hicolor-icon-theme + provides = thorium-reader=2.3.0 + conflicts = thorium-reader + 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 + source = LICENSE::https://raw.githubusercontent.com/edrlab/thorium-reader/v2.3.0/LICENSE + source = thorium-reader.sh + sha256sums = 1007cd9083715d32427e4d39f8a4cac69cf428cfc4521950571dc2290a308f23 + sha256sums = e95e504f42685015445b4a0a80dfdaa86e5b2b2c0e317bca2bcbb51330ec61e5 + sha256sums = c6376c7762d524d36e463659d1b1a15870e8a57b1d8b257a8395072f04f97456 + +pkgname = thorium-reader-bin diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..ffd9a55 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,46 @@ +# Maintainer: zxp19821005 +_pkgname=thorium +pkgname="${_pkgname}-reader-bin" +_appname=Thorium +_fullname="${_appname}Reader" +pkgver=2.3.0 +pkgrel=1 +pkgdesc="Cross-platform desktop reading app based on the Readium Desktop toolkit" +arch=('x86_64') +url="https://www.edrlab.org/software/thorium-reader/" +_ghurl="https://github.com/edrlab/thorium-reader" +license=('BSD') +conflicts=("${pkgname%-bin}") +provides=("${pkgname%-bin}=${pkgver}") +depends=( + 'bash' + 'electron25' + 'hicolor-icon-theme' +) +source=( + "${pkgname%-bin}-${pkgver}.deb::${_ghurl}/releases/download/v${pkgver}/EDRLab.${_fullname}_${pkgver}_amd64.deb" + "LICENSE::https://raw.githubusercontent.com/edrlab/thorium-reader/v${pkgver}/LICENSE" + "${pkgname%-bin}.sh" +) +sha256sums=('1007cd9083715d32427e4d39f8a4cac69cf428cfc4521950571dc2290a308f23' + 'e95e504f42685015445b4a0a80dfdaa86e5b2b2c0e317bca2bcbb51330ec61e5' + 'c6376c7762d524d36e463659d1b1a15870e8a57b1d8b257a8395072f04f97456') +build() { + bsdtar -xf "${srcdir}/data.tar.xz" + sed -e "s|Name=${_appname}|Name=${_fullname}|g" \ + -e "s|/opt/${_appname}/${_pkgname} %U|${pkgname%-bin}|g" \ + -e "s|Icon=${_pkgname}|Icon=${pkgname%-bin}|g" \ + -i "${srcdir}/usr/share/applications/${_pkgname}.desktop" +} +package() { + install -Dm755 "${srcdir}/${pkgname%-bin}.sh" "${pkgdir}/usr/bin/${pkgname%-bin}" + install -Dm755 "${srcdir}/opt/${_appname}/resources/app.asar" -t "${pkgdir}/usr/lib/${pkgname%-bin}" + install -Dm644 "${srcdir}/opt/${_appname}/resources/app.asar.unpacked/external-assets/lcp.node" \ + -t "${pkgdir}/usr/lib/${pkgname%-bin}app.asar.unpacked/external-assets" + for _icons in 256x256 512x512 1024x1024;do + install -Dm644 "${srcdir}/usr/share/icons/hicolor/${_icons}/apps/${_pkgname}.png" \ + "${pkgdir}/usr/share/icons/hicolor/${_icons}/apps/${pkgname%-bin}.png" + done + install -Dm644 "${srcdir}/usr/share/applications/${_pkgname}.desktop" "${pkgdir}/usr/share/applications/${pkgname%-bin}.desktop" + install -Dm644 "${srcdir}/LICENSE" -t "${pkgdir}/usr/share/licenses/${pkgname}" +} \ 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 @@ +#!/bin/bash +_ELECTRON=/usr/bin/electron25 +APPDIR="/usr/lib/thorium-reader" +export PATH="${APPDIR}:${PATH}" +_ASAR="${APPDIR}/app.asar" +if [[ $EUID -ne 0 ]] || [[ $ELECTRON_RUN_AS_NODE ]]; then + exec ${_ELECTRON} ${_ASAR} "$@" +else + exec ${_ELECTRON} ${_ASAR} --no-sandbox "$@" +fi \ No newline at end of file -- cgit v1.2.3-70-g09d2