Skip to content

Commit f3c9bba

Browse files
committed
+nasm
1 parent a0ec775 commit f3c9bba

3 files changed

Lines changed: 67 additions & 0 deletions

File tree

projects/nasm.us/build.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { BuildOptions, env_include, Path, run, unarchive } from "brewkit";
2+
3+
export default async function ({ prefix, tag }: BuildOptions) {
4+
await unarchive(`https://www.nasm.us/pub/nasm/releasebuilds/${tag}/nasm-${tag}.tar.xz`);
5+
6+
if (Deno.build.os != "windows") {
7+
run`./configure --prefix=${prefix}`;
8+
run`make --jobs ${navigator.hardwareConcurrency}`;
9+
run`make install`;
10+
} else {
11+
run`nmake /f Mkfiles/msvc.mak`;
12+
13+
Path.cwd().join("nasm.exe").cp({ into: prefix.bin.mkdir('p') });
14+
Path.cwd().join("ndisasm.exe").cp({ into: prefix.bin });
15+
Path.cwd().join("include").cp({ into: prefix });
16+
Path.cwd().join("libnasm.lib").cp({ into: prefix.join('lib').mkdir() });
17+
}
18+
}

projects/nasm.us/package.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name:
2+
NASM
3+
4+
unabbreviated-name: Netwide Assembler
5+
6+
distributable:
7+
url: https://www.nasm.us/pub/nasm/releasebuilds/{{version.raw}}/nasm-{{version.raw}}.tar.xz
8+
strip-components: 1
9+
10+
versions:
11+
url: https://www.nasm.us/pub/nasm/releasebuilds/
12+
match: /"\d+\.\d+(\.\d+)?\/"/
13+
strip:
14+
- /^"/
15+
- /\/"$/
16+
17+
build:
18+
script:
19+
- ./configure --prefix="{{prefix}}"
20+
- run: |
21+
make --jobs {{hw.concurrency}} rdf
22+
make install install_rdf
23+
if: <2.16
24+
# rdoff tools removed as unfixable
25+
# https://github.com/netwide-assembler/nasm/commit/93548c2de2a3c218b3d0ab4061b26d9781cb6b37
26+
- run: |
27+
make --jobs {{hw.concurrency}}
28+
make install
29+
if: '>=2.16'
30+
31+
test: nasm --version
32+
33+
programs:
34+
- bin/nasm
35+
- bin/ndisasm

projects/nasm.us/versions.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { SemVer } from "brewkit";
2+
3+
export default async function () {
4+
const rsp = await fetch("https://www.nasm.us/pub/nasm/releasebuilds/");
5+
const txt = await rsp.text();
6+
const matches = txt.matchAll(/"(\d+\.\d+(\.\d+))?\/"/mg);
7+
const rv = [];
8+
for (const match of matches) {
9+
const tag = match[1];
10+
const version = new SemVer(match[1]);
11+
rv.push({ version, tag });
12+
}
13+
return rv;
14+
}

0 commit comments

Comments
 (0)