[czmq] Upstream patch to use _DEFAULT_SOURCE instead of _BSD_SOURCE
Jose Pedro Oliveira
jpo at fedoraproject.org
Fri Feb 20 22:32:13 UTC 2015
commit 8714a86fd6fc3b130a05e38fc1dfdb1aff791e77
Author: Jose Pedro Oliveira <jose.p.oliveira.oss at gmail.com>
Date: Fri Feb 20 23:17:33 2015 +0100
Upstream patch to use _DEFAULT_SOURCE instead of _BSD_SOURCE
...se-_DEFAULT_SOURCE-instead-of-_BSD_SOURCE.patch | 51 ++++++++++++++++++++++
czmq.spec | 10 ++++-
2 files changed, 59 insertions(+), 2 deletions(-)
---
diff --git a/0001-Use-_DEFAULT_SOURCE-instead-of-_BSD_SOURCE.patch b/0001-Use-_DEFAULT_SOURCE-instead-of-_BSD_SOURCE.patch
new file mode 100644
index 0000000..42660e1
--- /dev/null
+++ b/0001-Use-_DEFAULT_SOURCE-instead-of-_BSD_SOURCE.patch
@@ -0,0 +1,51 @@
+From eebf66a267e0acdf8b791e541b24ab701557135e Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
+Date: Tue, 9 Sep 2014 23:36:10 +0200
+Subject: [PATCH] Use _DEFAULT_SOURCE instead of _BSD_SOURCE
+
+Since glibc 2.20, using _BSD_SOURCE triggers a warning, and since czmq
+uses -Werror, it aborts the build:
+
+ CC zchunk.lo
+In file included from /home/thomas/projets/buildroot/output/host/usr/nios2-buildroot-linux-gnu/sysroot/usr/include/ctype.h:25:0,
+ from ../include/czmq_prelude.h:203,
+ from ../include/czmq.h:19,
+ from zauth.c:25:
+/home/thomas/projets/buildroot/output/host/usr/nios2-buildroot-linux-gnu/sysroot/usr/include/features.h:148:3: error: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Werror=cpp]
+ # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
+ ^
+
+See the glibc 2.20 release notes, https://lwn.net/Articles/611162/,
+explaining the change about _BSD_SOURCE:
+
+* The _BSD_SOURCE and _SVID_SOURCE feature test macros are no longer
+ supported; they now act the same as _DEFAULT_SOURCE (but generate a
+ warning). Except for cases where _BSD_SOURCE enabled BSD interfaces that
+ conflicted with POSIX (support for which was removed in 2.19), the
+ interfaces those macros enabled remain available when compiling with
+ _GNU_SOURCE defined, with _DEFAULT_SOURCE defined, or without any feature
+ test macros defined.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
+---
+ include/czmq_prelude.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/include/czmq_prelude.h b/include/czmq_prelude.h
+index 9dc9c95..853f558 100644
+--- a/include/czmq_prelude.h
++++ b/include/czmq_prelude.h
+@@ -153,8 +153,8 @@
+ # ifndef __NO_CTYPE
+ # define __NO_CTYPE // Suppress warnings on tolower()
+ # endif
+-# ifndef _BSD_SOURCE
+-# define _BSD_SOURCE // Include stuff from 4.3 BSD Unix
++# ifndef _DEFAULT_SOURCE
++# define _DEFAULT_SOURCE // Include stuff from 4.3 BSD Unix
+ # endif
+ #elif (defined (Mips))
+ # define __UTYPE_MIPS
+--
+2.3.0
+
diff --git a/czmq.spec b/czmq.spec
index 550c42a..155f073 100644
--- a/czmq.spec
+++ b/czmq.spec
@@ -1,12 +1,15 @@
Name: czmq
Version: 2.2.0
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: High-level C binding for 0MQ (ZeroMQ)
Group: Development/Libraries
License: LGPLv3+
URL: http://czmq.zeromq.org/
Source0: http://download.zeromq.org/czmq-%{version}.tar.gz
+# Upstream patch: git format-patch -1 eebf66a
+# https://github.com/zeromq/czmq/commit/eebf66a267e0acdf8b791e541b24ab701557135e
+Patch0: 0001-Use-_DEFAULT_SOURCE-instead-of-_BSD_SOURCE.patch
BuildRequires: libuuid-devel
BuildRequires: zeromq3-devel
@@ -32,7 +35,7 @@ This package contains files needed to develop applications using czmq.
%prep
%setup -q
-
+%patch0 -p1
%build
%configure
@@ -75,6 +78,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make check
%changelog
+* Fri Feb 20 2015 Jose Pedro Oliveira <jose.p.oliveira.oss at gmail.com> - 2.2.0-2
+- Add upstream patch eebf66a (0001-Use-_DEFAULT_SOURCE-instead-of-_BSD_SOURCE.patch)
+
* Tue Feb 17 2015 Jose Pedro Oliveira <jose.p.oliveira.oss at gmail.com> - 2.2.0-1
- Update to 2.2.0.
More information about the scm-commits
mailing list