Gentoo Archives: gentoo-commits

From: Daniel Pielmeier <billie@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-sound/mac/files/, media-sound/mac/
Date: Sat, 04 Mar 2017 18:32:34
Message-Id: 1488652337.44c26d5015cc5bcfa96159da02e6a27be7bf5bc3.billie@gentoo
1 commit: 44c26d5015cc5bcfa96159da02e6a27be7bf5bc3
2 Author: Daniel Pielmeier <billie <AT> gentoo <DOT> org>
3 AuthorDate: Sat Mar 4 18:31:46 2017 +0000
4 Commit: Daniel Pielmeier <billie <AT> gentoo <DOT> org>
5 CommitDate: Sat Mar 4 18:32:17 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=44c26d50
7
8 media-sound/mac: Version bump.
9
10 Monkeys Audio 4.11 taken from Debian Multimedia including patches.
11 Also includes gcc 6 patch from Github pull request #4119 thanks to
12 Harri Nieminen.
13
14 Package-Manager: Portage-2.3.3, Repoman-2.3.1
15
16 media-sound/mac/Manifest | 1 +
17 media-sound/mac/files/mac-4.11.4.5.7-gcc6.patch | 199 ++++++++++++++++++++++
18 media-sound/mac/files/mac-4.11.4.5.7-output.patch | 27 +++
19 media-sound/mac/mac-4.11.4.5.7.ebuild | 59 +++++++
20 4 files changed, 286 insertions(+)
21
22 diff --git a/media-sound/mac/Manifest b/media-sound/mac/Manifest
23 index 9e3e6d78b52..be07b3b6d7a 100644
24 --- a/media-sound/mac/Manifest
25 +++ b/media-sound/mac/Manifest
26 @@ -1 +1,2 @@
27 DIST mac-3.99-u4-b5-s7.tar.gz 450981 SHA256 9a735af2c56f05ee06b6e2ff719e902271299adf9e25cd3c9e4b28e8df3e30c5 SHA512 fa7ca8cec0ba6c0fb78dda6e964b17e9331184fed656a2458d0e3ac12fc375a661adfd36c142ef63111f31c6b63e8c00fe40e7babe84f0cefe5433940be628e0 WHIRLPOOL f4df5bccad06b7313348e9be734e926c1d511a2e3ca40162bc2c6a8cffb38c1455543fd7dc0a2352efa91945ae5546364085bd05888e906eb9e1c49fde7f743d
28 +DIST monkeys-audio_4.11-u4-b5-s7.orig.tar.gz 511190 SHA256 73e28b7dbef5dfd07108b85783261a8a8bb1770917bf2877d4ab8f5c3833299a SHA512 7e73b35c86d6007ab2a94a2d8b7449bb4ac505bbba53e40373a279dc83a9cad5f62a51419a6375335576cf325c88ed7d317b0ef3039b8a497100cb74a63c25d0 WHIRLPOOL be9b56a45c8da00d1c6008d6955a7a9d4fd86e4a893a60b6b35ea426af38900493a213944f1a77451eb942a0d7d0c42e4af3d71c889bead2bc82e5d2732fa022
29
30 diff --git a/media-sound/mac/files/mac-4.11.4.5.7-gcc6.patch b/media-sound/mac/files/mac-4.11.4.5.7-gcc6.patch
31 new file mode 100644
32 index 00000000000..60494e4f6e5
33 --- /dev/null
34 +++ b/media-sound/mac/files/mac-4.11.4.5.7-gcc6.patch
35 @@ -0,0 +1,199 @@
36 +diff -Naur monkeys-audio-4.11-u4-b5-s7_old/src/MACLib/APECompress.cpp monkeys-audio-4.11-u4-b5-s7/src/MACLib/APECompress.cpp
37 +--- monkeys-audio-4.11-u4-b5-s7_old/src/MACLib/APECompress.cpp 2017-03-04 17:07:21.952460418 +0100
38 ++++ monkeys-audio-4.11-u4-b5-s7/src/MACLib/APECompress.cpp 2017-03-04 17:11:58.607449387 +0100
39 +@@ -116,7 +116,7 @@
40 + return ERROR_UNDEFINED;
41 +
42 + // calculate how many bytes to copy and add that much to the buffer
43 +- int nBytesToProcess = min(nBytesAvailable, nBytes - nBytesDone);
44 ++ int nBytesToProcess = min_macro(nBytesAvailable, nBytes - nBytesDone);
45 + memcpy(pBuffer, &pData[nBytesDone], nBytesToProcess);
46 +
47 + // unlock the buffer (fail if not successful)
48 +@@ -161,7 +161,7 @@
49 +
50 + while ((m_nBufferTail - m_nBufferHead) >= nThreshold)
51 + {
52 +- int nFrameBytes = min(m_spAPECompressCreate->GetFullFrameBytes(), m_nBufferTail - m_nBufferHead);
53 ++ int nFrameBytes = min_macro(m_spAPECompressCreate->GetFullFrameBytes(), m_nBufferTail - m_nBufferHead);
54 +
55 + if (nFrameBytes == 0)
56 + break;
57 +diff -Naur monkeys-audio-4.11-u4-b5-s7_old/src/MACLib/APEDecompress.cpp monkeys-audio-4.11-u4-b5-s7/src/MACLib/APEDecompress.cpp
58 +--- monkeys-audio-4.11-u4-b5-s7_old/src/MACLib/APEDecompress.cpp 2017-03-04 17:07:21.952460418 +0100
59 ++++ monkeys-audio-4.11-u4-b5-s7/src/MACLib/APEDecompress.cpp 2017-03-04 17:14:55.455442336 +0100
60 +@@ -36,8 +36,8 @@
61 + m_nErrorDecodingCurrentFrameOutputSilenceBlocks = 0;
62 +
63 + // set the "real" start and finish blocks
64 +- m_nStartBlock = (nStartBlock < 0) ? 0 : min(nStartBlock, GetInfo(APE_INFO_TOTAL_BLOCKS));
65 +- m_nFinishBlock = (nFinishBlock < 0) ? GetInfo(APE_INFO_TOTAL_BLOCKS) : min(nFinishBlock, GetInfo(APE_INFO_TOTAL_BLOCKS));
66 ++ m_nStartBlock = (nStartBlock < 0) ? 0 : min_macro(nStartBlock, GetInfo(APE_INFO_TOTAL_BLOCKS));
67 ++ m_nFinishBlock = (nFinishBlock < 0) ? GetInfo(APE_INFO_TOTAL_BLOCKS) : min_macro(nFinishBlock, GetInfo(APE_INFO_TOTAL_BLOCKS));
68 + m_bIsRanged = (m_nStartBlock != 0) || (m_nFinishBlock != GetInfo(APE_INFO_TOTAL_BLOCKS));
69 + }
70 +
71 +@@ -85,7 +85,7 @@
72 +
73 + // cap
74 + int nBlocksUntilFinish = m_nFinishBlock - m_nCurrentBlock;
75 +- const int nBlocksToRetrieve = min(nBlocks, nBlocksUntilFinish);
76 ++ const int nBlocksToRetrieve = min_macro(nBlocks, nBlocksUntilFinish);
77 +
78 + // get the data
79 + unsigned char * pOutputBuffer = (unsigned char *) pBuffer;
80 +@@ -99,7 +99,7 @@
81 +
82 + // analyze how much to remove from the buffer
83 + const int nFrameBufferBlocks = m_nFrameBufferFinishedBlocks;
84 +- nBlocksThisPass = min(nBlocksLeft, nFrameBufferBlocks);
85 ++ nBlocksThisPass = min_macro(nBlocksLeft, nFrameBufferBlocks);
86 +
87 + // remove as much as possible
88 + if (nBlocksThisPass > 0)
89 +@@ -179,7 +179,7 @@
90 + if (m_nErrorDecodingCurrentFrameOutputSilenceBlocks > 0)
91 + {
92 + // output silence
93 +- int nOutputSilenceBlocks = min(m_nErrorDecodingCurrentFrameOutputSilenceBlocks, nBlocksLeft);
94 ++ int nOutputSilenceBlocks = min_macro(m_nErrorDecodingCurrentFrameOutputSilenceBlocks, nBlocksLeft);
95 + unsigned char cSilence = (GetInfo(APE_INFO_BITS_PER_SAMPLE) == 8) ? 127 : 0;
96 + for (int z = 0; z < nOutputSilenceBlocks * m_nBlockAlign; z++)
97 + {
98 +@@ -204,7 +204,7 @@
99 + // analyze
100 + int nFrameOffsetBlocks = m_nCurrentFrameBufferBlock % GetInfo(APE_INFO_BLOCKS_PER_FRAME);
101 + int nFrameBlocksLeft = nFrameBlocks - nFrameOffsetBlocks;
102 +- int nBlocksThisPass = min(nFrameBlocksLeft, nBlocksLeft);
103 ++ int nBlocksThisPass = min_macro(nFrameBlocksLeft, nBlocksLeft);
104 +
105 + // start the frame if we need to
106 + if (nFrameOffsetBlocks == 0)
107 +diff -Naur monkeys-audio-4.11-u4-b5-s7_old/src/MACLib/APESimple.cpp monkeys-audio-4.11-u4-b5-s7/src/MACLib/APESimple.cpp
108 +--- monkeys-audio-4.11-u4-b5-s7_old/src/MACLib/APESimple.cpp 2017-03-04 17:07:21.952460418 +0100
109 ++++ monkeys-audio-4.11-u4-b5-s7/src/MACLib/APESimple.cpp 2017-03-04 17:17:41.695435707 +0100
110 +@@ -251,7 +251,7 @@
111 + nBytesRead = 1;
112 + while ((nBytesLeft > 0) && (nBytesRead > 0))
113 + {
114 +- int nBytesToRead = min(16384, nBytesLeft);
115 ++ int nBytesToRead = min_macro(16384, nBytesLeft);
116 + if (pIO->Read(spBuffer, nBytesToRead, &nBytesRead) != ERROR_SUCCESS)
117 + return ERROR_IO_READ;
118 +
119 +diff -Naur monkeys-audio-4.11-u4-b5-s7_old/src/MACLib/APETag.cpp monkeys-audio-4.11-u4-b5-s7/src/MACLib/APETag.cpp
120 +--- monkeys-audio-4.11-u4-b5-s7_old/src/MACLib/APETag.cpp 2017-03-04 17:07:21.952460418 +0100
121 ++++ monkeys-audio-4.11-u4-b5-s7/src/MACLib/APETag.cpp 2017-03-04 17:18:15.007434379 +0100
122 +@@ -15,7 +15,7 @@
123 + memcpy(m_spFieldNameUTF16, pFieldName, (wcslen(pFieldName) + 1) * sizeof(str_utf16));
124 +
125 + // data (we'll always allocate two extra bytes and memset to 0 so we're safely NULL terminated)
126 +- m_nFieldValueBytes = max(nFieldBytes, 0);
127 ++ m_nFieldValueBytes = max_macro(nFieldBytes, 0);
128 + m_spFieldValue.Assign(new char [m_nFieldValueBytes + 2], TRUE);
129 + memset(m_spFieldValue, 0, m_nFieldValueBytes + 2);
130 + if (m_nFieldValueBytes > 0)
131 +diff -Naur monkeys-audio-4.11-u4-b5-s7_old/src/MACLib/BitArray.cpp monkeys-audio-4.11-u4-b5-s7/src/MACLib/BitArray.cpp
132 +--- monkeys-audio-4.11-u4-b5-s7_old/src/MACLib/BitArray.cpp 2017-03-04 17:07:21.952460418 +0100
133 ++++ monkeys-audio-4.11-u4-b5-s7/src/MACLib/BitArray.cpp 2017-03-04 17:19:12.647432081 +0100
134 +@@ -113,7 +113,7 @@
135 + m_nCurrentBitIndex = (m_nCurrentBitIndex & 31);
136 +
137 + // zero the rest of the memory (may not need the +1 because of frame byte alignment)
138 +- memset(&m_pBitArray[1], 0, min(nBytesToWrite + 1, BIT_ARRAY_BYTES - 1));
139 ++ memset(&m_pBitArray[1], 0, min_macro(nBytesToWrite + 1, BIT_ARRAY_BYTES - 1));
140 + }
141 +
142 + // return a success
143 +@@ -233,7 +233,7 @@
144 + nEncode = (nEncode > 0) ? nEncode * 2 - 1 : -nEncode * 2;
145 +
146 + // figure the pivot value
147 +- int nPivotValue = max(BitArrayState.nKSum / 32, 1);
148 ++ int nPivotValue = max_macro(BitArrayState.nKSum / 32, 1);
149 + int nOverflow = nEncode / nPivotValue;
150 + int nBase = nEncode - (nOverflow * nPivotValue);
151 +
152 +diff -Naur monkeys-audio-4.11-u4-b5-s7_old/src/MACLib/MACProgressHelper.cpp monkeys-audio-4.11-u4-b5-s7/src/MACLib/MACProgressHelper.cpp
153 +--- monkeys-audio-4.11-u4-b5-s7_old/src/MACLib/MACProgressHelper.cpp 2017-03-04 17:07:21.952460418 +0100
154 ++++ monkeys-audio-4.11-u4-b5-s7/src/MACLib/MACProgressHelper.cpp 2017-03-04 17:19:56.135430347 +0100
155 +@@ -27,7 +27,7 @@
156 + m_nCurrentStep = nCurrentStep;
157 +
158 + // figure the percentage done
159 +- float fPercentageDone = float(m_nCurrentStep) / float(max(m_nTotalSteps, 1));
160 ++ float fPercentageDone = float(m_nCurrentStep) / float(max_macro(m_nTotalSteps, 1));
161 + int nPercentageDone = (int) (fPercentageDone * 1000 * 100);
162 + if (nPercentageDone > 100000) nPercentageDone = 100000;
163 +
164 +diff -Naur monkeys-audio-4.11-u4-b5-s7_old/src/MACLib/Prepare.cpp monkeys-audio-4.11-u4-b5-s7/src/MACLib/Prepare.cpp
165 +--- monkeys-audio-4.11-u4-b5-s7_old/src/MACLib/Prepare.cpp 2017-03-04 17:07:21.952460418 +0100
166 ++++ monkeys-audio-4.11-u4-b5-s7/src/MACLib/Prepare.cpp 2017-03-04 17:20:42.423428501 +0100
167 +@@ -176,9 +176,9 @@
168 +
169 + if (LPeak == 0) { *pSpecialCodes |= SPECIAL_FRAME_LEFT_SILENCE; }
170 + if (RPeak == 0) { *pSpecialCodes |= SPECIAL_FRAME_RIGHT_SILENCE; }
171 +- if (max(LPeak, RPeak) > *pPeakLevel)
172 ++ if (max_macro(LPeak, RPeak) > *pPeakLevel)
173 + {
174 +- *pPeakLevel = max(LPeak, RPeak);
175 ++ *pPeakLevel = max_macro(LPeak, RPeak);
176 + }
177 +
178 + // check for pseudo-stereo files
179 +diff -Naur monkeys-audio-4.11-u4-b5-s7_old/src/MACLib/UnBitArray.cpp monkeys-audio-4.11-u4-b5-s7/src/MACLib/UnBitArray.cpp
180 +--- monkeys-audio-4.11-u4-b5-s7_old/src/MACLib/UnBitArray.cpp 2017-03-04 17:07:21.952460418 +0100
181 ++++ monkeys-audio-4.11-u4-b5-s7/src/MACLib/UnBitArray.cpp 2017-03-04 17:21:09.935427404 +0100
182 +@@ -116,7 +116,7 @@
183 + if (m_nVersion >= 3990)
184 + {
185 + // figure the pivot value
186 +- int nPivotValue = max(BitArrayState.nKSum / 32, 1);
187 ++ int nPivotValue = max_macro(BitArrayState.nKSum / 32, 1);
188 +
189 + // get the overflow
190 + int nOverflow = 0;
191 +diff -Naur monkeys-audio-4.11-u4-b5-s7_old/src/Shared/CircleBuffer.cpp monkeys-audio-4.11-u4-b5-s7/src/Shared/CircleBuffer.cpp
192 +--- monkeys-audio-4.11-u4-b5-s7_old/src/Shared/CircleBuffer.cpp 2017-03-04 17:07:21.951460418 +0100
193 ++++ monkeys-audio-4.11-u4-b5-s7/src/Shared/CircleBuffer.cpp 2017-03-04 17:10:47.775452211 +0100
194 +@@ -45,7 +45,7 @@
195 +
196 + if (pBuffer != NULL && nBytes > 0)
197 + {
198 +- int nHeadBytes = min(m_nEndCap - m_nHead, nBytes);
199 ++ int nHeadBytes = min_macro(m_nEndCap - m_nHead, nBytes);
200 + int nFrontBytes = nBytes - nHeadBytes;
201 +
202 + memcpy(&pBuffer[0], &m_pBuffer[m_nHead], nHeadBytes);
203 +@@ -72,7 +72,7 @@
204 +
205 + int CCircleBuffer::RemoveHead(int nBytes)
206 + {
207 +- nBytes = min(MaxGet(), nBytes);
208 ++ nBytes = min_macro(MaxGet(), nBytes);
209 + m_nHead += nBytes;
210 + if (m_nHead >= m_nEndCap)
211 + m_nHead -= m_nEndCap;
212 +@@ -81,7 +81,7 @@
213 +
214 + int CCircleBuffer::RemoveTail(int nBytes)
215 + {
216 +- nBytes = min(MaxGet(), nBytes);
217 ++ nBytes = min_macro(MaxGet(), nBytes);
218 + m_nTail -= nBytes;
219 + if (m_nTail < 0)
220 + m_nTail += m_nEndCap;
221 +diff -Naur monkeys-audio-4.11-u4-b5-s7_old/src/Shared/NoWindows.h monkeys-audio-4.11-u4-b5-s7/src/Shared/NoWindows.h
222 +--- monkeys-audio-4.11-u4-b5-s7_old/src/Shared/NoWindows.h 2017-03-04 17:07:21.951460418 +0100
223 ++++ monkeys-audio-4.11-u4-b5-s7/src/Shared/NoWindows.h 2017-03-04 17:07:58.376458966 +0100
224 +@@ -41,8 +41,8 @@
225 + typedef const wchar_t * LPCWSTR;
226 +
227 + #define ZeroMemory(POINTER, BYTES) memset(POINTER, 0, BYTES);
228 +-#define max(a,b) (((a) > (b)) ? (a) : (b))
229 +-#define min(a,b) (((a) < (b)) ? (a) : (b))
230 ++#define max_macro(a,b) (((a) > (b)) ? (a) : (b))
231 ++#define min_macro(a,b) (((a) < (b)) ? (a) : (b))
232 +
233 + #define __stdcall
234 + #define CALLBACK
235
236 diff --git a/media-sound/mac/files/mac-4.11.4.5.7-output.patch b/media-sound/mac/files/mac-4.11.4.5.7-output.patch
237 new file mode 100644
238 index 00000000000..f90c2c42fdd
239 --- /dev/null
240 +++ b/media-sound/mac/files/mac-4.11.4.5.7-output.patch
241 @@ -0,0 +1,27 @@
242 +--- a/src/Console/Console.cpp
243 ++++ b/src/Console/Console.cpp
244 +@@ -60,7 +60,7 @@ Displays the proper usage for MAC.exe
245 + ***************************************************************************************/
246 + void DisplayProperUsage(FILE * pFile)
247 + {
248 +- _ftprintf(pFile, _T("Proper Usage: [EXE] [Input File] [Output File] [Mode]\n\n"));
249 ++ _ftprintf(pFile, _T("Proper Usage: [Input File] [Output File] [Mode]\n\n"));
250 +
251 + _ftprintf(pFile, _T("Modes: \n"));
252 + _ftprintf(pFile, _T(" Compress (fast): '-c1000'\n"));
253 +@@ -76,11 +76,11 @@ void DisplayProperUsage(FILE * pFile)
254 + _ftprintf(pFile, _T(" Convert: '-nXXXX'\n\n"));
255 +
256 + _ftprintf(pFile, _T("Examples:\n"));
257 +- _ftprintf(pFile, _T(" Compress: mac.exe \"Metallica - One.wav\" \"Metallica - One.ape\" -c2000\n"));
258 +- _ftprintf(pFile, _T(" Decompress: mac.exe \"Metallica - One.ape\" \"Metallica - One.wav\" -d\n"));
259 +- _ftprintf(pFile, _T(" Verify: mac.exe \"Metallica - One.ape\" -v\n"));
260 ++ _ftprintf(pFile, _T(" Compress: mac \"Metallica - One.wav\" \"Metallica - One.ape\" -c2000\n"));
261 ++ _ftprintf(pFile, _T(" Decompress: mac \"Metallica - One.ape\" \"Metallica - One.wav\" -d\n"));
262 ++ _ftprintf(pFile, _T(" Verify: mac \"Metallica - One.ape\" -v\n"));
263 + #ifdef SHNTOOL
264 +- _ftprintf(pFile, _T(" Quick verify: mac.exe \"Metallica - One.ape\" -q\n"));
265 ++ _ftprintf(pFile, _T(" Quick verify: mac \"Metallica - One.ape\" -q\n"));
266 + #endif
267 + _ftprintf(pFile, _T(" (note: int filenames must be put inside of quotations)\n"));
268 + }
269
270 diff --git a/media-sound/mac/mac-4.11.4.5.7.ebuild b/media-sound/mac/mac-4.11.4.5.7.ebuild
271 new file mode 100644
272 index 00000000000..8b88eadc1f1
273 --- /dev/null
274 +++ b/media-sound/mac/mac-4.11.4.5.7.ebuild
275 @@ -0,0 +1,59 @@
276 +# Copyright 1999-2017 Gentoo Foundation
277 +# Distributed under the terms of the GNU General Public License v2
278 +
279 +EAPI=6
280 +
281 +inherit flag-o-matic versionator
282 +
283 +MY_PN=monkeys-audio
284 +MY_PV=$(version_format_string '$1.$2-u$3-b$4')
285 +PATCH=s$(get_version_component_range 5)
286 +MY_P=${MY_PN}_${MY_PV}-${PATCH}
287 +
288 +DESCRIPTION="Monkey's Audio Codecs"
289 +HOMEPAGE="http://etree.org/shnutils/shntool/ http://www.deb-multimedia.org/dists/testing/main/binary-amd64/package/monkeys-audio.php"
290 +SRC_URI="http://www.deb-multimedia.org/pool/main/m/monkeys-audio/${MY_P}.orig.tar.gz"
291 +
292 +LICENSE="mac"
293 +SLOT="0"
294 +KEYWORDS="~alpha ~amd64 ~ppc ~ppc64 ~x86"
295 +IUSE="cpu_flags_x86_mmx static-libs"
296 +
297 +RDEPEND=""
298 +DEPEND="sys-apps/sed
299 + cpu_flags_x86_mmx? ( dev-lang/yasm )"
300 +
301 +S=${WORKDIR}/${MY_P/_/-}
302 +
303 +PATCHES=(
304 + "${FILESDIR}"/${P}-output.patch
305 + "${FILESDIR}"/${P}-gcc6.patch
306 +)
307 +
308 +DOCS=( AUTHORS ChangeLog NEWS TODO README src/History.txt src/Credits.txt ChangeLog.shntool )
309 +
310 +RESTRICT="mirror"
311 +
312 +src_prepare() {
313 + default
314 +
315 + sed -i -e 's:-O3::' configure || die
316 +}
317 +
318 +src_configure() {
319 + append-cppflags -DSHNTOOL
320 + use cpu_flags_x86_mmx && append-ldflags -Wl,-z,noexecstack
321 +
322 + econf \
323 + $(use_enable static-libs static) \
324 + $(use_enable cpu_flags_x86_mmx assembly)
325 +}
326 +
327 +src_install() {
328 + default
329 +
330 + insinto /usr/include/${PN}
331 + doins src/MACLib/{BitArray,UnBitArrayBase,Prepare}.h #409435
332 +
333 + find "${D}" -name '*.la' -delete || die
334 +}