From 98fdd07c81dc74ed2c9604a6681390c09d97eafa Mon Sep 17 00:00:00 2001 From: Tomas Krizek Date: Apr 04 2019 14:51:53 +0000 Subject: gcc9 compatibility for F30+ Fixes: #1675333 --- diff --git a/0001-GCC9-compatibility.patch b/0001-GCC9-compatibility.patch new file mode 100644 index 0000000..087a0a0 --- /dev/null +++ b/0001-GCC9-compatibility.patch @@ -0,0 +1,53 @@ +From 47a8fd8210deb317d37dd3b5f7d91abafc8376e0 Mon Sep 17 00:00:00 2001 +From: Tomas Krizek +Date: Thu, 4 Apr 2019 16:15:47 +0200 +Subject: [PATCH] GCC9 compatibility + +--- + src/lib/dns.h | 19 +------------------ + 1 file changed, 1 insertion(+), 18 deletions(-) + +diff --git a/src/lib/dns.h b/src/lib/dns.h +index 78d6402..f6ce1d6 100644 +--- a/src/lib/dns.h ++++ b/src/lib/dns.h +@@ -149,27 +149,10 @@ DNS_PUBLIC int *dns_debug_p(void); + * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +-#if defined __clang__ +-#define DNS_PRAGMA_PUSH _Pragma("clang diagnostic push") +-#define DNS_PRAGMA_QUIET _Pragma("clang diagnostic ignored \"-Winitializer-overrides\"") +-#define DNS_PRAGMA_POP _Pragma("clang diagnostic pop") +- +-#define dns_quietinit(...) \ +- DNS_PRAGMA_PUSH DNS_PRAGMA_QUIET __VA_ARGS__ DNS_PRAGMA_POP +-#elif (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || __GNUC__ > 4 +-#define DNS_PRAGMA_PUSH _Pragma("GCC diagnostic push") +-#define DNS_PRAGMA_QUIET _Pragma("GCC diagnostic ignored \"-Woverride-init\"") +-#define DNS_PRAGMA_POP _Pragma("GCC diagnostic pop") +- +-/* GCC parses the _Pragma operator less elegantly than clang. */ +-#define dns_quietinit(...) \ +- __extension__ ({ DNS_PRAGMA_PUSH DNS_PRAGMA_QUIET __VA_ARGS__; DNS_PRAGMA_POP }) +-#else + #define DNS_PRAGMA_PUSH + #define DNS_PRAGMA_QUIET + #define DNS_PRAGMA_POP + #define dns_quietinit(...) __VA_ARGS__ +-#endif + + #if defined __GNUC__ + #define DNS_PRAGMA_EXTENSION __extension__ +@@ -1056,7 +1039,7 @@ DNS_PUBLIC void dns_cache_close(struct dns_cache *); + #define DNS_OPTS_INITIALIZER { DNS_OPTS_INITIALIZER_ } + #define DNS_OPTS_INIT(...) { DNS_OPTS_INITIALIZER_, __VA_ARGS__ } + +-#define dns_opts(...) (&dns_quietinit((struct dns_options)DNS_OPTS_INIT(__VA_ARGS__))) ++#define dns_opts(...) (&(struct dns_options){ __VA_ARGS__ }) + + struct dns_options { + /* +-- +2.21.0 + diff --git a/lua-cqueues.spec b/lua-cqueues.spec index 594854e..29eeb8a 100644 --- a/lua-cqueues.spec +++ b/lua-cqueues.spec @@ -8,25 +8,28 @@ Name: lua-cqueues Version: 20171014 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Stackable Continuation Queues for the Lua Programming Language License: MIT URL: https://25thandclement.com/~william/projects/cqueues.html Source0: https://25thandclement.com/~william/projects/releases/cqueues-%{version}.tgz +Patch1: 0001-GCC9-compatibility.patch + +BuildRequires: gcc +BuildRequires: m4 +BuildRequires: make +BuildRequires: openssl-devel BuildRequires: lua-devel >= %{luaver} + +# runtime lua library %if 0%{?fedora} Requires: lua(abi) = %{luaver} %else Requires: lua >= %{luaver} %endif -%if 0%{?fedora} -BuildRequires: compat-lua >= %{luacompatver}, compat-lua-devel >= %{luacompatver} -%endif -BuildRequires: gcc, m4, make, openssl-devel - %description cqueues is a type of event loop for Lua. It doesn't use callbacks but instead you communicate with an event controller by the yielding and resumption of @@ -52,7 +55,6 @@ to use interfaces which abstract the different kernel facilities. %package -n compat-%{name} Summary: Stackable Continuation Queues for the Lua Programming Language %{luacompatver} Provides: lua-cqueues-compat -# owner of /usr/lib64/lua/5.1, for some reason this depedency is not auto-generated Requires: compat-lua-libs %description -n compat-%{name} @@ -65,8 +67,6 @@ BuildArch: noarch # Conflicts: {name} != {version} + compat-{name} != {version} would have been better # but I'm trying to avoid Conflicts Requires: %{name} == %{version} -# owner of /usr/share/doc -Requires: filesystem %description doc Documentation for the Stackable Continuation Queues library @@ -74,6 +74,7 @@ for the Lua Programming Language %prep %setup -q -n cqueues-%{version} +%patch1 -p1 %build make LUA_APIS="%{luaver}" %{?_smp_mflags} prefix=%{_prefix} libdir=%{_libdir} CFLAGS="%{optflags} -fPIC" @@ -113,10 +114,14 @@ sed -i '1 s|^#!/.*$|#!/usr/bin/lua|' %{buildroot}%{_pkgdocdir}/examples/* %files doc # force examples to be non-executable to avoid potential mess in autogenerated deps %defattr(644,root,root,755) -%doc %{_pkgdocdir} +%doc %{_pkgdocdir}/* %license LICENSE %changelog +* Thu Apr 04 2019 Tomas Krizek - 20171014-4 +- Compatibility patch for GCC 9, fixes BZ#1675333 +- Clean up BuildRequires/Requires + * Thu Apr 04 2019 Tomas Krizek - 20171014-3 - Change compat package name to compat-lua-cqueues