void-packages/srcpkgs/maturin/patches/add-ppc-tier3.patch

84 lines
3.0 KiB
Diff

From 88434b211f9e4219fe7b6d9adc737351091324cd Mon Sep 17 00:00:00 2001
From: Daniel Kolesa <daniel@octaforge.org>
Date: Fri, 5 Feb 2021 18:32:38 +0100
Subject: [PATCH] add support for tier 3 ppc targets
---
setup.py | 2 +-
src/target.rs | 18 ++++++++++++++++++
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git setup.py setup.py
index 228267f..8fa1c1e 100644
--- setup.py
+++ setup.py
@@ -62,7 +62,7 @@ class PostInstallCommand(install):
cargo_args = [cargo, "rustc", "--bin", "maturin", "--message-format=json"]
- if platform.machine() in ("ppc64le", "ppc64"):
+ if platform.machine() in ("ppc64le", "ppc64", "ppcle", "ppc"):
cargo_args.extend(
["--no-default-features", "--features=auditwheel,log,human-panic"]
)
diff --git src/target.rs src/target.rs
index d13cc34..66cc823 100644
--- src/target.rs
+++ src/target.rs
@@ -58,6 +58,8 @@ enum Arch {
ARMV7L,
POWERPC64LE,
POWERPC64,
+ POWERPCLE,
+ POWERPC,
X86,
X86_64,
}
@@ -69,6 +71,8 @@ impl fmt::Display for Arch {
Arch::ARMV7L => write!(f, "armv7l"),
Arch::POWERPC64LE => write!(f, "ppc64le"),
Arch::POWERPC64 => write!(f, "ppc64"),
+ Arch::POWERPCLE => write!(f, "ppcle"),
+ Arch::POWERPC => write!(f, "ppc"),
Arch::X86 => write!(f, "i686"),
Arch::X86_64 => write!(f, "x86_64"),
}
@@ -109,6 +113,16 @@ impl Target {
platforms::target::Arch::X86 => Arch::X86,
platforms::target::Arch::ARM => Arch::ARMV7L,
platforms::target::Arch::AARCH64 => Arch::AARCH64,
+ platforms::target::Arch::POWERPC
+ if platform.target_triple.starts_with("powerpc-") =>
+ {
+ Arch::POWERPC
+ }
+ platforms::target::Arch::POWERPC
+ if platform.target_triple.starts_with("powerpcle-") =>
+ {
+ Arch::POWERPCLE
+ }
platforms::target::Arch::POWERPC64
if platform.target_triple.starts_with("powerpc64-") =>
{
@@ -147,6 +161,8 @@ impl Target {
match self.arch {
Arch::AARCH64 => 64,
Arch::ARMV7L => 32,
+ Arch::POWERPC => 32,
+ Arch::POWERPCLE => 32,
Arch::POWERPC64 => 64,
Arch::POWERPC64LE => 64,
Arch::X86 => 32,
@@ -210,6 +226,8 @@ impl Target {
(OS::FreeBSD, _) => "", // according imp.get_suffixes(), there are no such
(OS::Linux, Arch::AARCH64) => "aarch64-linux-gnu", // aka armv8-linux-gnueabihf
(OS::Linux, Arch::ARMV7L) => "arm-linux-gnueabihf",
+ (OS::Linux, Arch::POWERPC) => "powerpc-linux-gnu",
+ (OS::Linux, Arch::POWERPCLE) => "powerpcle-linux-gnu",
(OS::Linux, Arch::POWERPC64) => "powerpc64-linux-gnu",
(OS::Linux, Arch::POWERPC64LE) => "powerpc64le-linux-gnu",
(OS::Linux, Arch::X86) => "i386-linux-gnu", // not i686
--
2.30.0