Skip to content

Commit

Permalink
Merge branch 'master' into dbus-user
Browse files Browse the repository at this point in the history
  • Loading branch information
jwillikers committed Apr 8, 2024
2 parents 688735a + 66ef257 commit 983176e
Show file tree
Hide file tree
Showing 10 changed files with 577 additions and 18 deletions.
3 changes: 3 additions & 0 deletions recipes/7bitdi/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"3.1.0":
url: "https://github.com/7bitcoder/7bitDI/archive/refs/tags/v3.1.0.tar.gz"
sha256: "345bf91e2a33cfe98628cac98c75488ddd55232b8c4bcfeba9b5001fec8d4f7c"
"3.0.0":
url: "https://github.com/7bitcoder/7bitDI/archive/refs/tags/v3.0.0.tar.gz"
sha256: "aabb8e907c0cafb8e4b7c8367ed5dbb3cba2d83af090bdef9a7f855c0778c8f3"
Expand Down
2 changes: 2 additions & 0 deletions recipes/7bitdi/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"3.1.0":
folder: all
"3.0.0":
folder: all
"2.1.0":
Expand Down
53 changes: 35 additions & 18 deletions recipes/dbus/1.x.x/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@

class DbusConan(ConanFile):
name = "dbus"
license = ("AFL-2.1", "GPL-2.0-or-later")
# license is AFL-2.1 OR GPL-2.0-or-later with several other compatible licenses for smaller sections of code
license = "(AFL-2.1 OR GPL-2.0-or-later) AND DocumentRef-COPYING"
url = "https://github.com/conan-io/conan-center-index"
homepage = "https://www.freedesktop.org/wiki/Software/dbus"
description = "D-Bus is a simple system for interprocess communication and coordination."
Expand All @@ -31,7 +32,7 @@ class DbusConan(ConanFile):
"system_socket": [None, "ANY"],
"system_pid_file": [None, "ANY"],
"with_x11": [True, False],
"with_glib": [True, False],
"with_glib": ["deprecated", True, False],
"with_systemd": [True, False],
"with_selinux": [True, False],
"session_socket_dir": ["ANY"],
Expand All @@ -44,7 +45,7 @@ class DbusConan(ConanFile):
"system_socket": None,
"system_pid_file": None,
"with_x11": False,
"with_glib": False,
"with_glib": "deprecated",
"with_systemd": False,
"with_selinux": False,
"session_socket_dir": "/tmp",
Expand All @@ -60,8 +61,8 @@ def export_sources(self):
def config_options(self):
if self.settings.os not in ("Linux", "FreeBSD"):
del self.options.with_systemd
if self.settings.os not in ("Linux", "FreeBSD"):
del self.options.with_x11
del self.options.with_selinux
if self.settings.os == "Windows":
del self.options.fPIC
if not self._has_message_bus_option:
Expand All @@ -75,19 +76,23 @@ def configure(self):
if not self.options.get_safe("message_bus"):
self.options.rm_safe("dbus_user")

def package_id(self):
del self.info.options.with_glib

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

def requirements(self):
self.requires("expat/2.6.0")
if self.options.with_glib:
self.requires("glib/2.78.3")
if self.options.get_safe("with_systemd"):
self.requires("libsystemd/253.6")
if self.options.with_selinux:
self.requires("libselinux/3.3")
if self.options.get_safe("with_selinux"):
self.requires("libselinux/3.5")
if self.options.get_safe("with_x11"):
self.requires("xorg/system")
# X11 is only linked into an executable and should not be propagated as a library dependency.
# It should still be provided in a VirtualRunEnv context, though,
# but Conan as of v2.2 does not yet provide a fine-grained enough control over this.
self.requires("xorg/system", visible=False)

def package_id(self):

Check failure on line 97 in recipes/dbus/1.x.x/conanfile.py

View workflow job for this annotation

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

method already defined line 79
# The dbus_user option only effects the installation of dbus during the package method.
Expand All @@ -97,9 +102,11 @@ def package_id(self):
def validate(self):
if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < 7:
raise ConanInvalidConfiguration(f"{self.ref} requires at least gcc 7.")
if self.options.with_glib != "deprecated":
raise ConanInvalidConfiguration(f"with_glib option is deprecated and should not be used - the option had no effect.")

Check warning on line 106 in recipes/dbus/1.x.x/conanfile.py

View workflow job for this annotation

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

Using an f-string that does not have any interpolated variables

def build_requirements(self):
self.tool_requires("meson/1.3.2")
self.tool_requires("meson/1.4.0")
if not self.conf.get("tools.gnu:pkg_config",check_type=str):
self.tool_requires("pkgconf/2.1.0")

