From 0d1c0f27a5f8cea2bdfc9179e4a54ea5f75b2e6c Mon Sep 17 00:00:00 2001 From: Wade Berrier Date: May 25 2020 01:49:54 +0000 Subject: Fix build on arm, aarch64, and ppc64le even though they are not officially supported. They still need to be tested. exclude s390x as it's not supported at all. --- diff --git a/mupen64plus-make-archs.patch b/mupen64plus-make-archs.patch new file mode 100644 index 0000000..0db3b97 --- /dev/null +++ b/mupen64plus-make-archs.patch @@ -0,0 +1,124 @@ +diff -ur mupen64plus-bundle-src-2.5.orig/source/mupen64plus-core/projects/unix/Makefile mupen64plus-bundle-src-2.5/source/mupen64plus-core/projects/unix/Makefile +--- mupen64plus-bundle-src-2.5.orig/source/mupen64plus-core/projects/unix/Makefile 2015-04-26 16:42:49.000000000 -0600 ++++ mupen64plus-bundle-src-2.5/source/mupen64plus-core/projects/unix/Makefile 2020-05-24 18:34:08.039720649 -0600 +@@ -89,6 +89,13 @@ + NO_ASM := 1 + $(warning Architecture "$(HOST_CPU)" not officially supported.') + endif ++ifneq ("$(filter ppc64le,$(HOST_CPU))","") ++ CPU := PPC ++ ARCH_DETECTED := 64BITS ++ PIC ?= 1 ++ NO_ASM := 1 ++ $(warning Architecture "$(HOST_CPU)" not officially supported.') ++endif + ifneq ("$(filter arm%,$(HOST_CPU))","") + ifeq ("$(filter arm%b,$(HOST_CPU))","") + CPU := ARM +@@ -116,6 +123,16 @@ + $(warning Architecture "$(HOST_CPU)" not officially supported.') + endif + endif ++ifneq ("$(filter aarch64,$(HOST_CPU))","") ++ CPU := ARM ++ ARCH_DETECTED := 64BITS ++ PIC ?= 1 ++ NEW_DYNAREC := 1 ++ ifeq ($(NEON), 1) ++ CFLAGS += -mfpu=neon -mfloat-abi=hard ++ endif ++ $(warning Architecture "$(HOST_CPU)" not officially supported.') ++endif + ifneq ("$(filter mips,$(HOST_CPU))","") + CPU := MIPS + ARCH_DETECTED := 32BITS +diff -ur mupen64plus-bundle-src-2.5.orig/source/mupen64plus-rsp-hle/projects/unix/Makefile mupen64plus-bundle-src-2.5/source/mupen64plus-rsp-hle/projects/unix/Makefile +--- mupen64plus-bundle-src-2.5.orig/source/mupen64plus-rsp-hle/projects/unix/Makefile 2015-04-26 16:42:54.000000000 -0600 ++++ mupen64plus-bundle-src-2.5/source/mupen64plus-rsp-hle/projects/unix/Makefile 2020-05-24 18:35:07.837550230 -0600 +@@ -103,6 +103,12 @@ + PIC ?= 1 + $(warning Architecture "$(HOST_CPU)" not officially supported.') + endif ++ifneq ("$(filter ppc64le,$(HOST_CPU))","") ++ CPU := PPC ++ ARCH_DETECTED := 64BITS ++ PIC ?= 1 ++ $(warning Architecture "$(HOST_CPU)" not officially supported.') ++endif + ifneq ("$(filter arm%,$(HOST_CPU))","") + ifeq ("$(filter arm%b,$(HOST_CPU))","") + CPU := ARM +@@ -111,6 +117,12 @@ + $(warning Architecture "$(HOST_CPU)" not officially supported.') + endif + endif ++ifneq ("$(filter aarch64,$(HOST_CPU))","") ++ CPU := ARM ++ ARCH_DETECTED := 64BITS ++ PIC ?= 1 ++ $(warning Architecture "$(HOST_CPU)" not officially supported.') ++endif + ifneq ("$(filter mips,$(HOST_CPU))","") + CPU := MIPS + ARCH_DETECTED := 32BITS +diff -ur mupen64plus-bundle-src-2.5.orig/source/mupen64plus-video-glide64mk2/projects/unix/Makefile mupen64plus-bundle-src-2.5/source/mupen64plus-video-glide64mk2/projects/unix/Makefile +--- mupen64plus-bundle-src-2.5.orig/source/mupen64plus-video-glide64mk2/projects/unix/Makefile 2015-04-26 16:42:57.000000000 -0600 ++++ mupen64plus-bundle-src-2.5/source/mupen64plus-video-glide64mk2/projects/unix/Makefile 2020-05-24 18:35:45.373443255 -0600 +@@ -108,6 +108,13 @@ + NO_ASM := 1 + $(warning Architecture "$(HOST_CPU)" not officially supported.') + endif ++ifneq ("$(filter ppc64le,$(HOST_CPU))","") ++ CPU := PPC ++ ARCH_DETECTED := 64BITS ++ PIC ?= 1 ++ NO_ASM := 1 ++ $(warning Architecture "$(HOST_CPU)" not officially supported.') ++endif + ifneq ("$(filter arm%,$(HOST_CPU))","") + ifeq ("$(filter arm%b,$(HOST_CPU))","") + CPU := ARM +@@ -117,6 +124,12 @@ + $(warning Architecture "$(HOST_CPU)" not officially supported.') + endif + endif ++ifneq ("$(filter aarch64,$(HOST_CPU))","") ++ CPU := ARM ++ ARCH_DETECTED := 64BITS ++ PIC ?= 1 ++ NO_ASM := 1 ++endif + ifeq ("$(CPU)","NONE") + $(error CPU type "$(HOST_CPU)" not supported. Please file bug report at 'http://code.google.com/p/mupen64plus/issues') + endif +diff -ur mupen64plus-bundle-src-2.5.orig/source/mupen64plus-video-rice/projects/unix/Makefile mupen64plus-bundle-src-2.5/source/mupen64plus-video-rice/projects/unix/Makefile +--- mupen64plus-bundle-src-2.5.orig/source/mupen64plus-video-rice/projects/unix/Makefile 2015-04-26 16:42:56.000000000 -0600 ++++ mupen64plus-bundle-src-2.5/source/mupen64plus-video-rice/projects/unix/Makefile 2020-05-24 18:36:24.465331847 -0600 +@@ -105,6 +105,13 @@ + NO_ASM := 1 + $(warning Architecture "$(HOST_CPU)" not officially supported.') + endif ++ifneq ("$(filter ppc64le,$(HOST_CPU))","") ++ CPU := PPC ++ ARCH_DETECTED := 64BITS ++ PIC ?= 1 ++ NO_ASM := 1 ++ $(warning Architecture "$(HOST_CPU)" not officially supported.') ++endif + ifneq ("$(filter arm%,$(HOST_CPU))","") + ifeq ("$(filter arm%b,$(HOST_CPU))","") + CPU := ARM +@@ -114,6 +121,13 @@ + $(warning Architecture "$(HOST_CPU)" not officially supported.') + endif + endif ++ifneq ("$(filter aarch64,$(HOST_CPU))","") ++ CPU := ARM ++ ARCH_DETECTED := 64BITS ++ PIC ?= 1 ++ NO_ASM := 1 ++ $(warning Architecture "$(HOST_CPU)" not officially supported.') ++endif + ifeq ("$(CPU)","NONE") + $(error CPU type "$(HOST_CPU)" not supported. Please file bug report at 'http://code.google.com/p/mupen64plus/issues') + endif diff --git a/mupen64plus.spec b/mupen64plus.spec index 0bbef8f..924f26c 100644 --- a/mupen64plus.spec +++ b/mupen64plus.spec @@ -3,13 +3,14 @@ Name: mupen64plus Version: 2.5 -Release: 6%{?dist} +Release: 7%{?dist} Summary: Nintendo 64 Emulator License: GPLv2+ and CC-BY-SA URL: http://www.mupen64plus.org/ Source: https://github.com/mupen64plus/mupen64plus-core/releases/download/2.5/mupen64plus-bundle-src-2.5.tar.gz Patch1: mupen64plus-multiple-definitions.patch +Patch2: mupen64plus-make-archs.patch BuildRequires: pkgconfig(SDL_ttf) @@ -31,6 +32,8 @@ Requires: hicolor-icon-theme Conflicts: mupen64plus-qt Conflicts: mupen64plus-cli +ExcludeArch: s390x + %description Mupen64plus is a Nintendo 64 Emulator. This package includes all the plug-ins. @@ -45,6 +48,7 @@ Development files for mupen64plus %prep %setup -q -n %{name}-bundle-src-%{version} %patch1 -p1 -b.multipledefinitions +%patch2 -p1 -b.makearchs # Need to avoid filename conflicts so they can be included in the package cp -a source/mupen64plus-rsp-hle/LICENSES LICENSE-rsp-hle @@ -59,10 +63,20 @@ cp -a source/mupen64plus-audio-sdl/LICENSES LICENSE-audio-sdl %build +# Architecture build flags +ADDITIONAL_FLAGS="" +if [[ "$(uname -m)" = arm* ]] ; then + ADDITIONAL_FLAGS="NEON=1 VFP_HARD=1 NO_SSE=1" +elif [[ "$(uname -m)" = aarch64 ]] ; then + ADDITIONAL_FLAGS="NO_SSE=1" +elif [[ "$(uname -m)" = ppc* ]] ; then + ADDITIONAL_FLAGS="NO_SSE=1" +fi + export CFLAGS="%{optflags}" export CXXFLAGS="%{optflags}" export LDFLAGS="%{?__global_ldflags}" -sh m64p_build.sh LIRC=1 +sh m64p_build.sh LIRC=1 $ADDITIONAL_FLAGS %install @@ -97,6 +111,8 @@ desktop-file-validate %{buildroot}/%{_datadir}/applications/mupen64plus.desktop %{_libdir}/libmupen64plus.so %changelog +* Mon May 25 2020 Wade Berrier - 2.5-7 +- Fix builds on arm, aarch64, and ppc64le * Sun May 24 2020 Wade Berrier - 2.5-6 - Fix build with gcc 10