summaryrefslogtreecommitdiff
path: root/PKGBUILD
blob: 430c84f10f35240bee7f4eace3cbb2ab40bdbfe6 (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
# Maintainer: jc_gargma <jc_gargma@iserlohn-fortress.net>
# Maintainer (Arch): schuay <jakob.gruber@gmail.com>
# Contributor (Arch): Jonathan Conder <jonno dot conder at gmail dot com>
# Contributor (Arch): Brad Fanella <bradfanella@archlinux.us>
# Contributor (Arch): Arkham <arkham at archlinux dot us>
# Contributor (Arch): Nathan Jones <nathanj@insightbb.com>
# Contributor (Arch): Javier "Phrodo_00" Aravena <phrodo.00 at gmail dot com>
# Contributor (Arch): angvp <angvp at archlinux dot us>
# Contributor (Arch): Allan <mcrae_allan at hotmail dot com>
# Contributor (Arch): w0rm <w0rmtux at gmail dot com>
# Contributor (Arch): vEX <vex at niechift dot com>
# Contributor (Arch): Asher256 <achrafcherti at gmail dot com>

# # I maintain this because:
# Arch version lacks additional optimization and hardening flags

pkgname=desmume
pkgver=0.9.11
pkgrel=6.2
pkgdesc="Nintendo DS emulator"
arch=('x86_64')
url="https://desmume.org/"
license=('GPL')
depends=('desktop-file-utils' 'libpcap' 'soundtouch' 'alsa-lib' 'glu' 'sdl' 'gtk2' 'zziplib')
makedepends=('intltool' 'mesa' 'clang')
source=("https://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz"
        gcc6_fixes.patch
        gcc7_fixes.patch)
sha256sums=('3ab34ba6cc009566245025c1dd94bf449b6a1b416d24387cb42e183c78e38896'
            'dfb25d204253ca1dad2218e54760c81872c1df0b70c12067591a6578159b9aef'
            'b8f419f5286c1ee08f824250cabc7f4984a572f55db8182070b0bf3235134d1f')

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

  # Fix build
  patch -Np1 -i ../gcc6_fixes.patch
  patch -Np1 -i ../gcc7_fixes.patch

 
  # See https://bugs.archlinux.org/task/35086 and
  # https://sourceforge.net/tracker/?func=detail&aid=3612768&group_id=164579&atid=832291
  sed -i 's/@GETTEXT_PACKAGE@/desmume/' po/Makefile.in.in
}

build() {
  cd "$srcdir/$pkgname-$pkgver"
  export CFLAGS="$CFLAGS -O3 -fstack-protector-all -flto=4 -fPIE"
  export CXXFLAGS="$CXXFLAGS -O3 -fstack-protector-all -flto=4 -fPIE"
  export LDFLAGS="$LDFLAGS,-pie"
  ./configure --prefix=/usr --enable-wifi --enable-openal
  make
}

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

  make DESTDIR="$pkgdir/" install
}