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

pango: add v1.54.0, enable libxft, freetype and fontconfig by default, add introspection support #25092

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
2fdb14d
pango: Fix some component requires
jwillikers Mar 4, 2024
56f69b8
Bump fontconfig to fix dependency conflict in libxft
jwillikers Mar 4, 2024
2a780ff
Merge branch 'master' into pango-fix-component-requires
jwillikers Apr 11, 2024
4a536d9
Merge branch 'master' into pango-fix-component-requires
jwillikers Apr 11, 2024
5d3dfe2
Add missing comma
jwillikers Apr 11, 2024
a66a1a3
Merge branch 'master' into pango-fix-component-requires
jwillikers Apr 17, 2024
926775e
Merge branch 'master' into pango-fix-component-requires
jwillikers Jul 11, 2024
31280ca
pango: add v1.54.0
valgur Aug 29, 2024
6677318
pango: use version ranges for meson and pkgconf
valgur Aug 31, 2024
efd04f8
pango: improve with_xft handling
valgur Aug 29, 2024
4f4a792
pango: enable freetype and fontconfig by default
valgur Aug 31, 2024
f9f2c5a
pango: add introspection support
valgur Aug 30, 2024
3e73368
Merge remote-tracking branch 'upstream/master' into update/pango
valgur Sep 2, 2024
cc62568
Merge remote-tracking branch 'jwillikers/pango-fix-component-requires…
valgur Sep 2, 2024
d8d21a4
Merge branch 'master' into update/pango
ErniGH Sep 3, 2024
94316e2
pango: revert propagation of option values to cairo
valgur Sep 4, 2024
095e8a8
Fix some issues in the recipe after inspecting meson.build
AbrilRBS Sep 18, 2024
3a0c96d
Try to solve Windows compilation issues
AbrilRBS Sep 20, 2024
3a44373
pango: add URLs to meson.build references in comments
valgur Sep 20, 2024
58cea0d
Add missing freetype requirement on pango, this might be overlinking …
AbrilRBS Sep 20, 2024
3bfc3eb
Merge branch 'master' into update/pango
AbrilRBS Sep 20, 2024
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
3 changes: 3 additions & 0 deletions recipes/pango/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"1.54.0":
url: "https://download.gnome.org/sources/pango/1.54/pango-1.54.0.tar.xz"
sha256: "8a9eed75021ee734d7fc0fdf3a65c3bba51dfefe4ae51a9b414a60c70b2d1ed8"
"1.51.0":
url: "https://download.gnome.org/sources/pango/1.51/pango-1.51.0.tar.xz"
sha256: "74efc109ae6f903bbe6af77eaa2ac6094b8ee245a2e23f132a7a8f0862d1a9f5"
Expand Down
92 changes: 53 additions & 39 deletions recipes/pango/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,50 +31,48 @@
"with_xft": [True, False],
"with_freetype": [True, False],
"with_fontconfig": [True, False],
"with_introspection": [True, False],
}
default_options = {
"shared": False,
"fPIC": True,
"with_libthai": False,
"with_cairo": True,
"with_xft": False,
"with_freetype": False,
"with_fontconfig": False,
"with_xft": True,
"with_freetype": True,
"with_fontconfig": True,
"with_introspection": False,
}

def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC

if self.settings.os in ["FreeBSD", "Linux"]:
self.options.with_xft = True
if not self.settings.os in ["Macos", "Windows"]:
self.options.with_freetype = True
self.options.with_fontconfig = True
if self.settings.os not in ["FreeBSD", "Linux"]:
del self.options.with_xft
if self.settings.os in ["Macos", "Windows"]:
self.options.with_freetype = False
self.options.with_fontconfig = False

def configure(self):
if self.options.shared:
self.options.rm_safe("fPIC")
self.settings.rm_safe("compiler.libcxx")
self.settings.rm_safe("compiler.cppstd")
self.options["cairo"].with_freetype = self.options.with_freetype
self.options["cairo"].with_fontconfig = self.options.with_fontconfig
valgur marked this conversation as resolved.
Show resolved Hide resolved

