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 Jun 6, 2024
1 parent 94600fd commit 74a04a4
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
4 changes: 4 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,7 @@ jobs:
# add the -pre repo
- run: conan remote add rnd-conan-pre ${{ env.REPO_PRE }}
- run: conan remote login rnd-conan-pre ${{ vars.JFROG_USERNAME }} --password ${{ secrets.JFROG_ACCESS_TOKEN }}
# upload dbus-cxx
- run: conan create recipes/dbus-cxx/2.x.x --version 2.4.0 --build=missing
- 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
8 changes: 3 additions & 5 deletions recipes/dbus-cxx/2.x.x/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
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: "52460c2e2ef1c8f522b36d8cc9db312f98f855ff"

19 changes: 13 additions & 6 deletions recipes/dbus-cxx/2.x.x/conanfile.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down Expand Up @@ -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)
Expand All @@ -46,12 +47,16 @@ 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)
Expand Down Expand Up @@ -79,4 +84,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

0 comments on commit 74a04a4

Please sign in to comment.