citadel/meta-gnome/recipes-support/mozjs78/mozjs78/0003-Set-rust-host-and-target-correctly.patch
Bruce Leidl 4c3baa433b Big Upgrade: GNOME 3.38, Yocto 3.1.3, meta-rust, meta-intel
Updated Recipes

   * dash-to-panel 40
   * dconf 0.38.0
   * gdm 3.38.0
   * glib 2.66.1
   * gjs 1.66.0
   * gnome-autoar 0.2.4
   * gnome-backgrounds 3.38.0
   * gnome-bluetooth 3.34.3
   * gnome-control-center 3.38.1
   * gnome-screenshot 3.38.0
   * gnome-shell 3.38.1
   * gnome-session 3.38.0
   * gnome-settings-daemon 3.38.0
   * gnome-terminal 3.38.0
   * gnome-usage 3.38.0
   * graphene 1.10.2
   * gsettings-desktop-schema 3.38.0
   * gvfs 1.46.1
   * iwd 1.9
   * libgee 0.20.3
   * libgtop 2.40.0
   * libgweather 3.36.1
   * mkpasswd 5.5.7
   * mozjs 78.0.1
   * mutter 3.38.1
   * nautilus 3.38.1
   * networkmanager 1.26.4
   * polkit 0.118
   * tracker 3.0.1
   * vte 0.62.0

Removed because recipes exist in poky with adequate version

   * atk, at-spi
   * clutter
   * clutter-gtk
   * cogl
   * ell
   * gcr
   * itstool
   * libinput
   * pango

Other removed recipes

   * systemd-initrd          No longer using a separate systemd recipe
                             for initramfs
   * caribou                 What even is this
   * gnome-tweaks            Not used
   * mozjs                   Polkit no longer requires an ancient mozjs
   * mozjs68                 Upgraded to mozjs78
2020-11-01 09:31:47 -05:00

86 lines
3.4 KiB
Diff

From de3d0659eb98f32a6da57c585a5417106bf93f99 Mon Sep 17 00:00:00 2001
From: Bruce Leidl <bruce@subgraph.com>
Date: Tue, 20 Oct 2020 08:03:45 -0400
Subject: [PATCH] Set rust host and target correctly
---
build/moz.configure/rust.configure | 44 +++++++++++++++++++++---------
1 file changed, 31 insertions(+), 13 deletions(-)
diff --git a/build/moz.configure/rust.configure b/build/moz.configure/rust.configure
index e5122d6b8..5575267d3 100644
--- a/build/moz.configure/rust.configure
+++ b/build/moz.configure/rust.configure
@@ -48,15 +48,6 @@ def unwrap_rustup(prog, name):
return
def from_rustup_which():
- out = check_cmd_output('rustup', 'which', name,
- executable=prog).rstrip()
- # If for some reason the above failed to return something, keep the
- # PROG we found originally.
- if out:
- log.info('Actually using \'%s\'', out)
- return out
-
- log.info('No `rustup which` output, using \'%s\'', prog)
return prog
(retcode, stdout, stderr) = get_cmd_output(prog, '+stable')
@@ -218,6 +209,26 @@ def rust_supported_targets(rustc):
return data
+option(env='RUST_HOST',
+ nargs=1,
+ help='Define the system type for Rust performing the build')
+
+@depends('RUST_HOST')
+@checking('rust host', lambda host: host)
+def rust_host_env(value):
+ if value:
+ return value[0]
+
+option(env='RUST_TARGET',
+ nargs=1,
+ help='Define the system type for Rust where the resulting executables will be used')
+
+@depends('RUST_TARGET')
+@checking('rust target', lambda target: target)
+def rust_target_env(value):
+ if value:
+ return value[0]
+
@template
def rust_triple_alias(host_or_target, host_or_target_c_compiler):
"""Template defining the alias used for rustc's --target flag.
@@ -228,8 +239,9 @@ def rust_triple_alias(host_or_target, host_or_target_c_compiler):
host_or_target_str = {host: 'host', target: 'target'}[host_or_target]
- @depends(rustc, host_or_target, host_or_target_c_compiler,
- rust_supported_targets, arm_target, when=rust_compiler)
+ @depends(rustc, host_or_target, rust_host_env, rust_target_env,
+ c_compiler, rust_supported_targets, arm_target,
+ when=rust_compiler)
@checking('for rust %s triplet' % host_or_target_str)
@imports('os')
@imports(_from='mozbuild.configure.util', _import='LineIO')
@@ -237,8 +249,14 @@ def rust_triple_alias(host_or_target, host_or_target_c_compiler):
@imports(_from='six', _import='ensure_binary')
@imports(_from='tempfile', _import='mkstemp')
@imports(_from='textwrap', _import='dedent')
- def rust_target(rustc, host_or_target, compiler_info,
- rust_supported_targets, arm_target):
+ def rust_target(rustc, host_or_target, rust_host_env, rust_target_env,
+ compiler_info, rust_supported_targets, arm_target):
+
+ specified_targets = {"host": rust_host_env, "target": rust_target_env}
+ specified_target = specified_targets[host_or_target_str]
+ if (specified_target):
+ return specified_target
+
# Rust's --target options are similar to, but not exactly the same
# as, the autoconf-derived targets we use. An example would be that
# Rust uses distinct target triples for targetting the GNU C++ ABI