-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 proposal/7.5.1 and update recipe for conan2 #16851
Merged
+130
−91
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
98d18c0
add proposal version 7.5.1 and inverse order of versions
Jean1995 e0bfd1b
update proposal package for conan2
Jean1995 338728e
Merge branch 'master' into proposal_conan2
Jean1995 fb12d8a
fix hook errors
Jean1995 a509496
Merge branch 'proposal_conan2' of github.com:Jean1995/conan-center-in…
Jean1995 59e717e
fix wrong license path
Jean1995 78df1f2
Merge branch 'master' into proposal_conan2
Jean1995 c00a2ca
address review comments by @prince-chrismc
Jean1995 6e93a5a
Merge branch 'master' into proposal_conan2
Jean1995 d89467d
self.output.warning instead of self.output.warn
Jean1995 7b697cb
try fixing compile error of testpackage in CI by using transitive hea…
Jean1995 2515577
Merge branch 'master' into proposal_conan2
Jean1995 565ac38
Merge branch 'master' into proposal_conan2
Jean1995 6704c1a
add transitive_headers for cubicinterpolation
Jean1995 b1155ba
fix DSO missing from command line error
Jean1995 9218ba0
proposal: add comments for transitive traits, add logging to test_pac…
jcar87 f8ba957
Merge branch 'master' into proposal_conan2
Jean1995 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,43 @@ | ||
sources: | ||
"7.0.2": | ||
url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.0.2.tar.gz" | ||
sha256: "8166ffca150abce77cc4254343bb89d3476e17910e96fa4936b87dafcc72d592" | ||
"7.0.4": | ||
url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.0.4.tar.gz" | ||
sha256: "1442b9f5d8824e7794e97a2eca3f5f109e33c423a37714ada9ad98435b4d4b01" | ||
"7.0.5": | ||
url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.0.5.tar.gz" | ||
sha256: "232f84e410f439e6bc1b721fc65280906e9f6ad5b39490561870d42a1ee1af17" | ||
"7.0.7": | ||
url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.0.7.tar.gz" | ||
sha256: "e366e9280fbe99e68bc5b31a74f51610e27ca8a646dff28e883573893572ab75" | ||
"7.1.0": | ||
url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.1.0.tar.gz" | ||
sha256: "98faba7cd9d743dae2a8bec70b1c4a382339b9fa40b71fda2936c9d7054d7a85" | ||
"7.1.1": | ||
url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.1.1.tar.gz" | ||
sha256: "090e885d6f241b87a98234571cc1bd2ff935933365717e327602ea37f4d3548a" | ||
"7.2.1": | ||
url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.2.1.tar.gz" | ||
sha256: "279c1b897c8ae426a493ca77e01c8cfd47e8cd313f3e35ed3ddf098dcccdeeda" | ||
"7.3.0": | ||
url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.3.0.tar.gz" | ||
sha256: "fa3763fee656164e5f3a7d6a11f08771dd70700adb93de9db4625ad981e0defb" | ||
"7.3.1": | ||
url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.3.1.tar.gz" | ||
sha256: "260426f71226c888832a6da47c55c05dab31b8240dbbc67b4b2466af24d962d3" | ||
"7.4.0": | ||
url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.4.0.tar.gz" | ||
sha256: "34865a84052c670fbc4554361acef716655906f65f5bba88e3fd73dff92989de" | ||
"7.4.1": | ||
url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.4.1.tar.gz" | ||
sha256: "e6ff9749f402dd77f320a2a28b77a45636cbe186f926d9b5a7b54ea6ee631ada" | ||
"7.4.2": | ||
url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.4.2.tar.gz" | ||
sha256: "f0db44c96a80a6ce3dda02c598574f5f0209376bd2c6c176797710da8eb3e108" | ||
"7.5.1": | ||
url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.5.1.tar.gz" | ||
sha256: "2a283bfc335c4b6b01d2acc1eea1a5e4c456bd3dd11e41ef24ca3d955c9655a3" | ||
"7.5.0": | ||
url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.5.0.tar.gz" | ||
sha256: "ba31bd0a2337f3717a1ad88a3b3f7fefa3f1e4dae4fc922e72144cfecffe5e94" | ||
"7.4.2": | ||
url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.4.2.tar.gz" | ||
sha256: "f0db44c96a80a6ce3dda02c598574f5f0209376bd2c6c176797710da8eb3e108" | ||
"7.4.1": | ||
url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.4.1.tar.gz" | ||
sha256: "e6ff9749f402dd77f320a2a28b77a45636cbe186f926d9b5a7b54ea6ee631ada" | ||
"7.4.0": | ||
url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.4.0.tar.gz" | ||
sha256: "34865a84052c670fbc4554361acef716655906f65f5bba88e3fd73dff92989de" | ||
"7.3.1": | ||
url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.3.1.tar.gz" | ||
sha256: "260426f71226c888832a6da47c55c05dab31b8240dbbc67b4b2466af24d962d3" | ||
"7.3.0": | ||
url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.3.0.tar.gz" | ||
sha256: "fa3763fee656164e5f3a7d6a11f08771dd70700adb93de9db4625ad981e0defb" | ||
"7.2.1": | ||
url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.2.1.tar.gz" | ||
sha256: "279c1b897c8ae426a493ca77e01c8cfd47e8cd313f3e35ed3ddf098dcccdeeda" | ||
"7.1.1": | ||
url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.1.1.tar.gz" | ||
sha256: "090e885d6f241b87a98234571cc1bd2ff935933365717e327602ea37f4d3548a" | ||
"7.1.0": | ||
url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.1.0.tar.gz" | ||
sha256: "98faba7cd9d743dae2a8bec70b1c4a382339b9fa40b71fda2936c9d7054d7a85" | ||
"7.0.7": | ||
url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.0.7.tar.gz" | ||
sha256: "e366e9280fbe99e68bc5b31a74f51610e27ca8a646dff28e883573893572ab75" | ||
"7.0.5": | ||
url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.0.5.tar.gz" | ||
sha256: "232f84e410f439e6bc1b721fc65280906e9f6ad5b39490561870d42a1ee1af17" | ||
"7.0.4": | ||
url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.0.4.tar.gz" | ||
sha256: "1442b9f5d8824e7794e97a2eca3f5f109e33c423a37714ada9ad98435b4d4b01" | ||
"7.0.2": | ||
url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.0.2.tar.gz" | ||
sha256: "8166ffca150abce77cc4254343bb89d3476e17910e96fa4936b87dafcc72d592" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,21 @@ | ||
from conans import ConanFile, CMake, tools | ||
from conans.errors import ConanInvalidConfiguration | ||
import os | ||
from conan import ConanFile | ||
from conan.tools.build import check_min_cppstd | ||
from conan.tools.files import get, rmdir, copy | ||
from conan.tools.cmake import CMake, CMakeToolchain | ||
from conan.errors import ConanInvalidConfiguration | ||
from conan.tools.scm import Version | ||
from conan.tools.microsoft import is_msvc | ||
|
||
required_conan_version = ">=1.43.0" | ||
required_conan_version = ">=1.53.0" | ||
|
||
|
||
class PROPOSALConan(ConanFile): | ||
name = "proposal" | ||
homepage = "https://github.com/tudo-astroparticlephysics/PROPOSAL" | ||
license = "LGPL-3.0" | ||
exports_sources = "CMakeLists.txt" | ||
package_type = "library" | ||
url = "https://github.com/conan-io/conan-center-index" | ||
description = "monte Carlo based lepton and photon propagator" | ||
topics = ("propagator", "lepton", "photon", "stochastic") | ||
|
@@ -26,29 +32,28 @@ class PROPOSALConan(ConanFile): | |
"with_python": False, | ||
} | ||
|
||
generators = "cmake", "cmake_find_package" | ||
_cmake = None | ||
generators = "CMakeDeps" | ||
|
||
@property | ||
def _source_subfolder(self): | ||
return "source_subfolder" | ||
Comment on lines
37
to
39
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. a layout is missing, and this attribute could be removed |
||
|
||
@property | ||
def _is_msvc(self): | ||
return str(self.settings.compiler) in ["Visual Studio", "msvc"] | ||
|
||
def config_options(self): | ||
if self.settings.os == "Windows": | ||
del self.options.fPIC | ||
self.options.rm_safe("fPIC") | ||
|
||
def configure(self): | ||
if self.options.shared: | ||
del self.options.fPIC | ||
self.options.rm_safe("fPIC") | ||
|
||
def requirements(self): | ||
self.requires("cubicinterpolation/0.1.4") | ||
self.requires("spdlog/1.9.2") | ||
self.requires("nlohmann_json/3.10.5") | ||
# cubicinterpolation: headers are transitively included, and function calls are made | ||
# from implementation in headers (templates) | ||
self.requires("cubicinterpolation/0.1.4", transitive_headers=True, transitive_libs=True) | ||
# spdlog: requires transitive_libs due to direct calls to functionality from headers | ||
self.requires("spdlog/1.9.2", transitive_headers=True, transitive_libs=True) | ||
# nlohmann_json: public headers include json.hpp and json_fwd.hpp | ||
self.requires("nlohmann_json/3.10.5", transitive_headers=True) | ||
if self.options.with_python: | ||
self.requires("pybind11/2.9.1") | ||
|
||
|
@@ -57,48 +62,45 @@ def _minimum_compilers_version(self): | |
return {"Visual Studio": "15", "gcc": "5", "clang": "5", "apple-clang": "5"} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you can add |
||
|
||
def validate(self): | ||
if self._is_msvc and self.options.shared: | ||
if is_msvc(self) and self.options.shared: | ||
raise ConanInvalidConfiguration( | ||
"Can not build shared library on Visual Studio." | ||
) | ||
if self.settings.compiler.get_safe("cppstd"): | ||
tools.check_min_cppstd(self, "14") | ||
check_min_cppstd(self, "14") | ||
|
||
minimum_version = self._minimum_compilers_version.get( | ||
str(self.settings.compiler), False | ||
) | ||
if not minimum_version: | ||
self.output.warn( | ||
self.output.warning( | ||
"PROPOSAL requires C++14. Your compiler is unknown. Assuming it supports C++14." | ||
) | ||
elif tools.Version(self.settings.compiler.version) < minimum_version: | ||
elif Version(self.settings.compiler.version) < minimum_version: | ||
raise ConanInvalidConfiguration( | ||
"PROPOSAL requires gcc >= 5, clang >= 5 or Visual Studio >= 15 as a compiler!" | ||
) | ||
|
||
def source(self): | ||
tools.get(**self.conan_data["sources"][self.version], | ||
destination=self._source_subfolder, strip_root=True) | ||
|
||
def _configure_cmake(self): | ||
if self._cmake: | ||
return self._cmake | ||
self._cmake = CMake(self) | ||
self._cmake.definitions["BUILD_TESTING"] = False | ||
self._cmake.definitions["BUILD_PYTHON"] = self.options.with_python | ||
self._cmake.definitions["BUILD_DOCUMENTATION"] = False | ||
self._cmake.configure() | ||
return self._cmake | ||
get(self, **self.conan_data["sources"][self.version], strip_root=True) | ||
|
||
def build(self): | ||
cmake = self._configure_cmake() | ||
cmake = CMake(self) | ||
cmake.configure() | ||
cmake.build() | ||
|
||
def package(self): | ||
self.copy("LICENSE.md", dst="licenses", src=self._source_subfolder) | ||
cmake = self._configure_cmake() | ||
copy(self, "LICENSE.md", self.source_folder, os.path.join(self.package_folder, "licenses")) | ||
cmake = CMake(self) | ||
cmake.install() | ||
tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) | ||
rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) | ||
|
||
def generate(self): | ||
tc = CMakeToolchain(self) | ||
tc.cache_variables["BUILD_TESTING"] = False | ||
tc.cache_variables["BUILD_PYTHON"] = self.options.with_python | ||
tc.cache_variables["BUILD_DOCUMENTATION"] = False | ||
tc.generate() | ||
|
||
def package_info(self): | ||
self.cpp_info.set_property("cmake_file_name", "PROPOSAL") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,24 @@ | ||
from conans import ConanFile, CMake, tools | ||
import os | ||
|
||
from conan import ConanFile | ||
from conan.tools.build import can_run | ||
from conan.tools.cmake import CMake, cmake_layout | ||
|
||
class TestPackageConan(ConanFile): | ||
settings = "os", "arch", "compiler", "build_type" | ||
generators = "cmake", "cmake_find_package_multi" | ||
generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" | ||
|
||
def requirements(self): | ||
self.requires(self.tested_reference_str) | ||
|
||
def layout(self): | ||
cmake_layout(self) | ||
|
||
def build(self): | ||
cmake = CMake(self) | ||
cmake.configure() | ||
cmake.build() | ||
|
||
def test(self): | ||
if not tools.cross_building(self): | ||
bin_path = os.path.join("bin", "test_package") | ||
self.run(bin_path, run_environment=True) | ||
if can_run(self): | ||
bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") | ||
self.run(bin_path, env="conanrun") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
cmake_minimum_required(VERSION 3.1) | ||
project(test_package CXX) | ||
|
||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) | ||
conan_basic_setup(TARGETS) | ||
|
||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ | ||
${CMAKE_CURRENT_BINARY_DIR}/test_package/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from conans import ConanFile, CMake, tools | ||
import os | ||
|
||
|
||
class TestPackageConan(ConanFile): | ||
settings = "os", "arch", "compiler", "build_type" | ||
generators = "cmake", "cmake_find_package_multi" | ||
|
||
def build(self): | ||
cmake = CMake(self) | ||
cmake.configure() | ||
cmake.build() | ||
|
||
def test(self): | ||
if not tools.cross_building(self): | ||
bin_path = os.path.join("bin", "test_package") | ||
self.run(bin_path, run_environment=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,29 @@ | ||
versions: | ||
"7.0.2": | ||
"7.5.1": | ||
folder: all | ||
"7.0.4": | ||
"7.5.0": | ||
folder: all | ||
"7.0.5": | ||
"7.4.2": | ||
folder: all | ||
"7.0.7": | ||
"7.4.1": | ||
folder: all | ||
"7.1.0": | ||
"7.4.0": | ||
folder: all | ||
"7.1.1": | ||
"7.3.1": | ||
folder: all | ||
"7.3.0": | ||
folder: all | ||
"7.2.1": | ||
folder: all | ||
"7.3.0": | ||
"7.1.1": | ||
folder: all | ||
"7.3.1": | ||
"7.1.0": | ||
folder: all | ||
"7.4.0": | ||
"7.0.7": | ||
folder: all | ||
"7.4.1": | ||
"7.0.5": | ||
folder: all | ||
"7.4.2": | ||
"7.0.4": | ||
folder: all | ||
"7.5.0": | ||
"7.0.2": | ||
folder: all |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this file is not required anymore