(package
    (name "rustc")
    (version "1.93.1")
    (homepage "https://rust-lang.org/")
    (dependencies xz ninja cmake)
    (src (tar
        (url "https://static.rust-lang.org/dist/rustc-1.93.1-src.tar.xz")
        (dir "rustc-1.93.1-src")
        (blake3 "c8f492b93a95d64efb51fbcc5eab1e8edc1468a3f5be923c756b69d66892161a")))
    (build
        (shell "cp -v bootstrap.example.toml bootstrap.toml || true")
        (shell "sed -i '1illvm.targets = \"X86\"' bootstrap.toml")
        (shell "sed -i '1ibuild.docs = false' bootstrap.toml")
        (shell "sed -i '1iinstall.prefix = \"/opt/rustc\"' bootstrap.toml")
        (shell "./x.py install")
        (shell "for f in /opt/rustc/bin/*; do ln -sf \"$f\" /usr/bin/ || true; done")))
