ladybird: search for fonts in NixOS-specific paths

Fixes #314604

(cherry picked from commit 2058c78327e6da183304fc441d237561edd6ff75)
This commit is contained in:
Francesco Gazzetta 2024-05-27 11:35:25 +02:00
parent 9df33e9518
commit c41846f758
2 changed files with 18 additions and 2 deletions

@ -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.

@ -0,0 +1,12 @@
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())),