Skip to content

Commit

Permalink
Merge branch 'master' of github.com:conan-io/conan-center-index into …
Browse files Browse the repository at this point in the history
…develop
  • Loading branch information
datalogics-devauto committed Apr 29, 2023
2 parents bc36145 + 2646a69 commit 38cbc12
Show file tree
Hide file tree
Showing 93 changed files with 1,515 additions and 890 deletions.
1 change: 1 addition & 0 deletions .c3i/authorized_users.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1128,3 +1128,4 @@ authorized_users:
- silvergasp
- doocman
- gouarin
- gegles
3 changes: 3 additions & 0 deletions recipes/arduinojson/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"6.21.2":
url: "https://github.com/bblanchon/ArduinoJson/releases/download/v6.21.2/ArduinoJson-v6.21.2.zip"
sha256: "1dc888061f6e7828f7a0a4e71bf059796e5ce202ce6ddb4e3a2e384d32b5cba0"
"6.21.0":
url: "https://github.com/bblanchon/ArduinoJson/releases/download/v6.21.0/ArduinoJson-v6.21.0.zip"
sha256: "08f7cad5fca2393c40fcb479c43235a2fa7da1a40331377ddf617eda2f123583"
Expand Down
20 changes: 19 additions & 1 deletion recipes/arduinojson/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from conan.tools.layout import basic_layout
from conan.tools.scm import Version
from conan.tools.build import check_min_cppstd
from conan.errors import ConanInvalidConfiguration
import os
import textwrap

Expand All @@ -16,12 +17,29 @@ class ArduinojsonConan(ConanFile):
topics = ("json", "arduino", "iot", "embedded", "esp8266")
license = "MIT"
url = "https://github.com/conan-io/conan-center-index"
package_type = "header-library"
settings = "os", "arch", "compiler", "build_type"
no_copy_source = True

@property
def _compilers_minimum_version(self):
return {
"Visual Studio": "16",
"msvc": "192",
"gcc": "6",
"clang": "6",
}

def validate(self):
if Version(self.version) >= "6.21.0":
check_min_cppstd(self, 11)
if self.settings.compiler.get_safe("cppstd"):
check_min_cppstd(self, 11)
elif str(self.settings.compiler) == 'apple-clang':
raise ConanInvalidConfiguration("cppstd needs to be set on apple-clang to activate c++11.")
else:
minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False)
if minimum_version and Version(self.settings.compiler.version) < minimum_version:
raise ConanInvalidConfiguration(f"{self.ref} requires C++11, which your compiler does not support.")

def package_id(self):
self.info.clear()
Expand Down
2 changes: 2 additions & 0 deletions recipes/arduinojson/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"6.21.2":
folder: all
"6.21.0":
folder: all
"6.20.1":
Expand Down
8 changes: 4 additions & 4 deletions recipes/armadillo/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def validate(self):
)

