Arch PKGBUILD for desktop app

For other Arch Linux users out there: I created a PKGBUILD file for the desktop app, based on a generic AppImage one I found on the 'net. If I feel brave enough I might even upload it to the Arch User Repository. :slight_smile:

A real build should probably extract the contents to something like /usr/lib/supernotes. Also, I could not find a license text so I took the terms from the website. @Supernotes do you have a plain text license?

Unfortunately, the app window decorations feel very out of place on KDE, but that might be something only the Supernotes devs can do something about. :wink:

_pkgname=supernotes
pkgname="${_pkgname}"-appimage
pkgver=1.8.4
pkgrel=1
pkgdesc="Web-based note taking app"
arch=('x86_64')
url="https://supernotes.app"
license=('custom')
depends=('zlib' 'hicolor-icon-theme')
options=(!strip)
_appimage="${pkgname}-${pkgver}.AppImage"
_terms="$pkgname-$pkgver-terms.html"
source_x86_64=("${_appimage}::https://download.supernotes.app/desktop/Supernotes-${pkgver}.AppImage"
               "${_terms}::https://supernotes.app/terms/"
              )
noextract=("${_appimage}")
sha256sums_x86_64=('778a62f32eeeb81de43ecdff62704fa41e8ff9b1fdb4f0d30fcaf3ab7fd227de'
                   'b0ac433a509e713bcd560c269a99b731dedc032009d2b599a73dcee31dde07d9')

prepare() {
    chmod +x "${_appimage}"
    ./"${_appimage}" --appimage-extract
}

build() {
    # Adjust .desktop so it will work outside of AppImage container
    sed -i -E "s|Exec=AppRun|Exec=env DESKTOPINTEGRATION=false /usr/bin/${_pkgname}|"\
        "squashfs-root/${_pkgname}.desktop"
    # Fix permissions; .AppImage permissions are 700 for all directories
    chmod -R a-x+rX squashfs-root/usr
}

package() {
    # AppImage
    install -Dm755 "${srcdir}/${_appimage}" "${pkgdir}/opt/${pkgname}/${pkgname}.AppImage"
    install -Dm644 "${srcdir}/${_terms}" "${pkgdir}/opt/${pkgname}/LICENSE.html"

    # Desktop file
    install -Dm644 "${srcdir}/squashfs-root/${_pkgname}.desktop"\
            "${pkgdir}/usr/share/applications/${_pkgname}.desktop"

    # Icon images
    install -dm755 "${pkgdir}/usr/share/"
    cp -a "${srcdir}/squashfs-root/usr/share/icons" "${pkgdir}/usr/share/"

    # Symlink executable
    install -dm755 "${pkgdir}/usr/bin"
    ln -s "/opt/${pkgname}/${pkgname}.AppImage" "${pkgdir}/usr/bin/${_pkgname}"

    # Symlink license
    install -dm755 "${pkgdir}/usr/share/licenses/${pkgname}/"
    ln -s "/opt/$pkgname/LICENSE.html" "$pkgdir/usr/share/licenses/$pkgname/LICENSE.html"
}
4 Likes

Hey @jcassee, this looks great! Thanks for putting this out there. For license purposes it’s fine to just put “copyright Supernotes, all rights reserved”.

We can definitely look into adding better support for Arch / KDE out of the box, at the moment we are only testing against Ubuntu.

Would be great to know if we have any other Arch users out there who’d be interested in this!

2 Likes

Thanks @jcassee for the PKGBUILD I just updated the version and hashes and it worked perfectly.

Fellow Arch user here. I would appreciate Flatpak support. That nearly every Linux distro can run it, not just specific supported distros. :slight_smile: