From 5d11c06b15bf00e4aecbd74d0dfa921230bfa4fa Mon Sep 17 00:00:00 2001 From: pcpa Date: Thu, 25 Feb 2021 17:24:22 -0300 Subject: [PATCH] Rework cargo patch to apply after unpacking spidermonkey --- 0ad-rust.patch | 42 ++++++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/0ad-rust.patch b/0ad-rust.patch index 43f4b79..d3dbdc6 100644 --- a/0ad-rust.patch +++ b/0ad-rust.patch @@ -1,14 +1,28 @@ -diff -up libraries/source/spidermonkey/mozjs-78.6.0/Cargo.toml.orig libraries/source/spidermonkey/mozjs-78.6.0/Cargo.toml ---- libraries/source/spidermonkey/mozjs-78.6.0/Cargo.toml.orig 2021-02-25 17:03:45.572062707 -0300 -+++ libraries/source/spidermonkey/mozjs-78.6.0/Cargo.toml 2021-02-25 17:04:19.858254901 -0300 -@@ -60,8 +60,8 @@ panic = "abort" - [patch.crates-io] - packed_simd = { git = "https://github.com/hsivonen/packed_simd", rev="3541e3818fdc7c2a24f87e3459151a4ce955a67a" } - rlbox_lucet_sandbox = { git = "https://github.com/PLSysSec/rlbox_lucet_sandbox/", rev="d510da5999a744c563b0acd18056069d1698273f" } --nix = { git = "https://github.com/shravanrn/nix/", branch = "r0.13.1", rev="4af6c367603869a30fddb5ffb0aba2b9477ba92e" } --spirv_cross = { git = "https://github.com/kvark/spirv_cross", branch = "wgpu3", rev = "20191ad2f370afd6d247edcb9ff9da32d3bedb9c" } -+nix = { git = "https://github.com/shravanrn/nix/", branch = "r0.13.1" } -+spirv_cross = { git = "https://github.com/kvark/spirv_cross", branch = "wgpu3" } - # failure's backtrace feature might break our builds, see bug 1608157. - failure = { git = "https://github.com/badboy/failure", rev = "64af847bc5fdcb6d2438bec8a6030812a80519a5" } - failure_derive = { git = "https://github.com/badboy/failure", rev = "64af847bc5fdcb6d2438bec8a6030812a80519a5" } +diff -up libraries/source/spidermonkey/0ad-rust.patch.orig libraries/source/spidermonkey/0ad-rust.patch +--- libraries/source/spidermonkey/0ad-rust.patch.orig 2021-02-25 17:18:50.534180370 -0300 ++++ libraries/source/spidermonkey/0ad-rust.patch 2021-02-25 17:17:58.248823782 -0300 +@@ -0,0 +1,14 @@ ++diff -up libraries/source/spidermonkey/mozjs-78.6.0/Cargo.toml.orig libraries/source/spidermonkey/mozjs-78.6.0/Cargo.toml ++--- libraries/source/spidermonkey/mozjs-78.6.0/Cargo.toml.orig 2021-02-25 17:03:45.572062707 -0300 +++++ libraries/source/spidermonkey/mozjs-78.6.0/Cargo.toml 2021-02-25 17:04:19.858254901 -0300 ++@@ -60,8 +60,8 @@ panic = "abort" ++ [patch.crates-io] ++ packed_simd = { git = "https://github.com/hsivonen/packed_simd", rev="3541e3818fdc7c2a24f87e3459151a4ce955a67a" } ++ rlbox_lucet_sandbox = { git = "https://github.com/PLSysSec/rlbox_lucet_sandbox/", rev="d510da5999a744c563b0acd18056069d1698273f" } ++-nix = { git = "https://github.com/shravanrn/nix/", branch = "r0.13.1", rev="4af6c367603869a30fddb5ffb0aba2b9477ba92e" } ++-spirv_cross = { git = "https://github.com/kvark/spirv_cross", branch = "wgpu3", rev = "20191ad2f370afd6d247edcb9ff9da32d3bedb9c" } +++nix = { git = "https://github.com/shravanrn/nix/", branch = "r0.13.1" } +++spirv_cross = { git = "https://github.com/kvark/spirv_cross", branch = "wgpu3" } ++ # failure's backtrace feature might break our builds, see bug 1608157. ++ failure = { git = "https://github.com/badboy/failure", rev = "64af847bc5fdcb6d2438bec8a6030812a80519a5" } ++ failure_derive = { git = "https://github.com/badboy/failure", rev = "64af847bc5fdcb6d2438bec8a6030812a80519a5" } +diff -up libraries/source/spidermonkey/patch.sh.orig libraries/source/spidermonkey/patch.sh +--- libraries/source/spidermonkey/patch.sh.orig 2021-02-25 17:18:42.290124146 -0300 ++++ libraries/source/spidermonkey/patch.sh 2021-02-25 17:19:56.569630737 -0300 +@@ -49,3 +49,6 @@ then + # https://svnweb.freebsd.org/ports/head/lang/spidermonkey78/files/patch-third__party_rust_cc_src_lib.rs?view=log + patch -p1 < ../FixFreeBSDRustThirdPartyOSDetection.diff + fi ++ ++# Correct build for newer rust ++patch -p4 < ../0ad-rust.patch