Skip to content

Commit f2c442f

Browse files
committed
fix(std): correct coreutils install phase on macOS
1 parent 64a2506 commit f2c442f

1 file changed

Lines changed: 14 additions & 8 deletions

File tree

packages/std/utils/coreutils.tg.ts

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,21 +93,21 @@ export const build = async (arg?: tg.Unresolved<Arg>) => {
9393
);
9494
}
9595

96-
// On macOS, build Apple xattr-preserving cp and install. These must be in
97-
// the build env so that `make install` uses Apple install (which preserves
98-
// xattrs) rather than GNU install (which does not support xattrs on macOS
99-
// because gnulib's xattr module is Linux-only). The same binaries also
100-
// replace the GNU versions in the output.
96+
// On macOS, build Apple xattr-preserving cp and install.
10197
let appleXattrCmds: ReturnType<typeof macOsXattrCmds> | undefined;
10298
if (os === "darwin") {
103-
appleXattrCmds = macOsXattrCmds(arg);
104-
dependencies.push(appleXattrCmds);
99+
appleXattrCmds = macOsXattrCmds({
100+
env: env_ ?? bootstrap.sdk(host),
101+
});
105102
}
106103
const env = [...dependencies, { FORCE_UNSAFE_CONFIGURE: true }];
107104
if (staticBuild) {
108105
env.push({ CC: "gcc -static" });
109106
}
110107
env.push(env_);
108+
if (os === "darwin" && appleXattrCmds) {
109+
env.push(appleXattrCmds);
110+
}
111111

112112
const configure = {
113113
args: [
@@ -121,12 +121,18 @@ export const build = async (arg?: tg.Unresolved<Arg>) => {
121121
],
122122
};
123123

124+
// On macOS, override INSTALL on the make install command line.
125+
const phases: std.phases.PhasesArg = { configure };
126+
if (os === "darwin") {
127+
phases.install = "make install 'INSTALL=install -c'";
128+
}
129+
124130
let output = await autotoolsInternal({
125131
build,
126132
host,
127133
bootstrap: bootstrap_,
128134
env: std.env.arg(...env, { utils: false }),
129-
phases: { configure },
135+
phases,
130136
processName: metadata.name,
131137
opt: staticBuild ? "s" : undefined,
132138
sdk,

0 commit comments

Comments
 (0)