summaryrefslogtreecommitdiff
path: root/PKGBUILD
blob: f9223e00c75dfed2565329bd7d0bdba9b13fc2ce (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 is out of date
# Arch version lacks additional optimization and hardening flags

pkgname=desmume
pkgver=0.9.13
_pkgver=0_9_13
pkgrel=1
pkgdesc="Nintendo DS emulator"
arch=('x86_64')
url="https://desmume.org/"
license=('GPL')
# # For some reason this breaks compiling. "error: C++ compiler cannot create executables"
# # But old-fashioned raw injection of -flto=auto via export doesn't.
#options=(lto)
depends=('desktop-file-utils' 'libpcap' 'soundtouch' 'alsa-lib' 'glu' 'sdl2' 'gtk2' 'zziplib')
makedepends=('intltool' 'mesa')
source=(${pkgname}-${pkgver}.tar.gz::"https://github.com/TASEmulators/${pkgname}/archive/refs/tags/release_${_pkgver}.tar.gz")
sha256sums=('7e513f3112ac2955bd0951bc00a94f10220999b036745bde5ac01eb524e05b57')
b2sums=('d63ed03801a15a3429c12b05da4ff2e4ea851a7dc307d4a4e02b6a0f74b2c4fab3a27ff14f6c563c9b84a827bb7d7db3083884154049cf8a8ffd5df6aa310e5c')

build() {
  cd "$srcdir/${pkgname}-release_${_pkgver}/${pkgname}/src/frontend/posix/"

  # Prevents build failure
  CXXFLAGS+=" -Wno-error=format-security"

  # Upstream suggested
  export CFLAGS="$CFLAGS -fuse-linker-plugin -minline-all-stringops"
  export CXXFLAGS="$CXXFLAGS -fuse-linker-plugin -minline-all-stringops"

  # General optimizations
  export CFLAGS="$CFLAGS -O3 -fstack-protector-all -flto=auto -fPIE"
  export CXXFLAGS="$CXXFLAGS -O3 -fstack-protector-all -flto=auto -fPIE"
  export LDFLAGS="$LDFLAGS,-pie"

  autoreconf -i
  ./configure --prefix=/usr --enable-wifi --enable-openal
  make
}

package() {
  cd "$srcdir/${pkgname}-release_${_pkgver}/${pkgname}/src/frontend/posix/"

  make DESTDIR="$pkgdir/" install
}