Accepting request 1251573 from games
OBS-URL: https://build.opensuse.org/request/show/1251573 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/0ad?expand=0&rev=16
This commit is contained in:
commit
8f752e8b9c
77
0001-Enable-building-on-arbitrary-architectures.patch
Normal file
77
0001-Enable-building-on-arbitrary-architectures.patch
Normal file
@ -0,0 +1,77 @@
|
||||
From ce0c692cf8b3d3f24e560ec60d20f7f4e2e99c3f Mon Sep 17 00:00:00 2001
|
||||
From: Jan Engelhardt <jengelh@inai.de>
|
||||
Date: Mon, 24 Feb 2025 20:04:23 +0000
|
||||
Subject: [PATCH] Enable building on arbitrary architectures
|
||||
References: https://gitea.wildfiregames.com/0ad/0ad/pulls/7663
|
||||
|
||||
This makes the software build on riscv64, ppc64le and s390x.
|
||||
---
|
||||
build/premake/premake5.lua | 7 ++++++-
|
||||
source/lib/sysdep/arch.h | 5 -----
|
||||
source/lib/sysdep/arch/generic/generic.cpp | 6 ++++++
|
||||
3 files changed, 12 insertions(+), 6 deletions(-)
|
||||
create mode 100644 source/lib/sysdep/arch/generic/generic.cpp
|
||||
|
||||
diff --git a/build/premake/premake5.lua b/build/premake/premake5.lua
|
||||
index dd7d6c6584..2cb5f8eaac 100644
|
||||
--- a/build/premake/premake5.lua
|
||||
+++ b/build/premake/premake5.lua
|
||||
@@ -116,7 +116,7 @@ else
|
||||
elseif string.find(machine, "ppc64") == 1 or string.find(machine, "powerpc64") == 1 then
|
||||
arch = "ppc64"
|
||||
else
|
||||
- print("WARNING: Cannot determine architecture from GCC, assuming x86")
|
||||
+ arch = "generic"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -916,6 +916,8 @@ function setup_all_libs ()
|
||||
table.insert(source_dirs, "lib/sysdep/arch/e2k");
|
||||
elseif arch == "ppc64" then
|
||||
table.insert(source_dirs, "lib/sysdep/arch/ppc64");
|
||||
+ else
|
||||
+ table.insert(source_dirs, "lib/sysdep/arch/generic");
|
||||
end
|
||||
|
||||
-- OS-specific
|
||||
@@ -1127,6 +1129,9 @@ function setup_main_exe ()
|
||||
links {
|
||||
-- Dynamic libraries (needed for linking for gold)
|
||||
"dl",
|
||||
+ -- boost lockfree algorithms cause references, satisfy them
|
||||
+ -- <https://github.com/scylladb/seastar/issues/530#issuecomment-2679517925>
|
||||
+ "atomic",
|
||||
}
|
||||
end
|
||||
|
||||
diff --git a/source/lib/sysdep/arch.h b/source/lib/sysdep/arch.h
|
||||
index 74550970ce..7963e292f8 100644
|
||||
--- a/source/lib/sysdep/arch.h
|
||||
+++ b/source/lib/sysdep/arch.h
|
||||
@@ -83,11 +83,6 @@
|
||||
# define ARCH_E2K 0
|
||||
#endif
|
||||
|
||||
-// ensure exactly one architecture has been detected
|
||||
-#if (ARCH_IA32+ARCH_IA64+ARCH_AMD64+ARCH_ALPHA+ARCH_ARM+ARCH_AARCH64+ARCH_MIPS+ARCH_E2K+ARCH_PPC64) != 1
|
||||
-# error "architecture not correctly detected (either none or multiple ARCH_* defined)"
|
||||
-#endif
|
||||
-
|
||||
// "X86_X64"-specific code requires either IA-32 or AMD64
|
||||
#define ARCH_X86_X64 (ARCH_IA32|ARCH_AMD64)
|
||||
|
||||
diff --git a/source/lib/sysdep/arch/generic/generic.cpp b/source/lib/sysdep/arch/generic/generic.cpp
|
||||
new file mode 100644
|
||||
index 0000000000..bdd0562a87
|
||||
--- /dev/null
|
||||
+++ b/source/lib/sysdep/arch/generic/generic.cpp
|
||||
@@ -0,0 +1,6 @@
|
||||
+#include "precompiled.h"
|
||||
+#include "lib/sysdep/cpu.h"
|
||||
+const char* cpu_IdentifierString()
|
||||
+{
|
||||
+ return "generic";
|
||||
+}
|
||||
--
|
||||
2.48.1
|
||||
|
@ -1,3 +1,10 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Feb 24 22:28:43 UTC 2025 - Jan Engelhardt <jengelh@inai.de>
|
||||
|
||||
- Add 0001-Enable-building-on-arbitrary-architectures.patch
|
||||
to make package succeed for openSUSE:Factory:RISCV/zSystems/PowerPC
|
||||
- Build premake & fcollada with smp_mflags as well
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Feb 18 21:16:40 UTC 2025 - Aaron Puchert <aaronpuchert@alice-dsl.net>
|
||||
|
||||
|
9
0ad.spec
9
0ad.spec
@ -43,6 +43,7 @@ URL: https://play0ad.com/
|
||||
Source: https://releases.wildfiregames.com/%{name}-%{version}-unix-build.tar.xz
|
||||
Source1: premake-disable-rpath.patch
|
||||
Source100: 0ad-rpmlintrc
|
||||
Patch1: 0001-Enable-building-on-arbitrary-architectures.patch
|
||||
BuildRequires: cmake
|
||||
BuildRequires: gcc%{?force_gcc_version}-c++
|
||||
BuildRequires: libXcursor-devel
|
||||
@ -82,7 +83,6 @@ BuildRequires: pkgconfig(mozjs-115)
|
||||
BuildRequires: cargo
|
||||
BuildRequires: rust
|
||||
%endif
|
||||
ExcludeArch: s390x
|
||||
|
||||
%description
|
||||
0 A.D. (pronounced "zero ey-dee") is a real-time strategy (RTS) game
|
||||
@ -93,7 +93,7 @@ The project contains 3D graphics, detailed artwork, sound, and a
|
||||
flexible game engine.
|
||||
|
||||
%prep
|
||||
%setup -q -n %{name}-%{version}
|
||||
%autosetup -p1
|
||||
cp %SOURCE1 libraries/source/premake-core/patches/
|
||||
sed -i -e 's_# patch_# patch\npatch -d "premake-core-${PV}" -p1 <patches/premake-disable-rpath.patch_' libraries/source/premake-core/build.sh
|
||||
|
||||
@ -107,9 +107,10 @@ export CCFLAGS="%{optflags}"
|
||||
export CPPFLAGS="%{optflags} -fpermissive"
|
||||
# Copied from macros.cmake.
|
||||
export LDFLAGS="-Wl,--as-needed -Wl,--no-undefined -Wl,-z,now"
|
||||
|
||||
libraries/source/cxxtest-4.4/build.sh
|
||||
libraries/source/fcollada/build.sh
|
||||
libraries/source/premake-core/build.sh
|
||||
JOBS="%{?_smp_mflags}" libraries/source/fcollada/build.sh
|
||||
JOBS="%{?_smp_mflags}" libraries/source/premake-core/build.sh
|
||||
build/workspaces/update-workspaces.sh \
|
||||
%{?_smp_mflags} \
|
||||
--bindir=%{_bindir} \
|
||||
|
Loading…
x
Reference in New Issue
Block a user