Skip to content

Commit a01b5a5

Browse files
committed
+node
1 parent c8e5ace commit a01b5a5

File tree

4 files changed

+52
-0
lines changed

4 files changed

+52
-0
lines changed

projects/nodejs.org/build.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { BuildOptions, ensure, run, unarchive } from "brewkit";
2+
3+
export default async function ({ prefix, tag }: BuildOptions) {
4+
await unarchive(`https://nodejs.org/dist/${tag}/node-${tag}.tar.xz`);
5+
6+
if (Deno.build.os != "windows") {
7+
ensure("python");
8+
9+
run`./configure --prefix=${prefix} --shared-openssl --shared-zlib`;
10+
run`make --jobs ${navigator.hardwareConcurrency} install`;
11+
} else {
12+
run`.\\vcbuild`;
13+
}
14+
}

projects/nodejs.org/package.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name:
2+
Node.js
3+
4+
repository:
5+
https://github.com/nodejs/node
6+
7+
# companions:
8+
# - nodejs.org/npm
9+
10+
dependencies:
11+
openssl.org: ^1.1,^3
12+
zlib.net: ^1
13+
# linux:
14+
# gnu.org/gcc/libstdcxx: '*' # libstdc++, since 22.2.0
15+
16+
programs:
17+
- bin/node
18+
19+
platforms:
20+
- darwin/aarch64
21+
- linux/x86-64
22+
- windows/x86-64

projects/nodejs.org/test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { backticks } from "brewkit";
2+
import { assertEquals } from "jsr:@std/assert@1/equals";
3+
4+
export default async function () {
5+
Deno.writeTextFileSync("test.js", "console.log('Hello, world!')");
6+
const out = await backticks`node ./test.js`;
7+
assertEquals(out, "Hello, world!");
8+
}

projects/nodejs.org/versions.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { github, Range } from "brewkit";
2+
3+
export default async function () {
4+
// need to say >=0 because the github.releases function does a shortcut for `*` to get latest
5+
// but latest is usually odd numbered which we then filter out
6+
const rv = (await github.releases("nodejs/node", new Range(">=0"))).compact(github.std_version_covert);
7+
return rv.filter(({ version }) => version.major % 2 == 0);
8+
}

0 commit comments

Comments
 (0)