diff options
author | xiota | 2023-11-25 14:17:37 -0800 |
---|---|---|
committer | xiota | 2023-11-25 14:17:37 -0800 |
commit | cee368cb54144abc8bd41a21349d6fdd6a6bc0d0 (patch) | |
tree | 8726896dd4874090eadb24d3cf22279224ce8319 | |
parent | 61af31e6ee0c2447052f1a56d092984ecff41751 (diff) | |
download | aur-cee368cb54144abc8bd41a21349d6fdd6a6bc0d0.tar.gz |
3.0.0
-rw-r--r-- | .SRCINFO | 22 | ||||
-rw-r--r-- | .gitignore | 4 | ||||
-rw-r--r-- | PKGBUILD | 132 | ||||
-rw-r--r-- | knowte.desktop | 9 | ||||
-rw-r--r-- | knowte.sh | 10 |
5 files changed, 120 insertions, 57 deletions
@@ -1,18 +1,16 @@ pkgbase = knowte - pkgdesc = A note taking application that allows you to quickly and easily organize and find your notes - pkgver = 2.0.9 + pkgdesc = Cross platform note taking application + pkgver = 3.0.0 pkgrel = 1 - url = https://www.digimezzo.com + url = https://github.com/digimezzo/knowte arch = x86_64 license = GPL3 - makedepends = coreutils - provides = knowte - conflicts = knowte - replaces = knowte - options = !strip - source = Knowte-2.0.9.AppImage::https://github.com/digimezzo/knowte/releases/download/v2.0.9/Knowte-2.0.9.AppImage - source = knowte.desktop - sha256sums = 0e72b151ec422d1c660b97f70a5b01969e5fce06d96ffac0708b8d6cd6049823 - sha256sums = 2e0022cf360af289e0fecb677ecd629759299f9e845e628bfb10eda88201f154 + makedepends = gendesk + makedepends = nvm + source = knowte-3.0.0.tar.gz::https://github.com/digimezzo/knowte/archive/refs/tags/v3.0.0.tar.gz + source = knowte.sh + sha256sums = 32247fbec85fcd9340e35bcb0c2655e216899ac568e7dbe91844a873da280f64 + sha256sums = 4fc173bf2c4c7f210e4a3fa1983ed6e502aa3bd2845b1947a472952189272b6f pkgname = knowte + depends = electron diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..018a3de08144 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +* +!PKGBUILD +!.SRCINFO +!.gitignore @@ -1,50 +1,110 @@ -# Maintainer: Digimezzo <raphael@digimezzo.com> -_pkgname=Knowte -pkgname=knowte -pkgver=2.0.9 +# Maintainer: +# Contributor: Digimezzo <raphael@digimezzo.com> + +# options +#: ${_pkgtype:=git} + +# basic info +_pkgname=knowte +pkgname="$_pkgname${_pkgtype:+-$_pkgtype}" +pkgver=3.0.0 pkgrel=1 -pkgdesc="A note taking application that allows you to quickly and easily organize and find your notes" -arch=('x86_64') -url="https://www.digimezzo.com" +pkgdesc="Cross platform note taking application" +url="https://github.com/digimezzo/knowte" license=('GPL3') -provides=(${pkgname}) -conflicts=(${pkgname}) -replaces=(${pkgname}) -depends=() -makedepends=('coreutils') -backup=() -options=(!strip) -source=("${_pkgname}-${pkgver}.AppImage::https://github.com/digimezzo/${pkgname}/releases/download/v${pkgver//_/-}/${_pkgname}-${pkgver}.AppImage" - "${pkgname}.desktop") -sha256sums=('0e72b151ec422d1c660b97f70a5b01969e5fce06d96ffac0708b8d6cd6049823' - '2e0022cf360af289e0fecb677ecd629759299f9e845e628bfb10eda88201f154') +arch=('x86_64') + +# main package +_main_package() { + makedepends=( + 'gendesk' + 'nvm' + ) + + if [ x"$pkgname" == x"$_pkgname" ] ; then + _main_stable + else + _main_git + fi + + source+=( + "$_pkgname.sh" + ) + sha256sums+=( + '4fc173bf2c4c7f210e4a3fa1983ed6e502aa3bd2845b1947a472952189272b6f' + ) +} + +# stable package +_main_stable() { + _pkgsrc="$_pkgname-${pkgver%%.r*}" + _pkgext="tar.gz" + source+=( + "$_pkgsrc.$_pkgext"::"$url/archive/refs/tags/v${pkgver%%.r*}.$_pkgext" + ) + sha256sums+=( + '32247fbec85fcd9340e35bcb0c2655e216899ac568e7dbe91844a873da280f64' + ) + + pkgver() { + local _pkgver="${pkgver%%.r*}" + echo "${_pkgver:?}" + } +} +# git package +_main_git() { + provides+=("$_pkgname=${pkgver%%.r*}") + conflicts+=("$_pkgname") + + _pkgsrc="$_pkgname" + source+=("$_pkgsrc"::"git+$url.git") + sha256sums+=('SKIP') + + pkgver() { + cd "$_pkgsrc" + git describe --long --tags --exclude='*[A-Za-z][A-Za-z]*' \ + | sed -E 's/^v//;s/([^-]*-g)/r\1/;s/-/./g' + } +} + +# common functions prepare() { - chmod u+x ${srcdir}/${_pkgname}-${pkgver}.AppImage + gendesk -q -f -n --categories "Utility" --pkgname="${_pkgname}" --pkgdesc="$pkgdesc" --name="Knowte" --exec="${_pkgname}" +} - ${srcdir}/${_pkgname}-${pkgver}.AppImage --appimage-extract +_ensure_local_nvm() { + export NVM_DIR="${srcdir:?}/nvm" + source /usr/share/nvm/init-nvm.sh || [[ $? != 1 ]] + nvm install 16 + nvm use 16 } -package() { - find ${srcdir}/squashfs-root/locales/ -type d -exec chmod 755 {} + - find ${srcdir}/squashfs-root/resources/ -type d -exec chmod 755 {} + +build() { + _ensure_local_nvm - install -d ${pkgdir}/opt/${pkgname} - cp -r ${srcdir}/squashfs-root/* ${pkgdir}/opt/${pkgname} + export XDG_CACHE_HOME="${srcdir:?}/cache" + export XDG_CONFIG_HOME="${srcdir:?}/config" - # remove broken or unused files and directories - rm -r ${pkgdir}/opt/${pkgname}/usr/ - rm ${pkgdir}/opt/${pkgname}/AppRun - rm ${pkgdir}/opt/${pkgname}/${pkgname}.desktop - rm ${pkgdir}/opt/${pkgname}/${pkgname}.png + cd "$_pkgsrc" + npm install --force --no-audit --no-fund + npm install --force --no-audit --no-fund querystring + npm run electron:linux || true +} - find ${srcdir}/squashfs-root/usr/share/icons/ -type d -exec chmod 755 {} + +package() { + depends+=( + 'electron' + ) - install -d ${pkgdir}/usr/share/icons - cp -r ${srcdir}/squashfs-root/usr/share/icons/hicolor ${pkgdir}/usr/share/icons/hicolor + install -Dm755 "$_pkgname.sh" "${pkgdir:?}/usr/bin/$_pkgname" - install -d ${pkgdir}/usr/bin - ln -s ../../opt/${pkgname}/${pkgname} ${pkgdir}/usr/bin/${pkgname} + install -Dm644 "$_pkgsrc/release/linux-unpacked/resources/app.asar" -t "${pkgdir:?}/usr/lib/$_pkgname/" - install -Dm644 ${srcdir}/${pkgname}.desktop ${pkgdir}/usr/share/applications/${pkgname}.desktop + install -Dm644 "$_pkgsrc/build/icon.png" "${pkgdir:?}/usr/share/pixmaps/$_pkgname.png" + + install -Dm644 "${srcdir:?}/$_pkgname.desktop" -t "${pkgdir:?}/usr/share/applications/" } + +# execute +_main_package diff --git a/knowte.desktop b/knowte.desktop deleted file mode 100644 index d92967e9d745..000000000000 --- a/knowte.desktop +++ /dev/null @@ -1,9 +0,0 @@ -[Desktop Entry] -Name=Knowte -Exec=knowte -Terminal=false -Type=Application -Icon=knowte -StartupWMClass=Knowte -Comment=A note taking application that allows you to quickly and easily organize and find your notes -Categories=Utility;
\ No newline at end of file diff --git a/knowte.sh b/knowte.sh new file mode 100644 index 000000000000..4f449d17be80 --- /dev/null +++ b/knowte.sh @@ -0,0 +1,10 @@ +#!/bin/bash +_ELECTRON=/usr/bin/electron +APPDIR="/usr/lib/knowte" +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 |