for opt in deprecated_opts:
self.output.warn(
self.output.warning(
f"DEPRECATION NOTICE: Value {opt} uses armadillo's default dependency search and will be replaced when this package becomes available in ConanCenter"
)

Expand All @@ -165,10 +165,10 @@ def requirements(self):

if self.options.use_hdf5:
# Use the conan dependency if the system lib isn't being used
self.requires("hdf5/1.12.0")
self.requires("hdf5/1.14.0")

if self.options.use_blas == "openblas":
self.requires("openblas/0.3.15")
self.requires("openblas/0.3.20")
# Note that if you're relying on this to build LAPACK, you _must_ have
# a fortran compiler installed. If you don't, OpenBLAS will build successfully but
# without LAPACK support, which isn't obvious.
Expand All @@ -187,7 +187,7 @@ def requirements(self):
self.options.use_blas == "intel_mkl"
or self.options.use_lapack == "intel_mkl"
):
self.output.warn(
self.output.warning(
"The intel-mkl package does not exist in CCI. To use an Intel MKL package, override this requirement with your own recipe."
)
self.requires("intel-mkl/2021.4")
Expand Down
63 changes: 36 additions & 27 deletions recipes/aws-checksums/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
from conan import ConanFile
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
from conan.tools.files import apply_conandata_patches, export_conandata_patches, copy, get, rmdir
from conan.tools.files import apply_conandata_patches, export_conandata_patches, copy, get, rmdir, save
import os
import textwrap

required_conan_version = ">=1.53.0"

required_conan_version = ">=1.52.0"

class AwsChecksums(ConanFile):
name = "aws-checksums"
description = (
"Cross-Platform HW accelerated CRC32c and CRC32 with fallback to efficient "
"SW implementations. C interface with language bindings for each of our SDKs."
)
license = "Apache-2.0",
license = "Apache-2.0"
url = "https://github.com/conan-io/conan-center-index"
homepage = "https://github.com/awslabs/aws-checksums"
topics = ("aws", "checksum", )
package_type = "library"
settings = "os", "arch", "compiler", "build_type"
options = {
"shared": [True, False],
Expand All @@ -34,18 +37,9 @@ def config_options(self):

def configure(self):
if self.options.shared:
try:
del self.options.fPIC
except Exception:
pass
try:
del self.settings.compiler.libcxx
except Exception:
pass
try:
del self.settings.compiler.cppstd
except Exception:
pass
self.options.rm_safe("fPIC")
self.settings.rm_safe("compiler.cppstd")
self.settings.rm_safe("compiler.libcxx")

def layout(self):
cmake_layout(self, src_folder="src")
Expand All @@ -54,8 +48,7 @@ def requirements(self):
self.requires("aws-c-common/0.8.2")

def source(self):
get(self, **self.conan_data["sources"][self.version],
destination=self.source_folder, strip_root=True)
get(self, **self.conan_data["sources"][self.version], strip_root=True)

def generate(self):
tc = CMakeToolchain(self)
Expand All @@ -76,18 +69,34 @@ def package(self):
cmake.install()
rmdir(self, os.path.join(self.package_folder, "lib", "aws-checksums"))

# TODO: to remove in conan v2 once legacy generators removed
self._create_cmake_module_alias_targets(
os.path.join(self.package_folder, self._module_file_rel_path),
{"AWS::aws-checksums": "aws-checksums::aws-checksums"}
)

def _create_cmake_module_alias_targets(self, module_file, targets):
content = ""
for alias, aliased in targets.items():
content += textwrap.dedent(f"""\
if(TARGET {aliased} AND NOT TARGET {alias})
add_library({alias} INTERFACE IMPORTED)
set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased})
endif()
""")
save(self, module_file, content)

@property
def _module_file_rel_path(self):
return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake")

def package_info(self):
self.cpp_info.set_property("cmake_file_name", "aws-checksums")
self.cpp_info.set_property("cmake_target_name", "AWS::aws-checksums")
# TODO: back to global scope in conan v2 once cmake_find_package* generators removed
self.cpp_info.components["aws-checksums-lib"].libs = ["aws-checksums"]
self.cpp_info.libs = ["aws-checksums"]
if self.options.shared:
self.cpp_info.defines.append("AWS_CHECKSUMS_USE_IMPORT_EXPORT")

# TODO: to remove in conan v2 once cmake_find_package* generators removed
self.cpp_info.filenames["cmake_find_package"] = "aws-checksums"
self.cpp_info.filenames["cmake_find_package_multi"] = "aws-checksums"
self.cpp_info.names["cmake_find_package"] = "AWS"
self.cpp_info.names["cmake_find_package_multi"] = "AWS"
self.cpp_info.components["aws-checksums-lib"].names["cmake_find_package"] = "aws-checksums"
self.cpp_info.components["aws-checksums-lib"].names["cmake_find_package_multi"] = "aws-checksums"
self.cpp_info.components["aws-checksums-lib"].set_property("cmake_target_name", "AWS::aws-checksums")
self.cpp_info.components["aws-checksums-lib"].requires = ["aws-c-common::aws-c-common-lib"]
self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path]
self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path]
8 changes: 3 additions & 5 deletions recipes/aws-checksums/all/test_v1_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
cmake_minimum_required(VERSION 3.1)
project(test_package LANGUAGES C)
project(test_package)

include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup(TARGETS)

find_package(aws-checksums REQUIRED CONFIG)

add_executable(${PROJECT_NAME} ../test_package/test_package.c)
target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-checksums)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package
${CMAKE_CURRENT_BINARY_DIR}/test_package)
23 changes: 23 additions & 0 deletions recipes/b64/all/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
cmake_minimum_required(VERSION 3.15)
project(b64 LANGUAGES C CXX)

