On macOS you'll need Homebrew and Xcode installed (get it in the App Store), plus you need to run Xcode once to let it install more tools.
First you need to tell the system to use Xcode's tools:
sudo xcode-select --switch /Applications/Xcode.app
Now install the prerequisites:
brew install coreutils e2fsprogs qemu bash gcc@11 imagemagick ninja cmake ccache rsync zstd libvirt
If you have an Apple Silicon Mac make sure that you only have these tools in one brew environment, arm or x86. Using the native arm tools is going to be faster.
There are two options for handling Serenity's ext2 filesystem, we'll use the simpler way with genext2fs. You can also use macFUSE, but it's a bit more complicated, check out the build instructions to do that.
brew install genext2fs
That's it for prereqs! Now we can start building.
Grab the SerenityOS repository:
git clone https://github.com/SerenityOS/serenity.git
cd serenity
First build the toolchain:
Meta/serenity.sh rebuild-toolchain
Now the final step:
Meta/serenity.sh run
If you're running Linux, you can just install a few libraries and then start building, check out the build instructions for your specific distribution if it's not here.
Ubuntu / Debian
sudo apt install build-essential cmake curl libmpfr-dev libmpc-dev libgmp-dev e2fsprogs ninja-build qemu-system-gui qemu-system-x86 qemu-utils ccache rsync unzip texinfo
You may need to install GCC 11 as well:
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install gcc-11 g++-11
And some prerequisites for QEMU:
sudo apt install libgtk-3-dev libpixman-1-dev libsdl2-dev libspice-server-dev
Arch
sudo pacman -S --needed base-devel cmake curl mpfr libmpc gmp e2fsprogs ninja qemu qemu-arch-extra ccache rsync unzip
Now it's the same as above to build the toolchain and run the OS:
git clone https://github.com/SerenityOS/serenity.git
cd serenity
Depending on the distribution you may need to build qemu:
Toolchain/BuildQemu.sh
Then finish up:
Meta/serenity.sh rebuild-toolchain
Meta/serenity.sh run
Text editor powered by tinymce.