You are not logged in.

#1 2021-07-03 10:18:02

Feakster
Member
Registered: 2021-07-02
Posts: 1

[REQUEST] simplenote-electron

Hi,

I was wondering whether you would consider adding simplenote-electron to the Arch community repo?

A PKGBUILD for simplenote-electron-bin is already present in the AUR, but this uses a *.deb as it's source. There's nothing inherently wrong with this, but for a PKGBUILD where the contents are just vomited into /opt/$pkgname/ I feel it makes more sense to use an *.AppImage for the package source as these place less assumptions on system shared object versions. Additionally, The upstream devs support more architectures as AppImages than they do as debs (https://github.com/Automattic/simplenot … ag/v2.13.0). Hence, switching the package source binary to the *.AppImage would benefit more Arch Linux downstream projects, such as Arch Linux ARM, which typically use PKGBUILDs from Arch Linux x86_64 as a starting point. I've asked the current maintainer of the AUR simplenote-electron-bin PKGBUILD, whether they would consider modifying their PKGBUILD to use the *.AppImage as the package source, but they are reluctant to do so as it would add complexity. However, as this is quite a popular programme, I thought that it might be a good candidate for the Arch community repo.

All comments on the PKGBUILD are welcome. It installs and runs without error on aarch64 & x86_64. I can't vouch for armv7h & i686 architectures as I don't have any of these installations to hand to test, but I can't see any reason why it wouldn't work on these. Some stuff that could potentially be removed is the "Fix Permissions" section in prepare(). The upstream devs were a bit lax with their file/directory permissions in the past. I'm not sure whether this is still the case, but left this in to cover those bases. I've tried building the package from the actual source code, but so far I've failed. I'm guessing it's not that easy to do, otherwise there would probably already be an AUR package that did so, and I wouldn't be here typing this now.

# Maintainer: Feakster <feakster at posteo dot eu>

### Info ###
pkgname=simplenote-electron
_pkgname=${pkgname%-electron}
pkgver=2.13.0
_appimage="simplenote-electron-${pkgver}-${CARCH}.AppImage"
pkgrel=1
pkgdesc='The simplest way to keep notes'
arch=('armv7h' 'aarch64' 'i686' 'x86_64')
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=('fuse2')
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")
source_i686=("simplenote-electron-${pkgver}-i686.AppImage::${url}/releases/download/v${pkgver}/Simplenote-linux-${pkgver}-i386.AppImage")
source_x86_64=("simplenote-electron-${pkgver}-x86_64.AppImage::${url}/releases/download/v${pkgver}/Simplenote-linux-${pkgver}-x86_64.AppImage")
noextract=("${source[@]%%::*}")
b2sums_armv7h=('73915723c884d741465b47049159496aadb9378fb487f4bbf165568675e69ad0a2de2a5af18b281eee1a2dc35eb805b3a5c8684885c50c383ee44d645d240a7d')
b2sums_aarch64=('1df436f6b106528d44e4bd3ed3f8ed0fcbf41d129174291545dffba8dbcdca57722fb7447d8d6edcb7df0be6d8d69c695379f07c15df37331a77e8b67098dd63')
b2sums_i686=('45a2c06bf37824b968d28f7c6a94da97218ee51e71b3472c2156f2dfdd01294bd1044e7e4d27255b3071bf14b7d26c86ef33ae454152c32090a0fd24f6ed29f7')
b2sums_x86_64=('27f858e19861cf15b482161f8a6167d1a3839464e76dcdc59fdd5e2472df0544f805813f4711bd76643b1893fbfebc3f90f469e189ba0bac8a034a7ccc77d054')

### Prepare ###
prepare() {
    ## Change Directory ##
    cd "$srcdir"

    ## Mark AppImage as Executable ##
    chmod a+x $_appimage

    ## Extract AppImage into squashfs-root Directory ##
    ./$_appimage --appimage-extract

    ## Remove Unnecessary 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
}

Offline

#2 2021-07-03 11:06:36

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 9,326

Re: [REQUEST] simplenote-electron

I feel it makes more sense to use an *.AppImage for the package source as these place less assumptions on system shared object versions.

That is usually considered a big downside for an archlinux package .

https://appimage.org/ wrote:

Download an application, make it executable, and run! No need to install. No system libraries or system preferences are altered. Can also run in a sandbox like Firejail

That's great for user installs , not for systemwide installs through a package manager .


Don't try to create a package for an electron application that is based on an appimage, try using system installed electron* .

https://wiki.archlinux.org/title/Electr … guidelines should help you to get started.


* If this is succesful, chances are very few architecture related changes are needed.

Check


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
Did you use the guided installer ? If yes, I can't help you.

(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

Board footer

Powered by FluxBB