Build from sources
Prerequisites
Lightpanda is written with Zig 0.14.0. You will have to
install it with the right version in order to build the project.
You need also to install Rust for building deps.
Lightpanda also depends on zig-js-runtime (with v8), Libcurl and html5ever .
To be able to build the v8 engine for zig-js-runtime, you have to install some libs:
For Debian/Ubuntu based Linux:
sudo apt install xz-utils ca-certificates \
pkg-config libglib2.0-dev \
clang make curl gitFor MacOS, you need Xcode and the following pacakges from homebrew:
brew install cmakeInstall Git submodules
The project uses git submodules for dependencies.
To init or update the submodules in the vendor/ directory:
make install-submoduleThis is an alias for git submodule init && git submodule update.
Build and run
You an build the entire browser with make build or make build-dev for debug
env.
But you can directly use the zig command to run in debug mode:
zig build runThe build will download and build V8. It can takes a lot of time, more than
1 hour.
You can save this part by donwloading manually a
[pre-built](https://github.com/lightpanda-io/zig-v8-fork/releases version)
and use the -Dprebuilt_v8_path= option.
Embed v8 snapshot
Lighpanda uses v8 snapshot. By default, it is created on startup but you can embed it by using the following commands:
Generate the snapshot.
zig build snapshot_creator -- src/snapshot.binBuild using the snapshot binary.
zig build -Dsnapshot_path=../../snapshot.binSee #1279 for more details.