view third_party/mercurial/runtime.bzl @ 261:b401627fc49e

Add JRPG mock flows and interactive previews Add scripted mock SSE commands, custom event forwarding, animated chat turns, full-height message navigation, and a cyberpunk resume dossier. Co-authored-by: Copilot <[email protected]>
author MrJuneJune <mrjunejune@users.noreply.github.com>
date Wed, 05 Aug 2026 20:38:32 -0700
parents c5129452493e
children
line wrap: on
line source

def _mercurial_runtime_impl(ctx):
    output = ctx.actions.declare_directory(ctx.label.name)
    ctx.actions.run_shell(
        inputs = [ctx.file.archive, ctx.file.launcher],
        outputs = [output],
        command = """
set -e
mkdir -p {output}/bin
unzip -q {archive} -d {output}
cp {output}/mercurial-7.2.3.dist-info/licenses/COPYING {output}/COPYING
cp {launcher} {output}/bin/hg
chmod 0555 {output}/bin/hg
chmod -R a-w {output}/hgdemandimport {output}/hgext {output}/mercurial
""".format(
            archive = ctx.file.archive.path,
            launcher = ctx.file.launcher.path,
            output = output.path,
        ),
        progress_message = "Assembling pure-Python Mercurial runtime",
    )
    return [
        DefaultInfo(
            files = depset([output]),
            runfiles = ctx.runfiles(files = [output]),
        ),
    ]

mercurial_runtime = rule(
    implementation = _mercurial_runtime_impl,
    attrs = {
        "archive": attr.label(allow_single_file = True, mandatory = True),
        "launcher": attr.label(allow_single_file = True, mandatory = True),
    },
)