Skip to content

Commit 1e393cc

Browse files
committed
Refactor build scripts to improve dependency handling and fix URL in gettext unarchive
1 parent 5452958 commit 1e393cc

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

brewkit/build-template.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ console.error("%cresolved:", "color: yellow", `${pkg.project}=${version.version}
2828
set_active_pkg({ project: pkg.project, version: version.version });
2929

3030
const SEP = Deno.build.os == "windows" ? ";" : ":";
31-
const deps_prefixes = (Deno.env.get("PKGS") || "").split(SEP).compact(Path.abs);
31+
let deps_prefixes = (Deno.env.get("PKGS") || "").split(SEP).compact(Path.abs);
3232
const deps = deps_prefixes.reduce((acc, prefix) => {
3333
const version = new SemVer(prefix.basename());
3434
const project = prefix.parent().relative({ to: PKGX_DIR }).replaceAll("\\", "/");
@@ -85,6 +85,11 @@ if (Deno.build.os != "windows") {
8585

8686
// ensure we continue to use pre-downloaded deps
8787
Deno.env.set("PKGX_DIR", dstdir.string);
88+
89+
deps_prefixes = deps_prefixes.map((prefix) => {
90+
const relpath = prefix.relative({ to: PKGX_DIR });
91+
return dstdir.join(relpath);
92+
});
8893
}
8994

9095
await fixup(

brewkit/fixups/rpath-fixer.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export default class RpathFixer {
2727
switch (Deno.build.os) {
2828
case "linux":
2929
for (const file of this.files) {
30+
console.error('%c+', 'color:yellow', 'fixing rpaths:', file);
3031
await this.execute_linux(file);
3132
}
3233
break;
@@ -39,6 +40,7 @@ export default class RpathFixer {
3940
Deno.env.set("GEM_HOME", "/tmp/gem");
4041

4142
for (const file of this.files) {
43+
console.error('%c+', 'color:yellow', 'fixing rpaths:', file);
4244
Deno.env.set("LIBS", JSON.stringify(this.files));
4345
run`${script} ${file} ${this.prefix} ${this.PKGX_DIR}`;
4446
}
@@ -49,6 +51,8 @@ export default class RpathFixer {
4951
async execute_linux(file: Path) {
5052
let rpaths: string[] = [];
5153

54+
console.error(this.deps_prefixes);
55+
5256
const LDLPATH = [
5357
this.prefix.join("lib"),
5458
...this.deps_prefixes.map((prefix) => prefix.join("lib")),

projects/gnu.org/gettext/build.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { BuildOptions, inreplace, run, unarchive } from "brewkit";
22

33
export default async function ({ prefix, tag }: BuildOptions) {
4-
await unarchive(`https://ftp.gnu.org/gnu/gettext/gettext-${tag.slice(1)}.tar.gz`);
4+
await unarchive(`https://ftp.gnu.org/gnu/gettext/gettext-${tag}.tar.gz`);
55
run`./configure
66
--prefix=${prefix}
77
--disable-debug

projects/perl.org/build.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export default async function ({ prefix, version }: BuildOptions) {
2626
run`make --jobs ${navigator.hardwareConcurrency} install`;
2727

2828
const sitearchexp = await (async () => {
29-
for await (const [path, { name }] of prefix.lib.join(`perl5/${version}`).ls()) {
29+
for await (const [path, { name }] of prefix.lib.join(`${version}`).ls()) {
3030
if (name.includes("thread-multi")) {
3131
return path;
3232
}

0 commit comments

Comments
 (0)