summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: da0502a73367c895dcadfeea5356b93faad4b407 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# Maintainer: begin-theadventure <begin-thecontact.ncncb at dralias dot com>
# Contributor: Artorias
# Contributor: Gustavo Chain <me@qustavo.cc>
# Contributor: zxp19821005 <zxp19821005 at 163 dot com>

pkgname=notesnook-bin
pkgdesc="A fully open source & end-to-end encrypted note taking alternative to Evernote (binary release)"
pkgver=3.0.22
pkgrel=1
url="https://github.com/streetwriters/notesnook"
license=('GPL-3.0-or-later')
arch=('x86_64' 'aarch64')
depends=('alsa-lib' 'gtk3' 'hicolor-icon-theme' 'libappindicator-gtk3' 'libindicator-gtk3' 'libnotify'
         'libxss' 'libxtst' 'mesa' 'nss')
makedepends=('fuse2')
provides=("notesnook")
conflicts=("notesnook")
_appimage="notesnook_linux_$CARCH-$pkgver.AppImage"
source_x86_64=("$_appimage::$url/releases/download/v$pkgver/notesnook_linux_x86_64.AppImage")
source_aarch64=("$_appimage::$url/releases/download/v$pkgver/notesnook_linux_arm64.AppImage")
sha256sums_x86_64=('13ad79d755148ceefaa7eee5aab13decd5b992a37c5ddc91746ddc9289ec4be9')
sha256sums_aarch64=('SKIP')
#sha256sums_aarch64=('SKIP')
#sha256sums_aarch64=('SKIP')

_fix_permissions() (
  target=$1

  if [[ -L "$target" ]]; then
    return 0
  fi

  if [[ -d "$target" || -x "$target" ]]; then
    chmod 755 "$target"
    return 0
  fi

  if [[ -f "$target" ]]; then
    chmod 644 "$target"
    return 0
  fi

  echo "Unrecognizable filesystem entry: $target" >&2
  return 1
) # Source: upscayl-appimage

prepare() {
# Extract the AppImage
  chmod +x "./$_appimage"
  "./$_appimage" --appimage-extract
# Edit the shortcut
  cd squashfs-root
  sed -i -E "s|Exec=AppRun|Exec=notesnook|g" notesnook.desktop
  sed -i "/X-AppImage-Version=$pkgver/d; /actions=undefined/d" notesnook.desktop
  sed -i 's/--no-sandbox //g' notesnook.desktop
}

package() {
# Create directories
  mkdir -p "$pkgdir/opt/notesnook" "$pkgdir/usr/bin"
# Install
  cd squashfs-root
  for i in 16 32 48 64 128 256 512 1024; do
    mkdir -p "$pkgdir/usr/share/icons/hicolor/${i}x${i}/apps"
    ln -s /opt/notesnook/resources/assets/icons/${i}x${i}.png "$pkgdir/usr/share/icons/hicolor/${i}x${i}/apps/notesnook.png"
  done
  install -Dm644 notesnook.desktop -t "$pkgdir/usr/share/applications"
  rm -dr usr AppRun notesnook.desktop notesnook.png .DirIcon resources/app-update.yml
  ln -s /opt/notesnook/notesnook "$pkgdir/usr/bin"
  mv * "$pkgdir/opt/notesnook"
# Fix permissions
  find "$pkgdir/opt/notesnook" | while read -r target; do
    _fix_permissions "$target"
  done
}