DEV Community

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

Posted on

2 1

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.

Image of AssemblyAI

Automatic Speech Recognition with AssemblyAI

Experience near-human accuracy, low-latency performance, and advanced Speech AI capabilities with AssemblyAI's Speech-to-Text API. Sign up today and get $50 in API credit. No credit card required.

Try the API

Top comments (2)

Collapse
 
lecindero profile image
Theo

It takes so long to build! xD

Collapse
 
aditya_tambi profile image
Aditya tambi

Only the first time. In subsequent attempt you will see that it is quite snappy.
Helpful because that's how we develop changes in the browser :
Make code changes -> rebuit -> check -> repeat

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay