commit:     0e2028487dc6c08de3ddb58fa873104981524c16
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 27 21:21:26 2016 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Tue Sep 27 21:28:29 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0e202848

dev-libs/fampp2: Fix building with GCC 6 and -Werror=terminate

Gentoo-bug: 595308
* EAPI=6
* Fix buildsystem properly, remove all the seds
* Fix building with GCC 6, due to changed noexcept semantics
* Remove 'eutils.eclass'
* Disable building of static libraries

Package-Manager: portage-2.3.1

 dev-libs/fampp2/fampp2-7.0.1-r1.ebuild             | 57 ----------------
 dev-libs/fampp2/fampp2-7.0.1-r2.ebuild             | 61 +++++++++++++++++
 .../files/fampp2-7.0.1-fix-buildsystem.patch       | 78 ++++++++++++++++++++++
 dev-libs/fampp2/files/fampp2-7.0.1-fix-gcc6.patch  | 67 +++++++++++++++++++
 .../fampp2/files/fampp2-7.0.1-libsigc++-2.6.patch  | 46 +++++++++++++
 5 files changed, 252 insertions(+), 57 deletions(-)

diff --git a/dev-libs/fampp2/fampp2-7.0.1-r1.ebuild 
b/dev-libs/fampp2/fampp2-7.0.1-r1.ebuild
deleted file mode 100644
index 665bb03..00000000
--- a/dev-libs/fampp2/fampp2-7.0.1-r1.ebuild
+++ /dev/null
@@ -1,57 +0,0 @@
-# Copyright 1999-2013 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI="5"
-
-inherit eutils flag-o-matic
-
-DESCRIPTION="C++ wrapper for fam"
-HOMEPAGE="https://sourceforge.net/projects/fampp/";
-SRC_URI="mirror://sourceforge/fampp/${P}.tar.bz2"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-IUSE="examples stlport"
-
-RDEPEND="virtual/fam
-       stlport? ( dev-libs/STLport )
-       >=dev-libs/ferrisloki-2.0.3[stlport?]
-       >=dev-libs/libsigc++-2.6:2
-       dev-libs/glib:2
-       x11-libs/gtk+:2"
-DEPEND="${DEPEND}
-       virtual/pkgconfig"
-
-src_prepare() {
-       # Fix compat with libsigc++-2.6
-       find -name '*.h' -exec sed -i '/sigc++\/object.h/d' {} + || die
-       find -name '*.hh' -exec sed -i '/sigc++\/object.h/d' {} + || die
-       find -name '*.cpp' -exec sed -i '/sigc++\/object.h/d' {} + || die
-       find -name '*.cpp' -exec sed -i '/sigc++\/object_slot.h/d' {} + || die
-       append-cxxflags -std=c++11
-
-       sed -ri \
-               -e '/^C(XX)?FLAGS/s:-O0 -g::' \
-               -e '/^LDFLAGS/s:-Wl,-O1 -Wl,--hash-style=both::' \
-               configure || die "sed failed"
-}
-
-src_configure() {
-       # glib and gtk+ are only required for some examples
-       econf \
-               --disable-glibtest \
-               --disable-gtktest \
-               --with-stlport=/usr/include/stlport \
-               $(use_enable stlport)
-
-       if ! use examples ; then
-               sed -i -e '/^SUBDIRS/ s/examples//' Makefile.in || die "sed 
failed"
-       fi
-}
-
-src_install() {
-       default
-       prune_libtool_files
-}

diff --git a/dev-libs/fampp2/fampp2-7.0.1-r2.ebuild 
b/dev-libs/fampp2/fampp2-7.0.1-r2.ebuild
new file mode 100644
index 00000000..8bed9bd
--- /dev/null
+++ b/dev-libs/fampp2/fampp2-7.0.1-r2.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+inherit autotools flag-o-matic
+
+DESCRIPTION="C++ wrapper for fam"
+HOMEPAGE="https://sourceforge.net/projects/fampp/";
+SRC_URI="mirror://sourceforge/fampp/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="examples stlport"
+
+RDEPEND="virtual/fam
+       stlport? ( dev-libs/STLport )
+       >=dev-libs/ferrisloki-2.0.3[stlport?]
+       >=dev-libs/libsigc++-2.6:2
+       dev-libs/glib:2
+       x11-libs/gtk+:2"
+DEPEND="${DEPEND}
+       virtual/pkgconfig"
+
+PATCHES=(
+       # Fix compat with libsigc++-2.6, #569700
+       "${FILESDIR}/${PN}-7.0.1-libsigc++-2.6.patch"
+       # Fix completely broken buildsystem
+       "${FILESDIR}/${PN}-7.0.1-fix-buildsystem.patch"
+       # Fix noexcept(true) for dtors in >=C++11 with GCC 6, #595308
+       "${FILESDIR}/${PN}-7.0.1-fix-gcc6.patch"
+)
+
+src_prepare() {
+       default
+       mv configure.{in,ac} || die
+       eautoreconf
+}
+
+src_configure() {
+       # libsigc++-2.6 requires building with C++11
+       append-cxxflags -std=c++11
+
+       # glib and gtk+ are only required for some examples
+       econf \
+               --disable-static \
+               --disable-glibtest \
+               --disable-gtktest \
+               --with-stlport="${EPREFIX}/usr/include/stlport" \
+               $(use_enable stlport) \
+               $(use_with examples)
+}
+
+src_install() {
+       default
+
+       # package provides .pc files
+       find "${D}" -name '*.la' -delete || die
+}

