wvstreams is a C++ networking library which is added here because
it's used by wvdial. Upstream for this library is dead, so we
download the package from storage.googleapis.com.

To make it compile the debian patches are added.

WvStreams uses autoconf, but not automake which for us means
that parallel build is broken. Disable parallel build for now.

Signed-off-by: Sascha Hauer <s.ha...@pengutronix.de>
---
 .../0001-Fix-FTBFS-with-gcc-4.7.patch              | 54 ++++++++++++++++++++
 .../0002-fix-FTBFS-with-OpenSSL-1.0.patch          | 25 ++++++++++
 .../0003-fix-FTBFS-with-glibc-2.12.patch           | 41 ++++++++++++++++
 .../0004-Fix-compilation-with-gcc-6.patch          | 49 +++++++++++++++++++
 patches/wvstreams-4.6.1/series                     |  4 ++
 rules/wvstreams.in                                 | 11 +++++
 rules/wvstreams.make                               | 57 ++++++++++++++++++++++
 7 files changed, 241 insertions(+)
 create mode 100644 patches/wvstreams-4.6.1/0001-Fix-FTBFS-with-gcc-4.7.patch
 create mode 100644 
patches/wvstreams-4.6.1/0002-fix-FTBFS-with-OpenSSL-1.0.patch
 create mode 100644 patches/wvstreams-4.6.1/0003-fix-FTBFS-with-glibc-2.12.patch
 create mode 100644 
patches/wvstreams-4.6.1/0004-Fix-compilation-with-gcc-6.patch
 create mode 100644 patches/wvstreams-4.6.1/series
 create mode 100644 rules/wvstreams.in
 create mode 100644 rules/wvstreams.make

