blob: 3f7f9e0f279ebc99b9409060ede6ac855888bd81 (
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
|
# Maintainer: jc_gargma <jc_gargma@iserlohn-fortress.net>
# Maintainer (Arch): Daniel Bermond <dbermond@archlinux.org>
# Contributor (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
#_pkgver=2.5
pkgrel=22
pkgdesc='Nintendo64 Emulator'
arch=('x86_64')
url='https://github.com/mupen64plus/mupen64plus-core'
license=('GPL')
options=('lto')
depends=('boost-libs' 'freetype2' 'glu' 'libgl' 'libpng' 'libsamplerate'
'minizip' 'sdl2' 'speexdsp' 'zlib' 'hicolor-icon-theme')
makedepends=('boost' 'mesa' 'nasm')
source=("https://github.com/mupen64plus/mupen64plus-core/releases/download/${pkgver}/mupen64plus-bundle-src-${pkgver}.tar.gz"
'010-mupen64plus-ui-console-pie.patch'
'020-mupen64plus-core-gcc10-fix.patch')
sha256sums=('9c75b9d826f2d24666175f723a97369b3a6ee159b307f7cc876bbb4facdbba66'
'0b674779949ca90db9f156b56dd9d7be9847354f5b07ec73aa3a89dde79d6b6d'
'f84f262bcf2b748ccded4443735caba92926241f9238f545a621009f6ae64ef7')
prepare() {
cd mupen64plus-bundle-src-${pkgver}
# package specified lto is broken. Disable it in the source.
sed -i 's|OPTFLAGS ?= -O3 -flto|#OPTFLAGS ?= -O3|' source/mupen64plus-core/projects/unix/Makefile
sed -i 's|OPTFLAGS ?= -O3 -flto|#OPTFLAGS ?= -O3|' source/mupen64plus-audio-sdl/projects/unix/Makefile
sed -i 's|OPTFLAGS ?= -O3 -flto|#OPTFLAGS ?= -O3|' source/mupen64plus-rsp-hle/projects/unix/Makefile
sed -i 's|OPTFLAGS ?= -O3 -flto|#OPTFLAGS ?= -O3|' source/mupen64plus-input-sdl/projects/unix/Makefile
sed -i 's|OPTFLAGS ?= -O3 -flto|#OPTFLAGS ?= -O3|' source/mupen64plus-ui-console/projects/unix/Makefile
sed -i 's|OPTFLAGS ?= -O3 -flto|#OPTFLAGS ?= -O3|' source/mupen64plus-video-glide64mk2/projects/unix/Makefile
sed -i 's|OPTFLAGS ?= -O3 -flto|#OPTFLAGS ?= -O3|' source/mupen64plus-video-rice/projects/unix/Makefile
patch -Np1 -i ../010-mupen64plus-ui-console-pie.patch
patch -Np1 -i ../020-mupen64plus-core-gcc10-fix.patch
}
build() {
cd mupen64plus-bundle-src-${pkgver}
# -fPIE breaks libmupen64plus.so.2
export CFLAGS="$CFLAGS -O3 -fstack-protector-all -fPIC"
export CXXFLAGS="$CXXFLAGS -O3 -fstack-protector-all -fPIC"
if [[ $CARCH = 'i686' ]]; then
export CFLAGS="${CFLAGS/-fno-plt/}"
export CXXFLAGS="${CXXFLAGS/-fno-plt/}"
fi
./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'
local _sover
_sover="$(find "${pkgdir}/usr/lib" -type f -name 'libmupen64plus.so.*.*.*' | sed 's/^.*\.so\.//')"
ln -s "libmupen64plus.so.${_sover}" "${pkgdir}/usr/lib/libmupen64plus.so"
}
|