void-packages/srcpkgs/godot/patches/ppc.patch
2021-11-01 21:36:40 +01:00

87 lines
2.3 KiB
Diff

From 9ae32c08a4cab0a77eed682c9fb188ce7fc6f85a Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Mon, 1 Nov 2021 21:05:31 +0100
Subject: [PATCH] add ppc detection
---
core/os/os.cpp | 14 ++++++++++++++
modules/lightmapper_cpu/config.py | 3 +++
modules/raycast/config.py | 3 +++
platform/x11/detect.py | 8 ++++++++
4 files changed, 28 insertions(+)
diff --git a/core/os/os.cpp b/core/os/os.cpp
index 35896d8..948c79a 100644
--- a/core/os/os.cpp
+++ b/core/os/os.cpp
@@ -699,6 +699,20 @@ bool OS::has_feature(const String &p_feature) {
if (p_feature == "arm") {
return true;
}
+#elif defined(__powerpc__)
+#if defined(__powerpc64__)
+#if defined(__LITTLE_ENDIAN__)
+ if (p_feature == "ppc64le") {
+ return true;
+ }
+#endif
+ if (p_feature == "ppc64") {
+ return true;
+ }
+#endif
+ if (p_feature == "ppc") {
+ return true;
+ }
#endif
if (_check_internal_feature_support(p_feature))
diff --git a/modules/lightmapper_cpu/config.py b/modules/lightmapper_cpu/config.py
index a3a33b3..842f9ae 100644
--- a/modules/lightmapper_cpu/config.py
+++ b/modules/lightmapper_cpu/config.py
@@ -15,6 +15,9 @@ def can_build(env, platform):
if env["bits"] == "32":
return False
+ if env["arch"].startswith("ppc"):
+ return False
+
return True
diff --git a/modules/raycast/config.py b/modules/raycast/config.py
index 6ea8e0a..bc2d40c 100644
--- a/modules/raycast/config.py
+++ b/modules/raycast/config.py
@@ -14,6 +14,9 @@ def can_build(env, platform):
if env["bits"] == "32":
return False
+ if env["arch"].startswith("ppc"):
+ return False
+
return True
diff --git a/platform/x11/detect.py b/platform/x11/detect.py
index b6472e2..c1858a7 100644
--- a/platform/x11/detect.py
+++ b/platform/x11/detect.py
@@ -119,6 +119,14 @@ def configure(env):
if env["bits"] == "default":
env["bits"] = "64" if is64 else "32"
+ if env["arch"] == "":
+ if platform.machine() == "ppc64le":
+ env["arch"] = "ppc64le"
+ elif platform.machine() == "ppc64":
+ env["arch"] = "ppc64"
+ elif platform.machine() == "ppc":
+ env["arch"] = "ppc"
+
## Compiler configuration
if "CXX" in env and "clang" in os.path.basename(env["CXX"]):
--
2.33.0