media-libs/libsidplay: Fix building with GCC 6
authorDavid Seifert <soap@gentoo.org>
Sat, 7 Jan 2017 11:08:43 +0000 (13:08 +0200)
committerDavid Seifert <soap@gentoo.org>
Sat, 7 Jan 2017 12:06:11 +0000 (14:06 +0200)
Gentoo-bug: 594326
* EAPI=6
* -Wnarrowing patch by Debian
* Make GCC 4.3 patch -p1 compliant

Package-Manager: Portage-2.3.3, Repoman-2.3.1

media-libs/libsidplay/files/libsidplay-1.36.59-fix-c++14.patch [new file with mode: 0644]
media-libs/libsidplay/files/libsidplay-1.36.59-gcc43.patch
media-libs/libsidplay/libsidplay-1.36.59-r2.ebuild [new file with mode: 0644]

diff --git a/media-libs/libsidplay/files/libsidplay-1.36.59-fix-c++14.patch b/media-libs/libsidplay/files/libsidplay-1.36.59-fix-c++14.patch
new file mode 100644 (file)
index 0000000..91e2064
--- /dev/null
@@ -0,0 +1,28 @@
+Description: use unsigned char to keep int value
+ Use unsigned char to keep all bits of int values in the array.
+Author: Laszlo Boszormenyi (GCS) <gcs@debian.org>
+Bug-Debian: https://bugs.debian.org/811762
+Last-Update: 2016-07-16
+
+---
+
+--- libsidplay-1.36.59.orig/src/samples.cpp
++++ libsidplay-1.36.59/src/samples.cpp
+@@ -75,7 +75,7 @@ struct sampleChannel
+ sampleChannel ch4, ch5;
+ 
+ 
+-const sbyte galwayNoiseTab1[16] =
++const ubyte galwayNoiseTab1[16] =
+ {
+       0x80,0x91,0xa2,0xb3,0xc4,0xd5,0xe6,0xf7,
+       0x08,0x19,0x2a,0x3b,0x4c,0x5d,0x6e,0x7f
+@@ -84,7 +84,7 @@ const sbyte galwayNoiseTab1[16] =
+ ubyte galwayNoiseVolTab[16];
+ sbyte galwayNoiseSamTab[16];
+ 
+-const sbyte sampleConvertTab[16] =
++const ubyte sampleConvertTab[16] =
+ {
+ //  0x81,0x99,0xaa,0xbb,0xcc,0xdd,0xee,0xff,
+ //  0x00,0x11,0x22,0x33,0x44,0x55,0x66,0x7f
index cc6810193b98c78738229eb828bc7afc1ef21e8f..f1fcc41cca556e5037d22a860c989426ea2093c2 100644 (file)
@@ -1,5 +1,5 @@
---- src/sidtune.cpp
-+++ src/sidtune.cpp
+--- a/src/sidtune.cpp
++++ b/src/sidtune.cpp
 @@ -306,11 +306,7 @@ udword sidTune::loadFile(const char* fileName, ubyte** bufferRef)
          return 0;
      }
diff --git a/media-libs/libsidplay/libsidplay-1.36.59-r2.ebuild b/media-libs/libsidplay/libsidplay-1.36.59-r2.ebuild
new file mode 100644 (file)
index 0000000..b9f175a
--- /dev/null
@@ -0,0 +1,39 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+inherit libtool multilib-minimal
+
+DESCRIPTION="C64 SID player library"
+HOMEPAGE="http://critical.ch/distfiles/"
+SRC_URI="http://critical.ch/distfiles/${P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="1"
+KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd"
+IUSE="static-libs"
+DEPEND=""
+RDEPEND=""
+
+DOCS=( AUTHORS DEVELOPER )
+PATCHES=(
+       "${FILESDIR}"/${P}-gcc43.patch
+       "${FILESDIR}"/${P}-fix-c++14.patch
+)
+
+src_prepare() {
+       default
+       elibtoolize # required for fbsd .so versioning
+}
+
+multilib_src_configure() {
+       ECONF_SOURCE="${S}" \
+       econf $(use_enable static-libs static)
+}
+
+multilib_src_install_all() {
+       einstalldocs
+       find "${D}" -name '*.la' -delete || die
+}