diff --git a/plugins/package-managers/conan/src/funTest/assets/projects/synthetic/conan-expected-output-py.yml b/plugins/package-managers/conan/src/funTest/assets/projects/synthetic/conan-expected-output-py.yml index d812efd742ce2..45be0f422f1a9 100644 --- a/plugins/package-managers/conan/src/funTest/assets/projects/synthetic/conan-expected-output-py.yml +++ b/plugins/package-managers/conan/src/funTest/assets/projects/synthetic/conan-expected-output-py.yml @@ -1,17 +1,14 @@ --- project: - id: "Conan::Poco:1.9.3" + id: "Conan::poco:" definition_file_path: "plugins/package-managers/conan/src/funTest/assets/projects/synthetic/conan-py/conanfile.py" - authors: - - "The Author" declared_licenses: - - "The Boost Software License 1.0" + - "BSL-1.0" declared_licenses_processed: - unmapped: - - "The Boost Software License 1.0" + spdx_expression: "BSL-1.0" vcs: type: "Git" - url: "http://github.com/pocoproject/conan-poco.git" + url: "https://github.com/conan-io/conan-center-index.git" revision: "" path: "" vcs_processed: @@ -19,18 +16,182 @@ project: url: "" revision: "" path: "" - homepage_url: "" + homepage_url: "https://pocoproject.org" scopes: - name: "build_requires" dependencies: [] - name: "requires" dependencies: - - id: "Conan::openssl:3.0.0" + - id: "Conan::expat:2.6.2" + - id: "Conan::libmysqlclient:8.1.0" + dependencies: + - id: "Conan::lz4:1.9.4" + - id: "Conan::openssl:3.3.1" + dependencies: + - id: "Conan::zlib:1.3.1" + - id: "Conan::zlib:1.3.1" + - id: "Conan::zstd:1.5.5" + - id: "Conan::libpq:15.4" + - id: "Conan::openssl:3.3.1" + dependencies: + - id: "Conan::zlib:1.3.1" + - id: "Conan::pcre2:10.42" dependencies: - - id: "Conan::zlib:1.2.12" + - id: "Conan::bzip2:1.0.8" + - id: "Conan::zlib:1.3.1" + - id: "Conan::sqlite3:3.45.0" + - id: "Conan::zlib:1.3.1" packages: -- id: "Conan::openssl:3.0.0" - purl: "pkg:conan/openssl@3.0.0" +- id: "Conan::bzip2:1.0.8" + purl: "pkg:conan/bzip2@1.0.8" + declared_licenses: + - "bzip2-1.0.8" + declared_licenses_processed: + unmapped: + - "bzip2-1.0.8" + description: "bzip2 is a free and open-source file compression program that uses\ + \ the Burrows Wheeler algorithm." + homepage_url: "https://sourceware.org/bzip2" + binary_artifact: + url: "" + hash: + value: "" + algorithm: "" + source_artifact: + url: "https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz" + hash: + value: "ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269" + algorithm: "SHA-256" + vcs: + type: "" + url: "" + revision: "" + path: "" + vcs_processed: + type: "" + url: "" + revision: "" + path: "" +- id: "Conan::expat:2.6.2" + purl: "pkg:conan/expat@2.6.2" + declared_licenses: + - "MIT" + declared_licenses_processed: + spdx_expression: "MIT" + description: "Fast streaming XML parser written in C." + homepage_url: "https://github.com/libexpat/libexpat" + binary_artifact: + url: "" + hash: + value: "" + algorithm: "" + source_artifact: + url: "https://github.com/libexpat/libexpat/releases/download/R_2_6_2/expat-2.6.2.tar.xz" + hash: + value: "ee14b4c5d8908b1bec37ad937607eab183d4d9806a08adee472c3c3121d27364" + algorithm: "SHA-256" + vcs: + type: "Git" + url: "https://github.com/libexpat/libexpat.git" + revision: "" + path: "" + vcs_processed: + type: "Git" + url: "https://github.com/libexpat/libexpat.git" + revision: "" + path: "" +- id: "Conan::libmysqlclient:8.1.0" + purl: "pkg:conan/libmysqlclient@8.1.0" + declared_licenses: + - "GPL-2.0" + declared_licenses_processed: + spdx_expression: "GPL-2.0-only" + mapped: + GPL-2.0: "GPL-2.0-only" + description: "A MySQL client library for C development." + homepage_url: "https://dev.mysql.com/downloads/mysql/" + binary_artifact: + url: "" + hash: + value: "" + algorithm: "" + source_artifact: + url: "https://dev.mysql.com/get/Downloads/MySQL-8.1/mysql-8.1.0.tar.gz" + hash: + value: "3dd017a940734aa90796a4c65e125e6712f64bbbbe3388d36469deaa87b599eb" + algorithm: "SHA-256" + vcs: + type: "" + url: "" + revision: "" + path: "" + vcs_processed: + type: "" + url: "" + revision: "" + path: "" + is_modified: true +- id: "Conan::libpq:15.4" + purl: "pkg:conan/libpq@15.4" + declared_licenses: + - "PostgreSQL" + declared_licenses_processed: + spdx_expression: "PostgreSQL" + description: "The library used by all the standard PostgreSQL tools." + homepage_url: "https://www.postgresql.org/docs/current/static/libpq.html" + binary_artifact: + url: "" + hash: + value: "" + algorithm: "" + source_artifact: + url: "https://ftp.postgresql.org/pub/source/v15.4/postgresql-15.4.tar.bz2" + hash: + value: "baec5a4bdc4437336653b6cb5d9ed89be5bd5c0c58b94e0becee0a999e63c8f9" + algorithm: "SHA-256" + vcs: + type: "" + url: "" + revision: "" + path: "" + vcs_processed: + type: "" + url: "" + revision: "" + path: "" + is_modified: true +- id: "Conan::lz4:1.9.4" + purl: "pkg:conan/lz4@1.9.4" + declared_licenses: + - "BSD-2-Clause" + - "BSD-3-Clause" + declared_licenses_processed: + spdx_expression: "BSD-2-Clause AND BSD-3-Clause" + description: "Extremely Fast Compression algorithm" + homepage_url: "https://github.com/lz4/lz4" + binary_artifact: + url: "" + hash: + value: "" + algorithm: "" + source_artifact: + url: "https://github.com/lz4/lz4/archive/v1.9.4.tar.gz" + hash: + value: "0b0e3aa07c8c063ddf40b082bdf7e37a1562bda40a0ff5272957f3e987e0e54b" + algorithm: "SHA-256" + vcs: + type: "Git" + url: "https://github.com/lz4/lz4.git" + revision: "" + path: "" + vcs_processed: + type: "Git" + url: "https://github.com/lz4/lz4.git" + revision: "" + path: "" + is_modified: true +- id: "Conan::openssl:3.3.1" + purl: "pkg:conan/openssl@3.3.1" declared_licenses: - "Apache-2.0" declared_licenses_processed: @@ -44,9 +205,9 @@ packages: value: "" algorithm: "" source_artifact: - url: "https://www.openssl.org/source/openssl-3.0.0.tar.gz" + url: "https://github.com/openssl/openssl/releases/download/openssl-3.3.1/openssl-3.3.1.tar.gz" hash: - value: "59eedfcb46c25214c9bd37ed6078297b4df01d012267fe9e9eee31f61bc70536" + value: "777cd596284c883375a2a7a11bf5d2786fc5413255efab20c50d6ffe6d020b7e" algorithm: "SHA-256" vcs: type: "Git" @@ -58,8 +219,64 @@ packages: url: "https://github.com/openssl/openssl.git" revision: "" path: "" -- id: "Conan::zlib:1.2.12" - purl: "pkg:conan/zlib@1.2.12" +- id: "Conan::pcre2:10.42" + purl: "pkg:conan/pcre2@10.42" + declared_licenses: + - "BSD-3-Clause" + declared_licenses_processed: + spdx_expression: "BSD-3-Clause" + description: "Perl Compatible Regular Expressions" + homepage_url: "https://www.pcre.org/" + binary_artifact: + url: "" + hash: + value: "" + algorithm: "" + source_artifact: + url: "https://github.com/PCRE2Project/pcre2/releases/download/pcre2-10.42/pcre2-10.42.tar.bz2" + hash: + value: "8d36cd8cb6ea2a4c2bb358ff6411b0c788633a2a45dabbf1aeb4b701d1b5e840" + algorithm: "SHA-256" + vcs: + type: "" + url: "" + revision: "" + path: "" + vcs_processed: + type: "" + url: "" + revision: "" + path: "" +- id: "Conan::sqlite3:3.45.0" + purl: "pkg:conan/sqlite3@3.45.0" + declared_licenses: + - "Unlicense" + declared_licenses_processed: + spdx_expression: "Unlicense" + description: "Self-contained, serverless, in-process SQL database engine." + homepage_url: "https://www.sqlite.org" + binary_artifact: + url: "" + hash: + value: "" + algorithm: "" + source_artifact: + url: "https://sqlite.org/2024/sqlite-amalgamation-3450000.zip" + hash: + value: "bde30d13ebdf84926ddd5e8b6df145be03a577a48fd075a087a5dd815bcdf740" + algorithm: "SHA-256" + vcs: + type: "" + url: "" + revision: "" + path: "" + vcs_processed: + type: "" + url: "" + revision: "" + path: "" +- id: "Conan::zlib:1.3.1" + purl: "pkg:conan/zlib@1.3.1" declared_licenses: - "Zlib" declared_licenses_processed: @@ -73,9 +290,9 @@ packages: value: "" algorithm: "" source_artifact: - url: "https://zlib.net/fossils/zlib-1.2.12.tar.gz" + url: "https://zlib.net/fossils/zlib-1.3.1.tar.gz" hash: - value: "91844808532e5ce316b3c010929493c0244f3d37593afd6de04f71821d5136d9" + value: "9a93b2b7dfdac77ceba5a558a580e74667dd6fede4585b91eefb60f03b72df23" algorithm: "SHA-256" vcs: type: "" @@ -88,3 +305,32 @@ packages: revision: "" path: "" is_modified: true +- id: "Conan::zstd:1.5.5" + purl: "pkg:conan/zstd@1.5.5" + declared_licenses: + - "BSD-3-Clause" + declared_licenses_processed: + spdx_expression: "BSD-3-Clause" + description: "Zstandard - Fast real-time compression algorithm" + homepage_url: "https://github.com/facebook/zstd" + binary_artifact: + url: "" + hash: + value: "" + algorithm: "" + source_artifact: + url: "https://github.com/facebook/zstd/releases/download/v1.5.5/zstd-1.5.5.tar.gz" + hash: + value: "9c4396cc829cfae319a6e2615202e82aad41372073482fce286fac78646d3ee4" + algorithm: "SHA-256" + vcs: + type: "Git" + url: "https://github.com/facebook/zstd.git" + revision: "" + path: "" + vcs_processed: + type: "Git" + url: "https://github.com/facebook/zstd.git" + revision: "" + path: "" + is_modified: true diff --git a/plugins/package-managers/conan/src/funTest/assets/projects/synthetic/conan-py/conanfile.py b/plugins/package-managers/conan/src/funTest/assets/projects/synthetic/conan-py/conanfile.py index 11e134c5c6b29..8223c242f01e0 100644 --- a/plugins/package-managers/conan/src/funTest/assets/projects/synthetic/conan-py/conanfile.py +++ b/plugins/package-managers/conan/src/funTest/assets/projects/synthetic/conan-py/conanfile.py @@ -1,197 +1,381 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rm, rmdir +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime, msvc_runtime_flag, VCVars +from conan.tools.scm import Version +from conan.tools.build import check_min_cppstd +from collections import namedtuple import os -import shutil -from conans import CMake -from conans import ConanFile, tools +required_conan_version = ">=1.54.0" class PocoConan(ConanFile): - name = "Poco" - version = "1.9.3" - url = "http://github.com/pocoproject/conan-poco" - exports_sources = "CMakeLists.txt", "PocoMacros.cmake" # REMOVE POCOMACROS IN NEXT VERSION! - generators = "cmake", "txt" + name = "poco" + description = ( + "Modern, powerful open source C++ class libraries for building " + "network- and internet-based applications that run on desktop, server, " + "mobile and embedded systems." + ) + license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://pocoproject.org" + topics = ("building", "networking", "server", "mobile", "embedded") + package_type = "library" settings = "os", "arch", "compiler", "build_type" - author = "The Author " - license = "The Boost Software License 1.0" - description = "Modern, powerful open source C++ class libraries for building network- and internet-based " \ - "applications that run on desktop, server, mobile and embedded systems." - options = {"shared": [True, False], - "fPIC": [True, False], - "enable_xml": [True, False], - "enable_json": [True, False], - "enable_mongodb": [True, False], - "enable_pdf": [True, False], - "enable_util": [True, False], - "enable_net": [True, False], - "enable_netssl": [True, False], - "enable_netssl_win": [True, False], - "enable_crypto": [True, False], - "enable_data": [True, False], - "enable_data_sqlite": [True, False], - "enable_data_mysql": [True, False], - "enable_data_odbc": [True, False], - "enable_sevenzip": [True, False], - "enable_zip": [True, False], - "enable_apacheconnector": [True, False], - "enable_cppparser": [True, False], - "enable_pocodoc": [True, False], - "enable_pagecompiler": [True, False], - "enable_pagecompiler_file2page": [True, False], - "enable_redis": [True, False], - "force_openssl": [True, False], # "Force usage of OpenSSL even under windows" - "enable_tests": [True, False], - "poco_unbundled": [True, False], - "cxx_14": [True, False] - } - default_options = ''' -shared=False -fPIC=True -enable_xml=True -enable_json=True -enable_mongodb=True -enable_pdf=False -enable_util=True -enable_net=True -enable_netssl=True -enable_netssl_win=True -enable_crypto=True -enable_data=True -enable_data_sqlite=True -enable_data_mysql=False -enable_data_odbc=False -enable_sevenzip=False -enable_zip=True -enable_apacheconnector=False -enable_cppparser=False -enable_pocodoc=False -enable_pagecompiler=False -enable_pagecompiler_file2page=False -enable_redis=True -force_openssl=True -enable_tests=False -poco_unbundled=False -cxx_14=False -''' + options = { + "shared": [True, False], + "fPIC": [True, False], + "enable_fork": [True, False], + "enable_active_record": [True, False, "deprecated"], + "log_debug": [True, False], + "with_sql_parser": [True, False], + "comp_foundation_sharedlibrary_debug_suffix": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "enable_fork": True, + "enable_active_record": "deprecated", + "log_debug": False, + "with_sql_parser": True, + "comp_foundation_sharedlibrary_debug_suffix": True, + } - def source(self): - zip_name = "poco-%s-release.zip" % self.version - tools.download("https://github.com/pocoproject/poco/archive/%s" % zip_name, zip_name) - tools.unzip(zip_name) - shutil.move("poco-poco-%s-release" % self.version, "poco") - os.unlink(zip_name) - shutil.move("poco/CMakeLists.txt", "poco/CMakeListsOriginal.cmake") - shutil.move("CMakeLists.txt", "poco/CMakeLists.txt") - # Patch the PocoMacros.cmake to fix the detection of the win10 sdk. - # NOTE: ALREADY FIXED IN POCO REPO, REMOVE THIS FOR NEXT VERSION - shutil.move("PocoMacros.cmake", "poco/cmake/PocoMacros.cmake") + _PocoComponent = namedtuple("_PocoComponent", ("option", "default_option", "dependencies", "external_dependencies", "is_lib")) + _poco_component_tree = { + "mod_poco": _PocoComponent("enable_apacheconnector", False, ["Util", "Net"], ["apr::apr", "apr-util::apr-util"], False), + "CppParser": _PocoComponent("enable_cppparser", False, ["Foundation"], [], False), + # "CppUnit": _PocoComponent("enable_cppunit", False, ["Foundation"], [], False)), + "Crypto": _PocoComponent("enable_crypto", True, ["Foundation"], ["openssl::openssl"], True), + "Data": _PocoComponent("enable_data", True, ["Foundation"], [], True), + "DataMySQL": _PocoComponent("enable_data_mysql", True, ["Data"], ["libmysqlclient::libmysqlclient"], True), + "DataODBC": _PocoComponent("enable_data_odbc", False, ["Data"], [], True), # requires odbc but conditional, see package_info() + "DataPostgreSQL": _PocoComponent("enable_data_postgresql", True, ["Data"], ["libpq::libpq"], True), + "DataSQLite": _PocoComponent("enable_data_sqlite", True, ["Data"], ["sqlite3::sqlite3"], True), + "Encodings": _PocoComponent("enable_encodings", True, ["Foundation"], [], True), + # "EncodingsCompiler": _PocoComponent("enable_encodingscompiler", False, ["Net", "Util"], [], False), + "Foundation": _PocoComponent(None, "Foundation", [], ["pcre::pcre", "zlib::zlib"], True), + "JSON": _PocoComponent("enable_json", True, ["Foundation"], [], True), + "JWT": _PocoComponent("enable_jwt", True, ["JSON", "Crypto"], [], True), + "MongoDB": _PocoComponent("enable_mongodb", True, ["Net"], [], True), + "Net": _PocoComponent("enable_net", True, ["Foundation"], [], True), + "NetSSL": _PocoComponent("enable_netssl", True, ["Crypto", "Util", "Net"], [], True), + "NetSSLWin": _PocoComponent("enable_netssl_win", False, ["Net", "Util"], [], True), + "PDF": _PocoComponent("enable_pdf", False, ["XML", "Util"], [], True), + "PageCompiler": _PocoComponent("enable_pagecompiler", False, ["Net", "Util"], [], False), + "File2Page": _PocoComponent("enable_pagecompiler_file2page", False, ["Net", "Util", "XML", "JSON"], [], False), + "PocoDoc": _PocoComponent("enable_pocodoc", False, ["Util", "XML", "CppParser"], [], False), + "Redis": _PocoComponent("enable_redis", True, ["Net"], [], True), + "SevenZip": _PocoComponent("enable_sevenzip", False, ["Util", "XML"], [], True), + "Util": _PocoComponent("enable_util", True, ["Foundation", "XML", "JSON"], [], True), + "XML": _PocoComponent("enable_xml", True, ["Foundation"], ["expat::expat"], True), + "Zip": _PocoComponent("enable_zip", True, ["Util", "XML"], [], True), + "ActiveRecord": _PocoComponent("enable_activerecord", True, ["Foundation", "Data"], [], True), + "ActiveRecordCompiler": _PocoComponent("enable_activerecord_compiler", False, ["Util", "XML"], [], False), + "Prometheus": _PocoComponent("enable_prometheus", False, ["Foundation", "Net"], [], True), + } + + for comp in _poco_component_tree.values(): + if comp.option: + options[comp.option] = [True, False] + default_options[comp.option] = comp.default_option + del comp + + @property + def _min_cppstd(self): + # Since 1.10.0, poco officially requires C++14 + # https://github.com/pocoproject/poco/releases/tag/poco-1.10.0-release + # But poco uses C++11 features only until 1.12.5 + # https://github.com/pocoproject/poco/commit/886b76f4faa2007cc0c09dad81f8dcdee6fcb4ac + if Version(self.version) < "1.12.5": + return "11" + # Since 1.13.0, poco requires C++17 + # https://github.com/pocoproject/poco/releases/tag/poco-1.13.0-release + if Version(self.version) < "1.13.0": + return "14" + return "17" + + @property + def _compilers_minimum_version(self): + return { + "14": { + "gcc": "6", + "clang": "5", + "apple-clang": "10", + "Visual Studio": "15", + "msvc": "191", + }, + "17": { + "gcc": "8", + "clang": "7", + "apple-clang": "12", + "Visual Studio": "16", + "msvc": "192", + }, + }.get(self._min_cppstd, {}) + + def export_sources(self): + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + del self.options.enable_fork + else: + del self.options.enable_netssl_win + if Version(self.version) < "1.12.0": + del self.options.enable_prometheus + if Version(self.version) < "1.13.0": + del self.options.with_sql_parser + if self.settings.build_type != "Debug": + del self.options.comp_foundation_sharedlibrary_debug_suffix def configure(self): - if self.options.enable_apacheconnector: - raise Exception("Apache connector not supported: https://github.com/pocoproject/poco/issues/1764") + if self.options.enable_active_record != "deprecated": + self.output.warning("enable_active_record option is deprecated, use 'enable_activerecord' instead") + if self.options.shared: + self.options.rm_safe("fPIC") + if not self.options.enable_xml: + util_dependencies = self._poco_component_tree["Util"].dependencies + self._poco_component_tree["Util"] = self._poco_component_tree["Util"]._replace(dependencies = [x for x in util_dependencies if x != "XML"]) + if not self.options.enable_json: + util_dependencies = self._poco_component_tree["Util"].dependencies + self._poco_component_tree["Util"] = self._poco_component_tree["Util"]._replace(dependencies = [x for x in util_dependencies if x != "JSON"]) + if Version(self.version) >= "1.12.0": + foundation_external_dependencies = self._poco_component_tree["Foundation"].external_dependencies + self._poco_component_tree["Foundation"] = self._poco_component_tree["Foundation"]._replace(external_dependencies = list(map(lambda x: 'pcre2::pcre2' if x == 'pcre::pcre' else x, foundation_external_dependencies))) + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - if self.options.enable_netssl or self.options.enable_netssl_win or self.options.enable_crypto or self.options.force_openssl: - self.requires.add("openssl/3.0.0", private=False) + if Version(self.version) < "1.12.0": + self.requires("pcre/8.45") + else: + self.requires("pcre2/10.42") + self.requires("zlib/[>=1.2.11 <2]", transitive_headers=True) + if self.options.enable_xml: + self.requires("expat/[>=2.6.2 <3]", transitive_headers=True) + if self.options.enable_data_sqlite: + self.requires("sqlite3/3.45.0") + if self.options.enable_apacheconnector: + self.requires("apr/1.7.4") + self.requires("apr-util/1.6.1") + if self.options.enable_netssl or self.options.enable_crypto or \ + self.options.get_safe("enable_jwt"): + self.requires("openssl/[>=1.1 <4]", transitive_headers=True) + if self.options.enable_data_odbc and self.settings.os != "Windows": + self.requires("odbc/2.3.11") + if self.options.get_safe("enable_data_postgresql"): + self.requires("libpq/15.4") + if self.options.get_safe("enable_data_mysql"): + self.requires("libmysqlclient/8.1.0") + + def package_id(self): + del self.info.options.enable_active_record + del self.info.options.log_debug + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + if self.options.enable_apacheconnector: + # FIXME: missing apache2 recipe + few issues + raise ConanInvalidConfiguration("Apache connector not supported: https://github.com/pocoproject/poco/issues/1764") + if is_msvc(self) and self.options.shared and is_msvc_static_runtime(self): + raise ConanInvalidConfiguration("Cannot build shared poco libraries with MT(d) runtime") + for compopt in self._poco_component_tree.values(): + if not compopt.option: + continue + if self.options.get_safe(compopt.option, False): + for compdep in compopt.dependencies: + if not self._poco_component_tree[compdep].option: + continue + if not self.options.get_safe(self._poco_component_tree[compdep].option, False): + raise ConanInvalidConfiguration(f"option {compopt.option} requires also option {self._poco_component_tree[compdep].option}") + if self.options.enable_data_sqlite: + if self.dependencies["sqlite3"].options.threadsafe == 0: + raise ConanInvalidConfiguration("sqlite3 must be built with threadsafe enabled") + if self.options.enable_netssl and self.options.get_safe("enable_netssl_win", False): + raise ConanInvalidConfiguration("Conflicting enable_netssl[_win] settings") - if self.options.enable_data_mysql: - # self.requires.add("MySQLClient/6.1.6@hklabbers/stable") - raise Exception("MySQL not supported yet, open an issue here please: %s" % self.url) + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def _dep_include_paths(self, dep_name): + dep = self.dependencies[dep_name] + dep_cpp_info = dep.cpp_info.aggregated_components() + return [os.path.join(dep.package_folder, dir).replace("\\", "/") for dir in dep_cpp_info.includedirs] + + def _dep_lib_paths(self, dep_name): + dep = self.dependencies[dep_name] + dep_cpp_info = dep.cpp_info.aggregated_components() + return [os.path.join(dep.package_folder, dir).replace("\\", "/") for dir in dep_cpp_info.libdirs] + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CMAKE_BUILD_TYPE"] = self.settings.build_type + for comp in self._poco_component_tree.values(): + if comp.option: + tc.variables[comp.option.upper()] = self.options.get_safe(comp.option, False) + tc.variables["POCO_UNBUNDLED"] = True + tc.variables["CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP"] = True + if is_msvc(self): + tc.variables["POCO_MT"] = is_msvc_static_runtime(self) + if self.options.get_safe("enable_data_postgresql", False): + tc.variables["PostgreSQL_ROOT_DIR"] = self.dependencies["libpq"].package_folder.replace("\\", "/") + tc.variables["PostgreSQL_ROOT_INCLUDE_DIRS"] = ";".join(self._dep_include_paths("libpq")) + tc.variables["PostgreSQL_ROOT_LIBRARY_DIRS"] = ";".join(self._dep_lib_paths("libpq")) + if self.options.get_safe("enable_data_mysql", False): + tc.variables["MYSQL_ROOT_DIR"] = self.dependencies["libmysqlclient"].package_folder.replace("\\", "/") + tc.variables["MYSQL_ROOT_INCLUDE_DIRS"] = ";".join(self._dep_include_paths("libmysqlclient")) + tc.variables["MYSQL_INCLUDE_DIR"] = ";".join(self._dep_include_paths("libmysqlclient")) + tc.variables["MYSQL_ROOT_LIBRARY_DIRS"] = ";".join(self._dep_lib_paths("libmysqlclient")) + if self.options.enable_apacheconnector: + tc.variables["APR_ROOT_DIR"] = self.dependencies["apr"].package_folder.replace("\\", "/") + tc.variables["APR_ROOT_INCLUDE_DIRS"] = ";".join(self._dep_include_paths("apr")) + tc.variables["APR_ROOT_LIBRARY_DIRS"] = ";".join(self._dep_lib_paths("apr")) + tc.variables["APRUTIL_ROOT_DIR"] = self.dependencies["apr-util"].package_folder.replace("\\", "/") + tc.variables["APRUTIL_ROOT_INCLUDE_DIRS"] = ";".join(self._dep_include_paths("apr-util")) + tc.variables["APRUTIL_ROOT_LIBRARY_DIRS"] = ";".join(self._dep_lib_paths("apr-util")) + # Disable fork + if not self.options.get_safe("enable_fork", True): + tc.variables["POCO_NO_FORK_EXEC"] = True + if self.options.get_safe("with_sql_parser", None) is False: + tc.variables["POCO_DATA_NO_SQL_PARSER"] = True + # Disable automatic linking on MSVC + tc.preprocessor_definitions["POCO_NO_AUTOMATIC_LIBS"] = "1" + # Picked up from conan v1 CMake wrapper, don't know the rationale + tc.preprocessor_definitions["XML_DTD"] = "1" + # Disable SharedLibrary::suffix() including "d" as part of the platform-specific filename suffix + if not self.options.get_safe("comp_foundation_sharedlibrary_debug_suffix", True): + tc.preprocessor_definitions["POCO_NO_SHARED_LIBRARY_DEBUG_SUFFIX"] = "1" + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + if is_msvc(self): + # On Windows, Poco needs a message (MC) compiler. + vcvars = VCVars(self) + vcvars.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + # mysql + if self.options.get_safe("enable_data_mysql"): + mysql_cpp_info = self.dependencies["libmysqlclient"].cpp_info + mysql_config_file = mysql_cpp_info.get_property("cmake_file_name") or "libmysqlclient" + replace_in_file( + self, + os.path.join(self.source_folder, "CMakeLists.txt"), + "find_package(MySQL REQUIRED)", + f"find_package({mysql_config_file} REQUIRED CONFIG)\nset(MYSQL_FOUND TRUE)", + ) + mysql_target_name = mysql_cpp_info.get_property("cmake_target_name") or "libmysqlclient::libmysqlclient" + replace_in_file( + self, + os.path.join(self.source_folder, "Data", "MySQL", "CMakeLists.txt"), + "MySQL::client", + mysql_target_name, + ) + # libpq + if self.options.get_safe("enable_data_postgresql"): + replace_in_file( + self, + os.path.join(self.source_folder, "CMakeLists.txt"), + "find_package(PostgreSQL REQUIRED)", + "find_package(PostgreSQL REQUIRED)\nset(POSTGRESQL_FOUND TRUE)", + ) + replace_in_file( + self, + os.path.join(self.source_folder, "Data", "PostgreSQL", "CMakeLists.txt"), + "PostgreSQL::client", + "PostgreSQL::PostgreSQL", + ) + # Ensure to use FindEXPAT.cmake instead of expat-config.cmake + # (side effect of CMAKE_FIND_PACKAGE_PREFER_CONFIG ON, see https://github.com/conan-io/conan/issues/10387) + replace_in_file( + self, + os.path.join(self.source_folder, "XML", "CMakeLists.txt"), + "find_package(EXPAT REQUIRED)", + "find_package(EXPAT REQUIRED MODULE)", + ) def build(self): - if self.settings.compiler == "Visual Studio" and self.options.shared: - self.output.warn("Adding ws2_32 dependency...") - replace = 'Net Util Foundation Crypt32.lib' - tools.replace_in_file("poco/NetSSL_Win/CMakeLists.txt", replace, replace + " ws2_32 ") - - replace = 'Foundation ${OPENSSL_LIBRARIES}' - tools.replace_in_file("poco/Crypto/CMakeLists.txt", replace, replace + " ws2_32 Crypt32.lib") - - cmake = CMake(self, parallel=None) # Parallel crashes building - for option_name in self.options.values.fields: - activated = getattr(self.options, option_name) - if option_name == "shared": - cmake.definitions["POCO_STATIC"] = "OFF" if activated else "ON" - elif not option_name == "fPIC": - cmake.definitions[option_name.upper()] = "ON" if activated else "OFF" - - if self.settings.os == "Windows" and self.settings.compiler == "Visual Studio": # MT or MTd - cmake.definitions["POCO_MT"] = "ON" if "MT" in str(self.settings.compiler.runtime) else "OFF" - self.output.info(cmake.definitions) - os.mkdir("build") - cmake.configure(source_dir="../poco", build_dir="build") + self._patch_sources() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - # Copy the license files - self.copy("poco/LICENSE", dst=".", keep_path=False) - # Typically includes we want to keep_path=True (default) - packages = ["CppUnit", "Crypto", "Data", "Data/MySQL", "Data/ODBC", "Data/SQLite", - "Foundation", "JSON", "MongoDB", "Net", "Redis", "Util", - "XML", "Zip"] - if self.settings.os == "Windows" and self.options.enable_netssl_win: - packages.append("NetSSL_Win") - else: - packages.append("NetSSL_OpenSSL") + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "cmake")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + # INFO: missing headers https://github.com/pocoproject/poco/issues/4378 + if self.options.get_safe("with_sql_parser", False): + copy( + self, + "*.h", + os.path.join(self.source_folder, "Data", "src"), + os.path.join(self.package_folder, "include"), + ) - for header in packages: - self.copy(pattern="*.h", dst="include", src="poco/%s/include" % header) + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Poco") + self.cpp_info.set_property("cmake_target_name", "Poco::Poco") - # But for libs and dlls, we want to avoid intermediate folders - self.copy(pattern="*.lib", dst="lib", src="build/lib", keep_path=False) - self.copy(pattern="*.a", dst="lib", src="build/lib", keep_path=False) - self.copy(pattern="*.dll", dst="bin", src="build/bin", keep_path=False) - # in linux shared libs are in lib, not bin - self.copy(pattern="*.so*", dst="lib", src="build/lib", keep_path=False, symlinks=True) - self.copy(pattern="*.dylib", dst="lib", src="build/lib", keep_path=False) + self.cpp_info.filenames["cmake_find_package"] = "Poco" + self.cpp_info.filenames["cmake_find_package_multi"] = "Poco" + self.cpp_info.names["cmake_find_package"] = "Poco" + self.cpp_info.names["cmake_find_package_multi"] = "Poco" - def package_info(self): - """ Define the required info that the consumers/users of this package will have - to add to their projects - """ - libs = [("enable_mongodb", "PocoMongoDB"), - ("enable_pdf", "PocoPDF"), - ("enable_netssl", "PocoNetSSL"), - ("enable_netssl_win", "PocoNetSSLWin"), - ("enable_net", "PocoNet"), - ("enable_crypto", "PocoCrypto"), - ("enable_data_sqlite", "PocoDataSQLite"), - ("enable_data_mysql", "PocoDataMySQL"), - ("enable_data_odbc", "PocoDataODBC"), - ("enable_data", "PocoData"), - ("enable_sevenzip", "PocoSevenZip"), - ("enable_zip", "PocoZip"), - ("enable_apacheconnector", "PocoApacheConnector"), - ("enable_util", "PocoUtil"), - ("enable_xml", "PocoXML"), - ("enable_json", "PocoJSON"), - ("enable_redis", "PocoRedis")] - - suffix = str(self.settings.compiler.runtime).lower() \ - if self.settings.compiler == "Visual Studio" and not self.options.shared \ - else ("d" if self.settings.build_type=="Debug" else "") - - for flag, lib in libs: - if getattr(self.options, flag): - if self.settings.os == "Windows" and flag == "enable_netssl" and self.options.enable_netssl_win: - continue - - if self.settings.os != "Windows" and flag == "enable_netssl_win": - continue - - self.cpp_info.libs.append("%s%s" % (lib, suffix)) - - self.cpp_info.libs.append("PocoFoundation%s" % suffix) - - # in linux we need to link also with these libs - if self.settings.os == "Linux": - self.cpp_info.libs.extend(["pthread", "dl", "rt"]) + suffix = msvc_runtime_flag(self).lower() \ + if is_msvc(self) and not self.options.shared \ + else ("d" if self.settings.build_type == "Debug" else "") + + for compname, comp in self._poco_component_tree.items(): + if comp.option is None or self.options.get_safe(comp.option): + conan_component = f"poco_{compname.lower()}" + requires = [f"poco_{dependency.lower()}" for dependency in comp.dependencies] + comp.external_dependencies + self.cpp_info.components[conan_component].set_property("cmake_target_name", f"Poco::{compname}") + self.cpp_info.components[conan_component].set_property("cmake_file_name", compname) + self.cpp_info.components[conan_component].names["cmake_find_package"] = compname + self.cpp_info.components[conan_component].names["cmake_find_package_multi"] = compname + if comp.is_lib: + self.cpp_info.components[conan_component].libs = [f"Poco{compname}{suffix}"] + self.cpp_info.components[conan_component].requires = requires + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["poco_foundation"].system_libs.extend(["pthread", "dl", "rt"]) + + if self.options.log_debug: + self.cpp_info.components["poco_foundation"].defines.append("POCO_LOG_DEBUG") + if is_msvc(self): + self.cpp_info.components["poco_foundation"].defines.append("POCO_NO_AUTOMATIC_LIBS") if not self.options.shared: - self.cpp_info.defines.extend(["POCO_STATIC=ON", "POCO_NO_AUTOMATIC_LIBS"]) - if self.settings.compiler == "Visual Studio": - self.cpp_info.libs.extend(["ws2_32", "Iphlpapi", "Crypt32"]) + self.cpp_info.components["poco_foundation"].defines.append("POCO_STATIC=ON") + if self.settings.os == "Windows": + self.cpp_info.components["poco_foundation"].system_libs.extend(["ws2_32", "iphlpapi", "crypt32"]) + if self.options.enable_data_odbc: + if self.settings.os == "Windows": + self.cpp_info.components["poco_dataodbc"].system_libs.extend(["odbc32", "odbccp32"]) + else: + self.cpp_info.components["poco_dataodbc"].requires.append("odbc::odbc") + self.cpp_info.components["poco_foundation"].defines.append("POCO_UNBUNDLED") + if self.options.enable_util: + if not self.options.enable_json: + self.cpp_info.components["poco_util"].defines.append("POCO_UTIL_NO_JSONCONFIGURATION") + if not self.options.enable_xml: + self.cpp_info.components["poco_util"].defines.append("POCO_UTIL_NO_XMLCONFIGURATION") diff --git a/plugins/package-managers/conan/src/funTest/assets/projects/synthetic/conan-py/conanfile.py.license b/plugins/package-managers/conan/src/funTest/assets/projects/synthetic/conan-py/conanfile.py.license new file mode 100644 index 0000000000000..8f856c8d2c12c --- /dev/null +++ b/plugins/package-managers/conan/src/funTest/assets/projects/synthetic/conan-py/conanfile.py.license @@ -0,0 +1,2 @@ +SPDX-License-Identifier: MIT +SPDX-FileCopyrightText: Copyright (c) 2019 Conan.io diff --git a/plugins/package-managers/conan/src/funTest/assets/projects/synthetic/conan-py/lockfile.lock b/plugins/package-managers/conan/src/funTest/assets/projects/synthetic/conan-py/lockfile.lock index 25d8c9639db46..cad160be6705b 100644 --- a/plugins/package-managers/conan/src/funTest/assets/projects/synthetic/conan-py/lockfile.lock +++ b/plugins/package-managers/conan/src/funTest/assets/projects/synthetic/conan-py/lockfile.lock @@ -2,32 +2,96 @@ "graph_lock": { "nodes": { "0": { - "ref": "Poco/1.9.3", - "options": "cxx_14=False\nenable_apacheconnector=False\nenable_cppparser=False\nenable_crypto=True\nenable_data=True\nenable_data_mysql=False\nenable_data_odbc=False\nenable_data_sqlite=True\nenable_json=True\nenable_mongodb=True\nenable_net=True\nenable_netssl=True\nenable_netssl_win=True\nenable_pagecompiler=False\nenable_pagecompiler_file2page=False\nenable_pdf=False\nenable_pocodoc=False\nenable_redis=True\nenable_sevenzip=False\nenable_tests=False\nenable_util=True\nenable_xml=True\nenable_zip=True\nforce_openssl=True\npoco_unbundled=False\nshared=False\nopenssl:386=False\nopenssl:capieng_dialog=False\nopenssl:enable_capieng=False\nopenssl:enable_weak_ssl_ciphers=False\nopenssl:no_aria=False\nopenssl:no_asm=False\nopenssl:no_async=False\nopenssl:no_bf=False\nopenssl:no_blake2=False\nopenssl:no_camellia=False\nopenssl:no_cast=False\nopenssl:no_chacha=False\nopenssl:no_cms=False\nopenssl:no_comp=False\nopenssl:no_ct=False\nopenssl:no_deprecated=False\nopenssl:no_des=False\nopenssl:no_dgram=False\nopenssl:no_dh=False\nopenssl:no_dsa=False\nopenssl:no_dso=False\nopenssl:no_ec=False\nopenssl:no_ecdh=False\nopenssl:no_ecdsa=False\nopenssl:no_engine=False\nopenssl:no_filenames=False\nopenssl:no_fips=False\nopenssl:no_gost=False\nopenssl:no_idea=False\nopenssl:no_legacy=False\nopenssl:no_md2=True\nopenssl:no_md4=False\nopenssl:no_mdc2=False\nopenssl:no_ocsp=False\nopenssl:no_pinshared=False\nopenssl:no_rc2=False\nopenssl:no_rc4=False\nopenssl:no_rc5=False\nopenssl:no_rfc3779=False\nopenssl:no_rmd160=False\nopenssl:no_seed=False\nopenssl:no_sm2=False\nopenssl:no_sm3=False\nopenssl:no_sm4=False\nopenssl:no_sock=False\nopenssl:no_srp=False\nopenssl:no_srtp=False\nopenssl:no_sse2=False\nopenssl:no_ssl=False\nopenssl:no_ssl3=False\nopenssl:no_stdio=False\nopenssl:no_threads=False\nopenssl:no_tls1=False\nopenssl:no_ts=False\nopenssl:no_whirlpool=False\nopenssl:no_zlib=False\nopenssl:openssldir=None\nopenssl:shared=False\nzlib:shared=False", + "ref": "poco/None", + "options": "enable_active_record=deprecated\nenable_activerecord=True\nenable_activerecord_compiler=False\nenable_apacheconnector=False\nenable_cppparser=False\nenable_crypto=True\nenable_data=True\nenable_data_mysql=True\nenable_data_odbc=False\nenable_data_postgresql=True\nenable_data_sqlite=True\nenable_encodings=True\nenable_fork=True\nenable_json=True\nenable_jwt=True\nenable_mongodb=True\nenable_net=True\nenable_netssl=True\nenable_pagecompiler=False\nenable_pagecompiler_file2page=False\nenable_pdf=False\nenable_pocodoc=False\nenable_prometheus=False\nenable_redis=True\nenable_sevenzip=False\nenable_util=True\nenable_xml=True\nenable_zip=True\nfPIC=True\nlog_debug=False\nshared=False\nwith_sql_parser=True\nbzip2:build_executable=True\nbzip2:fPIC=True\nbzip2:shared=False\nexpat:char_type=char\nexpat:fPIC=True\nexpat:large_size=False\nexpat:shared=False\nlibmysqlclient:fPIC=True\nlibmysqlclient:shared=False\nlibpq:disable_rpath=False\nlibpq:fPIC=True\nlibpq:shared=False\nlibpq:with_openssl=False\nlz4:fPIC=True\nlz4:shared=False\nopenssl:386=False\nopenssl:enable_trace=False\nopenssl:enable_weak_ssl_ciphers=False\nopenssl:fPIC=True\nopenssl:no_apps=False\nopenssl:no_aria=False\nopenssl:no_asm=False\nopenssl:no_async=False\nopenssl:no_autoload_config=False\nopenssl:no_bf=False\nopenssl:no_blake2=False\nopenssl:no_camellia=False\nopenssl:no_cast=False\nopenssl:no_chacha=False\nopenssl:no_cms=False\nopenssl:no_comp=False\nopenssl:no_ct=False\nopenssl:no_deprecated=False\nopenssl:no_des=False\nopenssl:no_dgram=False\nopenssl:no_dh=False\nopenssl:no_dsa=False\nopenssl:no_dso=False\nopenssl:no_ec=False\nopenssl:no_ecdh=False\nopenssl:no_ecdsa=False\nopenssl:no_engine=False\nopenssl:no_filenames=False\nopenssl:no_fips=False\nopenssl:no_gost=False\nopenssl:no_idea=False\nopenssl:no_legacy=False\nopenssl:no_md2=True\nopenssl:no_md4=False\nopenssl:no_mdc2=False\nopenssl:no_module=False\nopenssl:no_ocsp=False\nopenssl:no_pinshared=False\nopenssl:no_rc2=False\nopenssl:no_rc4=False\nopenssl:no_rc5=False\nopenssl:no_rfc3779=False\nopenssl:no_rmd160=False\nopenssl:no_seed=False\nopenssl:no_sm2=False\nopenssl:no_sm3=False\nopenssl:no_sm4=False\nopenssl:no_sock=False\nopenssl:no_srp=False\nopenssl:no_srtp=False\nopenssl:no_sse2=False\nopenssl:no_ssl=False\nopenssl:no_ssl3=False\nopenssl:no_stdio=False\nopenssl:no_threads=False\nopenssl:no_tls1=False\nopenssl:no_ts=False\nopenssl:no_whirlpool=False\nopenssl:no_zlib=False\nopenssl:openssldir=None\nopenssl:shared=False\nopenssl:tls_security_level=None\npcre2:build_pcre2_16=True\npcre2:build_pcre2_32=True\npcre2:build_pcre2_8=True\npcre2:build_pcre2grep=True\npcre2:fPIC=True\npcre2:grep_support_callout_fork=True\npcre2:link_size=2\npcre2:shared=False\npcre2:support_jit=False\npcre2:with_bzip2=True\npcre2:with_zlib=True\nsqlite3:build_executable=True\nsqlite3:disable_gethostuuid=False\nsqlite3:enable_column_metadata=True\nsqlite3:enable_dbpage_vtab=False\nsqlite3:enable_dbstat_vtab=False\nsqlite3:enable_default_secure_delete=False\nsqlite3:enable_default_vfs=True\nsqlite3:enable_explain_comments=False\nsqlite3:enable_fts3=False\nsqlite3:enable_fts3_parenthesis=False\nsqlite3:enable_fts4=False\nsqlite3:enable_fts5=False\nsqlite3:enable_json1=False\nsqlite3:enable_math_functions=True\nsqlite3:enable_preupdate_hook=False\nsqlite3:enable_rtree=True\nsqlite3:enable_soundex=False\nsqlite3:enable_unlock_notify=True\nsqlite3:fPIC=True\nsqlite3:max_blob_size=None\nsqlite3:max_column=None\nsqlite3:max_variable_number=None\nsqlite3:omit_deprecated=False\nsqlite3:omit_load_extension=False\nsqlite3:shared=False\nsqlite3:threadsafe=1\nsqlite3:use_alloca=False\nsqlite3:use_uri=False\nzlib:fPIC=True\nzlib:shared=False\nzstd:build_programs=True\nzstd:fPIC=True\nzstd:shared=False\nzstd:threading=True", "requires": [ - "1" + "1", + "2", + "4", + "5", + "6", + "7", + "8" ], "path": "conanfile.py", "context": "host" }, "1": { - "ref": "openssl/3.0.0", - "options": "386=False\ncapieng_dialog=False\nenable_capieng=False\nenable_weak_ssl_ciphers=False\nno_aria=False\nno_asm=False\nno_async=False\nno_bf=False\nno_blake2=False\nno_camellia=False\nno_cast=False\nno_chacha=False\nno_cms=False\nno_comp=False\nno_ct=False\nno_deprecated=False\nno_des=False\nno_dgram=False\nno_dh=False\nno_dsa=False\nno_dso=False\nno_ec=False\nno_ecdh=False\nno_ecdsa=False\nno_engine=False\nno_filenames=False\nno_fips=False\nno_gost=False\nno_idea=False\nno_legacy=False\nno_md2=True\nno_md4=False\nno_mdc2=False\nno_ocsp=False\nno_pinshared=False\nno_rc2=False\nno_rc4=False\nno_rc5=False\nno_rfc3779=False\nno_rmd160=False\nno_seed=False\nno_sm2=False\nno_sm3=False\nno_sm4=False\nno_sock=False\nno_srp=False\nno_srtp=False\nno_sse2=False\nno_ssl=False\nno_ssl3=False\nno_stdio=False\nno_threads=False\nno_tls1=False\nno_ts=False\nno_whirlpool=False\nno_zlib=False\nopenssldir=None\nshared=False\nzlib:shared=False", - "package_id": "73fc7f3ed0faf0fd80110346c52171985a5794b4", + "ref": "pcre2/10.42", + "options": "build_pcre2_16=True\nbuild_pcre2_32=True\nbuild_pcre2_8=True\nbuild_pcre2grep=True\nfPIC=True\ngrep_support_callout_fork=True\nlink_size=2\nshared=False\nsupport_jit=False\nwith_bzip2=True\nwith_zlib=True\nbzip2:build_executable=True\nbzip2:fPIC=True\nbzip2:shared=False\nzlib:fPIC=True\nzlib:shared=False", + "package_id": "89b1a341654fffa9a2b737e1b6e52b42acec7462", "requires": [ - "2" + "2", + "3" ], "context": "host" }, "2": { - "ref": "zlib/1.2.12", - "options": "shared=False", - "package_id": "7bc8c2c85db7a618e5320dc997f27fc33e1df074", + "ref": "zlib/1.3.1", + "options": "fPIC=True\nshared=False", + "package_id": "2a19826344ff00be1c04403f2f8e7008ed3a7cc6", + "context": "host" + }, + "3": { + "ref": "bzip2/1.0.8", + "options": "build_executable=True\nfPIC=True\nshared=False", + "package_id": "3cfc45772763dad1237052f26c1fe8b2bae3f7d2", + "context": "host" + }, + "4": { + "ref": "expat/2.6.2", + "options": "char_type=char\nfPIC=True\nlarge_size=False\nshared=False", + "package_id": "a1ba772dbe13186199f7ecf8dde362ba9613ecf7", + "context": "host" + }, + "5": { + "ref": "sqlite3/3.45.0", + "options": "build_executable=True\ndisable_gethostuuid=False\nenable_column_metadata=True\nenable_dbpage_vtab=False\nenable_dbstat_vtab=False\nenable_default_secure_delete=False\nenable_default_vfs=True\nenable_explain_comments=False\nenable_fts3=False\nenable_fts3_parenthesis=False\nenable_fts4=False\nenable_fts5=False\nenable_json1=False\nenable_math_functions=True\nenable_preupdate_hook=False\nenable_rtree=True\nenable_soundex=False\nenable_unlock_notify=True\nfPIC=True\nmax_blob_size=None\nmax_column=None\nmax_variable_number=None\nomit_deprecated=False\nomit_load_extension=False\nshared=False\nthreadsafe=1\nuse_alloca=False\nuse_uri=False", + "package_id": "668a23a956a1ae835b578205ecc8274cfd29ae40", + "context": "host" + }, + "6": { + "ref": "openssl/3.3.1", + "options": "386=False\nenable_trace=False\nenable_weak_ssl_ciphers=False\nfPIC=True\nno_apps=False\nno_aria=False\nno_asm=False\nno_async=False\nno_autoload_config=False\nno_bf=False\nno_blake2=False\nno_camellia=False\nno_cast=False\nno_chacha=False\nno_cms=False\nno_comp=False\nno_ct=False\nno_deprecated=False\nno_des=False\nno_dgram=False\nno_dh=False\nno_dsa=False\nno_dso=False\nno_ec=False\nno_ecdh=False\nno_ecdsa=False\nno_engine=False\nno_filenames=False\nno_fips=False\nno_gost=False\nno_idea=False\nno_legacy=False\nno_md2=True\nno_md4=False\nno_mdc2=False\nno_module=False\nno_ocsp=False\nno_pinshared=False\nno_rc2=False\nno_rc4=False\nno_rc5=False\nno_rfc3779=False\nno_rmd160=False\nno_seed=False\nno_sm2=False\nno_sm3=False\nno_sm4=False\nno_sock=False\nno_srp=False\nno_srtp=False\nno_sse2=False\nno_ssl=False\nno_ssl3=False\nno_stdio=False\nno_threads=False\nno_tls1=False\nno_ts=False\nno_whirlpool=False\nno_zlib=False\nopenssldir=None\nshared=False\ntls_security_level=None\nzlib:fPIC=True\nzlib:shared=False", + "package_id": "772675ace4978e609416253f5f352cadffbfbb53", + "requires": [ + "2" + ], + "context": "host" + }, + "7": { + "ref": "libpq/15.4", + "options": "disable_rpath=False\nfPIC=True\nshared=False\nwith_openssl=False", + "package_id": "2a19826344ff00be1c04403f2f8e7008ed3a7cc6", + "context": "host" + }, + "8": { + "ref": "libmysqlclient/8.1.0", + "options": "fPIC=True\nshared=False\nlz4:fPIC=True\nlz4:shared=False\nopenssl:386=False\nopenssl:enable_trace=False\nopenssl:enable_weak_ssl_ciphers=False\nopenssl:fPIC=True\nopenssl:no_apps=False\nopenssl:no_aria=False\nopenssl:no_asm=False\nopenssl:no_async=False\nopenssl:no_autoload_config=False\nopenssl:no_bf=False\nopenssl:no_blake2=False\nopenssl:no_camellia=False\nopenssl:no_cast=False\nopenssl:no_chacha=False\nopenssl:no_cms=False\nopenssl:no_comp=False\nopenssl:no_ct=False\nopenssl:no_deprecated=False\nopenssl:no_des=False\nopenssl:no_dgram=False\nopenssl:no_dh=False\nopenssl:no_dsa=False\nopenssl:no_dso=False\nopenssl:no_ec=False\nopenssl:no_ecdh=False\nopenssl:no_ecdsa=False\nopenssl:no_engine=False\nopenssl:no_filenames=False\nopenssl:no_fips=False\nopenssl:no_gost=False\nopenssl:no_idea=False\nopenssl:no_legacy=False\nopenssl:no_md2=True\nopenssl:no_md4=False\nopenssl:no_mdc2=False\nopenssl:no_module=False\nopenssl:no_ocsp=False\nopenssl:no_pinshared=False\nopenssl:no_rc2=False\nopenssl:no_rc4=False\nopenssl:no_rc5=False\nopenssl:no_rfc3779=False\nopenssl:no_rmd160=False\nopenssl:no_seed=False\nopenssl:no_sm2=False\nopenssl:no_sm3=False\nopenssl:no_sm4=False\nopenssl:no_sock=False\nopenssl:no_srp=False\nopenssl:no_srtp=False\nopenssl:no_sse2=False\nopenssl:no_ssl=False\nopenssl:no_ssl3=False\nopenssl:no_stdio=False\nopenssl:no_threads=False\nopenssl:no_tls1=False\nopenssl:no_ts=False\nopenssl:no_whirlpool=False\nopenssl:no_zlib=False\nopenssl:openssldir=None\nopenssl:shared=False\nopenssl:tls_security_level=None\nzlib:fPIC=True\nzlib:shared=False\nzstd:build_programs=True\nzstd:fPIC=True\nzstd:shared=False\nzstd:threading=True", + "package_id": "fa72dd8aafc989c2eefcb1d5933a7a6f312c1c1a", + "requires": [ + "6", + "2", + "9", + "10" + ], + "context": "host" + }, + "9": { + "ref": "zstd/1.5.5", + "options": "build_programs=True\nfPIC=True\nshared=False\nthreading=True", + "package_id": "1b177e416597e90db2922415c5ce0fe8e7df6e75", + "context": "host" + }, + "10": { + "ref": "lz4/1.9.4", + "options": "fPIC=True\nshared=False", + "package_id": "2a19826344ff00be1c04403f2f8e7008ed3a7cc6", "context": "host" } }, "revisions_enabled": false }, "version": "0.4", - "profile_host": "[settings]\narch=x86_64\narch_build=x86_64\nbuild_type=Release\ncompiler=gcc\ncompiler.libcxx=libstdc++\ncompiler.version=6.3\nos=Windows\nos_build=Windows\n[options]\n[build_requires]\n[env]\n" + "profile_host": "[settings]\narch=x86_64\narch_build=x86_64\nbuild_type=Release\ncompiler=gcc\ncompiler.libcxx=libstdc++\ncompiler.version=12\nos=Linux\nos_build=Linux\n[options]\n[build_requires]\n[env]\n" } diff --git a/plugins/package-managers/conan/src/main/kotlin/Conan.kt b/plugins/package-managers/conan/src/main/kotlin/Conan.kt index 16c54734520c5..31c91bad63a35 100644 --- a/plugins/package-managers/conan/src/main/kotlin/Conan.kt +++ b/plugins/package-managers/conan/src/main/kotlin/Conan.kt @@ -32,6 +32,7 @@ import java.io.File import kotlinx.serialization.json.Json import kotlinx.serialization.json.JsonObject +import kotlinx.serialization.json.contentOrNull import kotlinx.serialization.json.jsonObject import kotlinx.serialization.json.jsonPrimitive @@ -334,7 +335,9 @@ class Conan( } } - return results[field]?.jsonPrimitive?.content + // Note that while the console output of "conan inspect" uses "None" for absent values, the JSON output actually + // uses null values. + return results[field]?.jsonPrimitive?.contentOrNull } /**