diff options
author | Feakster | 2021-01-31 18:00:23 +0000 |
---|---|---|
committer | Feakster | 2021-01-31 18:00:23 +0000 |
commit | eb92bf8c244e3a1a3a9d6c8e8dfcc4de806e6d34 (patch) | |
tree | cd3bf1afd08b6a3cd4fb0b4de6a33b2266e66f9f | |
parent | dbc2aa0b2e60f94f48fee7149bb74b9f57ef769a (diff) | |
download | aur-eb92bf8c244e3a1a3a9d6c8e8dfcc4de806e6d34.tar.gz |
The great symlinking
- Swapped out a few of the embedded shared objects for symlinks towards system ones. I may add checks to ensure the filesystem targets exist before forcefully overwriting with symlinks, but I'm not sure this is necessary at the moment.
- Symlinkd the embedded licenses into /usr/share/licenses/$pkgname/.
-rw-r--r-- | PKGBUILD | 26 | ||||
-rw-r--r-- | simplenote-electron-arm-bin.install | 41 |
2 files changed, 47 insertions, 20 deletions
@@ -5,12 +5,12 @@ pkgname=simplenote-electron-arm-bin _pkgname=${pkgname%-electron-arm-bin} pkgver=2.5.0 _appimage="simplenote-electron-${pkgver}-${CARCH}.AppImage" -pkgrel=2 +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' 'nss') +depends=('gtk3' 'hicolor-icon-theme' 'libxss' 'mesa' 'nss') optdepends=( 'libnotify: desktop notifications' 'noto-fonts-emoji: emoji support' @@ -37,10 +37,21 @@ prepare() { ## Extract AppImage into squashfs-root Directory ## ./$_appimage --appimage-extract + ## Remove Unneccessary Directories/Files ## + rm squashfs-root/AppRun + rm squashfs-root/$_pkgname.png + rm squashfs-root/.DirIcon + ## Fix Permissions ## find squashfs-root -type d -exec chmod 0755 {} \; find squashfs-root -type f -name '*.so' -exec chmod 0644 {} \; - + + ## Replace Shared Objects with Symlinks ## + for SO in EGL GLESv2 vulkan + do + ln -fs /usr/lib/${SO}.so squashfs-root/lib${SO}.so + done + ## Modify Desktop File ## sed -i \ -e "s|^Exec=AppRun$|Exec=/usr/bin/${_pkgname}|" \ @@ -59,15 +70,12 @@ package() { install -dm0755 "$pkgdir"/usr/bin install -dm0755 "$pkgdir"/opt/$_pkgname install -dm0755 "$pkgdir"/usr/share/{applications,icons} + install -dm0755 "$pkgdir"/usr/share/licenses/$pkgname ## Install Icons ## cp -RL squashfs-root/usr/share/icons/hicolor "$pkgdir"/usr/share/icons/ + rm -rf squashfs-root/usr ## Move AppImage Contents to /opt/$_pkgname ## - cp -RLT squashfs-root "$pkgdir"/opt/$_pkgname - - ## Remove Unneccessary Directories/Files ## - rm -rf "$pkgdir"/opt/$_pkgname/usr - rm "$pkgdir"/opt/$_pkgname/AppRun - rm "$pkgdir"/opt/$_pkgname/$_pkgname.png + cp -RT squashfs-root "$pkgdir"/opt/$_pkgname } diff --git a/simplenote-electron-arm-bin.install b/simplenote-electron-arm-bin.install index 020b7c7da089..80b1d2b73f56 100644 --- a/simplenote-electron-arm-bin.install +++ b/simplenote-electron-arm-bin.install @@ -1,20 +1,39 @@ -### Vars ### +### Environmental Vars ### +pkgname=simplenote-electron-arm-bin _pkgname=simplenote ### Post Install ### post_install() { - ## Symlink Files ## - ln -s \ - "$pkgdir"/opt/$_pkgname/${_pkgname}.desktop \ - "$pkgdir"/usr/share/applications/${_pkgname}.desktop - ln -s \ - "$pkgdir"/opt/$_pkgname/$_pkgname \ - "$pkgdir"/usr/bin/$_pkgname + ## Symlink Files ## + ln -fs \ + "$pkgdir"/opt/$_pkgname/${_pkgname}.desktop \ + "$pkgdir"/usr/share/applications/${_pkgname}.desktop + ln -fs \ + "$pkgdir"/opt/$_pkgname/$_pkgname \ + "$pkgdir"/usr/bin/$_pkgname + + ## Symlink Licenses ## + ln -fs \ + "$pkgdir"/opt/$_pkgname/LICENSE.electron.txt \ + "$pkgdir"/usr/share/licenses/$pkgname/LICENSE.electron.txt + ln -fs \ + "$pkgdir"/opt/$_pkgname/LICENSES.chromium.html \ + "$pkgdir"/usr/share/licenses/$pkgname/LICENSES.chromium.html + + ## Change Permissions on Sandbox ## + chmod 4755 "$pkgdir"/opt/$_pkgname/chrome-sandbox +} + +### Post Upgrade ### +post_upgrade() { + ## Change Permissions on Sandbox ## + chmod 4755 "$pkgdir"/opt/$_pkgname/chrome-sandbox } ### Post Remove ### post_remove() { - ## Remove Symlinks ## - rm "$pkgdir"/usr/share/applications/${_pkgname}.desktop - rm "$pkgdir"/usr/bin/$_pkgname + ## Remove Symlinks ## + rm \ + "$pkgdir"/usr/share/applications/${_pkgname}.desktop \ + "$pkgdir"/usr/bin/$_pkgname } |