net-misc/vde: Fix for bug #543006
authorNicholas Vinson <nvinson234@gmail.com>
Sun, 3 Jan 2016 04:15:50 +0000 (23:15 -0500)
committerIan Delaney <idella4@gentoo.org>
Sun, 3 Jan 2016 08:39:29 +0000 (16:39 +0800)
Added vde-2.2.2-gcc53.patch.  Starting with GCC 5, GCC uses Std. C semantics for
inline kewords instead of non-compliant GNU C semantics.  This patch corrects
the source with respect to the semantic difference.

Package-Manager: portage-2.2.26

net-misc/vde/files/vde-2.2.2-gcc53.patch [new file with mode: 0644]
net-misc/vde/vde-2.2.2-r1.ebuild [new file with mode: 0644]

diff --git a/net-misc/vde/files/vde-2.2.2-gcc53.patch b/net-misc/vde/files/vde-2.2.2-gcc53.patch
new file mode 100644 (file)
index 0000000..60fb98c
--- /dev/null
@@ -0,0 +1,66 @@
+--- src/slirpvde/misc.c        2016-01-02 22:54:35.746094904 -0500
++++ src/slirpvde/misc.c.old    2016-01-02 22:54:33.152132668 -0500
+@@ -120,11 +120,15 @@ getouraddr()
+ struct quehead_32 {
+       u_int32_t qh_link;
+       u_int32_t qh_rlink;
+ };
+
++#ifdef __GNUC_GNU_INLINE__
+ inline void
++#else
++extern inline void
++#endif
+ insque_32(a, b)
+       void *a;
+       void *b;
+ {
+       register struct quehead_32 *element = (struct quehead_32 *) a;
+@@ -134,11 +134,15 @@ insque_32(a, b)
+       element->qh_rlink = (u_int32_t)head;
+       ((struct quehead_32 *)(element->qh_link))->qh_rlink
+       = (u_int32_t)element;
+ }
+ 
++#ifdef __GNUC_GNU_INLINE__
+ inline void
++#else
++extern inline void
++#endif
+ remque_32(void *a)
+ {
+       register struct quehead_32 *element = (struct quehead_32 *) a;
+       ((struct quehead_32 *)(element->qh_link))->qh_rlink = element->qh_rlink;
+       ((struct quehead_32 *)(element->qh_rlink))->qh_link = element->qh_link;
+@@ -150,11 +150,15 @@ remque_32(void *a)
+ struct quehead {
+       struct quehead *qh_link;
+       struct quehead *qh_rlink;
+ };
+ 
++#ifdef __GNUC_GNU_INLINE__
+ inline void
++#else
++extern inline void
++#endif
+ insque(a, b)
+       void *a, *b;
+ {
+       register struct quehead *element = (struct quehead *) a;
+       register struct quehead *head = (struct quehead *) b;
+@@ -163,11 +163,15 @@ insque(a, b)
+       element->qh_rlink = (struct quehead *)head;
+       ((struct quehead *)(element->qh_link))->qh_rlink
+       = (struct quehead *)element;
+ }
+ 
++#ifdef __GNUC_GNU_INLINE__
+ inline void
++#else
++extern inline void
++#endif
+ remque(a)
+      void *a;
+ {
+   register struct quehead *element = (struct quehead *) a;
+   ((struct quehead *)(element->qh_link))->qh_rlink = element->qh_rlink;
diff --git a/net-misc/vde/vde-2.2.2-r1.ebuild b/net-misc/vde/vde-2.2.2-r1.ebuild
new file mode 100644 (file)
index 0000000..242951d
--- /dev/null
@@ -0,0 +1,53 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic user
+
+MY_P="${PN}2-${PV}"
+S="${WORKDIR}/${MY_P}"
+
+DESCRIPTION="Virtual distributed ethernet emulator for emulators like qemu, bochs, and uml"
+SRC_URI="mirror://sourceforge/vde/${MY_P}.tar.bz2"
+HOMEPAGE="http://vde.sourceforge.net/"
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
+
+# The slirpvde-buffer-overflow patch was made by Ludwig Nussel and submitted upstream at
+# http://sourceforge.net/tracker/?func=detail&aid=2138410&group_id=95403&atid=611248
+PATCHES=(
+       "${FILESDIR}/${P}-gcc43.patch"
+       "${FILESDIR}/${P}-slirpvde-buffer-overflow.patch"
+       "${FILESDIR}/${P}-gcc53.patch"
+)
+
+src_prepare() {
+       epatch "${PATCHES[@]}"
+       epatch_user
+}
+
+src_configure() {
+       append-cflags $(test-flags-CC -fno-strict-aliasing)
+       econf
+}
+
+src_install() {
+       emake DESTDIR="${D}" install || die "emake install failed"
+       newinitd "${FILESDIR}"/vde.init vde
+       newconfd "${FILESDIR}"/vde.conf vde
+
+       dodoc INSTALL README
+}
+
+pkg_postinst() {
+       # default group already used in kqemu
+       enewgroup qemu
+       einfo "To start vde automatically add it to the default runlevel:"
+       einfo "# rc-update add vde default"
+       einfo "You need to setup tap0 in /etc/conf.d/net"
+       einfo "To use it as a user be sure to set a group in /etc/conf.d/vde"
+       einfo "Users of the group can then run: $ vdeq qemu -sock /var/run/vde.ctl ..other opts"
+}