8 , unicode-character-database
33 unicode-idna = fetchurl {
34 url = "https://www.unicode.org/Public/idna/${unicode-character-database.version}/IdnaMappingTable.txt";
35 hash = "sha256-QCy9KF8flS/NCDS2NUHVT2nT2PG4+Fmb9xoaFJNfgsQ=";
37 adobe-icc-profiles = fetchurl {
38 url = "https://download.adobe.com/pub/adobe/iccprofiles/win/AdobeICCProfilesCS4Win_end-user.zip";
39 hash = "sha256-kgQ7fDyloloPaXXQzcV9tgpn3Lnr37FbFiZzEb61j5Q=";
40 name = "adobe-icc-profiles.zip";
42 public_suffix_commit = "9094af5c6cb260e69137c043c01be18fee01a540";
43 public-suffix-list = fetchurl {
44 url = "https://raw.githubusercontent.com/publicsuffix/list/${public_suffix_commit}/public_suffix_list.dat";
45 hash = "sha256-0szHUz1T0MXOQ9tcXoKY2F/bI3s7hsYCjURqywZsf1w=";
47 # Note: The cacert version is synthetic and must match the version in the package's CMake
48 cacert_version = "2023-12-12";
50 stdenv.mkDerivation (finalAttrs: {
52 version = "0-unstable-2024-11-21";
54 src = fetchFromGitHub {
55 owner = "LadybirdWebBrowser";
57 rev = "6dc61f895db424e1ab245a7d4d219c6054a31ce3";
58 hash = "sha256-lEE2cfnQMSBi7+d34dbiuE5lwiGOzW1384/ohC+cf7I=";
62 sed -i '/iconutil/d' UI/CMakeLists.txt
64 # Don't set absolute paths in RPATH
65 substituteInPlace Meta/CMake/lagom_install_options.cmake \
66 --replace-fail "\''${CMAKE_INSTALL_BINDIR}" "bin" \
67 --replace-fail "\''${CMAKE_INSTALL_LIBDIR}" "lib"
71 # Setup caches for LibUnicode, LibTLS and LibGfx
72 # Note that the versions of the input data packages must match the
73 # expected version in the package's CMake.
75 # Check that the versions match
76 grep -F 'set(CACERT_VERSION "${cacert_version}")' Meta/CMake/ca_certificates_data.cmake || (echo cacert_version mismatch && exit 1)
80 cp -r ${unicode-character-database}/share/unicode build/Caches/UCD
81 chmod +w build/Caches/UCD
82 cp ${unicode-emoji}/share/unicode/emoji/emoji-test.txt build/Caches/UCD
83 cp ${unicode-idna} build/Caches/UCD/IdnaMappingTable.txt
84 echo -n ${unicode-character-database.version} > build/Caches/UCD/version.txt
85 chmod -w build/Caches/UCD
87 mkdir build/Caches/CACERT
88 cp ${cacert}/etc/ssl/certs/ca-bundle.crt build/Caches/CACERT/cacert-${cacert_version}.pem
89 echo -n ${cacert_version} > build/Caches/CACERT/version.txt
91 mkdir build/Caches/PublicSuffix
92 cp ${public-suffix-list} build/Caches/PublicSuffix/public_suffix_list.dat
94 mkdir build/Caches/AdobeICCProfiles
95 cp ${adobe-icc-profiles} build/Caches/AdobeICCProfiles/adobe-icc-profiles.zip
96 chmod +w build/Caches/AdobeICCProfiles
99 nativeBuildInputs = with qt6Packages; [
107 buildInputs = with qt6Packages; [
119 ] ++ lib.optional stdenv.hostPlatform.isLinux [
122 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
130 # Disable network operations
131 "-DSERENITY_CACHE_DIR=Caches"
132 "-DENABLE_NETWORK_DOWNLOADS=OFF"
133 ] ++ lib.optionals stdenv.hostPlatform.isLinux [
134 "-DCMAKE_INSTALL_LIBEXECDIR=libexec"
137 # FIXME: Add an option to -DENABLE_QT=ON on macOS to use Qt rather than Cocoa for the GUI
139 postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
140 mkdir -p $out/Applications $out/bin
141 mv $out/bundle/Ladybird.app $out/Applications
144 # Only Ladybird and WebContent need wrapped, if Qt is enabled.
145 # On linux we end up wraping some non-Qt apps, like headless-browser.
146 dontWrapQtApps = stdenv.hostPlatform.isDarwin;
149 nixosTest = nixosTests.ladybird;
152 passthru.updateScript = unstableGitUpdater { };
155 description = "Browser using the SerenityOS LibWeb engine with a Qt or Cocoa GUI";
156 homepage = "https://ladybird.org";
157 license = licenses.bsd2;
158 maintainers = with maintainers; [ fgaz ];
159 platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
160 mainProgram = "Ladybird";
161 # use of undeclared identifier 'NSBezelStyleAccessoryBarAction'
162 broken = stdenv.hostPlatform.isDarwin;