Skip to content

Commit

Permalink
Clean up packages (#112)
Browse files Browse the repository at this point in the history
* Update Go lockfile

* Replace uses of `std.download` with `Brioche.download` where possible

* Switch to using `.unarchive()` instead of workaround

* Update k9s to use `gitCheckout`

* Switch to using `export default function` everywhere

* Fix failing checks
  • Loading branch information
kylewlacy authored Sep 28, 2024
1 parent 93f3dc7 commit 987d8c4
Show file tree
Hide file tree
Showing 65 changed files with 344 additions and 310 deletions.
8 changes: 7 additions & 1 deletion packages/alsa_lib/brioche.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 5 additions & 9 deletions packages/alsa_lib/project.bri
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,13 @@ export const project = {
version: "1.2.12",
};

const source = std
.download({
url: `https://www.alsa-project.org/files/pub/lib/alsa-lib-${project.version}.tar.bz2`,
hash: std.sha256Hash(
"4868cd908627279da5a634f468701625be8cc251d84262c7e5b6a218391ad0d2",
),
})
const source = Brioche.download(
`https://www.alsa-project.org/files/pub/lib/alsa-lib-${project.version}.tar.bz2`,
)
.unarchive("tar", "bzip2")
.peel();

export default (): std.Recipe<std.Directory> => {
export default function (): std.Recipe<std.Directory> {
const alsaLib = std.runBash`
./configure --prefix=/
make install DESTDIR="$BRIOCHE_OUTPUT"
Expand All @@ -29,4 +25,4 @@ export default (): std.Recipe<std.Directory> => {
LIBRARY_PATH: { append: [{ path: "lib" }] },
PKG_CONFIG_PATH: { append: [{ path: "lib/pkgconfig" }] },
});
};
}
8 changes: 7 additions & 1 deletion packages/bat/brioche.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 3 additions & 7 deletions packages/bat/project.bri
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@ export const project = {
version: "0.24.0",
};

const source = std
.download({
url: `https://github.com/sharkdp/bat/archive/refs/tags/v${project.version}.tar.gz`,
hash: std.sha256Hash(
"907554a9eff239f256ee8fe05a922aad84febe4fe10a499def72a4557e9eedfb",
),
})
const source = Brioche.download(
`https://github.com/sharkdp/bat/archive/refs/tags/v${project.version}.tar.gz`,
)
.unarchive("tar", "gzip")
.peel();

Expand Down
8 changes: 7 additions & 1 deletion packages/broot/brioche.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 5 additions & 9 deletions packages/broot/project.bri
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,15 @@ export const project = {
version: "1.42.0",
};

const source = std
.download({
url: `https://github.com/Canop/broot/archive/refs/tags/v${project.version}.tar.gz`,
hash: std.sha256Hash(
"f8a206d44b55287f47cdb63e2f19c9022d55d49f9399e5461f7797ccbe0264ba",
),
})
const source = Brioche.download(
`https://github.com/Canop/broot/archive/refs/tags/v${project.version}.tar.gz`,
)
.unarchive("tar", "gzip")
.peel();

export default () => {
export default function (): std.Recipe<std.Directory> {
return cargoBuild({
source,
runnable: "bin/broot",
});
};
}
4 changes: 2 additions & 2 deletions packages/ca_certificates/project.bri
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const project = {
version: "2024-07-02",
};

export default (): std.Recipe<std.Directory> => {
export default function (): std.Recipe<std.Directory> {
const cacert = Brioche.download(
`https://curl.se/ca/cacert-${project.version}.pem`,
);
Expand All @@ -24,4 +24,4 @@ export default (): std.Recipe<std.Directory> => {
SSL_CERT_FILE: { fallback: { path: "etc/ssl/certs/ca-bundle.crt" } },
},
);
};
}
8 changes: 7 additions & 1 deletion packages/carapace/brioche.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 5 additions & 9 deletions packages/carapace/project.bri
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,13 @@ export const project = {
version: "1.0.5",
};

const source = std
.download({
url: `https://github.com/carapace-sh/carapace-bin/archive/refs/tags/v${project.version}.tar.gz`,
hash: std.sha256Hash(
"25555206b1b5350cba3567463cb2c5b87c43fad20d4e8200ab78d49371c0b4db",
),
})
const source = Brioche.download(
`https://github.com/carapace-sh/carapace-bin/archive/refs/tags/v${project.version}.tar.gz`,
)
.unarchive("tar", "gzip")
.peel();

