summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 15bf82f7b68ec73b01d9138dcaf5bcdb05364447 (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
#! /bin/bash
# Maintainer: Markus Kitsinger (SwooshyCueb) <root@swooshalicio.us>

_pkgname=desmume
pkgname=${_pkgname}-git
pkgdesc='Nintendo DS emulator'
url='http://desmume.org/'
arch=('i686' 'x86_64')
license=('GPL')

# The developers do not seem to make consistent use of tags
# I've manually specified the commit where the branch of the latest release (as
# of this writing) split from master, and we use this to get the rev number.
_last_rtm_ver=0.9.11
_last_rtm_commit=ccbf85ed42e4350af415d56b1465e83614c85ef8
pkgver="${_last_rtm_ver}.r583.07a68db"
pkgrel=2

depends=('gtkglext'
         'libglade'
         'libgl'
         'openal'
         'sdl'
         'soundtouch'
         'lua51')
makedepends=('autoconf'
             'automake'
             'pkg-config'
             'git'
             'lua')

provides=('desmume')
replaces=('desmume-sourceforge'
          'desmume-svn'
          'desmume-jit-svn')
conflicts=("${provides[@]}" "${replaces[@]}")

source=('git+https://github.com/TASVideos/desmume.git')
sha512sums=('SKIP')

_builddir="${_pkgname}/src/frontend/posix"

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

  local revnum="$(git rev-list --count ${_last_rtm_commit}..HEAD)"
  local shorthash="$(git rev-parse --short HEAD)"

  printf "%s.r%s.%s" "${_last_rtm_ver}" "${revnum}" "${shorthash}"
}

prepare(){
  cd "${srcdir}/${_pkgname}/${_builddir}"

  # lua5.1 package is named lua51 on Arch
  # we could probably just make it compile against the current lua
  sed -i 's/lua5.1/lua51/' configure.ac

  ./autogen.sh

  # Hud causes segfault in gtk version. Wifi doesn't really work.
  CFLAGS="-O3 -march=native" \
  CXXFLAGS="-O3 -march=native" \
  ./configure \
    --prefix=/usr \
    --enable-osmesa \
    --enable-glx \
    --enable-openal \
    --enable-glade
}

build() {
  cd "${srcdir}/${_pkgname}/${_builddir}"

  make
}

package() {
  cd "${srcdir}/${_pkgname}/${_builddir}"

  make DESTDIR="${pkgdir}" install
}