diff --git a/recipes/gtk/all/conandata.yml b/recipes/gtk/all/conandata.yml index 2fd377b60695c..5b31961c644ed 100644 --- a/recipes/gtk/all/conandata.yml +++ b/recipes/gtk/all/conandata.yml @@ -1,41 +1,13 @@ sources: + "4.14.3": + url: "https://download.gnome.org/sources/gtk/4.14/gtk-4.14.3.tar.xz" + sha256: "2be5c858bdef1104d37848c9779c089372c8d31503f6efc4b94e53b546fc9a43" "4.7.0": - sha256: "913fcd9d065efb348723e18c3b9113e23b92072e927ebd2f61d32745c8228b94" url: "https://download.gnome.org/sources/gtk/4.7/gtk-4.7.0.tar.xz" - "4.6.2": - url: "https://download.gnome.org/sources/gtk/4.6/gtk-4.6.2.tar.xz" - sha256: "ff263af609a50eb76056653592d929459aef4819a444c436f6d52c6f63c1faec" - "4.4.0": - url: "https://download.gnome.org/sources/gtk/4.4/gtk-4.4.0.tar.xz" - sha256: "e0a1508f441686c3a20dfec48af533b19a4b2e017c18eaee31dccdb7d292505b" - "4.3.2": - url: "https://download.gnome.org/sources/gtk/4.3/gtk-4.3.2.tar.xz" - sha256: "20639bb2be8b9f58304f14480e3d957abd2c9fa3f671bb7e05193f9a8389d93f" - "4.2.1": - url: "https://download.gnome.org/sources/gtk/4.2/gtk-4.2.1.tar.xz" - sha256: "023169775de43f0a1fde066fbc19d78545ea6a7562c1915abde9b8ae4a7309e6" - "4.1.2": - url: "https://download.gnome.org/sources/gtk/4.1/gtk-4.1.2.tar.xz" - sha256: "33407da437c5e5ac09e7a463ba3bd025da3d80ba1953b8bbe2bce97dd2609677" - "4.0.2": - url: "https://download.gnome.org/sources/gtk/4.0/gtk-4.0.2.tar.xz" - sha256: "626707ac6751426ed76fed49c5b2d052dfee45757ce3827088ba87ca7f1dbc84" + sha256: "913fcd9d065efb348723e18c3b9113e23b92072e927ebd2f61d32745c8228b94" + "3.24.41": + url: "https://download.gnome.org/sources/gtk+/3.24/gtk+-3.24.41.tar.xz" + sha256: "47da61487af3087a94bc49296fd025ca0bc02f96ef06c556e7c8988bd651b6fa" "3.24.24": url: "https://download.gnome.org/sources/gtk+/3.24/gtk+-3.24.24.tar.xz" sha256: "cc9d4367c55b724832f6b09ab85481738ea456871f0381768a6a99335a98378a" -patches: - "4.4.0": - - patch_file: "patches/0001-fix-UAC-manifest-rc.patch" - base_path: "source_subfolder" - - patch_file: "patches/0002-fix-version-resource-for-Windows-11-sdk.patch" - base_path: "source_subfolder" - "4.3.2": - - patch_file: "patches/0001-fix-UAC-manifest-rc.patch" - base_path: "source_subfolder" - - patch_file: "patches/0002-fix-version-resource-for-Windows-11-sdk.patch" - base_path: "source_subfolder" - "4.2.1": - - patch_file: "patches/0001-fix-UAC-manifest-rc.patch" - base_path: "source_subfolder" - - patch_file: "patches/0002-fix-version-resource-for-Windows-11-sdk.patch" - base_path: "source_subfolder" diff --git a/recipes/gtk/all/conanfile.py b/recipes/gtk/all/conanfile.py index 3d742625f585d..50b01213cfd77 100644 --- a/recipes/gtk/all/conanfile.py +++ b/recipes/gtk/all/conanfile.py @@ -1,19 +1,26 @@ -from conans import ConanFile, Meson, tools -from conans.errors import ConanInvalidConfiguration import os -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import copy, get, replace_in_file, rm, rmdir +from conan.tools.gnu import PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.meson import MesonToolchain, Meson +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version + +required_conan_version = ">=1.56.0 <2 || >=2.0.6" class GtkConan(ConanFile): name = "gtk" description = "libraries used for creating graphical user interfaces for applications." - topics = ("gtk", "widgets") + license = "LGPL-2.1-or-later" url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.gtk.org" - license = "LGPL-2.1-or-later" - generators = "pkg_config" - + topics = "widgets" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -24,8 +31,8 @@ class GtkConan(ConanFile): "with_ffmpeg": [True, False], "with_gstreamer": [True, False], "with_cups": [True, False], - "with_cloudprint": [True, False] - } + "with_cloudprint": [True, False], + } default_options = { "shared": False, "fPIC": True, @@ -35,30 +42,16 @@ class GtkConan(ConanFile): "with_ffmpeg": False, "with_gstreamer": False, "with_cups": False, - "with_cloudprint": False + "with_cloudprint": False, } - short_paths = True - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - @property def _gtk4(self): - return tools.Version("4.0.0") <= tools.Version(self.version) < tools.Version("5.0.0") + return Version(self.version).major == 4 @property def _gtk3(self): - return tools.Version("3.0.0") <= tools.Version(self.version) < tools.Version("4.0.0") - - def export_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + return Version(self.version).major == 3 def config_options(self): if self.settings.os == "Windows": @@ -67,138 +60,139 @@ def config_options(self): self.options["gdk-pixbuf"].shared = True # Fix segmentation fault self.options["cairo"].shared = True - if tools.Version(self.version) >= "4.1.0": + if self._gtk4: # The upstream meson file does not create a static library # See https://github.com/GNOME/gtk/commit/14f0a0addb9a195bad2f8651f93b95450b186bd6 self.options.shared = True - if self.settings.os != "Linux": - del self.options.with_wayland - del self.options.with_x11 - - def validate(self): - if self.settings.compiler == "gcc" and tools.Version(self.settings.compiler.version) < "5": - raise ConanInvalidConfiguration("this recipes does not support GCC before version 5. contributions are welcome") - if str(self.settings.compiler) in ["Visual Studio", "msvc"]: - if tools.Version(self.version) < "4.2": - raise ConanInvalidConfiguration("MSVC support of this recipe requires at least gtk/4.2") - if not self.options["gdk-pixbuf"].shared: - raise ConanInvalidConfiguration("MSVC build requires shared gdk-pixbuf") - if not self.options["cairo"].shared: - raise ConanInvalidConfiguration("MSVC build requires shared cairo") - if tools.Version(self.version) >= "4.1.0": - if not self.options.shared: - raise ConanInvalidConfiguration("gtk supports only shared since 4.1.0") + if self.settings.os not in ["Linux", "FreeBSD"]: + self.options.rm_safe("with_wayland") + self.options.rm_safe("with_x11") def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd - if self.settings.os == "Linux": + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + if self.settings.os in ["Linux", "FreeBSD"]: if self.options.with_wayland or self.options.with_x11: if not self.options.with_pango: raise ConanInvalidConfiguration("with_pango option is mandatory when with_wayland or with_x11 is used") - def build_requirements(self): - self.build_requires("meson/0.62.2") - if self._gtk4: - self.build_requires("libxml2/2.9.14") # for xmllint - self.build_requires("pkgconf/1.7.4") - if self._gtk4: - self.build_requires("sassc/3.6.2") + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): - self.requires("gdk-pixbuf/2.42.6") - self.requires("glib/2.73.0") - if self._gtk4 or self.settings.compiler != "Visual Studio": - self.requires("cairo/1.17.4") + # INFO: https://gitlab.gnome.org/GNOME/gtk/-/blob/4.10.0/gdk/gdktypes.h?ref_type=tags#L34-38 + self.requires("glib/2.78.3", transitive_headers=True, transitive_libs=True) + # INFO: https://gitlab.gnome.org/GNOME/gtk/-/blob/4.10.0/gdk/gdkpixbuf.h?ref_type=tags#L32-33 + # Note: gdkpixbuf.h is deprecated in newer versions + self.requires("gdk-pixbuf/2.42.10", transitive_headers=True, transitive_libs=True) + if self._gtk4 or not is_msvc(self): + self.requires("cairo/1.18.0", transitive_headers=True, transitive_libs=True) if self._gtk4: - self.requires("graphene/1.10.8") - self.requires("fribidi/1.0.12") - self.requires("libpng/1.6.37") - self.requires("libtiff/4.3.0") - self.requires("libjpeg/9d") - if self.settings.os == "Linux": - if self._gtk4: - self.requires("xkbcommon/1.4.1") - if self._gtk3: - self.requires("at-spi2-atk/2.38.0") + # INFO: https://gitlab.gnome.org/GNOME/gtk/-/blob/4.10.0/gsk/gsktypes.h#L25 + self.requires("graphene/1.10.8", transitive_headers=True, transitive_libs=True) + self.requires("fribidi/1.0.13") + self.requires("libpng/[>=1.6 <2]") + self.requires("libtiff/4.6.0") + self.requires("libjpeg/9e") + if Version(self.version) >= "4.13.2": + self.requires("libdrm/2.4.120") + if self.settings.os in ["Linux", "FreeBSD"]: + if self._gtk4 or self.options.with_wayland: + self.requires("xkbcommon/1.6.0") if self.options.with_wayland: - if self._gtk3: - self.requires("xkbcommon/1.4.1") - self.requires("wayland/1.20.0") + self.requires("wayland/1.22.0") + self.requires("wayland-protocols/1.33") if self.options.with_x11: - self.requires("xorg/system") + # https://gitlab.gnome.org/GNOME/gtk/-/blob/4.10.0/gdk/x11/gdkx11display.h#L35-36 + self.requires("xorg/system", transitive_headers=True, transitive_libs=True) if self._gtk3: - self.requires("atk/2.38.0") + # https://gitlab.gnome.org/GNOME/gtk/-/blob/3.24.37/gtk/gtkwidget.h?ref_type=tags#L36 + self.requires("at-spi2-core/2.51.0", transitive_headers=True, transitive_libs=True) self.requires("libepoxy/1.5.10") if self.options.with_pango: - self.requires("pango/1.50.7") + self.requires("pango/1.51.0", transitive_headers=True, transitive_libs=True) if self.options.with_ffmpeg: - self.requires("ffmpeg/5.0") + self.requires("ffmpeg/6.1") if self.options.with_gstreamer: - self.requires("gstreamer/1.19.2") + self.requires("gstreamer/1.22.6") + self.requires("fontconfig/2.15.0", override=True) - def source(self): - tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + def validate(self): + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "5": + raise ConanInvalidConfiguration("this recipes does not support GCC before version 5. contributions are welcome") + if is_msvc(self): + if Version(self.version) < "4.2": + raise ConanInvalidConfiguration("MSVC support of this recipe requires at least gtk/4.2") + if not self.dependencies["gdk-pixbuf"].options.shared: + raise ConanInvalidConfiguration("MSVC build requires shared gdk-pixbuf") + if not self.dependencies["cairo"].options.shared: + raise ConanInvalidConfiguration("MSVC build requires shared cairo") + if self._gtk4 and not self.options.shared: + raise ConanInvalidConfiguration("gtk supports only shared since 4.1.0") - def _configure_meson(self): - meson = Meson(self) - defs = {} - if self.settings.os == "Linux": - defs["wayland_backend" if self._gtk3 else "wayland-backend"] = "true" if self.options.with_wayland else "false" - defs["x11_backend" if self._gtk3 else "x11-backend"] = "true" if self.options.with_x11 else "false" - defs["introspection"] = "false" if self._gtk3 else "disabled" - defs["gtk_doc"] = "false" - defs["man-pages" if self._gtk4 else "man"] = "false" - defs["tests" if self._gtk3 else "build-tests"] = "false" - defs["examples" if self._gtk3 else "build-examples"] = "false" - defs["demos"] = "false" - defs["datadir"] = os.path.join(self.package_folder, "res", "share") - defs["localedir"] = os.path.join(self.package_folder, "res", "share", "locale") - defs["sysconfdir"] = os.path.join(self.package_folder, "res", "etc") - + def build_requirements(self): + self.tool_requires("meson/1.4.0") + self.tool_requires("glib/") if self._gtk4: - enabled_disabled = lambda opt : "enabled" if opt else "disabled" - defs["media-ffmpeg"] = enabled_disabled(self.options.with_ffmpeg) - defs["media-gstreamer"] = enabled_disabled(self.options.with_gstreamer) - defs["print-cups"] = enabled_disabled(self.options.with_cups) - if tools.Version(self.version) < "4.3.2": - defs["print-cloudprint"] = enabled_disabled(self.options.with_cloudprint) - args=[] - args.append("--wrap-mode=nofallback") - meson.configure(defs=defs, build_folder=self._build_subfolder, source_folder=self._source_subfolder, pkg_config_paths=[self.install_folder], args=args) - return meson + self.tool_requires("libxml2/[>=2.12.5 <3]") # for xmllint + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/2.2.0") + if self._gtk4: + self.tool_requires("sassc/3.6.2") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + VirtualBuildEnv(self).generate() + # Required for glib-compile-resources + VirtualRunEnv(self).generate(scope="build") + + tc = MesonToolchain(self) + if self.settings.os in ["Linux", "FreeBSD"]: + tc.project_options["wayland_backend" if self._gtk3 else "wayland-backend"] = "true" if self.options.with_wayland else "false" + tc.project_options["x11_backend" if self._gtk3 else "x11-backend"] = "true" if self.options.with_x11 else "false" + tc.project_options["introspection"] = "false" if self._gtk3 else "disabled" + tc.project_options["gtk_doc"] = "false" + tc.project_options["man-pages" if self._gtk4 else "man"] = "false" + tc.project_options["tests" if self._gtk3 else "build-tests"] = "false" + tc.project_options["examples" if self._gtk3 else "build-examples"] = "false" + tc.project_options["demos"] = "false" + tc.project_options["datadir"] = os.path.join(self.package_folder, "res", "share") + tc.project_options["localedir"] = os.path.join(self.package_folder, "res", "share", "locale") + tc.project_options["sysconfdir"] = os.path.join(self.package_folder, "res", "etc") + if self._gtk4: + enabled_disabled = lambda opt: "enabled" if opt else "disabled" + tc.project_options["media-ffmpeg"] = enabled_disabled(self.options.with_ffmpeg) + tc.project_options["media-gstreamer"] = enabled_disabled(self.options.with_gstreamer) + tc.project_options["print-cups"] = enabled_disabled(self.options.with_cups) + tc.generate() + + tc = PkgConfigDeps(self) + tc.generate() + + def _patch_sources(self): + if "4.6.2" <= Version(self.version) < "4.9.2": + replace_in_file(self, os.path.join(self.source_folder, "meson.build"), "dependency(is_msvc_like ? ", "dependency(false ? ") def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - if self._gtk3: - tools.replace_in_file(os.path.join(self._source_subfolder, "meson.build"), "\ntest(\n", "\nfalse and test(\n") - if "4.2.0" <= tools.Version(self.version) < "4.6.1": - tools.replace_in_file(os.path.join(self._source_subfolder, "meson.build"), - "gtk_update_icon_cache: true", - "gtk_update_icon_cache: false") - if "4.6.2" <= tools.Version(self.version): - tools.replace_in_file(os.path.join(self._source_subfolder, "meson.build"), - "dependency(is_msvc_like ? ", - "dependency(false ? ") - with tools.environment_append(tools.RunEnvironment(self).vars): - meson = self._configure_meson() - meson.build() + self._patch_sources() + meson = Meson(self) + meson.configure() + # args = ["--wrap-mode=nofallback"] + meson.build() def package(self): - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) - meson = self._configure_meson() - with tools.environment_append({ - "PKG_CONFIG_PATH": self.install_folder, - "PATH": [os.path.join(self.package_folder, "bin")]}): - meson.install() - - self.copy(pattern="COPYING", src=self._source_subfolder, dst="licenses") - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.remove_files_by_mask(os.path.join(self.package_folder, "bin"), "*.pdb") - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.pdb") + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + meson = Meson(self) + meson.install() + + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin"), recursive=True) + rm(self, "*.pdb", os.path.join(self.package_folder, "lib"), recursive=True) def package_info(self): if self._gtk3: @@ -208,35 +202,35 @@ def package_info(self): if self.options.with_pango: self.cpp_info.components["gdk-3.0"].requires.extend(["pango::pango_", "pango::pangocairo"]) self.cpp_info.components["gdk-3.0"].requires.append("gdk-pixbuf::gdk-pixbuf") - if self.settings.compiler != "Visual Studio": + if not is_msvc(self): self.cpp_info.components["gdk-3.0"].requires.extend(["cairo::cairo", "cairo::cairo-gobject"]) - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["gdk-3.0"].requires.extend(["glib::gio-unix-2.0", "cairo::cairo-xlib"]) if self.options.with_x11: self.cpp_info.components["gdk-3.0"].requires.append("xorg::xorg") self.cpp_info.components["gdk-3.0"].requires.append("libepoxy::libepoxy") - self.cpp_info.components["gdk-3.0"].names["pkg_config"] = "gdk-3.0" + self.cpp_info.components["gdk-3.0"].set_property("pkg_config_name", "gdk-3.0") self.cpp_info.components["gtk+-3.0"].libs = ["gtk-3"] - self.cpp_info.components["gtk+-3.0"].requires = ["gdk-3.0", "atk::atk"] - if self.settings.compiler != "Visual Studio": + self.cpp_info.components["gtk+-3.0"].requires = ["gdk-3.0", "at-spi2-core::at-spi2-core"] + if not is_msvc(self): self.cpp_info.components["gtk+-3.0"].requires.extend(["cairo::cairo", "cairo::cairo-gobject"]) self.cpp_info.components["gtk+-3.0"].requires.extend(["gdk-pixbuf::gdk-pixbuf", "glib::gio-2.0"]) - if self.settings.os == "Linux": - self.cpp_info.components["gtk+-3.0"].requires.append("at-spi2-atk::at-spi2-atk") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["gtk+-3.0"].requires.append("at-spi2-core::at-spi2-core") self.cpp_info.components["gtk+-3.0"].requires.append("libepoxy::libepoxy") if self.options.with_pango: - self.cpp_info.components["gtk+-3.0"].requires.append('pango::pangoft2') - if self.settings.os == "Linux": + self.cpp_info.components["gtk+-3.0"].requires.append("pango::pangoft2") + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["gtk+-3.0"].requires.append("glib::gio-unix-2.0") self.cpp_info.components["gtk+-3.0"].includedirs = [os.path.join("include", "gtk-3.0")] - self.cpp_info.components["gtk+-3.0"].names["pkg_config"] = "gtk+-3.0" + self.cpp_info.components["gtk+-3.0"].set_property("pkg_config_name", "gtk+-3.0") self.cpp_info.components["gail-3.0"].libs = ["gailutil-3"] - self.cpp_info.components["gail-3.0"].requires = ["gtk+-3.0", "atk::atk"] + self.cpp_info.components["gail-3.0"].requires = ["gtk+-3.0", "at-spi2-core::at-spi2-core"] self.cpp_info.components["gail-3.0"].includedirs = [os.path.join("include", "gail-3.0")] - self.cpp_info.components["gail-3.0"].names["pkg_config"] = "gail-3.0" + self.cpp_info.components["gail-3.0"].set_property("pkg_config_name", "gail-3.0") elif self._gtk4: - self.cpp_info.names["pkg_config"] = "gtk4" + self.cpp_info.set_property("pkg_config_name", "gtk4") self.cpp_info.libs = ["gtk-4"] self.cpp_info.includedirs.append(os.path.join("include", "gtk-4.0")) diff --git a/recipes/gtk/all/patches/0001-fix-UAC-manifest-rc.patch b/recipes/gtk/all/patches/0001-fix-UAC-manifest-rc.patch deleted file mode 100644 index 7994c91a214fc..0000000000000 --- a/recipes/gtk/all/patches/0001-fix-UAC-manifest-rc.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 53705a537c1aa51ffbecfaaf685501b9ea1cb6ba Mon Sep 17 00:00:00 2001 -From: Chun-wei Fan -Date: Wed, 13 Oct 2021 12:17:44 +0800 -Subject: [PATCH] tools/generate-uac-manifest.py: Fix UAC manifest .rc - -The resource compiler in the Windows 11 SDK does not allow one to include -winuser.h directly in resource scripts (.rc) with a rather cryptic error -message, so fix generating the .rc file to embed the UAC manifest by including -windows.h with WIN32_LEAN_AND_MEAN instead. ---- - tools/generate-uac-manifest.py | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/tools/generate-uac-manifest.py b/tools/generate-uac-manifest.py -index ede6ba5044..62f063a8bb 100644 ---- a/tools/generate-uac-manifest.py -+++ b/tools/generate-uac-manifest.py -@@ -24,7 +24,7 @@ def main(): - help='require admin access to application') - parser.add_argument('--input-resource-file', dest='resource', - default=None, -- help='existing .rc file to embed UAC manifest (do not generate a new .rc file), must have included winuser.h in it') -+ help='existing .rc file to embed UAC manifest (do not generate a new .rc file), must have included windows.h in it') - parser.add_argument('--output-dir', dest='outdir', - default=None, - help='directory to output resulting files') -@@ -92,7 +92,8 @@ def write_rc_file(name, resource, outdir): - - if resource is None: - outfile = open(output_file_base_name + '.rc', 'w+') -- outfile.write('#include ') -+ outfile.write('#define WIN32_LEAN_AND_MEAN\n') -+ outfile.write('#include \n') - else: - if resource != output_file_base_name + '.rc': - outfile = open(output_file_base_name + '.rc', 'w+') diff --git a/recipes/gtk/all/patches/0002-fix-version-resource-for-Windows-11-sdk.patch b/recipes/gtk/all/patches/0002-fix-version-resource-for-Windows-11-sdk.patch deleted file mode 100644 index 5233563a36001..0000000000000 --- a/recipes/gtk/all/patches/0002-fix-version-resource-for-Windows-11-sdk.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 3481ebdafb474ce7e312914e998e7212ecdbc5ba Mon Sep 17 00:00:00 2001 -From: Chun-wei Fan -Date: Wed, 13 Oct 2021 12:16:06 +0800 -Subject: [PATCH] gtk: Fix version resource on for Windows 11 SDK - -The rc.exe that comes with the Windows 11 SDK does not allow one to include -winuser.h directly in the .rc scripts, so make sure that it is not included -by gtk-win32.rc.body.in, but instead include windows.h with WIN32_LEAN_AND_MEAN -defined. ---- - gtk/gtk-win32.rc.body.in | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/gtk/gtk-win32.rc.body.in b/gtk/gtk-win32.rc.body.in -index b876a6ddf5..fc2dfd2ed3 100644 ---- a/gtk/gtk-win32.rc.body.in -+++ b/gtk/gtk-win32.rc.body.in -@@ -1,5 +1,5 @@ --#include --#include -+#define WIN32_LEAN_AND_MEAN -+#include - - GTK_ICON ICON "gtk.ico" - diff --git a/recipes/gtk/all/test_package/CMakeLists.txt b/recipes/gtk/all/test_package/CMakeLists.txt index afa2476357074..ca70b7a50a865 100644 --- a/recipes/gtk/all/test_package/CMakeLists.txt +++ b/recipes/gtk/all/test_package/CMakeLists.txt @@ -1,9 +1,7 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(gtk REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE gtk::gtk) diff --git a/recipes/gtk/all/test_package/conanfile.py b/recipes/gtk/all/test_package/conanfile.py index d4128b0450777..ef5d7042163ec 100644 --- a/recipes/gtk/all/test_package/conanfile.py +++ b/recipes/gtk/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/gtk/all/test_v1_package/CMakeLists.txt b/recipes/gtk/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/gtk/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/gtk/all/test_v1_package/conanfile.py b/recipes/gtk/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/gtk/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/gtk/config.yml b/recipes/gtk/config.yml index d1ce9d2211eee..1f8cb4b2de6fe 100644 --- a/recipes/gtk/config.yml +++ b/recipes/gtk/config.yml @@ -1,19 +1,11 @@ versions: - "system": - folder: "system" - "4.7.0": - folder: all - "4.6.2": - folder: all - "4.4.0": - folder: all - "4.3.2": - folder: all - "4.2.1": - folder: all - "4.1.2": - folder: all - "4.0.2": - folder: all - "3.24.24": - folder: all + "system": + folder: "system" + "4.14.3": + folder: all + "4.7.0": + folder: all + "3.24.41": + folder: all + "3.24.24": + folder: all