Expand All @@ -122,15 +129,15 @@ def generate(self):
tc.project_options["selinux"] = "enabled" if self.options.get_safe("with_selinux") else "disabled"
tc.project_options["session_socket_dir"] = str(self.options.get_safe("session_socket_dir", ""))
tc.project_options["systemd"] = "enabled" if self.options.get_safe("with_systemd") else "disabled"
if self.options.get_safe("with_systemd"):
tc.project_options["systemd_system_unitdir"] = "/res/lib/systemd/system"
tc.project_options["systemd_user_unitdir"] = "/res/usr/lib/systemd/system"
if self._has_message_bus_option:
tc.project_options["message_bus"] = self.options.message_bus
tc.project_options["message_bus"] = bool(self.options.message_bus)
if self.options.get_safe("dbus_user"):
tc.project_options["dbus_user"] = str(self.options.dbus_user)
tc.project_options["system_pid_file"] = str(self.options.get_safe("system_pid_file", ""))
tc.project_options["system_socket"] = str(self.options.get_safe("system_socket", ""))
if self.options.get_safe("with_systemd"):
tc.project_options["systemd_system_unitdir"] = os.path.join(self.package_folder, "lib", "systemd", "system")
tc.project_options["systemd_user_unitdir"] = os.path.join(self.package_folder, "lib", "systemd", "user")
if is_apple_os(self):
tc.project_options["launchd_agent_dir"] = os.path.join(self.package_folder, "res", "LaunchAgents")
tc.project_options["x11_autolaunch"] = "enabled" if self.options.get_safe("with_x11") else "disabled"
Expand All @@ -139,15 +146,20 @@ def generate(self):
deps = PkgConfigDeps(self)
deps.generate()

def build(self):
def _patch_sources(self):
apply_conandata_patches(self)
replace_in_file(self, os.path.join(self.source_folder, "meson.build"), "subdir('test')", "# subdir('test')")
replace_in_file(self, os.path.join(self.source_folder, "meson.build"),
"subdir('test')", "# subdir('test')")

def build(self):
self._patch_sources()
meson = Meson(self)
meson.configure()
meson.build()

def package(self):
copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses"))
copy(self, "COPYING", self.source_folder, os.path.join(self.package_folder, "licenses"))
copy(self, "*", os.path.join(self.source_folder, "LICENSES"), os.path.join(self.package_folder, "licenses"))
meson = Meson(self)
meson.install()

Expand All @@ -156,7 +168,6 @@ def package(self):

rmdir(self, os.path.join(self.package_folder, "lib", "cmake"))
rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig"))
rmdir(self, os.path.join(self.package_folder, "lib", "systemd"))
fix_apple_shared_install_name(self)
if self.settings.os == "Windows" and not self.options.shared:
rename(self, os.path.join(self.package_folder, "lib", "libdbus-1.a"), os.path.join(self.package_folder, "lib", "dbus-1.lib"))
Expand Down Expand Up @@ -202,6 +213,12 @@ def package_info(self):
if not self.options.shared:
self.cpp_info.defines.append("DBUS_STATIC_BUILD")

self.cpp_info.requires.append("expat::expat")
if self.options.get_safe("with_systemd"):
self.cpp_info.requires.append("libsystemd::libsystemd")
if self.options.get_safe("with_selinux"):
self.cpp_info.requires.append("libselinux::selinux")

# TODO: to remove in conan v2 once cmake_find_package_* & pkg_config generators removed
self.cpp_info.filenames["cmake_find_package"] = "DBus1"
self.cpp_info.filenames["cmake_find_package_multi"] = "DBus1"
Expand Down
3 changes: 3 additions & 0 deletions recipes/mbits-utfconv/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"1.0.4":
url: "https://github.com/mbits-libs/utfconv/archive/v1.0.4.tar.gz"
sha256: "cd4b6cbed75d67a02399add312b93c4c1de9ac53cf33a8bf44baece038fabb60"
"1.0.3":
url: "https://github.com/mbits-libs/utfconv/archive/v1.0.3.tar.gz"
sha256: "2077e3dcb999dc76d2bdc06cc141b38e10f15762975c261f72cc1a8c2519a27a"
2 changes: 2 additions & 0 deletions recipes/mbits-utfconv/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
versions:
"1.0.4":
folder: all
"1.0.3":
folder: all
7 changes: 7 additions & 0 deletions recipes/openimageio/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ sources:
"2.5.9.0":
url: "https://github.com/AcademySoftwareFoundation/OpenImageIO/archive/refs/tags/v2.5.9.0.tar.gz"
sha256: "b6a68e369bc475525eb843bdc0cb8adc910cc71000825f8db9b5e136166cdc78"
"2.5.10.1":
url: "https://github.com/AcademySoftwareFoundation/OpenImageIO/archive/refs/tags/v2.5.10.1.tar.gz"
sha256: "8f6a547f6a5d510737ba436f867043db537def65f0fdb14ec30e5a185b619f93"
patches:
"2.4.7.1":
- patch_file: "patches/2.4.7.1-cmake-targets.patch"
Expand All @@ -31,3 +34,7 @@ patches:
- patch_file: "patches/2.5.9.0-cmake-targets.patch"
patch_description: "Ensure project builds correctly with Conan (don't pick up disabled dependencies from the system, fix different spelling of libraries)"
patch_type: "conan"
"2.5.10.1":
- patch_file: "patches/2.5.10.1-cmake-targets.patch"
patch_description: "Ensure project builds correctly with Conan (don't pick up disabled dependencies from the system, fix different spelling of libraries)"
patch_type: "conan"
Loading

0 comments on commit 983176e

Please sign in to comment.