gnu: Add kafs-client
[jackhill/guix/guix.git] / gnu / packages / patches / rust-reproducible-builds.patch
1 From b9ca108fcae2b738ca3f0c88c84ae5dc5a6f843f Mon Sep 17 00:00:00 2001
2 From: Tim Ryan <id@timryan.org>
3 Date: Mon, 14 May 2018 06:22:21 -0400
4 Subject: [PATCH] Support reproducible builds by forcing window.search to use
5 stable key ordering. (#692)
6 See <https://github.com/rust-lang-nursery/mdBook/pull/692>
7 ---
8 src/vendor/mdbook/src/renderer/html_handlebars/search.rs | 4 ++++
9 1 file changed, 4 insertions(+)
10
11 diff --git a/src/vendor/mdbook/src/renderer/html_handlebars/search.rs b/src/vendor/mdbook/src/renderer/html_handlebars/search.rs
12 index d49772f8b..1ee66a511 100644
13 --- a/src/vendor/mdbook/src/renderer/html_handlebars/search.rs
14 +++ b/src/vendor/mdbook/src/renderer/html_handlebars/search.rs
15 @@ -205,6 +205,10 @@ fn write_to_js(index: Index, search_config: &Search) -> Result<String> {
16 searchoptions,
17 index,
18 };
19 +
20 + // By converting to serde_json::Value as an intermediary, we use a
21 + // BTreeMap internally and can force a stable ordering of map keys.
22 + let json_contents = serde_json::to_value(&json_contents)?;
23 let json_contents = serde_json::to_string(&json_contents)?;
24
25 Ok(format!("window.search = {};", json_contents))