diff --git a/dev-libs/fampp2/files/fampp2-7.0.1-fix-buildsystem.patch 
b/dev-libs/fampp2/files/fampp2-7.0.1-fix-buildsystem.patch
new file mode 100644
index 00000000..34067ff
--- /dev/null
+++ b/dev-libs/fampp2/files/fampp2-7.0.1-fix-buildsystem.patch
@@ -0,0 +1,78 @@
+Fix buildsystem, to avoid ugly and extremely brittle patching
+of the configure script and Makefile.in in the main ebuild.
+
+--- a/configure.in
++++ b/configure.in
+@@ -1,8 +1,8 @@
++AC_PREREQ([2.69])
++AC_INIT([fampp2],[7.0.1])
+ 
+-# require autoconf 2.13
+-AC_PREREQ(2.13)
+-
+-AC_INIT(src/Fampp2.hh)
++AC_CONFIG_MACRO_DIR([macros])
++AC_CONFIG_SRCDIR([src/Fampp2.hh])
+ 
+ FAMPPTWO_MAJOR=7
+ FAMPPTWO_MINOR=0
+@@ -22,9 +22,8 @@
+ VERSION=$FAMPP_VERSION
+ PACKAGE=fampp2
+ 
+-AM_CONFIG_HEADER(config.h)
+-AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
+-AM_MAINTAINER_MODE
++AC_CONFIG_HEADERS([config.h])
++AM_INIT_AUTOMAKE
+ 
+ AC_CANONICAL_HOST
+ AC_ISC_POSIX
+@@ -33,11 +32,7 @@
+ AC_PROG_CPP
+ AC_PROG_CXX
+ 
+-AC_STDC_HEADERS
+-#AC_ARG_PROGRAM
+-AC_DISABLE_FAST_INSTALL
+-AC_DISABLE_STATIC
+-AM_PROG_LIBTOOL
++LT_INIT
+ 
+ 
+ dnl Checks for libraries.
+@@ -58,15 +53,12 @@
+ 
###############################################################################
+ 
+ 
+-CFLAGS=" $STLPORT_CFLAGS $LOKI_CFLAGS $SIGC_CFLAGS $CFLAGS -O0 -g  "
+-CXXFLAGS=" $STLPORT_CFLAGS  $CXXFLAGS -O0 -g $LOKI_LIBS $SIGC_CFLAGS  "
+-LDFLAGS=" $STLPORT_LIBS $SIGC_LIBS $LDFLAGS  -Wl,-O1 -Wl,--hash-style=both"
+-AC_SUBST(CFLAGS)
+-AC_SUBST(CPPFLAGS)
+-AC_SUBST(LDFLAGS)
+-AC_SUBST(CXXFLAGS)
+-AC_SUBST(CXXCPPFLAGS)
++CFLAGS="${CFLAGS} ${STLPORT_CFLAGS} ${LOKI_CFLAGS} ${SIGC_CFLAGS}"
++CXXFLAGS="${CXXFLAGS} ${STLPORT_CFLAGS} ${LOKI_CFLAGS} ${SIGC_CFLAGS}"
++LIBS="${LIBS} ${STLPORT_LIBS} ${LOKI_LIBS} ${SIGC_LIBS}"
+ 
++AC_ARG_WITH([examples], [install examples])
++AM_CONDITIONAL([EXAMPLES], [test "x$with_examples" = "xyes"])
+ 
+ dnl if test "x${prefix}" = 'xNONE'; then
+ dnl         prefix=${ac_default_prefix};
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -1,7 +1,10 @@
+ AUTOMAKE_OPTIONS = dist-bzip2 subdir-objects
+ 
+ NULL=
+-SUBDIRS = src examples
++SUBDIRS = src
++if EXAMPLES
++SUBDIRS += examples
++endif
+ 
+ EXTRA_DIST = fampp.spec fampp.spec.in fampp2.pc.in fampp2.pc
+ 

