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

harfbuzz: add v8.3.1, drop vulnerable versions (< 7.0) #23255

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion recipes/harfbuzz/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
sources:
"9.0.0":
url: "https://github.com/harfbuzz/harfbuzz/releases/download/9.0.0/harfbuzz-9.0.0.tar.xz"
sha256: "a41b272ceeb920c57263ec851604542d9ec85ee3030506d94662067c7b6ab89e"
"8.5.0":
url: "https://github.com/harfbuzz/harfbuzz/releases/download/8.5.0/harfbuzz-8.5.0.tar.xz"
sha256: "77e4f7f98f3d86bf8788b53e6832fb96279956e1c3961988ea3d4b7ca41ddc27"
"8.3.0":
url: "https://github.com/harfbuzz/harfbuzz/releases/download/8.3.0/harfbuzz-8.3.0.tar.xz"
sha256: "109501eaeb8bde3eadb25fab4164e993fbace29c3d775bcaa1c1e58e2f15f847"
Expand Down Expand Up @@ -27,5 +33,5 @@ patches:
"5.1.0":
- patch_file: "patches/0000-fix-freetype-lookup-5.1.0.patch"
patch_type: "portability"
patch_description: "fix fretype and icu dependency lookup"
patch_description: "fix freetype and icu dependency lookup"
patch_source: "https://github.com/harfbuzz/harfbuzz/pull/3811"
68 changes: 47 additions & 21 deletions recipes/harfbuzz/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ class HarfbuzzConan(ConanFile):
"with_gdi": [True, False],
"with_uniscribe": [True, False],
"with_directwrite": [True, False],
"with_subset": [True, False],
"with_coretext": [True, False],
"with_subset": ["deprecated", True, False],
}
default_options = {
"shared": False,
Expand All @@ -45,8 +45,8 @@ class HarfbuzzConan(ConanFile):
"with_gdi": True,
"with_uniscribe": True,
"with_directwrite": False,
"with_subset": False,
"with_coretext": True,
"with_subset": "deprecated",
}

short_paths = True
Expand Down Expand Up @@ -78,6 +78,9 @@ def configure(self):
def layout(self):
basic_layout(self, src_folder="src")

def package_id(self):
self.info.with_subset = True

def requirements(self):
if self.options.with_freetype:
self.requires("freetype/2.13.2")
Expand All @@ -99,10 +102,13 @@ def validate(self):
"Linking shared glib with the MSVC static runtime is not supported"
)

if self.options.with_subset != "deprecated":
self.output.warning("The 'with_subset' option is deprecated and will be removed in a future version. It never had any effect.")

def build_requirements(self):
self.tool_requires("meson/1.4.0")
self.tool_requires("meson/[>=1.2.3 <2]")
if not self.conf.get("tools.gnu:pkg_config", check_type=str):
self.tool_requires("pkgconf/2.1.0")
self.tool_requires("pkgconf/[>=2.2 <3]")
if self.options.with_glib:
self.tool_requires("glib/<host_version>")
if self.settings.os == "Macos":
Expand Down Expand Up @@ -178,35 +184,55 @@ def package(self):

def package_info(self):
self.cpp_info.set_property("cmake_file_name", "harfbuzz")
self.cpp_info.set_property("cmake_target_name", "harfbuzz::harfbuzz")
self.cpp_info.set_property("pkg_config_name", "harfbuzz")
if self.options.with_icu:
self.cpp_info.libs.append("harfbuzz-icu")
if self.options.with_subset:
self.cpp_info.libs.append("harfbuzz-subset")
self.cpp_info.libs.append("harfbuzz")
self.cpp_info.includedirs.append(os.path.join("include", "harfbuzz"))
self.cpp_info.set_property("pkg_config_name", "_harfbuzz-do-not-use")

