summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjc_gargma <jc_gargma@iserlohn-fortress.net>2019-09-26 14:59:01 -0700
committerjc_gargma <jc_gargma@iserlohn-fortress.net>2019-09-26 14:59:01 -0700
commit9d0fb93c0d7d45ad022e7be3f8fa9ada5f1c6230 (patch)
treeb631b611090469ddb872b66f252e084d3c8bcf9b
downloadmupen64plus-9d0fb93c0d7d45ad022e7be3f8fa9ada5f1c6230.tar.xz
Initial commit
-rw-r--r--PKGBUILD50
-rw-r--r--ui-console-pic.patch12
2 files changed, 62 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 0000000..9e51942
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,50 @@
+# Maintainer: jc_gargma <jc_gargma@iserlohn-fortress.net>
+# Maintainer (Arch): Sven-Hendrik Haase <sh@lutzhaase.com>
+# Contributor (Arch): Thomas Dziedzic < gostrc at gmail >
+# Contributor (Arch): Laurent Carlier <lordheavym@gmail.com>
+# Contributor (Arch): Allan McRae <allan@archlinux.org>
+# Contributor (Arch): Zephyr
+
+# # I maintain this because:
+# Arch version lacks additional optimization and hardening flags
+
+pkgname=mupen64plus
+pkgver=2.5
+pkgrel=14.2
+pkgdesc='Nintendo64 Emulator'
+arch=('x86_64')
+url='https://github.com/mupen64plus/mupen64plus-core'
+license=('GPL')
+depends=('glu' 'libsamplerate' 'libpng' 'sdl' 'freetype2' 'boost-libs')
+makedepends=('mesa' 'boost')
+source=("https://github.com/mupen64plus/mupen64plus-core/releases/download/2.5/mupen64plus-bundle-src-${pkgver}.tar.gz"
+ 'ui-console-pic.patch')
+sha256sums=('9c75b9d826f2d24666175f723a97369b3a6ee159b307f7cc876bbb4facdbba66'
+ 'bb4784de177aaa4c0b4f5d07b14ae020f3b47e6aa524df65366ac00eb169ee8f')
+
+prepare() {
+ cd mupen64plus-bundle-src-$pkgver
+ patch -p1 -i ../ui-console-pic.patch
+}
+
+build() {
+ cd mupen64plus-bundle-src-${pkgver}
+
+ export CFLAGS="$CFLAGS -O3 -flto=4 -fPIE"
+ export CXXFLAGS="$CXXFLAGS -O3 -flto=4 -fPIE"
+ export LDFLAGS="$LDFLAGS,-pie"
+
+ if [[ $CARCH = 'i686' ]]; then
+ export CFLAGS="${CFLAGS/-fno-plt/}"
+ export CXXFLAGS="${CXXFLAGS/-fno-plt/}"
+ fi
+
+ sh m64p_build.sh
+}
+
+package() {
+ cd mupen64plus-bundle-src-$pkgver
+
+ # set LDCONFIG since we are using fakeroot and scripts run root commands by checking the uid
+ ./m64p_install.sh DESTDIR="$pkgdir" PREFIX='/usr' MANDIR='/usr/share/man' LDCONFIG='true'
+}
diff --git a/ui-console-pic.patch b/ui-console-pic.patch
new file mode 100644
index 0000000..62a1485
--- /dev/null
+++ b/ui-console-pic.patch
@@ -0,0 +1,12 @@
+diff --git a/source/mupen64plus-ui-console/projects/unix/Makefile b/source/mupen64plus-ui-console/projects/unix/Makefile
+index a4a05e3..199f27f 100755
+--- a/source/mupen64plus-ui-console/projects/unix/Makefile
++++ b/source/mupen64plus-ui-console/projects/unix/Makefile
+@@ -90,6 +90,7 @@ endif
+
+ # set special flags per-system
+ ifeq ($(OS), LINUX)
++ CFLAGS += -fPIC
+ LDLIBS += -ldl
+ endif
+ ifeq ($(OS), OSX)