Skip to content

Commit

Permalink
customize dbus-cxx recipe for NI
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikHons committed May 29, 2024
1 parent 2c59d91 commit 4db8d52
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ni_upload_to_jfrog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ jobs:
# add the -pre repo
- run: conan remote add rnd-conan-pre ${{ env.REPO_CI }}
- run: conan remote login rnd-conan-pre ${{ vars.JFROG_USERNAME }} --password ${{ secrets.JFROG_ACCESS_TOKEN }}
# upload dbus-cxx
- run: conan upload --remote rnd-conan-ci --only-recipe dbus-cxx/2.4.0
- run: conan upload --remote rnd-conan-pre --only-recipe dbus-cxx/2.4.0
5 changes: 3 additions & 2 deletions recipes/dbus-cxx/2.x.x/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
sources:
"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: "66c7d8360992fbe87e40aed6faf1a19927f79f86"

25 changes: 21 additions & 4 deletions recipes/dbus-cxx/2.x.x/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from conan import ConanFile
from conan.tools.cmake import cmake_layout, CMake
import conan.tools.files
import conan.tools.scm

class DbusCXX(ConanFile):
name = "dbus-cxx"
Expand Down Expand Up @@ -28,13 +28,24 @@ def requirements(self):
self.requires("libsigcpp/[^3.0.7]", transitive_headers=True)
self.requires("expat/[^2.5.0]")

# Our branch presumes libuv. This should be replaced by an
# option upstream eventually
self.requires("libuv/[>=1.0 <2.0]")

def source(self):
conan.tools.files.get(self, **self.conan_data["sources"][self.version], strip_root=True)
# Note: We don't use a conditional for our customization
# because Conan does not allow conditionals in the source()
# method (conan caches sources independent of the configuration).
git = conan.tools.scm.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 = "CMakeToolchain", "PkgConfigDeps"
# Our branch changed to find_package(). We should change back
# and drop this customization
generators = "CMakeToolchain", "CMakeDeps"

def build(self):
cmake = CMake(self)
Expand All @@ -46,5 +57,11 @@ def package(self):
cmake.install()

def package_info(self):
# Our branch adds the libuv integration which should be made
# an option upstream
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

0 comments on commit 4db8d52

Please sign in to comment.