summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e24752a4c0709bd08ad9c5e2f4065934c0d5f859 (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
# Maintainer: Fredy GarcĂ­a <frealgagu at gmail dot com>
# Contributor: Alexandre Moine < nobrakal at moine dot org >
# Contributor: Tasos Latsas < tlatsas2000 at gmail dot com >
# Contributor: Anton Bazhenov <anton.bazhenov at gmail>
# Contributor: arjan <arjan@archlinux.org>
# Contributor: Tom Newsom <Jeepster@gmx.co.uk>
# Contributor: Dany Martineau <dany.luc.martineau at gmail.com}

pkgname=tuxmath
pkgver=2.0.3
pkgrel=7
pkgdesc="An educational math tutorial game starring Tux, the Linux Penguin"
arch=("i686" "x86_64")
url="https://github.com/tux4kids/${pkgname}/"
license=("custom:OFL" "GPL")
depends=("t4kcommon")
options=(!docs)
source=(
  "${pkgname}-${pkgver}.tar.gz::https://github.com/tux4kids/${pkgname}/archive/upstream/${pkgver}.tar.gz"
  "0001-src-menu_lan.c-Remove-unused-duplicate-lan_player_in.patch"
  "0002-rename-blits-to-tmblits.patch"
)
sha256sums=(
  "ab91bd6df17eb9377e5608701030bd32110a3588933bf0e4c26b5697fb2a4698"
  "852f82370e323ea34825864c063bd44a5dbd6dd60fb2c52338edbeb0b70fbafe"
  "b5ede8e1a870cd19010890d8ca1867c8eae86c9dc3b78712c44e5e7576c05b91"
)

prepare() {
  cd "${srcdir}/${pkgname}-upstream-${pkgver}"

  patch -Np1 -i "${srcdir}/0001-src-menu_lan.c-Remove-unused-duplicate-lan_player_in.patch"
  patch -Np1 -i "${srcdir}/0002-rename-blits-to-tmblits.patch"
}

build() {
  cd "${srcdir}/${pkgname}-upstream-${pkgver}"

  CFLAGS+=" -Wno-incompatible-pointer-types"
  CXXFLAGS+=" -Wno-incompatible-pointer-types"

  ./configure \
    --prefix=/usr \
    --localstatedir=/usr/share/games \
    --sysconfdir=/etc
  make
}

package() {
  cd "${srcdir}/${pkgname}-upstream-${pkgver}"

  make DESTDIR="${pkgdir}" install

  # install .desktop file and icons
  install -dm755 "${pkgdir}/usr/share/"{applications,pixmaps}
  install -Dm644 "${srcdir}/${pkgname}-upstream-${pkgver}/${pkgname}.desktop" "${pkgdir}/usr/share/applications/${pkgname}.desktop"
  install -Dm644 "${srcdir}/${pkgname}-upstream-${pkgver}/data/images/icons/icon.png" "${pkgdir}/usr/share/pixmaps/${pkgname}.png"

  # Install doc
  install -dm755 "${pkgdir}/usr/share/doc/${pkgname}"
  install -Dm644 "${srcdir}/${pkgname}-upstream-${pkgver}/doc/README" "${pkgdir}/usr/share/doc/${pkgname}/README"

  # install licenses
  install -Dm644 "${srcdir}/${pkgname}-upstream-${pkgver}/doc/OFL" "${pkgdir}/usr/share/licenses/${pkgname}/OFL"
  install -Dm644 "${srcdir}/${pkgname}-upstream-${pkgver}/doc/README_DATA_LICENSES" "${pkgdir}/usr/share/licenses/${pkgname}/DATA_LICENSES"
}