diff --git a/patches/wvstreams-4.6.1/0001-Fix-FTBFS-with-gcc-4.7.patch 
b/patches/wvstreams-4.6.1/0001-Fix-FTBFS-with-gcc-4.7.patch
new file mode 100644
index 000000000..b8597d29a
--- /dev/null
+++ b/patches/wvstreams-4.6.1/0001-Fix-FTBFS-with-gcc-4.7.patch
@@ -0,0 +1,54 @@
+From 912004e2faa35c95558a04b8d7ac7d132676d92f Mon Sep 17 00:00:00 2001
+From: Paul Tagliamonte <paul...@ubuntu.com>
+Date: Thu, 28 Sep 2017 15:50:05 +0200
+Subject: [PATCH 1/4] Fix FTBFS with gcc-4.7
+
+Small header include change. This is borderlinde cosmetic, but still
+needed to prevent the FTBFS.
+---
+ utils/wvcrash.cc     | 2 +-
+ utils/wvcrashbase.cc | 2 +-
+ utils/wvuid.cc       | 1 +
+ 3 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/utils/wvcrash.cc b/utils/wvcrash.cc
+index 0417759..d5e1d87 100644
+--- a/utils/wvcrash.cc
++++ b/utils/wvcrash.cc
+@@ -26,7 +26,7 @@
+ #endif
+ 
+ // FIXME: this file mostly only works in Linux
+-#ifdef __linux
++#if 1
+ 
+ # include <execinfo.h>
+ #include <unistd.h>
+diff --git a/utils/wvcrashbase.cc b/utils/wvcrashbase.cc
+index 8d67027..53e2037 100644
+--- a/utils/wvcrashbase.cc
++++ b/utils/wvcrashbase.cc
+@@ -66,7 +66,7 @@ const char *wvcrash_ring_buffer_get()
+ 
+ 
+ // FIXME: leaving of a will and catching asserts mostly only works in Linux
+-#ifdef __linux
++#if 1
+ 
+ #ifdef __USE_GNU
+ static const char *argv0 = program_invocation_short_name;
+diff --git a/utils/wvuid.cc b/utils/wvuid.cc
+index 7fa1035..709a484 100644
+--- a/utils/wvuid.cc
++++ b/utils/wvuid.cc
+@@ -33,6 +33,7 @@ wvuid_t wvgetuid()
+ 
+ #else // not WIN32
+ 
++#include <unistd.h>
+ 
+ WvString wv_username_from_uid(wvuid_t uid)
+ {
+-- 
+2.11.0
+
diff --git a/patches/wvstreams-4.6.1/0002-fix-FTBFS-with-OpenSSL-1.0.patch 
b/patches/wvstreams-4.6.1/0002-fix-FTBFS-with-OpenSSL-1.0.patch
new file mode 100644
index 000000000..d308bc93c
--- /dev/null
+++ b/patches/wvstreams-4.6.1/0002-fix-FTBFS-with-OpenSSL-1.0.patch
@@ -0,0 +1,25 @@
+From f6a5f6c664be64c04d4e70c7a69993401318f36a Mon Sep 17 00:00:00 2001
+From: Luca Falavigna <dktrkr...@debian.org>
+Date: Thu, 28 Sep 2017 15:51:26 +0200
+Subject: [PATCH 2/4] fix FTBFS with OpenSSL 1.0
+
+---
+ crypto/wvx509.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/crypto/wvx509.cc b/crypto/wvx509.cc
+index 93dae06..41fa742 100644
+--- a/crypto/wvx509.cc
++++ b/crypto/wvx509.cc
+@@ -1157,7 +1157,7 @@ WvString WvX509::get_extension(int nid) const
+         
+         if (ext)
+         {
+-            X509V3_EXT_METHOD *method = X509V3_EXT_get(ext);
++            X509V3_EXT_METHOD *method = (X509V3_EXT_METHOD 
*)X509V3_EXT_get(ext);
+             if (!method)
+             {
+                 WvDynBuf buf;
+-- 
+2.11.0
+
diff --git a/patches/wvstreams-4.6.1/0003-fix-FTBFS-with-glibc-2.12.patch 
b/patches/wvstreams-4.6.1/0003-fix-FTBFS-with-glibc-2.12.patch
new file mode 100644
index 000000000..183583aab
--- /dev/null
+++ b/patches/wvstreams-4.6.1/0003-fix-FTBFS-with-glibc-2.12.patch
@@ -0,0 +1,41 @@
+From 013d7fc99cafd215a18ee2e3eeeead15c4428242 Mon Sep 17 00:00:00 2001
+From: Luca Falavigna <dktrkr...@debian.org>
+Date: Thu, 28 Sep 2017 15:52:12 +0200
+Subject: [PATCH 3/4] fix FTBFS with glibc 2.12
+
+---
+ ipstreams/wvunixdgsocket.cc | 2 --
+ streams/wvatomicfile.cc     | 3 ---
+ 2 files changed, 5 deletions(-)
+
+diff --git a/ipstreams/wvunixdgsocket.cc b/ipstreams/wvunixdgsocket.cc
+index 41d2911..c8b539f 100644
+--- a/ipstreams/wvunixdgsocket.cc
++++ b/ipstreams/wvunixdgsocket.cc
+@@ -1,8 +1,6 @@
+ #include "wvunixdgsocket.h"
+-#ifdef MACOS
+ #include <sys/types.h>
+ #include <sys/stat.h>
+-#endif
+ 
+ WvUnixDGSocket::WvUnixDGSocket(WvStringParm filename, bool _server, int perms)
+     : socketfile(filename)
+diff --git a/streams/wvatomicfile.cc b/streams/wvatomicfile.cc
+index 65ae202..e249a14 100644
+--- a/streams/wvatomicfile.cc
++++ b/streams/wvatomicfile.cc
+@@ -10,10 +10,7 @@
+ #include "wvatomicfile.h"
+ #include "wvfileutils.h"
+ #include "wvstrutils.h"
+-
+-#ifdef MACOS
+ #include <sys/stat.h>
+-#endif
+ 
+ WvAtomicFile::WvAtomicFile(WvStringParm filename, int flags, mode_t 
create_mode)
+     : tmp_file(WvString::null)
+-- 
+2.11.0
+
diff --git a/patches/wvstreams-4.6.1/0004-Fix-compilation-with-gcc-6.patch 
b/patches/wvstreams-4.6.1/0004-Fix-compilation-with-gcc-6.patch
new file mode 100644
index 000000000..9381c4c11
--- /dev/null
+++ b/patches/wvstreams-4.6.1/0004-Fix-compilation-with-gcc-6.patch
@@ -0,0 +1,49 @@
+From e8ef9e0843bc0e8e59c556dbe8c612221e54c295 Mon Sep 17 00:00:00 2001
+From: Gert Wollny <gw.foss...@gmail.com>
+Date: Thu, 28 Sep 2017 15:53:36 +0200
+Subject: [PATCH 4/4] Fix compilation with gcc-6
+
+---
+ streams/wvstream.cc | 12 +++++++-----
+ 1 file changed, 7 insertions(+), 5 deletions(-)
+
+diff --git a/streams/wvstream.cc b/streams/wvstream.cc
+index 4564f3c..5a3c070 100644
+--- a/streams/wvstream.cc
++++ b/streams/wvstream.cc
+@@ -907,9 +907,9 @@ void WvStream::_build_selectinfo(SelectInfo &si, time_t 
msec_timeout,
+     
+     if (forceable)
+     {
+-      si.wants.readable = readcb;
+-      si.wants.writable = writecb;
+-      si.wants.isexception = exceptcb;
++      si.wants.readable = static_cast<bool>(readcb);
++      si.wants.writable = static_cast<bool>(writecb);
++      si.wants.isexception = static_cast<bool>(exceptcb);
+     }
+     else
+     {
+@@ -1019,7 +1019,8 @@ bool WvStream::_select(time_t msec_timeout, bool 
readable, bool writable,
+ 
+ IWvStream::SelectRequest WvStream::get_select_request()
+ {
+-    return IWvStream::SelectRequest(readcb, writecb, exceptcb);
++    return IWvStream::SelectRequest(static_cast<bool>(readcb), 
static_cast<bool>(writecb),
++                                  static_cast<bool>(exceptcb));
+ }
+ 
+ 
+@@ -1107,7 +1108,8 @@ bool WvStream::continue_select(time_t msec_timeout)
+     // inefficient, because if the alarm was expired then pre_select()
+     // returned true anyway and short-circuited the previous select().
+     TRACE("hello-%p\n", this);
+-    return !alarm_was_ticking || select(0, readcb, writecb, exceptcb);
++    return !alarm_was_ticking || select(0, static_cast<bool>(readcb),
++                                      static_cast<bool>(writecb), 
static_cast<bool>(exceptcb));
+ }
+ 
+ 
+-- 
+2.11.0
+
diff --git a/patches/wvstreams-4.6.1/series b/patches/wvstreams-4.6.1/series
new file mode 100644
index 000000000..d21be5195
--- /dev/null
+++ b/patches/wvstreams-4.6.1/series
@@ -0,0 +1,4 @@
+0001-Fix-FTBFS-with-gcc-4.7.patch
+0002-fix-FTBFS-with-OpenSSL-1.0.patch
+0003-fix-FTBFS-with-glibc-2.12.patch
+0004-Fix-compilation-with-gcc-6.patch
diff --git a/rules/wvstreams.in b/rules/wvstreams.in
new file mode 100644
index 000000000..2f3f60b83
--- /dev/null
+++ b/rules/wvstreams.in
@@ -0,0 +1,11 @@
+## SECTION=system_libraries
+
+config WVSTREAMS
+       tristate
+       prompt "wvstreams"
+       select ZLIB
+       select OPENSSL
+       help
+         WvStreams aims to be an efficient, secure, and easy-to-use library
+         for doing network and systems applications development in C++.
+         Mainly needed for the wvdial tool.
diff --git a/rules/wvstreams.make b/rules/wvstreams.make
new file mode 100644
index 000000000..d5e9aff2b
--- /dev/null
+++ b/rules/wvstreams.make
@@ -0,0 +1,57 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2017 by Sascha Hauer <s.ha...@pengutronix.de>
+#
+# See CREDITS for details about who has contributed to this project.
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_WVSTREAMS) += wvstreams
+
+#
+# Paths and names
+#
+WVSTREAMS_VERSION      := 4.6.1
+WVSTREAMS_MD5          := 2760dac31a43d452a19a3147bfde571c
+WVSTREAMS              := wvstreams-$(WVSTREAMS_VERSION)
+WVSTREAMS_SUFFIX       := tar.gz
+WVSTREAMS_URL          := 
https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/wvstreams/${WVSTREAMS}.$(WVSTREAMS_SUFFIX)
+WVSTREAMS_SOURCE       := $(SRCDIR)/$(WVSTREAMS).$(WVSTREAMS_SUFFIX)
+WVSTREAMS_DIR          := $(BUILDDIR)/$(WVSTREAMS)
+WVSTREAMS_LICENSE      := GPLv2
+
+#
+# autoconf
+#
+WVSTREAMS_CONF_TOOL    := autoconf
+#WVSTREAMS_CONF_OPT    := $(CROSS_AUTOCONF_USR)
+WVSTREAMS_MAKE_PAR := NO
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/wvstreams.targetinstall:
+       @$(call targetinfo)
+
+       @$(call install_init, wvstreams)
+       @$(call install_fixup, wvstreams,PRIORITY,optional)
+       @$(call install_fixup, wvstreams,SECTION,base)
+       @$(call install_fixup, wvstreams,AUTHOR,"Sascha Hauer 
<s.ha...@pengutronix.de>")
+       @$(call install_fixup, wvstreams,DESCRIPTION,missing)
+
+       @$(call install_lib, wvstreams, 0, 0, 0644, libuniconf)
+       @$(call install_lib, wvstreams, 0, 0, 0644, libwvbase)
+       @$(call install_lib, wvstreams, 0, 0, 0644, libwvstreams)
+       @$(call install_lib, wvstreams, 0, 0, 0644, libwvutils)
+
+       @$(call install_finish, wvstreams)
+
+       @$(call touch)
+
+# vim: syntax=make
-- 
2.11.0


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

Reply via email to