summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 4f2c71610ed65be97f979a6d13edde51b919d742 (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# Maintainer: Chris Severance aur.severach aATt spamgourmet dott com
# Contributor: beest <gnubeest at zoho dot com>
# Contributor: c0mmando <c0mmand0_88 at yahoo dot com dot ar>
# Contributor: Farhan Yousasf <farhany at gmail dot com>
# Contributor: Vinzenz Vietzke <vinz at archlinux dot us>

set -u
pkgname='atari800'
#pkgname+='-git'
pkgver=5.2.0
pkgrel=1
pkgdesc='An emulator of the Atari 800/800XL/130XE/5200 with various extensions'
arch=('i686' 'x86_64')
arch+=('aarch64') # Idorobots
#url='https://atari800.sourceforge.net/'
url='https://atari800.github.io/'
_giturl='https://github.com/atari800/atari800'
license=('GPL2')
depends=('sdl')
optdepends=('libpng: PNG screenshot support')
options=('!strip')
_srcdir="${pkgname%-git}-${pkgver%.r*}"
_srcf="${_srcdir^^}"
_srcf="${_srcf//./_}"
_srcf="${_srcf//-/_}"
source=(
  "${_giturl}/releases/download/${_srcf}/${_srcdir}-src.tgz"
  'atari.sh'
  'atari800.desktop'
)
if ! :; then
  source[0]="${_giturl}/archive/refs/tags/${_srcf}.tar.gz"
  _srcdir="${pkgname%-git}-${_srcf}"
fi
unset _srcf
md5sums=('bed6188abbe73c2ac109dc954050fd46'
         '4f6ae0290954e7132c705c9f9fc37dd2'
         '82d425a60aa04f7596ffe0d3cf3dfd92')
sha256sums=('3874d02b89d83c8089f75391a4c91ecb4e94001da2020c2617be088eba1f461f'
            '832fcb80e3eb02e7d5d8d50512e82c28aef9110e4f764f288b12228e99c13f42'
            '95e03020358a0855e12ee19b62abebb336e472fcf525f7eb42dcc28419588df9')

if [ "${pkgname%-git}" != "${pkgname}" ]; then
  source[0]="git+${_giturl}.git"
  md5sums[0]='SKIP'
  sha256sums[0]='SKIP'
  conflicts=("${pkgname%-git}")
  provides=("${pkgname%-git}=${pkgver%%.r*}")
  _srcdir="${pkgname%-git}"
pkgver() {
  set -u
  cd "${_srcdir}"
  local _ver="$(git describe --tags --long)"
  _ver="${_ver#ATARI800_}"
  _ver="${_ver/-/-r}"
  _ver="${_ver//_/.}"
  _ver="${_ver//-/.}"
  printf '%s' "${_ver}"
  set +u
}
else
  if [ "${pkgver%.r*}" != "${pkgver}" ]; then
pkgver() {
  printf '%s' "${pkgver%.r*}"
}
  fi
fi

build() {
  set -u
  cd "${_srcdir}"
  if [ -s 'src/autogen.sh' ]; then
    cd 'src'
  fi
  if [ ! -s 'configure' ]; then
    sh -e -u 'autogen.sh'
  fi
  if [ ! -s 'Makefile' ]; then
    local _copts=(
      --prefix='/usr'
      #--enable-riodevice        # The R: Network device, enabled as of 4.2
      #--enable-seriosound       # SIO Sound for true retro feeling
      #--enable-onscreenkeyboard # OnScreen Keyboard
      --enable-linuxjoystick
    )
    ./configure "${_copts[@]}"
  fi
  make
  set +u
}

package() {
  set -u
  cd "${_srcdir}"
  if [ -s 'src/autogen.sh' ]; then
    cd 'src'
  fi
  make DESTDIR="${pkgdir}/" install
  install -Dm755 "${srcdir}/atari800.desktop" -t "${pkgdir}/usr/share/applications/"
  install -Dm755 'data/atari2.png' "${pkgdir}/usr/share/pixmaps/atari800.png"
  set +u
  msg2 "\e[1;32mThis package has some options you might interested in. Have a look at _copts[@] in PKGBUILD.\e[0m"
}
set +u