def layout(self):
basic_layout(self, src_folder="src")

def requirements(self):
if self.options.with_freetype:
self.requires("freetype/2.13.2")

if self.options.with_fontconfig:
self.requires("fontconfig/2.15.0")
if self.options.with_xft:
if self.options.get_safe("with_xft"):
self.requires("libxft/2.3.8")
if (
self.options.with_xft
and self.options.with_fontconfig
and self.options.with_freetype
):
self.requires("xorg/system") # for xorg::xrender
if self.options.with_fontconfig and self.options.with_freetype:
self.requires("xorg/system") # for xorg::xrender
if self.options.with_cairo:
# "pango/pangocairo.h" includes "cairo.h"
self.requires("cairo/1.18.0", transitive_headers=True)
Expand All @@ -89,13 +87,10 @@
and Version(self.settings.compiler.version) < "5"
):
raise ConanInvalidConfiguration(f"{self.name} does not support GCC before version 5. Contributions are welcome.")
if self.options.with_xft and not self.settings.os in ["Linux", "FreeBSD"]:
raise ConanInvalidConfiguration("Xft can only be used on Linux and FreeBSD")

if self.options.with_xft and (
not self.options.with_freetype or not self.options.with_fontconfig
):
raise ConanInvalidConfiguration("Xft requires freetype and fontconfig")
if self.options.get_safe("with_xft"):
if not self.options.with_freetype or not self.options.with_fontconfig:
raise ConanInvalidConfiguration("Xft requires freetype and fontconfig")

Check warning on line 93 in recipes/pango/all/conanfile.py

View workflow job for this annotation

GitHub Actions / Lint changed conanfile.py (v2 migration)

Bad indentation. Found 15 spaces, expected 16

if self.dependencies["glib"].options.shared and is_msvc_static_runtime(self):
raise ConanInvalidConfiguration(
Expand All @@ -118,25 +113,32 @@

def build_requirements(self):
self.tool_requires("glib/<host_version>")
self.tool_requires("meson/1.4.0")
self.tool_requires("meson/[>=1.2.3 <2]")
if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str):
self.tool_requires("pkgconf/2.1.0")
self.tool_requires("pkgconf/[>=2.2 <3]")
if self.options.with_introspection:
self.tool_requires("gobject-introspection/1.78.1")

def source(self):
get(self, **self.conan_data["sources"][self.version], strip_root=True)

def generate(self):
virtual_build_env = VirtualBuildEnv(self)
virtual_build_env.generate()
pkg_config_deps = PkgConfigDeps(self)
pkg_config_deps.generate()
VirtualBuildEnv(self).generate()

deps = PkgConfigDeps(self)
if self.options.with_introspection:
# gnome.generate_gir() in Meson looks for gobject-introspection-1.0.pc
deps.build_context_activated = ["gobject-introspection"]
deps.generate()

enabled_disabled = lambda opt: "enabled" if opt else "disabled"
tc = MesonToolchain(self)
tc.project_options["introspection"] = "disabled"
tc.project_options["libthai"] = "enabled" if self.options.with_libthai else "disabled"
tc.project_options["cairo"] = "enabled" if self.options.with_cairo else "disabled"
tc.project_options["xft"] = "enabled" if self.options.with_xft else "disabled"
tc.project_options["fontconfig"] = "enabled" if self.options.with_fontconfig else "disabled"
tc.project_options["freetype"] = "enabled" if self.options.with_freetype else "disabled"
tc.project_options["introspection"] = enabled_disabled(self.options.with_introspection)
tc.project_options["libthai"] = enabled_disabled(self.options.with_libthai)
tc.project_options["cairo"] = enabled_disabled(self.options.with_cairo)
tc.project_options["xft"] = enabled_disabled(self.options.get_safe("with_xft"))
tc.project_options["fontconfig"] = enabled_disabled(self.options.with_fontconfig)
tc.project_options["freetype"] = enabled_disabled(self.options.with_freetype)
tc.generate()