file(GLOB HEADER_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/include/b64/*.h")
add_library(${PROJECT_NAME} "${CMAKE_CURRENT_SOURCE_DIR}/src/src/cdecode.c" "${CMAKE_CURRENT_SOURCE_DIR}/src/src/cencode.c" ${HEADER_FILES})
target_include_directories(${PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/src/include")
set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "${HEADER_FILES}" WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
install(TARGETS ${PROJECT_NAME}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/b64"
)

set(BASE64_APP base64)
add_executable(${BASE64_APP} "${CMAKE_CURRENT_SOURCE_DIR}/src/base64/base64.cc" ${HEADER_FILES})
target_link_libraries(${BASE64_APP} PRIVATE ${PROJECT_NAME})
target_include_directories(${BASE64_APP} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/src/include")
target_compile_definitions(${BASE64_APP} PRIVATE BUFFERSIZE=16777216)
set_target_properties(${BASE64_APP} PROPERTIES LINKER_LANGUAGE CXX)
install(TARGETS ${BASE64_APP}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
20 changes: 20 additions & 0 deletions recipes/b64/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
sources:
"2.0.0.1":
url: "https://github.com/libb64/libb64/archive/refs/tags/v2.0.0.1.tar.gz"
sha256: "ce8e578a953a591bd4a6f157eec310b9a4c2e6f10ade2fdda6ae6bafaf798b98"
patches:
"2.0.0.1":
- patch_file: "patches/0001-windows-elseif.patch"
patch_description: "Replace elseif definition by elif to make it work on Windows"
patch_type: "portability"
patch_source: "https://github.com/libb64/libb64/commit/b5edeafc89853c48fa41a4c16393a1fdc8638ab6"
- patch_file: "patches/0002-extern-c.patch"
patch_description: "Move extern C from C++ headers to C headers"
patch_type: "portability"
patch_source: "https://github.com/libb64/libb64/pull/6/commits/502573666a61317aa6bee2ff9ab74e65a7c25f63"
- patch_file: "patches/0003-stdlib-exit.patch"
patch_description: "Use cstdlib instead of stdlib.h for exit() - needed for GCC5"
patch_type: "conan"
- patch_file: "patches/0004-include-order.patch"
patch_description: "Include C headers first, than C++ headers, and project headers"
patch_type: "conan"
65 changes: 65 additions & 0 deletions recipes/b64/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
from conan import ConanFile
from conan.tools.files import get, copy, export_conandata_patches, apply_conandata_patches
from conan.tools.cmake import cmake_layout, CMakeToolchain, CMake
import os


required_conan_version = ">=1.53.0"


class B64Conan(ConanFile):
name = "b64"
description = "A library of ANSI C routines for fast encoding/decoding data into and from a base64-encoded format."
license = "CC0-1.0"
url = "https://github.com/conan-io/conan-center-index"
homepage = "https://libb64.sourceforge.net/"
topics = ("base64", "codec", "encoder", "decoder")
package_type = "library"
settings = "os", "arch", "compiler", "build_type"
options = {
"shared": [True, False],
"fPIC": [True, False],
}
default_options = {
"shared": False,
"fPIC": True,
}

def export_sources(self):
copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder)
export_conandata_patches(self)

def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC

def configure(self):
if self.options.shared:
self.options.rm_safe("fPIC")

def layout(self):
cmake_layout(self, src_folder="src")

def source(self):
get(self, **self.conan_data["sources"][self.version], strip_root=True)

def generate(self):
tc = CMakeToolchain(self)
tc.generate()

def build(self):
apply_conandata_patches(self)
cmake = CMake(self)
cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir))
cmake.build()

def package(self):
copy(self, pattern="LICENSE.md", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder)
cmake = CMake(self)
cmake.install()

def package_info(self):
self.cpp_info.libs = ["b64"]

# TODO: Only for Conan 1.x legacy - Remove after running Conan 2.x only
self.env_info.PATH.append(os.path.join(self.package_folder, "bin"))
13 changes: 13 additions & 0 deletions recipes/b64/all/patches/0001-windows-elseif.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/include/b64/ccommon.h b/include/b64/ccommon.h
index 2b614df..28a9936 100644
--- a/include/b64/ccommon.h
+++ b/include/b64/ccommon.h
@@ -14,7 +14,7 @@ For details, see http://sourceforge.net/projects/libb64
#ifndef HAVE_SIZE_T
#ifdef _WIN32
#include <crtdefs.h>
- #elseif defined (__unix__) || (defined (__APPLE__) && defined (__MACH__))
+ #elif defined (__unix__) || (defined (__APPLE__) && defined (__MACH__))
#include <stdlib.h>
#else
typedef unsigned long size_t;
Loading

0 comments on commit 38cbc12

Please sign in to comment.