ladybird: unstable-2023-01-17 -> 0-unstable-2024-03-16

authored by Andrew Kaster and committed by Francesco Gazzetta b467733c dbf53da0

+111 -26
+1 -1
nixos/tests/ladybird.nix
··· 21 21 '' 22 22 machine.wait_for_x() 23 23 machine.succeed("echo '<!DOCTYPE html><html><body><h1>Hello world</h1></body></html>' > page.html") 24 - machine.execute("ladybird file://$(pwd)/page.html >&2 &") 24 + machine.execute("Ladybird file://$(pwd)/page.html >&2 &") 25 25 machine.wait_for_window("Ladybird") 26 26 machine.sleep(5) 27 27 machine.wait_for_text("Hello world")
+108 -24
pkgs/applications/networking/browsers/ladybird/default.nix
··· 1 1 { lib 2 2 , stdenv 3 3 , fetchFromGitHub 4 + , fetchzip 5 + , fetchurl 6 + , cacert 7 + , tzdata 8 + , unicode-emoji 9 + , unicode-character-database 10 + , darwin 4 11 , cmake 5 12 , ninja 6 - , unzip 7 - , wrapQtAppsHook 8 13 , libxcrypt 9 - , qtbase 14 + , qt6Packages 10 15 , nixosTests 16 + , AppKit 17 + , Cocoa 18 + , Foundation 19 + , OpenGL 11 20 }: 12 21 22 + let 23 + inherit (builtins) elemAt; 24 + cldr_version = "44.1.0"; 25 + cldr-json = fetchzip { 26 + url = "https://github.com/unicode-org/cldr-json/releases/download/${cldr_version}/cldr-${cldr_version}-json-modern.zip"; 27 + stripRoot = false; 28 + hash = "sha256-EbbzaaspKgRT/dsJV3Kf0Dfj8LN9zT+Pl4gk5kiOXWk="; 29 + postFetch = '' 30 + echo -n ${cldr_version} > $out/version.txt 31 + ''; 32 + }; 33 + unicode-idna = fetchurl { 34 + url = "https://www.unicode.org/Public/idna/${unicode-character-database.version}/IdnaMappingTable.txt"; 35 + hash = "sha256-QCy9KF8flS/NCDS2NUHVT2nT2PG4+Fmb9xoaFJNfgsQ="; 36 + }; 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"; 41 + }; 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="; 46 + }; 47 + # Note: The cacert version is synthetic and must match the version in the package's CMake 48 + cacert_version = "2023-12-12"; 49 + in 13 50 stdenv.mkDerivation (finalAttrs: { 14 51 pname = "ladybird"; 15 - version = "unstable-2023-01-17"; 52 + version = "0-unstable-2024-03-16"; 16 53 17 54 src = fetchFromGitHub { 18 55 owner = "SerenityOS"; 19 56 repo = "serenity"; 20 - rev = "45e85d20b64862df119f643f24e2d500c76c58f3"; 21 - hash = "sha256-n2mLg9wNfdMGsJuGj+ukjto9qYjGOIz4cZjgvMGQUrY="; 57 + rev = "3a8bde9ef24dace600484b38992fdc7d17bf92c3"; 58 + hash = "sha256-r8HYcexrOjDYsXuCtROiNY7Rl60pVQBvVQf190gqNuY="; 22 59 }; 23 60 24 61 sourceRoot = "${finalAttrs.src.name}/Ladybird"; 25 62 26 63 postPatch = '' 27 - substituteInPlace CMakeLists.txt \ 28 - --replace "MACOSX_BUNDLE TRUE" "MACOSX_BUNDLE FALSE" 29 - # https://github.com/SerenityOS/serenity/issues/17062 30 - substituteInPlace main.cpp \ 31 - --replace "./SQLServer/SQLServer" "$out/bin/SQLServer" 32 - # https://github.com/SerenityOS/serenity/issues/10055 33 - substituteInPlace ../Meta/Lagom/CMakeLists.txt \ 34 - --replace "@rpath" "$out/lib" 64 + sed -i '/iconutil/d' CMakeLists.txt 65 + 66 + # Don't set absolute paths in RPATH 67 + substituteInPlace ../Meta/CMake/lagom_install_options.cmake \ 68 + --replace-fail "\''${CMAKE_INSTALL_BINDIR}" "bin" \ 69 + --replace-fail "\''${CMAKE_INSTALL_LIBDIR}" "lib" 35 70 ''; 36 71 37 - nativeBuildInputs = [ 72 + preConfigure = '' 73 + # Setup caches for LibLocale, LibUnicode, LibTimezone, LibTLS and LibGfx 74 + # Note that the versions of the input data packages must match the 75 + # expected version in the package's CMake. 76 + mkdir -p build/Caches 77 + 78 + ln -s ${cldr-json} build/Caches/CLDR 79 + 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 86 + 87 + mkdir build/Caches/TZDB 88 + tar -xzf ${elemAt tzdata.srcs 0} -C build/Caches/TZDB 89 + echo -n ${tzdata.version} > build/Caches/TZDB/version.txt 90 + 91 + mkdir build/Caches/CACERT 92 + cp ${cacert}/etc/ssl/certs/ca-bundle.crt build/Caches/CACERT/cacert-${cacert_version}.pem 93 + echo -n ${cacert_version} > build/Caches/CACERT/version.txt 94 + 95 + mkdir build/Caches/PublicSuffix 96 + cp ${public-suffix-list} build/Caches/PublicSuffix/public_suffix_list.dat 97 + 98 + mkdir build/Caches/AdobeICCProfiles 99 + cp ${adobe-icc-profiles} build/Caches/AdobeICCProfiles/adobe-icc-profiles.zip 100 + chmod +w build/Caches/AdobeICCProfiles 101 + ''; 102 + 103 + nativeBuildInputs = with qt6Packages; [ 38 104 cmake 39 105 ninja 40 - unzip 41 106 wrapQtAppsHook 42 107 ]; 43 108 44 - buildInputs = [ 109 + buildInputs = with qt6Packages; [ 45 110 libxcrypt 46 111 qtbase 112 + qtmultimedia 113 + ] ++ lib.optionals stdenv.isDarwin [ 114 + AppKit 115 + Cocoa 116 + Foundation 117 + OpenGL 47 118 ]; 48 119 49 120 cmakeFlags = [ 50 121 # Disable network operations 51 - "-DENABLE_TIME_ZONE_DATABASE_DOWNLOAD=false" 52 - "-DENABLE_UNICODE_DATABASE_DOWNLOAD=false" 122 + "-DSERENITY_CACHE_DIR=Caches" 123 + "-DENABLE_NETWORK_DOWNLOADS=OFF" 124 + "-DENABLE_COMMONMARK_SPEC_DOWNLOAD=OFF" 125 + ] ++ lib.optionals stdenv.isLinux [ 126 + "-DCMAKE_INSTALL_LIBEXECDIR=libexec" 127 + # FIXME: Enable this when launching with the commandline flag --enable-gpu-painting doesn't fail calling eglBindAPI on GNU/Linux 128 + "-DENABLE_ACCELERATED_GRAPHICS=OFF" 53 129 ]; 54 130 131 + # FIXME: Add an option to -DENABLE_QT=ON on macOS to use Qt rather than Cocoa for the GUI 132 + # FIXME: Add an option to enable PulseAudio rather than using Qt multimedia on non-macOS 133 + 55 134 env.NIX_CFLAGS_COMPILE = "-Wno-error"; 56 135 57 - # https://github.com/SerenityOS/serenity/issues/10055 58 136 postInstall = lib.optionalString stdenv.isDarwin '' 59 - install_name_tool -add_rpath $out/lib $out/bin/ladybird 137 + mkdir -p $out/Applications $out/bin 138 + mv $out/bundle/Ladybird.app $out/Applications 60 139 ''; 61 140 141 + # Only Ladybird and WebContent need wrapped, if Qt is enabled. 142 + # On linux we end up wraping some non-Qt apps, like headless-browser. 143 + dontWrapQtApps = stdenv.isDarwin; 144 + 62 145 passthru.tests = { 63 146 nixosTest = nixosTests.ladybird; 64 147 }; 65 148 66 149 meta = with lib; { 67 - description = "A browser using the SerenityOS LibWeb engine with a Qt GUI"; 68 - homepage = "https://github.com/awesomekling/ladybird"; 150 + description = "A browser using the SerenityOS LibWeb engine with a Qt or Cocoa GUI"; 151 + homepage = "https://ladybird.dev"; 69 152 license = licenses.bsd2; 70 153 maintainers = with maintainers; [ fgaz ]; 71 - platforms = platforms.unix; 154 + platforms = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" ]; 155 + mainProgram = "Ladybird"; 72 156 }; 73 157 })
+2 -1
pkgs/top-level/all-packages.nix
··· 32847 32847 32848 32848 ladspa-sdk = callPackage ../applications/audio/ladspa-sdk { }; 32849 32849 32850 - ladybird = qt6Packages.callPackage ../applications/networking/browsers/ladybird { 32850 + ladybird = darwin.apple_sdk_11_0.callPackage ../applications/networking/browsers/ladybird { 32851 32851 stdenv = if stdenv.isDarwin then overrideLibcxx darwin.apple_sdk_11_0.llvmPackages_16.stdenv else stdenv; 32852 + inherit (darwin.apple_sdk_11_0.frameworks) AppKit Cocoa Foundation OpenGL; 32852 32853 }; 32853 32854 32854 32855 lazpaint = callPackage ../applications/graphics/lazpaint { };