export default () => {
export default function (): std.Recipe<std.Directory> {
return goBuild({
source,
buildParams: {
Expand All @@ -26,4 +22,4 @@ export default () => {
path: "./cmd/carapace",
runnable: "bin/carapace",
});
};
}
8 changes: 7 additions & 1 deletion packages/curl/brioche.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 5 additions & 9 deletions packages/curl/project.bri
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,13 @@ export const project = {
version: "8.9.1",
};

const source = std
.download({
url: `https://curl.se/download/curl-${project.version}.tar.gz`,
hash: std.sha256Hash(
"291124a007ee5111997825940b3876b3048f7d31e73e9caa681b80fe48b2dcd5",
),
})
const source = Brioche.download(
`https://curl.se/download/curl-${project.version}.tar.gz`,
)
.unarchive("tar", "gzip")
.peel();

export default (): std.Recipe<std.Directory> => {
export default function (): std.Recipe<std.Directory> {
let curl = std.runBash`
./configure \\
--prefix=/ \\
Expand All @@ -38,4 +34,4 @@ export default (): std.Recipe<std.Directory> => {
});

return std.withRunnableLink(curl, "bin/curl");
};
}
8 changes: 7 additions & 1 deletion packages/dust/brioche.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 5 additions & 9 deletions packages/dust/project.bri
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,15 @@ export const project = {
version: "1.1.1",
};

const source = std
.download({
url: `https://github.com/bootandy/dust/archive/refs/tags/v${project.version}.tar.gz`,
hash: std.sha256Hash(
"98cae3e4b32514e51fcc1ed07fdbe6929d4b80942925348cc6e57b308d9c4cb0",
),
})
const source = Brioche.download(
`https://github.com/bootandy/dust/archive/refs/tags/v${project.version}.tar.gz`,
)
.unarchive("tar", "gzip")
.peel();

export default () => {
export default function (): std.Recipe<std.Directory> {
return cargoBuild({
source,
runnable: "bin/dust",
});
};
}
18 changes: 4 additions & 14 deletions packages/eza/project.bri
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,13 @@ export const project = {
version: "0.19.2",
};

// HACK: Workaround for issue unarchiving this tarfile. See:
// https://github.com/brioche-dev/brioche/issues/103
const sourceTar = Brioche.download(
const source = Brioche.download(
`https://github.com/eza-community/eza/archive/refs/tags/v${project.version}.tar.gz`,
);
const source = std
.process({
command: "tar",
args: ["-xf", sourceTar, "--strip-components=1", "-C", std.outputPath],
outputScaffold: std.directory(),
dependencies: [std.tools()],
})
.toDirectory();
).unarchive("tar", "gzip");

export default () => {
export default function (): std.Recipe<std.Directory> {
return cargoBuild({
source,
runnable: "bin/eza",
});
};
}
8 changes: 7 additions & 1 deletion packages/git/brioche.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 3 additions & 7 deletions packages/git/project.bri
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,9 @@ export const project = {
version: "2.46.0",
};

const source = std
.download({
url: `https://github.com/git/git/archive/refs/tags/v${project.version}.tar.gz`,
hash: std.sha256Hash(
"d9a72f1648406806d2cb3049b4a73f357e2dc8df5d2962ce6d24220f3861a221",
),
})
const source = Brioche.download(
`https://github.com/git/git/archive/refs/tags/v${project.version}.tar.gz`,
)
.unarchive("tar", "gzip")
.peel();

Expand Down
5 changes: 3 additions & 2 deletions packages/gitui/project.bri
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import * as std from "std";
import git, { gitCheckout } from "git";
import { cargoBuild } from "rust";

Expand All @@ -13,7 +14,7 @@ const source = gitCheckout(
}),
);

export default () => {
export default function (): std.Recipe<std.Directory> {
return cargoBuild({
source,
dependencies: [git()],
Expand All @@ -22,4 +23,4 @@ export default () => {
},
runnable: "bin/gitui",
});
};
}
4 changes: 2 additions & 2 deletions packages/go/brioche.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions packages/hello_world/project.bri
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ export const project = {
name: "hello_world",
};

export default () => {
export default function (): std.Recipe<std.Directory> {
return std.runBash`
mkdir -p "$BRIOCHE_OUTPUT/bin"
gcc src/main.c -o "$BRIOCHE_OUTPUT/bin/hello-world"
ln -s bin/hello-world "$BRIOCHE_OUTPUT/brioche-run"
`
.workDir(Brioche.glob("src"))
.dependencies(std.toolchain());
};
.dependencies(std.toolchain())
.toDirectory();
}
8 changes: 7 additions & 1 deletion packages/joshuto/brioche.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 5 additions & 9 deletions packages/joshuto/project.bri
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@ export const project = {
version: "0.9.8",
};

const source = std
.download({
url: `https://github.com/kamiyaa/joshuto/archive/refs/tags/v${project.version}.tar.gz`,
hash: std.sha256Hash(
"877d841b2e26d26d0f0f2e6f1dab3ea2fdda38c345abcd25085a3f659c24e013",
),
})
const source = Brioche.download(
`https://github.com/kamiyaa/joshuto/archive/refs/tags/v${project.version}.tar.gz`,
)
.unarchive("tar", "gzip")
.peel();

Expand All @@ -21,7 +17,7 @@ const source = std
// https://github.com/kamiyaa/joshuto/commit/1245124fcd264e25becfd75258840708d7b8b4bb
const patch = Brioche.includeFile("joshuto-v0.9.8.patch");

export default () => {
export default function (): std.Recipe<std.Directory> {
const patchedSource = std.runBash`
cd "$BRIOCHE_OUTPUT"
patch -p1 < $patch
Expand All @@ -34,4 +30,4 @@ export default () => {
source: patchedSource,
runnable: "bin/joshuto",
});
};
}
8 changes: 7 additions & 1 deletion packages/jujutsu/brioche.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 987d8c4

Please sign in to comment.