Skip to content

Commit 7a66791

Browse files
alexveeclealexpdp7
authored andcommitted
Package typst
1 parent 3313288 commit 7a66791

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

repo/typst.ubpkg.sky

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
gh = github_repo("typst/typst")
2+
3+
release = gh.latest_release("^v[0-9]+\.[0-9]+\.[0-9]+$")
4+
5+
rest = {
6+
("macos", "aarch64"): "aarch64-apple-darwin",
7+
("macos", "x86_64"): "x86_64-apple-darwin",
8+
("linux", "x86_64"): "x86_64-unknown-linux-musl",
9+
("linux", "aarch64"): "aarch64-unknown-linux-musl",
10+
("windows", "x86_64"): "x86_64-pc-windows-msvc",
11+
}[(os, arch)]
12+
13+
archive_format = {
14+
"linux": "tar.xz",
15+
"macos": "tar.xz",
16+
"windows": "zip",
17+
}[os]
18+
19+
asset = release.get_asset_url("typst-{rest}.{archive_format}".format(rest=rest, archive_format=archive_format))
20+
21+
install_binary(extract_from_url(asset, "typst-{rest}/typst".format(rest=rest)), "typst")

0 commit comments

Comments
 (0)