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

objectbox: add version 4.0.0 #24042

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions recipes/objectbox/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"4.0.0":
url: "https://github.com/objectbox/objectbox-c/archive/refs/tags/v4.0.0.tar.gz"
sha256: "1cd1f0633290395a7cacace484485197562f38ec85ac6cc3b3a1bceae430c615"
# The release tarball is invalid, so we need to get the tarball from the v0.20.0 commit.
# https://github.com/objectbox/objectbox-c/issues/38
"0.21.0":
Expand All @@ -20,6 +23,10 @@ sources:
url: "https://github.com/objectbox/objectbox-c/archive/refs/tags/v0.17.0.tar.gz"
sha256: "3b936b3352ae0c8ea3706cc0a1790d2714a415cdce16007c2caca367ead5af8d"
patches:
"4.0.0":
- patch_file: "patches/0.21.0-0001-fix-cmake.patch"
patch_description: "add sync option, disable tests/examples, support max length of windows path"
patch_type: "conan"
"0.21.0":
- patch_file: "patches/0.21.0-0001-fix-cmake.patch"
patch_description: "add sync option, disable tests/examples, support max length of windows path"
Expand Down
12 changes: 12 additions & 0 deletions recipes/objectbox/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout
from conan.tools.scm import Version
import os
import platform

required_conan_version = ">=1.53.0"

Expand Down Expand Up @@ -34,6 +35,8 @@ def validate(self):
if Version(self.version) >= "0.19.0" and \
self.settings.compiler == "gcc" and Version(self.settings.compiler.version) <= "5":
raise ConanInvalidConfiguration(f"{self.ref} requires GCC 6 or higher")
if Version(self.version) >= "4.0.0" and self._is_glibc_older_than_2_27_on_linux:
raise ConanInvalidConfiguration(f"{self.ref} requires glibc>=2.27")

def source(self):
get(self, **self.conan_data["sources"][self.version], strip_root=True)
Expand Down Expand Up @@ -62,3 +65,12 @@ def package_info(self):
self.cpp_info.system_libs.extend(["m", "pthread"])
if Version(self.version) >= "0.18.0":
self.cpp_info.system_libs.append("dl")

@property
def _is_glibc_older_than_2_27_on_linux(self):
libver = platform.libc_ver()
return (
self.settings.os == 'Linux' and
libver[0] == 'glibc' and
Version(libver[1]) < '2.27'
)
2 changes: 2 additions & 0 deletions recipes/objectbox/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"4.0.0":
folder: all
"0.21.0":
folder: all
"0.20.0":
Expand Down