Skip to content

Commit

Permalink
Add proot package (#152)
Browse files Browse the repository at this point in the history
* Add `proot` package

* Add runnable link in `proot` package
  • Loading branch information
kylewlacy authored Jan 1, 2025
1 parent 06e9fb9 commit 2c7e5e7
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/proot/brioche.lock

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

62 changes: 62 additions & 0 deletions packages/proot/project.bri
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import * as std from "std";
import git, { gitCheckout } from "git";
import talloc from "talloc";
import libarchive from "libarchive";

export const project = {
name: "proot",
version: "5.4.0",
};

export const source = std.recipeFn(() => {
const source = gitCheckout(
Brioche.gitRef({
repository: "https://github.com/proot-me/proot.git",
ref: `v${project.version}`,
}),
);
return std.runBash`
cd "$BRIOCHE_OUTPUT"
sed -i 's|/bin/echo|/usr/bin/env echo|g' src/GNUmakefile
`
.outputScaffold(source)
.toDirectory();
});

export default function proot(): std.Recipe<std.Directory> {
let proot = std.runBash`
BRIOCHE_LD_AUTOPACK=false make -C src loader.elf loader-m32.elf build.h
make -C src proot care
make -C src install PREFIX="$BRIOCHE_OUTPUT"
`
.workDir(source)
.dependencies(std.toolchain(), git(), talloc(), uthash(), libarchive())
.toDirectory();

proot = std.withRunnableLink(proot, "bin/proot");

return proot;
}

function uthash(): std.Recipe<std.Directory> {
const uthash = gitCheckout(
Brioche.gitRef({
repository: "https://github.com/troydhanson/uthash.git",
ref: "master",
}),
);

return std.setEnv(uthash, {
CPATH: { append: [{ path: "include" }] },
});
}

export function test() {
return std.runBash`
proot --version
proot -R "$tools" ls /
exit 1
`
.dependencies(proot())
.env({ tools: std.tools() });
}

0 comments on commit 2c7e5e7

Please sign in to comment.