media-sound/mp3check: Fix building against GCC 9
authorDavid Seifert <soap@gentoo.org>
Sat, 22 Jun 2019 08:33:13 +0000 (10:33 +0200)
committerDavid Seifert <soap@gentoo.org>
Sat, 22 Jun 2019 08:33:13 +0000 (10:33 +0200)
Closes: https://bugs.gentoo.org/685880
Package-Manager: Portage-2.3.67, Repoman-2.3.15
Signed-off-by: David Seifert <soap@gentoo.org>
media-sound/mp3check/files/mp3check-0.8.7-fix-buildsystem.patch [new file with mode: 0644]
media-sound/mp3check/files/mp3check-0.8.7-fix-c++14-operator-delete.patch [new file with mode: 0644]
media-sound/mp3check/mp3check-0.8.7.ebuild

diff --git a/media-sound/mp3check/files/mp3check-0.8.7-fix-buildsystem.patch b/media-sound/mp3check/files/mp3check-0.8.7-fix-buildsystem.patch
new file mode 100644 (file)
index 0000000..86c69c1
--- /dev/null
@@ -0,0 +1,17 @@
+--- a/Makefile
++++ b/Makefile
+@@ -2,12 +2,10 @@
+ # Please see COPYING for license.
+ # --- config ----------------------------------------------------------------
+-WARN = -Wall -W -g
++WARN = -Wall -W
+ #OPT = -O2
+ OPT =
+-CPPFLAGS = $(ADDITIONAL_CPPFLAGS)
+-CXXFLAGS = $(WARN) $(OPT)
+-CXX = g++
++CXXFLAGS += $(WARN)
+ CC = $(CXX)
+ # --- default target
diff --git a/media-sound/mp3check/files/mp3check-0.8.7-fix-c++14-operator-delete.patch b/media-sound/mp3check/files/mp3check-0.8.7-fix-c++14-operator-delete.patch
new file mode 100644 (file)
index 0000000..de19421
--- /dev/null
@@ -0,0 +1,19 @@
+https://bugs.gentoo.org/685880
+tstring.cc: In static member function ‘static tstring::Rep* tstring::Rep::create(size_t)’:
+tstring.cc:114:39: error: exception cleanup for this placement new selects non-placement operator delete [-fpermissive]
+  114 |    Rep *p = new (m - 1 - sizeof(Rep)) Rep;
+      |                                       ^~~
+In file included from tstring.cc:26:
+
+--- a/tstring.h
++++ b/tstring.h
+@@ -75,6 +75,9 @@
+        return ::operator new (size + tmem + 1);}
+       static void operator delete (void *p, size_t) {
+        ::operator delete (p); }
++      // Gentoo Bug #685880
++      static void operator delete (void *p) {
++        ::operator delete (p); }
+       
+       // create a new representation
+       static Rep *create(size_t tmem);
index ee78058978c766a79ff755cb090d31ca04850cc4..97e7d314e0c28b3e3acee673aa307f93fe145f4b 100644 (file)
@@ -1,7 +1,8 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=5
+EAPI=7
+
 inherit flag-o-matic toolchain-funcs
 
 DESCRIPTION="Checks mp3 files for consistency and prints several errors and warnings"
@@ -11,20 +12,18 @@ SRC_URI="https://${PN}.googlecode.com/files/${P}.tgz"
 LICENSE="GPL-2"
 SLOT="0"
 KEYWORDS="amd64 ~ppc x86"
-IUSE=""
 
-src_prepare() {
-       sed -i -e '/^WARN/s:-g::' Makefile || die
-}
+PATCHES=(
+       "${FILESDIR}"/${PN}-0.8.7-fix-buildsystem.patch
+       "${FILESDIR}"/${PN}-0.8.7-fix-c++14-operator-delete.patch
+)
 
 src_configure() {
        # tfiletools.h:59:50: warning: dereferencing type-punned pointer will break
        # strict-aliasing rules [-Wstrict-aliasing]
        append-cxxflags -fno-strict-aliasing
-}
 
-src_compile() {
-       emake CXX="$(tc-getCXX)" OPT="${CXXFLAGS}"
+       tc-export CXX
 }
 
 src_install() {