def build(self):
Expand Down Expand Up @@ -164,6 +166,9 @@
self._fix_library_names(os.path.join(self.package_folder, "lib"))
rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig"))
rm(self, "*.pdb", self.package_folder, recursive=True)
if self.options.with_introspection:
os.rename(os.path.join(self.package_folder, "share"),
os.path.join(self.package_folder, "res"))

def package_info(self):
self.cpp_info.components["pango_"].libs = ["pango-1.0"]
Expand All @@ -178,7 +183,7 @@
if self.options.with_fontconfig:
self.cpp_info.components["pango_"].requires.append("fontconfig::fontconfig")

if self.options.with_xft:
if self.options.get_safe("with_xft"):
self.cpp_info.components["pango_"].requires.append("libxft::libxft")
# Pango only uses xrender when Xft, fontconfig and freetype are enabled
if self.options.with_fontconfig and self.options.with_freetype:
Expand All @@ -189,28 +194,37 @@
os.path.join(self.package_folder, "include", "pango-1.0")
]

if self.options.with_introspection:
self.cpp_info.components["pango_"].resdirs = ["res"]
self.buildenv_info.append_path("GI_GIR_PATH", os.path.join(self.package_folder, "res", "gir-1.0"))
self.buildenv_info.append_path("GI_TYPELIB_PATH", os.path.join(self.package_folder, "lib", "girepository-1.0"))
self.env_info.GI_GIR_PATH.append(os.path.join(self.package_folder, "res", "gir-1.0"))
self.env_info.GI_TYPELIB_PATH.append(os.path.join(self.package_folder, "lib", "girepository-1.0"))

if self.options.with_freetype:
self.cpp_info.components["pangoft2"].libs = ["pangoft2-1.0"]
self.cpp_info.components["pangoft2"].set_property("pkg_config_name", "pangoft2")
self.cpp_info.components["pangoft2"].requires = [
"pango_",
"freetype::freetype",
]
if self.options.with_fontconfig:
self.cpp_info.components["pangoft2"].requires.append("fontconfig::fontconfig")
self.cpp_info.components["pangoft2"].includedirs = [
os.path.join(self.package_folder, "include", "pango-1.0")
]

if self.options.with_fontconfig:
self.cpp_info.components["pangofc"].set_property("pkg_config_name", "pangofc")
if self.options.with_freetype:
self.cpp_info.components["pangofc"].requires = ["pangoft2"]
self.cpp_info.components["pangofc"].requires = ["freetype::freetype", "harfbuzz::harfbuzz", "pangoft2"]

if self.settings.os != "Windows":
self.cpp_info.components["pangoroot"].set_property("pkg_config_name", "pangoroot")
if self.options.with_freetype:
self.cpp_info.components["pangoroot"].requires = ["pangoft2"]

if self.options.with_xft:
if self.options.get_safe("with_xft"):
self.cpp_info.components["pangoxft"].libs = ["pangoxft-1.0"]
self.cpp_info.components["pangoxft"].set_property("pkg_config_name", "pangoxft")
self.cpp_info.components["pangoxft"].requires = ["pango_", "pangoft2"]
Expand All @@ -231,7 +245,7 @@
self.cpp_info.components["pangocairo"].set_property("pkg_config_name", "pangocairo")
self.cpp_info.components["pangocairo"].requires = ["pango_"]
if self.options.with_freetype:
self.cpp_info.components["pangocairo"].requires.append("pangoft2")
self.cpp_info.components["pangocairo"].requires.extend(["cairo::cairo_", "freetype::freetype", "pangoft2"])
if self.settings.os == "Windows":
self.cpp_info.components["pangocairo"].requires.append("pangowin32")
self.cpp_info.components["pangocairo"].system_libs.append("gdi32")
Expand Down
2 changes: 2 additions & 0 deletions recipes/pango/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"1.54.0":
folder: all
"1.51.0":
folder: all
"1.50.14":
Expand Down
Loading