Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: cmake port. #92

Merged
merged 10 commits into from
Jul 1, 2024
49 changes: 49 additions & 0 deletions ports/cmake.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { InstallConfigFat, InstallConfigSimple } from "../port.ts";
import { AsdfInstallConf } from "./asdf.ts";
import { PipiInstallConf } from "./pipi.ts";
import * as ports from "./mod.ts";

/**
* Port to install cmake
*
* For macOS users, you need to add python as allowed build dependencies
* as cmake is downladed via pip install.
*
* Example:
* ```typescript
* const installs = {
python_latest: ports.cpy_bs({ version: "3.12.2", releaseTag: "20240224" }),
};
* config({
stdDeps: true,
allowedBuildDeps: [
installs.python_latest
],
enableRuntimes: true
});
* ```
*
*/
export default function conf(
config: InstallConfigSimple,
): InstallConfigFat[] {
/*
The universal macOS cmake build downloaded by asdf crashes
due to security restrictions in macOS, so it's installed using pipi port instead, which runs with no problems.
*/
if (Deno.build.os === "darwin") {
destifo marked this conversation as resolved.
Show resolved Hide resolved
const pipiConfig: PipiInstallConf = {
packageName: "cmake",
version: config.version,
};
return ports.pipi(pipiConfig);
}
const asdfConfig: AsdfInstallConf = {
...config,
pluginRepo: "https://github.com/asdf-community/asdf-cmake",
installType: "version",
version: config.version,
};

return [ports.asdf(asdfConfig)];
}
1 change: 1 addition & 0 deletions ports/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export { default as act } from "./act.ts";
export { default as asdf } from "./asdf.ts";
export { default as cargo_binstall } from "./cargo-binstall.ts";
export { default as cargobi } from "./cargobi.ts";
export { default as cmake } from "./cmake.ts";
export { default as cpy_bs } from "./cpy_bs.ts";
export { default as curl } from "./curl.ts";
export { default as deno_ghrel } from "./deno_ghrel.ts";
Expand Down
2 changes: 1 addition & 1 deletion ports/pipi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
import cpy_bs from "./cpy_bs.ts";
import * as std_ports from "../modules/ports/std.ts";

const manifest = {
export const manifest = {
ty: "denoWorker@v1" as const,
name: "pipi_pypi",
version: "0.1.0",
Expand Down
18 changes: 9 additions & 9 deletions tests/ports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,21 +144,21 @@ const cases: CustomE2eTestCase[] = [
: `meta --version && wasmedge --version`,
ignore: testTargetPlatform == "linux/aarch64",
},
// 77 meg +
{
name: "asdf-cmake",
installConf: ports.asdf({
pluginRepo: "https://github.com/asdf-community/asdf-cmake",
installType: "version",
}),
ePoint: `cmake --version`,
},
// 80 meg
{
name: "cpy_bs",
installConf: ports.cpy_bs(),
ePoint: `python3 --version`,
},
// 77 meg +, depends on "cpy_bs" on darwin/macos
{
name: "cmake",
installConf: ports.cmake({}),
ePoint: `cmake --version`,
secureConf: {
enableRuntimes: true,
},
},
// 80 meg +
{
name: "pipi-poetry",
Expand Down