1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-19 20:21:14 +00:00
nixpkgs/pkgs/by-name/ha/hare/003-hardcode-qbe-and-harec.patch
Coutinho de Souza 0801041b52
hare: remove shell wrapping overhead
Hardcode qbe and harec to avoid the overhead of wrapping hare with a
bash script.

By doing that, we also had to change how `makeFlags` were defined: Now
only part of the `<ARCH>_<TOOL>` make variables are conditioned to the
enableCrossCompilation. The ones belonging to the build platform are
passed unconditionally.

Add qbe and harec to propagatedBuildInputs.

Some build frameworks may rely on having harec and qbe available on
PATH by setting `HAREC` and `QBE` to relative paths --- e. g., `haredo`.
2024-05-16 10:14:14 -03:00

25 lines
813 B
Diff

diff --git a/cmd/hare/build.ha b/cmd/hare/build.ha
index b2ac6518..417b46c6 100644
--- a/cmd/hare/build.ha
+++ b/cmd/hare/build.ha
@@ -37,7 +37,7 @@ fn build(name: str, cmd: *getopt::command) (void | error) = {
case let ncpu: size =>
yield ncpu;
},
- version = build::get_version(os::tryenv("HAREC", "harec"))?,
+ version = build::get_version(os::tryenv("HAREC", "@harec@"))?,
arch = arch.qbe_name,
platform = build::get_platform(os::sysname())?,
...
@@ -145,8 +145,8 @@ fn build(name: str, cmd: *getopt::command) (void | error) = {
set_arch_tags(&ctx.ctx.tags, arch);
ctx.cmds = ["",
- os::tryenv("HAREC", "harec"),
- os::tryenv("QBE", "qbe"),
+ os::tryenv("HAREC", "@harec@"),
+ os::tryenv("QBE", "@qbe@"),
os::tryenv("AS", arch.as_cmd),
os::tryenv("LD", arch.ld_cmd),
];