summaryrefslogtreecommitdiffstats
path: root/debian/patches/d-bootstrap-use-local-css.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/d-bootstrap-use-local-css.patch')
-rw-r--r--debian/patches/d-bootstrap-use-local-css.patch30
1 files changed, 24 insertions, 6 deletions
diff --git a/debian/patches/d-bootstrap-use-local-css.patch b/debian/patches/d-bootstrap-use-local-css.patch
index 894bd03c7..72595d9d3 100644
--- a/debian/patches/d-bootstrap-use-local-css.patch
+++ b/debian/patches/d-bootstrap-use-local-css.patch
@@ -9,18 +9,36 @@ Subject: d-bootstrap-use-local-css
--- a/src/bootstrap/doc.rs
+++ b/src/bootstrap/doc.rs
-@@ -365,6 +365,10 @@
+@@ -350,7 +350,27 @@
+ .arg("--index-page")
.arg(&builder.src.join("src/doc/index.md"))
.arg("--markdown-playground-url")
- .arg("https://play.rust-lang.org/")
-+ .arg("--markdown-css")
-+ .arg(format!("rustdoc{}.css", &builder.version))
-+ .arg("--markdown-css")
+- .arg("https://play.rust-lang.org/")
++ .arg("https://play.rust-lang.org/");
++
++ // Debian: librustdoc now generates a resource-suffix for static
++ // files with rustc_hash::FxHasher, so we need to find it.
++ let _dir = out.join("static.files");
++ if _dir.is_dir() {
++ let _css = _dir.read_dir().expect("Debian: failed to read static.files/ when is_dir() == true")
++ .find_map(|entry| entry.ok().map(|entry| {
++ let name = entry.file_name().into_string()
++ .expect("Debian: rustc files should have UTF-8 name");
++ if name.starts_with("rustdoc-") && name.ends_with(".css") {
++ Some(name)
++ } else { None }
++ })).flatten();
++ if let Some(name) = _css {
++ cmd.arg("--markdown-css").arg(name);
++ }
++ }
++
++ cmd.arg("--markdown-css")
+ .arg("rust.css")
.arg("-o")
.arg(&out)
.arg(&path);
-@@ -373,11 +377,6 @@
+@@ -359,11 +379,6 @@
cmd.arg("--disable-minification");
}