blob: 64673964e339d6f201f094eaef966442362775d7 (
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
|
# Maintainer: twchen aur@twchen.cc
pkgname=joplin-appimage
pkgver=1.0.117
pkgrel=1
pkgdesc="The latest released AppImage of Joplin - a cross-platform note taking and to-do app"
arch=('x86_64')
url="https://github.com/laurent22/joplin"
license=('MIT')
makedepends=('curl' 'grep')
options=(!strip) # necessary otherwise the AppImage file in the package is truncated
_filename=Joplin-$pkgver-x86_64.AppImage
pkgver() {
RELEASES_URL=https://api.github.com/repos/laurent22/joplin/releases/latest
curl $RELEASES_URL | grep -oP '(?<="name":\s"v).*(?=")'
}
build() {
curl -L "https://github.com/laurent22/joplin/releases/download/v$pkgver/$_filename" -O
}
package() {
chmod +x $_filename
mkdir -p squashfs-root/usr/share/icons/hicolor/{72x72,16x16}/apps
./$_filename --appimage-extract "usr/share/icons/hicolor/*/apps/joplin.png" > /dev/null 2>&1
./$_filename --appimage-extract joplin.desktop > /dev/null 2>&1
INSTALL_PATH="/opt/appimages/Joplin.AppImage"
sed -i -E "s|Exec=AppRun|Exec=${INSTALL_PATH}|" squashfs-root/joplin.desktop
# install icons
install -dm755 "$pkgdir/usr/share/icons"
cp -dpr --no-preserve=ownership "squashfs-root/usr/share/icons" "$pkgdir/usr/share"
chmod -R 755 "$pkgdir/usr/share/icons"
find "$pkgdir/usr/share/icons" -type f -name "joplin.png" -exec chmod 644 {} \;
# install .desktop file and image file
install -Dm644 "squashfs-root/joplin.desktop" "$pkgdir/usr/share/applications/joplin.desktop"
install -Dm755 "$_filename" "$pkgdir$INSTALL_PATH"
# disable AppImage integration prompt
# https://github.com/electron-userland/electron-builder/issues/1962
install -dm755 "$pkgdir/usr/share/appimagekit"
touch "$pkgdir/usr/share/appimagekit/no_desktopintegration"
chmod 644 "$pkgdir/usr/share/appimagekit/no_desktopintegration"
}
|