summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c551e6febf126d7d0c79b1451be630b24d79135c (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
# Maintainer: Harrison <htv04rules at gmail dot com>

_pkgbase=grrlib
_reponame=${_pkgbase^^}

pkgbase=${_pkgbase}-git
pkgname=("ppc-libpngu-git" "wii-${pkgbase}")
pkgver=4.4.1.r14.gc432111
pkgrel=1
pkgdesc="A C/C++ 2D/3D graphics library for Wii application developers"
arch=("x86_64")
url="https://github.com/GRRLIB/${_reponame}"
license=("MIT")
makedepends=("git")
options=("!strip") # Binary format is different than expected
source=("git+${url}.git"
        "libpngu-destdir.patch"
        "grrlib-destdir.patch")
sha256sums=("SKIP"
            "ea3a6147b1f03f6ae4278bc707109bc3386cb64eb1ab57fcb86e6194ff095fda"
            "4deab45ed27a4e287cc3dfc9b64f87b093cf27f3995a7ca5f90c5498c91c0d1f")

pkgver() {
  cd "${srcdir}/${_reponame}"

  git describe --long | sed "s/^v//;s/\([^-]*-g\)/r\1/;s/-/./g"
}

prepare() {
  cd "${srcdir}"

  # Patch Makefiles with DESTDIR support
  patch "${_reponame}/GRRLIB/lib/pngu/Makefile" libpngu-destdir.patch
  patch "${_reponame}/GRRLIB/GRRLIB/Makefile" grrlib-destdir.patch
}

build() {
  cd "${srcdir}/${_reponame}/GRRLIB"

  # Build libpngu and GRRLIB
  for lib in lib/pngu GRRLIB; do
    pushd ${lib} > /dev/null
    make clean all
    popd > /dev/null
  done
}

# NOTE: Must update function name and references manually
package_ppc-libpngu-git() {
  depends=("devkitPPC" "ppc-libpng")
  provides=("ppc-libpngu")

  cd "${srcdir}/${_reponame}"

  # Install license
  install -Dm0644 LICENCE.md "${pkgdir}/opt/devkitpro/portlibs/ppc/licenses/ppc-libpngu-git/LICENCE.md"

  cd GRRLIB/lib/pngu

  make DESTDIR="${pkgdir}" install
}

# NOTE: Must update function name and references manually
package_wii-grrlib-git() {
  depends=("devkitPPC" "libfat-ogc" "ppc-libpngu" "ppc-freetype" "ppc-libjpeg-turbo")
  provides=("wii-${_pkgbase}")

  cd "${srcdir}/${_reponame}"

  # Install license
  install -Dm0644 LICENCE.md "${pkgdir}/opt/devkitpro/portlibs/wii/licenses/wii-${pkgbase}/LICENCE.md"

  cd GRRLIB/GRRLIB

  make DESTDIR="${pkgdir}" install
}