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
22 changes: 7 additions & 15 deletions recipes/fontconfig/meson/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

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(self.package_folder, "res", "etc"),
"datadir": os.path.join(self.package_folder, "res", "share"),
jwillikers marked this conversation as resolved.
Show resolved Hide resolved
})
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