Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ladybird: fix build #203532

Merged
merged 1 commit into from
Nov 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 23 additions & 6 deletions pkgs/applications/networking/browsers/ladybird/default.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
{ lib
, gcc11Stdenv
, stdenv
, fetchFromGitHub
, cmake
, ninja
, unzip
, wrapQtAppsHook
, libxcrypt
, qtbase
, qttools
, nixosTests
}:

Expand All @@ -17,8 +16,8 @@ let serenity = fetchFromGitHub {
rev = "a0f3e2c9a2b82117aa7c1a3444ad0d31baa070d5";
hash = "sha256-8Xde59ZfdkTD39mYSv0lfFjBHFDWTUwfozE+Q9Yq6C8=";
};

in gcc11Stdenv.mkDerivation {
in
stdenv.mkDerivation {
pname = "ladybird";
version = "unstable-2022-09-29";

Expand All @@ -30,6 +29,11 @@ in gcc11Stdenv.mkDerivation {
hash = "sha256-XQj2Bohk8F6dGCAManOmmDP5b/SqEeZXZbLDYPfvi2E=";
};

postPatch = ''
substituteInPlace CMakeLists.txt \
--replace "MACOSX_BUNDLE TRUE" "MACOSX_BUNDLE FALSE"
'';

nativeBuildInputs = [
cmake
ninja
Expand All @@ -49,6 +53,20 @@ in gcc11Stdenv.mkDerivation {
"-DENABLE_UNICODE_DATABASE_DOWNLOAD=false"
];

# error: use of undeclared identifier 'aligned_alloc'
NIX_CFLAGS_COMPILE = toString (lib.optionals (stdenv.isDarwin && lib.versionOlder stdenv.targetPlatform.darwinSdkVersion "11.0") [
"-include mm_malloc.h"
"-Daligned_alloc=_mm_malloc"
]);

# https://github.com/NixOS/nixpkgs/issues/201254
NIX_LDFLAGS = lib.optionalString (stdenv.isLinux && stdenv.isAarch64 && stdenv.cc.isGNU) "-lgcc";

# https://github.com/SerenityOS/serenity/issues/10055
postInstall = lib.optionalString stdenv.isDarwin ''
install_name_tool -add_rpath $out/lib $out/bin/ladybird
'';

passthru.tests = {
nixosTest = nixosTests.ladybird;
};
Expand All @@ -58,7 +76,6 @@ in gcc11Stdenv.mkDerivation {
homepage = "https://github.com/awesomekling/ladybird";
license = licenses.bsd2;
maintainers = with maintainers; [ fgaz ];
# SerenityOS only works on x86, and can only be built on unix systems.
platforms = [ "x86_64-linux" "i686-linux" "x86_64-darwin" ];
platforms = platforms.unix;
};
}
4 changes: 3 additions & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30042,7 +30042,9 @@ with pkgs;

ladspa-sdk = callPackage ../applications/audio/ladspa-sdk { };

ladybird = qt6.callPackage ../applications/networking/browsers/ladybird { };
ladybird = qt6Packages.callPackage ../applications/networking/browsers/ladybird {
stdenv = if stdenv.isDarwin then llvmPackages_14.stdenv else gcc11Stdenv;
};
fgaz marked this conversation as resolved.
Show resolved Hide resolved

lazpaint = callPackage ../applications/graphics/lazpaint { };

Expand Down