Vendor Typst compiler locally instead of depending on typstdrive folder

This commit is contained in:
2026-07-22 16:34:31 -04:00
parent 30bfa0d7a8
commit 65b041b6c9
5 changed files with 26 additions and 23 deletions
+9 -9
View File
@@ -23,8 +23,8 @@ jobs:
- name: Clone Typst compiler
run: |
git clone https://github.com/typst/typst.git typstdrive/typst
git -C typstdrive/typst checkout "$TYPST_COMMIT"
git clone https://github.com/typst/typst.git typst-desktop/typst
git -C typst-desktop/typst checkout "$TYPST_COMMIT"
- name: Install build dependencies
run: |
@@ -85,17 +85,18 @@ jobs:
path: packages/*
if-no-files-found: error
- name: Publish to GitHub release
- name: Publish to Gitea release
if: startsWith(github.ref, 'refs/tags/v')
env:
TOKEN: ${{ secrets.RELEASE_TOKEN }}
TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITEA_URL: https://git.sirblob.co
REPOSITORY: sirblobby/typst-desktop
TAG: ${{ github.ref_name }}
run: |
set -euo pipefail
api="https://api.github.com/repos/$REPOSITORY"
auth="Authorization: Bearer $TOKEN"
api="$GITEA_URL/api/v1/repos/$REPOSITORY"
auth="Authorization: token $TOKEN"
json="Content-Type: application/json"
existing=$(curl -sS -H "$auth" "$api/releases/tags/$TAG" | jq -r '.id // empty')
@@ -118,9 +119,8 @@ jobs:
name=$(basename "$package")
echo "Uploading $name"
curl -sS --fail -X POST -H "$auth" \
-H "Content-Type: application/octet-stream" \
--data-binary "@$package" \
"https://uploads.github.com/repos/$REPOSITORY/releases/$release_id/assets?name=$name" \
-F "attachment=@$package" \
"$api/releases/$release_id/assets?name=$name" \
> /dev/null
done
+2 -2
View File
@@ -41,8 +41,8 @@ jobs:
- name: Clone Typst compiler
run: |
git clone https://github.com/typst/typst.git typstdrive/typst
git -C typstdrive/typst checkout "$TYPST_COMMIT"
git clone https://github.com/typst/typst.git typst-desktop/typst
git -C typst-desktop/typst checkout "$TYPST_COMMIT"
- name: Install build dependencies
run: |
+1
View File
@@ -1,5 +1,6 @@
.DS_Store
node_modules
/typst
/build
/.svelte-kit
/package
+7 -5
View File
@@ -169,10 +169,10 @@ The editor header shows the language server status. Without `tinymist` the edito
## Development
The app compiles Typst from source, so clone the compiler into TypstDrive's `typst/` folder first — both projects share it:
The app compiles Typst from source, so clone the compiler into this repo's `typst/` folder first:
```bash
git clone https://github.com/typst/typst.git ../typstdrive/typst
git clone https://github.com/typst/typst.git typst
```
Then:
@@ -200,11 +200,11 @@ macOS builds are unsigned. Gatekeeper blocks unsigned apps on first launch, so o
### Building locally for another platform
Building on the target platform is the supported path. The Typst compiler is a path dependency, so any machine or runner needs it checked out beside this repository:
Building on the target platform is the supported path. The Typst compiler is a path dependency, so any machine or runner needs it checked out inside this repository:
```bash
git clone https://github.com/typst/typst.git ../typstdrive/typst
git -C ../typstdrive/typst checkout 44b3f78ed37fedea75e911dde2269ef86c45316f
git clone https://github.com/typst/typst.git typst
git -C typst checkout 9dfd3a08500b7896045f907433cf7b4b02434fad
```
Linux builds also need the WebKit and GTK development packages:
@@ -217,6 +217,8 @@ sudo apt-get install libwebkit2gtk-4.1-dev libgtk-3-dev librsvg2-dev patchelf
bun run build:linux
```
Build on Ubuntu 22.04 (the CI baseline) rather than a rolling-release distro. glibc compatibility only works forward, so a binary is only guaranteed to run on distros with a glibc version equal to or newer than the one it was built against. This won't cover musl-based distros like Alpine, or glibc-based distros older than the build machine.
## License
Apache License 2.0. See [LICENSE](LICENSE).
+7 -7
View File
@@ -27,13 +27,13 @@ serde = { version = "1", features = ["derive"] }
serde_json = "1"
rusqlite = { version = "0.32", features = ["bundled"] }
typst = { version = "0.15.1", path = "../../typstdrive/typst/crates/typst" }
typst-kit = { path = "../../typstdrive/typst/crates/typst-kit", features = ["system-downloader", "system-packages", "embedded-fonts"] }
typst-pdf = { path = "../../typstdrive/typst/crates/typst-pdf" }
typst-render = { path = "../../typstdrive/typst/crates/typst-render" }
typst-svg = { path = "../../typstdrive/typst/crates/typst-svg" }
typst-html = { path = "../../typstdrive/typst/crates/typst-html" }
typst-layout = { path = "../../typstdrive/typst/crates/typst-layout" }
typst = { version = "0.15.1", path = "../typst/crates/typst" }
typst-kit = { path = "../typst/crates/typst-kit", features = ["system-downloader", "system-packages", "embedded-fonts"] }
typst-pdf = { path = "../typst/crates/typst-pdf" }
typst-render = { path = "../typst/crates/typst-render" }
typst-svg = { path = "../typst/crates/typst-svg" }
typst-html = { path = "../typst/crates/typst-html" }
typst-layout = { path = "../typst/crates/typst-layout" }
typst-assets = { version = "0.15.1", features = ["fonts"] }
chrono = { version = "0.4", features = ["serde"] }