Total Pageviews

Wednesday, 16 September 2026

基于rust构建的浏览器ladybird

 ladybird.org

Ladybird browser build instructions

Build Prerequisites

Qt6.9+ development packages, nasm, additional build tools, and a C++23 capable compiler are required.

Note

Some distributions still package a Qt6 older than 6.9; for example, Debian 13 (trixie) ships Qt 6.8 — so configuring against it fails. If your Qt6 is older than 6.9, install a newer one from a newer distribution release, or directly from the Qt online installer, and then point the build to it using CMAKE_PREFIX_PATH.

A Rust toolchain is also required. You can install it via rustup.

We currently use gcc-14 and clang-21 in our CI pipeline. If these versions are not available on your system, see find_compiler.py for the minimum compatible version.

CMake 3.30 or newer must be available in $PATH.


Debian/Ubuntu:

sudo apt install autoconf autoconf-archive automake build-essential ccache cmake curl fonts-liberation2 git glslang-tools libdrm-dev libgl1-mesa-dev libncurses-dev libpulse-dev libtool nasm ninja-build pkg-config python3-venv qt6-base-private-dev qt6-positioning-dev qt6-tools-dev-tools qt6-wayland tar unzip zip

CMake 3.30 or newer:

Note

Kitware’s apt repository is Ubuntu-only.

# Add Kitware GPG signing key
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null

# Optional: Verify the GPG key manually

# Use the key to authorize an entry for apt.kitware.com in apt sources list
echo "deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/kitware.list

# Update apt package list and install cmake
sudo apt update -y && sudo apt install cmake -y

C++23-capable compiler:

# Add LLVM GPG signing key
sudo wget -O /usr/share/keyrings/llvm-snapshot.gpg.key https://apt.llvm.org/llvm-snapshot.gpg.key

# Optional: Verify the GPG key manually

# Use the key to authorize an entry for apt.llvm.org in apt sources list
echo "deb [signed-by=/usr/share/keyrings/llvm-snapshot.gpg.key] https://apt.llvm.org/$(lsb_release -sc)/ llvm-toolchain-$(lsb_release -sc)-21 main" | sudo tee -a /etc/apt/sources.list.d/llvm.list

# Update apt package list and install clang and associated packages
sudo apt update -y && sudo apt install clang-21 clangd-21 clang-tools-21 clang-format-21 clang-tidy-21 lld-21 -y
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update && sudo apt install g++-14 libstdc++-14-dev

Arch Linux/Manjaro:

sudo pacman -S --needed autoconf-archive base-devel ccache cmake curl git less libgl libpulse nasm ninja python qt6-base qt6-positioning qt6-tools ttf-liberation tar unzip zip

Fedora or derivatives:

sudo dnf install autoconf-archive automake ccache cmake curl git libdrm-devel liberation-sans-fonts libglvnd-devel libtool nasm ncurses-devel ninja-build patchelf perl-FindBin perl-IPC-Cmd perl-lib perl-Time-Piece pulseaudio-libs-devel qt6-qtbase-private-devel qt6-qtpositioning-devel qt6-qttools-devel qt6-qtwayland-devel tar unzip zip zlib-ng-compat-static

openSUSE:

sudo zypper install autoconf-archive automake ccache cmake curl gcc14 gcc14-c++ git liberation-fonts libglvnd-devel libpulse-devel libtool nasm ncurses-devel ninja qt6-base-private-devel qt6-positioning-devel qt6-tools-devel qt6-wayland-devel tar unzip zip

If one or more of the base repository packages are flagged as having an out-of-date version during the build process, you may need add the devel:tools:building repository. For example, on Leap 15.6, the autoconf package might be version 2.69, whereas the gperf package requires 2.70 to build.

For Leap 15.6, run the following command to add this repo (you will need to adjust the URL for other openSUSE versions):

sudo zypper addrepo https://download.opensuse.org/repositories/devel:tools:building/15.6/devel:tools:building.repo
sudo zypper refresh

Below is an example printout that might be received depending which versions of autoconf are available for installation:

> sudo zypper install autoconf
Loading repository data...
Reading installed packages...
'autoconf' is already installed.
There is an update candidate for 'autoconf' from vendor 'obs://build.opensuse.org/devel:tools', while the current vendor is 'SUSE LLC <https://www.suse.com/>'. Use 'zypper install autoconf-2.72-80.d_t_b.1.noarch' to install this candidate.
Resolving package dependencies...
Nothing to do.
> sudo zypper install autoconf-2.72-80.d_t_b.1.noarch

The build process requires at least python3.7; openSUSE Leap only features Python 3.6 as default, so it is recommendable to install the package python312 and create a virtual environment (venv) in this case.

A virtual environment can be created in your home directory and once the source command is issued python3 --version will show that the current version is python 3.12 within the virtual environment shell session.

python3.12 -m venv ~/python312_venv
source ~/python312_venv/bin/activate
python3 --version

This virtual environment can be created once and reused in future shell sessions by sourcing the generated file ~/python312_venv/bin/activate again.

Void Linux:

sudo xbps-install -Su # (optional) ensure packages are up to date to avoid "Transaction aborted due to unresolved dependencies."
sudo xbps-install -S git bash gcc python3 curl cmake libtool zip unzip linux-headers make pkg-config autoconf automake autoconf-archive nasm ncurses-devel MesaLib-devel ninja pulseaudio-devel qt6-base-private-devel qt6-position-devel qt6-tools-devel qt6-wayland-devel

NixOS or with Nix:

A Nix development shell is maintained here, in the nix-environments repository. If you encounter any problems building with Nix, please create an issue there.

macOS:

Xcode 15 or clang from homebrew is required to successfully build ladybird.

xcode-select --install
brew install autoconf autoconf-archive automake ccache cmake libtool nasm ninja pkg-config

If you wish to use clang from homebrew instead:

brew install llvm@21

If you also plan to use the Qt UI on macOS:

brew install qt

Note

It is recommended to add your terminal application (i.e. Terminal.app or iTerm.app) to the system list of developer tools. Doing so will reduce slow startup time of freshly compiled binaries, due to macOS validating the binary on its first run. This can be done in the "Developer Tools" section of the "Privacy & Security" system settings.

from https://github.com/LadybirdBrowser/ladybird/blob/master/Documentation/BuildInstructionsLadybird.md

No comments:

Post a Comment