diff options
author | David Seifert <soap@gentoo.org> | 2017-01-07 14:05:52 +0200 |
---|---|---|
committer | David Seifert <soap@gentoo.org> | 2017-01-07 14:06:15 +0200 |
commit | fb8965e575b33b5e57bb06e55937222ac6f024cd (patch) | |
tree | 7e739a3526aed1ffeabf098c06ea3c6a1767704f /media-sound/mp3blaster | |
parent | media-libs/libsidplay: Fix building with GCC 6 (diff) | |
download | gentoo-fb8965e575b33b5e57bb06e55937222ac6f024cd.tar.gz gentoo-fb8965e575b33b5e57bb06e55937222ac6f024cd.tar.bz2 gentoo-fb8965e575b33b5e57bb06e55937222ac6f024cd.zip |
media-sound/mp3blaster: Fix C++ and build system
Gentoo-bug: 422791, 559210, 600158
* EAPI=6
* Add -Wnarrowing patch
* Fix ncurses[tinfo] underlinking
* Fix hard-coded ar
Package-Manager: Portage-2.3.3, Repoman-2.3.1
Diffstat (limited to 'media-sound/mp3blaster')
3 files changed, 203 insertions, 0 deletions
diff --git a/media-sound/mp3blaster/files/mp3blaster-3.2.5-fix-build-system.patch b/media-sound/mp3blaster/files/mp3blaster-3.2.5-fix-build-system.patch new file mode 100644 index 000000000000..6e6b86fcf04c --- /dev/null +++ b/media-sound/mp3blaster/files/mp3blaster-3.2.5-fix-build-system.patch @@ -0,0 +1,94 @@ +Fix broken handling of ncurses by relying on pkg-config +instead of broken detection. +See also: https://bugs.gentoo.org/show_bug.cgi?id=559210 + +--- a/configure.ac ++++ b/configure.ac +@@ -9,7 +9,7 @@ + CXXFLAGS="-O2 -Wall -W -fno-strength-reduce" + fi + +-AM_CONFIG_HEADER(config.h) ++AC_CONFIG_HEADERS(config.h) + + dnl Checks for programs. + AC_PROG_CC +@@ -17,6 +17,7 @@ + AC_PROG_LN_S + AC_PROG_INSTALL + AC_PROG_RANLIB ++AM_PROG_AR + + dnl Checks for typedefs, structures, and compiler characteristics. + AC_C_CONST +@@ -26,7 +27,7 @@ + AC_PROG_GCC_TRADITIONAL + AC_CHECK_FUNCS(strdup strstr) + +-AC_LANG_CPLUSPLUS ++AC_PROG_CXX + + #For FreeBSD, look in /usr/local/(lib,include) first, since ncurses4 + #must be installed as an add-on on these systems in /usr/local +@@ -233,55 +234,12 @@ + REQ_CURSES=1 + + if test "$WANT_CURSES" = "1" ; then +- AC_CHECK_LIB(curses,main,HAVE_LIBCURSES=1) +- AC_CHECK_LIB(ncurses,main,HAVE_LIBNCURSES=1) +- AC_CHECK_HEADER(curses.h,HAVE_CURSES_H=1,HAVE_CURSES_H=0) +- AC_CHECK_HEADER(ncurses/ncurses.h,HAVE_NCURSES_NCURSES_H=1) +- AC_CHECK_HEADER(ncurses/curses.h,HAVE_NCURSES_CURSES_H=1) +- AC_CHECK_HEADER(ncurses.h,HAVE_NCURSES_H=1) +- +- if test "$FORCECURSES" = "1" ; then +- if test "$HAVE_LIBCURSES" = 0 -o "$HAVE_CURSES_H" = 0; then +- AC_MSG_ERROR([you forced using curses instead of ncurses, but lib/include cannot be found]) +- fi +- AC_DEFINE_UNQUOTED(NCURSES_HEADER, [<curses.h>], +- [Which headerfile to include for ncurses support]) +- NCURSES_LIBS="-lcurses" +- AC_SUBST(NCURSES_LIBS) +- else +- HAVE_CURSES="yes" +- if test "$HAVE_LIBNCURSES" = 1 ; then +- NCURSES_LIBS="-lncurses" +- elif test "$HAVE_LIBCURSES" = 1 ; then +- NCURSES_LIBS="-lcurses" +- else +- HAVE_CURSES="no" +- fi +- +- #header(s) found? +- HAVE_CURSES_HEADER=1 +- if test "$HAVE_NCURSES_NCURSES_H" = "1" ; then +- NCURSES_HEADER="<ncurses/ncurses.h>" +- elif test "$HAVE_NCURSES_CURSES_H" = "1" ; then +- NCURSES_HEADER="<ncurses/curses.h>" +- elif test "$HAVE_NCURSES_H" = "1" ; then +- NCURSES_HEADER="<ncurses.h>" +- elif test "$HAVE_CURSES_H" = "1" ; then +- NCURSES_HEADER="<curses.h>" +- else +- HAVE_CURSES_HEADER=0 +- fi +- +- if test "$HAVE_CURSES_HEADER" = "0" ; then HAVE_CURSES="no" ; fi +- +- if test "$HAVE_CURSES" = "yes" ; then +- AC_SUBST(NCURSES_LIBS) +- AC_DEFINE_UNQUOTED(NCURSES_HEADER, $NCURSES_HEADER, +- [Which headerfile to include for ncurses support]) +- elif test "$REQ_CURSES" = "1" ; then +- AC_MSG_ERROR([could not find (n)curses libs or includes, which are required]) +- fi +- fi #FORCECURSES ++ PKG_CHECK_MODULES([NCURSES], [ncurses]) ++ HAVE_CURSES="yes" ++ HAVE_CURSES_HEADER=1 ++ NCURSES_HEADER="<ncurses.h>" ++ AC_DEFINE_UNQUOTED(NCURSES_HEADER, $NCURSES_HEADER, ++ [Which headerfile to include for ncurses support]) + fi + + #Sound output devices. diff --git a/media-sound/mp3blaster/files/mp3blaster-3.2.5-fix-c++14.patch b/media-sound/mp3blaster/files/mp3blaster-3.2.5-fix-c++14.patch new file mode 100644 index 000000000000..bf732e7b1161 --- /dev/null +++ b/media-sound/mp3blaster/files/mp3blaster-3.2.5-fix-c++14.patch @@ -0,0 +1,39 @@ +Fix -Wnarrowing failures in C++14 mode +See also: https://bugs.gentoo.org/show_bug.cgi?id=600158 + +--- a/mpegsound/huffmantable.cc ++++ b/mpegsound/huffmantable.cc +@@ -550,11 +550,11 @@ + + const HUFFMANCODETABLE Mpegtoraw::ht[HTN]= + { +- { 0, 0-1, 0-1, 0, 0, htd33}, ++ { 0, (unsigned int)0-1, (unsigned int)0-1, 0, 0, htd33}, + { 1, 2-1, 2-1, 0, 7,htd01}, + { 2, 3-1, 3-1, 0, 17,htd02}, + { 3, 3-1, 3-1, 0, 17,htd03}, +- { 4, 0-1, 0-1, 0, 0, htd33}, ++ { 4, (unsigned int)0-1, (unsigned int)0-1, 0, 0, htd33}, + { 5, 4-1, 4-1, 0, 31,htd05}, + { 6, 4-1, 4-1, 0, 31,htd06}, + { 7, 6-1, 6-1, 0, 71,htd07}, +@@ -564,7 +564,7 @@ + {11, 8-1, 8-1, 0,127,htd11}, + {12, 8-1, 8-1, 0,127,htd12}, + {13,16-1,16-1, 0,511,htd13}, +- {14, 0-1, 0-1, 0, 0, htd33}, ++ {14, (unsigned int)0-1, (unsigned int)0-1, 0, 0, htd33}, + {15,16-1,16-1, 0,511,htd15}, + {16,16-1,16-1, 1,511,htd16}, + {17,16-1,16-1, 2,511,htd16}, +--- a/nmixer/nmixer.h ++++ b/nmixer/nmixer.h +@@ -26,7 +26,7 @@ + + #define MIXER_DEVICE "/dev/mixer" + #define MYMIN(x, y) ((x) < (y) ? (x) : (y)) +-#define MYVERSION "<<NMixer "VERSION">>" ++#define MYVERSION "<<NMixer " VERSION ">>" + + #define BOTH_CHANNELS 0x11 + #define RIGHT_CHANNEL 0x10 diff --git a/media-sound/mp3blaster/mp3blaster-3.2.5-r2.ebuild b/media-sound/mp3blaster/mp3blaster-3.2.5-r2.ebuild new file mode 100644 index 000000000000..d81b5df29a46 --- /dev/null +++ b/media-sound/mp3blaster/mp3blaster-3.2.5-r2.ebuild @@ -0,0 +1,70 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=6 + +inherit autotools + +DESCRIPTION="Text console based program for playing audio files" +HOMEPAGE="http://mp3blaster.sourceforge.net/" +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz + mirror://debian/pool/main/m/${PN}/${PN}_${PV}-3.debian.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd" +IUSE="lirc oss +sdl sid vorbis" + +RDEPEND=" + sys-libs/ncurses:0= + lirc? ( app-misc/lirc ) + sdl? ( media-libs/libsdl ) + sid? ( media-libs/libsidplay:1 ) + vorbis? ( media-libs/libvorbis )" +DEPEND="${RDEPEND} + x11-misc/imake + oss? ( virtual/os-headers )" + +REQUIRED_USE="|| ( oss sdl )" + +PATCHES=( + "${WORKDIR}"/debian/patches + "${FILESDIR}"/${PN}-3.2.5-fix-c++14.patch + "${FILESDIR}"/${PN}-3.2.5-fix-build-system.patch +) + +src_prepare() { + default + eautoreconf + + # file collision with media-sound/splay + sed -i -e 's:splay.1:splay_mp3blaster.1:' Makefile.in || die + mv -vf splay{,_mp3blaster}.1 || die +} + +src_configure() { + # libpth and newthreads support are both broken + econf \ + --disable-newthreads \ + --without-pth \ + --without-nas \ + $(use_with lirc) \ + $(use_with vorbis oggvorbis) \ + $(use_with sid sidplay) \ + --without-esd \ + $(use_with sdl) \ + $(use_with oss) +} + +src_install() { + default + + doman "${WORKDIR}"/debian/manpages/mp3tag.1 + + # relocate everything except commands.txt because it's used by src/main.cc + mv -vf "${ED%/}"/usr/share/{${PN}/{charmap,sample.*},doc/${PF}} || die + + # file collision with media-sound/splay + mv -vf "${ED%/}"/usr/bin/splay{,_mp3blaster} || die +} |