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 8 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.73.0:
- url: "https://github.com/boostorg/boostdep/archive/boost-1.73.0.tar.gz"
sha256: "8fc24f1aeea725638fdeb57fa3a0fe5b941f56b73c3af309a7c316591c276658"
- url: "http://www.boost.org/LICENSE_1_0.txt"
sha256: "c9bff75738922193e67fa726fa225535870d2aa1059f91452c411736284ad566"
63 changes: 63 additions & 0 deletions recipes/boostdep/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
from conans import CMake, ConanFile, tools
from conans.errors import ConanInvalidConfiguration
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.73.0")

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.configure(build_folder=self._build_subfolder)
return self._cmake

def build(self):
if self.settings.build_type != "Release":
raise ConanInvalidConfiguration("Only Release built_type supported")
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if self.settings.build_type != "Release":
raise ConanInvalidConfiguration("Only Release built_type supported")

Is there a reason to remove Release builds? We finally decided to keep the Debug builds just in case someone wants to debug those binaries.

Copy link
Contributor Author

@madebr madebr Dec 14, 2020

Choose a reason for hiding this comment

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

No this was done just for reducing the number of builds.
I will modify the recipe to make it look like other installer recipes.

if self.settings.compiler == "Visual Studio" and self.settings.compiler.runtime != "MT":
raise ConanInvalidConfiguration("Only MT runtime supported")

cmake = self._configure_cmake()
cmake.build()

def package(self):
self.copy("LICENSE*", dst="licenses")
cmake = self._configure_cmake()
cmake.install()

def package_id(self):
del self.info.settings.compiler

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.73.0":
folder: "all"