Everywhere: Remove Nix build support

A significant portion of reported build problems come from people trying
to build Ladybird with Nix, and it seems there's always something broken
for someone. The maintainers are currently not focused on supporting
Nix, and as a result PRs are not reviewed as well as they could have
been.

This removes all Nix-related files.
This commit is contained in:
Jelle Raaijmakers 2025-03-24 13:50:59 +00:00 committed by Sam Atkins
parent 582084e74e
commit 685cc1aae8
Notes: github-actions[bot] 2025-03-24 17:23:10 +00:00
7 changed files with 0 additions and 228 deletions

View file

@ -99,41 +99,6 @@ sudo xbps-install -Su # (optional) ensure packages are up to date to avoid "Tran
sudo xbps-install -S git bash gcc python3 curl cmake zip unzip linux-headers make pkg-config autoconf automake autoconf-archive nasm MesaLib-devel ninja qt6-base-devel qt6-multimedia-devel qt6-tools-devel qt6-wayland-devel
```
### NixOS or with Nix:
> [!NOTE]
> Ladybird's build system uses vcpkg to vendor third-party dependencies, which proves undesirable to use with Nix for [several reasons](https://github.com/LadybirdBrowser/ladybird/issues/371).
> As a result, using `ladybird.sh` to compile and run Ladybird will fail. Therefore, it is necessary to use system packages provided by the dev-shell.
To build the project, first enter the shell:
```console
nix develop
# With a custom entrypoint, for example, your favorite shell
nix develop --command bash
# Using nix-shell
nix-shell
# Using nix-shell and a custom shell
nix-shell --command bash
```
Then invoke `cmake` directly. For example:
```
cmake -GNinja -BBuild/release
```
Finally, run `ninja` (or the generator you're using) to start the build:
```
ninja -C Build/release
```
For more information, see [Custom CMake build directory](#custom-cmake-build-directory) and [Running manually](#running-manually).
### macOS:
Xcode 15 or clang from homebrew is required to successfully build ladybird.

View file

@ -3,5 +3,3 @@ config-temp
config.log
# For caching the entire toolchain (useful on Travis)
Cache/
# Nix profiles can be stored here
nix-profiles/

View file

@ -1,26 +0,0 @@
# Override ladybird from nixpkgs with the source directory as the source
# and latest revision (or "dirty") as the version. Unless new dependencies
# are introduced, this should work just fine. If a new dependency is added
# and builds are broken, simply adding the missing dependencies in buildInputs
# inside of the attribute should do the trick.
{
self,
lib,
ladybird,
...
}:
ladybird.overrideAttrs {
# Reproducible source path
src = builtins.path {
path = ../../.;
name = "ladybird-source";
filter = lib.cleanSourceFilter;
};
# Short rev will be missing in "dirty" source trees. In which case we fall
# back to "dirty" as the version.
version = self.shortRev or "dirty";
# Let's not bother nixpkgs maintainers with issues in the source.
meta.maintainers = with lib.maintainers; [ NotAShelf ];
}

View file

@ -1,33 +0,0 @@
{
mkShell,
kdePackages,
ccache,
clang-tools,
pre-commit,
nodePackages,
ladybird,
...
}:
mkShell {
inputsFrom = [
ladybird
];
packages = [
ccache
clang-tools
pre-commit
nodePackages.prettier
];
# Fix for: https://github.com/LadybirdBrowser/ladybird/issues/371#issuecomment-2616415434
# https://github.com/NixOS/nixpkgs/commit/049a854b4be087eaa3a09012b9c452fbc838dd41
NIX_LDFLAGS = "-lGL";
shellHook = ''
# NOTE: This is required to make it find the wayland platform plugin installed
# above, but should probably be fixed upstream.
export QT_PLUGIN_PATH="$QT_PLUGIN_PATH:${kdePackages.qtwayland}/lib/qt-6/plugins"
export QT_QPA_PLATFORM="wayland;xcb"
'';
}

43
flake.lock generated
View file

@ -1,43 +0,0 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1741010256,
"narHash": "sha256-WZNlK/KX7Sni0RyqLSqLPbK8k08Kq7H7RijPJbq9KHM=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "ba487dbc9d04e0634c64e3b1f0d25839a0a68246",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs",
"systems": "systems"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

View file

@ -1,54 +0,0 @@
{
description = "Ladybird";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
systems.url = "github:nix-systems/default";
};
outputs =
{
self,
systems,
nixpkgs,
...
}:
let
eachSystem = nixpkgs.lib.genAttrs (import systems);
in
{
packages = eachSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
# Default ladybird package built from source using current directory
# as the source. This is not cached.
ladybird = pkgs.callPackage ./Toolchain/Nix/package.nix { inherit self; };
# Alias for `nix run .` or `nix run github:LadybirdBrowser/ladybird`
default = self.packages.${system}.ladybird;
}
);
devShells = eachSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
# Override nixpkgs ladybird with the one provided
# by this flake. This will allow inputsFrom to
# remain in-sync with the package provided by the
# flake.
default = pkgs.callPackage ./Toolchain/Nix/shell.nix {
inherit (self.packages.${system}) ladybird;
};
}
);
# Provide a formatter for `nix fmt`
formatter = eachSystem (system: nixpkgs.legacyPackages.${system}.nixfmt-rfc-style);
};
}

View file

@ -1,35 +0,0 @@
{
pkgs ? import <nixpkgs> { },
}:
pkgs.mkShell {
inputsFrom = [
pkgs.ladybird
];
packages =
with pkgs;
with pkgs.qt6Packages;
with pkgs.nodePackages;
[
qtbase.dev
qttools
qtwayland.dev
ccache
clang-tools
pre-commit
prettier
];
# Fix for: https://github.com/LadybirdBrowser/ladybird/issues/371#issuecomment-2616415434
# https://github.com/NixOS/nixpkgs/commit/049a854b4be087eaa3a09012b9c452fbc838dd41
NIX_LDFLAGS = "-lGL";
shellHook = ''
# NOTE: This is required to make it find the wayland platform plugin installed
# above, but should probably be fixed upstream.
export QT_PLUGIN_PATH="$QT_PLUGIN_PATH:${pkgs.qt6.qtwayland}/lib/qt-6/plugins"
export QT_QPA_PLATFORM="wayland;xcb"
'';
}