From 3a87f6a7186f8503a252864f9ec02dc4e0950db8 Mon Sep 17 00:00:00 2001 From: zxp19821005 Date: Mon, 11 Nov 2024 15:58:22 +0800 Subject: [PATCH] update to 1.2.2 --- .SRCINFO | 19 +++++++++++++++++++ PKGBUILD | 47 +++++++++++++++++++++++++++++++++++++++++++++++ leavepad.sh | 29 +++++++++++++++++++++++++++++ 3 files changed, 95 insertions(+) create mode 100644 .SRCINFO create mode 100644 PKGBUILD create mode 100644 leavepad.sh diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..d3c98fc08711 --- /dev/null +++ b/.SRCINFO @@ -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 diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..a2b298e90a4d --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,47 @@ +# Maintainer: zxp19821005 +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" +} diff --git a/leavepad.sh b/leavepad.sh new file mode 100644 index 000000000000..40e422ca2ee7 --- /dev/null +++ b/leavepad.sh @@ -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 \ No newline at end of file