self.cpp_info.components["harfbuzz_"].set_property("cmake_target_name", "harfbuzz::harfbuzz")
self.cpp_info.components["harfbuzz_"].set_property("pkg_config_name", "harfbuzz")
self.cpp_info.components["harfbuzz_"].libs = ["harfbuzz"]
self.cpp_info.components["harfbuzz_"].includedirs.append(os.path.join("include", "harfbuzz"))
if self.options.with_freetype:
self.cpp_info.components["harfbuzz_"].requires.append("freetype::freetype")
if self.options.with_glib:
self.cpp_info.components["harfbuzz_"].requires.append("glib::glib-2.0")

if self.settings.os in ["Linux", "FreeBSD"]:
self.cpp_info.system_libs.append("m")
self.cpp_info.components["harfbuzz_"].system_libs.extend(["m", "pthread"])
if self.settings.os == "Windows" and not self.options.shared:
self.cpp_info.system_libs.append("user32")
self.cpp_info.components["harfbuzz_"].system_libs.append("user32")
if self.options.with_gdi or self.options.with_uniscribe:
self.cpp_info.system_libs.append("gdi32")
self.cpp_info.components["harfbuzz_"].system_libs.append("gdi32")
if self.options.with_uniscribe or self.options.with_directwrite:
self.cpp_info.system_libs.append("rpcrt4")
self.cpp_info.components["harfbuzz_"].system_libs.append("rpcrt4")
if self.options.with_uniscribe:
self.cpp_info.system_libs.append("usp10")
self.cpp_info.components["harfbuzz_"].system_libs.append("usp10")
if self.options.with_directwrite:
self.cpp_info.system_libs.append("dwrite")
self.cpp_info.components["harfbuzz_"].system_libs.append("dwrite")
if is_apple_os(self) and self.options.get_safe("with_coretext", False):
if self.settings.os == "Macos":
self.cpp_info.frameworks.append("ApplicationServices")
self.cpp_info.components["harfbuzz_"].frameworks.append("ApplicationServices")
else:
self.cpp_info.frameworks.extend(["CoreFoundation", "CoreGraphics", "CoreText"])
self.cpp_info.components["harfbuzz_"].frameworks.extend(["CoreFoundation", "CoreGraphics", "CoreText"])
if not self.options.shared:
libcxx = stdcpp_library(self)
if libcxx:
self.cpp_info.system_libs.append(libcxx)
self.cpp_info.components["harfbuzz_"].system_libs.append(libcxx)

self.cpp_info.components["subset"].set_property("cmake_target_name", "harfbuzz::subset")
self.cpp_info.components["subset"].set_property("pkg_config_name", "harfbuzz-subset")
self.cpp_info.components["subset"].libs = ["harfbuzz-subset"]
self.cpp_info.components["subset"].requires = ["harfbuzz_"]

if self.options.with_icu:
self.cpp_info.components["icu"].set_property("cmake_target_name", "harfbuzz::icu")
self.cpp_info.components["icu"].set_property("pkg_config_name", "harfbuzz-icu")
self.cpp_info.components["icu"].libs = ["harfbuzz-icu"]
self.cpp_info.components["icu"].requires = ["harfbuzz_", "icu::icu-uc"]

if self.options.with_glib:
self.cpp_info.components["gobject"].set_property("cmake_target_name", "harfbuzz::gobject")
self.cpp_info.components["gobject"].set_property("pkg_config_name", "harfbuzz-gobject")
self.cpp_info.components["gobject"].libs = ["harfbuzz-gobject"]
self.cpp_info.components["gobject"].requires = ["harfbuzz_", "glib::glib-2.0", "glib::gobject-2.0"]


def fix_msvc_libname(conanfile, remove_lib_prefix=True):
Expand Down
4 changes: 4 additions & 0 deletions recipes/harfbuzz/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
versions:
"9.0.0":
folder: all
"8.5.0":
folder: all
"8.3.0":
folder: all
"8.2.2":
Expand Down
Loading