SHA256
1
0
forked from pool/nghttp2

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
This commit is contained in:
Adam Majer 2024-04-03 11:55:28 +00:00 committed by Git OBS Bridge
parent 7fbd9529fa
commit 0f810767da
3 changed files with 71 additions and 1 deletions

64
gcc7.patch Normal file
View File

@ -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<shrpx::AltSvc>::vector(<brace-enclosed initializer list>)'
[ 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<AltSvc> 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<AltSvc> 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<AltSvc> 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<AltSvc> altsvcs = {s1, s2};
assert_stdstring_equal(
R"(h3=":443"; ma=3600, h3%25="\"foo\":4433")",
http::create_altsvc_header_value(balloc, altsvcs).str());

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Wed Apr 3 10:31:13 UTC 2024 - Adam Majer <adam.majer@suse.de>
- gcc7.patch: Fix compilation for SLE-15 (jsc#PED-8206)
-------------------------------------------------------------------
Mon Mar 18 12:59:00 UTC 2024 - Martin Pluskal <mpluskal@suse.com>

View File

@ -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 \