# Maintainer: Feakster ### Info ### pkgname=simplenote-electron-arm-bin _pkgname=${pkgname%-electron-arm-bin} pkgver=2.13.0 _appimage="simplenote-electron-${pkgver}-${CARCH}.AppImage" pkgrel=3 pkgdesc='The simplest way to keep notes' arch=('armv7h' 'aarch64') url='https://github.com/Automattic/simplenote-electron' license=('GPL2') depends=('gtk3' 'hicolor-icon-theme' 'libxss' 'mesa' 'nss') optdepends=( 'libnotify: desktop notifications' 'noto-fonts-emoji: emoji support' 'ttf-joypixels: emoji support' ) makedepends=('fuse' 'zlib') provides=('simplenote') options=(!strip) source_armv7h=("simplenote-electron-${pkgver}-armv7h.AppImage::${url}/releases/download/v${pkgver}/Simplenote-linux-${pkgver}-armv7l.AppImage") source_aarch64=("simplenote-electron-${pkgver}-aarch64.AppImage::${url}/releases/download/v${pkgver}/Simplenote-linux-${pkgver}-arm64.AppImage") noextract=("${source[@]%%::*}") b2sums_armv7h=('73915723c884d741465b47049159496aadb9378fb487f4bbf165568675e69ad0a2de2a5af18b281eee1a2dc35eb805b3a5c8684885c50c383ee44d645d240a7d') b2sums_aarch64=('1df436f6b106528d44e4bd3ed3f8ed0fcbf41d129174291545dffba8dbcdca57722fb7447d8d6edcb7df0be6d8d69c695379f07c15df37331a77e8b67098dd63') ### Prepare ### prepare() { ## Change Directory ## cd "$srcdir" ## Mark AppImage as Executable ## chmod a+x $_appimage ## Extract AppImage into squashfs-root Directory ## ./$_appimage --appimage-extract ## Remove Unneccessary Files ## rm squashfs-root/{.DirIcon,AppRun,$_pkgname.png} ## Fix Permissions ## find squashfs-root -type d -exec chmod 0755 {} \; find squashfs-root -type f -exec chmod 0644 {} \; find squashfs-root -type f -regex '^.+\.so\(\.[0-9]+\)?$' -exec chmod 0755 {} \; chmod 0755 squashfs-root/$_pkgname ## Modify Desktop File ## sed -i \ -e "s|^Exec=.*|Exec=/usr/bin/$_pkgname %U|" \ -e '/^TryExec=.*/d' \ -e '/^X-AppImage-Version=.*/d' \ squashfs-root/${_pkgname}.desktop echo "TryExec=/opt/$_pkgname/$_pkgname" >> squashfs-root/${_pkgname}.desktop } ### Package ### package() { ## Move AppImage Contents to /opt/$_pkgname ## install -dm0755 "$pkgdir"/opt/$_pkgname cp -RT "$srcdir"/squashfs-root "$pkgdir"/opt/$_pkgname ## SUID Sandbox ## chmod 4755 "$pkgdir"/opt/$_pkgname/chrome-sandbox ## Executable Binary ## install -dm0755 "$pkgdir"/usr/bin ln -fs \ /opt/$_pkgname/$_pkgname \ "$pkgdir"/usr/bin/$_pkgname ## Icons ## for SIZE in 16 32 48 64 128 256 512 1024 do install -dm0755 "$pkgdir"/usr/share/icons/hicolor/${SIZE}x${SIZE}/apps ln -fs \ /opt/$_pkgname/usr/share/icons/hicolor/${SIZE}x${SIZE}/apps/${_pkgname}.png \ "$pkgdir"/usr/share/icons/hicolor/${SIZE}x${SIZE}/apps/${_pkgname}.png done ## Desktop Entry ## install -dm0755 "$pkgdir"/usr/share/applications ln -fs \ /opt/$_pkgname/${_pkgname}.desktop \ "$pkgdir"/usr/share/applications/${_pkgname}.desktop ## Licenses ## install -dm0755 "$pkgdir"/usr/share/licenses/$pkgname ln -fs \ /opt/$_pkgname/LICENSE.electron.txt \ "$pkgdir"/usr/share/licenses/$pkgname/LICENSE.electron.txt ln -fs \ /opt/$_pkgname/LICENSES.chromium.html \ "$pkgdir"/usr/share/licenses/$pkgname/LICENSES.chromium.html }