Commit c41846f7 authored by Francesco Gazzetta's avatar Francesco Gazzetta
Browse files

ladybird: search for fonts in NixOS-specific paths

Fixes #314604

(cherry picked from commit 2058c78327e6da183304fc441d237561edd6ff75)
parent 9df33e95
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -59,18 +59,22 @@ stdenv.mkDerivation (finalAttrs: {
    hash = "sha256-+g/1F/v8nTVbvtSrtyvQbeYacjTlfRpg+Htu0lRlkcU=";
  };

  sourceRoot = "${finalAttrs.src.name}/Ladybird";
  patches = [
    ./nixos-font-path.patch
  ];

  postPatch = ''
    sed -i '/iconutil/d' CMakeLists.txt

    # Don't set absolute paths in RPATH
    substituteInPlace ../Meta/CMake/lagom_install_options.cmake \
    substituteInPlace Meta/CMake/lagom_install_options.cmake \
      --replace-fail "\''${CMAKE_INSTALL_BINDIR}" "bin" \
      --replace-fail "\''${CMAKE_INSTALL_LIBDIR}" "lib"
  '';

  preConfigure = ''
    cd Ladybird

    # Setup caches for LibLocale, LibUnicode, LibTimezone, LibTLS and LibGfx
    # Note that the versions of the input data packages must match the
    # expected version in the package's CMake.
+12 −0
Original line number Diff line number Diff line
diff --git a/Userland/Libraries/LibCore/StandardPaths.cpp b/Userland/Libraries/LibCore/StandardPaths.cpp
index 77ddbeb9..76481497 100644
--- a/Userland/Libraries/LibCore/StandardPaths.cpp
+++ b/Userland/Libraries/LibCore/StandardPaths.cpp
@@ -205,6 +205,7 @@ ErrorOr<Vector<String>> StandardPaths::font_directories()
         "/Library/Fonts"_string,
         TRY(String::formatted("{}/Library/Fonts"sv, home_directory())),
 #    else
+        "/run/current-system/sw/share/X11/fonts"_string,
         "/usr/share/fonts"_string,
         "/usr/local/share/fonts"_string,
         TRY(String::formatted("{}/.local/share/fonts"sv, home_directory())),