Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fontconfig: Remove patch for freetype libtool version number #23010

Merged
Merged
24 changes: 8 additions & 16 deletions recipes/fontconfig/meson/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@
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

required_conan_version = ">=1.53.0"
required_conan_version = ">=1.64.0 <2 || >=2.2.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jwillikers Why was this massive bump to the required Conan version necessary?

Related to conan-io/conan#16140



class FontconfigConan(ConanFile):
Expand Down Expand Up @@ -75,15 +74,14 @@ def generate(self):
"doc": "disabled",
"nls": "disabled",
"tests": "disabled",
"tools": "disabled"
"tools": "disabled",
"sysconfdir": os.path.join("res", "etc"),
"datadir": os.path.join("res", "share"),
})
tc.generate()

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()
Expand All @@ -96,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)

Expand All @@ -113,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):
Expand Down