diff --git a/dev-libs/fampp2/files/fampp2-7.0.1-fix-gcc6.patch 
b/dev-libs/fampp2/files/fampp2-7.0.1-fix-gcc6.patch
new file mode 100644
index 00000000..659ecd5
--- /dev/null
+++ b/dev-libs/fampp2/files/fampp2-7.0.1-fix-gcc6.patch
@@ -0,0 +1,67 @@
+C++11 changed destructor semantics to be noexcept(true)
+by default, leading to potentially changed semantics.
+See also: https://bugs.gentoo.org/show_bug.cgi?id=595308
+
+--- a/src/Fampp2.cpp
++++ b/src/Fampp2.cpp
+@@ -105,6 +105,9 @@
+ // #include <unistd.h>
+ 
+     FamppRequest::~FamppRequest()
++#if __cplusplus >= 201103L
++    noexcept(false)
++#endif
+     {
+ //         cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << 
endl;
+ //         cerr << "FamppRequest::~FamppRequest() this:" << (void*)this << 
endl;
+@@ -245,6 +248,9 @@
+ 
+     
+     FamppImplMethods::~FamppImplMethods()
++#if __cplusplus >= 201103L
++    noexcept(false)
++#endif
+     {
+         if(0 != FAMClose( &theFAMConnection )) {
+             throw FamppCloseFailedException();
+--- a/src/Fampp2.hh
++++ b/src/Fampp2.hh
+@@ -168,7 +168,11 @@
+     public:
+ 
+         
+-        ~FamppRequest();
++        ~FamppRequest()
++#if __cplusplus >= 201103L
++        noexcept(false)
++#endif
++        ;
+ 
+ 
+         void suspend();
+@@ -216,7 +220,11 @@
+     protected:
+ 
+         FamppImplMethods();
+-        virtual ~FamppImplMethods();
++        virtual ~FamppImplMethods()
++#if __cplusplus >= 201103L
++        noexcept(false)
++#endif
++        ;
+ 
+ 
+     public:
+@@ -251,7 +259,11 @@
+     public:
+         FamppSingletonClass();
+         FamppSingletonClass(const std::string appName);
+-        ~FamppSingletonClass();
++        ~FamppSingletonClass()
++#if __cplusplus >= 201103L
++        noexcept(false)
++#endif
++        ;
+ 
+ 
+         void NextEvent();

diff --git a/dev-libs/fampp2/files/fampp2-7.0.1-libsigc++-2.6.patch 
b/dev-libs/fampp2/files/fampp2-7.0.1-libsigc++-2.6.patch
new file mode 100644
index 00000000..6b76a15
--- /dev/null
+++ b/dev-libs/fampp2/files/fampp2-7.0.1-libsigc++-2.6.patch
@@ -0,0 +1,46 @@
+Remove inclusion of libsigc++ headers obsoleted with version 2.6
+See also: https://bugs.gentoo.org/show_bug.cgi?id=569700
+
+--- a/examples/console_test/famppct.cpp
++++ b/examples/console_test/famppct.cpp
+@@ -30,8 +30,6 @@
+ 
+ #include <sigc++/sigc++.h>
+ #include <sigc++/slot.h>
+-#include <sigc++/object.h>
+-#include <sigc++/object_slot.h>
+ 
+ #include <gtk/gtk.h>
+ #include <stdio.h>
+--- a/examples/gtk/famppgtk.cpp
++++ b/examples/gtk/famppgtk.cpp
+@@ -31,8 +31,6 @@
+ 
+ #include <sigc++/sigc++.h>
+ #include <sigc++/slot.h>
+-#include <sigc++/object.h>
+-#include <sigc++/object_slot.h>
+ 
+ #include <gtk/gtk.h>
+ #include <stdio.h>
+--- a/src/Fampp2.cpp
++++ b/src/Fampp2.cpp
+@@ -34,8 +34,6 @@
+ 
+ #include <sigc++/sigc++.h>
+ #include <sigc++/slot.h>
+-#include <sigc++/object.h>
+-#include <sigc++/object_slot.h>
+ 
+ 
+ using namespace std;
+--- a/src/FamppEvents.hh
++++ b/src/FamppEvents.hh
+@@ -36,7 +36,6 @@
+ 
+ #include <fam.h>
+ #include <sigc++/signal.h>
+-#include <sigc++/object.h>
+ #include <SmartPtr.h>
+ #include <Singleton.h>
+ #include <Factory.h>

Reply via email to