From 0f810767da33fe40149765c71948157fc38dfc4d191ba77dfb44d92d4fc50b77 Mon Sep 17 00:00:00 2001 From: Adam Majer Date: Wed, 3 Apr 2024 11:55:28 +0000 Subject: [PATCH] Accepting request 1164345 from home:adamm:branches:devel:libraries:c_c++ - gcc7.patch: Fix compilation for SLE-15 (jsc#PED-8206) OBS-URL: https://build.opensuse.org/request/show/1164345 OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/nghttp2?expand=0&rev=122 --- gcc7.patch | 64 +++++++++++++++++++++++++++++++++++++++++++++++++ nghttp2.changes | 5 ++++ nghttp2.spec | 3 ++- 3 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 gcc7.patch diff --git a/gcc7.patch b/gcc7.patch new file mode 100644 index 0000000..72dabca --- /dev/null +++ b/gcc7.patch @@ -0,0 +1,64 @@ +When compiling with GCC 7.5, non-trivial initializers are unsupported. + +[ 9s] shrpx_http_test.cc: In function 'void shrpx::test_shrpx_http_create_altsvc_header_value()': +[ 9s] shrpx_http_test.cc:152:9: sorry, unimplemented: non-trivial designated initializers not supported +[ 9s] }, +[ 9s] ^ +[ 9s] shrpx_http_test.cc:152:9: sorry, unimplemented: non-trivial designated initializers not supported +[ 9s] shrpx_http_test.cc:153:5: error: no matching function for call to 'std::vector::vector()' +[ 9s] }; +[ 9s] ^ + +Index: nghttp2-1.60.0/src/shrpx_http_test.cc +=================================================================== +--- nghttp2-1.60.0.orig/src/shrpx_http_test.cc ++++ nghttp2-1.60.0/src/shrpx_http_test.cc +@@ -143,14 +143,12 @@ void test_shrpx_http_create_affinity_coo + void test_shrpx_http_create_altsvc_header_value(void) { + { + BlockAllocator balloc(1024, 1024); +- std::vector altsvcs{ +- AltSvc{ +- .protocol_id = StringRef::from_lit("h3"), +- .host = StringRef::from_lit("127.0.0.1"), +- .service = StringRef::from_lit("443"), +- .params = StringRef::from_lit("ma=3600"), +- }, +- }; ++ AltSvc s; ++ s.protocol_id = StringRef::from_lit("h3"); ++ s.host = StringRef::from_lit("127.0.0.1"); ++ s.service = StringRef::from_lit("443"); ++ s.params = StringRef::from_lit("ma=3600"); ++ std::vector altsvcs = {s}; + + assert_stdstring_equal( + R"(h3="127.0.0.1:443"; ma=3600)", +@@ -159,19 +157,15 @@ void test_shrpx_http_create_altsvc_heade + + { + BlockAllocator balloc(1024, 1024); +- std::vector altsvcs{ +- AltSvc{ +- .protocol_id = StringRef::from_lit("h3"), +- .service = StringRef::from_lit("443"), +- .params = StringRef::from_lit("ma=3600"), +- }, +- AltSvc{ +- .protocol_id = StringRef::from_lit("h3%"), +- .host = StringRef::from_lit("\"foo\""), +- .service = StringRef::from_lit("4433"), +- }, +- }; ++ AltSvc s1, s2; ++ s1.protocol_id = StringRef::from_lit("h3"); ++ s1.service = StringRef::from_lit("443"); ++ s1.params = StringRef::from_lit("ma=3600"); ++ s2.protocol_id = StringRef::from_lit("h3%"); ++ s2.host = StringRef::from_lit("\"foo\""); ++ s2.service = StringRef::from_lit("4433"); + ++ std::vector altsvcs = {s1, s2}; + assert_stdstring_equal( + R"(h3=":443"; ma=3600, h3%25="\"foo\":4433")", + http::create_altsvc_header_value(balloc, altsvcs).str()); diff --git a/nghttp2.changes b/nghttp2.changes index 2f6e4db..547e6eb 100644 --- a/nghttp2.changes +++ b/nghttp2.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Apr 3 10:31:13 UTC 2024 - Adam Majer + +- gcc7.patch: Fix compilation for SLE-15 (jsc#PED-8206) + ------------------------------------------------------------------- Mon Mar 18 12:59:00 UTC 2024 - Martin Pluskal diff --git a/nghttp2.spec b/nghttp2.spec index 713ddae..d3baa1d 100644 --- a/nghttp2.spec +++ b/nghttp2.spec @@ -30,6 +30,7 @@ Source0: https://github.com/nghttp2/nghttp2/releases/download/v%{version} Source1: https://github.com/nghttp2/nghttp2/releases/download/v%{version}/nghttp2-%{version}.tar.xz.asc Source2: nghttp2.keyring Source3: baselibs.conf +Patch1: gcc7.patch BuildRequires: gcc-c++ BuildRequires: libboost_system-devel BuildRequires: libboost_thread-devel @@ -92,7 +93,7 @@ Documentation for nghttp2, which includes a shared C library, HTTP/2 client, server and proxy. %prep -%setup -q -n nghttp2-%{version} +%autosetup -p1 -n nghttp2-%{version} %build %configure \