summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b0908e7e6f8ce741625dc6fc22bc1e949bf2a3df (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
47
48
49
50
51
52
53
54
55
56
57
# Maintainer: timofei302 <timofei302 at proton dot me>

pkgname=hypersomnia-appimage
pkgver=1.2.9167
pkgrel=1
pkgdesc="Online shooter with relentless dynamics."
arch=('x86_64')
url="https://hypersomnia.xyz"
license=('AGPL3')
conflicts=('hypersomnia-git')
depends=('fuse2')
options=(!strip) # necessary otherwise the AppImage file in the package is truncated
source=(
  ${url}/builds/latest/Hypersomnia.AppImage
)
sha512sums=(
  SKIP
)
_filename="Hypersomnia.AppImage"
_squashfs_desktop_file="Hypersomnia.desktop"
_desktop_file="/usr/share/applications/Hypersomnia-appimage.desktop"
_appimage_name=$(echo "${_filename}"|sed -E 's/-[0-9]*.[0-9]*.[0-9]*//')
_install_path="/opt/hypersomnia/${_appimage_name}"

package() {
    chmod +x "${_filename}"
    mkdir -p squashfs-root/usr/share/icons/hicolor/64x64/apps
    ./${_filename} --appimage-extract "usr/share/icons/hicolor/64x64/apps/Hypersomnia.png" > /dev/null 2>&1
    echo "#\!/usr/bin/env xdg-open
[Desktop Entry]
Type=Application
Categories=Game
Name=Hypersomnia
Comment=Online shooter with relentless dynamics.
Exec=hypersomnia
Icon=Hypersomnia
StartupNotify=false
Terminal=false" >> squashfs-root/Hypersomnia.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 "Hypersomnia.png" -exec chmod 644 {} \;

    # install .desktop file and image file

    install -Dm644 "squashfs-root/${_squashfs_desktop_file}" "${pkgdir}/${_desktop_file}"
    install -Dm777 "${_filename}" "${pkgdir}/${_install_path}"
    chmod 777 -R "${pkgdir}/opt/hypersomnia/" # It is necessary for correct auto-update
    mkdir "${pkgdir}/usr/bin/" && chmod 755 "${pkgdir}/usr/bin/"
    ln -s "${_install_path}" "${pkgdir}/usr/bin/hypersomnia"

    # disable AppImage integration prompt
    # https://github.com/electron-userland/electron-builder/issues/1962
    install -dm755 "${pkgdir}/usr/share/appimagekit"
}