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

Add boostdep/1.75.0 recipe #2096

Merged
merged 15 commits into from
Jan 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions recipes/boostdep/all/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
cmake_minimum_required(VERSION 2.8)
project(cmake_wrapper)

include(conanbuildinfo.cmake)
conan_basic_setup()

add_subdirectory(source_subfolder)
6 changes: 6 additions & 0 deletions recipes/boostdep/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -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"
58 changes: 58 additions & 0 deletions recipes/boostdep/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -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)
14 changes: 14 additions & 0 deletions recipes/boostdep/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -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)
3 changes: 3 additions & 0 deletions recipes/boostdep/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
versions:
"1.75.0":
folder: "all"