summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 751d416c90d62fbeb1631ca5f2cf1ddbfa27256c (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
# Maintainer: Kendall G. <kgarner at duck dot com>

pkgname=feishin-appimage
pkgver=0.11.1
pkgrel=1
pkgdesc="Sonixd Rewrite"
arch=('x86_64')
url="https://github.com/jeffvli/feishin"
provides=("feishin")
license=('GPL3')
depends=('fuse2' 'mpv')
options=(!strip) # necessary otherwise the AppImage file in the package is truncated
conflicts=("feishin-bin")
_filename=Feishin-${pkgver//_/-}-linux-$CARCH.AppImage
source=("${url}/releases/download/v${pkgver//_/-}/${_filename}")
sha256sums=("25789697967908834585ef49c71891723645cecff06cf8b3aa8bcb525a98336c")
pkgdesc="A modern self-hosted music player."
INSTALL_PATH="/opt/${pkgname}/${_filename}"

prepare() {
  chmod +x $_filename
  mkdir -p squashfs-root/usr/share/icons/hicolor
  ./$_filename --appimage-extract "usr/share/icons/hicolor/*/apps/feishin.png" > /dev/null 2>&1
  ./$_filename --appimage-extract feishin.desktop > /dev/null 2>&1
}

build() {
  sed -i -E "s|Exec=AppRun|Exec=${INSTALL_PATH}|" squashfs-root/feishin.desktop
  # Fix permissions; .AppImage permissions are 700 for all directories
  chmod -R a-x+rX squashfs-root/usr
}

package() {
  # install icons
  install -dm755 "${pkgdir}/usr/share/icons"
  cp -dpr --no-preserve=ownership "squashfs-root/usr/share/icons" "${pkgdir}/usr/share"
  # In 0.4.0 the only image directory is 0x0, move it to the right one
  mv "${pkgdir}/usr/share/icons/hicolor/0x0" "${pkgdir}/usr/share/icons/hicolor/512x512"
  chmod -R 755 "${pkgdir}/usr/share/icons"
  find "${pkgdir}/usr/share/icons" -type f -name "feishin.png" -exec chmod 644 {} \;

  # install .desktop file and image file
  install -Dm644 "squashfs-root/feishin.desktop" "${pkgdir}/usr/share/applications/feishin.desktop"
  install -Dm755 "${_filename}" "${pkgdir}${INSTALL_PATH}"
}