From 5e9716ccf2bae66265a0557dedd70a23cd86193f Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 12 Jan 2021 21:08:31 +0100 Subject: [PATCH 01/13] bump dependencies --- recipes/libarchive/all/conanfile.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/recipes/libarchive/all/conanfile.py b/recipes/libarchive/all/conanfile.py index 829d6c2b2dc2b..a8415e32de461 100644 --- a/recipes/libarchive/all/conanfile.py +++ b/recipes/libarchive/all/conanfile.py @@ -81,21 +81,21 @@ def requirements(self): if self.options.with_bzip2: self.requires("bzip2/1.0.8") if self.options.with_openssl: - self.requires("openssl/1.1.1d") + self.requires("openssl/1.1.1i") if self.options.with_lz4: - self.requires("lz4/1.9.2") + self.requires("lz4/1.9.3") if self.options.with_zstd: - self.requires("zstd/1.4.3") + self.requires("zstd/1.4.8") if self.options.with_lzma: - self.requires("xz_utils/5.2.4") + self.requires("xz_utils/5.2.5") if self.options.with_libxml2: - self.requires("libxml2/2.9.9") + self.requires("libxml2/2.9.10") if self.options.with_expat: - self.requires("expat/2.2.7") + self.requires("expat/2.2.10") if self.options.with_iconv: - self.requires("libiconv/1.15") + self.requires("libiconv/1.16") if self.options.with_pcreposix: - self.requires("pcre/8.41") + self.requires("pcre/8.44") # TODO: deps not covered yet: cng, nettle, libb2 def _configure_cmake(self): From b77483db26b060e266202481b063bb4738c048b1 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 12 Jan 2021 21:08:54 +0100 Subject: [PATCH 02/13] delete fPIC option if shared --- recipes/libarchive/all/conanfile.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipes/libarchive/all/conanfile.py b/recipes/libarchive/all/conanfile.py index a8415e32de461..e6302a2cf5f62 100644 --- a/recipes/libarchive/all/conanfile.py +++ b/recipes/libarchive/all/conanfile.py @@ -73,6 +73,8 @@ def config_options(self): del self.options.fPIC def configure(self): + if self.options.shared: + del self.options.fPIC del self.settings.compiler.libcxx del self.settings.compiler.cppstd From 21eb3ac3ebe91182070f040b6a95901416238e0b Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 12 Jan 2021 21:10:29 +0100 Subject: [PATCH 03/13] cache cmake --- recipes/libarchive/all/conanfile.py | 61 +++++++++++++++++------------ 1 file changed, 35 insertions(+), 26 deletions(-) diff --git a/recipes/libarchive/all/conanfile.py b/recipes/libarchive/all/conanfile.py index e6302a2cf5f62..960f374b00dc6 100644 --- a/recipes/libarchive/all/conanfile.py +++ b/recipes/libarchive/all/conanfile.py @@ -52,8 +52,15 @@ class LibarchiveConan(ConanFile): 'with_zstd': False } - _source_subfolder = "source_subfolder" - _build_subfolder = "build_subfolder" + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" def source(self): tools.get(**self.conan_data["sources"][self.version]) @@ -101,36 +108,38 @@ def requirements(self): # TODO: deps not covered yet: cng, nettle, libb2 def _configure_cmake(self): - cmake = CMake(self) + if self._cmake: + return self._cmake + self._cmake = CMake(self) # turn off deps to avoid picking up them accidentally - cmake.definitions["ENABLE_NETTLE"] = self.options.with_nettle - cmake.definitions["ENABLE_OPENSSL"] = self.options.with_openssl - cmake.definitions["ENABLE_LIBB2"] = self.options.with_libb2 - cmake.definitions["ENABLE_LZ4"] = self.options.with_lz4 - cmake.definitions["ENABLE_LZO"] = self.options.with_lzo - cmake.definitions["ENABLE_LZMA"] = self.options.with_lzma - cmake.definitions["ENABLE_ZSTD"] = self.options.with_zstd - cmake.definitions["ENABLE_ZLIB"] = True - cmake.definitions["ENABLE_BZip2"] = self.options.with_bzip2 + self._cmake.definitions["ENABLE_NETTLE"] = self.options.with_nettle + self._cmake.definitions["ENABLE_OPENSSL"] = self.options.with_openssl + self._cmake.definitions["ENABLE_LIBB2"] = self.options.with_libb2 + self._cmake.definitions["ENABLE_LZ4"] = self.options.with_lz4 + self._cmake.definitions["ENABLE_LZO"] = self.options.with_lzo + self._cmake.definitions["ENABLE_LZMA"] = self.options.with_lzma + self._cmake.definitions["ENABLE_ZSTD"] = self.options.with_zstd + self._cmake.definitions["ENABLE_ZLIB"] = True + self._cmake.definitions["ENABLE_BZip2"] = self.options.with_bzip2 # requires LibXml2 cmake name - cmake.definitions["ENABLE_LIBXML2"] = self.options.with_libxml2 - cmake.definitions["ENABLE_ICONV"] = self.options.with_iconv - cmake.definitions["ENABLE_EXPAT"] = self.options.with_expat - cmake.definitions["ENABLE_PCREPOSIX"] = self.options.with_pcreposix - cmake.definitions["ENABLE_LibGCC"] = False - cmake.definitions["ENABLE_CNG"] = self.options.with_cng + self._cmake.definitions["ENABLE_LIBXML2"] = self.options.with_libxml2 + self._cmake.definitions["ENABLE_ICONV"] = self.options.with_iconv + self._cmake.definitions["ENABLE_EXPAT"] = self.options.with_expat + self._cmake.definitions["ENABLE_PCREPOSIX"] = self.options.with_pcreposix + self._cmake.definitions["ENABLE_LibGCC"] = False + self._cmake.definitions["ENABLE_CNG"] = self.options.with_cng # turn off features - cmake.definitions["ENABLE_ACL"] = self.options.with_acl + self._cmake.definitions["ENABLE_ACL"] = self.options.with_acl # turn off components - cmake.definitions["ENABLE_TAR"] = False - cmake.definitions["ENABLE_CPIO"] = False - cmake.definitions["ENABLE_CAT"] = False - cmake.definitions["ENABLE_TEST"] = False + self._cmake.definitions["ENABLE_TAR"] = False + self._cmake.definitions["ENABLE_CPIO"] = False + self._cmake.definitions["ENABLE_CAT"] = False + self._cmake.definitions["ENABLE_TEST"] = False # too strict check - cmake.definitions["ENABLE_WERROR"] = False + self._cmake.definitions["ENABLE_WERROR"] = False - cmake.configure(build_folder=self._build_subfolder) - return cmake + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake def _patch_sources(self): cmakelists_path = os.path.join(self._source_subfolder, "CMakeLists.txt") From ca7b3a42e998df1c7b1f461d9d7684eeea62f2bc Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 12 Jan 2021 21:11:24 +0100 Subject: [PATCH 04/13] reorder methods by order of execution --- recipes/libarchive/all/conanfile.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/recipes/libarchive/all/conanfile.py b/recipes/libarchive/all/conanfile.py index 960f374b00dc6..66046bb4212c0 100644 --- a/recipes/libarchive/all/conanfile.py +++ b/recipes/libarchive/all/conanfile.py @@ -62,19 +62,6 @@ def _source_subfolder(self): def _build_subfolder(self): return "build_subfolder" - def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = self.name + "-" + self.version - os.rename(extracted_dir, self._source_subfolder) - - def validate(self): - if self.version == "3.4.0": - # https://github.com/libarchive/libarchive/pull/1395 - if self.settings.compiler == "Visual Studio" and self.settings.compiler.version == "16": - raise ConanInvalidConfiguration("Visual Studio 16 is not supported") - if self.options.with_expat and self.options.with_libxml2: - raise ConanInvalidConfiguration("libxml2 and expat options are exclusive. They cannot be used together as XML engine") - def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -107,6 +94,19 @@ def requirements(self): self.requires("pcre/8.44") # TODO: deps not covered yet: cng, nettle, libb2 + def validate(self): + if self.version == "3.4.0": + # https://github.com/libarchive/libarchive/pull/1395 + if self.settings.compiler == "Visual Studio" and self.settings.compiler.version == "16": + raise ConanInvalidConfiguration("Visual Studio 16 is not supported") + if self.options.with_expat and self.options.with_libxml2: + raise ConanInvalidConfiguration("libxml2 and expat options are exclusive. They cannot be used together as XML engine") + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = self.name + "-" + self.version + os.rename(extracted_dir, self._source_subfolder) + def _configure_cmake(self): if self._cmake: return self._cmake From 1c3e29ae37229c96db1639420c7158a8c29898a0 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 12 Jan 2021 21:12:04 +0100 Subject: [PATCH 05/13] consistent double quote across recipe --- recipes/libarchive/all/conanfile.py | 40 ++++++++++++++--------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/recipes/libarchive/all/conanfile.py b/recipes/libarchive/all/conanfile.py index 66046bb4212c0..1131e7b2c3dd5 100644 --- a/recipes/libarchive/all/conanfile.py +++ b/recipes/libarchive/all/conanfile.py @@ -34,22 +34,22 @@ class LibarchiveConan(ConanFile): "with_zstd": [True, False] } default_options = { - 'shared': False, - 'fPIC': True, - 'with_acl': True, - 'with_bzip2': False, - 'with_libxml2': False, - 'with_expat': False, - 'with_iconv': True, - 'with_pcreposix': False, - 'with_cng': False, - 'with_nettle': False, - 'with_openssl': False, - 'with_libb2': False, - 'with_lz4': False, - 'with_lzo': False, - 'with_lzma': False, - 'with_zstd': False + "shared": False, + "fPIC": True, + "with_acl": True, + "with_bzip2": False, + "with_libxml2": False, + "with_expat": False, + "with_iconv": True, + "with_pcreposix": False, + "with_cng": False, + "with_nettle": False, + "with_openssl": False, + "with_libb2": False, + "with_lz4": False, + "with_lzo": False, + "with_lzma": False, + "with_zstd": False } _cmake = None @@ -193,10 +193,10 @@ def package(self): cmake = self._configure_cmake() cmake.install() # drop pc and cmake file - tools.rmdir(os.path.join(self.package_folder, 'lib', 'pkgconfig')) - tools.rmdir(os.path.join(self.package_folder, 'lib', 'cmake')) - tools.rmdir(os.path.join(self.package_folder, 'cmake')) - tools.rmdir(os.path.join(self.package_folder, 'share')) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + tools.rmdir(os.path.join(self.package_folder, "cmake")) + tools.rmdir(os.path.join(self.package_folder, "share")) def package_info(self): self.cpp_info.libs = tools.collect_libs(self) From 8b78e2ff3530250f56f6a3319a7869be0a28cdbe Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 12 Jan 2021 22:04:24 +0100 Subject: [PATCH 06/13] allow 3.4.0 and Visual Studio 16 --- recipes/libarchive/all/conandata.yml | 4 ++++ recipes/libarchive/all/conanfile.py | 9 ++++----- recipes/libarchive/all/patches/msvc-no-we4061.patch | 10 ++++++++++ 3 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 recipes/libarchive/all/patches/msvc-no-we4061.patch diff --git a/recipes/libarchive/all/conandata.yml b/recipes/libarchive/all/conandata.yml index 492ea43c1b776..69feffc4c6691 100644 --- a/recipes/libarchive/all/conandata.yml +++ b/recipes/libarchive/all/conandata.yml @@ -5,3 +5,7 @@ sources: "3.4.3": url: "https://github.com/libarchive/libarchive/releases/download/v3.4.3/libarchive-3.4.3.tar.gz" sha256: "ee1e749213c108cb60d53147f18c31a73d6717d7e3d2481c157e1b34c881ea39" +patches: + "3.4.0": + - patch_file: "patches/msvc-no-we4061.patch" + base_path: "source_subfolder" diff --git a/recipes/libarchive/all/conanfile.py b/recipes/libarchive/all/conanfile.py index 1131e7b2c3dd5..3fe9eb1d39cc6 100644 --- a/recipes/libarchive/all/conanfile.py +++ b/recipes/libarchive/all/conanfile.py @@ -12,7 +12,7 @@ class LibarchiveConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://libarchive.org" license = "BSD" - exports_sources = ["CMakeLists.txt"] + exports_sources = ["CMakeLists.txt", "patches/**"] generators = "cmake", "cmake_find_package" settings = "os", "arch", "compiler", "build_type" options = { @@ -95,10 +95,6 @@ def requirements(self): # TODO: deps not covered yet: cng, nettle, libb2 def validate(self): - if self.version == "3.4.0": - # https://github.com/libarchive/libarchive/pull/1395 - if self.settings.compiler == "Visual Studio" and self.settings.compiler.version == "16": - raise ConanInvalidConfiguration("Visual Studio 16 is not supported") if self.options.with_expat and self.options.with_libxml2: raise ConanInvalidConfiguration("libxml2 and expat options are exclusive. They cannot be used together as XML engine") @@ -142,6 +138,9 @@ def _configure_cmake(self): return self._cmake def _patch_sources(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + cmakelists_path = os.path.join(self._source_subfolder, "CMakeLists.txt") # it can possibly override CMAKE_MODULE_PATH provided by generator diff --git a/recipes/libarchive/all/patches/msvc-no-we4061.patch b/recipes/libarchive/all/patches/msvc-no-we4061.patch new file mode 100644 index 0000000000000..196cebcfb9baa --- /dev/null +++ b/recipes/libarchive/all/patches/msvc-no-we4061.patch @@ -0,0 +1,10 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -157,7 +157,6 @@ IF (MSVC) + # This is added into CMAKE_C_FLAGS when CMAKE_BUILD_TYPE is "Debug" + # Enable level 4 C4061: The enumerate has no associated handler in a switch + # statement. +- SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4061") + # Enable level 4 C4254: A larger bit field was assigned to a smaller bit + # field. + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4254") From 87b2636073b9e324010b395ca9303a2fdb6694af Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 12 Jan 2021 22:23:32 +0100 Subject: [PATCH 07/13] add libarchive/3.5.1 --- recipes/libarchive/all/conandata.yml | 9 ++++++--- recipes/libarchive/config.yml | 4 +++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/recipes/libarchive/all/conandata.yml b/recipes/libarchive/all/conandata.yml index 69feffc4c6691..abb60ad9babfd 100644 --- a/recipes/libarchive/all/conandata.yml +++ b/recipes/libarchive/all/conandata.yml @@ -1,10 +1,13 @@ sources: - "3.4.0": - url: "https://github.com/libarchive/libarchive/releases/download/v3.4.0/libarchive-3.4.0.tar.gz" - sha256: "8643d50ed40c759f5412a3af4e353cffbce4fdf3b5cf321cb72cacf06b2d825e" + "3.5.1": + url: "https://github.com/libarchive/libarchive/releases/download/3.5.1/libarchive-3.5.1.tar.gz" + sha256: "9015d109ec00bb9ae1a384b172bf2fc1dff41e2c66e5a9eeddf933af9db37f5a" "3.4.3": url: "https://github.com/libarchive/libarchive/releases/download/v3.4.3/libarchive-3.4.3.tar.gz" sha256: "ee1e749213c108cb60d53147f18c31a73d6717d7e3d2481c157e1b34c881ea39" + "3.4.0": + url: "https://github.com/libarchive/libarchive/releases/download/v3.4.0/libarchive-3.4.0.tar.gz" + sha256: "8643d50ed40c759f5412a3af4e353cffbce4fdf3b5cf321cb72cacf06b2d825e" patches: "3.4.0": - patch_file: "patches/msvc-no-we4061.patch" diff --git a/recipes/libarchive/config.yml b/recipes/libarchive/config.yml index e94af843aed67..6f124321b75a9 100644 --- a/recipes/libarchive/config.yml +++ b/recipes/libarchive/config.yml @@ -1,5 +1,7 @@ versions: - "3.4.0": + "3.5.1": folder: all "3.4.3": folder: all + "3.4.0": + folder: all From efa6545c4f5130e7ac9cba8bb4ca8a0f65f0ce64 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 12 Jan 2021 22:38:21 +0100 Subject: [PATCH 08/13] remove useless packaging cleanup lib/cmake and cmake folders are not installed --- recipes/libarchive/all/conanfile.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/recipes/libarchive/all/conanfile.py b/recipes/libarchive/all/conanfile.py index 3fe9eb1d39cc6..af95c569c2b09 100644 --- a/recipes/libarchive/all/conanfile.py +++ b/recipes/libarchive/all/conanfile.py @@ -191,10 +191,7 @@ def package(self): self.copy("COPYING", dst="licenses", src=self._source_subfolder) cmake = self._configure_cmake() cmake.install() - # drop pc and cmake file tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) - tools.rmdir(os.path.join(self.package_folder, "cmake")) tools.rmdir(os.path.join(self.package_folder, "share")) def package_info(self): From 8de3e914994b0541c3ef2e32edc12c06dc0e9bd7 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 12 Jan 2021 22:40:40 +0100 Subject: [PATCH 09/13] fix license --- recipes/libarchive/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/libarchive/all/conanfile.py b/recipes/libarchive/all/conanfile.py index af95c569c2b09..2978f1fd3eee5 100644 --- a/recipes/libarchive/all/conanfile.py +++ b/recipes/libarchive/all/conanfile.py @@ -11,7 +11,7 @@ class LibarchiveConan(ConanFile): topics = ("conan", "libarchive", "tar", "data-compressor", "file-compression") url = "https://github.com/conan-io/conan-center-index" homepage = "https://libarchive.org" - license = "BSD" + license = "BSD-2-Clause" exports_sources = ["CMakeLists.txt", "patches/**"] generators = "cmake", "cmake_find_package" settings = "os", "arch", "compiler", "build_type" From e990f9b89dc56fe0b1806a7fd0fef7bfbbbcea8a Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Wed, 13 Jan 2021 00:45:30 +0100 Subject: [PATCH 10/13] add with_zlib option --- recipes/libarchive/all/conanfile.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/recipes/libarchive/all/conanfile.py b/recipes/libarchive/all/conanfile.py index 2978f1fd3eee5..01b5821eb1339 100644 --- a/recipes/libarchive/all/conanfile.py +++ b/recipes/libarchive/all/conanfile.py @@ -19,6 +19,7 @@ class LibarchiveConan(ConanFile): "shared": [True, False], "fPIC": [True, False], "with_acl": [True, False], + "with_zlib": [True, False], "with_bzip2": [True, False], "with_libxml2": [True, False], "with_expat": [True, False], @@ -37,6 +38,7 @@ class LibarchiveConan(ConanFile): "shared": False, "fPIC": True, "with_acl": True, + "with_zlib": True, "with_bzip2": False, "with_libxml2": False, "with_expat": False, @@ -73,7 +75,8 @@ def configure(self): del self.settings.compiler.cppstd def requirements(self): - self.requires("zlib/1.2.11") + if self.options.with_zlib: + self.requires("zlib/1.2.11") if self.options.with_bzip2: self.requires("bzip2/1.0.8") if self.options.with_openssl: @@ -115,7 +118,7 @@ def _configure_cmake(self): self._cmake.definitions["ENABLE_LZO"] = self.options.with_lzo self._cmake.definitions["ENABLE_LZMA"] = self.options.with_lzma self._cmake.definitions["ENABLE_ZSTD"] = self.options.with_zstd - self._cmake.definitions["ENABLE_ZLIB"] = True + self._cmake.definitions["ENABLE_ZLIB"] = self.options.with_zlib self._cmake.definitions["ENABLE_BZip2"] = self.options.with_bzip2 # requires LibXml2 cmake name self._cmake.definitions["ENABLE_LIBXML2"] = self.options.with_libxml2 From 255c18262f3ed3277b054d974f03e31181206c49 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Wed, 13 Jan 2021 00:47:09 +0100 Subject: [PATCH 11/13] add missing dependencies (except cng) --- recipes/libarchive/all/conanfile.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/recipes/libarchive/all/conanfile.py b/recipes/libarchive/all/conanfile.py index 01b5821eb1339..d9e70eac64a8e 100644 --- a/recipes/libarchive/all/conanfile.py +++ b/recipes/libarchive/all/conanfile.py @@ -95,7 +95,15 @@ def requirements(self): self.requires("libiconv/1.16") if self.options.with_pcreposix: self.requires("pcre/8.44") - # TODO: deps not covered yet: cng, nettle, libb2 + if self.options.with_cng: + # TODO: add cng when available in CCI + raise ConanInvalidConfiguration("cng recipe not yet available in CCI.") + if self.options.with_nettle: + self.requires("nettle/3.6") + if self.options.with_libb2: + self.requires("libb2/20190723") + if self.options.with_lzo: + self.requires("lzo/2.10") def validate(self): if self.options.with_expat and self.options.with_libxml2: From 08333929b3a2dfe3d267872c13f4e9e760434bd7 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Wed, 13 Jan 2021 00:48:26 +0100 Subject: [PATCH 12/13] same ordering in requirements() and options easier to see if all options are covered --- recipes/libarchive/all/conanfile.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/recipes/libarchive/all/conanfile.py b/recipes/libarchive/all/conanfile.py index d9e70eac64a8e..a5339de763821 100644 --- a/recipes/libarchive/all/conanfile.py +++ b/recipes/libarchive/all/conanfile.py @@ -79,14 +79,6 @@ def requirements(self): self.requires("zlib/1.2.11") if self.options.with_bzip2: self.requires("bzip2/1.0.8") - if self.options.with_openssl: - self.requires("openssl/1.1.1i") - if self.options.with_lz4: - self.requires("lz4/1.9.3") - if self.options.with_zstd: - self.requires("zstd/1.4.8") - if self.options.with_lzma: - self.requires("xz_utils/5.2.5") if self.options.with_libxml2: self.requires("libxml2/2.9.10") if self.options.with_expat: @@ -100,10 +92,18 @@ def requirements(self): raise ConanInvalidConfiguration("cng recipe not yet available in CCI.") if self.options.with_nettle: self.requires("nettle/3.6") + if self.options.with_openssl: + self.requires("openssl/1.1.1i") if self.options.with_libb2: self.requires("libb2/20190723") + if self.options.with_lz4: + self.requires("lz4/1.9.3") if self.options.with_lzo: self.requires("lzo/2.10") + if self.options.with_lzma: + self.requires("xz_utils/5.2.5") + if self.options.with_zstd: + self.requires("zstd/1.4.8") def validate(self): if self.options.with_expat and self.options.with_libxml2: From 8cf68f5005dd1ae20deb9bdd27a8089a192a505b Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Wed, 13 Jan 2021 01:09:55 +0100 Subject: [PATCH 13/13] fix bzip2/libxml2/openssl/pcre/lzma options --- recipes/libarchive/all/conanfile.py | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/recipes/libarchive/all/conanfile.py b/recipes/libarchive/all/conanfile.py index a5339de763821..ac0391544ecc8 100644 --- a/recipes/libarchive/all/conanfile.py +++ b/recipes/libarchive/all/conanfile.py @@ -133,6 +133,8 @@ def _configure_cmake(self): self._cmake.definitions["ENABLE_ICONV"] = self.options.with_iconv self._cmake.definitions["ENABLE_EXPAT"] = self.options.with_expat self._cmake.definitions["ENABLE_PCREPOSIX"] = self.options.with_pcreposix + if self.options.with_pcreposix: + self._cmake.definitions["POSIX_REGEX_LIB"] = "LIBPCREPOSIX" self._cmake.definitions["ENABLE_LibGCC"] = False self._cmake.definitions["ENABLE_CNG"] = self.options.with_cng # turn off features @@ -158,15 +160,28 @@ def _patch_sources(self): tools.replace_in_file(cmakelists_path, "SET(CMAKE_MODULE_PATH", "LIST(APPEND CMAKE_MODULE_PATH") - # Using Visual Studio, openssl caused some link problems because by using cmake variableds - # generated by cmake's FindOpenSSL, will let it forget these libraries + # workaround due to case sensitivity and limitations in cmake_find_package + # see https://github.com/conan-io/conan/issues/7691 + if self.options.with_bzip2: + tools.replace_in_file(cmakelists_path, "BZIP2_FOUND", "BZip2_FOUND") + tools.replace_in_file(cmakelists_path, "BZIP2_INCLUDE_DIR", "BZip2_INCLUDE_DIR") + tools.replace_in_file(cmakelists_path, "BZIP2_LIBRARIES", "BZip2_LIBRARIES") + if self.options.with_libxml2: + tools.replace_in_file(cmakelists_path, "LIBXML2_FOUND", "LibXml2_FOUND") + tools.replace_in_file(cmakelists_path, "LIBXML2_INCLUDE_DIR", "LibXml2_INCLUDE_DIR") + tools.replace_in_file(cmakelists_path, "LIBXML2_LIBRARIES", "LibXml2_LIBRARIES") if self.options.with_openssl: tools.replace_in_file(cmakelists_path, - "${OPENSSL_CRYPTO_LIBRARY}", - "${OPENSSL_CRYPTO_LIBRARY} ${CONAN_LIBS_OPENSSL}") - tools.replace_in_file(cmakelists_path, - "${OPENSSL_LIBRARIES}", - "${OPENSSL_LIBRARIES} ${CONAN_LIBS_OPENSSL}") + "IF(ENABLE_OPENSSL AND NOT CMAKE_SYSTEM_NAME MATCHES \"Darwin\")", + "IF(ENABLE_OPENSSL)") + tools.replace_in_file(cmakelists_path, "OPENSSL_FOUND", "OpenSSL_FOUND") + tools.replace_in_file(cmakelists_path, "OPENSSL_INCLUDE_DIR", "OpenSSL_INCLUDE_DIR") + tools.replace_in_file(cmakelists_path, "OPENSSL_LIBRARIES", "OpenSSL_LIBRARIES") + tools.replace_in_file(cmakelists_path, "OPENSSL_CRYPTO_LIBRARY", "OpenSSL_LIBRARIES") + if self.options.with_lzma: + tools.replace_in_file(cmakelists_path, "LIBLZMA_FOUND", "LibLZMA_FOUND") + tools.replace_in_file(cmakelists_path, "LIBLZMA_INCLUDE_DIR", "LibLZMA_INCLUDE_DIR") + tools.replace_in_file(cmakelists_path, "LIBLZMA_LIBRARIES", "LibLZMA_LIBRARIES") # add possible names for lz4 library if not self.options.shared: tools.replace_in_file(cmakelists_path,