From 4692049fc0f10ee871109cebbbe968d272a751ed Mon Sep 17 00:00:00 2001 From: toge Date: Tue, 14 May 2024 01:49:32 +0900 Subject: [PATCH 1/5] libnghttp2: add version 1.62.0, support with_app and with_hpack --- recipes/libnghttp2/all/conandata.yml | 3 ++ recipes/libnghttp2/all/conanfile.py | 42 ++++++++++++++++++- .../all/test_package/CMakeLists.txt | 6 ++- recipes/libnghttp2/config.yml | 2 + 4 files changed, 51 insertions(+), 2 deletions(-) diff --git a/recipes/libnghttp2/all/conandata.yml b/recipes/libnghttp2/all/conandata.yml index c95a58d3fe33d..67c0292da6494 100644 --- a/recipes/libnghttp2/all/conandata.yml +++ b/recipes/libnghttp2/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.62.0": + url: "https://github.com/nghttp2/nghttp2/releases/download/v1.62.0/nghttp2-1.62.0.tar.bz2" + sha256: "086125b1b0d2b1e6743504abc0bc5825414d400bd3d559df063d2bfcbb918264" "1.61.0": url: "https://github.com/nghttp2/nghttp2/releases/download/v1.61.0/nghttp2-1.61.0.tar.bz2" sha256: "4e8cf7ec32d4c5a430966242d72035d255cd9470a8766d61eed7a0190dd544fd" diff --git a/recipes/libnghttp2/all/conanfile.py b/recipes/libnghttp2/all/conanfile.py index 8fa456dd4d783..0227e5e30d626 100644 --- a/recipes/libnghttp2/all/conanfile.py +++ b/recipes/libnghttp2/all/conanfile.py @@ -6,6 +6,7 @@ from conan.tools.gnu import PkgConfigDeps from conan.tools.microsoft import is_msvc from conan.tools.scm import Version +from conan.tools.build import check_min_cppstd import os @@ -38,6 +39,33 @@ class Nghttp2Conan(ConanFile): "with_asio": False, } + @property + def _is_using_cpp(self): + return self.options.with_app or self.options.with_hpack or self.options.get_safe("with_asio") + + @property + def _min_cppstd(self): + return "14" if Version(self.version) <= "1.62.0" else "20" + + @property + def _compilers_minimum_version(self): + return { + "14": { + "gcc": "6", + "clang": "5", + "apple-clang": "10", + "Visual Studio": "15", + "msvc": "191", + }, + "20": { + "gcc": "11", + "clang": "12", + "apple-clang": "13", + "Visual Studio": "16", + "msvc": "192", + } + }.get(self._min_cppstd, {}) + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -45,7 +73,7 @@ def config_options(self): def configure(self): if self.options.shared: self.options.rm_safe("fPIC") - if not (self.options.with_app or self.options.with_hpack or self.options.with_asio): + if not self._is_using_cpp: self.settings.rm_safe("compiler.cppstd") self.settings.rm_safe("compiler.libcxx") if not self.options.with_app: @@ -77,6 +105,14 @@ def validate(self): raise ConanInvalidConfiguration("Build with asio and MSVC is not supported yet, see upstream bug #589") if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "6": raise ConanInvalidConfiguration(f"{self.ref} requires GCC >= 6.0") + if self._is_using_cpp: + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -108,6 +144,10 @@ def generate(self): tc.generate() tc = CMakeDeps(self) + if self.options.with_app: + tc.set_property("libev", "cmake_file_name", "LIBEV") + if self.options.with_hpack: + tc.set_property("jansson", "cmake_file_name", "JANSSON") tc.generate() tc = PkgConfigDeps(self) tc.generate() diff --git a/recipes/libnghttp2/all/test_package/CMakeLists.txt b/recipes/libnghttp2/all/test_package/CMakeLists.txt index f359e60515137..3d582ec77fb40 100644 --- a/recipes/libnghttp2/all/test_package/CMakeLists.txt +++ b/recipes/libnghttp2/all/test_package/CMakeLists.txt @@ -5,4 +5,8 @@ find_package(libnghttp2 REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE libnghttp2::libnghttp2) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +if(libnghttp2_VERSION VERSION_LESS "1.62.0") + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) +endif() diff --git a/recipes/libnghttp2/config.yml b/recipes/libnghttp2/config.yml index 99922e9441daf..cbddd84df4cc5 100644 --- a/recipes/libnghttp2/config.yml +++ b/recipes/libnghttp2/config.yml @@ -1,4 +1,6 @@ versions: + "1.62.0": + folder: all "1.61.0": folder: all "1.60.0": From 9e68df7e8e91915c64b9ec310b46a5c3631702fb Mon Sep 17 00:00:00 2001 From: toge Date: Tue, 14 May 2024 02:15:59 +0900 Subject: [PATCH 2/5] require C++14 only --- recipes/libnghttp2/all/test_package/CMakeLists.txt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/recipes/libnghttp2/all/test_package/CMakeLists.txt b/recipes/libnghttp2/all/test_package/CMakeLists.txt index 3d582ec77fb40..f359e60515137 100644 --- a/recipes/libnghttp2/all/test_package/CMakeLists.txt +++ b/recipes/libnghttp2/all/test_package/CMakeLists.txt @@ -5,8 +5,4 @@ find_package(libnghttp2 REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE libnghttp2::libnghttp2) -if(libnghttp2_VERSION VERSION_LESS "1.62.0") - target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) -else() - target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) -endif() +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) From 82c7b65935209c2635b05a96502ff92a09eb2617 Mon Sep 17 00:00:00 2001 From: toge Date: Mon, 20 May 2024 11:54:37 +0900 Subject: [PATCH 3/5] update 1.62.1 --- recipes/libnghttp2/all/conandata.yml | 6 +++--- recipes/libnghttp2/config.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/recipes/libnghttp2/all/conandata.yml b/recipes/libnghttp2/all/conandata.yml index 67c0292da6494..aa6efbec04676 100644 --- a/recipes/libnghttp2/all/conandata.yml +++ b/recipes/libnghttp2/all/conandata.yml @@ -1,7 +1,7 @@ sources: - "1.62.0": - url: "https://github.com/nghttp2/nghttp2/releases/download/v1.62.0/nghttp2-1.62.0.tar.bz2" - sha256: "086125b1b0d2b1e6743504abc0bc5825414d400bd3d559df063d2bfcbb918264" + "1.62.1": + url: "https://github.com/nghttp2/nghttp2/releases/download/v1.62.1/nghttp2-1.62.1.tar.bz2" + sha256: "3966ec82fda7fc380506d372a260d8d9b6e946be4deaef1fecc1a74b4809ae3d" "1.61.0": url: "https://github.com/nghttp2/nghttp2/releases/download/v1.61.0/nghttp2-1.61.0.tar.bz2" sha256: "4e8cf7ec32d4c5a430966242d72035d255cd9470a8766d61eed7a0190dd544fd" diff --git a/recipes/libnghttp2/config.yml b/recipes/libnghttp2/config.yml index cbddd84df4cc5..3943b211afe2e 100644 --- a/recipes/libnghttp2/config.yml +++ b/recipes/libnghttp2/config.yml @@ -1,5 +1,5 @@ versions: - "1.62.0": + "1.62.1": folder: all "1.61.0": folder: all From 463cd69d0794540bce268c1d4327adef9f98277e Mon Sep 17 00:00:00 2001 From: toge Date: Thu, 5 Sep 2024 14:18:34 +0900 Subject: [PATCH 4/5] update 1.63.0 --- recipes/libnghttp2/all/conandata.yml | 6 +++--- recipes/libnghttp2/config.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/recipes/libnghttp2/all/conandata.yml b/recipes/libnghttp2/all/conandata.yml index aa6efbec04676..ac8669dda9cc9 100644 --- a/recipes/libnghttp2/all/conandata.yml +++ b/recipes/libnghttp2/all/conandata.yml @@ -1,7 +1,7 @@ sources: - "1.62.1": - url: "https://github.com/nghttp2/nghttp2/releases/download/v1.62.1/nghttp2-1.62.1.tar.bz2" - sha256: "3966ec82fda7fc380506d372a260d8d9b6e946be4deaef1fecc1a74b4809ae3d" + "1.63.0": + url: "https://github.com/nghttp2/nghttp2/releases/download/v1.63.0/nghttp2-1.63.0.tar.bz2" + sha256: "607b174554d22a828bc532d1d734fe0f729b5d5ed207f2f12e96a62e83f29c55" "1.61.0": url: "https://github.com/nghttp2/nghttp2/releases/download/v1.61.0/nghttp2-1.61.0.tar.bz2" sha256: "4e8cf7ec32d4c5a430966242d72035d255cd9470a8766d61eed7a0190dd544fd" diff --git a/recipes/libnghttp2/config.yml b/recipes/libnghttp2/config.yml index 3943b211afe2e..7f0c5109f04b8 100644 --- a/recipes/libnghttp2/config.yml +++ b/recipes/libnghttp2/config.yml @@ -1,5 +1,5 @@ versions: - "1.62.1": + "1.63.0": folder: all "1.61.0": folder: all From f9f59194bf751dc5f2590641a358d91defc29623 Mon Sep 17 00:00:00 2001 From: toge Date: Mon, 21 Oct 2024 22:23:59 +0900 Subject: [PATCH 5/5] update 1.64.0 --- recipes/libnghttp2/all/conandata.yml | 6 +++--- recipes/libnghttp2/config.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/recipes/libnghttp2/all/conandata.yml b/recipes/libnghttp2/all/conandata.yml index ac8669dda9cc9..45e916368acfb 100644 --- a/recipes/libnghttp2/all/conandata.yml +++ b/recipes/libnghttp2/all/conandata.yml @@ -1,7 +1,7 @@ sources: - "1.63.0": - url: "https://github.com/nghttp2/nghttp2/releases/download/v1.63.0/nghttp2-1.63.0.tar.bz2" - sha256: "607b174554d22a828bc532d1d734fe0f729b5d5ed207f2f12e96a62e83f29c55" + "1.64.0": + url: "https://github.com/nghttp2/nghttp2/releases/download/v1.64.0/nghttp2-1.64.0.tar.bz2" + sha256: "3a670df378e852b85a2295f25e4f51cc28f56e0fcc496408b8c3764290537af5" "1.61.0": url: "https://github.com/nghttp2/nghttp2/releases/download/v1.61.0/nghttp2-1.61.0.tar.bz2" sha256: "4e8cf7ec32d4c5a430966242d72035d255cd9470a8766d61eed7a0190dd544fd" diff --git a/recipes/libnghttp2/config.yml b/recipes/libnghttp2/config.yml index 7f0c5109f04b8..919ba22bbdb8b 100644 --- a/recipes/libnghttp2/config.yml +++ b/recipes/libnghttp2/config.yml @@ -1,5 +1,5 @@ versions: - "1.63.0": + "1.64.0": folder: all "1.61.0": folder: all