summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 274291a3c919c8423e978fdf120881468f9c5af4 (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
# Maintainer: Amos Wenger <amos@itch.io>
# Contributor: FrozenCow <frozencow@gmail.com>

pkgname=itch-bin
pkgver=23.6.3
pkgrel=3
pkgdesc="The best way to play itch.io games."

arch=('i686' 'x86_64')
url="https://github.com/itchio/itch"
license=('MIT')

depends=('alsa-lib' 'libnotify' 'nss' 'gconf' 'gtk2' 'libxtst' 'desktop-file-utils' 'gtk-update-icon-cache' 'libxss')
makedepends=()
options=('!strip')
provides=('itch')
conflicts=('itch')
install="itch.install"

[ "$CARCH" = "i686" ]   && _ELECTRON_ARCH=ia32; _ITCH_ARCH=i386
[ "$CARCH" = "x86_64" ] && _ELECTRON_ARCH=x64;  _ITCH_ARCH=amd64

# sic. - source is in itch repo, kitch is a dummy repo for canary-channel github releases
source=("https://github.com/itchio/itch/releases/download/v${pkgver}/itch-${pkgver}-${_ITCH_ARCH}.tar.xz" 
"extras.tar.gz")
sha256sums=('d9015929cecf5d68c05b109dc462ee42d457f7e7a5feb8885678fcc355ae8212' '66da55a3c7700a411aadc70123ac3bff4ba4a529683381fa9dd14ef303065799')

prepare() {
  basedir=`cd .. && pwd`;
  tar xf "${basedir}/extras.tar.gz"
}

package() {
  tar xf itch-${pkgver}-${_ITCH_ARCH}.tar.xz
  cd "${srcdir}/itch-${pkgver}-${_ITCH_ARCH}"

  install -d "${pkgdir}/usr/lib/itch"
  cp -a "${srcdir}/itch-${pkgver}-${_ITCH_ARCH}/." "${pkgdir}/usr/lib/itch"

  install -d "${pkgdir}/usr/share/applications"
  install -Dm644 "${srcdir}/extras/io.itch.itch.desktop" "${pkgdir}/usr/share/applications/itch.desktop"

  for icon in ${srcdir}/extras/icon*.png
  do
    iconsize="${icon#${srcdir}/extras/icon}"
    iconsize="${iconsize%.png}"
    icondir="${pkgdir}/usr/share/icons/hicolor/${iconsize}x${iconsize}/apps/"
    install -d "${icondir}"
    install -Dm644 "$icon" "$icondir/itch.png"
  done

  install -D -m644 "${srcdir}/extras/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"

  mkdir -p "${pkgdir}/usr/bin"
  ln -s "/usr/lib/itch/itch" "${pkgdir}/usr/bin/itch"
}