From 32930d7bd48ee1d559accc787915ad8f23a8abb2 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Mon, 3 Dec 2018 17:52:53 -0200 Subject: #187 Add Conan recipe - Add generic Conan recipe Signed-off-by: Uilian Ries --- conanfile.py | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 conanfile.py diff --git a/conanfile.py b/conanfile.py new file mode 100644 index 00000000..18b3aab2 --- /dev/null +++ b/conanfile.py @@ -0,0 +1,78 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +from conans.model.version import Version + + +class AbseilConan(ConanFile): + name = "abseil" + url = "https://github.com/abseil/abseil-cpp" + homepage = url + author = "Ashley Hedberg " + description = "Abseil Common Libraries (C++) from Google" + license = "Apache-2.0" + exports = ["LICENSE"] + exports_sources = ["CMakeLists.txt", "CMake/*", "absl/*"] + generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + requires = "cctz/2.2@bincrafters/stable" + + def configure(self): + if self.settings.os == "Windows" and \ + self.settings.compiler == "Visual Studio" and \ + Version(self.settings.compiler.version.value) < "14": + raise ConanInvalidConfiguration("Abseil does not support MSVC < 14") + + def build(self): + tools.replace_in_file("CMakeLists.txt", "project(absl)", "project(absl)\ninclude(conanbuildinfo.cmake)\nconan_basic_setup()") + cmake = CMake(self) + cmake.definitions["BUILD_TESTING"] = False + cmake.configure() + cmake.build() + + def package(self): + self.copy("LICENSE", dst="licenses") + self.copy("*.h", dst="include", src="absl") + self.copy("*.inc", dst="include", src="absl") + self.copy("*.a", dst="lib", src=".", keep_path=False) + self.copy("*.lib", dst="lib", src=".", keep_path=False) + + def package_info(self): + self.cpp_info.libs = ["absl_base", + "absl_synchronization", + "absl_strings", + "absl_symbolize", + "absl_malloc_internal", + "absl_time", + "absl_strings", + "absl_base", + "absl_dynamic_annotations", + "absl_spinlock_wait", + "absl_throw_delegate", + "absl_stacktrace", + "absl_int128", + "absl_span", + "test_instance_tracker_lib", + "absl_stack_consumption", + "absl_bad_any_cast", + "absl_hash", + "str_format_extension_internal", + "absl_failure_signal_handler", + "absl_str_format", + "absl_numeric", + "absl_any", + "absl_optional", + "absl_container", + "absl_debugging", + "absl_memory", + "absl_leak_check", + "absl_meta", + "absl_utility", + "str_format_internal", + "absl_variant", + "absl_examine_stack", + "absl_bad_optional_access", + "absl_algorithm"] + if self.settings.os == "Linux": + self.cpp_info.libs.append("pthread") -- cgit v1.2.3 From db6a73681472820e3d7295b24ca89dc69407306e Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Tue, 4 Dec 2018 14:41:28 -0200 Subject: #187 Remove cctz as external dependency - CCTZ was embedded in absl/time/internal Signed-off-by: Uilian Ries --- conanfile.py | 1 - 1 file changed, 1 deletion(-) diff --git a/conanfile.py b/conanfile.py index 18b3aab2..6ac48705 100644 --- a/conanfile.py +++ b/conanfile.py @@ -16,7 +16,6 @@ class AbseilConan(ConanFile): exports_sources = ["CMakeLists.txt", "CMake/*", "absl/*"] generators = "cmake" settings = "os", "arch", "compiler", "build_type" - requires = "cctz/2.2@bincrafters/stable" def configure(self): if self.settings.os == "Windows" and \ -- cgit v1.2.3 From 1aa550f840f52296b7ca14e19bc33618ed7d6e5a Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Thu, 13 Dec 2018 08:33:39 -0200 Subject: #187 Add Conan topics Signed-off-by: Uilian Ries --- conanfile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/conanfile.py b/conanfile.py index 6ac48705..ba774be4 100644 --- a/conanfile.py +++ b/conanfile.py @@ -12,6 +12,7 @@ class AbseilConan(ConanFile): author = "Ashley Hedberg " description = "Abseil Common Libraries (C++) from Google" license = "Apache-2.0" + topics = ("conan", "abseil", "abseil-cpp", "google", "common-libraries") exports = ["LICENSE"] exports_sources = ["CMakeLists.txt", "CMake/*", "absl/*"] generators = "cmake" -- cgit v1.2.3 From 325cf0d872bf6fba94e6be56b5926abeaaf61e78 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Thu, 20 Dec 2018 09:41:53 -0200 Subject: #187 Update Conan author Signed-off-by: Uilian Ries --- conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conanfile.py b/conanfile.py index ba774be4..77304769 100644 --- a/conanfile.py +++ b/conanfile.py @@ -9,7 +9,7 @@ class AbseilConan(ConanFile): name = "abseil" url = "https://github.com/abseil/abseil-cpp" homepage = url - author = "Ashley Hedberg " + author = "Abseil " description = "Abseil Common Libraries (C++) from Google" license = "Apache-2.0" topics = ("conan", "abseil", "abseil-cpp", "google", "common-libraries") -- cgit v1.2.3 From e41b5b1c8a9b20e89bde00fe388e8c7b74cfa229 Mon Sep 17 00:00:00 2001 From: ahedberg Date: Thu, 20 Dec 2018 13:51:25 -0500 Subject: Add note at top that this is supported best-effort --- conanfile.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/conanfile.py b/conanfile.py index 77304769..d8307b45 100644 --- a/conanfile.py +++ b/conanfile.py @@ -1,5 +1,10 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- + +# Note: Conan is supported on a best-effort basis. Abseil doesn't use Conan +# internally, so we won't know if it stops working. We may ask community +# members to help us debug any problems that arise. + from conans import ConanFile, CMake, tools from conans.errors import ConanInvalidConfiguration from conans.model.version import Version -- cgit v1.2.3