1 |
commit: db5ba8d0625e670e679f558e0943006f238f952b |
2 |
Author: Jonathan Scruggs <j.scruggs <AT> gmail <DOT> com> |
3 |
AuthorDate: Fri Oct 28 09:31:09 2016 +0000 |
4 |
Commit: David Seifert <soap <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Oct 28 22:30:29 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=db5ba8d0 |
7 |
|
8 |
media-libs/audiofile: Add gcc 6 build fixes patch |
9 |
|
10 |
Gentoo-bug: 582792 |
11 |
|
12 |
Signed-off by: Jonathan Scruggs (j.scruggs <AT> gmail.com) |
13 |
Closes: https://github.com/gentoo/gentoo/pull/2684 |
14 |
|
15 |
Signed-off-by: David Seifert <soap <AT> gentoo.org> |
16 |
|
17 |
media-libs/audiofile/audiofile-0.3.6-r2.ebuild | 50 ++++++++ |
18 |
.../files/audiofile-0.3.6-gcc6-build-fixes.patch | 127 +++++++++++++++++++++ |
19 |
2 files changed, 177 insertions(+) |
20 |
|
21 |
diff --git a/media-libs/audiofile/audiofile-0.3.6-r2.ebuild b/media-libs/audiofile/audiofile-0.3.6-r2.ebuild |
22 |
new file mode 100644 |
23 |
index 00000000..53ee8b6 |
24 |
--- /dev/null |
25 |
+++ b/media-libs/audiofile/audiofile-0.3.6-r2.ebuild |
26 |
@@ -0,0 +1,50 @@ |
27 |
+# Copyright 1999-2016 Gentoo Foundation |
28 |
+# Distributed under the terms of the GNU General Public License v2 |
29 |
+# $Id$ |
30 |
+ |
31 |
+EAPI=6 |
32 |
+ |
33 |
+inherit autotools gnome.org multilib-minimal |
34 |
+ |
35 |
+DESCRIPTION="An elegant API for accessing audio files" |
36 |
+HOMEPAGE="http://www.68k.org/~michael/audiofile/" |
37 |
+ |
38 |
+LICENSE="GPL-2 LGPL-2.1" |
39 |
+SLOT="0/1" # subslot = soname major version |
40 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc \ |
41 |
+ ~x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~x86-interix ~amd64-linux \ |
42 |
+ ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x86-solaris" |
43 |
+IUSE="flac static-libs test" |
44 |
+ |
45 |
+RDEPEND="flac? ( >=media-libs/flac-1.2.1[${MULTILIB_USEDEP}] )" |
46 |
+DEPEND="${RDEPEND} |
47 |
+ virtual/pkgconfig |
48 |
+ test? ( dev-cpp/gtest[${MULTILIB_USEDEP}] )" |
49 |
+ |
50 |
+PATCHES=( |
51 |
+ "${FILESDIR}"/${PN}-0.3.6-gcc6-build-fixes.patch |
52 |
+ "${FILESDIR}"/${PN}-0.3.6-system-gtest.patch |
53 |
+) |
54 |
+ |
55 |
+src_prepare() { |
56 |
+ default |
57 |
+ eautoreconf |
58 |
+} |
59 |
+ |
60 |
+multilib_src_configure() { |
61 |
+ local myconf=( |
62 |
+ --enable-largefile |
63 |
+ --disable-werror |
64 |
+ --disable-examples |
65 |
+ $(use_enable flac) |
66 |
+ $(use_enable static-libs static) |
67 |
+ ) |
68 |
+ ECONF_SOURCE="${S}" econf "${myconf[@]}" |
69 |
+} |
70 |
+ |
71 |
+multilib_src_install_all() { |
72 |
+ einstalldocs |
73 |
+ |
74 |
+ # package provides .pc file |
75 |
+ find "${D}" -name '*.la' -delete || die |
76 |
+} |
77 |
|
78 |
diff --git a/media-libs/audiofile/files/audiofile-0.3.6-gcc6-build-fixes.patch b/media-libs/audiofile/files/audiofile-0.3.6-gcc6-build-fixes.patch |
79 |
new file mode 100644 |
80 |
index 00000000..02d96f1 |
81 |
--- /dev/null |
82 |
+++ b/media-libs/audiofile/files/audiofile-0.3.6-gcc6-build-fixes.patch |
83 |
@@ -0,0 +1,127 @@ |
84 |
+From 308571e254ad30101be8c1247d2b0b64cf488386 Mon Sep 17 00:00:00 2001 |
85 |
+From: Michael Schwendt <mschwendt@×××××××××××××.org> |
86 |
+Date: Wed, 3 Feb 2016 21:56:11 +0100 |
87 |
+Subject: [PATCH] left shifting a negative int is undefined behaviour / |
88 |
+ narrowing conversion issues / for GCC 6 |
89 |
+ |
90 |
+fix left shifts for 32-bit to avoid int overflow |
91 |
+ |
92 |
+avoid int overflow too |
93 |
+ |
94 |
+char on ARM is unsigned by default |
95 |
+--- |
96 |
+ libaudiofile/modules/SimpleModule.h | 2 +- |
97 |
+ test/FloatToInt.cpp | 2 +- |
98 |
+ test/IntToFloat.cpp | 2 +- |
99 |
+ test/NeXT.cpp | 14 +++++++------- |
100 |
+ test/Sign.cpp | 2 +- |
101 |
+ 5 files changed, 11 insertions(+), 11 deletions(-) |
102 |
+ |
103 |
+diff --git a/libaudiofile/modules/SimpleModule.h b/libaudiofile/modules/SimpleModule.h |
104 |
+index 03c6c69..e4cc138 100644 |
105 |
+--- a/libaudiofile/modules/SimpleModule.h |
106 |
++++ b/libaudiofile/modules/SimpleModule.h |
107 |
+@@ -123,7 +123,7 @@ struct signConverter |
108 |
+ typedef typename IntTypes<Format>::UnsignedType UnsignedType; |
109 |
+ |
110 |
+ static const int kScaleBits = (Format + 1) * CHAR_BIT - 1; |
111 |
+- static const int kMinSignedValue = -1 << kScaleBits; |
112 |
++ static const int kMinSignedValue = 0-(1U<<kScaleBits); |
113 |
+ |
114 |
+ struct signedToUnsigned : public std::unary_function<SignedType, UnsignedType> |
115 |
+ { |
116 |
+diff --git a/test/FloatToInt.cpp b/test/FloatToInt.cpp |
117 |
+index 0d179a8..bf491b2 100644 |
118 |
+--- a/test/FloatToInt.cpp |
119 |
++++ b/test/FloatToInt.cpp |
120 |
+@@ -115,7 +115,7 @@ TEST_F(FloatToIntTest, Int16) |
121 |
+ EXPECT_EQ(readData[i], expectedData[i]); |
122 |
+ } |
123 |
+ |
124 |
+-static const int32_t kMinInt24 = -1<<23; |
125 |
++static const int32_t kMinInt24 = 0-(1U<<23); |
126 |
+ static const int32_t kMaxInt24 = (1<<23) - 1; |
127 |
+ |
128 |
+ TEST_F(FloatToIntTest, Int24) |
129 |
+diff --git a/test/IntToFloat.cpp b/test/IntToFloat.cpp |
130 |
+index b716635..1d91b58 100644 |
131 |
+--- a/test/IntToFloat.cpp |
132 |
++++ b/test/IntToFloat.cpp |
133 |
+@@ -117,7 +117,7 @@ TEST_F(IntToFloatTest, Int16) |
134 |
+ EXPECT_EQ(readData[i], expectedData[i]); |
135 |
+ } |
136 |
+ |
137 |
+-static const int32_t kMinInt24 = -1<<23; |
138 |
++static const int32_t kMinInt24 = 0-(1U<<23); |
139 |
+ static const int32_t kMaxInt24 = (1<<23) - 1; |
140 |
+ |
141 |
+ TEST_F(IntToFloatTest, Int24) |
142 |
+diff --git a/test/NeXT.cpp b/test/NeXT.cpp |
143 |
+index 7e39850..a37cea1 100644 |
144 |
+--- a/test/NeXT.cpp |
145 |
++++ b/test/NeXT.cpp |
146 |
+@@ -37,13 +37,13 @@ |
147 |
+ |
148 |
+ #include "TestUtilities.h" |
149 |
+ |
150 |
+-const char kDataUnspecifiedLength[] = |
151 |
++const signed char kDataUnspecifiedLength[] = |
152 |
+ { |
153 |
+ '.', 's', 'n', 'd', |
154 |
+ 0, 0, 0, 24, // offset of 24 bytes |
155 |
+- 0xff, 0xff, 0xff, 0xff, // unspecified length |
156 |
++ -1, -1, -1, -1, // unspecified length |
157 |
+ 0, 0, 0, 3, // 16-bit linear |
158 |
+- 0, 0, 172, 68, // 44100 Hz |
159 |
++ 0, 0, -84, 68, // 44100 Hz (0xAC44) |
160 |
+ 0, 0, 0, 1, // 1 channel |
161 |
+ 0, 1, |
162 |
+ 0, 1, |
163 |
+@@ -57,13 +57,13 @@ const char kDataUnspecifiedLength[] = |
164 |
+ 0, 55 |
165 |
+ }; |
166 |
+ |
167 |
+-const char kDataTruncated[] = |
168 |
++const signed char kDataTruncated[] = |
169 |
+ { |
170 |
+ '.', 's', 'n', 'd', |
171 |
+ 0, 0, 0, 24, // offset of 24 bytes |
172 |
+ 0, 0, 0, 20, // length of 20 bytes |
173 |
+ 0, 0, 0, 3, // 16-bit linear |
174 |
+- 0, 0, 172, 68, // 44100 Hz |
175 |
++ 0, 0, -84, 68, // 44100 Hz (0xAC44) |
176 |
+ 0, 0, 0, 1, // 1 channel |
177 |
+ 0, 1, |
178 |
+ 0, 1, |
179 |
+@@ -152,13 +152,13 @@ TEST(NeXT, Truncated) |
180 |
+ ASSERT_EQ(::unlink(testFileName.c_str()), 0); |
181 |
+ } |
182 |
+ |
183 |
+-const char kDataZeroChannels[] = |
184 |
++const signed char kDataZeroChannels[] = |
185 |
+ { |
186 |
+ '.', 's', 'n', 'd', |
187 |
+ 0, 0, 0, 24, // offset of 24 bytes |
188 |
+ 0, 0, 0, 2, // 2 bytes |
189 |
+ 0, 0, 0, 3, // 16-bit linear |
190 |
+- 0, 0, 172, 68, // 44100 Hz |
191 |
++ 0, 0, -84, 68, // 44100 Hz (0xAC44) |
192 |
+ 0, 0, 0, 0, // 0 channels |
193 |
+ 0, 1 |
194 |
+ }; |
195 |
+diff --git a/test/Sign.cpp b/test/Sign.cpp |
196 |
+index 7275399..c339514 100644 |
197 |
+--- a/test/Sign.cpp |
198 |
++++ b/test/Sign.cpp |
199 |
+@@ -116,7 +116,7 @@ TEST_F(SignConversionTest, Int16) |
200 |
+ EXPECT_EQ(readData[i], expectedData[i]); |
201 |
+ } |
202 |
+ |
203 |
+-static const int32_t kMinInt24 = -1<<23; |
204 |
++static const int32_t kMinInt24 = 0-(1U<<23); |
205 |
+ static const int32_t kMaxInt24 = (1<<23) - 1; |
206 |
+ static const uint32_t kMaxUInt24 = (1<<24) - 1; |
207 |
+ |
208 |
+-- |
209 |
+2.10.1 |
210 |
+ |