Skip to content

Commit

Permalink
(#11375) sol2: add version 3.3.0
Browse files Browse the repository at this point in the history
* sol2: add version 3.3.0

* use lua/5.3.5 under 3.2.0
  • Loading branch information
toge authored Jun 27, 2022
1 parent bcf74c3 commit 35e66bd
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 32 deletions.
27 changes: 15 additions & 12 deletions recipes/sol2/3.x.x/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
sources:
"3.0.3":
url: "https://github.com/ThePhD/sol2/archive/v3.0.3.tar.gz"
sha256: "bf089e50387edfc70063e24fd7fbb693cceba4a50147d864fabedd1b33483582"
"3.2.0":
url: "https://github.com/ThePhD/sol2/archive/v3.2.0.tar.gz"
sha256: "733f03d82df6e0e8a15967831840d240dcb2c606982bec753bd173a9cc1b3435"
"3.2.1":
url: "https://github.com/ThePhD/sol2/archive/v3.2.1.tar.gz"
sha256: "b10f88dc1246f74a10348faef7d2c06e2784693307df74dcd87c4641cf6a6828"
"3.2.2":
url: "https://github.com/ThePhD/sol2/archive/v3.2.2.tar.gz"
sha256: "141790dae0c1821dd2dbac3595433de49ba72545845efc3ec7d88de8b0a3b2da"
"3.3.0":
url: "https://github.com/ThePhD/sol2/archive/v3.3.0.tar.gz"
sha256: "b82c5de030e18cb2bcbcefcd5f45afd526920c517a96413f0b59b4332d752a1e"
"3.2.3":
url: "https://github.com/ThePhD/sol2/archive/v3.2.3.tar.gz"
sha256: "f74158f92996f476786be9c9e83f8275129bb1da2a8d517d050421ac160a4b9e"
"3.2.2":
url: "https://github.com/ThePhD/sol2/archive/v3.2.2.tar.gz"
sha256: "141790dae0c1821dd2dbac3595433de49ba72545845efc3ec7d88de8b0a3b2da"
"3.2.1":
url: "https://github.com/ThePhD/sol2/archive/v3.2.1.tar.gz"
sha256: "b10f88dc1246f74a10348faef7d2c06e2784693307df74dcd87c4641cf6a6828"
"3.2.0":
url: "https://github.com/ThePhD/sol2/archive/v3.2.0.tar.gz"
sha256: "733f03d82df6e0e8a15967831840d240dcb2c606982bec753bd173a9cc1b3435"
"3.0.3":
url: "https://github.com/ThePhD/sol2/archive/v3.0.3.tar.gz"
sha256: "bf089e50387edfc70063e24fd7fbb693cceba4a50147d864fabedd1b33483582"
23 changes: 13 additions & 10 deletions recipes/sol2/3.x.x/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
from conans.errors import ConanInvalidConfiguration
import os

required_conan_version = ">=1.33.0"

class Sol2Conan(ConanFile):
name = "sol2"
description = "a C++ <-> Lua API wrapper with advanced features and top notch performance"
license = "MIT"
url = "https://github.com/conan-io/conan-center-index"
homepage = "https://github.com/ThePhD/sol2"
description = "C++17 Lua bindings"
topics = ("conan", "lua", "c++", "bindings")
settings = "compiler"
license = "MIT"
topics = ("lua", "c++", "bindings")
settings = "os", "arch", "compiler", "build_type"
no_copy_source = True

@property
Expand All @@ -21,12 +22,12 @@ def _source_subfolder(self):
def _compilers_minimum_version(self):
return {
"gcc": "7",
"Visual Studio": "15.7",
"Visual Studio": "15.7" if tools.Version(self.version) < "3.3.0" else "16",
"clang": "6",
"apple-clang": "10",
}

def configure(self):
def validate(self):
if self.settings.compiler.get_safe("cppstd"):
tools.check_min_cppstd(self, "17")

Expand All @@ -46,15 +47,17 @@ def lazy_lt_semver(v1, v2):
self.settings.compiler.version))

def requirements(self):
self.requires("lua/5.3.5")
if tools.Version(self.version) < "3.2.0":
self.requires("lua/5.3.5")
else:
self.requires("lua/5.4.4")

def package_id(self):
self.info.header_only()

def source(self):
tools.get(**self.conan_data["sources"][self.version])
extracted_dir = self.name + "-" + self.version
os.rename(extracted_dir, self._source_subfolder)
tools.get(**self.conan_data["sources"][self.version],
destination=self._source_subfolder, strip_root=True)

def package(self):
self.copy("LICENSE.txt", src=self._source_subfolder, dst="licenses")
Expand Down
4 changes: 2 additions & 2 deletions recipes/sol2/3.x.x/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 3.8)
project(test_package)

include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
Expand All @@ -7,5 +7,5 @@ conan_basic_setup(TARGETS)
find_package(sol2 REQUIRED CONFIG)

add_executable(${PROJECT_NAME} test_package.cpp)
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17)
target_link_libraries(${PROJECT_NAME} sol2::sol2)
4 changes: 2 additions & 2 deletions recipes/sol2/3.x.x/test_package/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


class TestPackageConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
settings = "os", "arch", "compiler", "build_type"
generators = "cmake", "cmake_find_package_multi"

def build(self):
Expand All @@ -12,6 +12,6 @@ def build(self):
cmake.build()

def test(self):
if not tools.cross_building(self.settings):
if not tools.cross_building(self):
bin_path = os.path.join("bin", "test_package")
self.run(bin_path, run_environment=True)
14 changes: 8 additions & 6 deletions recipes/sol2/config.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
versions:
"2.20.6":
folder: "2.x.x"
"3.0.3":
"3.3.0":
folder: "3.x.x"
"3.2.0":
"3.2.3":
folder: "3.x.x"
"3.2.2":
folder: "3.x.x"
"3.2.1":
folder: "3.x.x"
"3.2.2":
"3.2.0":
folder: "3.x.x"
"3.2.3":
"3.0.3":
folder: "3.x.x"
"2.20.6":
folder: "2.x.x"

0 comments on commit 35e66bd

Please sign in to comment.