From 0fb86d5ac7ea397145a9e315d61c9ebd30a118fb Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Wed, 6 Mar 2024 15:58:11 -0600 Subject: [PATCH 1/3] fontconfig: Remove patch for freetype libtool version number This patch is a bad workaround for improper versioning in the freetype package. This is fixed in the freetype package itself in #22974. --- recipes/fontconfig/meson/conanfile.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/recipes/fontconfig/meson/conanfile.py b/recipes/fontconfig/meson/conanfile.py index 828bf72f6aba3..d4522c5e7635d 100644 --- a/recipes/fontconfig/meson/conanfile.py +++ b/recipes/fontconfig/meson/conanfile.py @@ -3,12 +3,11 @@ from conan.tools.env import VirtualBuildEnv from conan.tools.files import ( apply_conandata_patches, copy, export_conandata_patches, get, - replace_in_file, rm, rmdir + rm, rmdir ) from conan.tools.gnu import PkgConfigDeps from conan.tools.layout import basic_layout from conan.tools.meson import Meson, MesonToolchain -from conan.tools.scm import Version import os @@ -81,9 +80,6 @@ def generate(self): def _patch_files(self): apply_conandata_patches(self) - replace_in_file(self, os.path.join(self.source_folder, "meson.build"), - "freetype_req = '>= 21.0.15'", - f"freetype_req = '{Version(self.dependencies['freetype'].ref.version)}'") def build(self): self._patch_files() From 4c0fa5a6760c95e5c757a3d41cec151b22886687 Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Wed, 13 Mar 2024 09:55:01 -0500 Subject: [PATCH 2/3] Fix missing conf fontconfig file This fixes the following error, which can be seen when running the test package: ``` Fontconfig error: Cannot load default config file: No such file: (null) ``` This is fixed by installing the fontconfig configuration file. It was being installed to the wrong location in the Meson package previously. Additionally, don't set `FONTCONFIG_FILE`, but instead append to `FONTCONFIG_PATH` only. This works and makes it easier for consumers to opt for the system font directory. See #5782. --- recipes/fontconfig/meson/conanfile.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/recipes/fontconfig/meson/conanfile.py b/recipes/fontconfig/meson/conanfile.py index d4522c5e7635d..2c7862ff4c4a7 100644 --- a/recipes/fontconfig/meson/conanfile.py +++ b/recipes/fontconfig/meson/conanfile.py @@ -74,7 +74,9 @@ def generate(self): "doc": "disabled", "nls": "disabled", "tests": "disabled", - "tools": "disabled" + "tools": "disabled", + "sysconfdir": os.path.join(self.package_folder, "res", "etc"), + "datadir": os.path.join(self.package_folder, "res", "share"), }) tc.generate() @@ -92,11 +94,9 @@ def package(self): meson = Meson(self) meson.install() rm(self, "*.pdb", self.package_folder, recursive=True) - rm(self, "*.conf", os.path.join(self.package_folder, "bin", "etc", "fonts", "conf.d")) + rm(self, "*.conf", os.path.join(self.package_folder, "res", "etc", "fonts", "conf.d")) rm(self, "*.def", os.path.join(self.package_folder, "lib")) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) - rmdir(self, os.path.join(self.package_folder, "etc")) - rmdir(self, os.path.join(self.package_folder, "share")) fix_apple_shared_install_name(self) fix_msvc_libname(self) @@ -109,16 +109,12 @@ def package_info(self): if self.settings.os in ("Linux", "FreeBSD"): self.cpp_info.system_libs.extend(["m", "pthread"]) - fontconfig_file = os.path.join(self.package_folder, "bin", "etc", "fonts", "fonts.conf") - self.runenv_info.prepend_path("FONTCONFIG_FILE", fontconfig_file) - - fontconfig_path = os.path.join(self.package_folder, "bin", "etc", "fonts") - self.runenv_info.prepend_path("FONTCONFIG_PATH", fontconfig_path) + fontconfig_path = os.path.join(self.package_folder, "res", "etc", "fonts") + self.runenv_info.append_path("FONTCONFIG_PATH", fontconfig_path) # TODO: to remove in conan v2 self.cpp_info.names["cmake_find_package"] = "Fontconfig" self.cpp_info.names["cmake_find_package_multi"] = "Fontconfig" - self.env_info.FONTCONFIG_FILE = fontconfig_file self.env_info.FONTCONFIG_PATH = fontconfig_path def fix_msvc_libname(conanfile, remove_lib_prefix=True): From 85a6b8953356c8a3712a05bddf1a7e700d374391 Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Tue, 23 Apr 2024 07:55:20 -0500 Subject: [PATCH 3/3] Use relative paths for the updated Meson generator --- recipes/fontconfig/meson/conanfile.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/recipes/fontconfig/meson/conanfile.py b/recipes/fontconfig/meson/conanfile.py index 2c7862ff4c4a7..7e8180d100b57 100644 --- a/recipes/fontconfig/meson/conanfile.py +++ b/recipes/fontconfig/meson/conanfile.py @@ -11,7 +11,7 @@ import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.64.0 <2 || >=2.2.0" class FontconfigConan(ConanFile): @@ -75,8 +75,8 @@ def generate(self): "nls": "disabled", "tests": "disabled", "tools": "disabled", - "sysconfdir": os.path.join(self.package_folder, "res", "etc"), - "datadir": os.path.join(self.package_folder, "res", "share"), + "sysconfdir": os.path.join("res", "etc"), + "datadir": os.path.join("res", "share"), }) tc.generate()