]> git.proxmox.com Git - rustc.git/blob - debian/patches/d-use-system-jquery.patch
e470cff570638d6fc17d2d20f970be451fbc6979
[rustc.git] / debian / patches / d-use-system-jquery.patch
1 Index: rust/src/librustdoc/html/render.rs
2 ===================================================================
3 --- rust.orig/src/librustdoc/html/render.rs
4 +++ rust/src/librustdoc/html/render.rs
5 @@ -653,8 +653,16 @@ fn write_shared(cx: &Context,
6 // Add all the static files. These may already exist, but we just
7 // overwrite them anyway to make sure that they're fresh and up-to-date.
8
9 - write(cx.dst.join("jquery.js"),
10 - include_bytes!("static/jquery-2.1.4.min.js"))?;
11 + {
12 + // In Debian, just copy the system jquery instead.
13 + // If the file gets installed, we can eventually create something like
14 + // dh_rustdoc, similar to dh_sphinxdoc to detect these copies and
15 + // convert them into symlinks.
16 + let jquery_system_path = "/usr/share/javascript/jquery/jquery.min.js";
17 + let jquery = cx.dst.join("jquery.js");
18 + let jquery = jquery.as_path();
19 + try_err!(fs::copy(jquery_system_path, jquery), &jquery);
20 + }
21 write(cx.dst.join("main.js"),
22 include_bytes!("static/main.js"))?;
23 write(cx.dst.join("rustdoc.css"),