LadybirdBrowser / ladybird

Truly independent web browser
https://ladybird.org
BSD 2-Clause "Simplified" License
19.59k stars 794 forks source link

include could not find requested file: fontconfig #1384

Open clausecker opened 5 days ago

clausecker commented 5 days ago

I'm trying to update our FreeBSD port for Ladybird to 1d9c404b8cb898b351ee3c69840bf943e97d499c. Unfortunately, the build fails during configuration:

CMake Warning (dev) in CMakeLists.txt:                                                                                 
  No project() command is present.  The top-level CMakeLists.txt file must
  contain a literal, direct call to the project() command.  Add a line of
  code such as

    project(ProjectName)                                                                                               

  near the top of the file, but after cmake_minimum_required().      

  CMake is pretending there is a "project(Project)" command on the first
  line.         
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) in CMakeLists.txt:                                                                                                                                                                                                         
  cmake_minimum_required() should be called prior to this top-level project()
  call.  Please see the cmake-commands(7) manual for usage documentation of
  both commands.
This warning is for project developers.  Use -Wno-dev to suppress it.      

-- The C compiler identification is Clang 18.1.6
-- The CXX compiler identification is Clang 18.1.6
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at WebContent/CMakeLists.txt:1 (include):
  include could not find requested file:

    fontconfig

CMake Error at WebWorker/CMakeLists.txt:1 (include):
  include could not find requested file:

    fontconfig

CMake Error at cmake/InstallRules.cmake:36 (include):
  include could not find requested file:

    /Meta/Lagom/get_linked_lagom_libraries.cmake
Call Stack (most recent call first):
  CMakeLists.txt:159 (include)

CMake Error at cmake/InstallRules.cmake:38 (get_linked_lagom_libraries):
  Unknown CMake command "get_linked_lagom_libraries".
Call Stack (most recent call first):
  CMakeLists.txt:159 (include)                       

CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 3.30)            

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring incomplete, errors occurred!

I have no idea what the problem is. Fontconfig seems to be installed and I'm not good enough with cmake to say for sure what the right course of action is.

ADKaster commented 5 days ago

That's looking for our file fontconfig.cmake, from Meta/CMake.

the warning about no "project()" directive suggests that your previous build wasn't updated for https://github.com/LadybirdBrowser/ladybird/commit/66d91fa08cac961007322f33dd1acef80c328a22

The CMake source directory should be the top-level one, not -S Ladybird now.

ADKaster commented 5 days ago

We now (for the most part) document our dependencies in vcpkg.json https://github.com/LadybirdBrowser/ladybird/blob/541968b30dc50208f473566498100769711f10c8/vcpkg.json

You might find this mostly working flatpak build I created last week helpful if there's extra packages we're now using that need ports to FreeBSD (skia comes to mind...).

branch diff

I ended up having to manually build gn for the host, and then created some scripts to configure, build and install skia by hand based on the nixpkgs recipe that @fgaz made a while back.

ADKaster commented 5 days ago

oh right, skia isn't directly supported on FreeBSD. This issue and attached patch might be useful

https://issues.skia.org/issues/40045542

clausecker commented 5 days ago

Thank you for the comments. I did not know about these changes and will read the resources you reference.

Skia should be portable as we build it as a bundled part of Chromium. I'll look into it.