update to 1.2.2

This commit is contained in:
zxp19821005 2024-11-11 15:58:22 +08:00
commit 3a87f6a718
3 changed files with 95 additions and 0 deletions

19
.SRCINFO Normal file
View file

@ -0,0 +1,19 @@
pkgbase = leavepad-bin
pkgdesc = A multi-platform notepad. focuses on writing memos. File editing is not supported.(Prebuilt version.Use system-wide electron)
pkgver = 1.2.2
pkgrel = 1
url = https://github.com/kaishuu0123/leavepad
arch = x86_64
license = AGPL-3.0-only
makedepends = fuse2
depends = electron31
provides = leavepad=1.2.2
conflicts = leavepad
source = leavepad-1.2.2.AppImage::https://github.com/kaishuu0123/leavepad/releases/download/v1.2.2/leavepad-1.2.2.AppImage
source = LICENSE-1.2.2::https://raw.githubusercontent.com/kaishuu0123/leavepad/v1.2.2/LICENSE
source = leavepad.sh
sha256sums = a289a6ca1b46a5bda85722432d37367be1e2e5240a3b74636daa048d3d624090
sha256sums = 2db6d2f8319742e183737299159ca2a72096629542c080492f13770b7d305c3b
sha256sums = 291f50480f5a61bc9c68db7d44cd0412071128706baa868a9cb854f8779a1980
pkgname = leavepad-bin

47
PKGBUILD Normal file
View file

@ -0,0 +1,47 @@
# Maintainer: zxp19821005 <zxp19821005 at 163 dot com>
pkgname=leavepad-bin
_pkgname=Leavepad
pkgver=1.2.2
_electronversion=31
pkgrel=1
pkgdesc="A multi-platform notepad. focuses on writing memos. File editing is not supported.(Prebuilt version.Use system-wide electron)"
arch=('x86_64')
url="https://github.com/kaishuu0123/leavepad"
license=('AGPL-3.0-only')
provides=("${pkgname%-bin}=${pkgver}")
conflicts=("${pkgname%-bin}")
depends=(
"electron${_electronversion}"
)
makedepends=(
'fuse2'
)
source=(
"${pkgname%-bin}-${pkgver}.AppImage::${url}/releases/download/v${pkgver}/${pkgname%-bin}-${pkgver}.AppImage"
"LICENSE-${pkgver}::https://raw.githubusercontent.com/kaishuu0123/leavepad/v${pkgver}/LICENSE"
"${pkgname%-bin}.sh"
)
sha256sums=('a289a6ca1b46a5bda85722432d37367be1e2e5240a3b74636daa048d3d624090'
'2db6d2f8319742e183737299159ca2a72096629542c080492f13770b7d305c3b'
'291f50480f5a61bc9c68db7d44cd0412071128706baa868a9cb854f8779a1980')
build() {
sed -e "
s/@electronversion@/${_electronversion}/g
s/@appname@/${pkgname%-bin}/g
s/@runname@/app.asar/g
s/@cfgdirname@/${pkgname%-bin}/g
s/@options@/env ELECTRON_OZONE_PLATFORM_HINT=auto/g
" -i "${srcdir}/${pkgname%-bin}.sh"
chmod a+x "${srcdir}/${pkgname%-bin}-${pkgver}.AppImage"
"${srcdir}/${pkgname%-bin}-${pkgver}.AppImage" --appimage-extract > /dev/null
sed -i "s/AppRun --no-sandbox/${pkgname%-bin}/g" "${srcdir}/squashfs-root/${pkgname%-bin}.desktop"
find "${srcdir}/squashfs-root/resources" -type d -exec chmod 755 {} +
}
package() {
install -Dm755 "${srcdir}/${pkgname%-bin}.sh" "${pkgdir}/usr/bin/${pkgname%-bin}"
install -Dm644 "${srcdir}/squashfs-root/resources/app.asar" -t "${pkgdir}/usr/lib/${pkgname%-bin}"
cp -Pr --no-preserve=ownership "${srcdir}/squashfs-root/resources/app.asar.unpacked" -t "${pkgdir}/usr/lib/${pkgname%-bin}"
install -Dm644 "${srcdir}/squashfs-root/usr/share/icons/hicolor/0x0/apps/${pkgname%-bin}.png" "${pkgdir}/usr/share/pixmaps/${pkgname%-bin}.png"
install -Dm644 "${srcdir}/squashfs-root/${pkgname%-bin}.desktop" "${pkgdir}/usr/share/applications/${pkgname%-bin}.desktop"
install -Dm644 "${srcdir}/LICENSE-${pkgver}" "${pkgdir}/usr/share/licenses/${pkgname%-bin}/LICENSE"
}

29
leavepad.sh Normal file
View file

@ -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}@appname@-flags.conf"
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