From 4324da12cf8afa3f8fcee4b47968d83400eaa5db Mon Sep 17 00:00:00 2001 From: Erik Hons Date: Wed, 22 May 2024 16:42:08 -0500 Subject: [PATCH] customize dbus-cxx recipe for NI --- .github/workflows/ni_upload_to_jfrog.yml | 1 + recipes/dbus-cxx/2.x.x/conandata.yml | 7 ++----- recipes/dbus-cxx/2.x.x/conanfile.py | 24 ++++++++++++++++-------- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ni_upload_to_jfrog.yml b/.github/workflows/ni_upload_to_jfrog.yml index 36725f20e546d..806b21ed4cdbc 100644 --- a/.github/workflows/ni_upload_to_jfrog.yml +++ b/.github/workflows/ni_upload_to_jfrog.yml @@ -37,6 +37,7 @@ jobs: - run: conan export recipes/ninja/all --version 1.11.1 - run: conan export recipes/nlohmann_json/all --version 3.11.3 - run: conan export recipes/spdlog/all --version 1.14.1 + - run: conan export recipes/dbus-cxx/2.x.x --version 2.4.0 # upload everthing - run: conan upload -r rnd-conan-ci -c "*" diff --git a/recipes/dbus-cxx/2.x.x/conandata.yml b/recipes/dbus-cxx/2.x.x/conandata.yml index d70ca7b1a6c53..63c06f295485a 100644 --- a/recipes/dbus-cxx/2.x.x/conandata.yml +++ b/recipes/dbus-cxx/2.x.x/conandata.yml @@ -1,7 +1,4 @@ sources: - "2.5.1": - url: "https://github.com/dbus-cxx/dbus-cxx/archive/refs/tags/2.5.1.tar.gz" - sha256: "848467b14db37710ac3ad31cc6474b2d65b9b24e6cdcbb7e88c7637c0ad7b388" "2.4.0": - url: "https://github.com/dbus-cxx/dbus-cxx/archive/refs/tags/2.4.0.tar.gz" - sha256: "c38456ed70023d93e6e689087e4bbe030f1650bbda9de7c035d6f4ebac788379" + url: "https://github.com/ni/dbus-cxx" + sha: "b25fe20ab60e27c954f6e1217a007fbb9e612b29" diff --git a/recipes/dbus-cxx/2.x.x/conanfile.py b/recipes/dbus-cxx/2.x.x/conanfile.py index 62180204981cb..93ffb67e3368d 100644 --- a/recipes/dbus-cxx/2.x.x/conanfile.py +++ b/recipes/dbus-cxx/2.x.x/conanfile.py @@ -1,7 +1,7 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain -from conan.tools.scm import Version +from conan.tools.scm import Git, Version import conan.tools.files class DbusCXX(ConanFile): @@ -35,8 +35,9 @@ def config_options(self): del self.options.fPIC def validate(self): - if self.options.uv_support and Version(self.version) < "2.5.0": - raise ConanInvalidConfiguration("UV support requires verion >= 2.5.0") + # Our branch added libuv support in 2.4.0 so this check must + # be removed + pass def requirements(self): self.requires("libsigcpp/[^3.0.7]", transitive_headers=True) @@ -46,19 +47,24 @@ def requirements(self): self.requires("libuv/[>=1.0 <2.0]") def source(self): - conan.tools.files.get(self, **self.conan_data["sources"][self.version], strip_root=True) + git = Git(self) + git.clone(url=self.conan_data["sources"][self.version]["url"], target=".") + git.checkout(commit=self.conan_data["sources"][self.version]["sha"]) def layout(self): cmake_layout(self) - generators = "PkgConfigDeps" + # Our branch changed to find_package(). We should change back + # and drop this customization + generators = "CMakeDeps" def generate(self): tc = CMakeToolchain(self) tc.cache_variables["ENABLE_GLIB_SUPPORT"] = self.options.glib_support tc.cache_variables["ENABLE_QT_SUPPORT"] = self.options.qt_support - if Version(self.version) >= "2.5.0": - tc.cache_variables["ENABLE_UV_SUPPORT"] = self.options.uv_support + # Our branch add libuv support in 2.4.0 so this cmake variable + # must be created + tc.cache_variables["ENABLE_UV_SUPPORT"] = self.options.uv_support tc.generate() def build(self): @@ -79,4 +85,6 @@ def package_info(self): self.cpp_info.libs.append("dbus-cxx-uv") self.cpp_info.libs.append("dbus-cxx") - self.cpp_info.includedirs = ['include/dbus-cxx-2.0'] + + # Our branch drops the versioned include path. We should + # restore that and drop this customization