From 0db1dd93b28e86deb0326ea8756f5fe9912e9069 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Fri, 24 Mar 2023 17:25:04 +1100 Subject: [PATCH 01/96] apr-util: Upgrade to be conan 2 compatibile --- recipes/apr-util/all/CMakeLists.txt | 7 - recipes/apr-util/all/conandata.yml | 21 ++- recipes/apr-util/all/conanfile.py | 159 +++++++++--------- .../0004-set-min-cmake-version-first.patch | 15 ++ .../patches/0005-fix-expat-found-test.patch | 11 ++ .../apr-util/all/test_package/CMakeLists.txt | 8 +- .../apr-util/all/test_package/conanfile.py | 25 +-- 7 files changed, 136 insertions(+), 110 deletions(-) delete mode 100644 recipes/apr-util/all/CMakeLists.txt create mode 100644 recipes/apr-util/all/patches/0004-set-min-cmake-version-first.patch create mode 100644 recipes/apr-util/all/patches/0005-fix-expat-found-test.patch diff --git a/recipes/apr-util/all/CMakeLists.txt b/recipes/apr-util/all/CMakeLists.txt deleted file mode 100644 index 2a122ebfa3606..0000000000000 --- a/recipes/apr-util/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12) -project(cmake_wrapper C) - -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 index 54e26418aee59..c21350dae0d31 100644 --- a/recipes/apr-util/all/conandata.yml +++ b/recipes/apr-util/all/conandata.yml @@ -4,11 +4,20 @@ sources: url: - "https://archive.apache.org/dist/apr/apr-util-1.6.1.tar.gz" - "https://downloads.apache.org/apr/apr-util-1.6.1.tar.gz" + "1.6.3": + sha256: "a41076e3710746326c3945042994ad9a4fcac0ce0277dd8fea076fec3c9772b5" + url: + - "https://archive.apache.org/dist/apr/apr-util-1.6.3.tar.gz" + - "https://downloads.apache.org/apr/apr-util-1.6.3.tar.gz" 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" + - patch_file: "patches/0001-cmake-build-only-shared-static.patch" + - patch_file: "patches/0002-apu-config-prefix-env.patch" + - patch_file: "patches/0003-disable-check-APR_LIBRARIES.patch" + - patch_file: "patches/0004-set-min-cmake-version-first.patch" + - patch_file: "patches/0005-fix-expat-found-test.patch" + "1.6.3": + - patch_file: "patches/0001-cmake-build-only-shared-static.patch" + - patch_file: "patches/0002-apu-config-prefix-env.patch" + - patch_file: "patches/0003-disable-check-APR_LIBRARIES.patch" + - patch_file: "patches/0004-set-min-cmake-version-first.patch" diff --git a/recipes/apr-util/all/conanfile.py b/recipes/apr-util/all/conanfile.py index f7c03746e3c19..82f2e9f25251e 100644 --- a/recipes/apr-util/all/conanfile.py +++ b/recipes/apr-util/all/conanfile.py @@ -1,20 +1,28 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout +from conan.tools.env import VirtualBuildEnv +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rm, rmdir +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import cross_building +from conan.tools.microsoft import is_msvc import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.54.0" class AprUtilConan(ConanFile): name = "apr-util" - description = "The Apache Portable Runtime (APR) provides a predictable and consistent interface to underlying platform-specific implementations" + description = ( + "The Apache Portable Runtime (APR) provides a predictable and consistent " + "interface to underlying platform-specific implementations" + ) license = "Apache-2.0" topics = ("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], @@ -45,37 +53,29 @@ class AprUtilConan(ConanFile): "with_ldap": False, } - _autotools = None - _cmake = None + def export_sources(self): + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": - del self.options.fPIC + self.options.rm_safe("fPIC") def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("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") + self.requires("apr/[>=1.7]") if self.settings.os != "Windows": #cmake build doesn't allow injection of iconv yet - self.requires("libiconv/1.16") + self.requires("libiconv/[>=1.16]") if self.options.with_openssl: - self.requires("openssl/1.1.1k") + self.requires("openssl/[>=1.1]") if self.options.with_nss: # self.requires("nss/x.y.z") raise ConanInvalidConfiguration("CCI has no nss recipe (yet)") @@ -98,90 +98,80 @@ def requirements(self): # self.requires("ldap/x.y.z") raise ConanInvalidConfiguration("CCI has no ldap recipe (yet)") if self.options.with_mysql: - self.requires("libmysqlclient/8.0.25") + self.requires("libmysqlclient/[>=8.0]") if self.options.with_sqlite3: - self.requires("sqlite3/3.35.5") + self.requires("sqlite3/[>=3.35]") if self.options.with_expat: - self.requires("expat/2.4.1") + self.requires("expat/[>=2.4]") if self.options.with_postgresql: - self.requires("libpq/13.2") + self.requires("libpq/[>=13.2]") def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def validate(self): - if self.options.shared != self.options["apr"].shared: + if self.options.shared != self.dependencies["apr"].options.shared: raise ConanInvalidConfiguration("apr-util must be built with same shared option as apr") - 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-iconv={}".format(tools.unix_path(self.deps_cpp_info["libiconv"].rootpath)), - "--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 generate(self): + if is_msvc(self): + tc = CMakeToolchain(self) + tc.variables["INSTALL_PDB"] = False + tc.variables["APR_INCLUDE_DIR"] = ";".join(self.dependencies["apr"].cpp_info.includedirs).replace("\\", "/") + tc.variables["APU_HAVE_CRYPTO"] = self._with_crypto + tc.variables["APR_HAS_LDAP"] = self.options.with_ldap + tc.generate() + cmake_deps = CMakeDeps(self) + cmake_deps.generate() + else: + env = VirtualBuildEnv(self) + env.generate() + tc = AutotoolsToolchain(self) + tc.configure_args.append("--with-installbuilddir=${prefix}/res/build-1") + tc.configure_args.append("--with-apr={}".format(self.dependencies["apr"].package_folder)) + tc.configure_args.append("--with-crypto" if self._with_crypto else "--without-crypto") + tc.configure_args.append("--with-iconv={}".format(self.dependencies["libiconv"].package_folder)) + tc.configure_args.append("--with-openssl={}".format(self.dependencies["openssl"].package_folder) if self.options.with_openssl else "--without-openssl") + tc.configure_args.append("--with-expat={}".format(self.dependencies["expat"].package_folder) if self.options.with_expat else "--without-expat") + tc.configure_args.append("--with-mysql={}".format(self.dependencies["libmysqlclient"].package_folder) if self.options.with_mysql else "--without-mysql") + tc.configure_args.append("--with-pgsql={}".format(self.dependencies["libpq"].package_folder) if self.options.with_postgresql else "--without-pgsql") + tc.configure_args.append("--with-sqlite3={}".format(self.dependencies["sqlite3"].package_folder) if self.options.with_sqlite3 else "--without-sqlite3") + tc.configure_args.append("--with-ldap={}".format(self.dependencies["ldap"].package_folder) if self.options.with_ldap else "--without-ldap") + tc.configure_args.append("--with-berkeley-db={}".format(self.dependencies["libdb"].package_folder) if self.options.dbm == "db" else "--without-berkeley-db") + tc.configure_args.append("--with-gdbm={}".format(self.dependencies["gdbm"].package_folder) if self.options.dbm == "gdbm" else "--without-gdbm") + tc.configure_args.append("--with-ndbm={}".format(self.dependencies["ndbm"].package_folder) if self.options.dbm == "ndbm" else "--without-ndbm") + if self.options.dbm: + tc.configure_args.append("--with-dbm={}".format(self.options.dbm)) + if cross_building(self): + tc.configure_args.append("apr_cv_mutex_robust_shared=yes") + tc.generate() def build(self): - self._patch_sources() + apply_conandata_patches(self) if self.settings.os == "Windows": - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() else: autotools = self._configure_autotools() autotools.make() def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) if self.settings.os == "Windows": - cmake = self._configure_cmake() + cmake = CMake(self) cmake.install() else: - autotools = self._configure_autotools() + autotools = Autotools(self) autotools.install() - - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib", "apr-util-1"), "*.la") - os.unlink(os.path.join(self.package_folder, "lib", "libaprutil-1.la")) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.la", os.path.join(self.package_folder, "apr-util-1", "lib")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) def package_info(self): self.cpp_info.names["pkg_config"] = "apr-util-1" @@ -194,13 +184,14 @@ def package_info(self): elif self.settings.os == "Windows": self.cpp_info.system_libs = ["mswsock", "rpcrt4", "ws2_32"] + # TODO: to remove in conan v2 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) + apr_util_root = 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) + if self.settings.compiler != "msvc": + self.env_info.APRUTIL_LDFLAGS = " ".join("-L{}".format(l) for l in self.deps_cpp_info.lib_paths) diff --git a/recipes/apr-util/all/patches/0004-set-min-cmake-version-first.patch b/recipes/apr-util/all/patches/0004-set-min-cmake-version-first.patch new file mode 100644 index 0000000000000..100ee6388bf3f --- /dev/null +++ b/recipes/apr-util/all/patches/0004-set-min-cmake-version-first.patch @@ -0,0 +1,15 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -15,10 +15,10 @@ + # + # Read README.cmake before using this. + +-PROJECT(APR-Util C) +- + CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + ++PROJECT(APR-Util C) ++ + FIND_PACKAGE(OpenSSL) + + FIND_PACKAGE(expat) diff --git a/recipes/apr-util/all/patches/0005-fix-expat-found-test.patch b/recipes/apr-util/all/patches/0005-fix-expat-found-test.patch new file mode 100644 index 0000000000000..d9e38672eae70 --- /dev/null +++ b/recipes/apr-util/all/patches/0005-fix-expat-found-test.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -21,7 +21,7 @@ PROJECT(APR-Util C) + + FIND_PACKAGE(OpenSSL) + +-FIND_PACKAGE(expat) ++FIND_PACKAGE(EXPAT MODULE) + + OPTION(APU_HAVE_CRYPTO "Crypto support" OFF) + OPTION(APU_HAVE_ODBC "Build ODBC DBD driver" ON) diff --git a/recipes/apr-util/all/test_package/CMakeLists.txt b/recipes/apr-util/all/test_package/CMakeLists.txt index f8b971e2db377..b4ea1db79c3f4 100644 --- a/recipes/apr-util/all/test_package/CMakeLists.txt +++ b/recipes/apr-util/all/test_package/CMakeLists.txt @@ -1,8 +1,10 @@ cmake_minimum_required(VERSION 3.1) project(test_package LANGUAGES C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(apr REQUIRED CONFIG) + +find_package(apr-util REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_include_directories(${PROJECT_NAME} PRIVATE ${apr_INCLUDE_DIR} ${apr-util_INCLUDE_DIR}) +target_link_libraries(${PROJECT_NAME} PRIVATE apr-util::apr-util apr::apr) diff --git a/recipes/apr-util/all/test_package/conanfile.py b/recipes/apr-util/all/test_package/conanfile.py index 9952431a15adf..5d3a839553e33 100644 --- a/recipes/apr-util/all/test_package/conanfile.py +++ b/recipes/apr-util/all/test_package/conanfile.py @@ -1,11 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout import os -from conans import ConanFile, CMake, tools - - class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + generators = "CMakeDeps", "CMakeToolchain" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + self.requires("apr/[>=1.7]") def build(self): cmake = CMake(self) @@ -13,9 +21,6 @@ def build(self): 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) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") From 2a111d2bb18951d729be982480b38fd594fb9221 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Fri, 24 Mar 2023 18:03:24 +1100 Subject: [PATCH 02/96] log4cxx: Upgrade to be conan 2 compatibile --- recipes/log4cxx/all/conandata.yml | 16 +- recipes/log4cxx/all/conanfile.py | 146 ++++++++---------- .../log4cxx/all/patches/0002-find-apr.patch | 17 ++ .../log4cxx/all/patches/0003-find-apr.patch | 18 +++ .../log4cxx/all/test_package/CMakeLists.txt | 7 +- recipes/log4cxx/all/test_package/conanfile.py | 22 ++- 6 files changed, 126 insertions(+), 100 deletions(-) create mode 100644 recipes/log4cxx/all/patches/0002-find-apr.patch create mode 100644 recipes/log4cxx/all/patches/0003-find-apr.patch diff --git a/recipes/log4cxx/all/conandata.yml b/recipes/log4cxx/all/conandata.yml index 4d9c222f7d839..a0517ae10799b 100644 --- a/recipes/log4cxx/all/conandata.yml +++ b/recipes/log4cxx/all/conandata.yml @@ -5,10 +5,18 @@ sources: "0.12.0": url: "https://archive.apache.org/dist/logging/log4cxx/0.12.0/apache-log4cxx-0.12.0.tar.gz" sha256: "bd5b5009ca914c8fa7944b92ea6b4ca6fb7d146f65d526f21bf8b3c6a0520e44" + "0.13.0": + sha256: "4e5be64b6b1e6de8525f8b87635270b81f772a98902d20d7ac646fdf1ac08284" + url: "https://archive.apache.org/dist/logging/log4cxx//0.13.0/apache-log4cxx-0.13.0.tar.gz" + "1.0.0": + sha256: "6df9f1f682650de6045309473d5b2fe1f798a03ceb36a74a5b21f5520962d32f" + url: "https://archive.apache.org/dist/logging/log4cxx//1.0.0/apache-log4cxx-1.0.0.tar.gz" patches: "0.12.1": - - base_path: "source_subfolder" - patch_file: "patches/0001-find-apr.patch" + - patch_file: "patches/0001-find-apr.patch" "0.12.0": - - base_path: "source_subfolder" - patch_file: "patches/0001-find-apr.patch" + - patch_file: "patches/0001-find-apr.patch" + "0.13.0": + - patch_file: "patches/0002-find-apr.patch" + "1.0.0": + - patch_file: "patches/0003-find-apr.patch" diff --git a/recipes/log4cxx/all/conanfile.py b/recipes/log4cxx/all/conanfile.py index ac48eb45fc460..e6c6b313b208b 100644 --- a/recipes/log4cxx/all/conanfile.py +++ b/recipes/log4cxx/all/conanfile.py @@ -1,59 +1,58 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout +from conan.errors import ConanInvalidConfiguration import os import textwrap -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.54.0" -class Log4cxxConan(ConanFile): +class Log4cxx(ConanFile): name = "log4cxx" description = "Logging framework for C++ patterned after Apache log4j" url = "https://github.com/conan-io/conan-center-index" license = "Apache-2.0" homepage = "https://logging.apache.org/log4cxx" - topics = ("logging", "log") + topics = ("logging") settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], + "with_networking": [True, False], + "with_wchar_t": [True, False], + "with_multiprocess_rolling_file_appender": [True, False], + "with_qt": [True, False], } default_options = { "shared": False, "fPIC": True, + "with_networking": True, + "with_wchar_t": False, + "with_multiprocess_rolling_file_appender": False, + "with_qt": False, } - generators = "cmake", "cmake_find_package", "pkg_config" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": - del self.options.fPIC + self.options.rm_safe("fPIC") def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") def requirements(self): - self.requires("apr/1.7.0") - self.requires("apr-util/1.6.1") - self.requires("expat/2.4.2") + self.requires("apr/[>=1.6]") + self.requires("apr-util/[>=1.6]") + self.requires("expat/[>=2.4]") if self.settings.os != "Windows": - self.requires("odbc/2.3.9") + self.requires("odbc/[>=2.3]") + if self.options.get_safe("with_qt"): + self.requires("qt/[>=5.15]") @property def _compilers_minimum_version(self): @@ -65,85 +64,64 @@ def _compilers_minimum_version(self): } def validate(self): - # TODO: if compiler doesn't support C++17, boost can be used instead - if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, "17") - minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) - if not minimum_version: - self.output.warn("log4cxx requires C++17. Your compiler is unknown. Assuming it supports C++17.") - elif tools.Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration("log4cxx requires a compiler that supports at least C++17") + if self.options.with_multiprocess_rolling_file_appender: + # TODO: if compiler doesn't support C++17, boost can be used instead + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, "17") + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if not minimum_version: + self.output.warn("multiprocess rolling file appender requires C++17. Your compiler is unknown. Assuming it supports C++17.") + elif tools.Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration("multiprocess rolling file appender requires a compiler that supports at least C++17") def build_requirements(self): if self.settings.os != "Windows": - self.build_requires("pkgconf/1.7.4") + self.tool_requires("pkgconf/1.7.4") + + def layout(self): + cmake_layout(self) def source(self): - #OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: - #'source_subfolder\\src\\test\\resources\\output\\xyz\\:' - pattern = "*[!:]" - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True, - pattern=pattern) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - - def _configure_cmake(self): - if not self._cmake: - self._cmake = CMake(self) - self._cmake.definitions["BUILD_TESTING"] = False - if self.settings.os == "Windows": - self._cmake.definitions["LOG4CXX_INSTALL_PDB"] = False - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + apply_conandata_patches(self) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_TESTING"] = False + tc.variables["LOG4CXX_NETWORKING_SUPPORT"] = self.options.with_networking + tc.variables["LOG4CXX_MULTIPROCESS_ROLLING_FILE_APPENDER"] = self.options.with_multiprocess_rolling_file_appender + tc.variables["LOG4CXX_WCHAR_T"] = self.options.with_wchar_t + tc.variables["LOG4CXX_QT_SUPPORT"] = self.options.with_qt + if self.settings.os == "Windows": + tc.variables["LOG4CXX_INSTALL_PDB"] = False + tc.generate() + + tc = CMakeDeps(self) + tc.generate() def build(self): self._patch_sources() - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy("LICENSE", src=self._source_subfolder, dst="licenses") - self.copy("NOTICE", src=self._source_subfolder, dst="licenses") - cmake = self._configure_cmake() + copy(self, "LICENSE", src=self.source_folder, dst="licenses") + copy(self, "NOTICE", src=self.source_folder, dst="licenses") + cmake = CMake(self) cmake.install() - tools.rmdir(os.path.join(self.package_folder, "share")) - - # TODO: to remove in conan v2 once cmake_find_package* generators removed - self._create_cmake_module_alias_targets( - os.path.join(self.package_folder, self._module_file_rel_path), - {"log4cxx": "log4cxx::log4cxx"} - ) - - @staticmethod - def _create_cmake_module_alias_targets(module_file, targets): - content = "" - for alias, aliased in targets.items(): - content += textwrap.dedent("""\ - if(TARGET {aliased} AND NOT TARGET {alias}) - add_library({alias} INTERFACE IMPORTED) - set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) - endif() - """.format(alias=alias, aliased=aliased)) - tools.save(module_file, content) - - @property - def _module_file_rel_path(self): - return os.path.join("lib", "cmake", "conan-official-{}-targets.cmake".format(self.name)) + rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "log4cxx") self.cpp_info.set_property("cmake_target_name", "log4cxx") self.cpp_info.set_property("pkg_config_name", "liblog4cxx") + self.cpp_info.libs = ["log4cxx"] if not self.options.shared: self.cpp_info.defines = ["LOG4CXX_STATIC"] - self.cpp_info.libs = ["log4cxx"] if self.settings.os == "Windows": self.cpp_info.system_libs = ["odbc32"] - - # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed - self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] - self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] - self.cpp_info.names["pkg_config"] = "liblog4cxx" + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["pthread"] diff --git a/recipes/log4cxx/all/patches/0002-find-apr.patch b/recipes/log4cxx/all/patches/0002-find-apr.patch new file mode 100644 index 0000000000000..174331cfd2a57 --- /dev/null +++ b/recipes/log4cxx/all/patches/0002-find-apr.patch @@ -0,0 +1,17 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -41,10 +41,12 @@ if(NOT BUILD_SHARED_LIBS) + endif() + + # Find Apache Runtime +-find_package(APR REQUIRED) ++find_package(apr REQUIRED) ++set(APR_LIBRARIES apr::apr) + + # Find Apache Runtime Utilities +-find_package(APR-Util REQUIRED) ++find_package(apr-util REQUIRED) ++set(APR_UTIL_LIBRARIES apr-util::apr-util) + + find_package( Threads REQUIRED ) + diff --git a/recipes/log4cxx/all/patches/0003-find-apr.patch b/recipes/log4cxx/all/patches/0003-find-apr.patch new file mode 100644 index 0000000000000..de12dbc43f660 --- /dev/null +++ b/recipes/log4cxx/all/patches/0003-find-apr.patch @@ -0,0 +1,18 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -51,11 +51,13 @@ endif() + + # Find Apache Runtime + option(APR_STATIC "Link to the APR static library" OFF) +-find_package(APR REQUIRED) ++find_package(apr REQUIRED) ++set(APR_LIBRARIES apr::apr) + + # Find Apache Runtime Utilities + option(APU_STATIC "Link to the APR-Util static library" OFF) +-find_package(APR-Util REQUIRED) ++find_package(apr-util REQUIRED) ++set(APR_UTIL_LIBRARIES apr-util::apr-util) + + find_package( Threads REQUIRED ) + diff --git a/recipes/log4cxx/all/test_package/CMakeLists.txt b/recipes/log4cxx/all/test_package/CMakeLists.txt index 4b7ef0dd16dbb..fa1c3c838f463 100644 --- a/recipes/log4cxx/all/test_package/CMakeLists.txt +++ b/recipes/log4cxx/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ cmake_minimum_required(VERSION 3.8) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(log4cxx REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} log4cxx) -target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17) +target_include_directories(${PROJECT_NAME} PRIVATE ${log4cxx_INCLUDE_DIR}) +target_link_libraries(${PROJECT_NAME} PRIVATE log4cxx) diff --git a/recipes/log4cxx/all/test_package/conanfile.py b/recipes/log4cxx/all/test_package/conanfile.py index 0aa45c8d4db18..8f4b70c22dd26 100644 --- a/recipes/log4cxx/all/test_package/conanfile.py +++ b/recipes/log4cxx/all/test_package/conanfile.py @@ -1,10 +1,18 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout import os - class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeDeps", "CMakeToolchain" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,7 +20,7 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): + if can_run(self): config_xml_name = os.path.join(self.source_folder, "log4cxx_config.xml") - bin_path = os.path.join("bin", "test_package") - self.run("{} {}".format(bin_path, config_xml_name), run_environment=True) + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run("{} {}".format(bin_path, config_xml_name), env="conanrun") From b362f67b6318c0be3be11d9cde8bb665f2d5cbd7 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Sat, 25 Mar 2023 13:24:49 +1100 Subject: [PATCH 03/96] Add patch descriptions and remove unused imports --- recipes/log4cxx/all/conandata.yml | 8 ++++++++ recipes/log4cxx/all/test_package/conanfile.py | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/recipes/log4cxx/all/conandata.yml b/recipes/log4cxx/all/conandata.yml index a0517ae10799b..439bd88175488 100644 --- a/recipes/log4cxx/all/conandata.yml +++ b/recipes/log4cxx/all/conandata.yml @@ -14,9 +14,17 @@ sources: patches: "0.12.1": - patch_file: "patches/0001-find-apr.patch" + patch_type: "conan" + patch_description: "Use conan generated apr, apr-util target names" "0.12.0": - patch_file: "patches/0001-find-apr.patch" + patch_type: "conan" + patch_description: "Use conan generated apr, apr-util target names" "0.13.0": - patch_file: "patches/0002-find-apr.patch" + patch_type: "conan" + patch_description: "Use conan generated apr, apr-util target names" "1.0.0": - patch_file: "patches/0003-find-apr.patch" + patch_type: "conan" + patch_description: "Use conan generated apr, apr-util target names" diff --git a/recipes/log4cxx/all/test_package/conanfile.py b/recipes/log4cxx/all/test_package/conanfile.py index 8f4b70c22dd26..c62801f661e54 100644 --- a/recipes/log4cxx/all/test_package/conanfile.py +++ b/recipes/log4cxx/all/test_package/conanfile.py @@ -1,6 +1,6 @@ from conan import ConanFile from conan.tools.build import can_run -from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout +from conan.tools.cmake import CMake, cmake_layout import os class TestPackageConan(ConanFile): From 129895b13e47c9b05a606b6f1e4f112685451c63 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Sat, 25 Mar 2023 13:33:18 +1100 Subject: [PATCH 04/96] Remove faulty 0.12.0 version --- recipes/log4cxx/all/conandata.yml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/recipes/log4cxx/all/conandata.yml b/recipes/log4cxx/all/conandata.yml index 439bd88175488..7cb72ab179c37 100644 --- a/recipes/log4cxx/all/conandata.yml +++ b/recipes/log4cxx/all/conandata.yml @@ -2,24 +2,17 @@ sources: "0.12.1": url: "https://archive.apache.org/dist/logging/log4cxx/0.12.1/apache-log4cxx-0.12.1.tar.gz" sha256: "7bea5cb477f0e31c838f0e1f4f498cc3b30c2eae74703ddda923e7e8c2268d22" - "0.12.0": - url: "https://archive.apache.org/dist/logging/log4cxx/0.12.0/apache-log4cxx-0.12.0.tar.gz" - sha256: "bd5b5009ca914c8fa7944b92ea6b4ca6fb7d146f65d526f21bf8b3c6a0520e44" "0.13.0": sha256: "4e5be64b6b1e6de8525f8b87635270b81f772a98902d20d7ac646fdf1ac08284" - url: "https://archive.apache.org/dist/logging/log4cxx//0.13.0/apache-log4cxx-0.13.0.tar.gz" + url: "https://archive.apache.org/dist/logging/log4cxx/0.13.0/apache-log4cxx-0.13.0.tar.gz" "1.0.0": sha256: "6df9f1f682650de6045309473d5b2fe1f798a03ceb36a74a5b21f5520962d32f" - url: "https://archive.apache.org/dist/logging/log4cxx//1.0.0/apache-log4cxx-1.0.0.tar.gz" + url: "https://archive.apache.org/dist/logging/log4cxx/1.0.0/apache-log4cxx-1.0.0.tar.gz" patches: "0.12.1": - patch_file: "patches/0001-find-apr.patch" patch_type: "conan" patch_description: "Use conan generated apr, apr-util target names" - "0.12.0": - - patch_file: "patches/0001-find-apr.patch" - patch_type: "conan" - patch_description: "Use conan generated apr, apr-util target names" "0.13.0": - patch_file: "patches/0002-find-apr.patch" patch_type: "conan" From 738e344bd6438190cfdaee0d389a0e8fe98222ea Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Sat, 25 Mar 2023 13:54:30 +1100 Subject: [PATCH 05/96] Remove unused CMakeLists.txt --- recipes/log4cxx/all/CMakeLists.txt | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 recipes/log4cxx/all/CMakeLists.txt diff --git a/recipes/log4cxx/all/CMakeLists.txt b/recipes/log4cxx/all/CMakeLists.txt deleted file mode 100644 index b83949de59dc5..0000000000000 --- a/recipes/log4cxx/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.13) -project(cmake_wrapper CXX) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory("source_subfolder") From 9179b5a15718e2816254404351c17e8c41a71b21 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Sat, 25 Mar 2023 14:31:44 +1100 Subject: [PATCH 06/96] Prevent compilation error with shared=False 0.13.0 version --- recipes/log4cxx/all/conandata.yml | 3 +++ .../patches/0002-fix-static-library-compilation.patch | 11 +++++++++++ 2 files changed, 14 insertions(+) create mode 100644 recipes/log4cxx/all/patches/0002-fix-static-library-compilation.patch diff --git a/recipes/log4cxx/all/conandata.yml b/recipes/log4cxx/all/conandata.yml index 7cb72ab179c37..96c4d767cb763 100644 --- a/recipes/log4cxx/all/conandata.yml +++ b/recipes/log4cxx/all/conandata.yml @@ -17,6 +17,9 @@ patches: - patch_file: "patches/0002-find-apr.patch" patch_type: "conan" patch_description: "Use conan generated apr, apr-util target names" + - patch_file: "patches/0002-fix-static-library-compilation.patch" + patch_type: "bugfix" + patch_description: "https://github.com/apache/logging-log4cxx/commit/09b5b723a1a210c28bf8b05b0676bb2b104359ba" "1.0.0": - patch_file: "patches/0003-find-apr.patch" patch_type: "conan" diff --git a/recipes/log4cxx/all/patches/0002-fix-static-library-compilation.patch b/recipes/log4cxx/all/patches/0002-fix-static-library-compilation.patch new file mode 100644 index 0000000000000..1e1868067293e --- /dev/null +++ b/recipes/log4cxx/all/patches/0002-fix-static-library-compilation.patch @@ -0,0 +1,11 @@ +--- a/src/main/cpp/threadutility.cpp ++++ b/src/main/cpp/threadutility.cpp +@@ -16,6 +16,9 @@ + */ + + #include "log4cxx/helpers/threadutility.h" ++#if !defined(LOG4CXX) ++ #define LOG4CXX 1 ++#endif + #include "log4cxx/private/log4cxx_private.h" + #include "log4cxx/helpers/loglog.h" From 51833eeacf79cee20367a74e44af272e9746c841 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Sat, 25 Mar 2023 15:10:57 +1100 Subject: [PATCH 07/96] Fix 0.12.1 build --- recipes/log4cxx/all/conandata.yml | 3 +++ .../log4cxx/all/patches/0002-fix-expat-target.patch | 11 +++++++++++ 2 files changed, 14 insertions(+) create mode 100644 recipes/log4cxx/all/patches/0002-fix-expat-target.patch diff --git a/recipes/log4cxx/all/conandata.yml b/recipes/log4cxx/all/conandata.yml index 96c4d767cb763..61c8f7ea0d734 100644 --- a/recipes/log4cxx/all/conandata.yml +++ b/recipes/log4cxx/all/conandata.yml @@ -13,6 +13,9 @@ patches: - patch_file: "patches/0001-find-apr.patch" patch_type: "conan" patch_description: "Use conan generated apr, apr-util target names" + - patch_file: "patches/0002-fix-expat-target.patch" + patch_type: "conan" + patch_description: "Use conan generated expat target name" "0.13.0": - patch_file: "patches/0002-find-apr.patch" patch_type: "conan" diff --git a/recipes/log4cxx/all/patches/0002-fix-expat-target.patch b/recipes/log4cxx/all/patches/0002-fix-expat-target.patch new file mode 100644 index 0000000000000..36ffedd2c9c64 --- /dev/null +++ b/recipes/log4cxx/all/patches/0002-fix-expat-target.patch @@ -0,0 +1,11 @@ +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -3,7 +3,7 @@ cmake_policy(SET CMP0079 NEW) + add_subdirectory(main) + target_compile_definitions(log4cxx PRIVATE ${LOG4CXX_COMPILE_DEFINITIONS} ${APR_COMPILE_DEFINITIONS} ${APR_UTIL_COMPILE_DEFINITIONS} ) + target_include_directories(log4cxx INTERFACE $ PRIVATE ${APR_INCLUDE_DIR} ${APR_UTIL_INCLUDE_DIR}) +-target_link_libraries(log4cxx PRIVATE ${APR_UTIL_LIBRARIES} EXPAT::EXPAT ${APR_LIBRARIES} ${APR_SYSTEM_LIBS}) ++target_link_libraries(log4cxx PRIVATE ${APR_UTIL_LIBRARIES} expat::expat ${APR_LIBRARIES} ${APR_SYSTEM_LIBS}) + if(WIN32) + # The ODBC appender is always enabled in the Windows configuration + target_link_libraries(log4cxx PRIVATE odbc32.lib) From e9b5593735608aaf7bebd50cd7895c61d5ef35ca Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Sat, 25 Mar 2023 15:30:16 +1100 Subject: [PATCH 08/96] Improve conan 2 compatability --- recipes/log4cxx/all/conanfile.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/recipes/log4cxx/all/conanfile.py b/recipes/log4cxx/all/conanfile.py index e6c6b313b208b..90e712a18d7bd 100644 --- a/recipes/log4cxx/all/conanfile.py +++ b/recipes/log4cxx/all/conanfile.py @@ -1,6 +1,8 @@ from conan import ConanFile from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout +from conan.tools.scm import Version +from conan.tools.build import check_min_cppstd from conan.errors import ConanInvalidConfiguration import os import textwrap @@ -40,6 +42,9 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": self.options.rm_safe("fPIC") + if Version(self.version) < "1.0.0": + self.options.rm_safe("with_multiprocess_rolling_file_appender") + self.options.rm_safe("with_networking") def configure(self): if self.options.shared: @@ -59,19 +64,21 @@ def _compilers_minimum_version(self): return { "gcc": "7", "Visual Studio": "15", + "msvc": "191", "clang": "5", "apple-clang": "10", } def validate(self): - if self.options.with_multiprocess_rolling_file_appender: + if self.options.get_safe("with_multiprocess_rolling_file_appender"): # TODO: if compiler doesn't support C++17, boost can be used instead if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, "17") + self.output.warning("multiprocess rolling file appender requires C++17.") + check_min_cppstd(self, "17") minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) if not minimum_version: - self.output.warn("multiprocess rolling file appender requires C++17. Your compiler is unknown. Assuming it supports C++17.") - elif tools.Version(self.settings.compiler.version) < minimum_version: + self.output.warning("multiprocess rolling file appender requires C++17. Your compiler is unknown. Assuming it supports C++17.") + elif Version(self.settings.compiler.version) < minimum_version: raise ConanInvalidConfiguration("multiprocess rolling file appender requires a compiler that supports at least C++17") def build_requirements(self): @@ -90,8 +97,9 @@ def _patch_sources(self): def generate(self): tc = CMakeToolchain(self) tc.variables["BUILD_TESTING"] = False - tc.variables["LOG4CXX_NETWORKING_SUPPORT"] = self.options.with_networking - tc.variables["LOG4CXX_MULTIPROCESS_ROLLING_FILE_APPENDER"] = self.options.with_multiprocess_rolling_file_appender + if Version(self.version) >= "1.0.0": + tc.variables["LOG4CXX_NETWORKING_SUPPORT"] = self.options.with_networking + tc.variables["LOG4CXX_MULTIPROCESS_ROLLING_FILE_APPENDER"] = self.options.with_multiprocess_rolling_file_appender tc.variables["LOG4CXX_WCHAR_T"] = self.options.with_wchar_t tc.variables["LOG4CXX_QT_SUPPORT"] = self.options.with_qt if self.settings.os == "Windows": From b9006b61765a8d49fc8b81feed5cbd7d287f0a4c Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Sat, 25 Mar 2023 15:41:29 +1100 Subject: [PATCH 09/96] Move patch description to patch source --- recipes/log4cxx/all/conandata.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recipes/log4cxx/all/conandata.yml b/recipes/log4cxx/all/conandata.yml index 61c8f7ea0d734..f7bff908d1f76 100644 --- a/recipes/log4cxx/all/conandata.yml +++ b/recipes/log4cxx/all/conandata.yml @@ -22,7 +22,8 @@ patches: patch_description: "Use conan generated apr, apr-util target names" - patch_file: "patches/0002-fix-static-library-compilation.patch" patch_type: "bugfix" - patch_description: "https://github.com/apache/logging-log4cxx/commit/09b5b723a1a210c28bf8b05b0676bb2b104359ba" + patch_description: "Prevent compilation error when shared=False" + patch_source: "https://github.com/apache/logging-log4cxx/commit/09b5b723a1a210c28bf8b05b0676bb2b104359ba" "1.0.0": - patch_file: "patches/0003-find-apr.patch" patch_type: "conan" From 7a00cd269a8bae0f4f52965d07ba62b07d191bb3 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Sat, 25 Mar 2023 17:56:41 +1100 Subject: [PATCH 10/96] Improve compiler version warning messages --- recipes/log4cxx/all/conanfile.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/recipes/log4cxx/all/conanfile.py b/recipes/log4cxx/all/conanfile.py index 90e712a18d7bd..b8a58aaa43a86 100644 --- a/recipes/log4cxx/all/conanfile.py +++ b/recipes/log4cxx/all/conanfile.py @@ -72,14 +72,15 @@ def _compilers_minimum_version(self): def validate(self): if self.options.get_safe("with_multiprocess_rolling_file_appender"): # TODO: if compiler doesn't support C++17, boost can be used instead - if self.settings.compiler.get_safe("cppstd"): - self.output.warning("multiprocess rolling file appender requires C++17.") - check_min_cppstd(self, "17") + self.output.warning("multiprocess rolling file appender requires C++17.") minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + compiler_version = Version(self.settings.compiler.version) if not minimum_version: - self.output.warning("multiprocess rolling file appender requires C++17. Your compiler is unknown. Assuming it supports C++17.") - elif Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration("multiprocess rolling file appender requires a compiler that supports at least C++17") + self.output.warning("Your compiler is unknown. Assuming it supports C++17.") + elif compiler_version < minimum_version: + raise ConanInvalidConfiguration(f"{self.settings.compiler} {compiler_version} does not support C++17: Requies {minimum_version}") + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, "17") def build_requirements(self): if self.settings.os != "Windows": From a66870395765a9794de3e61e29fd2a98b54b47ad Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Sun, 26 Mar 2023 15:18:40 +1100 Subject: [PATCH 11/96] Fix 0.13.0 build --- recipes/log4cxx/all/conandata.yml | 4 ++ .../0002-fix-static-library-compilation.patch | 1 + .../all/patches/0003-logchar-type.patch | 44 +++++++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 recipes/log4cxx/all/patches/0003-logchar-type.patch diff --git a/recipes/log4cxx/all/conandata.yml b/recipes/log4cxx/all/conandata.yml index f7bff908d1f76..5776f9b072a47 100644 --- a/recipes/log4cxx/all/conandata.yml +++ b/recipes/log4cxx/all/conandata.yml @@ -24,6 +24,10 @@ patches: patch_type: "bugfix" patch_description: "Prevent compilation error when shared=False" patch_source: "https://github.com/apache/logging-log4cxx/commit/09b5b723a1a210c28bf8b05b0676bb2b104359ba" + - patch_file: "patches/0003-logchar-type.patch" + patch_type: "bugfix" + patch_description: "Prevent compilation errors when with_wchar_t=False" + patch_source: "https://github.com/apache/logging-log4cxx/commit/5109466a844d1e5fb8b455a23077765a30325a24" "1.0.0": - patch_file: "patches/0003-find-apr.patch" patch_type: "conan" diff --git a/recipes/log4cxx/all/patches/0002-fix-static-library-compilation.patch b/recipes/log4cxx/all/patches/0002-fix-static-library-compilation.patch index 1e1868067293e..53bcabf38e8da 100644 --- a/recipes/log4cxx/all/patches/0002-fix-static-library-compilation.patch +++ b/recipes/log4cxx/all/patches/0002-fix-static-library-compilation.patch @@ -9,3 +9,4 @@ +#endif #include "log4cxx/private/log4cxx_private.h" #include "log4cxx/helpers/loglog.h" + diff --git a/recipes/log4cxx/all/patches/0003-logchar-type.patch b/recipes/log4cxx/all/patches/0003-logchar-type.patch new file mode 100644 index 0000000000000..c62b87d4185ec --- /dev/null +++ b/recipes/log4cxx/all/patches/0003-logchar-type.patch @@ -0,0 +1,44 @@ +diff --git a/src/main/cpp/threadutility.cpp b/src/main/cpp/threadutility.cpp +index c14c12fd..057ecd86 100644 +--- a/src/main/cpp/threadutility.cpp ++++ b/src/main/cpp/threadutility.cpp +@@ -116,11 +116,13 @@ void ThreadUtility::threadStartedNameThread(LogString threadName, + std::thread::id /*threadId*/, + std::thread::native_handle_type nativeHandle){ + #if LOG4CXX_HAS_PTHREAD_SETNAME +- if( pthread_setname_np( static_cast( nativeHandle ), threadName.c_str() ) < 0 ){ +- LOGLOG_ERROR( LOG4CXX_STR("unable to set thread name") ); ++ LOG4CXX_ENCODE_CHAR(sthreadName, threadName); ++ if (pthread_setname_np(static_cast(nativeHandle), sthreadName.c_str()) < 0) { ++ LOGLOG_ERROR(LOG4CXX_STR("unable to set thread name")); + } + #elif LOG4CXX_HAS_SETTHREADDESCRIPTION +- HRESULT hr = SetThreadDescription(static_cast(nativeHandle), threadName.c_str()); ++ LOG4CXX_ENCODE_WCHAR(wthreadName, threadName); ++ HRESULT hr = SetThreadDescription(static_cast(nativeHandle), wthreadName.c_str()); + if(FAILED(hr)){ + LOGLOG_ERROR( LOG4CXX_STR("unable to set thread name") ); + } +diff --git a/src/main/include/CMakeLists.txt b/src/main/include/CMakeLists.txt +index e31443fb..32122e41 100644 +--- a/src/main/include/CMakeLists.txt ++++ b/src/main/include/CMakeLists.txt +@@ -39,9 +39,18 @@ endif() + + if(${LOG4CXX_CHAR} STREQUAL "unichar") + set(LOGCHAR_IS_UNICHAR 1) ++ set(LOGCHAR_IS_WCHAR 0) ++ set(LOGCHAR_IS_UTF8 0) + elseif(${LOG4CXX_CHAR} STREQUAL "wchar_t") + set(LOGCHAR_IS_WCHAR 1) ++ set(LOGCHAR_IS_UNICHAR 0) ++ set(LOGCHAR_IS_UTF8 0) ++elseif(${LOG4CXX_CHAR} STREQUAL "utf-8") ++ set(LOGCHAR_IS_UNICHAR 0) ++ set(LOGCHAR_IS_WCHAR 0) ++ set(LOGCHAR_IS_UTF8 1) + endif() ++ + option(LOG4CXX_WCHAR_T "Enable wchar_t API methods" ON) + option(LOG4CXX_UNICHAR "Enable UniChar API methods" OFF) + set(INIT_IOS_BASE 0) From b2bcf3b9842e0a10b75a59ba502061a1d8035476 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Sun, 26 Mar 2023 16:58:32 +1100 Subject: [PATCH 12/96] Fix 0.12.1 build when with_wchar_t=False --- recipes/log4cxx/all/conandata.yml | 4 ++++ .../all/patches/0002-logchar-type.patch | 21 +++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 recipes/log4cxx/all/patches/0002-logchar-type.patch diff --git a/recipes/log4cxx/all/conandata.yml b/recipes/log4cxx/all/conandata.yml index 5776f9b072a47..3d1d8b9932fec 100644 --- a/recipes/log4cxx/all/conandata.yml +++ b/recipes/log4cxx/all/conandata.yml @@ -16,6 +16,10 @@ patches: - patch_file: "patches/0002-fix-expat-target.patch" patch_type: "conan" patch_description: "Use conan generated expat target name" + - patch_file: "patches/0002-logchar-type.patch" + patch_type: "bugfix" + patch_description: "Prevent compilation errors when with_wchar_t=False" + patch_source: "https://github.com/apache/logging-log4cxx/commit/5109466a844d1e5fb8b455a23077765a30325a24" "0.13.0": - patch_file: "patches/0002-find-apr.patch" patch_type: "conan" diff --git a/recipes/log4cxx/all/patches/0002-logchar-type.patch b/recipes/log4cxx/all/patches/0002-logchar-type.patch new file mode 100644 index 0000000000000..a59e3639553ae --- /dev/null +++ b/recipes/log4cxx/all/patches/0002-logchar-type.patch @@ -0,0 +1,21 @@ +--- a/src/main/include/CMakeLists.txt ++++ b/src/main/include/CMakeLists.txt +@@ -22,9 +22,18 @@ endif() + + if(${LOG4CXX_CHAR} STREQUAL "unichar") + set(LOGCHAR_IS_UNICHAR 1) ++ set(LOGCHAR_IS_WCHAR 0) ++ set(LOGCHAR_IS_UTF8 0) + elseif(${LOG4CXX_CHAR} STREQUAL "wchar_t") + set(LOGCHAR_IS_WCHAR 1) ++ set(LOGCHAR_IS_UNICHAR 0) ++ set(LOGCHAR_IS_UTF8 0) ++elseif(${LOG4CXX_CHAR} STREQUAL "utf-8") ++ set(LOGCHAR_IS_UNICHAR 0) ++ set(LOGCHAR_IS_WCHAR 0) ++ set(LOGCHAR_IS_UTF8 1) + endif() ++ + option(LOG4CXX_WCHAR_T "Enable wchar_t API methods" ON) + option(LOG4CXX_UNICHAR "Enable UniChar API methods" OFF) + set(INIT_IOS_BASE 0) From 15fbe7f8bfc23758f12b9268400d283d5242efe5 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Mon, 27 Mar 2023 13:02:41 +1100 Subject: [PATCH 13/96] Revert "apr-util: Upgrade to be conan 2 compatibile" This reverts commit 0db1dd93b28e86deb0326ea8756f5fe9912e9069. --- recipes/apr-util/all/CMakeLists.txt | 7 + recipes/apr-util/all/conandata.yml | 21 +-- recipes/apr-util/all/conanfile.py | 159 +++++++++--------- .../0004-set-min-cmake-version-first.patch | 15 -- .../patches/0005-fix-expat-found-test.patch | 11 -- .../apr-util/all/test_package/CMakeLists.txt | 8 +- .../apr-util/all/test_package/conanfile.py | 25 ++- 7 files changed, 110 insertions(+), 136 deletions(-) create mode 100644 recipes/apr-util/all/CMakeLists.txt delete mode 100644 recipes/apr-util/all/patches/0004-set-min-cmake-version-first.patch delete mode 100644 recipes/apr-util/all/patches/0005-fix-expat-found-test.patch diff --git a/recipes/apr-util/all/CMakeLists.txt b/recipes/apr-util/all/CMakeLists.txt new file mode 100644 index 0000000000000..2a122ebfa3606 --- /dev/null +++ b/recipes/apr-util/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.8.12) +project(cmake_wrapper C) + +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 index c21350dae0d31..54e26418aee59 100644 --- a/recipes/apr-util/all/conandata.yml +++ b/recipes/apr-util/all/conandata.yml @@ -4,20 +4,11 @@ sources: url: - "https://archive.apache.org/dist/apr/apr-util-1.6.1.tar.gz" - "https://downloads.apache.org/apr/apr-util-1.6.1.tar.gz" - "1.6.3": - sha256: "a41076e3710746326c3945042994ad9a4fcac0ce0277dd8fea076fec3c9772b5" - url: - - "https://archive.apache.org/dist/apr/apr-util-1.6.3.tar.gz" - - "https://downloads.apache.org/apr/apr-util-1.6.3.tar.gz" patches: "1.6.1": - - patch_file: "patches/0001-cmake-build-only-shared-static.patch" - - patch_file: "patches/0002-apu-config-prefix-env.patch" - - patch_file: "patches/0003-disable-check-APR_LIBRARIES.patch" - - patch_file: "patches/0004-set-min-cmake-version-first.patch" - - patch_file: "patches/0005-fix-expat-found-test.patch" - "1.6.3": - - patch_file: "patches/0001-cmake-build-only-shared-static.patch" - - patch_file: "patches/0002-apu-config-prefix-env.patch" - - patch_file: "patches/0003-disable-check-APR_LIBRARIES.patch" - - patch_file: "patches/0004-set-min-cmake-version-first.patch" + - 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 index 82f2e9f25251e..f7c03746e3c19 100644 --- a/recipes/apr-util/all/conanfile.py +++ b/recipes/apr-util/all/conanfile.py @@ -1,28 +1,20 @@ -from conan import ConanFile -from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout -from conan.tools.env import VirtualBuildEnv -from conan.tools.gnu import Autotools, AutotoolsToolchain -from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rm, rmdir -from conan.errors import ConanInvalidConfiguration -from conan.tools.build import cross_building -from conan.tools.microsoft import is_msvc +from conans import AutoToolsBuildEnvironment, ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration import os -required_conan_version = ">=1.54.0" +required_conan_version = ">=1.33.0" class AprUtilConan(ConanFile): name = "apr-util" - description = ( - "The Apache Portable Runtime (APR) provides a predictable and consistent " - "interface to underlying platform-specific implementations" - ) + description = "The Apache Portable Runtime (APR) provides a predictable and consistent interface to underlying platform-specific implementations" license = "Apache-2.0" topics = ("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], @@ -53,29 +45,37 @@ class AprUtilConan(ConanFile): "with_ldap": False, } - def export_sources(self): - export_conandata_patches(self) + _autotools = None + _cmake = None def config_options(self): if self.settings.os == "Windows": - self.options.rm_safe("fPIC") + del self.options.fPIC def configure(self): if self.options.shared: - self.options.rm_safe("fPIC") - self.settings.rm_safe("compiler.cppstd") - self.settings.rm_safe("compiler.libcxx") + 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]") + self.requires("apr/1.7.0") if self.settings.os != "Windows": #cmake build doesn't allow injection of iconv yet - self.requires("libiconv/[>=1.16]") + self.requires("libiconv/1.16") if self.options.with_openssl: - self.requires("openssl/[>=1.1]") + self.requires("openssl/1.1.1k") if self.options.with_nss: # self.requires("nss/x.y.z") raise ConanInvalidConfiguration("CCI has no nss recipe (yet)") @@ -98,80 +98,90 @@ def requirements(self): # self.requires("ldap/x.y.z") raise ConanInvalidConfiguration("CCI has no ldap recipe (yet)") if self.options.with_mysql: - self.requires("libmysqlclient/[>=8.0]") + self.requires("libmysqlclient/8.0.25") if self.options.with_sqlite3: - self.requires("sqlite3/[>=3.35]") + self.requires("sqlite3/3.35.5") if self.options.with_expat: - self.requires("expat/[>=2.4]") + self.requires("expat/2.4.1") if self.options.with_postgresql: - self.requires("libpq/[>=13.2]") + self.requires("libpq/13.2") def source(self): - get(self, **self.conan_data["sources"][self.version], strip_root=True) + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) def validate(self): - if self.options.shared != self.dependencies["apr"].options.shared: + if self.options.shared != self.options["apr"].shared: raise ConanInvalidConfiguration("apr-util must be built with same shared option as apr") + 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 generate(self): - if is_msvc(self): - tc = CMakeToolchain(self) - tc.variables["INSTALL_PDB"] = False - tc.variables["APR_INCLUDE_DIR"] = ";".join(self.dependencies["apr"].cpp_info.includedirs).replace("\\", "/") - tc.variables["APU_HAVE_CRYPTO"] = self._with_crypto - tc.variables["APR_HAS_LDAP"] = self.options.with_ldap - tc.generate() - cmake_deps = CMakeDeps(self) - cmake_deps.generate() - else: - env = VirtualBuildEnv(self) - env.generate() - tc = AutotoolsToolchain(self) - tc.configure_args.append("--with-installbuilddir=${prefix}/res/build-1") - tc.configure_args.append("--with-apr={}".format(self.dependencies["apr"].package_folder)) - tc.configure_args.append("--with-crypto" if self._with_crypto else "--without-crypto") - tc.configure_args.append("--with-iconv={}".format(self.dependencies["libiconv"].package_folder)) - tc.configure_args.append("--with-openssl={}".format(self.dependencies["openssl"].package_folder) if self.options.with_openssl else "--without-openssl") - tc.configure_args.append("--with-expat={}".format(self.dependencies["expat"].package_folder) if self.options.with_expat else "--without-expat") - tc.configure_args.append("--with-mysql={}".format(self.dependencies["libmysqlclient"].package_folder) if self.options.with_mysql else "--without-mysql") - tc.configure_args.append("--with-pgsql={}".format(self.dependencies["libpq"].package_folder) if self.options.with_postgresql else "--without-pgsql") - tc.configure_args.append("--with-sqlite3={}".format(self.dependencies["sqlite3"].package_folder) if self.options.with_sqlite3 else "--without-sqlite3") - tc.configure_args.append("--with-ldap={}".format(self.dependencies["ldap"].package_folder) if self.options.with_ldap else "--without-ldap") - tc.configure_args.append("--with-berkeley-db={}".format(self.dependencies["libdb"].package_folder) if self.options.dbm == "db" else "--without-berkeley-db") - tc.configure_args.append("--with-gdbm={}".format(self.dependencies["gdbm"].package_folder) if self.options.dbm == "gdbm" else "--without-gdbm") - tc.configure_args.append("--with-ndbm={}".format(self.dependencies["ndbm"].package_folder) if self.options.dbm == "ndbm" else "--without-ndbm") - if self.options.dbm: - tc.configure_args.append("--with-dbm={}".format(self.options.dbm)) - if cross_building(self): - tc.configure_args.append("apr_cv_mutex_robust_shared=yes") - tc.generate() + 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-iconv={}".format(tools.unix_path(self.deps_cpp_info["libiconv"].rootpath)), + "--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): - apply_conandata_patches(self) + self._patch_sources() if self.settings.os == "Windows": - cmake = CMake(self) - cmake.configure() + cmake = self._configure_cmake() cmake.build() else: autotools = self._configure_autotools() autotools.make() def package(self): - copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) if self.settings.os == "Windows": - cmake = CMake(self) + cmake = self._configure_cmake() cmake.install() else: - autotools = Autotools(self) + autotools = self._configure_autotools() autotools.install() - rm(self, "*.la", os.path.join(self.package_folder, "apr-util-1", "lib")) - rm(self, "*.la", os.path.join(self.package_folder, "lib")) - rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) - rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + tools.remove_files_by_mask(os.path.join(self.package_folder, "lib", "apr-util-1"), "*.la") + 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" @@ -184,14 +194,13 @@ def package_info(self): elif self.settings.os == "Windows": self.cpp_info.system_libs = ["mswsock", "rpcrt4", "ws2_32"] - # TODO: to remove in conan v2 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 = self.package_folder + 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 != "msvc": - self.env_info.APRUTIL_LDFLAGS = " ".join("-L{}".format(l) for l in self.deps_cpp_info.lib_paths) + 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/0004-set-min-cmake-version-first.patch b/recipes/apr-util/all/patches/0004-set-min-cmake-version-first.patch deleted file mode 100644 index 100ee6388bf3f..0000000000000 --- a/recipes/apr-util/all/patches/0004-set-min-cmake-version-first.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -15,10 +15,10 @@ - # - # Read README.cmake before using this. - --PROJECT(APR-Util C) -- - CMAKE_MINIMUM_REQUIRED(VERSION 2.8) - -+PROJECT(APR-Util C) -+ - FIND_PACKAGE(OpenSSL) - - FIND_PACKAGE(expat) diff --git a/recipes/apr-util/all/patches/0005-fix-expat-found-test.patch b/recipes/apr-util/all/patches/0005-fix-expat-found-test.patch deleted file mode 100644 index d9e38672eae70..0000000000000 --- a/recipes/apr-util/all/patches/0005-fix-expat-found-test.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -21,7 +21,7 @@ PROJECT(APR-Util C) - - FIND_PACKAGE(OpenSSL) - --FIND_PACKAGE(expat) -+FIND_PACKAGE(EXPAT MODULE) - - OPTION(APU_HAVE_CRYPTO "Crypto support" OFF) - OPTION(APU_HAVE_ODBC "Build ODBC DBD driver" ON) diff --git a/recipes/apr-util/all/test_package/CMakeLists.txt b/recipes/apr-util/all/test_package/CMakeLists.txt index b4ea1db79c3f4..f8b971e2db377 100644 --- a/recipes/apr-util/all/test_package/CMakeLists.txt +++ b/recipes/apr-util/all/test_package/CMakeLists.txt @@ -1,10 +1,8 @@ cmake_minimum_required(VERSION 3.1) project(test_package LANGUAGES C) -find_package(apr REQUIRED CONFIG) - -find_package(apr-util REQUIRED CONFIG) +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() add_executable(${PROJECT_NAME} test_package.c) -target_include_directories(${PROJECT_NAME} PRIVATE ${apr_INCLUDE_DIR} ${apr-util_INCLUDE_DIR}) -target_link_libraries(${PROJECT_NAME} PRIVATE apr-util::apr-util apr::apr) +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 index 5d3a839553e33..9952431a15adf 100644 --- a/recipes/apr-util/all/test_package/conanfile.py +++ b/recipes/apr-util/all/test_package/conanfile.py @@ -1,19 +1,11 @@ -from conan import ConanFile -from conan.tools.build import can_run -from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout import os -class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "CMakeDeps", "CMakeToolchain" - test_type = "explicit" +from conans import ConanFile, CMake, tools - def layout(self): - cmake_layout(self) - def requirements(self): - self.requires(self.tested_reference_str) - self.requires("apr/[>=1.7]") +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" def build(self): cmake = CMake(self) @@ -21,6 +13,9 @@ def build(self): cmake.build() def test(self): - if can_run(self): - bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - self.run(bin_path, env="conanrun") + 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) From f229464cb07ac9a2e2a582ec5fb15eb3be7f9d53 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Mon, 27 Mar 2023 13:10:44 +1100 Subject: [PATCH 14/96] Fix Linter errors --- recipes/log4cxx/all/conanfile.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/recipes/log4cxx/all/conanfile.py b/recipes/log4cxx/all/conanfile.py index b8a58aaa43a86..9e95cf6eecafa 100644 --- a/recipes/log4cxx/all/conanfile.py +++ b/recipes/log4cxx/all/conanfile.py @@ -1,11 +1,10 @@ from conan import ConanFile -from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout from conan.tools.scm import Version from conan.tools.build import check_min_cppstd from conan.errors import ConanInvalidConfiguration import os -import textwrap required_conan_version = ">=1.54.0" @@ -57,7 +56,7 @@ def requirements(self): if self.settings.os != "Windows": self.requires("odbc/[>=2.3]") if self.options.get_safe("with_qt"): - self.requires("qt/[>=5.15]") + self.requires("qt/[>=5.15 <6]") @property def _compilers_minimum_version(self): @@ -87,10 +86,10 @@ def build_requirements(self): self.tool_requires("pkgconf/1.7.4") def layout(self): - cmake_layout(self) + cmake_layout(self, src_folder=".") def source(self): - get(self, **self.conan_data["sources"][self.version], strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def _patch_sources(self): apply_conandata_patches(self) From f0cfc651d5492f23527e19d215f7555c579da486 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Mon, 27 Mar 2023 13:14:11 +1100 Subject: [PATCH 15/96] Fix Linter errors --- recipes/log4cxx/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/log4cxx/all/conanfile.py b/recipes/log4cxx/all/conanfile.py index 9e95cf6eecafa..8ba23d259755c 100644 --- a/recipes/log4cxx/all/conanfile.py +++ b/recipes/log4cxx/all/conanfile.py @@ -86,7 +86,7 @@ def build_requirements(self): self.tool_requires("pkgconf/1.7.4") def layout(self): - cmake_layout(self, src_folder=".") + cmake_layout(self, src_folder="src") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) From 1674f2bb1a217d23de6099d58a63ac47957b2ab8 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Tue, 28 Mar 2023 12:33:53 +1100 Subject: [PATCH 16/96] Prevent build failure when compiler.cppstd=14 --- recipes/log4cxx/all/conandata.yml | 4 ++++ .../all/patches/0001-pre-cxx17-compilers.patch | 12 ++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 recipes/log4cxx/all/patches/0001-pre-cxx17-compilers.patch diff --git a/recipes/log4cxx/all/conandata.yml b/recipes/log4cxx/all/conandata.yml index 3d1d8b9932fec..bf99ef4b8f173 100644 --- a/recipes/log4cxx/all/conandata.yml +++ b/recipes/log4cxx/all/conandata.yml @@ -33,6 +33,10 @@ patches: patch_description: "Prevent compilation errors when with_wchar_t=False" patch_source: "https://github.com/apache/logging-log4cxx/commit/5109466a844d1e5fb8b455a23077765a30325a24" "1.0.0": + - patch_file: "patches/0001-pre-cxx17-compilers.patch" + patch_type: "bugfix" + patch_description: "Prevent build failure when compiler.cppstd=14" + patch_source: "https://github.com/apache/logging-log4cxx/commit/0b83584592290cb539f90ab79fc542d60cc3ba23" - patch_file: "patches/0003-find-apr.patch" patch_type: "conan" patch_description: "Use conan generated apr, apr-util target names" diff --git a/recipes/log4cxx/all/patches/0001-pre-cxx17-compilers.patch b/recipes/log4cxx/all/patches/0001-pre-cxx17-compilers.patch new file mode 100644 index 0000000000000..2a3df8456a23b --- /dev/null +++ b/recipes/log4cxx/all/patches/0001-pre-cxx17-compilers.patch @@ -0,0 +1,12 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -240,9 +240,6 @@ endif() + # + # Check for any fatal configuration errors + # +-if( "${SHARED_MUTEX_IMPL}" STREQUAL "NONE" ) +- message( FATAL_ERROR "No shared_mutex implementation found. Requires Boost or C++17" ) +-endif() + + # + # Output configuration information From 17ea685f3641fe540c8b818f331bf01f89e17033 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Mon, 3 Apr 2023 08:57:07 +1000 Subject: [PATCH 17/96] Restore conan v1 test_package as test_v1_package --- .../log4cxx/all/test_package/CMakeLists.txt | 9 +++++--- recipes/log4cxx/all/test_package/conanfile.py | 22 ++++++------------- .../all/test_v1_package/CMakeLists.txt | 11 ++++++++++ .../log4cxx/all/test_v1_package/conanfile.py | 18 +++++++++++++++ .../all/test_v1_package/log4cxx_config.xml | 22 +++++++++++++++++++ .../all/test_v1_package/test_package.cpp | 20 +++++++++++++++++ recipes/log4cxx/config.yml | 4 +++- 7 files changed, 87 insertions(+), 19 deletions(-) create mode 100644 recipes/log4cxx/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/log4cxx/all/test_v1_package/conanfile.py create mode 100644 recipes/log4cxx/all/test_v1_package/log4cxx_config.xml create mode 100644 recipes/log4cxx/all/test_v1_package/test_package.cpp diff --git a/recipes/log4cxx/all/test_package/CMakeLists.txt b/recipes/log4cxx/all/test_package/CMakeLists.txt index fa1c3c838f463..d61945ab89603 100644 --- a/recipes/log4cxx/all/test_package/CMakeLists.txt +++ b/recipes/log4cxx/all/test_package/CMakeLists.txt @@ -1,8 +1,11 @@ cmake_minimum_required(VERSION 3.8) -project(test_package CXX) +project(test_package LANGUAGES CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) find_package(log4cxx REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_include_directories(${PROJECT_NAME} PRIVATE ${log4cxx_INCLUDE_DIR}) -target_link_libraries(${PROJECT_NAME} PRIVATE log4cxx) +target_link_libraries(${PROJECT_NAME} log4cxx) +target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_11) diff --git a/recipes/log4cxx/all/test_package/conanfile.py b/recipes/log4cxx/all/test_package/conanfile.py index c62801f661e54..0aa45c8d4db18 100644 --- a/recipes/log4cxx/all/test_package/conanfile.py +++ b/recipes/log4cxx/all/test_package/conanfile.py @@ -1,18 +1,10 @@ -from conan import ConanFile -from conan.tools.build import can_run -from conan.tools.cmake import CMake, cmake_layout +from conans import ConanFile, CMake, tools import os -class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "CMakeDeps", "CMakeToolchain" - test_type = "explicit" - - def layout(self): - cmake_layout(self) - def requirements(self): - self.requires(self.tested_reference_str) +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" def build(self): cmake = CMake(self) @@ -20,7 +12,7 @@ def build(self): cmake.build() def test(self): - if can_run(self): + if not tools.cross_building(self): config_xml_name = os.path.join(self.source_folder, "log4cxx_config.xml") - bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - self.run("{} {}".format(bin_path, config_xml_name), env="conanrun") + bin_path = os.path.join("bin", "test_package") + self.run("{} {}".format(bin_path, config_xml_name), run_environment=True) diff --git a/recipes/log4cxx/all/test_v1_package/CMakeLists.txt b/recipes/log4cxx/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..4b7ef0dd16dbb --- /dev/null +++ b/recipes/log4cxx/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(log4cxx REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} log4cxx) +target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17) diff --git a/recipes/log4cxx/all/test_v1_package/conanfile.py b/recipes/log4cxx/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..0aa45c8d4db18 --- /dev/null +++ b/recipes/log4cxx/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + config_xml_name = os.path.join(self.source_folder, "log4cxx_config.xml") + bin_path = os.path.join("bin", "test_package") + self.run("{} {}".format(bin_path, config_xml_name), run_environment=True) diff --git a/recipes/log4cxx/all/test_v1_package/log4cxx_config.xml b/recipes/log4cxx/all/test_v1_package/log4cxx_config.xml new file mode 100644 index 0000000000000..4269f78dd989e --- /dev/null +++ b/recipes/log4cxx/all/test_v1_package/log4cxx_config.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/recipes/log4cxx/all/test_v1_package/test_package.cpp b/recipes/log4cxx/all/test_v1_package/test_package.cpp new file mode 100644 index 0000000000000..4e52b04611957 --- /dev/null +++ b/recipes/log4cxx/all/test_v1_package/test_package.cpp @@ -0,0 +1,20 @@ +#include "log4cxx/logger.h" +#include "log4cxx/xml/domconfigurator.h" + +#include + +using namespace log4cxx; +using namespace log4cxx::xml; + +int main(int argc, const char* argv[]) +{ + LoggerPtr logger(Logger::getLogger("TEST")); + if (argc < 2) { + std::cerr << "Expected path to config xml\n"; + return -1; + } + DOMConfigurator::configure(argv[1]); + LOG4CXX_INFO(logger, "App started!"); + LOG4CXX_ERROR(logger, "Some error!"); + return 0; +} diff --git a/recipes/log4cxx/config.yml b/recipes/log4cxx/config.yml index f5578f6ffba14..bb558b7de42dc 100644 --- a/recipes/log4cxx/config.yml +++ b/recipes/log4cxx/config.yml @@ -1,5 +1,7 @@ versions: "0.12.1": folder: all - "0.12.0": + "0.13.0": + folder: all + "1.0.0": folder: all From 85d3e1b2bdee76b046f91463a47027e8d16bcf9a Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Mon, 3 Apr 2023 09:42:03 +1000 Subject: [PATCH 18/96] Restore conan v1 test_package as test_v1_package --- .../log4cxx/all/test_package/CMakeLists.txt | 9 +++----- recipes/log4cxx/all/test_package/conanfile.py | 22 +++++++++++++------ 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/recipes/log4cxx/all/test_package/CMakeLists.txt b/recipes/log4cxx/all/test_package/CMakeLists.txt index d61945ab89603..fa1c3c838f463 100644 --- a/recipes/log4cxx/all/test_package/CMakeLists.txt +++ b/recipes/log4cxx/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ cmake_minimum_required(VERSION 3.8) -project(test_package LANGUAGES CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +project(test_package CXX) find_package(log4cxx REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} log4cxx) -target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_11) +target_include_directories(${PROJECT_NAME} PRIVATE ${log4cxx_INCLUDE_DIR}) +target_link_libraries(${PROJECT_NAME} PRIVATE log4cxx) diff --git a/recipes/log4cxx/all/test_package/conanfile.py b/recipes/log4cxx/all/test_package/conanfile.py index 0aa45c8d4db18..c62801f661e54 100644 --- a/recipes/log4cxx/all/test_package/conanfile.py +++ b/recipes/log4cxx/all/test_package/conanfile.py @@ -1,10 +1,18 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout import os - class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeDeps", "CMakeToolchain" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -12,7 +20,7 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): + if can_run(self): config_xml_name = os.path.join(self.source_folder, "log4cxx_config.xml") - bin_path = os.path.join("bin", "test_package") - self.run("{} {}".format(bin_path, config_xml_name), run_environment=True) + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run("{} {}".format(bin_path, config_xml_name), env="conanrun") From c7ce0a061b8922f4dbef9a3f9802da2179d9e06f Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Mon, 3 Apr 2023 09:55:26 +1000 Subject: [PATCH 19/96] Prevent 'odbc/2.3.11' requires 'libiconv/1.17' while 'apr-util/1.6.1' requires 'libiconv/1.16' --- recipes/log4cxx/all/conandata.yml | 6 +++ recipes/log4cxx/all/conanfile.py | 7 +++- .../all/patches/0001-make-odbc-optional.patch | 39 +++++++++++++++++++ .../all/patches/0002-make-odbc-optional.patch | 39 +++++++++++++++++++ .../all/patches/0003-make-odbc-optional.patch | 39 +++++++++++++++++++ 5 files changed, 128 insertions(+), 2 deletions(-) create mode 100644 recipes/log4cxx/all/patches/0001-make-odbc-optional.patch create mode 100644 recipes/log4cxx/all/patches/0002-make-odbc-optional.patch create mode 100644 recipes/log4cxx/all/patches/0003-make-odbc-optional.patch diff --git a/recipes/log4cxx/all/conandata.yml b/recipes/log4cxx/all/conandata.yml index bf99ef4b8f173..20940256f4993 100644 --- a/recipes/log4cxx/all/conandata.yml +++ b/recipes/log4cxx/all/conandata.yml @@ -10,6 +10,9 @@ sources: url: "https://archive.apache.org/dist/logging/log4cxx/1.0.0/apache-log4cxx-1.0.0.tar.gz" patches: "0.12.1": + - patch_file: "patches/0001-make-odbc-optional.patch" + patch_type: "conan" + patch_description: "Prevent 'odbc/2.3.11' requires 'libiconv/1.17' while 'apr-util/1.6.1' requires 'libiconv/1.16'" - patch_file: "patches/0001-find-apr.patch" patch_type: "conan" patch_description: "Use conan generated apr, apr-util target names" @@ -37,6 +40,9 @@ patches: patch_type: "bugfix" patch_description: "Prevent build failure when compiler.cppstd=14" patch_source: "https://github.com/apache/logging-log4cxx/commit/0b83584592290cb539f90ab79fc542d60cc3ba23" + - patch_file: "patches/0003-make-odbc-optional.patch" + patch_type: "conan" + patch_description: "Prevent 'odbc/2.3.11' requires 'libiconv/1.17' while 'apr-util/1.6.1' requires 'libiconv/1.16'" - patch_file: "patches/0003-find-apr.patch" patch_type: "conan" patch_description: "Use conan generated apr, apr-util target names" diff --git a/recipes/log4cxx/all/conanfile.py b/recipes/log4cxx/all/conanfile.py index 8ba23d259755c..fba7ac872b18d 100644 --- a/recipes/log4cxx/all/conanfile.py +++ b/recipes/log4cxx/all/conanfile.py @@ -23,6 +23,7 @@ class Log4cxx(ConanFile): "fPIC": [True, False], "with_networking": [True, False], "with_wchar_t": [True, False], + "with_odbc": [True, False], "with_multiprocess_rolling_file_appender": [True, False], "with_qt": [True, False], } @@ -31,6 +32,7 @@ class Log4cxx(ConanFile): "fPIC": True, "with_networking": True, "with_wchar_t": False, + "with_odbc": False, "with_multiprocess_rolling_file_appender": False, "with_qt": False, } @@ -53,7 +55,7 @@ def requirements(self): self.requires("apr/[>=1.6]") self.requires("apr-util/[>=1.6]") self.requires("expat/[>=2.4]") - if self.settings.os != "Windows": + if self.options.get_safe("with_odbc") and self.settings.os != "Windows": self.requires("odbc/[>=2.3]") if self.options.get_safe("with_qt"): self.requires("qt/[>=5.15 <6]") @@ -77,7 +79,7 @@ def validate(self): if not minimum_version: self.output.warning("Your compiler is unknown. Assuming it supports C++17.") elif compiler_version < minimum_version: - raise ConanInvalidConfiguration(f"{self.settings.compiler} {compiler_version} does not support C++17: Requies {minimum_version}") + raise ConanInvalidConfiguration(f"{self.settings.compiler} {compiler_version} does not support C++17: {minimum_version} required.") if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, "17") @@ -100,6 +102,7 @@ def generate(self): if Version(self.version) >= "1.0.0": tc.variables["LOG4CXX_NETWORKING_SUPPORT"] = self.options.with_networking tc.variables["LOG4CXX_MULTIPROCESS_ROLLING_FILE_APPENDER"] = self.options.with_multiprocess_rolling_file_appender + tc.variables["LOG4CXX_ENABLE_ODBC"] = self.options.with_odbc tc.variables["LOG4CXX_WCHAR_T"] = self.options.with_wchar_t tc.variables["LOG4CXX_QT_SUPPORT"] = self.options.with_qt if self.settings.os == "Windows": diff --git a/recipes/log4cxx/all/patches/0001-make-odbc-optional.patch b/recipes/log4cxx/all/patches/0001-make-odbc-optional.patch new file mode 100644 index 0000000000000..c0b1fb3f1e387 --- /dev/null +++ b/recipes/log4cxx/all/patches/0001-make-odbc-optional.patch @@ -0,0 +1,39 @@ +--- a/src/main/include/CMakeLists.txt ++++ b/src/main/include/CMakeLists.txt +@@ -68,16 +68,27 @@ include(CheckIncludeFiles) + include(CheckIncludeFileCXX) + include(CheckLibraryExists) + +-if(WIN32) +- CHECK_INCLUDE_FILES(sqlext.h HAS_ODBC) +-else() +- include(FindPkgConfig) ++option(LOG4CXX_ENABLE_ODBC "Support logging via ODBC" OFF) ++if(LOG4CXX_ENABLE_ODBC) ++ if(WIN32) ++ CHECK_INCLUDE_FILES(sqlext.h HAS_ODBC) ++ else() ++ include(FindPkgConfig) + +- pkg_check_modules( odbc QUIET odbc ) +- if(${odbc_FOUND}) +- set(HAS_ODBC 1) +- endif(${odbc_FOUND}) +-endif(WIN32) ++ pkg_check_modules( odbc odbc ) ++ if(${odbc_FOUND}) ++ set(HAS_ODBC 1) ++ else() ++ set(HAS_ODBC 0) ++ endif(${odbc_FOUND}) ++ endif(WIN32) ++ ++ if(NOT ${HAS_ODBC}) ++ message(SEND_ERROR "ODBC not found but requested") ++ endif() ++else() ++ set(HAS_ODBC 0) ++endif(LOG4CXX_ENABLE_ODBC) + + CHECK_INCLUDE_FILE_CXX(locale HAS_STD_LOCALE) + CHECK_FUNCTION_EXISTS(mbsrtowcs HAS_MBSRTOWCS) diff --git a/recipes/log4cxx/all/patches/0002-make-odbc-optional.patch b/recipes/log4cxx/all/patches/0002-make-odbc-optional.patch new file mode 100644 index 0000000000000..bd3bfa101f8b7 --- /dev/null +++ b/recipes/log4cxx/all/patches/0002-make-odbc-optional.patch @@ -0,0 +1,39 @@ +--- a/src/main/include/CMakeLists.txt ++++ b/src/main/include/CMakeLists.txt +@@ -85,16 +85,27 @@ include(CheckIncludeFiles) + include(CheckIncludeFileCXX) + include(CheckLibraryExists) + +-if(WIN32) +- CHECK_INCLUDE_FILES(sqlext.h HAS_ODBC) +-else() +- include(FindPkgConfig) ++option(LOG4CXX_ENABLE_ODBC "Support logging via ODBC" OFF) ++if(LOG4CXX_ENABLE_ODBC) ++ if(WIN32) ++ CHECK_INCLUDE_FILES(sqlext.h HAS_ODBC) ++ else() ++ include(FindPkgConfig) + +- pkg_check_modules( odbc QUIET odbc ) +- if(${odbc_FOUND}) +- set(HAS_ODBC 1) +- endif(${odbc_FOUND}) +-endif(WIN32) ++ pkg_check_modules( odbc odbc ) ++ if(${odbc_FOUND}) ++ set(HAS_ODBC 1) ++ else() ++ set(HAS_ODBC 0) ++ endif(${odbc_FOUND}) ++ endif(WIN32) ++ ++ if(NOT ${HAS_ODBC}) ++ message(SEND_ERROR "ODBC not found but requested") ++ endif() ++else() ++ set(HAS_ODBC 0) ++endif(LOG4CXX_ENABLE_ODBC) + + CHECK_INCLUDE_FILE_CXX(locale HAS_STD_LOCALE) + CHECK_FUNCTION_EXISTS(mbsrtowcs HAS_MBSRTOWCS) diff --git a/recipes/log4cxx/all/patches/0003-make-odbc-optional.patch b/recipes/log4cxx/all/patches/0003-make-odbc-optional.patch new file mode 100644 index 0000000000000..e62c04d64ed24 --- /dev/null +++ b/recipes/log4cxx/all/patches/0003-make-odbc-optional.patch @@ -0,0 +1,39 @@ +--- a/src/main/include/CMakeLists.txt ++++ b/src/main/include/CMakeLists.txt +@@ -107,16 +107,27 @@ include(CheckIncludeFiles) + include(CheckIncludeFileCXX) + include(CheckLibraryExists) + +-if(WIN32) +- CHECK_INCLUDE_FILES(sqlext.h HAS_ODBC) +-else() +- include(FindPkgConfig) ++option(LOG4CXX_ENABLE_ODBC "Support logging via ODBC" OFF) ++if(LOG4CXX_ENABLE_ODBC) ++ if(WIN32) ++ CHECK_INCLUDE_FILES(sqlext.h HAS_ODBC) ++ else() ++ include(FindPkgConfig) + +- pkg_check_modules( odbc QUIET odbc ) +- if(${odbc_FOUND}) +- set(HAS_ODBC 1) +- endif(${odbc_FOUND}) +-endif(WIN32) ++ pkg_check_modules( odbc odbc ) ++ if(${odbc_FOUND}) ++ set(HAS_ODBC 1) ++ else() ++ set(HAS_ODBC 0) ++ endif(${odbc_FOUND}) ++ endif(WIN32) ++ ++ if(NOT ${HAS_ODBC}) ++ message(SEND_ERROR "ODBC not found but requested") ++ endif() ++else() ++ set(HAS_ODBC 0) ++endif(LOG4CXX_ENABLE_ODBC) + + CHECK_INCLUDE_FILE_CXX(locale HAS_STD_LOCALE) + CHECK_FUNCTION_EXISTS(mbsrtowcs HAS_MBSRTOWCS) From c24fbea1ca6eda17f37e68ab686dae99d6d2066d Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Mon, 3 Apr 2023 11:04:32 +1000 Subject: [PATCH 20/96] A missing shared_mutex implementation should not be fatal --- recipes/log4cxx/all/conandata.yml | 4 ++++ .../all/patches/0001-shared-mutex-not-required.patch | 12 ++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 recipes/log4cxx/all/patches/0001-shared-mutex-not-required.patch diff --git a/recipes/log4cxx/all/conandata.yml b/recipes/log4cxx/all/conandata.yml index 20940256f4993..296056133f882 100644 --- a/recipes/log4cxx/all/conandata.yml +++ b/recipes/log4cxx/all/conandata.yml @@ -24,6 +24,10 @@ patches: patch_description: "Prevent compilation errors when with_wchar_t=False" patch_source: "https://github.com/apache/logging-log4cxx/commit/5109466a844d1e5fb8b455a23077765a30325a24" "0.13.0": + - patch_file: "patches/0001-shared-mutex-not-required.patch" + patch_type: "bugfix" + patch_description: "Prevent build failure when compiler.cppstd=14" + patch_source: "https://github.com/apache/logging-log4cxx/commit/09b5b723a1a210c28bf8b05b0676bb2b104359ba" - patch_file: "patches/0002-find-apr.patch" patch_type: "conan" patch_description: "Use conan generated apr, apr-util target names" diff --git a/recipes/log4cxx/all/patches/0001-shared-mutex-not-required.patch b/recipes/log4cxx/all/patches/0001-shared-mutex-not-required.patch new file mode 100644 index 0000000000000..1d057049c6526 --- /dev/null +++ b/recipes/log4cxx/all/patches/0001-shared-mutex-not-required.patch @@ -0,0 +1,12 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -212,9 +212,6 @@ endif() + # + # Check for any fatal configuration errors + # +-if( "${SHARED_MUTEX_IMPL}" STREQUAL "NONE" ) +- message( FATAL_ERROR "No shared_mutex implementation found. Requires Boost or C++17" ) +-endif() + + # + # Output configuration information From 192cd0cc19b4148495b8e609a1137b158454ee3a Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Mon, 3 Apr 2023 12:21:48 +1000 Subject: [PATCH 21/96] Remove .pc files from the package --- recipes/log4cxx/all/conanfile.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/recipes/log4cxx/all/conanfile.py b/recipes/log4cxx/all/conanfile.py index fba7ac872b18d..39b035095b11f 100644 --- a/recipes/log4cxx/all/conanfile.py +++ b/recipes/log4cxx/all/conanfile.py @@ -123,7 +123,9 @@ def package(self): copy(self, "NOTICE", src=self.source_folder, dst="licenses") cmake = CMake(self) cmake.install() - rmdir(self, os.path.join(self.package_folder, "share")) + if self.settings.os != "Windows": + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "cmake")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "log4cxx") From da607895df76c62c1588cdcabda6a227b3c695bb Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Mon, 3 Apr 2023 12:24:58 +1000 Subject: [PATCH 22/96] Remove cmake files from the package --- recipes/log4cxx/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/log4cxx/all/conanfile.py b/recipes/log4cxx/all/conanfile.py index 39b035095b11f..745554ccef690 100644 --- a/recipes/log4cxx/all/conanfile.py +++ b/recipes/log4cxx/all/conanfile.py @@ -125,7 +125,7 @@ def package(self): cmake.install() if self.settings.os != "Windows": rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) - rmdir(self, os.path.join(self.package_folder, "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "log4cxx") From d1ddd7f29cd43707638f1f820835d0d8bafa9264 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Mon, 3 Apr 2023 13:25:30 +1000 Subject: [PATCH 23/96] Make the SMTP appender available when libesmtp is available --- recipes/log4cxx/all/conandata.yml | 2 +- recipes/log4cxx/all/conanfile.py | 6 ++ .../0002-make-odbc-and-esmtp-optional.patch | 56 +++++++++++++++++++ .../all/patches/0003-make-odbc-optional.patch | 39 ------------- 4 files changed, 63 insertions(+), 40 deletions(-) create mode 100644 recipes/log4cxx/all/patches/0002-make-odbc-and-esmtp-optional.patch delete mode 100644 recipes/log4cxx/all/patches/0003-make-odbc-optional.patch diff --git a/recipes/log4cxx/all/conandata.yml b/recipes/log4cxx/all/conandata.yml index 296056133f882..cbabd96d9afb6 100644 --- a/recipes/log4cxx/all/conandata.yml +++ b/recipes/log4cxx/all/conandata.yml @@ -44,7 +44,7 @@ patches: patch_type: "bugfix" patch_description: "Prevent build failure when compiler.cppstd=14" patch_source: "https://github.com/apache/logging-log4cxx/commit/0b83584592290cb539f90ab79fc542d60cc3ba23" - - patch_file: "patches/0003-make-odbc-optional.patch" + - patch_file: "patches/0002-make-odbc-and-esmtp-optional.patch" patch_type: "conan" patch_description: "Prevent 'odbc/2.3.11' requires 'libiconv/1.17' while 'apr-util/1.6.1' requires 'libiconv/1.16'" - patch_file: "patches/0003-find-apr.patch" diff --git a/recipes/log4cxx/all/conanfile.py b/recipes/log4cxx/all/conanfile.py index 745554ccef690..212e5d754be09 100644 --- a/recipes/log4cxx/all/conanfile.py +++ b/recipes/log4cxx/all/conanfile.py @@ -25,6 +25,7 @@ class Log4cxx(ConanFile): "with_wchar_t": [True, False], "with_odbc": [True, False], "with_multiprocess_rolling_file_appender": [True, False], + "with_smtp_appender": [True, False], "with_qt": [True, False], } default_options = { @@ -34,6 +35,7 @@ class Log4cxx(ConanFile): "with_wchar_t": False, "with_odbc": False, "with_multiprocess_rolling_file_appender": False, + "with_smtp_appender": False, "with_qt": False, } @@ -45,6 +47,7 @@ def config_options(self): self.options.rm_safe("fPIC") if Version(self.version) < "1.0.0": self.options.rm_safe("with_multiprocess_rolling_file_appender") + self.options.rm_safe("with_smtp_appender") self.options.rm_safe("with_networking") def configure(self): @@ -57,6 +60,8 @@ def requirements(self): self.requires("expat/[>=2.4]") if self.options.get_safe("with_odbc") and self.settings.os != "Windows": self.requires("odbc/[>=2.3]") + if self.options.get_safe("with_smtp_appender"): + self.requires("libesmtp/[>=1.0]") if self.options.get_safe("with_qt"): self.requires("qt/[>=5.15 <6]") @@ -102,6 +107,7 @@ def generate(self): if Version(self.version) >= "1.0.0": tc.variables["LOG4CXX_NETWORKING_SUPPORT"] = self.options.with_networking tc.variables["LOG4CXX_MULTIPROCESS_ROLLING_FILE_APPENDER"] = self.options.with_multiprocess_rolling_file_appender + tc.variables["LOG4CXX_ENABLE_ESMTP"] = self.options.with_smtp_appender tc.variables["LOG4CXX_ENABLE_ODBC"] = self.options.with_odbc tc.variables["LOG4CXX_WCHAR_T"] = self.options.with_wchar_t tc.variables["LOG4CXX_QT_SUPPORT"] = self.options.with_qt diff --git a/recipes/log4cxx/all/patches/0002-make-odbc-and-esmtp-optional.patch b/recipes/log4cxx/all/patches/0002-make-odbc-and-esmtp-optional.patch new file mode 100644 index 0000000000000..6e8edce9f006c --- /dev/null +++ b/recipes/log4cxx/all/patches/0002-make-odbc-and-esmtp-optional.patch @@ -0,0 +1,56 @@ +diff --git a/src/main/include/CMakeLists.txt b/src/main/include/CMakeLists.txt +index 59982cf..5f6c123 100644 +--- a/src/main/include/CMakeLists.txt ++++ b/src/main/include/CMakeLists.txt +@@ -107,22 +107,42 @@ include(CheckIncludeFiles) + include(CheckIncludeFileCXX) + include(CheckLibraryExists) + +-if(WIN32) +- CHECK_INCLUDE_FILES(sqlext.h HAS_ODBC) ++option(LOG4CXX_ENABLE_ODBC "Support logging via ODBC" OFF) ++if(LOG4CXX_ENABLE_ODBC) ++ if(WIN32) ++ CHECK_INCLUDE_FILES(sqlext.h HAS_ODBC) ++ else() ++ include(FindPkgConfig) ++ ++ pkg_check_modules( odbc odbc ) ++ if(${odbc_FOUND}) ++ set(HAS_ODBC 1) ++ else() ++ set(HAS_ODBC 0) ++ endif(${odbc_FOUND}) ++ endif(WIN32) ++ ++ if(NOT ${HAS_ODBC}) ++ message(SEND_ERROR "ODBC not found but requested") ++ endif() + else() +- include(FindPkgConfig) ++ set(HAS_ODBC 0) ++endif(LOG4CXX_ENABLE_ODBC) + +- pkg_check_modules( odbc QUIET odbc ) +- if(${odbc_FOUND}) +- set(HAS_ODBC 1) +- endif(${odbc_FOUND}) +-endif(WIN32) ++option(LOG4CXX_ENABLE_ESMTP "Support logging via libesmtp" OFF) ++if(LOG4CXX_ENABLE_ESMTP) ++ CHECK_LIBRARY_EXISTS(esmtp smtp_create_session "" HAS_LIBESMTP) ++ if(NOT HAS_LIBESMTP) ++ message(SEND_ERROR "SMTP support with libesmtp not found but requested") ++ endif() ++else() ++ set(HAS_LIBESMTP 0) ++endif(LOG4CXX_ENABLE_ESMTP) + + CHECK_INCLUDE_FILE_CXX(locale HAS_STD_LOCALE) + CHECK_FUNCTION_EXISTS(mbsrtowcs HAS_MBSRTOWCS) + CHECK_FUNCTION_EXISTS(wcstombs HAS_WCSTOMBS) + CHECK_FUNCTION_EXISTS(fwide HAS_FWIDE) +-CHECK_LIBRARY_EXISTS(esmtp smtp_create_session "" HAS_LIBESMTP) + CHECK_FUNCTION_EXISTS(syslog HAS_SYSLOG) + try_compile(HAS_THREAD_LOCAL "${CMAKE_BINARY_DIR}/thread-local-test" + "${LOG4CXX_SOURCE_DIR}/src/cmake/test-thread-local.cpp" diff --git a/recipes/log4cxx/all/patches/0003-make-odbc-optional.patch b/recipes/log4cxx/all/patches/0003-make-odbc-optional.patch deleted file mode 100644 index e62c04d64ed24..0000000000000 --- a/recipes/log4cxx/all/patches/0003-make-odbc-optional.patch +++ /dev/null @@ -1,39 +0,0 @@ ---- a/src/main/include/CMakeLists.txt -+++ b/src/main/include/CMakeLists.txt -@@ -107,16 +107,27 @@ include(CheckIncludeFiles) - include(CheckIncludeFileCXX) - include(CheckLibraryExists) - --if(WIN32) -- CHECK_INCLUDE_FILES(sqlext.h HAS_ODBC) --else() -- include(FindPkgConfig) -+option(LOG4CXX_ENABLE_ODBC "Support logging via ODBC" OFF) -+if(LOG4CXX_ENABLE_ODBC) -+ if(WIN32) -+ CHECK_INCLUDE_FILES(sqlext.h HAS_ODBC) -+ else() -+ include(FindPkgConfig) - -- pkg_check_modules( odbc QUIET odbc ) -- if(${odbc_FOUND}) -- set(HAS_ODBC 1) -- endif(${odbc_FOUND}) --endif(WIN32) -+ pkg_check_modules( odbc odbc ) -+ if(${odbc_FOUND}) -+ set(HAS_ODBC 1) -+ else() -+ set(HAS_ODBC 0) -+ endif(${odbc_FOUND}) -+ endif(WIN32) -+ -+ if(NOT ${HAS_ODBC}) -+ message(SEND_ERROR "ODBC not found but requested") -+ endif() -+else() -+ set(HAS_ODBC 0) -+endif(LOG4CXX_ENABLE_ODBC) - - CHECK_INCLUDE_FILE_CXX(locale HAS_STD_LOCALE) - CHECK_FUNCTION_EXISTS(mbsrtowcs HAS_MBSRTOWCS) From 9df00e17e2f45ad1fc060a94f0205c44d23b3893 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Mon, 3 Apr 2023 13:36:58 +1000 Subject: [PATCH 24/96] Prevent build failure when compiler.cppstd=14 --- recipes/log4cxx/all/conandata.yml | 4 ++++ .../all/patches/0000-shared-mutex-not-required.patch | 12 ++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 recipes/log4cxx/all/patches/0000-shared-mutex-not-required.patch diff --git a/recipes/log4cxx/all/conandata.yml b/recipes/log4cxx/all/conandata.yml index cbabd96d9afb6..248202a7bf7c7 100644 --- a/recipes/log4cxx/all/conandata.yml +++ b/recipes/log4cxx/all/conandata.yml @@ -10,6 +10,10 @@ sources: url: "https://archive.apache.org/dist/logging/log4cxx/1.0.0/apache-log4cxx-1.0.0.tar.gz" patches: "0.12.1": + - patch_file: "patches/0000-shared-mutex-not-required.patch" + patch_type: "bugfix" + patch_description: "Prevent build failure when compiler.cppstd=14" + patch_source: "https://github.com/apache/logging-log4cxx/commit/09b5b723a1a210c28bf8b05b0676bb2b104359ba" - patch_file: "patches/0001-make-odbc-optional.patch" patch_type: "conan" patch_description: "Prevent 'odbc/2.3.11' requires 'libiconv/1.17' while 'apr-util/1.6.1' requires 'libiconv/1.16'" diff --git a/recipes/log4cxx/all/patches/0000-shared-mutex-not-required.patch b/recipes/log4cxx/all/patches/0000-shared-mutex-not-required.patch new file mode 100644 index 0000000000000..c4adf5996a8bb --- /dev/null +++ b/recipes/log4cxx/all/patches/0000-shared-mutex-not-required.patch @@ -0,0 +1,12 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -191,9 +191,6 @@ endif() + # + # Check for any fatal configuration errors + # +-if( "${SHARED_MUTEX_IMPL}" STREQUAL "NONE" ) +- message( FATAL_ERROR "No shared_mutex implementation found. Requires Boost or C++17" ) +-endif() + + # + # Output configuration information From 8aa1f87e2a829a057b0d7755ab29baac422d376d Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Mon, 3 Apr 2023 13:38:17 +1000 Subject: [PATCH 25/96] Revert "Prevent build failure when compiler.cppstd=14" This reverts commit 9df00e17e2f45ad1fc060a94f0205c44d23b3893. --- recipes/log4cxx/all/conandata.yml | 4 ---- .../all/patches/0000-shared-mutex-not-required.patch | 12 ------------ 2 files changed, 16 deletions(-) delete mode 100644 recipes/log4cxx/all/patches/0000-shared-mutex-not-required.patch diff --git a/recipes/log4cxx/all/conandata.yml b/recipes/log4cxx/all/conandata.yml index 248202a7bf7c7..cbabd96d9afb6 100644 --- a/recipes/log4cxx/all/conandata.yml +++ b/recipes/log4cxx/all/conandata.yml @@ -10,10 +10,6 @@ sources: url: "https://archive.apache.org/dist/logging/log4cxx/1.0.0/apache-log4cxx-1.0.0.tar.gz" patches: "0.12.1": - - patch_file: "patches/0000-shared-mutex-not-required.patch" - patch_type: "bugfix" - patch_description: "Prevent build failure when compiler.cppstd=14" - patch_source: "https://github.com/apache/logging-log4cxx/commit/09b5b723a1a210c28bf8b05b0676bb2b104359ba" - patch_file: "patches/0001-make-odbc-optional.patch" patch_type: "conan" patch_description: "Prevent 'odbc/2.3.11' requires 'libiconv/1.17' while 'apr-util/1.6.1' requires 'libiconv/1.16'" diff --git a/recipes/log4cxx/all/patches/0000-shared-mutex-not-required.patch b/recipes/log4cxx/all/patches/0000-shared-mutex-not-required.patch deleted file mode 100644 index c4adf5996a8bb..0000000000000 --- a/recipes/log4cxx/all/patches/0000-shared-mutex-not-required.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -191,9 +191,6 @@ endif() - # - # Check for any fatal configuration errors - # --if( "${SHARED_MUTEX_IMPL}" STREQUAL "NONE" ) -- message( FATAL_ERROR "No shared_mutex implementation found. Requires Boost or C++17" ) --endif() - - # - # Output configuration information From bdbe030205f5e3f5ffebb42d5ffa0d1c3fdc1942 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Mon, 3 Apr 2023 13:41:40 +1000 Subject: [PATCH 26/96] Version 0.12.1 requires a std::shared_mutex implementation --- recipes/log4cxx/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/log4cxx/all/conanfile.py b/recipes/log4cxx/all/conanfile.py index 212e5d754be09..7b8f1c0dbead7 100644 --- a/recipes/log4cxx/all/conanfile.py +++ b/recipes/log4cxx/all/conanfile.py @@ -76,7 +76,7 @@ def _compilers_minimum_version(self): } def validate(self): - if self.options.get_safe("with_multiprocess_rolling_file_appender"): + if Version(self.version) == "0.12.1" or self.options.get_safe("with_multiprocess_rolling_file_appender"): # TODO: if compiler doesn't support C++17, boost can be used instead self.output.warning("multiprocess rolling file appender requires C++17.") minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) From 7862dcfc1e86cd5a1fc3f6ba5f38c6bf5feede40 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Mon, 3 Apr 2023 13:45:59 +1000 Subject: [PATCH 27/96] Version 0.13.0 requires a std::shared_mutex implementation --- recipes/log4cxx/all/conandata.yml | 3 --- recipes/log4cxx/all/conanfile.py | 2 +- .../all/patches/0001-shared-mutex-not-required.patch | 12 ------------ 3 files changed, 1 insertion(+), 16 deletions(-) delete mode 100644 recipes/log4cxx/all/patches/0001-shared-mutex-not-required.patch diff --git a/recipes/log4cxx/all/conandata.yml b/recipes/log4cxx/all/conandata.yml index cbabd96d9afb6..c57e698748b27 100644 --- a/recipes/log4cxx/all/conandata.yml +++ b/recipes/log4cxx/all/conandata.yml @@ -24,9 +24,6 @@ patches: patch_description: "Prevent compilation errors when with_wchar_t=False" patch_source: "https://github.com/apache/logging-log4cxx/commit/5109466a844d1e5fb8b455a23077765a30325a24" "0.13.0": - - patch_file: "patches/0001-shared-mutex-not-required.patch" - patch_type: "bugfix" - patch_description: "Prevent build failure when compiler.cppstd=14" patch_source: "https://github.com/apache/logging-log4cxx/commit/09b5b723a1a210c28bf8b05b0676bb2b104359ba" - patch_file: "patches/0002-find-apr.patch" patch_type: "conan" diff --git a/recipes/log4cxx/all/conanfile.py b/recipes/log4cxx/all/conanfile.py index 7b8f1c0dbead7..7d5c4fc234bec 100644 --- a/recipes/log4cxx/all/conanfile.py +++ b/recipes/log4cxx/all/conanfile.py @@ -76,7 +76,7 @@ def _compilers_minimum_version(self): } def validate(self): - if Version(self.version) == "0.12.1" or self.options.get_safe("with_multiprocess_rolling_file_appender"): + if Version(self.version) < "1.0.0" or self.options.get_safe("with_multiprocess_rolling_file_appender"): # TODO: if compiler doesn't support C++17, boost can be used instead self.output.warning("multiprocess rolling file appender requires C++17.") minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) diff --git a/recipes/log4cxx/all/patches/0001-shared-mutex-not-required.patch b/recipes/log4cxx/all/patches/0001-shared-mutex-not-required.patch deleted file mode 100644 index 1d057049c6526..0000000000000 --- a/recipes/log4cxx/all/patches/0001-shared-mutex-not-required.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -212,9 +212,6 @@ endif() - # - # Check for any fatal configuration errors - # --if( "${SHARED_MUTEX_IMPL}" STREQUAL "NONE" ) -- message( FATAL_ERROR "No shared_mutex implementation found. Requires Boost or C++17" ) --endif() - - # - # Output configuration information From 3f8ecec00ed6fbfc7b8b3a361b2057c7f1b43253 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Mon, 3 Apr 2023 13:48:15 +1000 Subject: [PATCH 28/96] Version 0.13.0 requires a std::shared_mutex implementation --- recipes/log4cxx/all/conandata.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/recipes/log4cxx/all/conandata.yml b/recipes/log4cxx/all/conandata.yml index c57e698748b27..b3cdded0ae01f 100644 --- a/recipes/log4cxx/all/conandata.yml +++ b/recipes/log4cxx/all/conandata.yml @@ -24,7 +24,6 @@ patches: patch_description: "Prevent compilation errors when with_wchar_t=False" patch_source: "https://github.com/apache/logging-log4cxx/commit/5109466a844d1e5fb8b455a23077765a30325a24" "0.13.0": - patch_source: "https://github.com/apache/logging-log4cxx/commit/09b5b723a1a210c28bf8b05b0676bb2b104359ba" - patch_file: "patches/0002-find-apr.patch" patch_type: "conan" patch_description: "Use conan generated apr, apr-util target names" From 6fce6e4908d7307c6e2a20625985f3b1492d4f13 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Mon, 3 Apr 2023 14:05:49 +1000 Subject: [PATCH 29/96] Improve diagnostic warning message and make options more consistent --- recipes/log4cxx/all/conanfile.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/recipes/log4cxx/all/conanfile.py b/recipes/log4cxx/all/conanfile.py index 7d5c4fc234bec..070764f477582 100644 --- a/recipes/log4cxx/all/conanfile.py +++ b/recipes/log4cxx/all/conanfile.py @@ -23,7 +23,7 @@ class Log4cxx(ConanFile): "fPIC": [True, False], "with_networking": [True, False], "with_wchar_t": [True, False], - "with_odbc": [True, False], + "with_odbc_appender": [True, False], "with_multiprocess_rolling_file_appender": [True, False], "with_smtp_appender": [True, False], "with_qt": [True, False], @@ -33,7 +33,7 @@ class Log4cxx(ConanFile): "fPIC": True, "with_networking": True, "with_wchar_t": False, - "with_odbc": False, + "with_odbc_appender": False, "with_multiprocess_rolling_file_appender": False, "with_smtp_appender": False, "with_qt": False, @@ -58,7 +58,7 @@ def requirements(self): self.requires("apr/[>=1.6]") self.requires("apr-util/[>=1.6]") self.requires("expat/[>=2.4]") - if self.options.get_safe("with_odbc") and self.settings.os != "Windows": + if self.options.get_safe("with_odbc_appender") and self.settings.os != "Windows": self.requires("odbc/[>=2.3]") if self.options.get_safe("with_smtp_appender"): self.requires("libesmtp/[>=1.0]") @@ -78,7 +78,10 @@ def _compilers_minimum_version(self): def validate(self): if Version(self.version) < "1.0.0" or self.options.get_safe("with_multiprocess_rolling_file_appender"): # TODO: if compiler doesn't support C++17, boost can be used instead - self.output.warning("multiprocess rolling file appender requires C++17.") + if Version(self.version) < "1.0.0": + self.output.warning(f"Version {self.version} requires C++17. Use log4cxx version 1.0.0 or set compiler.cppstd=17.") + else: + self.output.warning("multiprocess rolling file appender requires C++17.") minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) compiler_version = Version(self.settings.compiler.version) if not minimum_version: @@ -108,7 +111,7 @@ def generate(self): tc.variables["LOG4CXX_NETWORKING_SUPPORT"] = self.options.with_networking tc.variables["LOG4CXX_MULTIPROCESS_ROLLING_FILE_APPENDER"] = self.options.with_multiprocess_rolling_file_appender tc.variables["LOG4CXX_ENABLE_ESMTP"] = self.options.with_smtp_appender - tc.variables["LOG4CXX_ENABLE_ODBC"] = self.options.with_odbc + tc.variables["LOG4CXX_ENABLE_ODBC"] = self.options.with_odbc_appender tc.variables["LOG4CXX_WCHAR_T"] = self.options.with_wchar_t tc.variables["LOG4CXX_QT_SUPPORT"] = self.options.with_qt if self.settings.os == "Windows": From 4ef6593db9d155fdf2c0e5e4c5993cc97a2f402d Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Mon, 3 Apr 2023 14:53:07 +1000 Subject: [PATCH 30/96] Ensure the package includes licenses folder --- recipes/log4cxx/all/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/log4cxx/all/conanfile.py b/recipes/log4cxx/all/conanfile.py index 070764f477582..bf4353ae29c67 100644 --- a/recipes/log4cxx/all/conanfile.py +++ b/recipes/log4cxx/all/conanfile.py @@ -128,8 +128,8 @@ def build(self): cmake.build() def package(self): - copy(self, "LICENSE", src=self.source_folder, dst="licenses") - copy(self, "NOTICE", src=self.source_folder, dst="licenses") + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "NOTICE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) cmake = CMake(self) cmake.install() if self.settings.os != "Windows": From c3587580445a46699077bbcb9c6ce1284bf9fb3d Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Mon, 3 Apr 2023 14:59:40 +1000 Subject: [PATCH 31/96] Provide option for libfmt type layout definitions --- recipes/log4cxx/all/conanfile.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/recipes/log4cxx/all/conanfile.py b/recipes/log4cxx/all/conanfile.py index bf4353ae29c67..e11d94d635849 100644 --- a/recipes/log4cxx/all/conanfile.py +++ b/recipes/log4cxx/all/conanfile.py @@ -23,6 +23,7 @@ class Log4cxx(ConanFile): "fPIC": [True, False], "with_networking": [True, False], "with_wchar_t": [True, False], + "with_fmt_layout": [True, False], "with_odbc_appender": [True, False], "with_multiprocess_rolling_file_appender": [True, False], "with_smtp_appender": [True, False], @@ -33,6 +34,7 @@ class Log4cxx(ConanFile): "fPIC": True, "with_networking": True, "with_wchar_t": False, + "with_fmt_layout": False, "with_odbc_appender": False, "with_multiprocess_rolling_file_appender": False, "with_smtp_appender": False, @@ -49,6 +51,7 @@ def config_options(self): self.options.rm_safe("with_multiprocess_rolling_file_appender") self.options.rm_safe("with_smtp_appender") self.options.rm_safe("with_networking") + self.options.rm_safe("with_fmt_layout") def configure(self): if self.options.shared: @@ -62,6 +65,8 @@ def requirements(self): self.requires("odbc/[>=2.3]") if self.options.get_safe("with_smtp_appender"): self.requires("libesmtp/[>=1.0]") + if self.options.get_safe("with_fmt_layout"): + self.requires("fmt/[>=9.0]") if self.options.get_safe("with_qt"): self.requires("qt/[>=5.15 <6]") @@ -111,6 +116,7 @@ def generate(self): tc.variables["LOG4CXX_NETWORKING_SUPPORT"] = self.options.with_networking tc.variables["LOG4CXX_MULTIPROCESS_ROLLING_FILE_APPENDER"] = self.options.with_multiprocess_rolling_file_appender tc.variables["LOG4CXX_ENABLE_ESMTP"] = self.options.with_smtp_appender + tc.variables["ENABLE_FMT_LAYOUT"] = self.options.with_fmt_layout tc.variables["LOG4CXX_ENABLE_ODBC"] = self.options.with_odbc_appender tc.variables["LOG4CXX_WCHAR_T"] = self.options.with_wchar_t tc.variables["LOG4CXX_QT_SUPPORT"] = self.options.with_qt From 316d836d7a1d010e499a302d7e8899d5d4abbdd9 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Mon, 3 Apr 2023 16:06:44 +1000 Subject: [PATCH 32/96] Prevent gcc5 compiler error --- recipes/log4cxx/all/conandata.yml | 3 ++ .../patches/0004-gcc5-compiler-error.patch | 29 +++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 recipes/log4cxx/all/patches/0004-gcc5-compiler-error.patch diff --git a/recipes/log4cxx/all/conandata.yml b/recipes/log4cxx/all/conandata.yml index b3cdded0ae01f..387e9eb51e296 100644 --- a/recipes/log4cxx/all/conandata.yml +++ b/recipes/log4cxx/all/conandata.yml @@ -46,3 +46,6 @@ patches: - patch_file: "patches/0003-find-apr.patch" patch_type: "conan" patch_description: "Use conan generated apr, apr-util target names" + - patch_file: "patches/0004-gcc5-compiler-error.patch" + patch_type: "bugfix" + patch_description: "Prevent build failure when compiling with gcc5" diff --git a/recipes/log4cxx/all/patches/0004-gcc5-compiler-error.patch b/recipes/log4cxx/all/patches/0004-gcc5-compiler-error.patch new file mode 100644 index 0000000000000..32f459909d09e --- /dev/null +++ b/recipes/log4cxx/all/patches/0004-gcc5-compiler-error.patch @@ -0,0 +1,29 @@ +diff --git a/src/main/cpp/defaultconfigurator.cpp b/src/main/cpp/defaultconfigurator.cpp +index a8bdddb..9a86695 100644 +--- a/src/main/cpp/defaultconfigurator.cpp ++++ b/src/main/cpp/defaultconfigurator.cpp +@@ -164,6 +164,7 @@ log4cxx::spi::ConfigurationStatus DefaultConfigurator::tryLoadFile(const LogStri + + std::tuple + DefaultConfigurator::configureFromFile(const std::vector& directories, const std::vector& filenames){ ++ using ResultType = std::tuple; + log4cxx::helpers::Pool pool; + + for( LogString dir : directories ){ +@@ -178,14 +179,14 @@ DefaultConfigurator::configureFromFile(const std::vector& directories + { + log4cxx::spi::ConfigurationStatus configStatus = tryLoadFile(canidate_str); + if( configStatus == log4cxx::spi::ConfigurationStatus::Configured ){ +- return {configStatus, canidate_str}; ++ return ResultType{configStatus, canidate_str}; + } + LogLog::debug("Unable to load file: trying next"); + } + } + } + +- return {log4cxx::spi::ConfigurationStatus::NotConfigured, LogString()}; ++ return ResultType{log4cxx::spi::ConfigurationStatus::NotConfigured, LogString()}; + } + + From a97f3bf3bc3bab09510012769f40a4a010616ba4 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Mon, 3 Apr 2023 16:22:12 +1000 Subject: [PATCH 33/96] Fixtest failure. Reduce duplication --- .../all/test_v1_package/CMakeLists.txt | 4 ++-- .../log4cxx/all/test_v1_package/conanfile.py | 2 +- .../all/test_v1_package/log4cxx_config.xml | 22 ------------------- .../all/test_v1_package/test_package.cpp | 20 ----------------- 4 files changed, 3 insertions(+), 45 deletions(-) delete mode 100644 recipes/log4cxx/all/test_v1_package/log4cxx_config.xml delete mode 100644 recipes/log4cxx/all/test_v1_package/test_package.cpp diff --git a/recipes/log4cxx/all/test_v1_package/CMakeLists.txt b/recipes/log4cxx/all/test_v1_package/CMakeLists.txt index 4b7ef0dd16dbb..20a36358362cc 100644 --- a/recipes/log4cxx/all/test_v1_package/CMakeLists.txt +++ b/recipes/log4cxx/all/test_v1_package/CMakeLists.txt @@ -6,6 +6,6 @@ conan_basic_setup(TARGETS) find_package(log4cxx REQUIRED CONFIG) -add_executable(${PROJECT_NAME} test_package.cpp) +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_include_directories(${PROJECT_NAME} PRIVATE ${CONAN_INCLUDE_DIRS}) target_link_libraries(${PROJECT_NAME} log4cxx) -target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17) diff --git a/recipes/log4cxx/all/test_v1_package/conanfile.py b/recipes/log4cxx/all/test_v1_package/conanfile.py index 0aa45c8d4db18..a8869a726edb8 100644 --- a/recipes/log4cxx/all/test_v1_package/conanfile.py +++ b/recipes/log4cxx/all/test_v1_package/conanfile.py @@ -13,6 +13,6 @@ def build(self): def test(self): if not tools.cross_building(self): - config_xml_name = os.path.join(self.source_folder, "log4cxx_config.xml") + config_xml_name = os.path.join(self.source_folder, "..", "test_package", "log4cxx_config.xml") bin_path = os.path.join("bin", "test_package") self.run("{} {}".format(bin_path, config_xml_name), run_environment=True) diff --git a/recipes/log4cxx/all/test_v1_package/log4cxx_config.xml b/recipes/log4cxx/all/test_v1_package/log4cxx_config.xml deleted file mode 100644 index 4269f78dd989e..0000000000000 --- a/recipes/log4cxx/all/test_v1_package/log4cxx_config.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/recipes/log4cxx/all/test_v1_package/test_package.cpp b/recipes/log4cxx/all/test_v1_package/test_package.cpp deleted file mode 100644 index 4e52b04611957..0000000000000 --- a/recipes/log4cxx/all/test_v1_package/test_package.cpp +++ /dev/null @@ -1,20 +0,0 @@ -#include "log4cxx/logger.h" -#include "log4cxx/xml/domconfigurator.h" - -#include - -using namespace log4cxx; -using namespace log4cxx::xml; - -int main(int argc, const char* argv[]) -{ - LoggerPtr logger(Logger::getLogger("TEST")); - if (argc < 2) { - std::cerr << "Expected path to config xml\n"; - return -1; - } - DOMConfigurator::configure(argv[1]); - LOG4CXX_INFO(logger, "App started!"); - LOG4CXX_ERROR(logger, "Some error!"); - return 0; -} From a0fbf3df462db54560bbbdfd6ae87f020aba426a Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Mon, 3 Apr 2023 16:48:29 +1000 Subject: [PATCH 34/96] Remove share directory from package --- recipes/log4cxx/all/conanfile.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipes/log4cxx/all/conanfile.py b/recipes/log4cxx/all/conanfile.py index e11d94d635849..ba69ff8bd6aed 100644 --- a/recipes/log4cxx/all/conanfile.py +++ b/recipes/log4cxx/all/conanfile.py @@ -138,6 +138,8 @@ def package(self): copy(self, "NOTICE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) cmake = CMake(self) cmake.install() + if Version(self.version) < "1.0.0": + rmdir(self, os.path.join(self.package_folder, "share")) if self.settings.os != "Windows": rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) From b5ae993479927c02948bcddd84fd5c4d765da5ff Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Mon, 3 Apr 2023 17:52:06 +1000 Subject: [PATCH 35/96] Ensure gcc5 builds test_packages --- recipes/log4cxx/all/test_package/CMakeLists.txt | 1 + recipes/log4cxx/all/test_v1_package/CMakeLists.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/recipes/log4cxx/all/test_package/CMakeLists.txt b/recipes/log4cxx/all/test_package/CMakeLists.txt index fa1c3c838f463..072a0fc3cb098 100644 --- a/recipes/log4cxx/all/test_package/CMakeLists.txt +++ b/recipes/log4cxx/all/test_package/CMakeLists.txt @@ -4,5 +4,6 @@ project(test_package CXX) find_package(log4cxx REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) +target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_11) target_include_directories(${PROJECT_NAME} PRIVATE ${log4cxx_INCLUDE_DIR}) target_link_libraries(${PROJECT_NAME} PRIVATE log4cxx) diff --git a/recipes/log4cxx/all/test_v1_package/CMakeLists.txt b/recipes/log4cxx/all/test_v1_package/CMakeLists.txt index 20a36358362cc..5dbe98f1b9fbd 100644 --- a/recipes/log4cxx/all/test_v1_package/CMakeLists.txt +++ b/recipes/log4cxx/all/test_v1_package/CMakeLists.txt @@ -7,5 +7,6 @@ conan_basic_setup(TARGETS) find_package(log4cxx REQUIRED CONFIG) add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) +target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_11) target_include_directories(${PROJECT_NAME} PRIVATE ${CONAN_INCLUDE_DIRS}) target_link_libraries(${PROJECT_NAME} log4cxx) From 2d911a1c43f8191d3dfe38374037545372123bba Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Mon, 3 Apr 2023 18:12:13 +1000 Subject: [PATCH 36/96] Ensure test_packages build --- recipes/log4cxx/all/test_package/CMakeLists.txt | 2 +- recipes/log4cxx/all/test_v1_package/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/log4cxx/all/test_package/CMakeLists.txt b/recipes/log4cxx/all/test_package/CMakeLists.txt index 072a0fc3cb098..9003a843576c9 100644 --- a/recipes/log4cxx/all/test_package/CMakeLists.txt +++ b/recipes/log4cxx/all/test_package/CMakeLists.txt @@ -4,6 +4,6 @@ project(test_package CXX) find_package(log4cxx REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_11) +target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17) target_include_directories(${PROJECT_NAME} PRIVATE ${log4cxx_INCLUDE_DIR}) target_link_libraries(${PROJECT_NAME} PRIVATE log4cxx) diff --git a/recipes/log4cxx/all/test_v1_package/CMakeLists.txt b/recipes/log4cxx/all/test_v1_package/CMakeLists.txt index 5dbe98f1b9fbd..3c11ba18c1a9f 100644 --- a/recipes/log4cxx/all/test_v1_package/CMakeLists.txt +++ b/recipes/log4cxx/all/test_v1_package/CMakeLists.txt @@ -7,6 +7,6 @@ conan_basic_setup(TARGETS) find_package(log4cxx REQUIRED CONFIG) add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_11) +target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17) target_include_directories(${PROJECT_NAME} PRIVATE ${CONAN_INCLUDE_DIRS}) target_link_libraries(${PROJECT_NAME} log4cxx) From 6e4b536748f7c07343c843eac612d5f08f90496e Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Mon, 3 Apr 2023 21:11:16 +1000 Subject: [PATCH 37/96] Use conan generated target name in test_package. --- recipes/log4cxx/all/test_package/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/log4cxx/all/test_package/CMakeLists.txt b/recipes/log4cxx/all/test_package/CMakeLists.txt index 9003a843576c9..e9502358359ab 100644 --- a/recipes/log4cxx/all/test_package/CMakeLists.txt +++ b/recipes/log4cxx/all/test_package/CMakeLists.txt @@ -6,4 +6,4 @@ find_package(log4cxx REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17) target_include_directories(${PROJECT_NAME} PRIVATE ${log4cxx_INCLUDE_DIR}) -target_link_libraries(${PROJECT_NAME} PRIVATE log4cxx) +target_link_libraries(${PROJECT_NAME} PRIVATE log4cxx::log4cxx) From 5ec9817a0526d54d50578fe9e6585cbff42a51a7 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Mon, 3 Apr 2023 21:19:08 +1000 Subject: [PATCH 38/96] Use conan generated target name in test_package. --- recipes/log4cxx/all/test_package/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/log4cxx/all/test_package/CMakeLists.txt b/recipes/log4cxx/all/test_package/CMakeLists.txt index e9502358359ab..82bfe10ac8263 100644 --- a/recipes/log4cxx/all/test_package/CMakeLists.txt +++ b/recipes/log4cxx/all/test_package/CMakeLists.txt @@ -5,5 +5,5 @@ find_package(log4cxx REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17) -target_include_directories(${PROJECT_NAME} PRIVATE ${log4cxx_INCLUDE_DIR}) -target_link_libraries(${PROJECT_NAME} PRIVATE log4cxx::log4cxx) +target_include_directories(${PROJECT_NAME} PRIVATE ${CONAN_INCLUDE_DIRS}) +target_link_libraries(${PROJECT_NAME} PRIVATE ${CONAN_LIBS}) From 18fec2bb8b7fe9e6902c0e8cdb0eb53ea8873b20 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Mon, 3 Apr 2023 21:20:32 +1000 Subject: [PATCH 39/96] Use conan generated target name in test_package. --- recipes/log4cxx/all/test_package/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/log4cxx/all/test_package/CMakeLists.txt b/recipes/log4cxx/all/test_package/CMakeLists.txt index 82bfe10ac8263..6ce52c268af2e 100644 --- a/recipes/log4cxx/all/test_package/CMakeLists.txt +++ b/recipes/log4cxx/all/test_package/CMakeLists.txt @@ -5,5 +5,5 @@ find_package(log4cxx REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17) -target_include_directories(${PROJECT_NAME} PRIVATE ${CONAN_INCLUDE_DIRS}) +target_include_directories(${PROJECT_NAME} PRIVATE ${log4cxx_INCLUDE_DIR}) target_link_libraries(${PROJECT_NAME} PRIVATE ${CONAN_LIBS}) From d898174e422e856bfa379208548ad5c7fe0cd9d6 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Tue, 4 Apr 2023 12:08:47 +1000 Subject: [PATCH 40/96] Use conan generated target name in test_package. --- recipes/log4cxx/all/test_v1_package/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/log4cxx/all/test_v1_package/CMakeLists.txt b/recipes/log4cxx/all/test_v1_package/CMakeLists.txt index 3c11ba18c1a9f..b31ee9eca2bc4 100644 --- a/recipes/log4cxx/all/test_v1_package/CMakeLists.txt +++ b/recipes/log4cxx/all/test_v1_package/CMakeLists.txt @@ -9,4 +9,4 @@ find_package(log4cxx REQUIRED CONFIG) add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17) target_include_directories(${PROJECT_NAME} PRIVATE ${CONAN_INCLUDE_DIRS}) -target_link_libraries(${PROJECT_NAME} log4cxx) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) From 229708c0879154639fb565b622643e5a932762fd Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Tue, 4 Apr 2023 14:26:40 +1000 Subject: [PATCH 41/96] Reduce duplication in test_v1_package. --- recipes/log4cxx/all/test_package/CMakeLists.txt | 2 +- recipes/log4cxx/all/test_v1_package/CMakeLists.txt | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/recipes/log4cxx/all/test_package/CMakeLists.txt b/recipes/log4cxx/all/test_package/CMakeLists.txt index 6ce52c268af2e..9003a843576c9 100644 --- a/recipes/log4cxx/all/test_package/CMakeLists.txt +++ b/recipes/log4cxx/all/test_package/CMakeLists.txt @@ -6,4 +6,4 @@ find_package(log4cxx REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17) target_include_directories(${PROJECT_NAME} PRIVATE ${log4cxx_INCLUDE_DIR}) -target_link_libraries(${PROJECT_NAME} PRIVATE ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE log4cxx) diff --git a/recipes/log4cxx/all/test_v1_package/CMakeLists.txt b/recipes/log4cxx/all/test_v1_package/CMakeLists.txt index b31ee9eca2bc4..be00a8c7f57c7 100644 --- a/recipes/log4cxx/all/test_v1_package/CMakeLists.txt +++ b/recipes/log4cxx/all/test_v1_package/CMakeLists.txt @@ -1,12 +1,8 @@ cmake_minimum_required(VERSION 3.8) -project(test_package CXX) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(log4cxx REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) -target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17) -target_include_directories(${PROJECT_NAME} PRIVATE ${CONAN_INCLUDE_DIRS}) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) From b3f833320d30fde5c7b51c00c19a2781c2a888eb Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Tue, 4 Apr 2023 15:44:54 +1000 Subject: [PATCH 42/96] Use conan generated target name in test_package. --- recipes/log4cxx/all/test_package/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/log4cxx/all/test_package/CMakeLists.txt b/recipes/log4cxx/all/test_package/CMakeLists.txt index 9003a843576c9..9851e3f2089ab 100644 --- a/recipes/log4cxx/all/test_package/CMakeLists.txt +++ b/recipes/log4cxx/all/test_package/CMakeLists.txt @@ -6,4 +6,4 @@ find_package(log4cxx REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17) target_include_directories(${PROJECT_NAME} PRIVATE ${log4cxx_INCLUDE_DIR}) -target_link_libraries(${PROJECT_NAME} PRIVATE log4cxx) +target_link_libraries(${PROJECT_NAME} PRIVATE log4cxx::log4cxx ) From 64747286fbf248be1e2af4826d4eac6ee1101f99 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Tue, 4 Apr 2023 15:50:05 +1000 Subject: [PATCH 43/96] Use conan generated target name in test_package. --- recipes/log4cxx/all/test_package/CMakeLists.txt | 2 +- recipes/log4cxx/all/test_v1_package/CMakeLists.txt | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/recipes/log4cxx/all/test_package/CMakeLists.txt b/recipes/log4cxx/all/test_package/CMakeLists.txt index 9851e3f2089ab..46cbee37aace9 100644 --- a/recipes/log4cxx/all/test_package/CMakeLists.txt +++ b/recipes/log4cxx/all/test_package/CMakeLists.txt @@ -6,4 +6,4 @@ find_package(log4cxx REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17) target_include_directories(${PROJECT_NAME} PRIVATE ${log4cxx_INCLUDE_DIR}) -target_link_libraries(${PROJECT_NAME} PRIVATE log4cxx::log4cxx ) +target_link_libraries(${PROJECT_NAME} PRIVATE log4cxx ) diff --git a/recipes/log4cxx/all/test_v1_package/CMakeLists.txt b/recipes/log4cxx/all/test_v1_package/CMakeLists.txt index be00a8c7f57c7..c9558a628b335 100644 --- a/recipes/log4cxx/all/test_v1_package/CMakeLists.txt +++ b/recipes/log4cxx/all/test_v1_package/CMakeLists.txt @@ -4,5 +4,9 @@ project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) +find_package(log4cxx REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/../test_package.cpp) +target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17) +target_include_directories(${PROJECT_NAME} PRIVATE ${log4cxx_INCLUDE_DIR}) +target_link_libraries(${PROJECT_NAME} PRIVATE log4cxx::log4cxx ) From f5a3b896f63b7d40725f7231006e8ff3667408d0 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Tue, 4 Apr 2023 15:52:28 +1000 Subject: [PATCH 44/96] Use conan generated target name in test_package. --- recipes/log4cxx/all/test_v1_package/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/log4cxx/all/test_v1_package/CMakeLists.txt b/recipes/log4cxx/all/test_v1_package/CMakeLists.txt index c9558a628b335..42492ab1d8d04 100644 --- a/recipes/log4cxx/all/test_v1_package/CMakeLists.txt +++ b/recipes/log4cxx/all/test_v1_package/CMakeLists.txt @@ -6,7 +6,7 @@ conan_basic_setup(TARGETS) find_package(log4cxx REQUIRED CONFIG) -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/../test_package.cpp) +add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/../test_package/test_package.cpp) target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17) target_include_directories(${PROJECT_NAME} PRIVATE ${log4cxx_INCLUDE_DIR}) target_link_libraries(${PROJECT_NAME} PRIVATE log4cxx::log4cxx ) From e4ecb1900b56ae86d306e1af7fdfc8221b546450 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Tue, 4 Apr 2023 17:53:34 +1000 Subject: [PATCH 45/96] Prevent Visual Studio 2017 compilation error --- recipes/log4cxx/all/conandata.yml | 11 +++++++---- recipes/log4cxx/all/patches/0003-logchar-type.patch | 2 +- .../log4cxx/all/patches/0004-visual-studio-15.patch | 10 ++++++++++ ...atch => 0005-fix-static-library-compilation.patch} | 0 4 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 recipes/log4cxx/all/patches/0004-visual-studio-15.patch rename recipes/log4cxx/all/patches/{0002-fix-static-library-compilation.patch => 0005-fix-static-library-compilation.patch} (100%) diff --git a/recipes/log4cxx/all/conandata.yml b/recipes/log4cxx/all/conandata.yml index 387e9eb51e296..e5ff8d94e78a8 100644 --- a/recipes/log4cxx/all/conandata.yml +++ b/recipes/log4cxx/all/conandata.yml @@ -27,14 +27,17 @@ patches: - patch_file: "patches/0002-find-apr.patch" patch_type: "conan" patch_description: "Use conan generated apr, apr-util target names" - - patch_file: "patches/0002-fix-static-library-compilation.patch" - patch_type: "bugfix" - patch_description: "Prevent compilation error when shared=False" - patch_source: "https://github.com/apache/logging-log4cxx/commit/09b5b723a1a210c28bf8b05b0676bb2b104359ba" - patch_file: "patches/0003-logchar-type.patch" patch_type: "bugfix" patch_description: "Prevent compilation errors when with_wchar_t=False" patch_source: "https://github.com/apache/logging-log4cxx/commit/5109466a844d1e5fb8b455a23077765a30325a24" + - patch_file: "patches/0004-visual-studio-15.patch" + patch_type: "bugfix" + patch_description: "Prevent Visual Studio 2017 compilation error" + - patch_file: "patches/0005-fix-static-library-compilation.patch" + patch_type: "bugfix" + patch_description: "Prevent compilation error when shared=False" + patch_source: "https://github.com/apache/logging-log4cxx/commit/09b5b723a1a210c28bf8b05b0676bb2b104359ba" "1.0.0": - patch_file: "patches/0001-pre-cxx17-compilers.patch" patch_type: "bugfix" diff --git a/recipes/log4cxx/all/patches/0003-logchar-type.patch b/recipes/log4cxx/all/patches/0003-logchar-type.patch index c62b87d4185ec..cb4669d6873b4 100644 --- a/recipes/log4cxx/all/patches/0003-logchar-type.patch +++ b/recipes/log4cxx/all/patches/0003-logchar-type.patch @@ -2,7 +2,7 @@ diff --git a/src/main/cpp/threadutility.cpp b/src/main/cpp/threadutility.cpp index c14c12fd..057ecd86 100644 --- a/src/main/cpp/threadutility.cpp +++ b/src/main/cpp/threadutility.cpp -@@ -116,11 +116,13 @@ void ThreadUtility::threadStartedNameThread(LogString threadName, +@@ -113,11 +113,13 @@ void ThreadUtility::threadStartedNameThread(LogString threadName, std::thread::id /*threadId*/, std::thread::native_handle_type nativeHandle){ #if LOG4CXX_HAS_PTHREAD_SETNAME diff --git a/recipes/log4cxx/all/patches/0004-visual-studio-15.patch b/recipes/log4cxx/all/patches/0004-visual-studio-15.patch new file mode 100644 index 0000000000000..6d2dd344498a1 --- /dev/null +++ b/recipes/log4cxx/all/patches/0004-visual-studio-15.patch @@ -0,0 +1,10 @@ +--- a/src/main/cpp/threadutility.cpp ++++ b/src/main/cpp/threadutility.cpp +@@ -28,6 +28,7 @@ + #endif + + using log4cxx::helpers::ThreadUtility; ++using log4cxx::helpers::ThreadConfigurationType; + + struct ThreadUtility::priv_data{ + priv_data(){ diff --git a/recipes/log4cxx/all/patches/0002-fix-static-library-compilation.patch b/recipes/log4cxx/all/patches/0005-fix-static-library-compilation.patch similarity index 100% rename from recipes/log4cxx/all/patches/0002-fix-static-library-compilation.patch rename to recipes/log4cxx/all/patches/0005-fix-static-library-compilation.patch From f4c39893310dd89e0f0748393c2bd2c6492d78a5 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Tue, 4 Apr 2023 18:18:14 +1000 Subject: [PATCH 46/96] Prevent Visual Studio 2017 compilation error --- recipes/log4cxx/all/conandata.yml | 3 +++ .../log4cxx/all/patches/0001-visual-studio-15.patch | 10 ++++++++++ 2 files changed, 13 insertions(+) create mode 100644 recipes/log4cxx/all/patches/0001-visual-studio-15.patch diff --git a/recipes/log4cxx/all/conandata.yml b/recipes/log4cxx/all/conandata.yml index e5ff8d94e78a8..22f90ea005c19 100644 --- a/recipes/log4cxx/all/conandata.yml +++ b/recipes/log4cxx/all/conandata.yml @@ -43,6 +43,9 @@ patches: patch_type: "bugfix" patch_description: "Prevent build failure when compiler.cppstd=14" patch_source: "https://github.com/apache/logging-log4cxx/commit/0b83584592290cb539f90ab79fc542d60cc3ba23" + - patch_file: "patches/0001-visual-studio-15.patch" + patch_type: "bugfix" + patch_description: "Prevent Visual Studio 2017 compilation error" - patch_file: "patches/0002-make-odbc-and-esmtp-optional.patch" patch_type: "conan" patch_description: "Prevent 'odbc/2.3.11' requires 'libiconv/1.17' while 'apr-util/1.6.1' requires 'libiconv/1.16'" diff --git a/recipes/log4cxx/all/patches/0001-visual-studio-15.patch b/recipes/log4cxx/all/patches/0001-visual-studio-15.patch new file mode 100644 index 0000000000000..b8ac5c52b249a --- /dev/null +++ b/recipes/log4cxx/all/patches/0001-visual-studio-15.patch @@ -0,0 +1,10 @@ +--- a/src/main/cpp/threadutility.cpp ++++ b/src/main/cpp/threadutility.cpp +@@ -31,6 +31,7 @@ + #endif + + using log4cxx::helpers::ThreadUtility; ++using log4cxx::helpers::ThreadConfigurationType; + + struct ThreadUtility::priv_data + { From 9297e1cee96458ed23959c07aa3579b2b43bbd77 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Wed, 5 Apr 2023 11:55:05 +1000 Subject: [PATCH 47/96] Prevent Visual Studio 2017 compilation error --- .../all/patches/0001-visual-studio-15.patch | 93 ++++++++++++++++++- .../all/patches/0004-visual-studio-15.patch | 48 +++++++++- 2 files changed, 135 insertions(+), 6 deletions(-) diff --git a/recipes/log4cxx/all/patches/0001-visual-studio-15.patch b/recipes/log4cxx/all/patches/0001-visual-studio-15.patch index b8ac5c52b249a..6296e0a9d8d1a 100644 --- a/recipes/log4cxx/all/patches/0001-visual-studio-15.patch +++ b/recipes/log4cxx/all/patches/0001-visual-studio-15.patch @@ -1,10 +1,97 @@ +diff --git a/src/main/cpp/threadutility.cpp b/src/main/cpp/threadutility.cpp +index 877b06ea..0467d172 100644 --- a/src/main/cpp/threadutility.cpp +++ b/src/main/cpp/threadutility.cpp -@@ -31,6 +31,7 @@ +@@ -21,16 +21,20 @@ #endif + #include "log4cxx/private/log4cxx_private.h" + #include "log4cxx/helpers/loglog.h" ++#include "log4cxx/helpers/transcoder.h" - using log4cxx::helpers::ThreadUtility; -+using log4cxx::helpers::ThreadConfigurationType; + #include + #include + +-#if LOG4CXX_HAS_SETTHREADDESCRIPTION ++#if WIN32 + #include + #include + #endif + +-using log4cxx::helpers::ThreadUtility; ++namespace log4cxx ++{ ++namespace helpers ++{ struct ThreadUtility::priv_data { +@@ -41,9 +45,9 @@ struct ThreadUtility::priv_data + start_post = nullptr; + } + +- log4cxx::helpers::ThreadStartPre start_pre; +- log4cxx::helpers::ThreadStarted started; +- log4cxx::helpers::ThreadStartPost start_post; ++ ThreadStartPre start_pre; ++ ThreadStarted started; ++ ThreadStartPost start_post; + }; + + #if LOG4CXX_HAS_PTHREAD_SIGMASK +@@ -139,13 +143,26 @@ void ThreadUtility::threadStartedNameThread(LogString threadName, + if (pthread_setname_np(static_cast(nativeHandle), sthreadName.c_str()) < 0) { + LOGLOG_ERROR(LOG4CXX_STR("unable to set thread name")); + } +-#elif LOG4CXX_HAS_SETTHREADDESCRIPTION +- LOG4CXX_ENCODE_WCHAR(wthreadName, threadName); +- HRESULT hr = SetThreadDescription(static_cast(nativeHandle), wthreadName.c_str()); +- if(FAILED(hr)){ +- LOGLOG_ERROR( LOG4CXX_STR("unable to set thread name") ); ++#elif WIN32 ++ typedef HRESULT (WINAPI *TSetThreadDescription)(HANDLE, PCWSTR); ++ static struct initialiser ++ { ++ HMODULE hKernelBase; ++ TSetThreadDescription SetThreadDescription; ++ initialiser() ++ : hKernelBase(GetModuleHandleA("KernelBase.dll")) ++ , SetThreadDescription(nullptr) ++ { ++ if (hKernelBase) ++ SetThreadDescription = reinterpret_cast(GetProcAddress(hKernelBase, "SetThreadDescription")); ++ } ++ } win32Func; ++ if (win32Func.SetThreadDescription) ++ { ++ LOG4CXX_ENCODE_WCHAR(wthreadName, threadName); ++ if(FAILED(win32Func.SetThreadDescription(static_cast(nativeHandle), wthreadName.c_str()))) ++ LOGLOG_ERROR( LOG4CXX_STR("unable to set thread name") ); + } +- + #endif + } + +@@ -166,17 +183,20 @@ void ThreadUtility::postThreadUnblockSignals() + } + + +-log4cxx::helpers::ThreadStartPre ThreadUtility::preStartFunction() ++ThreadStartPre ThreadUtility::preStartFunction() + { + return m_priv->start_pre; + } + +-log4cxx::helpers::ThreadStarted ThreadUtility::threadStartedFunction() ++ThreadStarted ThreadUtility::threadStartedFunction() + { + return m_priv->started; + } + +-log4cxx::helpers::ThreadStartPost ThreadUtility::postStartFunction() ++ThreadStartPost ThreadUtility::postStartFunction() + { + return m_priv->start_post; + } ++ ++} //namespace helpers ++} //namespace log4cxx diff --git a/recipes/log4cxx/all/patches/0004-visual-studio-15.patch b/recipes/log4cxx/all/patches/0004-visual-studio-15.patch index 6d2dd344498a1..0c491ee579c3b 100644 --- a/recipes/log4cxx/all/patches/0004-visual-studio-15.patch +++ b/recipes/log4cxx/all/patches/0004-visual-studio-15.patch @@ -1,10 +1,52 @@ +diff --git a/src/main/cpp/threadutility.cpp b/src/main/cpp/threadutility.cpp +index b57ab66..ef48704 100644 --- a/src/main/cpp/threadutility.cpp +++ b/src/main/cpp/threadutility.cpp -@@ -28,6 +28,7 @@ +@@ -27,7 +27,11 @@ + #include #endif - using log4cxx::helpers::ThreadUtility; -+using log4cxx::helpers::ThreadConfigurationType; +-using log4cxx::helpers::ThreadUtility; ++namespace log4cxx ++{ ++namespace helpers ++{ ++ struct ThreadUtility::priv_data{ priv_data(){ +@@ -36,9 +40,9 @@ struct ThreadUtility::priv_data{ + start_post = nullptr; + } + +- log4cxx::helpers::ThreadStartPre start_pre; +- log4cxx::helpers::ThreadStarted started; +- log4cxx::helpers::ThreadStartPost start_post; ++ ThreadStartPre start_pre; ++ ThreadStarted started; ++ ThreadStartPost start_post; + }; + + #if LOG4CXX_HAS_PTHREAD_SIGMASK +@@ -138,14 +142,18 @@ void ThreadUtility::postThreadUnblockSignals(){ + } + + +-log4cxx::helpers::ThreadStartPre ThreadUtility::preStartFunction(){ ++ThreadStartPre ThreadUtility::preStartFunction(){ + return m_priv->start_pre; + } + +-log4cxx::helpers::ThreadStarted ThreadUtility::threadStartedFunction(){ ++ThreadStarted ThreadUtility::threadStartedFunction(){ + return m_priv->started; + } + +-log4cxx::helpers::ThreadStartPost ThreadUtility::postStartFunction(){ ++ThreadStartPost ThreadUtility::postStartFunction(){ + return m_priv->start_post; + } ++ ++} //namespace helpers ++} //namespace log4cxx ++ From c7497097f29bc34a96c8770dc11a60665fd3b1bb Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Wed, 5 Apr 2023 14:38:33 +1000 Subject: [PATCH 48/96] Prevent Visual Studio 2017 compilation error --- recipes/log4cxx/all/conandata.yml | 3 + .../all/patches/0002-visual-studio-15.patch | 104 ++++++++++++++++++ 2 files changed, 107 insertions(+) create mode 100644 recipes/log4cxx/all/patches/0002-visual-studio-15.patch diff --git a/recipes/log4cxx/all/conandata.yml b/recipes/log4cxx/all/conandata.yml index 22f90ea005c19..f78a2f2fa1325 100644 --- a/recipes/log4cxx/all/conandata.yml +++ b/recipes/log4cxx/all/conandata.yml @@ -46,6 +46,9 @@ patches: - patch_file: "patches/0001-visual-studio-15.patch" patch_type: "bugfix" patch_description: "Prevent Visual Studio 2017 compilation error" + - patch_file: "patches/0002-visual-studio-15.patch" + patch_type: "bugfix" + patch_description: "Prevent Visual Studio 2017 compilation error" - patch_file: "patches/0002-make-odbc-and-esmtp-optional.patch" patch_type: "conan" patch_description: "Prevent 'odbc/2.3.11' requires 'libiconv/1.17' while 'apr-util/1.6.1' requires 'libiconv/1.16'" diff --git a/recipes/log4cxx/all/patches/0002-visual-studio-15.patch b/recipes/log4cxx/all/patches/0002-visual-studio-15.patch new file mode 100644 index 0000000000000..c7d4b1e6dda2a --- /dev/null +++ b/recipes/log4cxx/all/patches/0002-visual-studio-15.patch @@ -0,0 +1,104 @@ +diff --git a/src/main/cpp-qt/configuration.cpp b/src/main/cpp-qt/configuration.cpp +index 516acef4..166de640 100644 +--- a/src/main/cpp-qt/configuration.cpp ++++ b/src/main/cpp-qt/configuration.cpp +@@ -26,7 +26,10 @@ + #include + + using log4cxx::qt::Configuration; +-using log4cxx::helpers::LogLog; ++namespace log4cxx ++{ ++namespace helpers ++{ + + static std::unique_ptr watcher; + static QString configFilename; +@@ -120,3 +123,6 @@ Configuration::configureFromFileAndWatch(const QVector& directories, + + return {log4cxx::spi::ConfigurationStatus::NotConfigured, QString()}; + } ++ ++} //namespace helpers ++} //namespace log4cxx +diff --git a/src/main/cpp/aprdatagramsocket.cpp b/src/main/cpp/aprdatagramsocket.cpp +index f337736f..55852386 100644 +--- a/src/main/cpp/aprdatagramsocket.cpp ++++ b/src/main/cpp/aprdatagramsocket.cpp +@@ -20,7 +20,10 @@ + #include + #include + +-using log4cxx::helpers::APRDatagramSocket; ++namespace log4cxx ++{ ++namespace helpers ++{ + + #define _priv static_cast(m_priv.get()) + +@@ -207,3 +210,6 @@ bool APRDatagramSocket::isClosed() const + { + return _priv->socket != nullptr; + } ++ ++} //namespace helpers ++} //namespace log4cxx +diff --git a/src/main/cpp/aprserversocket.cpp b/src/main/cpp/aprserversocket.cpp +index 797b5a1b..23140030 100644 +--- a/src/main/cpp/aprserversocket.cpp ++++ b/src/main/cpp/aprserversocket.cpp +@@ -22,7 +22,10 @@ + #include "apr_pools.h" + #include "apr_poll.h" + +-using log4cxx::helpers::APRServerSocket; ++namespace log4cxx ++{ ++namespace helpers ++{ + + #define _priv static_cast(m_priv.get()) + +@@ -98,7 +101,7 @@ void APRServerSocket::close(){ + /** Listens for a connection to be made to this socket and + accepts it + */ +-log4cxx::helpers::SocketPtr APRServerSocket::accept() ++SocketPtr APRServerSocket::accept() + { + std::unique_lock lock(_priv->mutex); + +@@ -155,3 +158,6 @@ log4cxx::helpers::SocketPtr APRServerSocket::accept() + + return std::make_shared(newSocket, newPool); + } ++ ++} //namespace helpers ++} //namespace log4cxx +diff --git a/src/main/cpp/aprsocket.cpp b/src/main/cpp/aprsocket.cpp +index e212c689..624363aa 100644 +--- a/src/main/cpp/aprsocket.cpp ++++ b/src/main/cpp/aprsocket.cpp +@@ -23,9 +23,12 @@ + #include "apr_network_io.h" + #include "apr_signal.h" + +-using log4cxx::helpers::APRSocket; ++namespace log4cxx ++{ ++namespace helpers ++{ + +-struct APRSocket::APRSocketPriv : public log4cxx::helpers::Socket::SocketPrivate { ++struct APRSocket::APRSocketPriv : public Socket::SocketPrivate { + APRSocketPriv() : + socket(nullptr) + {} +@@ -154,3 +157,6 @@ void APRSocket::close() + _priv->socket = 0; + } + } ++ ++} //namespace helpers ++} //namespace log4cxx From 754b2042dbeb2b0ba25365a41a97e78438d95dcd Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Wed, 5 Apr 2023 15:00:43 +1000 Subject: [PATCH 49/96] Prevent Visual Studio 2017 compilation error --- recipes/log4cxx/all/conandata.yml | 3 +++ .../all/patches/0002-visual-studio-15.patch | 23 ------------------- .../all/patches/0003-visual-studio-15.patch | 23 +++++++++++++++++++ 3 files changed, 26 insertions(+), 23 deletions(-) create mode 100644 recipes/log4cxx/all/patches/0003-visual-studio-15.patch diff --git a/recipes/log4cxx/all/conandata.yml b/recipes/log4cxx/all/conandata.yml index f78a2f2fa1325..9b59a493fb08d 100644 --- a/recipes/log4cxx/all/conandata.yml +++ b/recipes/log4cxx/all/conandata.yml @@ -55,6 +55,9 @@ patches: - patch_file: "patches/0003-find-apr.patch" patch_type: "conan" patch_description: "Use conan generated apr, apr-util target names" + - patch_file: "patches/0003-visual-studio-15.patch" + patch_type: "bugfix" + patch_description: "Prevent Visual Studio 2017 compilation error" - patch_file: "patches/0004-gcc5-compiler-error.patch" patch_type: "bugfix" patch_description: "Prevent build failure when compiling with gcc5" diff --git a/recipes/log4cxx/all/patches/0002-visual-studio-15.patch b/recipes/log4cxx/all/patches/0002-visual-studio-15.patch index c7d4b1e6dda2a..31015713f5045 100644 --- a/recipes/log4cxx/all/patches/0002-visual-studio-15.patch +++ b/recipes/log4cxx/all/patches/0002-visual-studio-15.patch @@ -1,26 +1,3 @@ -diff --git a/src/main/cpp-qt/configuration.cpp b/src/main/cpp-qt/configuration.cpp -index 516acef4..166de640 100644 ---- a/src/main/cpp-qt/configuration.cpp -+++ b/src/main/cpp-qt/configuration.cpp -@@ -26,7 +26,10 @@ - #include - - using log4cxx::qt::Configuration; --using log4cxx::helpers::LogLog; -+namespace log4cxx -+{ -+namespace helpers -+{ - - static std::unique_ptr watcher; - static QString configFilename; -@@ -120,3 +123,6 @@ Configuration::configureFromFileAndWatch(const QVector& directories, - - return {log4cxx::spi::ConfigurationStatus::NotConfigured, QString()}; - } -+ -+} //namespace helpers -+} //namespace log4cxx diff --git a/src/main/cpp/aprdatagramsocket.cpp b/src/main/cpp/aprdatagramsocket.cpp index f337736f..55852386 100644 --- a/src/main/cpp/aprdatagramsocket.cpp diff --git a/recipes/log4cxx/all/patches/0003-visual-studio-15.patch b/recipes/log4cxx/all/patches/0003-visual-studio-15.patch new file mode 100644 index 0000000000000..b2ffb43cfb949 --- /dev/null +++ b/recipes/log4cxx/all/patches/0003-visual-studio-15.patch @@ -0,0 +1,23 @@ +diff --git a/src/main/cpp-qt/configuration.cpp b/src/main/cpp-qt/configuration.cpp +index 516acef4..ef8589fe 100644 +--- a/src/main/cpp-qt/configuration.cpp ++++ b/src/main/cpp-qt/configuration.cpp +@@ -25,7 +25,10 @@ + #include + #include + +-using log4cxx::qt::Configuration; ++namespace log4cxx ++{ ++namespace qt ++{ + using log4cxx::helpers::LogLog; + + static std::unique_ptr watcher; +@@ -120,3 +123,6 @@ Configuration::configureFromFileAndWatch(const QVector& directories, + + return {log4cxx::spi::ConfigurationStatus::NotConfigured, QString()}; + } ++ ++} //namespace helpers ++} //namespace log4cxx From 2e731683e8731dbbebd32519aa7fcf731dd99089 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Wed, 5 Apr 2023 17:33:14 +1000 Subject: [PATCH 50/96] Provide bugfix source urls. Provide C++17 requirement as information instad of a warning --- recipes/log4cxx/all/conandata.yml | 5 +++++ recipes/log4cxx/all/conanfile.py | 4 ++-- recipes/log4cxx/all/test_package/test_package.cpp | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/recipes/log4cxx/all/conandata.yml b/recipes/log4cxx/all/conandata.yml index 9b59a493fb08d..6a41b8ea1b91e 100644 --- a/recipes/log4cxx/all/conandata.yml +++ b/recipes/log4cxx/all/conandata.yml @@ -34,6 +34,7 @@ patches: - patch_file: "patches/0004-visual-studio-15.patch" patch_type: "bugfix" patch_description: "Prevent Visual Studio 2017 compilation error" + patch_source: "https://github.com/apache/logging-log4cxx/commit/f59bf53f831b8b68ef3a2f3a6705ae626090758e" - patch_file: "patches/0005-fix-static-library-compilation.patch" patch_type: "bugfix" patch_description: "Prevent compilation error when shared=False" @@ -46,9 +47,11 @@ patches: - patch_file: "patches/0001-visual-studio-15.patch" patch_type: "bugfix" patch_description: "Prevent Visual Studio 2017 compilation error" + patch_source: "https://github.com/apache/logging-log4cxx/commit/f59bf53f831b8b68ef3a2f3a6705ae626090758e" - patch_file: "patches/0002-visual-studio-15.patch" patch_type: "bugfix" patch_description: "Prevent Visual Studio 2017 compilation error" + patch_source: "https://github.com/apache/logging-log4cxx/commit/f59bf53f831b8b68ef3a2f3a6705ae626090758e" - patch_file: "patches/0002-make-odbc-and-esmtp-optional.patch" patch_type: "conan" patch_description: "Prevent 'odbc/2.3.11' requires 'libiconv/1.17' while 'apr-util/1.6.1' requires 'libiconv/1.16'" @@ -58,6 +61,8 @@ patches: - patch_file: "patches/0003-visual-studio-15.patch" patch_type: "bugfix" patch_description: "Prevent Visual Studio 2017 compilation error" + patch_source: "https://github.com/apache/logging-log4cxx/commit/f59bf53f831b8b68ef3a2f3a6705ae626090758e" - patch_file: "patches/0004-gcc5-compiler-error.patch" patch_type: "bugfix" patch_description: "Prevent build failure when compiling with gcc5" + patch_source: "https://github.com/apache/logging-log4cxx/commit/f59bf53f831b8b68ef3a2f3a6705ae626090758e" diff --git a/recipes/log4cxx/all/conanfile.py b/recipes/log4cxx/all/conanfile.py index ba69ff8bd6aed..5079f80607e9d 100644 --- a/recipes/log4cxx/all/conanfile.py +++ b/recipes/log4cxx/all/conanfile.py @@ -84,9 +84,9 @@ def validate(self): if Version(self.version) < "1.0.0" or self.options.get_safe("with_multiprocess_rolling_file_appender"): # TODO: if compiler doesn't support C++17, boost can be used instead if Version(self.version) < "1.0.0": - self.output.warning(f"Version {self.version} requires C++17. Use log4cxx version 1.0.0 or set compiler.cppstd=17.") + self.output.info(f"Version {self.version} requires C++17. log4cxx version 1.0.0 does not.") else: - self.output.warning("multiprocess rolling file appender requires C++17.") + self.output.info("multiprocess rolling file appender requires C++17.") minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) compiler_version = Version(self.settings.compiler.version) if not minimum_version: diff --git a/recipes/log4cxx/all/test_package/test_package.cpp b/recipes/log4cxx/all/test_package/test_package.cpp index 4e52b04611957..1439c36c33ac1 100644 --- a/recipes/log4cxx/all/test_package/test_package.cpp +++ b/recipes/log4cxx/all/test_package/test_package.cpp @@ -14,7 +14,7 @@ int main(int argc, const char* argv[]) return -1; } DOMConfigurator::configure(argv[1]); - LOG4CXX_INFO(logger, "App started!"); - LOG4CXX_ERROR(logger, "Some error!"); + LOG4CXX_INFO(logger, "App started"); + LOG4CXX_ERROR(logger, "Information message"); return 0; } From 57a03e75c36f486ba5236a03f597fcdaaf53dfe0 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Thu, 6 Apr 2023 10:50:06 +1000 Subject: [PATCH 51/96] Prevent WARN: apr-util/1.6.1: requirement expat/2.4.1 overridden by log4cxx/0.12.1 to expat/2.5.0 --- recipes/log4cxx/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/log4cxx/all/conanfile.py b/recipes/log4cxx/all/conanfile.py index 5079f80607e9d..4c3640c67ee47 100644 --- a/recipes/log4cxx/all/conanfile.py +++ b/recipes/log4cxx/all/conanfile.py @@ -60,7 +60,7 @@ def configure(self): def requirements(self): self.requires("apr/[>=1.6]") self.requires("apr-util/[>=1.6]") - self.requires("expat/[>=2.4]") + self.requires("expat/2.4.1") if self.options.get_safe("with_odbc_appender") and self.settings.os != "Windows": self.requires("odbc/[>=2.3]") if self.options.get_safe("with_smtp_appender"): From 682d7ebb418de6cbdbefb2d678e8483e3c086e50 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Thu, 6 Apr 2023 22:16:11 +1000 Subject: [PATCH 52/96] Revert "Prevent WARN: apr-util/1.6.1: requirement expat/2.4.1 overridden by log4cxx/0.12.1 to expat/2.5.0" This reverts commit 57a03e75c36f486ba5236a03f597fcdaaf53dfe0. --- recipes/log4cxx/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/log4cxx/all/conanfile.py b/recipes/log4cxx/all/conanfile.py index 4c3640c67ee47..5079f80607e9d 100644 --- a/recipes/log4cxx/all/conanfile.py +++ b/recipes/log4cxx/all/conanfile.py @@ -60,7 +60,7 @@ def configure(self): def requirements(self): self.requires("apr/[>=1.6]") self.requires("apr-util/[>=1.6]") - self.requires("expat/2.4.1") + self.requires("expat/[>=2.4]") if self.options.get_safe("with_odbc_appender") and self.settings.os != "Windows": self.requires("odbc/[>=2.3]") if self.options.get_safe("with_smtp_appender"): From 9169ec14cdadba46b1ec40af426c565a66c508f6 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Thu, 6 Apr 2023 22:22:01 +1000 Subject: [PATCH 53/96] Fix Windows failure when using a shared library --- recipes/log4cxx/all/test_package/test_package.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/recipes/log4cxx/all/test_package/test_package.cpp b/recipes/log4cxx/all/test_package/test_package.cpp index 1439c36c33ac1..41abd554c33f4 100644 --- a/recipes/log4cxx/all/test_package/test_package.cpp +++ b/recipes/log4cxx/all/test_package/test_package.cpp @@ -1,20 +1,18 @@ -#include "log4cxx/logger.h" +#include "log4cxx/logmanager.h" #include "log4cxx/xml/domconfigurator.h" #include -using namespace log4cxx; -using namespace log4cxx::xml; - int main(int argc, const char* argv[]) { - LoggerPtr logger(Logger::getLogger("TEST")); if (argc < 2) { - std::cerr << "Expected path to config xml\n"; + std::cerr << "Usage error. Expected an argument, the path to a xml configuration file\n"; return -1; } - DOMConfigurator::configure(argv[1]); + log4cxx::xml::DOMConfigurator::configure(argv[1]); + auto logger = log4cxx::LogManager::getLogger("TEST"); LOG4CXX_INFO(logger, "App started"); LOG4CXX_ERROR(logger, "Information message"); + log4cxx::LogManager::shutdown(); return 0; } From 33a568a583069abe48dbe3345c0bf0a8f29d0eea Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Fri, 7 Apr 2023 12:03:35 +1000 Subject: [PATCH 54/96] Remove expat requirement - it is not directly required by log4cxx --- recipes/log4cxx/all/conanfile.py | 1 - 1 file changed, 1 deletion(-) diff --git a/recipes/log4cxx/all/conanfile.py b/recipes/log4cxx/all/conanfile.py index 5079f80607e9d..387fa071178a5 100644 --- a/recipes/log4cxx/all/conanfile.py +++ b/recipes/log4cxx/all/conanfile.py @@ -60,7 +60,6 @@ def configure(self): def requirements(self): self.requires("apr/[>=1.6]") self.requires("apr-util/[>=1.6]") - self.requires("expat/[>=2.4]") if self.options.get_safe("with_odbc_appender") and self.settings.os != "Windows": self.requires("odbc/[>=2.3]") if self.options.get_safe("with_smtp_appender"): From e62ae4103d62d539736bdf42ff5449ae43d94f14 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Fri, 7 Apr 2023 12:05:23 +1000 Subject: [PATCH 55/96] Attempt to get CI logs for version 1.0.0 --- recipes/log4cxx/all/conandata.yml | 72 +++++++++++++++---------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/recipes/log4cxx/all/conandata.yml b/recipes/log4cxx/all/conandata.yml index 6a41b8ea1b91e..5327554e3d8f8 100644 --- a/recipes/log4cxx/all/conandata.yml +++ b/recipes/log4cxx/all/conandata.yml @@ -1,44 +1,14 @@ sources: - "0.12.1": - url: "https://archive.apache.org/dist/logging/log4cxx/0.12.1/apache-log4cxx-0.12.1.tar.gz" - sha256: "7bea5cb477f0e31c838f0e1f4f498cc3b30c2eae74703ddda923e7e8c2268d22" - "0.13.0": - sha256: "4e5be64b6b1e6de8525f8b87635270b81f772a98902d20d7ac646fdf1ac08284" - url: "https://archive.apache.org/dist/logging/log4cxx/0.13.0/apache-log4cxx-0.13.0.tar.gz" "1.0.0": sha256: "6df9f1f682650de6045309473d5b2fe1f798a03ceb36a74a5b21f5520962d32f" url: "https://archive.apache.org/dist/logging/log4cxx/1.0.0/apache-log4cxx-1.0.0.tar.gz" -patches: - "0.12.1": - - patch_file: "patches/0001-make-odbc-optional.patch" - patch_type: "conan" - patch_description: "Prevent 'odbc/2.3.11' requires 'libiconv/1.17' while 'apr-util/1.6.1' requires 'libiconv/1.16'" - - patch_file: "patches/0001-find-apr.patch" - patch_type: "conan" - patch_description: "Use conan generated apr, apr-util target names" - - patch_file: "patches/0002-fix-expat-target.patch" - patch_type: "conan" - patch_description: "Use conan generated expat target name" - - patch_file: "patches/0002-logchar-type.patch" - patch_type: "bugfix" - patch_description: "Prevent compilation errors when with_wchar_t=False" - patch_source: "https://github.com/apache/logging-log4cxx/commit/5109466a844d1e5fb8b455a23077765a30325a24" "0.13.0": - - patch_file: "patches/0002-find-apr.patch" - patch_type: "conan" - patch_description: "Use conan generated apr, apr-util target names" - - patch_file: "patches/0003-logchar-type.patch" - patch_type: "bugfix" - patch_description: "Prevent compilation errors when with_wchar_t=False" - patch_source: "https://github.com/apache/logging-log4cxx/commit/5109466a844d1e5fb8b455a23077765a30325a24" - - patch_file: "patches/0004-visual-studio-15.patch" - patch_type: "bugfix" - patch_description: "Prevent Visual Studio 2017 compilation error" - patch_source: "https://github.com/apache/logging-log4cxx/commit/f59bf53f831b8b68ef3a2f3a6705ae626090758e" - - patch_file: "patches/0005-fix-static-library-compilation.patch" - patch_type: "bugfix" - patch_description: "Prevent compilation error when shared=False" - patch_source: "https://github.com/apache/logging-log4cxx/commit/09b5b723a1a210c28bf8b05b0676bb2b104359ba" + sha256: "4e5be64b6b1e6de8525f8b87635270b81f772a98902d20d7ac646fdf1ac08284" + url: "https://archive.apache.org/dist/logging/log4cxx/0.13.0/apache-log4cxx-0.13.0.tar.gz" + "0.12.1": + url: "https://archive.apache.org/dist/logging/log4cxx/0.12.1/apache-log4cxx-0.12.1.tar.gz" + sha256: "7bea5cb477f0e31c838f0e1f4f498cc3b30c2eae74703ddda923e7e8c2268d22" +patches: "1.0.0": - patch_file: "patches/0001-pre-cxx17-compilers.patch" patch_type: "bugfix" @@ -66,3 +36,33 @@ patches: patch_type: "bugfix" patch_description: "Prevent build failure when compiling with gcc5" patch_source: "https://github.com/apache/logging-log4cxx/commit/f59bf53f831b8b68ef3a2f3a6705ae626090758e" + "0.13.0": + - patch_file: "patches/0002-find-apr.patch" + patch_type: "conan" + patch_description: "Use conan generated apr, apr-util target names" + - patch_file: "patches/0003-logchar-type.patch" + patch_type: "bugfix" + patch_description: "Prevent compilation errors when with_wchar_t=False" + patch_source: "https://github.com/apache/logging-log4cxx/commit/5109466a844d1e5fb8b455a23077765a30325a24" + - patch_file: "patches/0004-visual-studio-15.patch" + patch_type: "bugfix" + patch_description: "Prevent Visual Studio 2017 compilation error" + patch_source: "https://github.com/apache/logging-log4cxx/commit/f59bf53f831b8b68ef3a2f3a6705ae626090758e" + - patch_file: "patches/0005-fix-static-library-compilation.patch" + patch_type: "bugfix" + patch_description: "Prevent compilation error when shared=False" + patch_source: "https://github.com/apache/logging-log4cxx/commit/09b5b723a1a210c28bf8b05b0676bb2b104359ba" + "0.12.1": + - patch_file: "patches/0001-make-odbc-optional.patch" + patch_type: "conan" + patch_description: "Prevent 'odbc/2.3.11' requires 'libiconv/1.17' while 'apr-util/1.6.1' requires 'libiconv/1.16'" + - patch_file: "patches/0001-find-apr.patch" + patch_type: "conan" + patch_description: "Use conan generated apr, apr-util target names" + - patch_file: "patches/0002-fix-expat-target.patch" + patch_type: "conan" + patch_description: "Use conan generated expat target name" + - patch_file: "patches/0002-logchar-type.patch" + patch_type: "bugfix" + patch_description: "Prevent compilation errors when with_wchar_t=False" + patch_source: "https://github.com/apache/logging-log4cxx/commit/5109466a844d1e5fb8b455a23077765a30325a24" From 2c91c770c730d3d64feb152ed4b0af46ad32cd49 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Fri, 7 Apr 2023 13:33:21 +1000 Subject: [PATCH 56/96] Fix Windows failure when using a shared library --- recipes/log4cxx/all/test_package/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/log4cxx/all/test_package/conanfile.py b/recipes/log4cxx/all/test_package/conanfile.py index c62801f661e54..c0959972ac66c 100644 --- a/recipes/log4cxx/all/test_package/conanfile.py +++ b/recipes/log4cxx/all/test_package/conanfile.py @@ -23,4 +23,4 @@ def test(self): if can_run(self): config_xml_name = os.path.join(self.source_folder, "log4cxx_config.xml") bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - self.run("{} {}".format(bin_path, config_xml_name), env="conanrun") + self.run("{} {}".format(bin_path, config_xml_name), run_environment=True, env="conanrun") From ec06aab36ce93d7c334dccfc477fd545e07286e4 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Fri, 7 Apr 2023 15:19:45 +1000 Subject: [PATCH 57/96] Make test_package conform with other conan 2 recipes --- recipes/log4cxx/all/test_package/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/log4cxx/all/test_package/conanfile.py b/recipes/log4cxx/all/test_package/conanfile.py index c0959972ac66c..549fd9532dd16 100644 --- a/recipes/log4cxx/all/test_package/conanfile.py +++ b/recipes/log4cxx/all/test_package/conanfile.py @@ -5,7 +5,7 @@ class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "CMakeDeps", "CMakeToolchain" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" test_type = "explicit" def layout(self): @@ -23,4 +23,4 @@ def test(self): if can_run(self): config_xml_name = os.path.join(self.source_folder, "log4cxx_config.xml") bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - self.run("{} {}".format(bin_path, config_xml_name), run_environment=True, env="conanrun") + self.run("{} {}".format(bin_path, config_xml_name), env="conanrun") From 56ae2d42e55ef514e4623fbd7487661d80d2bd98 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Mon, 10 Apr 2023 15:14:10 +1000 Subject: [PATCH 58/96] PkgConfig is mostly not required. Version 1.0.0 requires C++11. --- recipes/log4cxx/all/conanfile.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/recipes/log4cxx/all/conanfile.py b/recipes/log4cxx/all/conanfile.py index 387fa071178a5..1615d3b3a13f8 100644 --- a/recipes/log4cxx/all/conanfile.py +++ b/recipes/log4cxx/all/conanfile.py @@ -94,9 +94,11 @@ def validate(self): raise ConanInvalidConfiguration(f"{self.settings.compiler} {compiler_version} does not support C++17: {minimum_version} required.") if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, "17") + elif self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, "11") def build_requirements(self): - if self.settings.os != "Windows": + if self.options.get_safe("with_odbc_appender") and self.settings.os != "Windows": self.tool_requires("pkgconf/1.7.4") def layout(self): From 9a239a90698c2dd99f50bab136fe104e51eb4a56 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Tue, 11 Apr 2023 14:58:54 +1000 Subject: [PATCH 59/96] Use find_package(ODBC) instead of pkg_check_modules( odbc odbc ) --- recipes/log4cxx/all/conanfile.py | 4 ---- recipes/log4cxx/all/patches/0001-make-odbc-optional.patch | 8 ++++---- .../all/patches/0002-make-odbc-and-esmtp-optional.patch | 8 ++++---- recipes/log4cxx/all/patches/0002-make-odbc-optional.patch | 8 ++++---- 4 files changed, 12 insertions(+), 16 deletions(-) diff --git a/recipes/log4cxx/all/conanfile.py b/recipes/log4cxx/all/conanfile.py index 1615d3b3a13f8..1da248c78aadf 100644 --- a/recipes/log4cxx/all/conanfile.py +++ b/recipes/log4cxx/all/conanfile.py @@ -97,10 +97,6 @@ def validate(self): elif self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, "11") - def build_requirements(self): - if self.options.get_safe("with_odbc_appender") and self.settings.os != "Windows": - self.tool_requires("pkgconf/1.7.4") - def layout(self): cmake_layout(self, src_folder="src") diff --git a/recipes/log4cxx/all/patches/0001-make-odbc-optional.patch b/recipes/log4cxx/all/patches/0001-make-odbc-optional.patch index c0b1fb3f1e387..40b57b6407be1 100644 --- a/recipes/log4cxx/all/patches/0001-make-odbc-optional.patch +++ b/recipes/log4cxx/all/patches/0001-make-odbc-optional.patch @@ -13,19 +13,19 @@ + if(WIN32) + CHECK_INCLUDE_FILES(sqlext.h HAS_ODBC) + else() -+ include(FindPkgConfig) ++ find_package(ODBC) - pkg_check_modules( odbc QUIET odbc ) - if(${odbc_FOUND}) - set(HAS_ODBC 1) - endif(${odbc_FOUND}) -endif(WIN32) -+ pkg_check_modules( odbc odbc ) -+ if(${odbc_FOUND}) ++ ++ if(${ODBC_FOUND}) + set(HAS_ODBC 1) + else() + set(HAS_ODBC 0) -+ endif(${odbc_FOUND}) ++ endif(${ODBC_FOUND}) + endif(WIN32) + + if(NOT ${HAS_ODBC}) diff --git a/recipes/log4cxx/all/patches/0002-make-odbc-and-esmtp-optional.patch b/recipes/log4cxx/all/patches/0002-make-odbc-and-esmtp-optional.patch index 6e8edce9f006c..3871bd208d55a 100644 --- a/recipes/log4cxx/all/patches/0002-make-odbc-and-esmtp-optional.patch +++ b/recipes/log4cxx/all/patches/0002-make-odbc-and-esmtp-optional.patch @@ -13,14 +13,14 @@ index 59982cf..5f6c123 100644 + if(WIN32) + CHECK_INCLUDE_FILES(sqlext.h HAS_ODBC) + else() -+ include(FindPkgConfig) ++ find_package(ODBC) + -+ pkg_check_modules( odbc odbc ) -+ if(${odbc_FOUND}) ++ ++ if(${ODBC_FOUND}) + set(HAS_ODBC 1) + else() + set(HAS_ODBC 0) -+ endif(${odbc_FOUND}) ++ endif(${ODBC_FOUND}) + endif(WIN32) + + if(NOT ${HAS_ODBC}) diff --git a/recipes/log4cxx/all/patches/0002-make-odbc-optional.patch b/recipes/log4cxx/all/patches/0002-make-odbc-optional.patch index bd3bfa101f8b7..03d6dcd8b7173 100644 --- a/recipes/log4cxx/all/patches/0002-make-odbc-optional.patch +++ b/recipes/log4cxx/all/patches/0002-make-odbc-optional.patch @@ -13,19 +13,19 @@ + if(WIN32) + CHECK_INCLUDE_FILES(sqlext.h HAS_ODBC) + else() -+ include(FindPkgConfig) ++ find_package(ODBC) - pkg_check_modules( odbc QUIET odbc ) - if(${odbc_FOUND}) - set(HAS_ODBC 1) - endif(${odbc_FOUND}) -endif(WIN32) -+ pkg_check_modules( odbc odbc ) -+ if(${odbc_FOUND}) ++ ++ if(${ODBC_FOUND}) + set(HAS_ODBC 1) + else() + set(HAS_ODBC 0) -+ endif(${odbc_FOUND}) ++ endif(${ODBC_FOUND}) + endif(WIN32) + + if(NOT ${HAS_ODBC}) From 9aca6d6a628eca16177b38e812044a81624615c6 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Thu, 13 Apr 2023 13:14:44 +1000 Subject: [PATCH 60/96] SMTP appender is broken in version 0.12 through 1.0.0 --- recipes/log4cxx/all/conanfile.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/recipes/log4cxx/all/conanfile.py b/recipes/log4cxx/all/conanfile.py index 1da248c78aadf..c1b3463315e42 100644 --- a/recipes/log4cxx/all/conanfile.py +++ b/recipes/log4cxx/all/conanfile.py @@ -52,6 +52,9 @@ def config_options(self): self.options.rm_safe("with_smtp_appender") self.options.rm_safe("with_networking") self.options.rm_safe("with_fmt_layout") + # SMTP appender is broken in version 0.12 through 1.0.0 + if Version(self.version) <= "1.0.0": + self.options.rm_safe("with_smtp_appender") def configure(self): if self.options.shared: @@ -112,8 +115,9 @@ def generate(self): if Version(self.version) >= "1.0.0": tc.variables["LOG4CXX_NETWORKING_SUPPORT"] = self.options.with_networking tc.variables["LOG4CXX_MULTIPROCESS_ROLLING_FILE_APPENDER"] = self.options.with_multiprocess_rolling_file_appender - tc.variables["LOG4CXX_ENABLE_ESMTP"] = self.options.with_smtp_appender tc.variables["ENABLE_FMT_LAYOUT"] = self.options.with_fmt_layout + if Version(self.version) > "1.0.0": + tc.variables["LOG4CXX_ENABLE_ESMTP"] = self.options.with_smtp_appender tc.variables["LOG4CXX_ENABLE_ODBC"] = self.options.with_odbc_appender tc.variables["LOG4CXX_WCHAR_T"] = self.options.with_wchar_t tc.variables["LOG4CXX_QT_SUPPORT"] = self.options.with_qt From 2e75dc1c39c8ceae02f73e53e0cc970e18c915a8 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Sat, 15 Apr 2023 16:48:48 +1000 Subject: [PATCH 61/96] SMTP appender is not implemented for Windows --- recipes/log4cxx/all/conanfile.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/recipes/log4cxx/all/conanfile.py b/recipes/log4cxx/all/conanfile.py index c1b3463315e42..fcced08eaa617 100644 --- a/recipes/log4cxx/all/conanfile.py +++ b/recipes/log4cxx/all/conanfile.py @@ -47,14 +47,13 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": self.options.rm_safe("fPIC") + self.options.rm_safe("with_smtp_appender") # *nix only + elif Version(self.version) <= "1.0.0": # SMTP appender is broken in version 0.12 through 1.0.0 + self.options.rm_safe("with_smtp_appender") if Version(self.version) < "1.0.0": self.options.rm_safe("with_multiprocess_rolling_file_appender") - self.options.rm_safe("with_smtp_appender") self.options.rm_safe("with_networking") self.options.rm_safe("with_fmt_layout") - # SMTP appender is broken in version 0.12 through 1.0.0 - if Version(self.version) <= "1.0.0": - self.options.rm_safe("with_smtp_appender") def configure(self): if self.options.shared: From 55f930d542c866f183795d016e00588bc67012e5 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Thu, 20 Apr 2023 16:34:42 +1000 Subject: [PATCH 62/96] Make with_odbc_appender option work on Windows (sqlext.h not found by CHECK_INCLUDE_FILES) --- recipes/log4cxx/all/patches/0001-make-odbc-optional.patch | 2 +- .../log4cxx/all/patches/0002-make-odbc-and-esmtp-optional.patch | 2 +- recipes/log4cxx/all/patches/0002-make-odbc-optional.patch | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/recipes/log4cxx/all/patches/0001-make-odbc-optional.patch b/recipes/log4cxx/all/patches/0001-make-odbc-optional.patch index 40b57b6407be1..5649a6ec2c349 100644 --- a/recipes/log4cxx/all/patches/0001-make-odbc-optional.patch +++ b/recipes/log4cxx/all/patches/0001-make-odbc-optional.patch @@ -11,7 +11,7 @@ +option(LOG4CXX_ENABLE_ODBC "Support logging via ODBC" OFF) +if(LOG4CXX_ENABLE_ODBC) + if(WIN32) -+ CHECK_INCLUDE_FILES(sqlext.h HAS_ODBC) ++ SET(HAS_ODBC 1) + else() + find_package(ODBC) diff --git a/recipes/log4cxx/all/patches/0002-make-odbc-and-esmtp-optional.patch b/recipes/log4cxx/all/patches/0002-make-odbc-and-esmtp-optional.patch index 3871bd208d55a..4598b3bded77f 100644 --- a/recipes/log4cxx/all/patches/0002-make-odbc-and-esmtp-optional.patch +++ b/recipes/log4cxx/all/patches/0002-make-odbc-and-esmtp-optional.patch @@ -11,7 +11,7 @@ index 59982cf..5f6c123 100644 +option(LOG4CXX_ENABLE_ODBC "Support logging via ODBC" OFF) +if(LOG4CXX_ENABLE_ODBC) + if(WIN32) -+ CHECK_INCLUDE_FILES(sqlext.h HAS_ODBC) ++ set(HAS_ODBC 1) + else() + find_package(ODBC) + diff --git a/recipes/log4cxx/all/patches/0002-make-odbc-optional.patch b/recipes/log4cxx/all/patches/0002-make-odbc-optional.patch index 03d6dcd8b7173..e9f756cfdfef1 100644 --- a/recipes/log4cxx/all/patches/0002-make-odbc-optional.patch +++ b/recipes/log4cxx/all/patches/0002-make-odbc-optional.patch @@ -11,7 +11,7 @@ +option(LOG4CXX_ENABLE_ODBC "Support logging via ODBC" OFF) +if(LOG4CXX_ENABLE_ODBC) + if(WIN32) -+ CHECK_INCLUDE_FILES(sqlext.h HAS_ODBC) ++ set(HAS_ODBC 1) + else() + find_package(ODBC) From fa40cde94332cbe18563b7fd5cb92592cbefbe12 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Fri, 5 May 2023 13:30:44 +1000 Subject: [PATCH 63/96] SMTP appender option is not available on Windows --- recipes/log4cxx/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/log4cxx/all/conanfile.py b/recipes/log4cxx/all/conanfile.py index fcced08eaa617..a4980e597a7ff 100644 --- a/recipes/log4cxx/all/conanfile.py +++ b/recipes/log4cxx/all/conanfile.py @@ -115,7 +115,7 @@ def generate(self): tc.variables["LOG4CXX_NETWORKING_SUPPORT"] = self.options.with_networking tc.variables["LOG4CXX_MULTIPROCESS_ROLLING_FILE_APPENDER"] = self.options.with_multiprocess_rolling_file_appender tc.variables["ENABLE_FMT_LAYOUT"] = self.options.with_fmt_layout - if Version(self.version) > "1.0.0": + if Version(self.version) > "1.0.0" and self.settings.os != "Windows": tc.variables["LOG4CXX_ENABLE_ESMTP"] = self.options.with_smtp_appender tc.variables["LOG4CXX_ENABLE_ODBC"] = self.options.with_odbc_appender tc.variables["LOG4CXX_WCHAR_T"] = self.options.with_wchar_t From 5e9fbc3817cf6e2109ada85666239bf9c31905c8 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Mon, 8 May 2023 12:15:57 +1000 Subject: [PATCH 64/96] Add support for version 1.1.0 --- recipes/log4cxx/all/conandata.yml | 7 +++++++ .../log4cxx/all/patches/0004-find-apr.patch | 20 +++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 recipes/log4cxx/all/patches/0004-find-apr.patch diff --git a/recipes/log4cxx/all/conandata.yml b/recipes/log4cxx/all/conandata.yml index 5327554e3d8f8..0f885f4b2dd3b 100644 --- a/recipes/log4cxx/all/conandata.yml +++ b/recipes/log4cxx/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.1.0": + sha256: "1fc7d82697534184bc0f757348d969d24852b948f63d6b17283fd1ee29c2c28a" + url: "https://archive.apache.org/dist/logging/log4cxx/1.1.0/apache-log4cxx-1.1.0.tar.gz" "1.0.0": sha256: "6df9f1f682650de6045309473d5b2fe1f798a03ceb36a74a5b21f5520962d32f" url: "https://archive.apache.org/dist/logging/log4cxx/1.0.0/apache-log4cxx-1.0.0.tar.gz" @@ -9,6 +12,10 @@ sources: url: "https://archive.apache.org/dist/logging/log4cxx/0.12.1/apache-log4cxx-0.12.1.tar.gz" sha256: "7bea5cb477f0e31c838f0e1f4f498cc3b30c2eae74703ddda923e7e8c2268d22" patches: + "1.1.0": + - patch_file: "patches/0004-find-apr.patch" + patch_type: "conan" + patch_description: "Use conan generated apr, apr-util target names" "1.0.0": - patch_file: "patches/0001-pre-cxx17-compilers.patch" patch_type: "bugfix" diff --git a/recipes/log4cxx/all/patches/0004-find-apr.patch b/recipes/log4cxx/all/patches/0004-find-apr.patch new file mode 100644 index 0000000000000..de547e1cc6185 --- /dev/null +++ b/recipes/log4cxx/all/patches/0004-find-apr.patch @@ -0,0 +1,20 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 61c0479..5473fd1 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -51,11 +51,13 @@ endif() + + # Find Apache Runtime + option(APR_STATIC "Link to the APR static library" OFF) +-find_package(APR REQUIRED) ++find_package(apr REQUIRED) ++set(APR_LIBRARIES apr::apr) + + # Find Apache Runtime Utilities + option(APU_STATIC "Link to the APR-Util static library" OFF) +-find_package(APR-Util REQUIRED) ++find_package(apr-util REQUIRED) ++set(APR_UTIL_LIBRARIES apr-util::apr-util) + + find_package( Threads REQUIRED ) + From 98fd69833e4fc66bc4abf47e674f6589f8226892 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Mon, 8 May 2023 13:08:07 +1000 Subject: [PATCH 65/96] Add version 1.1.0 to CI build --- recipes/log4cxx/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipes/log4cxx/config.yml b/recipes/log4cxx/config.yml index bb558b7de42dc..44b4286657a6d 100644 --- a/recipes/log4cxx/config.yml +++ b/recipes/log4cxx/config.yml @@ -5,3 +5,5 @@ versions: folder: all "1.0.0": folder: all + "1.1.0": + folder: all From ea3ef396ebe03f93db81080014dbdfa7c03fb407 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Wed, 10 May 2023 12:01:17 +1000 Subject: [PATCH 66/96] Version 1.0.0 has been superceded by 1.1.0 --- recipes/log4cxx/all/conandata.yml | 30 ------------------------------ recipes/log4cxx/all/conanfile.py | 2 +- recipes/log4cxx/config.yml | 6 ++---- 3 files changed, 3 insertions(+), 35 deletions(-) diff --git a/recipes/log4cxx/all/conandata.yml b/recipes/log4cxx/all/conandata.yml index 0f885f4b2dd3b..211f5d6dd6a40 100644 --- a/recipes/log4cxx/all/conandata.yml +++ b/recipes/log4cxx/all/conandata.yml @@ -2,9 +2,6 @@ sources: "1.1.0": sha256: "1fc7d82697534184bc0f757348d969d24852b948f63d6b17283fd1ee29c2c28a" url: "https://archive.apache.org/dist/logging/log4cxx/1.1.0/apache-log4cxx-1.1.0.tar.gz" - "1.0.0": - sha256: "6df9f1f682650de6045309473d5b2fe1f798a03ceb36a74a5b21f5520962d32f" - url: "https://archive.apache.org/dist/logging/log4cxx/1.0.0/apache-log4cxx-1.0.0.tar.gz" "0.13.0": sha256: "4e5be64b6b1e6de8525f8b87635270b81f772a98902d20d7ac646fdf1ac08284" url: "https://archive.apache.org/dist/logging/log4cxx/0.13.0/apache-log4cxx-0.13.0.tar.gz" @@ -16,33 +13,6 @@ patches: - patch_file: "patches/0004-find-apr.patch" patch_type: "conan" patch_description: "Use conan generated apr, apr-util target names" - "1.0.0": - - patch_file: "patches/0001-pre-cxx17-compilers.patch" - patch_type: "bugfix" - patch_description: "Prevent build failure when compiler.cppstd=14" - patch_source: "https://github.com/apache/logging-log4cxx/commit/0b83584592290cb539f90ab79fc542d60cc3ba23" - - patch_file: "patches/0001-visual-studio-15.patch" - patch_type: "bugfix" - patch_description: "Prevent Visual Studio 2017 compilation error" - patch_source: "https://github.com/apache/logging-log4cxx/commit/f59bf53f831b8b68ef3a2f3a6705ae626090758e" - - patch_file: "patches/0002-visual-studio-15.patch" - patch_type: "bugfix" - patch_description: "Prevent Visual Studio 2017 compilation error" - patch_source: "https://github.com/apache/logging-log4cxx/commit/f59bf53f831b8b68ef3a2f3a6705ae626090758e" - - patch_file: "patches/0002-make-odbc-and-esmtp-optional.patch" - patch_type: "conan" - patch_description: "Prevent 'odbc/2.3.11' requires 'libiconv/1.17' while 'apr-util/1.6.1' requires 'libiconv/1.16'" - - patch_file: "patches/0003-find-apr.patch" - patch_type: "conan" - patch_description: "Use conan generated apr, apr-util target names" - - patch_file: "patches/0003-visual-studio-15.patch" - patch_type: "bugfix" - patch_description: "Prevent Visual Studio 2017 compilation error" - patch_source: "https://github.com/apache/logging-log4cxx/commit/f59bf53f831b8b68ef3a2f3a6705ae626090758e" - - patch_file: "patches/0004-gcc5-compiler-error.patch" - patch_type: "bugfix" - patch_description: "Prevent build failure when compiling with gcc5" - patch_source: "https://github.com/apache/logging-log4cxx/commit/f59bf53f831b8b68ef3a2f3a6705ae626090758e" "0.13.0": - patch_file: "patches/0002-find-apr.patch" patch_type: "conan" diff --git a/recipes/log4cxx/all/conanfile.py b/recipes/log4cxx/all/conanfile.py index a4980e597a7ff..8aded1ffa4f00 100644 --- a/recipes/log4cxx/all/conanfile.py +++ b/recipes/log4cxx/all/conanfile.py @@ -85,7 +85,7 @@ def validate(self): if Version(self.version) < "1.0.0" or self.options.get_safe("with_multiprocess_rolling_file_appender"): # TODO: if compiler doesn't support C++17, boost can be used instead if Version(self.version) < "1.0.0": - self.output.info(f"Version {self.version} requires C++17. log4cxx version 1.0.0 does not.") + self.output.info(f"Version {self.version} requires C++17. log4cxx version 1.1.0 does not.") else: self.output.info("multiprocess rolling file appender requires C++17.") minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) diff --git a/recipes/log4cxx/config.yml b/recipes/log4cxx/config.yml index 44b4286657a6d..550486b02792b 100644 --- a/recipes/log4cxx/config.yml +++ b/recipes/log4cxx/config.yml @@ -1,9 +1,7 @@ versions: - "0.12.1": + "1.1.0": folder: all "0.13.0": folder: all - "1.0.0": - folder: all - "1.1.0": + "0.12.1": folder: all From 029a4aff159d07d50c181054b3fb5f9de8aa33d6 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Wed, 10 May 2023 12:08:22 +1000 Subject: [PATCH 67/96] Remove unsed patch files --- .../patches/0001-pre-cxx17-compilers.patch | 12 --- .../all/patches/0001-visual-studio-15.patch | 97 ------------------- .../0002-make-odbc-and-esmtp-optional.patch | 56 ----------- .../all/patches/0002-visual-studio-15.patch | 81 ---------------- .../log4cxx/all/patches/0003-find-apr.patch | 18 ---- .../all/patches/0003-visual-studio-15.patch | 23 ----- .../patches/0004-gcc5-compiler-error.patch | 29 ------ 7 files changed, 316 deletions(-) delete mode 100644 recipes/log4cxx/all/patches/0001-pre-cxx17-compilers.patch delete mode 100644 recipes/log4cxx/all/patches/0001-visual-studio-15.patch delete mode 100644 recipes/log4cxx/all/patches/0002-make-odbc-and-esmtp-optional.patch delete mode 100644 recipes/log4cxx/all/patches/0002-visual-studio-15.patch delete mode 100644 recipes/log4cxx/all/patches/0003-find-apr.patch delete mode 100644 recipes/log4cxx/all/patches/0003-visual-studio-15.patch delete mode 100644 recipes/log4cxx/all/patches/0004-gcc5-compiler-error.patch diff --git a/recipes/log4cxx/all/patches/0001-pre-cxx17-compilers.patch b/recipes/log4cxx/all/patches/0001-pre-cxx17-compilers.patch deleted file mode 100644 index 2a3df8456a23b..0000000000000 --- a/recipes/log4cxx/all/patches/0001-pre-cxx17-compilers.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -240,9 +240,6 @@ endif() - # - # Check for any fatal configuration errors - # --if( "${SHARED_MUTEX_IMPL}" STREQUAL "NONE" ) -- message( FATAL_ERROR "No shared_mutex implementation found. Requires Boost or C++17" ) --endif() - - # - # Output configuration information diff --git a/recipes/log4cxx/all/patches/0001-visual-studio-15.patch b/recipes/log4cxx/all/patches/0001-visual-studio-15.patch deleted file mode 100644 index 6296e0a9d8d1a..0000000000000 --- a/recipes/log4cxx/all/patches/0001-visual-studio-15.patch +++ /dev/null @@ -1,97 +0,0 @@ -diff --git a/src/main/cpp/threadutility.cpp b/src/main/cpp/threadutility.cpp -index 877b06ea..0467d172 100644 ---- a/src/main/cpp/threadutility.cpp -+++ b/src/main/cpp/threadutility.cpp -@@ -21,16 +21,20 @@ - #endif - #include "log4cxx/private/log4cxx_private.h" - #include "log4cxx/helpers/loglog.h" -+#include "log4cxx/helpers/transcoder.h" - - #include - #include - --#if LOG4CXX_HAS_SETTHREADDESCRIPTION -+#if WIN32 - #include - #include - #endif - --using log4cxx::helpers::ThreadUtility; -+namespace log4cxx -+{ -+namespace helpers -+{ - - struct ThreadUtility::priv_data - { -@@ -41,9 +45,9 @@ struct ThreadUtility::priv_data - start_post = nullptr; - } - -- log4cxx::helpers::ThreadStartPre start_pre; -- log4cxx::helpers::ThreadStarted started; -- log4cxx::helpers::ThreadStartPost start_post; -+ ThreadStartPre start_pre; -+ ThreadStarted started; -+ ThreadStartPost start_post; - }; - - #if LOG4CXX_HAS_PTHREAD_SIGMASK -@@ -139,13 +143,26 @@ void ThreadUtility::threadStartedNameThread(LogString threadName, - if (pthread_setname_np(static_cast(nativeHandle), sthreadName.c_str()) < 0) { - LOGLOG_ERROR(LOG4CXX_STR("unable to set thread name")); - } --#elif LOG4CXX_HAS_SETTHREADDESCRIPTION -- LOG4CXX_ENCODE_WCHAR(wthreadName, threadName); -- HRESULT hr = SetThreadDescription(static_cast(nativeHandle), wthreadName.c_str()); -- if(FAILED(hr)){ -- LOGLOG_ERROR( LOG4CXX_STR("unable to set thread name") ); -+#elif WIN32 -+ typedef HRESULT (WINAPI *TSetThreadDescription)(HANDLE, PCWSTR); -+ static struct initialiser -+ { -+ HMODULE hKernelBase; -+ TSetThreadDescription SetThreadDescription; -+ initialiser() -+ : hKernelBase(GetModuleHandleA("KernelBase.dll")) -+ , SetThreadDescription(nullptr) -+ { -+ if (hKernelBase) -+ SetThreadDescription = reinterpret_cast(GetProcAddress(hKernelBase, "SetThreadDescription")); -+ } -+ } win32Func; -+ if (win32Func.SetThreadDescription) -+ { -+ LOG4CXX_ENCODE_WCHAR(wthreadName, threadName); -+ if(FAILED(win32Func.SetThreadDescription(static_cast(nativeHandle), wthreadName.c_str()))) -+ LOGLOG_ERROR( LOG4CXX_STR("unable to set thread name") ); - } -- - #endif - } - -@@ -166,17 +183,20 @@ void ThreadUtility::postThreadUnblockSignals() - } - - --log4cxx::helpers::ThreadStartPre ThreadUtility::preStartFunction() -+ThreadStartPre ThreadUtility::preStartFunction() - { - return m_priv->start_pre; - } - --log4cxx::helpers::ThreadStarted ThreadUtility::threadStartedFunction() -+ThreadStarted ThreadUtility::threadStartedFunction() - { - return m_priv->started; - } - --log4cxx::helpers::ThreadStartPost ThreadUtility::postStartFunction() -+ThreadStartPost ThreadUtility::postStartFunction() - { - return m_priv->start_post; - } -+ -+} //namespace helpers -+} //namespace log4cxx diff --git a/recipes/log4cxx/all/patches/0002-make-odbc-and-esmtp-optional.patch b/recipes/log4cxx/all/patches/0002-make-odbc-and-esmtp-optional.patch deleted file mode 100644 index 4598b3bded77f..0000000000000 --- a/recipes/log4cxx/all/patches/0002-make-odbc-and-esmtp-optional.patch +++ /dev/null @@ -1,56 +0,0 @@ -diff --git a/src/main/include/CMakeLists.txt b/src/main/include/CMakeLists.txt -index 59982cf..5f6c123 100644 ---- a/src/main/include/CMakeLists.txt -+++ b/src/main/include/CMakeLists.txt -@@ -107,22 +107,42 @@ include(CheckIncludeFiles) - include(CheckIncludeFileCXX) - include(CheckLibraryExists) - --if(WIN32) -- CHECK_INCLUDE_FILES(sqlext.h HAS_ODBC) -+option(LOG4CXX_ENABLE_ODBC "Support logging via ODBC" OFF) -+if(LOG4CXX_ENABLE_ODBC) -+ if(WIN32) -+ set(HAS_ODBC 1) -+ else() -+ find_package(ODBC) -+ -+ -+ if(${ODBC_FOUND}) -+ set(HAS_ODBC 1) -+ else() -+ set(HAS_ODBC 0) -+ endif(${ODBC_FOUND}) -+ endif(WIN32) -+ -+ if(NOT ${HAS_ODBC}) -+ message(SEND_ERROR "ODBC not found but requested") -+ endif() - else() -- include(FindPkgConfig) -+ set(HAS_ODBC 0) -+endif(LOG4CXX_ENABLE_ODBC) - -- pkg_check_modules( odbc QUIET odbc ) -- if(${odbc_FOUND}) -- set(HAS_ODBC 1) -- endif(${odbc_FOUND}) --endif(WIN32) -+option(LOG4CXX_ENABLE_ESMTP "Support logging via libesmtp" OFF) -+if(LOG4CXX_ENABLE_ESMTP) -+ CHECK_LIBRARY_EXISTS(esmtp smtp_create_session "" HAS_LIBESMTP) -+ if(NOT HAS_LIBESMTP) -+ message(SEND_ERROR "SMTP support with libesmtp not found but requested") -+ endif() -+else() -+ set(HAS_LIBESMTP 0) -+endif(LOG4CXX_ENABLE_ESMTP) - - CHECK_INCLUDE_FILE_CXX(locale HAS_STD_LOCALE) - CHECK_FUNCTION_EXISTS(mbsrtowcs HAS_MBSRTOWCS) - CHECK_FUNCTION_EXISTS(wcstombs HAS_WCSTOMBS) - CHECK_FUNCTION_EXISTS(fwide HAS_FWIDE) --CHECK_LIBRARY_EXISTS(esmtp smtp_create_session "" HAS_LIBESMTP) - CHECK_FUNCTION_EXISTS(syslog HAS_SYSLOG) - try_compile(HAS_THREAD_LOCAL "${CMAKE_BINARY_DIR}/thread-local-test" - "${LOG4CXX_SOURCE_DIR}/src/cmake/test-thread-local.cpp" diff --git a/recipes/log4cxx/all/patches/0002-visual-studio-15.patch b/recipes/log4cxx/all/patches/0002-visual-studio-15.patch deleted file mode 100644 index 31015713f5045..0000000000000 --- a/recipes/log4cxx/all/patches/0002-visual-studio-15.patch +++ /dev/null @@ -1,81 +0,0 @@ -diff --git a/src/main/cpp/aprdatagramsocket.cpp b/src/main/cpp/aprdatagramsocket.cpp -index f337736f..55852386 100644 ---- a/src/main/cpp/aprdatagramsocket.cpp -+++ b/src/main/cpp/aprdatagramsocket.cpp -@@ -20,7 +20,10 @@ - #include - #include - --using log4cxx::helpers::APRDatagramSocket; -+namespace log4cxx -+{ -+namespace helpers -+{ - - #define _priv static_cast(m_priv.get()) - -@@ -207,3 +210,6 @@ bool APRDatagramSocket::isClosed() const - { - return _priv->socket != nullptr; - } -+ -+} //namespace helpers -+} //namespace log4cxx -diff --git a/src/main/cpp/aprserversocket.cpp b/src/main/cpp/aprserversocket.cpp -index 797b5a1b..23140030 100644 ---- a/src/main/cpp/aprserversocket.cpp -+++ b/src/main/cpp/aprserversocket.cpp -@@ -22,7 +22,10 @@ - #include "apr_pools.h" - #include "apr_poll.h" - --using log4cxx::helpers::APRServerSocket; -+namespace log4cxx -+{ -+namespace helpers -+{ - - #define _priv static_cast(m_priv.get()) - -@@ -98,7 +101,7 @@ void APRServerSocket::close(){ - /** Listens for a connection to be made to this socket and - accepts it - */ --log4cxx::helpers::SocketPtr APRServerSocket::accept() -+SocketPtr APRServerSocket::accept() - { - std::unique_lock lock(_priv->mutex); - -@@ -155,3 +158,6 @@ log4cxx::helpers::SocketPtr APRServerSocket::accept() - - return std::make_shared(newSocket, newPool); - } -+ -+} //namespace helpers -+} //namespace log4cxx -diff --git a/src/main/cpp/aprsocket.cpp b/src/main/cpp/aprsocket.cpp -index e212c689..624363aa 100644 ---- a/src/main/cpp/aprsocket.cpp -+++ b/src/main/cpp/aprsocket.cpp -@@ -23,9 +23,12 @@ - #include "apr_network_io.h" - #include "apr_signal.h" - --using log4cxx::helpers::APRSocket; -+namespace log4cxx -+{ -+namespace helpers -+{ - --struct APRSocket::APRSocketPriv : public log4cxx::helpers::Socket::SocketPrivate { -+struct APRSocket::APRSocketPriv : public Socket::SocketPrivate { - APRSocketPriv() : - socket(nullptr) - {} -@@ -154,3 +157,6 @@ void APRSocket::close() - _priv->socket = 0; - } - } -+ -+} //namespace helpers -+} //namespace log4cxx diff --git a/recipes/log4cxx/all/patches/0003-find-apr.patch b/recipes/log4cxx/all/patches/0003-find-apr.patch deleted file mode 100644 index de12dbc43f660..0000000000000 --- a/recipes/log4cxx/all/patches/0003-find-apr.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -51,11 +51,13 @@ endif() - - # Find Apache Runtime - option(APR_STATIC "Link to the APR static library" OFF) --find_package(APR REQUIRED) -+find_package(apr REQUIRED) -+set(APR_LIBRARIES apr::apr) - - # Find Apache Runtime Utilities - option(APU_STATIC "Link to the APR-Util static library" OFF) --find_package(APR-Util REQUIRED) -+find_package(apr-util REQUIRED) -+set(APR_UTIL_LIBRARIES apr-util::apr-util) - - find_package( Threads REQUIRED ) - diff --git a/recipes/log4cxx/all/patches/0003-visual-studio-15.patch b/recipes/log4cxx/all/patches/0003-visual-studio-15.patch deleted file mode 100644 index b2ffb43cfb949..0000000000000 --- a/recipes/log4cxx/all/patches/0003-visual-studio-15.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff --git a/src/main/cpp-qt/configuration.cpp b/src/main/cpp-qt/configuration.cpp -index 516acef4..ef8589fe 100644 ---- a/src/main/cpp-qt/configuration.cpp -+++ b/src/main/cpp-qt/configuration.cpp -@@ -25,7 +25,10 @@ - #include - #include - --using log4cxx::qt::Configuration; -+namespace log4cxx -+{ -+namespace qt -+{ - using log4cxx::helpers::LogLog; - - static std::unique_ptr watcher; -@@ -120,3 +123,6 @@ Configuration::configureFromFileAndWatch(const QVector& directories, - - return {log4cxx::spi::ConfigurationStatus::NotConfigured, QString()}; - } -+ -+} //namespace helpers -+} //namespace log4cxx diff --git a/recipes/log4cxx/all/patches/0004-gcc5-compiler-error.patch b/recipes/log4cxx/all/patches/0004-gcc5-compiler-error.patch deleted file mode 100644 index 32f459909d09e..0000000000000 --- a/recipes/log4cxx/all/patches/0004-gcc5-compiler-error.patch +++ /dev/null @@ -1,29 +0,0 @@ -diff --git a/src/main/cpp/defaultconfigurator.cpp b/src/main/cpp/defaultconfigurator.cpp -index a8bdddb..9a86695 100644 ---- a/src/main/cpp/defaultconfigurator.cpp -+++ b/src/main/cpp/defaultconfigurator.cpp -@@ -164,6 +164,7 @@ log4cxx::spi::ConfigurationStatus DefaultConfigurator::tryLoadFile(const LogStri - - std::tuple - DefaultConfigurator::configureFromFile(const std::vector& directories, const std::vector& filenames){ -+ using ResultType = std::tuple; - log4cxx::helpers::Pool pool; - - for( LogString dir : directories ){ -@@ -178,14 +179,14 @@ DefaultConfigurator::configureFromFile(const std::vector& directories - { - log4cxx::spi::ConfigurationStatus configStatus = tryLoadFile(canidate_str); - if( configStatus == log4cxx::spi::ConfigurationStatus::Configured ){ -- return {configStatus, canidate_str}; -+ return ResultType{configStatus, canidate_str}; - } - LogLog::debug("Unable to load file: trying next"); - } - } - } - -- return {log4cxx::spi::ConfigurationStatus::NotConfigured, LogString()}; -+ return ResultType{log4cxx::spi::ConfigurationStatus::NotConfigured, LogString()}; - } - - From 5c7bc89793d3018f81579049e24727558bf7feab Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Sun, 18 Jun 2023 13:54:35 +1000 Subject: [PATCH 68/96] Standarize recipe class name --- recipes/log4cxx/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/log4cxx/all/conanfile.py b/recipes/log4cxx/all/conanfile.py index 8aded1ffa4f00..a746f628c16d7 100644 --- a/recipes/log4cxx/all/conanfile.py +++ b/recipes/log4cxx/all/conanfile.py @@ -9,7 +9,7 @@ required_conan_version = ">=1.54.0" -class Log4cxx(ConanFile): +class Log4cxxConan(ConanFile): name = "log4cxx" description = "Logging framework for C++ patterned after Apache log4j" url = "https://github.com/conan-io/conan-center-index" From da9f044de2fa7854699f2a47189cc2d9e7384c49 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Fri, 14 Jul 2023 17:15:49 +1000 Subject: [PATCH 69/96] Prevent 'Version conflict: apr-util/1.6.1->apr/1.7.0, None->apr/1.7.4' --- recipes/apr-util/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/apr-util/all/conanfile.py b/recipes/apr-util/all/conanfile.py index 86dd0a9fc160c..7cd323339ddf8 100644 --- a/recipes/apr-util/all/conanfile.py +++ b/recipes/apr-util/all/conanfile.py @@ -76,7 +76,7 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("apr/1.7.0", transitive_headers=True) + self.requires("apr/[>=1.6]", transitive_headers=True) if self.settings.os != "Windows": #cmake build doesn't allow injection of iconv yet # https://github.com/conan-io/conan-center-index/pull/16142#issuecomment-1494282164 From 69070795096fa2b8f02a0ada1b9344596b682b0d Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Fri, 14 Jul 2023 17:43:26 +1000 Subject: [PATCH 70/96] Revert "Prevent 'Version conflict: apr-util/1.6.1->apr/1.7.0, None->apr/1.7.4'" This reverts commit da9f044de2fa7854699f2a47189cc2d9e7384c49. --- recipes/apr-util/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/apr-util/all/conanfile.py b/recipes/apr-util/all/conanfile.py index 7cd323339ddf8..86dd0a9fc160c 100644 --- a/recipes/apr-util/all/conanfile.py +++ b/recipes/apr-util/all/conanfile.py @@ -76,7 +76,7 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("apr/[>=1.6]", transitive_headers=True) + self.requires("apr/1.7.0", transitive_headers=True) if self.settings.os != "Windows": #cmake build doesn't allow injection of iconv yet # https://github.com/conan-io/conan-center-index/pull/16142#issuecomment-1494282164 From 5fff340e0fc896076ff0d1c3e0ef3af7cae89ada Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Fri, 14 Jul 2023 17:44:25 +1000 Subject: [PATCH 71/96] Prevent 'Version conflict: apr-util/1.6.1->apr/1.7.0, None->apr/1.7.4' --- recipes/log4cxx/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/log4cxx/all/conanfile.py b/recipes/log4cxx/all/conanfile.py index a746f628c16d7..f28373acc81b7 100644 --- a/recipes/log4cxx/all/conanfile.py +++ b/recipes/log4cxx/all/conanfile.py @@ -60,7 +60,7 @@ def configure(self): self.options.rm_safe("fPIC") def requirements(self): - self.requires("apr/[>=1.6]") + self.requires("apr/1.7.0") self.requires("apr-util/[>=1.6]") if self.options.get_safe("with_odbc_appender") and self.settings.os != "Windows": self.requires("odbc/[>=2.3]") From e2c9ebfb5e77e95a0a741819ee61e3f067e99362 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Sat, 15 Jul 2023 11:04:13 +1000 Subject: [PATCH 72/96] Replace disallowed version ranges Obtain APR via APR-UTIL transitively --- recipes/log4cxx/all/conanfile.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/recipes/log4cxx/all/conanfile.py b/recipes/log4cxx/all/conanfile.py index f28373acc81b7..6b980d58878c2 100644 --- a/recipes/log4cxx/all/conanfile.py +++ b/recipes/log4cxx/all/conanfile.py @@ -60,16 +60,15 @@ def configure(self): self.options.rm_safe("fPIC") def requirements(self): - self.requires("apr/1.7.0") - self.requires("apr-util/[>=1.6]") + self.requires("apr-util/1.6.1") if self.options.get_safe("with_odbc_appender") and self.settings.os != "Windows": - self.requires("odbc/[>=2.3]") + self.requires("odbc/2.3.11") if self.options.get_safe("with_smtp_appender"): - self.requires("libesmtp/[>=1.0]") + self.requires("libesmtp/1.1.0") if self.options.get_safe("with_fmt_layout"): - self.requires("fmt/[>=9.0]") + self.requires("fmt/9.1.0") if self.options.get_safe("with_qt"): - self.requires("qt/[>=5.15 <6]") + self.requires("qt/5.15") @property def _compilers_minimum_version(self): From 42c2980d454cac2964387cd1a2003b9d05b29ca8 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Sat, 15 Jul 2023 11:33:14 +1000 Subject: [PATCH 73/96] Restore 'cmake_find_package* generator' support code --- recipes/log4cxx/all/conanfile.py | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/recipes/log4cxx/all/conanfile.py b/recipes/log4cxx/all/conanfile.py index 6b980d58878c2..2bc3427e33c95 100644 --- a/recipes/log4cxx/all/conanfile.py +++ b/recipes/log4cxx/all/conanfile.py @@ -143,14 +143,41 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + # TODO: to remove in conan v2 once cmake_find_package* generators removed + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"log4cxx": "log4cxx::log4cxx"} + ) + + @staticmethod + def _create_cmake_module_alias_targets(module_file, targets): + content = "" + for alias, aliased in targets.items(): + content += textwrap.dedent("""\ + if(TARGET {aliased} AND NOT TARGET {alias}) + add_library({alias} INTERFACE IMPORTED) + set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) + endif() + """.format(alias=alias, aliased=aliased)) + tools.save(module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", "conan-official-{}-targets.cmake".format(self.name)) + def package_info(self): self.cpp_info.set_property("cmake_file_name", "log4cxx") self.cpp_info.set_property("cmake_target_name", "log4cxx") self.cpp_info.set_property("pkg_config_name", "liblog4cxx") - self.cpp_info.libs = ["log4cxx"] if not self.options.shared: self.cpp_info.defines = ["LOG4CXX_STATIC"] + self.cpp_info.libs = ["log4cxx"] if self.settings.os == "Windows": self.cpp_info.system_libs = ["odbc32"] + + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + self.cpp_info.names["pkg_config"] = "liblog4cxx" if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs = ["pthread"] From 91a5496577e7a5ab369ec9ca346f31ededca1f8e Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Sat, 15 Jul 2023 12:31:02 +1000 Subject: [PATCH 74/96] Restore 'cmake_find_package* generator' support code --- recipes/log4cxx/all/conanfile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/log4cxx/all/conanfile.py b/recipes/log4cxx/all/conanfile.py index 2bc3427e33c95..3fc7f4e0ab742 100644 --- a/recipes/log4cxx/all/conanfile.py +++ b/recipes/log4cxx/all/conanfile.py @@ -5,6 +5,7 @@ from conan.tools.build import check_min_cppstd from conan.errors import ConanInvalidConfiguration import os +import textwrap required_conan_version = ">=1.54.0" From 1430ebbaa2c0a043fe89461113806c28ec4efae4 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Sat, 15 Jul 2023 12:48:12 +1000 Subject: [PATCH 75/96] Restore 'cmake_find_package* generator' support code --- recipes/log4cxx/all/conanfile.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/recipes/log4cxx/all/conanfile.py b/recipes/log4cxx/all/conanfile.py index 3fc7f4e0ab742..139ab73815d15 100644 --- a/recipes/log4cxx/all/conanfile.py +++ b/recipes/log4cxx/all/conanfile.py @@ -1,5 +1,5 @@ from conan import ConanFile -from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout from conan.tools.scm import Version from conan.tools.build import check_min_cppstd @@ -150,8 +150,7 @@ def package(self): {"log4cxx": "log4cxx::log4cxx"} ) - @staticmethod - def _create_cmake_module_alias_targets(module_file, targets): + def _create_cmake_module_alias_targets(self, module_file, targets): content = "" for alias, aliased in targets.items(): content += textwrap.dedent("""\ @@ -160,7 +159,7 @@ def _create_cmake_module_alias_targets(module_file, targets): set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) endif() """.format(alias=alias, aliased=aliased)) - tools.save(module_file, content) + save(self, module_file, content) @property def _module_file_rel_path(self): From 34add1eabdb2db287f6f886648e2edc367d535ae Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Sat, 15 Jul 2023 13:16:16 +1000 Subject: [PATCH 76/96] Replace 'fix-expat-target.patch' with 'tc.set_property(...' equivalent --- recipes/log4cxx/all/conandata.yml | 3 --- recipes/log4cxx/all/conanfile.py | 2 ++ .../log4cxx/all/patches/0002-fix-expat-target.patch | 11 ----------- 3 files changed, 2 insertions(+), 14 deletions(-) delete mode 100644 recipes/log4cxx/all/patches/0002-fix-expat-target.patch diff --git a/recipes/log4cxx/all/conandata.yml b/recipes/log4cxx/all/conandata.yml index 211f5d6dd6a40..e799864a5d851 100644 --- a/recipes/log4cxx/all/conandata.yml +++ b/recipes/log4cxx/all/conandata.yml @@ -36,9 +36,6 @@ patches: - patch_file: "patches/0001-find-apr.patch" patch_type: "conan" patch_description: "Use conan generated apr, apr-util target names" - - patch_file: "patches/0002-fix-expat-target.patch" - patch_type: "conan" - patch_description: "Use conan generated expat target name" - patch_file: "patches/0002-logchar-type.patch" patch_type: "bugfix" patch_description: "Prevent compilation errors when with_wchar_t=False" diff --git a/recipes/log4cxx/all/conanfile.py b/recipes/log4cxx/all/conanfile.py index 139ab73815d15..3114f92c903c0 100644 --- a/recipes/log4cxx/all/conanfile.py +++ b/recipes/log4cxx/all/conanfile.py @@ -125,6 +125,8 @@ def generate(self): tc.generate() tc = CMakeDeps(self) + if Version(self.version) < "0.13.0": + tc.set_property("expat", "cmake_target_name", "EXPAT::EXPAT") tc.generate() def build(self): diff --git a/recipes/log4cxx/all/patches/0002-fix-expat-target.patch b/recipes/log4cxx/all/patches/0002-fix-expat-target.patch deleted file mode 100644 index 36ffedd2c9c64..0000000000000 --- a/recipes/log4cxx/all/patches/0002-fix-expat-target.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -3,7 +3,7 @@ cmake_policy(SET CMP0079 NEW) - add_subdirectory(main) - target_compile_definitions(log4cxx PRIVATE ${LOG4CXX_COMPILE_DEFINITIONS} ${APR_COMPILE_DEFINITIONS} ${APR_UTIL_COMPILE_DEFINITIONS} ) - target_include_directories(log4cxx INTERFACE $ PRIVATE ${APR_INCLUDE_DIR} ${APR_UTIL_INCLUDE_DIR}) --target_link_libraries(log4cxx PRIVATE ${APR_UTIL_LIBRARIES} EXPAT::EXPAT ${APR_LIBRARIES} ${APR_SYSTEM_LIBS}) -+target_link_libraries(log4cxx PRIVATE ${APR_UTIL_LIBRARIES} expat::expat ${APR_LIBRARIES} ${APR_SYSTEM_LIBS}) - if(WIN32) - # The ODBC appender is always enabled in the Windows configuration - target_link_libraries(log4cxx PRIVATE odbc32.lib) From ed50008d82a3565c9678526c59ee08dcda299f97 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Tue, 18 Jul 2023 16:47:02 +1000 Subject: [PATCH 77/96] APR library is not provided via APR-UTIL transitively --- recipes/log4cxx/all/conanfile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/log4cxx/all/conanfile.py b/recipes/log4cxx/all/conanfile.py index 3114f92c903c0..dbb847e283d8a 100644 --- a/recipes/log4cxx/all/conanfile.py +++ b/recipes/log4cxx/all/conanfile.py @@ -61,6 +61,7 @@ def configure(self): self.options.rm_safe("fPIC") def requirements(self): + self.requires("apr/1.7.0") self.requires("apr-util/1.6.1") if self.options.get_safe("with_odbc_appender") and self.settings.os != "Windows": self.requires("odbc/2.3.11") From 541328db5be04141e6d66958d74fef200b600f73 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Wed, 19 Jul 2023 15:17:22 +1000 Subject: [PATCH 78/96] Use CMakeDeps.set_property{} instead of a patch to find apr and apr-util --- recipes/log4cxx/all/conandata.yml | 10 ---------- .../log4cxx/all/patches/0001-find-apr.patch | 17 ---------------- .../log4cxx/all/patches/0002-find-apr.patch | 17 ---------------- .../log4cxx/all/patches/0004-find-apr.patch | 20 ------------------- 4 files changed, 64 deletions(-) delete mode 100644 recipes/log4cxx/all/patches/0001-find-apr.patch delete mode 100644 recipes/log4cxx/all/patches/0002-find-apr.patch delete mode 100644 recipes/log4cxx/all/patches/0004-find-apr.patch diff --git a/recipes/log4cxx/all/conandata.yml b/recipes/log4cxx/all/conandata.yml index e799864a5d851..6184769126b06 100644 --- a/recipes/log4cxx/all/conandata.yml +++ b/recipes/log4cxx/all/conandata.yml @@ -9,14 +9,7 @@ sources: url: "https://archive.apache.org/dist/logging/log4cxx/0.12.1/apache-log4cxx-0.12.1.tar.gz" sha256: "7bea5cb477f0e31c838f0e1f4f498cc3b30c2eae74703ddda923e7e8c2268d22" patches: - "1.1.0": - - patch_file: "patches/0004-find-apr.patch" - patch_type: "conan" - patch_description: "Use conan generated apr, apr-util target names" "0.13.0": - - patch_file: "patches/0002-find-apr.patch" - patch_type: "conan" - patch_description: "Use conan generated apr, apr-util target names" - patch_file: "patches/0003-logchar-type.patch" patch_type: "bugfix" patch_description: "Prevent compilation errors when with_wchar_t=False" @@ -33,9 +26,6 @@ patches: - patch_file: "patches/0001-make-odbc-optional.patch" patch_type: "conan" patch_description: "Prevent 'odbc/2.3.11' requires 'libiconv/1.17' while 'apr-util/1.6.1' requires 'libiconv/1.16'" - - patch_file: "patches/0001-find-apr.patch" - patch_type: "conan" - patch_description: "Use conan generated apr, apr-util target names" - patch_file: "patches/0002-logchar-type.patch" patch_type: "bugfix" patch_description: "Prevent compilation errors when with_wchar_t=False" diff --git a/recipes/log4cxx/all/patches/0001-find-apr.patch b/recipes/log4cxx/all/patches/0001-find-apr.patch deleted file mode 100644 index 11635d23e734f..0000000000000 --- a/recipes/log4cxx/all/patches/0001-find-apr.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -25,10 +25,12 @@ if(NOT BUILD_SHARED_LIBS) - endif() - - # Find Apache Runtime --find_package(APR REQUIRED) -+find_package(apr REQUIRED) -+set(APR_LIBRARIES apr::apr) - - # Find Apache Runtime Utilities --find_package(APR-Util REQUIRED) -+find_package(apr-util REQUIRED) -+set(APR_UTIL_LIBRARIES apr-util::apr-util) - - find_package( Threads REQUIRED ) - diff --git a/recipes/log4cxx/all/patches/0002-find-apr.patch b/recipes/log4cxx/all/patches/0002-find-apr.patch deleted file mode 100644 index 174331cfd2a57..0000000000000 --- a/recipes/log4cxx/all/patches/0002-find-apr.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -41,10 +41,12 @@ if(NOT BUILD_SHARED_LIBS) - endif() - - # Find Apache Runtime --find_package(APR REQUIRED) -+find_package(apr REQUIRED) -+set(APR_LIBRARIES apr::apr) - - # Find Apache Runtime Utilities --find_package(APR-Util REQUIRED) -+find_package(apr-util REQUIRED) -+set(APR_UTIL_LIBRARIES apr-util::apr-util) - - find_package( Threads REQUIRED ) - diff --git a/recipes/log4cxx/all/patches/0004-find-apr.patch b/recipes/log4cxx/all/patches/0004-find-apr.patch deleted file mode 100644 index de547e1cc6185..0000000000000 --- a/recipes/log4cxx/all/patches/0004-find-apr.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 61c0479..5473fd1 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -51,11 +51,13 @@ endif() - - # Find Apache Runtime - option(APR_STATIC "Link to the APR static library" OFF) --find_package(APR REQUIRED) -+find_package(apr REQUIRED) -+set(APR_LIBRARIES apr::apr) - - # Find Apache Runtime Utilities - option(APU_STATIC "Link to the APR-Util static library" OFF) --find_package(APR-Util REQUIRED) -+find_package(apr-util REQUIRED) -+set(APR_UTIL_LIBRARIES apr-util::apr-util) - - find_package( Threads REQUIRED ) - From 8ef66f30303842aff1ccff5f1035bca678f4a574 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Wed, 19 Jul 2023 15:34:38 +1000 Subject: [PATCH 79/96] Use CMakeDeps.set_property{} instead of a patch to find apr and apr-util --- recipes/log4cxx/all/conanfile.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/recipes/log4cxx/all/conanfile.py b/recipes/log4cxx/all/conanfile.py index dbb847e283d8a..e42f26cbacb83 100644 --- a/recipes/log4cxx/all/conanfile.py +++ b/recipes/log4cxx/all/conanfile.py @@ -125,10 +125,12 @@ def generate(self): tc.variables["LOG4CXX_INSTALL_PDB"] = False tc.generate() - tc = CMakeDeps(self) + deps = CMakeDeps(self) + deps.set_property("apr", "cmake_target_name", "APR") + deps.set_property("apr-util", "cmake_target_name", "APR-Util") if Version(self.version) < "0.13.0": - tc.set_property("expat", "cmake_target_name", "EXPAT::EXPAT") - tc.generate() + deps.set_property("expat", "cmake_target_name", "EXPAT::EXPAT") + deps.generate() def build(self): self._patch_sources() From 3d496f187ef5e87536a1e03ef47af36998d6e84d Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Wed, 19 Jul 2023 17:23:21 +1000 Subject: [PATCH 80/96] Revert "Use CMakeDeps.set_property{} instead of a patch to find apr and apr-util" This reverts commit 8ef66f30303842aff1ccff5f1035bca678f4a574. --- recipes/log4cxx/all/conanfile.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/recipes/log4cxx/all/conanfile.py b/recipes/log4cxx/all/conanfile.py index e42f26cbacb83..dbb847e283d8a 100644 --- a/recipes/log4cxx/all/conanfile.py +++ b/recipes/log4cxx/all/conanfile.py @@ -125,12 +125,10 @@ def generate(self): tc.variables["LOG4CXX_INSTALL_PDB"] = False tc.generate() - deps = CMakeDeps(self) - deps.set_property("apr", "cmake_target_name", "APR") - deps.set_property("apr-util", "cmake_target_name", "APR-Util") + tc = CMakeDeps(self) if Version(self.version) < "0.13.0": - deps.set_property("expat", "cmake_target_name", "EXPAT::EXPAT") - deps.generate() + tc.set_property("expat", "cmake_target_name", "EXPAT::EXPAT") + tc.generate() def build(self): self._patch_sources() From 8373069dbe182fb22de14f07f67426cd5737dd74 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Wed, 19 Jul 2023 17:23:37 +1000 Subject: [PATCH 81/96] Revert "Use CMakeDeps.set_property{} instead of a patch to find apr and apr-util" This reverts commit 541328db5be04141e6d66958d74fef200b600f73. --- recipes/log4cxx/all/conandata.yml | 10 ++++++++++ .../log4cxx/all/patches/0001-find-apr.patch | 17 ++++++++++++++++ .../log4cxx/all/patches/0002-find-apr.patch | 17 ++++++++++++++++ .../log4cxx/all/patches/0004-find-apr.patch | 20 +++++++++++++++++++ 4 files changed, 64 insertions(+) create mode 100644 recipes/log4cxx/all/patches/0001-find-apr.patch create mode 100644 recipes/log4cxx/all/patches/0002-find-apr.patch create mode 100644 recipes/log4cxx/all/patches/0004-find-apr.patch diff --git a/recipes/log4cxx/all/conandata.yml b/recipes/log4cxx/all/conandata.yml index 6184769126b06..e799864a5d851 100644 --- a/recipes/log4cxx/all/conandata.yml +++ b/recipes/log4cxx/all/conandata.yml @@ -9,7 +9,14 @@ sources: url: "https://archive.apache.org/dist/logging/log4cxx/0.12.1/apache-log4cxx-0.12.1.tar.gz" sha256: "7bea5cb477f0e31c838f0e1f4f498cc3b30c2eae74703ddda923e7e8c2268d22" patches: + "1.1.0": + - patch_file: "patches/0004-find-apr.patch" + patch_type: "conan" + patch_description: "Use conan generated apr, apr-util target names" "0.13.0": + - patch_file: "patches/0002-find-apr.patch" + patch_type: "conan" + patch_description: "Use conan generated apr, apr-util target names" - patch_file: "patches/0003-logchar-type.patch" patch_type: "bugfix" patch_description: "Prevent compilation errors when with_wchar_t=False" @@ -26,6 +33,9 @@ patches: - patch_file: "patches/0001-make-odbc-optional.patch" patch_type: "conan" patch_description: "Prevent 'odbc/2.3.11' requires 'libiconv/1.17' while 'apr-util/1.6.1' requires 'libiconv/1.16'" + - patch_file: "patches/0001-find-apr.patch" + patch_type: "conan" + patch_description: "Use conan generated apr, apr-util target names" - patch_file: "patches/0002-logchar-type.patch" patch_type: "bugfix" patch_description: "Prevent compilation errors when with_wchar_t=False" diff --git a/recipes/log4cxx/all/patches/0001-find-apr.patch b/recipes/log4cxx/all/patches/0001-find-apr.patch new file mode 100644 index 0000000000000..11635d23e734f --- /dev/null +++ b/recipes/log4cxx/all/patches/0001-find-apr.patch @@ -0,0 +1,17 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -25,10 +25,12 @@ if(NOT BUILD_SHARED_LIBS) + endif() + + # Find Apache Runtime +-find_package(APR REQUIRED) ++find_package(apr REQUIRED) ++set(APR_LIBRARIES apr::apr) + + # Find Apache Runtime Utilities +-find_package(APR-Util REQUIRED) ++find_package(apr-util REQUIRED) ++set(APR_UTIL_LIBRARIES apr-util::apr-util) + + find_package( Threads REQUIRED ) + diff --git a/recipes/log4cxx/all/patches/0002-find-apr.patch b/recipes/log4cxx/all/patches/0002-find-apr.patch new file mode 100644 index 0000000000000..174331cfd2a57 --- /dev/null +++ b/recipes/log4cxx/all/patches/0002-find-apr.patch @@ -0,0 +1,17 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -41,10 +41,12 @@ if(NOT BUILD_SHARED_LIBS) + endif() + + # Find Apache Runtime +-find_package(APR REQUIRED) ++find_package(apr REQUIRED) ++set(APR_LIBRARIES apr::apr) + + # Find Apache Runtime Utilities +-find_package(APR-Util REQUIRED) ++find_package(apr-util REQUIRED) ++set(APR_UTIL_LIBRARIES apr-util::apr-util) + + find_package( Threads REQUIRED ) + diff --git a/recipes/log4cxx/all/patches/0004-find-apr.patch b/recipes/log4cxx/all/patches/0004-find-apr.patch new file mode 100644 index 0000000000000..de547e1cc6185 --- /dev/null +++ b/recipes/log4cxx/all/patches/0004-find-apr.patch @@ -0,0 +1,20 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 61c0479..5473fd1 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -51,11 +51,13 @@ endif() + + # Find Apache Runtime + option(APR_STATIC "Link to the APR static library" OFF) +-find_package(APR REQUIRED) ++find_package(apr REQUIRED) ++set(APR_LIBRARIES apr::apr) + + # Find Apache Runtime Utilities + option(APU_STATIC "Link to the APR-Util static library" OFF) +-find_package(APR-Util REQUIRED) ++find_package(apr-util REQUIRED) ++set(APR_UTIL_LIBRARIES apr-util::apr-util) + + find_package( Threads REQUIRED ) + From 3216869b35f5879cacfe050cd3d5b6844417be81 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Thu, 10 Aug 2023 17:35:07 +1000 Subject: [PATCH 82/96] Allow internal and file character type options --- recipes/log4cxx/all/conanfile.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/recipes/log4cxx/all/conanfile.py b/recipes/log4cxx/all/conanfile.py index dbb847e283d8a..b5119945d7513 100644 --- a/recipes/log4cxx/all/conanfile.py +++ b/recipes/log4cxx/all/conanfile.py @@ -22,6 +22,8 @@ class Log4cxxConan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], + "char_type": ["utf-8", "wchar_t", "unichar"], + "char_encoding": ["locale", "utf-8", "ISO-8859-1", "US-ASCII", "EBCDIC"], "with_networking": [True, False], "with_wchar_t": [True, False], "with_fmt_layout": [True, False], @@ -33,6 +35,8 @@ class Log4cxxConan(ConanFile): default_options = { "shared": False, "fPIC": True, + "char_type": "utf-8", + "char_encoding": "locale", "with_networking": True, "with_wchar_t": False, "with_fmt_layout": False, @@ -119,6 +123,8 @@ def generate(self): if Version(self.version) > "1.0.0" and self.settings.os != "Windows": tc.variables["LOG4CXX_ENABLE_ESMTP"] = self.options.with_smtp_appender tc.variables["LOG4CXX_ENABLE_ODBC"] = self.options.with_odbc_appender + tc.variables["LOG4CXX_CHAR"] = self.options.char_type + tc.variables["LOG4CXX_CHARSET"] = self.options.char_encoding tc.variables["LOG4CXX_WCHAR_T"] = self.options.with_wchar_t tc.variables["LOG4CXX_QT_SUPPORT"] = self.options.with_qt if self.settings.os == "Windows": From 8c77b885f781fd6771f907bc6f87b770de06ea20 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Thu, 10 Aug 2023 22:09:28 +1000 Subject: [PATCH 83/96] Simplify package logic --- recipes/log4cxx/all/conanfile.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/recipes/log4cxx/all/conanfile.py b/recipes/log4cxx/all/conanfile.py index b5119945d7513..afb848cae3013 100644 --- a/recipes/log4cxx/all/conanfile.py +++ b/recipes/log4cxx/all/conanfile.py @@ -147,10 +147,8 @@ def package(self): copy(self, "NOTICE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) cmake = CMake(self) cmake.install() - if Version(self.version) < "1.0.0": - rmdir(self, os.path.join(self.package_folder, "share")) - if self.settings.os != "Windows": - rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) # TODO: to remove in conan v2 once cmake_find_package* generators removed From edc9779cc4c3b84c23173158d47d1d35749409ec Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Fri, 11 Aug 2023 13:43:49 +1000 Subject: [PATCH 84/96] Remove upper-case encoding options --- recipes/log4cxx/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/log4cxx/all/conanfile.py b/recipes/log4cxx/all/conanfile.py index afb848cae3013..9942d7f1e63aa 100644 --- a/recipes/log4cxx/all/conanfile.py +++ b/recipes/log4cxx/all/conanfile.py @@ -23,7 +23,7 @@ class Log4cxxConan(ConanFile): "shared": [True, False], "fPIC": [True, False], "char_type": ["utf-8", "wchar_t", "unichar"], - "char_encoding": ["locale", "utf-8", "ISO-8859-1", "US-ASCII", "EBCDIC"], + "char_encoding": ["locale", "utf-8"], "with_networking": [True, False], "with_wchar_t": [True, False], "with_fmt_layout": [True, False], From d5e481177a1d37bdfb35e8b765d33389477bd0ec Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Sat, 12 Aug 2023 10:29:47 +1000 Subject: [PATCH 85/96] Make utf-8 the default character encoding --- recipes/log4cxx/all/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/log4cxx/all/conanfile.py b/recipes/log4cxx/all/conanfile.py index 9942d7f1e63aa..a407d4e395d2b 100644 --- a/recipes/log4cxx/all/conanfile.py +++ b/recipes/log4cxx/all/conanfile.py @@ -23,7 +23,7 @@ class Log4cxxConan(ConanFile): "shared": [True, False], "fPIC": [True, False], "char_type": ["utf-8", "wchar_t", "unichar"], - "char_encoding": ["locale", "utf-8"], + "char_encoding": ["utf-8", "locale"], "with_networking": [True, False], "with_wchar_t": [True, False], "with_fmt_layout": [True, False], @@ -36,7 +36,7 @@ class Log4cxxConan(ConanFile): "shared": False, "fPIC": True, "char_type": "utf-8", - "char_encoding": "locale", + "char_encoding": "utf-8", "with_networking": True, "with_wchar_t": False, "with_fmt_layout": False, From df33a6c5980821018d59f8f4537fd52acf8b1f41 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Wed, 15 Nov 2023 13:34:05 +1100 Subject: [PATCH 86/96] Prevent lint complaint --- recipes/log4cxx/all/conanfile.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/recipes/log4cxx/all/conanfile.py b/recipes/log4cxx/all/conanfile.py index 0e793e799ffac..e7204e17787c4 100644 --- a/recipes/log4cxx/all/conanfile.py +++ b/recipes/log4cxx/all/conanfile.py @@ -17,7 +17,7 @@ class Log4cxxConan(ConanFile): license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://logging.apache.org/log4cxx" - topics = ("logging") + topics = ("logging", "log") package_type = "library" settings = "os", "arch", "compiler", "build_type" @@ -50,7 +50,7 @@ class Log4cxxConan(ConanFile): @property def _min_cppstd(self): - return 17 + return 11 @property def _compilers_minimum_version(self): @@ -83,7 +83,6 @@ def configure(self): def layout(self): cmake_layout(self, src_folder="src") - def requirements(self): self.requires("apr/1.7.4") self.requires("apr-util/1.6.1") @@ -111,8 +110,6 @@ def validate(self): raise ConanInvalidConfiguration(f"{self.settings.compiler} {compiler_version} does not support C++17: {minimum_version} required.") if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, "17") - elif self.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, "11") def _patch_sources(self): apply_conandata_patches(self) From c54ac7ebe982a7b8a54025dc82fca93b48b89199 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Wed, 15 Nov 2023 13:43:03 +1100 Subject: [PATCH 87/96] Prevent actual lint complaint --- recipes/log4cxx/all/conandata.yml | 5 ++--- .../{0002-find-apr.patch => 0.13.0-0001-find-apr.patch} | 0 2 files changed, 2 insertions(+), 3 deletions(-) rename recipes/log4cxx/all/patches/{0002-find-apr.patch => 0.13.0-0001-find-apr.patch} (100%) diff --git a/recipes/log4cxx/all/conandata.yml b/recipes/log4cxx/all/conandata.yml index 3381fa0b93a4b..1be7ee5f645e1 100644 --- a/recipes/log4cxx/all/conandata.yml +++ b/recipes/log4cxx/all/conandata.yml @@ -1,7 +1,7 @@ sources: "1.1.0": - url: "https://archive.apache.org/dist/logging/log4cxx/1.1.0/apache-log4cxx-1.1.0.tar.gz" sha256: "1fc7d82697534184bc0f757348d969d24852b948f63d6b17283fd1ee29c2c28a" + url: "https://archive.apache.org/dist/logging/log4cxx/1.1.0/apache-log4cxx-1.1.0.tar.gz" "0.13.0": sha256: "4e5be64b6b1e6de8525f8b87635270b81f772a98902d20d7ac646fdf1ac08284" url: "https://archive.apache.org/dist/logging/log4cxx/0.13.0/apache-log4cxx-0.13.0.tar.gz" @@ -14,7 +14,7 @@ patches: patch_description: "use cci's package name" patch_type: "conan" "0.13.0": - - patch_file: "patches/0002-find-apr.patch" + - patch_file: "patches/0.13.0-0001-find-apr.patch" patch_type: "conan" patch_description: "Use conan generated apr, apr-util target names" - patch_file: "patches/0003-logchar-type.patch" @@ -44,4 +44,3 @@ patches: - patch_file: "patches/0.12.0-0001-find-apr.patch" patch_description: "use cci's package name" patch_type: "conan" - diff --git a/recipes/log4cxx/all/patches/0002-find-apr.patch b/recipes/log4cxx/all/patches/0.13.0-0001-find-apr.patch similarity index 100% rename from recipes/log4cxx/all/patches/0002-find-apr.patch rename to recipes/log4cxx/all/patches/0.13.0-0001-find-apr.patch From 50e594d39b45c978076d23e7b1421a4ab0ef1dd2 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Wed, 15 Nov 2023 14:34:34 +1100 Subject: [PATCH 88/96] Remove patch required by upstream incompatibility --- recipes/log4cxx/all/conandata.yml | 7 ---- .../all/patches/0001-make-odbc-optional.patch | 39 ------------------- 2 files changed, 46 deletions(-) delete mode 100644 recipes/log4cxx/all/patches/0001-make-odbc-optional.patch diff --git a/recipes/log4cxx/all/conandata.yml b/recipes/log4cxx/all/conandata.yml index 1be7ee5f645e1..0d5f5f9ee61e0 100644 --- a/recipes/log4cxx/all/conandata.yml +++ b/recipes/log4cxx/all/conandata.yml @@ -33,14 +33,7 @@ patches: - patch_file: "patches/0.12.0-0001-find-apr.patch" patch_description: "use cci's package name" patch_type: "conan" - - patch_file: "patches/0001-make-odbc-optional.patch" - patch_type: "conan" - patch_description: "Prevent 'odbc/2.3.11' requires 'libiconv/1.17' while 'apr-util/1.6.1' requires 'libiconv/1.16'" - patch_file: "patches/0002-logchar-type.patch" patch_type: "bugfix" patch_description: "Prevent compilation errors when with_wchar_t=False" patch_source: "https://github.com/apache/logging-log4cxx/commit/5109466a844d1e5fb8b455a23077765a30325a24" - "0.12.0": - - patch_file: "patches/0.12.0-0001-find-apr.patch" - patch_description: "use cci's package name" - patch_type: "conan" diff --git a/recipes/log4cxx/all/patches/0001-make-odbc-optional.patch b/recipes/log4cxx/all/patches/0001-make-odbc-optional.patch deleted file mode 100644 index 5649a6ec2c349..0000000000000 --- a/recipes/log4cxx/all/patches/0001-make-odbc-optional.patch +++ /dev/null @@ -1,39 +0,0 @@ ---- a/src/main/include/CMakeLists.txt -+++ b/src/main/include/CMakeLists.txt -@@ -68,16 +68,27 @@ include(CheckIncludeFiles) - include(CheckIncludeFileCXX) - include(CheckLibraryExists) - --if(WIN32) -- CHECK_INCLUDE_FILES(sqlext.h HAS_ODBC) --else() -- include(FindPkgConfig) -+option(LOG4CXX_ENABLE_ODBC "Support logging via ODBC" OFF) -+if(LOG4CXX_ENABLE_ODBC) -+ if(WIN32) -+ SET(HAS_ODBC 1) -+ else() -+ find_package(ODBC) - -- pkg_check_modules( odbc QUIET odbc ) -- if(${odbc_FOUND}) -- set(HAS_ODBC 1) -- endif(${odbc_FOUND}) --endif(WIN32) -+ -+ if(${ODBC_FOUND}) -+ set(HAS_ODBC 1) -+ else() -+ set(HAS_ODBC 0) -+ endif(${ODBC_FOUND}) -+ endif(WIN32) -+ -+ if(NOT ${HAS_ODBC}) -+ message(SEND_ERROR "ODBC not found but requested") -+ endif() -+else() -+ set(HAS_ODBC 0) -+endif(LOG4CXX_ENABLE_ODBC) - - CHECK_INCLUDE_FILE_CXX(locale HAS_STD_LOCALE) - CHECK_FUNCTION_EXISTS(mbsrtowcs HAS_MBSRTOWCS) From 3c9ce672f87d904885876e18ac82955a670392b5 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Wed, 15 Nov 2023 14:51:18 +1100 Subject: [PATCH 89/96] Update patch file names --- recipes/log4cxx/all/conandata.yml | 14 +++---- recipes/log4cxx/all/conanfile.py | 5 +-- ...d-apr.patch => 0.12.1-0001-find-apr.patch} | 0 ...e.patch => 0.12.1-0001-logchar-type.patch} | 0 ...0001-fix-static-library-compilation.patch} | 0 ...e.patch => 0.13.0-0001-logchar-type.patch} | 0 ...tch => 0.13.0-0001-visual-studio-15.patch} | 0 .../all/patches/0002-make-odbc-optional.patch | 39 ------------------- 8 files changed, 8 insertions(+), 50 deletions(-) rename recipes/log4cxx/all/patches/{0.12.0-0001-find-apr.patch => 0.12.1-0001-find-apr.patch} (100%) rename recipes/log4cxx/all/patches/{0002-logchar-type.patch => 0.12.1-0001-logchar-type.patch} (100%) rename recipes/log4cxx/all/patches/{0005-fix-static-library-compilation.patch => 0.13.0-0001-fix-static-library-compilation.patch} (100%) rename recipes/log4cxx/all/patches/{0003-logchar-type.patch => 0.13.0-0001-logchar-type.patch} (100%) rename recipes/log4cxx/all/patches/{0004-visual-studio-15.patch => 0.13.0-0001-visual-studio-15.patch} (100%) delete mode 100644 recipes/log4cxx/all/patches/0002-make-odbc-optional.patch diff --git a/recipes/log4cxx/all/conandata.yml b/recipes/log4cxx/all/conandata.yml index 0d5f5f9ee61e0..44969eb093c75 100644 --- a/recipes/log4cxx/all/conandata.yml +++ b/recipes/log4cxx/all/conandata.yml @@ -1,10 +1,10 @@ sources: "1.1.0": - sha256: "1fc7d82697534184bc0f757348d969d24852b948f63d6b17283fd1ee29c2c28a" url: "https://archive.apache.org/dist/logging/log4cxx/1.1.0/apache-log4cxx-1.1.0.tar.gz" + sha256: "1fc7d82697534184bc0f757348d969d24852b948f63d6b17283fd1ee29c2c28a" "0.13.0": - sha256: "4e5be64b6b1e6de8525f8b87635270b81f772a98902d20d7ac646fdf1ac08284" url: "https://archive.apache.org/dist/logging/log4cxx/0.13.0/apache-log4cxx-0.13.0.tar.gz" + sha256: "4e5be64b6b1e6de8525f8b87635270b81f772a98902d20d7ac646fdf1ac08284" "0.12.1": url: "https://archive.apache.org/dist/logging/log4cxx/0.12.1/apache-log4cxx-0.12.1.tar.gz" sha256: "7bea5cb477f0e31c838f0e1f4f498cc3b30c2eae74703ddda923e7e8c2268d22" @@ -17,23 +17,23 @@ patches: - patch_file: "patches/0.13.0-0001-find-apr.patch" patch_type: "conan" patch_description: "Use conan generated apr, apr-util target names" - - patch_file: "patches/0003-logchar-type.patch" + - patch_file: "patches/0.13.0-0001-logchar-type.patch" patch_type: "bugfix" patch_description: "Prevent compilation errors when with_wchar_t=False" patch_source: "https://github.com/apache/logging-log4cxx/commit/5109466a844d1e5fb8b455a23077765a30325a24" - - patch_file: "patches/0004-visual-studio-15.patch" + - patch_file: "patches/0.13.0-0001-visual-studio-15.patch" patch_type: "bugfix" patch_description: "Prevent Visual Studio 2017 compilation error" patch_source: "https://github.com/apache/logging-log4cxx/commit/f59bf53f831b8b68ef3a2f3a6705ae626090758e" - - patch_file: "patches/0005-fix-static-library-compilation.patch" + - patch_file: "patches/0.13.0-0001-fix-static-library-compilation.patch" patch_type: "bugfix" patch_description: "Prevent compilation error when shared=False" patch_source: "https://github.com/apache/logging-log4cxx/commit/09b5b723a1a210c28bf8b05b0676bb2b104359ba" "0.12.1": - - patch_file: "patches/0.12.0-0001-find-apr.patch" + - patch_file: "patches/0.12.1-0001-find-apr.patch" patch_description: "use cci's package name" patch_type: "conan" - - patch_file: "patches/0002-logchar-type.patch" + - patch_file: "patches/0.12.1-0001-logchar-type.patch" patch_type: "bugfix" patch_description: "Prevent compilation errors when with_wchar_t=False" patch_source: "https://github.com/apache/logging-log4cxx/commit/5109466a844d1e5fb8b455a23077765a30325a24" diff --git a/recipes/log4cxx/all/conanfile.py b/recipes/log4cxx/all/conanfile.py index e7204e17787c4..9639ecab69517 100644 --- a/recipes/log4cxx/all/conanfile.py +++ b/recipes/log4cxx/all/conanfile.py @@ -120,10 +120,7 @@ def build_requirements(self): self.tool_requires("pkgconf/2.0.3") def source(self): - # OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: - # 'src\\test\\resources\\output\\xyz\\:' - pattern = "*[!:]" - get(self, **self.conan_data["sources"][self.version], strip_root=True, pattern=pattern) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) diff --git a/recipes/log4cxx/all/patches/0.12.0-0001-find-apr.patch b/recipes/log4cxx/all/patches/0.12.1-0001-find-apr.patch similarity index 100% rename from recipes/log4cxx/all/patches/0.12.0-0001-find-apr.patch rename to recipes/log4cxx/all/patches/0.12.1-0001-find-apr.patch diff --git a/recipes/log4cxx/all/patches/0002-logchar-type.patch b/recipes/log4cxx/all/patches/0.12.1-0001-logchar-type.patch similarity index 100% rename from recipes/log4cxx/all/patches/0002-logchar-type.patch rename to recipes/log4cxx/all/patches/0.12.1-0001-logchar-type.patch diff --git a/recipes/log4cxx/all/patches/0005-fix-static-library-compilation.patch b/recipes/log4cxx/all/patches/0.13.0-0001-fix-static-library-compilation.patch similarity index 100% rename from recipes/log4cxx/all/patches/0005-fix-static-library-compilation.patch rename to recipes/log4cxx/all/patches/0.13.0-0001-fix-static-library-compilation.patch diff --git a/recipes/log4cxx/all/patches/0003-logchar-type.patch b/recipes/log4cxx/all/patches/0.13.0-0001-logchar-type.patch similarity index 100% rename from recipes/log4cxx/all/patches/0003-logchar-type.patch rename to recipes/log4cxx/all/patches/0.13.0-0001-logchar-type.patch diff --git a/recipes/log4cxx/all/patches/0004-visual-studio-15.patch b/recipes/log4cxx/all/patches/0.13.0-0001-visual-studio-15.patch similarity index 100% rename from recipes/log4cxx/all/patches/0004-visual-studio-15.patch rename to recipes/log4cxx/all/patches/0.13.0-0001-visual-studio-15.patch diff --git a/recipes/log4cxx/all/patches/0002-make-odbc-optional.patch b/recipes/log4cxx/all/patches/0002-make-odbc-optional.patch deleted file mode 100644 index e9f756cfdfef1..0000000000000 --- a/recipes/log4cxx/all/patches/0002-make-odbc-optional.patch +++ /dev/null @@ -1,39 +0,0 @@ ---- a/src/main/include/CMakeLists.txt -+++ b/src/main/include/CMakeLists.txt -@@ -85,16 +85,27 @@ include(CheckIncludeFiles) - include(CheckIncludeFileCXX) - include(CheckLibraryExists) - --if(WIN32) -- CHECK_INCLUDE_FILES(sqlext.h HAS_ODBC) --else() -- include(FindPkgConfig) -+option(LOG4CXX_ENABLE_ODBC "Support logging via ODBC" OFF) -+if(LOG4CXX_ENABLE_ODBC) -+ if(WIN32) -+ set(HAS_ODBC 1) -+ else() -+ find_package(ODBC) - -- pkg_check_modules( odbc QUIET odbc ) -- if(${odbc_FOUND}) -- set(HAS_ODBC 1) -- endif(${odbc_FOUND}) --endif(WIN32) -+ -+ if(${ODBC_FOUND}) -+ set(HAS_ODBC 1) -+ else() -+ set(HAS_ODBC 0) -+ endif(${ODBC_FOUND}) -+ endif(WIN32) -+ -+ if(NOT ${HAS_ODBC}) -+ message(SEND_ERROR "ODBC not found but requested") -+ endif() -+else() -+ set(HAS_ODBC 0) -+endif(LOG4CXX_ENABLE_ODBC) - - CHECK_INCLUDE_FILE_CXX(locale HAS_STD_LOCALE) - CHECK_FUNCTION_EXISTS(mbsrtowcs HAS_MBSRTOWCS) From 700224731f75574b970780226a0b80d65b135727 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Wed, 15 Nov 2023 14:56:41 +1100 Subject: [PATCH 90/96] Remove unused patch file --- .../log4cxx/all/patches/0004-find-apr.patch | 20 ------------------- 1 file changed, 20 deletions(-) delete mode 100644 recipes/log4cxx/all/patches/0004-find-apr.patch diff --git a/recipes/log4cxx/all/patches/0004-find-apr.patch b/recipes/log4cxx/all/patches/0004-find-apr.patch deleted file mode 100644 index de547e1cc6185..0000000000000 --- a/recipes/log4cxx/all/patches/0004-find-apr.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 61c0479..5473fd1 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -51,11 +51,13 @@ endif() - - # Find Apache Runtime - option(APR_STATIC "Link to the APR static library" OFF) --find_package(APR REQUIRED) -+find_package(apr REQUIRED) -+set(APR_LIBRARIES apr::apr) - - # Find Apache Runtime Utilities - option(APU_STATIC "Link to the APR-Util static library" OFF) --find_package(APR-Util REQUIRED) -+find_package(apr-util REQUIRED) -+set(APR_UTIL_LIBRARIES apr-util::apr-util) - - find_package( Threads REQUIRED ) - From 30eb110904d719c732b088ffa376e422e0101269 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Fri, 15 Mar 2024 17:16:44 +1100 Subject: [PATCH 91/96] Add release version 1.2.0 --- recipes/log4cxx/all/conandata.yml | 7 +++++ .../all/patches/1.2.0-0001-find-apr.patch | 26 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 recipes/log4cxx/all/patches/1.2.0-0001-find-apr.patch diff --git a/recipes/log4cxx/all/conandata.yml b/recipes/log4cxx/all/conandata.yml index 44969eb093c75..6402ed3764d38 100644 --- a/recipes/log4cxx/all/conandata.yml +++ b/recipes/log4cxx/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.2.0": + url: "https://archive.apache.org/dist/logging/log4cxx/1.1.0/apache-log4cxx-1.2.0.tar.gz" + sha256: "09f4748aa5675ef5c0770bedbf5e00488668933c5a935a43ac5b85be2436c48a" "1.1.0": url: "https://archive.apache.org/dist/logging/log4cxx/1.1.0/apache-log4cxx-1.1.0.tar.gz" sha256: "1fc7d82697534184bc0f757348d969d24852b948f63d6b17283fd1ee29c2c28a" @@ -9,6 +12,10 @@ sources: url: "https://archive.apache.org/dist/logging/log4cxx/0.12.1/apache-log4cxx-0.12.1.tar.gz" sha256: "7bea5cb477f0e31c838f0e1f4f498cc3b30c2eae74703ddda923e7e8c2268d22" patches: + "1.2.0": + - patch_file: "patches/1.2.0-0001-find-apr.patch" + patch_description: "use cci's package name" + patch_type: "conan" "1.1.0": - patch_file: "patches/1.1.0-0001-find-apr.patch" patch_description: "use cci's package name" diff --git a/recipes/log4cxx/all/patches/1.2.0-0001-find-apr.patch b/recipes/log4cxx/all/patches/1.2.0-0001-find-apr.patch new file mode 100644 index 0000000000000..03f1b1478ec0e --- /dev/null +++ b/recipes/log4cxx/all/patches/1.2.0-0001-find-apr.patch @@ -0,0 +1,26 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 61c0479..6ac3e77 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -51,16 +51,18 @@ endif() + + # Find Apache Runtime + option(APR_STATIC "Link to the APR static library" OFF) +-find_package(APR REQUIRED) ++find_package(apr REQUIRED) ++set(APR_LIBRARIES apr::apr) + + # Find Apache Runtime Utilities + option(APU_STATIC "Link to the APR-Util static library" OFF) +-find_package(APR-Util REQUIRED) ++find_package(apr-util REQUIRED) ++set(APR_UTIL_LIBRARIES apr-util::apr-util) + + find_package( Threads REQUIRED ) + + # Find expat for XML parsing +-find_package(EXPAT REQUIRED) ++find_package(EXPAT REQUIRED MODULE) + if(TARGET EXPAT::EXPAT) + set(EXPAT_LIBRARIES EXPAT::EXPAT) + elseif(TARGET expat::expat) From 2c495c35eff54cd1fb5f749fde9a408a28408b5f Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Mon, 18 Mar 2024 13:26:30 +1100 Subject: [PATCH 92/96] Add release version 1.2.0 to config.yml --- recipes/log4cxx/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipes/log4cxx/config.yml b/recipes/log4cxx/config.yml index 550486b02792b..fb792fbdf460c 100644 --- a/recipes/log4cxx/config.yml +++ b/recipes/log4cxx/config.yml @@ -1,4 +1,6 @@ versions: + "1.2.0": + folder: all "1.1.0": folder: all "0.13.0": From 31ff81ce3c73f15b28bb719b2b5d7946e883dd85 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Mon, 18 Mar 2024 14:58:18 +1100 Subject: [PATCH 93/96] Fix release version 1.2.0 path --- recipes/log4cxx/all/conandata.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/log4cxx/all/conandata.yml b/recipes/log4cxx/all/conandata.yml index 6402ed3764d38..5f5b6f75de86a 100644 --- a/recipes/log4cxx/all/conandata.yml +++ b/recipes/log4cxx/all/conandata.yml @@ -1,6 +1,6 @@ sources: "1.2.0": - url: "https://archive.apache.org/dist/logging/log4cxx/1.1.0/apache-log4cxx-1.2.0.tar.gz" + url: "https://archive.apache.org/dist/logging/log4cxx/1.2.0/apache-log4cxx-1.2.0.tar.gz" sha256: "09f4748aa5675ef5c0770bedbf5e00488668933c5a935a43ac5b85be2436c48a" "1.1.0": url: "https://archive.apache.org/dist/logging/log4cxx/1.1.0/apache-log4cxx-1.1.0.tar.gz" From bd16e1b263dc1823b09bf5c07af9ca629303d7f6 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Mon, 25 Mar 2024 14:15:55 +1100 Subject: [PATCH 94/96] Clarify the purpose of char_type vs with_wchar_t etc. --- recipes/log4cxx/all/conanfile.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/recipes/log4cxx/all/conanfile.py b/recipes/log4cxx/all/conanfile.py index 9639ecab69517..f7b26d93e9b6d 100644 --- a/recipes/log4cxx/all/conanfile.py +++ b/recipes/log4cxx/all/conanfile.py @@ -34,6 +34,17 @@ class Log4cxxConan(ConanFile): "with_smtp_appender": [True, False], "with_qt": [True, False], } + options_description = { + "char_type": "The log4cxx internal character type (selects the std::basic_string template parameter used by log4cxx::LogString)", + "char_encoding": "The external character set used when writing to files", + "with_networking": "Include appenders that use network i/o", + "with_wchar_t": "Include wchar_t API methods in class interfaces", + "with_fmt_layout": "Include the log4cxx::FMTLayout class that uses libfmt to layout messages", + "with_odbc_appender": "Include the log4cxx::ODBCAppender that sends log events to a database", + "with_multiprocess_rolling_file_appender": "Include the appender that allows multiple applications to log to the same file", + "with_smtp_appender": "Include the appender that sends an e-mail when a specific logging event occurs", + "with_qt": "Allow QString values in the LOG4CXX_WARN, LOG4CXX_INFO, LOG4CXX_DEBUG etc. macros", + } default_options = { "shared": False, "fPIC": True, From 1dc374ab7359b680611a38ab34708a22085db2bb Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Mon, 25 Mar 2024 14:30:19 +1100 Subject: [PATCH 95/96] Apply reviewer suggested changes --- recipes/log4cxx/all/conanfile.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/recipes/log4cxx/all/conanfile.py b/recipes/log4cxx/all/conanfile.py index f7b26d93e9b6d..043134e2e9ca0 100644 --- a/recipes/log4cxx/all/conanfile.py +++ b/recipes/log4cxx/all/conanfile.py @@ -110,14 +110,12 @@ def validate(self): if Version(self.version) < "1.0.0" or self.options.get_safe("with_multiprocess_rolling_file_appender"): # TODO: if compiler doesn't support C++17, boost can be used instead if Version(self.version) < "1.0.0": - self.output.info(f"Version {self.version} requires C++17. log4cxx version 1.1.0 does not.") + self.output.info(f"Version {self.version} requires C++17. log4cxx version 1.x does not.") else: self.output.info("multiprocess rolling file appender requires C++17.") minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) compiler_version = Version(self.settings.compiler.version) - if not minimum_version: - self.output.warning("Your compiler is unknown. Assuming it supports C++17.") - elif compiler_version < minimum_version: + if compiler_version < minimum_version: raise ConanInvalidConfiguration(f"{self.settings.compiler} {compiler_version} does not support C++17: {minimum_version} required.") if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, "17") @@ -135,8 +133,8 @@ def source(self): def generate(self): tc = CMakeToolchain(self) - tc.cache_variables["BUILD_TESTING"] = False - tc.cache_variables["LOG4CXX_INSTALL_PDB"] = False + tc.variables["BUILD_TESTING"] = False + tc.variables["LOG4CXX_INSTALL_PDB"] = False if Version(self.version) >= "1.0.0": tc.variables["LOG4CXX_NETWORKING_SUPPORT"] = self.options.with_networking tc.variables["LOG4CXX_MULTIPROCESS_ROLLING_FILE_APPENDER"] = self.options.with_multiprocess_rolling_file_appender From 04fb6ee6e547808920cc728ebf00c45e48ae9541 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Mon, 25 Mar 2024 14:37:13 +1100 Subject: [PATCH 96/96] Bump dependency versions --- recipes/log4cxx/all/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/log4cxx/all/conanfile.py b/recipes/log4cxx/all/conanfile.py index 043134e2e9ca0..4429e3e63b17f 100644 --- a/recipes/log4cxx/all/conanfile.py +++ b/recipes/log4cxx/all/conanfile.py @@ -102,9 +102,9 @@ def requirements(self): if self.options.get_safe("with_smtp_appender"): self.requires("libesmtp/1.1.0") if self.options.get_safe("with_fmt_layout"): - self.requires("fmt/9.1.0") + self.requires("fmt/10.2.1") if self.options.get_safe("with_qt"): - self.requires("qt/5.15") + self.requires("qt/5.15.12") def validate(self): if Version(self.version) < "1.0.0" or self.options.get_safe("with_multiprocess_rolling_file_appender"):