From 1300210a24cee1ee7b4c04414216fe548dd90251 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Sat, 9 Jan 2021 21:31:46 +0100 Subject: [PATCH] (#2096) Add boostdep/1.75.0 recipe * Add boostdep/1.73.0 recipe * boostdep: download + install boost license * boostdep: use requires instead of build_requires for boost * boostdep: only allow MT+Release and discard compiler.version * boostdep: remove settings.compiler in package_id * boostdep: lower required boost version * boostdep: even lower required boost version * boostdep: bump required boost version Co-authored-by: Uilian Ries * Revert "boostdep: bump required boost version" This reverts commit 374e7502d9ab4e26e0645017f63297230f1b3249. * boostdep: update to boostdep/1.74.0 * boostdep: fix on MSVC with static boost * boostdep: bump boost dependency to 1.74.0 * boostdep: bump to boostdep/1.75.0 * boostdep: don't raise Error on non-release builds * boostdep: bump version of boost dependency Co-authored-by: Uilian Ries --- recipes/boostdep/all/CMakeLists.txt | 7 +++ recipes/boostdep/all/conandata.yml | 6 ++ recipes/boostdep/all/conanfile.py | 58 +++++++++++++++++++ .../boostdep/all/test_package/conanfile.py | 14 +++++ recipes/boostdep/config.yml | 3 + 5 files changed, 88 insertions(+) create mode 100644 recipes/boostdep/all/CMakeLists.txt create mode 100644 recipes/boostdep/all/conandata.yml create mode 100644 recipes/boostdep/all/conanfile.py create mode 100644 recipes/boostdep/all/test_package/conanfile.py create mode 100644 recipes/boostdep/config.yml diff --git a/recipes/boostdep/all/CMakeLists.txt b/recipes/boostdep/all/CMakeLists.txt new file mode 100644 index 0000000000000..3b49576743c54 --- /dev/null +++ b/recipes/boostdep/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.8) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory(source_subfolder) diff --git a/recipes/boostdep/all/conandata.yml b/recipes/boostdep/all/conandata.yml new file mode 100644 index 0000000000000..3831a32bc89c9 --- /dev/null +++ b/recipes/boostdep/all/conandata.yml @@ -0,0 +1,6 @@ +sources: + 1.75.0: + - url: "https://github.com/boostorg/boostdep/archive/boost-1.75.0.tar.gz" + sha256: "7eecd835eb5b0fd602ff3615a6b663b45917689386d11073d961b86710f428af" + - url: "http://www.boost.org/LICENSE_1_0.txt" + sha256: "c9bff75738922193e67fa726fa225535870d2aa1059f91452c411736284ad566" diff --git a/recipes/boostdep/all/conanfile.py b/recipes/boostdep/all/conanfile.py new file mode 100644 index 0000000000000..cdbf9e9013088 --- /dev/null +++ b/recipes/boostdep/all/conanfile.py @@ -0,0 +1,58 @@ +from conans import CMake, ConanFile, tools +import os + + +class BoostDepConan(ConanFile): + name = "boostdep" + settings = "os", "arch", "compiler", "build_type" + description = "A tool to create Boost module dependency reports" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/boostorg/boostdep" + license = "BSL-1.0" + topics = ("conan", "boostdep", "dependency", "tree") + exports_sources = "CMakeLists.txt" + generators = "cmake" + + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def requirements(self): + self.requires("boost/1.75.0") + + def package_id(self): + del self.info.settings.compiler + + def source(self): + tools.get(**self.conan_data["sources"][self.version][0]) + os.rename("boostdep-boost-{}".format(self.version), self._source_subfolder) + license_info = self.conan_data["sources"][self.version][1] + tools.download(filename=os.path.basename(license_info["url"]), **license_info) + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.definitions["Boost_USE_STATIC_LIBS"] = not self.options["boost"].shared + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE*", dst="licenses") + cmake = self._configure_cmake() + cmake.install() + + def package_info(self): + bin_path = os.path.join(self.package_folder, "bin") + self.output.info("Appending PATH environment variable: {}".format(bin_path)) + self.deps_env_info.PATH.append(bin_path) diff --git a/recipes/boostdep/all/test_package/conanfile.py b/recipes/boostdep/all/test_package/conanfile.py new file mode 100644 index 0000000000000..58fd1c28454f1 --- /dev/null +++ b/recipes/boostdep/all/test_package/conanfile.py @@ -0,0 +1,14 @@ +from conans import ConanFile, tools +import os + + +class DefaultNameConan(ConanFile): + settings = "os", "compiler", "arch", "build_type" + + def test(self): + if tools.cross_building(self.settings): + return + tools.mkdir("libs") + tools.save("Jamroot", "") + with tools.environment_append({"BOOST_ROOT": self.build_folder}): + self.run("boostdep --list-modules", run_environment=True) diff --git a/recipes/boostdep/config.yml b/recipes/boostdep/config.yml new file mode 100644 index 0000000000000..640761587c2ae --- /dev/null +++ b/recipes/boostdep/config.yml @@ -0,0 +1,3 @@ +versions: + "1.75.0": + folder: "all"