git: 853fc90fc363 - 2022Q1 - graphics/librsvg2-rust: fix build on powerpc64le and powerpc

From: Jan Beich <jbeich_at_FreeBSD.org>
Date: Mon, 21 Feb 2022 20:38:18 UTC
The branch 2022Q1 has been updated by jbeich:

URL: https://cgit.FreeBSD.org/ports/commit/?id=853fc90fc363cf3f2d59694b25aee9abf65c6f37

commit 853fc90fc363cf3f2d59694b25aee9abf65c6f37
Author:     Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2022-01-05 19:04:58 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2022-02-21 20:37:16 +0000

    graphics/librsvg2-rust: fix build on powerpc64le and powerpc
    
    1. There are now two copies of cfg_expr used, both need to be patched.
    2. For some reason, when powerpc64le block in cfg_expr 0.9 was lower than it
    is currently, the target failed to be identified as supported.
    
    (cherry picked from commit 51cc50759b234fe474a8c64ca96633a2b9128e03)
---
 ...h-vendor_cfg-expr-0.8.1_src_targets_builtins.rs | 38 ++++++++++++++++++++++
 .../patch-vendor_cfg-expr_src_targets_builtins.rs  |  4 +--
 2 files changed, 40 insertions(+), 2 deletions(-)

diff --git a/graphics/librsvg2-rust/files/patch-vendor_cfg-expr-0.8.1_src_targets_builtins.rs b/graphics/librsvg2-rust/files/patch-vendor_cfg-expr-0.8.1_src_targets_builtins.rs
new file mode 100644
index 000000000000..69260e376741
--- /dev/null
+++ b/graphics/librsvg2-rust/files/patch-vendor_cfg-expr-0.8.1_src_targets_builtins.rs
@@ -0,0 +1,38 @@
+https://github.com/EmbarkStudios/cfg-expr/commit/f8c59a8dccd0
+
+--- vendor/cfg-expr-0.8.1/src/targets/builtins.rs.orig	2021-09-16 01:15:26 UTC
++++ vendor/cfg-expr-0.8.1/src/targets/builtins.rs
+@@ -894,6 +894,16 @@ pub const ALL_BUILTINS: &[TargetInfo<'static>] = &[
+         endian: Endian::little,
+     },
+     TargetInfo {
++        triple: "powerpc-unknown-freebsd",
++        os: Some(Os::freebsd),
++        arch: Arch::powerpc,
++        env: None,
++        vendor: Some(Vendor::unknown),
++        family: Some(Family::unix),
++        pointer_width: 32,
++        endian: Endian::big,
++    },
++    TargetInfo {
+         triple: "powerpc-unknown-linux-gnu",
+         os: Some(Os::linux),
+         arch: Arch::powerpc,
+@@ -1002,6 +1012,16 @@ pub const ALL_BUILTINS: &[TargetInfo<'static>] = &[
+         family: Some(Family::unix),
+         pointer_width: 64,
+         endian: Endian::big,
++    },
++    TargetInfo {
++        triple: "powerpc64le-unknown-freebsd",
++        os: Some(Os::freebsd),
++        arch: Arch::powerpc64,
++        env: None,
++        vendor: Some(Vendor::unknown),
++        family: Some(Family::unix),
++        pointer_width: 64,
++        endian: Endian::little,
+     },
+     TargetInfo {
+         triple: "powerpc64le-unknown-linux-gnu",
diff --git a/graphics/librsvg2-rust/files/patch-vendor_cfg-expr_src_targets_builtins.rs b/graphics/librsvg2-rust/files/patch-vendor_cfg-expr_src_targets_builtins.rs
index 2a7fbc137cf0..b0da8fced087 100644
--- a/graphics/librsvg2-rust/files/patch-vendor_cfg-expr_src_targets_builtins.rs
+++ b/graphics/librsvg2-rust/files/patch-vendor_cfg-expr_src_targets_builtins.rs
@@ -19,7 +19,7 @@ https://github.com/EmbarkStudios/cfg-expr/commit/f8c59a8dccd0
          triple: Triple::new_const("powerpc-unknown-linux-gnu"),
          os: Some(Os::linux),
          arch: Arch::powerpc,
-@@ -1002,6 +1012,16 @@ pub const ALL_BUILTINS: &[TargetInfo] = &[
+@@ -992,6 +1002,16 @@ pub const ALL_BUILTINS: &[TargetInfo] = &[
          family: Some(Family::unix),
          pointer_width: 64,
          endian: Endian::big,
@@ -35,4 +35,4 @@ https://github.com/EmbarkStudios/cfg-expr/commit/f8c59a8dccd0
 +        endian: Endian::little,
      },
      TargetInfo {
-         triple: Triple::new_const("powerpc64-unknown-linux-musl"),
+         triple: Triple::new_const("powerpc64-unknown-linux-gnu"),