diff options
author | zxp19821005 | 2024-03-15 10:53:47 +0800 |
---|---|---|
committer | zxp19821005 | 2024-03-15 10:53:47 +0800 |
commit | 0a0bcd40a67ce72ccc0a61c60afd7a7c9640cc65 (patch) | |
tree | a87f5156d06b46e3196c81d9292d9f6334e9d18c | |
parent | 6540fb959cca61c3246676db11371693829e4743 (diff) | |
download | aur-0a0bcd40a67ce72ccc0a61c60afd7a7c9640cc65.tar.gz |
fix errors
-rw-r--r-- | .SRCINFO | 27 | ||||
-rw-r--r-- | PKGBUILD | 111 | ||||
-rw-r--r-- | notesnook.desktop | 23 | ||||
-rw-r--r-- | notesnook.sh | 16 |
4 files changed, 147 insertions, 30 deletions
@@ -1,13 +1,26 @@ pkgbase = notesnook-git - pkgdesc = Take private notes, capture ideas, make lists & sync them anywhere - pkgver = 1.6.11 + pkgdesc = A fully open source & end-to-end encrypted note taking alternative to Evernote + pkgver = 2.6.16.r12.ga3b590bcb pkgrel = 1 url = https://notesnook.com/ + arch = aarch64 arch = x86_64 - license = Unknown - depends = gtk3 - depends = nss - source = notesnook-git_1.6.11_amd64.deb::https://github.com/streetwriters/notesnook-git/releases/download/v1.6.11/notesnook-git_amd64.deb - sha256sums = 1633b7989f49c4cb119cff2aeaa696b9252cae4f43361a0bd0dce64fbb1ac674 + license = GPL-3.0-or-later + makedepends = nvm + makedepends = npm + makedepends = git + makedepends = zip + makedepends = base-devel + makedepends = gcc + makedepends = curl + depends = electron25-bin + provides = notesnook=2.6.16 + conflicts = notesnook + source = notesnook.git::git+https://github.com/streetwriters/notesnook.git + source = notesnook.desktop + source = notesnook.sh + sha256sums = SKIP + sha256sums = efc8a6cea79ed0203dcbadf17632b5341952a49704f99e3ea0ddc573b06748f4 + sha256sums = dc0c5ca385ad81a08315a91655c7c064b5bf110eada55e61265633ae198b39f8 pkgname = notesnook-git @@ -1,29 +1,94 @@ -# Maintainer: candroid_man <candroid_man@protonmail.com> +# Maintainer: zxp19821005 <zxp19821005 at 163 dot com> +# Contributer: candroid_man <candroid_man@protonmail.com> # Contributer: Ada <adadonderr@gmail.com> # Contributor: Christian Finnberg <christian@finnberg.net> -pkgname='notesnook-git' -pkgver=1.6.11 +pkgname=notesnook-git +pkgver=2.6.16.r12.ga3b590bcb +_electronversion=25 +_nodeversion=16 pkgrel=1 -pkgdesc="Take private notes, capture ideas, make lists & sync them anywhere" -arch=('x86_64') +pkgdesc="A fully open source & end-to-end encrypted note taking alternative to Evernote" +arch=( + 'aarch64' + 'x86_64' +) url="https://notesnook.com/" -license=('Unknown') -depends=('gtk3' 'nss') -source=("${pkgname}_${pkgver}_amd64.deb"::"https://github.com/streetwriters/$pkgname/releases/download/v$pkgver/${pkgname}_amd64.deb") -sha256sums=('1633b7989f49c4cb119cff2aeaa696b9252cae4f43361a0bd0dce64fbb1ac674') - -package() { - bsdtar -xf data.tar.xz -C "$pkgdir" - - # Link to the binary - mkdir -p "${pkgdir}/usr/bin" - ln -s '/opt/Notesnook/Notesnook' "${pkgdir}/usr/bin/Notesnook" +_ghurl="https://github.com/streetwriters/notesnook" +license=('GPL-3.0-or-later') +provides=("${pkgname%-git}=${pkgver%.r*}") +conflicts=("${pkgname%-git}") +depends=( + "electron${_electronversion}-bin" +) +makedepends=( + 'nvm' + 'npm' + 'git' + 'zip' + 'base-devel' + 'gcc' + 'curl' +) +source=( + "${pkgname//-/.}::git+${_ghurl}.git" + "${pkgname%-git}.desktop" + "${pkgname%-git}.sh" +) +sha256sums=('SKIP' + 'efc8a6cea79ed0203dcbadf17632b5341952a49704f99e3ea0ddc573b06748f4' + 'dc0c5ca385ad81a08315a91655c7c064b5bf110eada55e61265633ae198b39f8') +pkgver() { + cd "${srcdir}/${pkgname//-/.}" + git describe --long --tags --exclude='*[a-z][a-z]*' | sed -E 's/^v//;s/([^-]*-g)/r\1/;s/-/./g' +} +_ensure_local_nvm() { + export NVM_DIR="${srcdir}/.nvm" + source /usr/share/nvm/init-nvm.sh || [[ $? != 1 ]] + nvm install "${_nodeversion}" + nvm use "${_nodeversion}" } - -post_install() { - # SUID chrome-sandbox for Electron 5+ - chmod 4755 "${pkgdir}/opt/Notesnook/chrome-sandbox" || true - - update-mime-database /usr/share/mime || true - update-desktop-database /usr/share/applications || true +build() { + sed -e "s|@electronversion@|${_electronversion}|" \ + -e "s|@appname@|${pkgname}|g" \ + -e "s|@runname@|app|g" \ + -e "s|@options@||g" \ + -i "${srcdir}/${pkgname%-git}.sh" + _ensure_local_nvm + export npm_config_build_from_source=true + export npm_config_cache="${srcdir}/.npm_cache" + export ELECTRON_SKIP_BINARY_DOWNLOAD=1 + export SYSTEM_ELECTRON_VERSION="$(electron${_electronversion} -v | sed 's/v//g')" + export npm_config_target="${SYSTEM_ELECTRON_VERSION}" + export ELECTRONVERSION="${_electronversion}" + export npm_config_disturl=https://electronjs.org/headers + HOME="${srcdir}/.electron-gyp" + #build + cd "${srcdir}/${pkgname//-/.}" + if [ `curl ifconfig.co/country` = "China" ];then + echo 'registry="https://registry.npmmirror.com/"' >> .npmrc + echo 'electron_mirror="https://registry.npmmirror.com/-/binary/electron/"' >> .npmrc + echo 'electron_builder_binaries_mirror="https://registry.npmmirror.com/-/binary/electron-builder-binaries/"' >> .npmrc + else + echo "Your network is OK." + fi + # Install packages + npm ci --ignore-scripts --prefer-offline --no-audit + npm run bootstrap -- --scope=web + # Generate desktop build + npx nx build:desktop @notesnook/web + npm run bootstrap -- --scope=desktop + # Build Electron wrapper + cd "${srcdir}/${pkgname//-/.}/apps/desktop" + npx nx run release --project @notesnook/desktop + npx electron-builder --dir } +package() { + install -Dm755 "${srcdir}/${pkgname%-git}.sh" "${pkgdir}/usr/bin/${pkgname%-git}" + install -Dm755 -d "${pkgdir}/usr/lib/${pkgname%-git}" + cp -r "${srcdir}/${pkgname//-/.}/apps/desktop/output/linux-"*/resources/{app,assets} "${pkgdir}/usr/lib/${pkgname%-git}" + for _icons in 16x16 24x24 32x32 48x48 64x64 128x128 256x256 512x512 1024x1024;do + install -Dm644 "${srcdir}/${pkgname//-/.}/apps/desktop/assets/icons/${_icons}.png" \ + "${pkgdir}/usr/share/icons/hicolor/${_icons}/apps/${pkgname%-git}.png" + done + install -Dm644 "${srcdir}/${pkgname%-git}.desktop" -t "${pkgdir}/usr/share/applications" +}
\ No newline at end of file diff --git a/notesnook.desktop b/notesnook.desktop new file mode 100644 index 000000000000..42df99f354fc --- /dev/null +++ b/notesnook.desktop @@ -0,0 +1,23 @@ +[Desktop Entry] +Name=Notesnook +Exec=notesnook %U +Terminal=false +Type=Application +Icon=notesnook +StartupWMClass=Notesnook +actions=undefined +Comment=Your private note taking space +Categories=Office; +Actions=new-note;new-notebook;new-reminder; + +[Desktop Action new-note] +Name=New note +Exec=notesnook %U new note + +[Desktop Action new-notebook] +Name=New notebook +Exec=notesnook %U new notebook + +[Desktop Action new-reminder] +Name=New reminder +Exec=notesnook %U new reminder
\ No newline at end of file diff --git a/notesnook.sh b/notesnook.sh new file mode 100644 index 000000000000..7ddcaab8d734 --- /dev/null +++ b/notesnook.sh @@ -0,0 +1,16 @@ +#!/bin/bash +set -e +_APPDIR="/usr/lib/@appname@" +_RUNNAME="${_APPDIR}/@runname@" +_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 NODE_ENV=production +cd "${_APPDIR}" +if [[ $EUID -ne 0 ]] || [[ $ELECTRON_RUN_AS_NODE ]]; then + exec electron@electronversion@ "${_RUNNAME}" "${_OPTIONS}" "$@" || exit $? +else + exec electron@electronversion@ "${_RUNNAME}" "${_OPTIONS}" --no-sandbox "$@" || exit $? +fi
\ No newline at end of file |