Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sdbus-cpp/0.8.3 #4148

Merged
merged 3 commits into from
Jan 19, 2021
Merged

sdbus-cpp/0.8.3 #4148

merged 3 commits into from
Jan 19, 2021

Conversation

bobrofon
Copy link
Contributor

@bobrofon bobrofon commented Jan 7, 2021

Specify library name and version: sdbus-cpp/0.8.3

  • I've read the guidelines for contributing.
  • I've followed the PEP8 style guides for Python code in the recipes.
  • I've used the latest Conan client version.
  • I've tried at least one configuration locally with the
    conan-center hook activated.

tools.check_min_cppstd(self, "17")

def build_requirements(self):
self.build_requires("cmake/3.19.1")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We usually don't require CMake as this is one of very few dependencies we pre-require. Exceptions can be made when the CMake version required is very recent or only supports a specific old versions or something like that.

This projects seems to be fine with CMake >= 3.13.0 so I would argue that it should be removed here

https://github.com/Kistler-Group/sdbus-cpp/blob/d6fdacafbe5e490d540956fe78f8df808723f49e/CMakeLists.txt#L5

@conan-center-bot
Copy link
Collaborator

Failure in build 1 (53d7b452dffe018b62ea6741359ea52d4f097c2f):

  • sdbus-cpp/0.8.3:
    • Zero packages generated. Looks like all configurations have been discarded by ConanInvalidConfiguration exceptions

@conan-center-bot
Copy link
Collaborator

Failure in build 2 (1cc1fb3e2339de44e4998031f6cde4feb97f0ee6):

  • sdbus-cpp/0.8.3:
    • Zero packages generated. Looks like all configurations have been discarded by ConanInvalidConfiguration exceptions

raise ConanInvalidConfiguration("Only Linux supported")
if self.options.shared:
del self.options.fPIC
tools.check_min_cppstd(self, "17")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs an if check and some boilerplate

You can copy this conan-io/conan#8002 (comment)

self._cmake.definitions["BUILD_TESTS"] = False
self._cmake.definitions["BUILD_LIBSYSTEMD"] = False
self._cmake.configure(source_folder=self._source_subfolder,
build_folder=self._build_subfolder)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like you are missing the cmake wrapper which is required to inject the right flags

conan_basic_setup()

add_executable(example example.cpp)
target_link_libraries(example ${CONAN_LIBS})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to test the cmake components you added

@conan-center-bot
Copy link
Collaborator

All green in build 3 (898c3397faa6d4e311c083ae5ec094de73f2285b)! 😊

recipes/sdbus-cpp/all/conanfile.py Show resolved Hide resolved
Comment on lines 49 to 53
def configure(self):
if self.settings.os != "Linux":
raise ConanInvalidConfiguration("Only Linux supported")
if self.options.shared:
del self.options.fPIC
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def configure(self):
if self.settings.os != "Linux":
raise ConanInvalidConfiguration("Only Linux supported")
if self.options.shared:
del self.options.fPIC
def configure(self):
if self.options.shared:
del self.options.fPIC
def validate(self):
if self.settings.os != "Linux":
raise ConanInvalidConfiguration("Only Linux supported")

https://blog.conan.io/2020/12/14/New-conan-release-1-32.html

self._cmake.configure()
return self._cmake

def fix_tools_cmake(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def fix_tools_cmake(self):
def _patch_sources(self):

Any custom method should be declared as protected to avoid future name collisions.

_patch_sources is no official name or a pattern, but it's the most popular in CCI.

Comment on lines 104 to 106
# FIXME: remove after
# https://github.com/Kistler-Group/sdbus-cpp/pull/136
self.fix_tools_cmake()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# FIXME: remove after
# https://github.com/Kistler-Group/sdbus-cpp/pull/136
self.fix_tools_cmake()
# FIXME: remove after https://github.com/Kistler-Group/sdbus-cpp/pull/136
self._patch_sources()

Try to keep fixme, todo, xxx as single line. It's printed as warning on output, it's easier to be visualized.

self.cpp_info.components["sdbus-c++"].names["cmake_find_package_multi"] = "sdbus-c++"
self.cpp_info.components["sdbus-c++"].names["pkg_config"] = "sdbus-c++"
if self.options.with_code_gen:
bin_path = os.path.join(self.package_folder, "bin")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
bin_path = os.path.join(self.package_folder, "bin")
bin_path = os.path.join(self.package_folder, "bin")
self.output.info("Appending PATH env var with : {}".format(bin_path))

That's a common pattern when adding something to PATH.

@conan-center-bot
Copy link
Collaborator

All green in build 4 (679335ebbb17345f1fc65d474766c50d7c84afec)! 😊

prince-chrismc
prince-chrismc previously approved these changes Jan 8, 2021
@conan-center-bot conan-center-bot merged commit 1589128 into conan-io:master Jan 19, 2021
@bobrofon bobrofon deleted the sdbus-cpp/0.8.3 branch January 25, 2021 05:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants