DEV Community

Cover image for Set-up ladybird in mac
Aditya tambi
Aditya tambi

Posted on

Set-up ladybird in mac

In case you missed out on this new ongoing project, visit the website Ladybird to get acquainted.

The official build instructions. This is a step by step guide to build ladybird locally in MacOS.

  • 1. Install Build Prerequisites You need development tools and dependencies. Use the terminal to install them.

Install Xcode and Command Line Tools :

xcode-select --install
Enter fullscreen mode Exit fullscreen mode

In my case the xcode-select was already installed.

install xcode

xcode provides compilers like clang, and tools like git. Essential for building software on macOS. We need it for compiling the source code and managing version control.

Install Homebrew (if not already installed) :

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Enter fullscreen mode Exit fullscreen mode

install homebrew

Homebrew is a package manager for macOS that simplifies the installation of software and libraries. We would use it to install and manage additional build dependencies like cmake, nasm, and ninja.

Keep in mind for Homebrew that it needs to be added in your PATH
the following would show up on your console.

set PATH in homebrew

Install Required tools via Homebrew :

brew install autoconf autoconf-archive automake ccache cmake nasm ninja pkg-config
Enter fullscreen mode Exit fullscreen mode
  1. ccache: a compiler cache that speeds up recompilation by caching previous compilations. Will reduce build time when making frequent modifications to source code.
  2. cmake: a cross-platform build system generator. Will help build and configure the build environment based on system-specific conditions.
  3. nasm: Required for building parts of code written in assembly.
  4. ninja: helps build systems in parallel, reducing the build time.

Don't think a screenshot is needed here. Simply run the command.

The build guide mentions an optional to get clang from Homebrew.
If you face issues with Xcode’s default clang, install a newer version: _I did not need to install this

brew install llvm@18
Enter fullscreen mode Exit fullscreen mode
  • 2. Download Ladybird Source Code

Clone the repository

git clone https://github.com/LadybirdBrowser/ladybird.git
cd ladybird
Enter fullscreen mode Exit fullscreen mode
  • 3. Build Ladybird

Using the ladybird.sh script
This script simplifies the build process.

To build and run the Ladybird browser:

./Meta/ladybird.sh run ladybird
Enter fullscreen mode Exit fullscreen mode

This command will take a little while to run in your terminal. Will install other dependencies if you have missing. And then it should run the ladybird browser in your machine

Note: if you have downloaded clang using Homebrew then build command will look like this

CC=$(brew --prefix llvm)/bin/clang CXX=$(brew --prefix llvm)/bin/clang++ ./Meta/ladybird.sh run
Enter fullscreen mode Exit fullscreen mode

Then when it is done, when you open any url in ladybird it should work and show in your terminal as well.

Currently this is what google.com looks like in ladybird browser

Screenshot of google

and in terminal you can check something like this (even errors)

terminal image of success and error

As of November 2024, ladybird is in pre-alpha stage. Hence the complexity in build and run. That also explains the look of google's homepage as well.

Top comments (0)