Gentoo Archives: gentoo-commits

From: Lars Wendler <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-sound/audacity/files/, media-sound/audacity/
Date: Wed, 21 Feb 2018 11:09:03
Message-Id: 1519211330.18dbd4fcf1bca48ad8b368346bfe73e2f2f40f02.polynomial-c@gentoo
1 commit: 18dbd4fcf1bca48ad8b368346bfe73e2f2f40f02
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Wed Feb 21 10:42:32 2018 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Wed Feb 21 11:08:50 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=18dbd4fc
7
8 media-sound/audacity: Fixed compilation with USE="-midi"
9
10 Thanks to Matt Whitlock for providing the initial patch.
11
12 Closes: https://bugs.gentoo.org/637110
13 Package-Manager: Portage-2.3.24, Repoman-2.3.6
14
15 media-sound/audacity/audacity-2.2.2.ebuild | 8 +
16 .../audacity/files/audacity-2.2.2-midi.patch | 168 +++++++++++++++++++++
17 2 files changed, 176 insertions(+)
18
19 diff --git a/media-sound/audacity/audacity-2.2.2.ebuild b/media-sound/audacity/audacity-2.2.2.ebuild
20 index af62f464499..cb2b8ea861f 100644
21 --- a/media-sound/audacity/audacity-2.2.2.ebuild
22 +++ b/media-sound/audacity/audacity-2.2.2.ebuild
23 @@ -49,6 +49,14 @@ REQUIRED_USE="soundtouch? ( midi )"
24
25 S="${WORKDIR}/${MY_P}-rc1"
26
27 +PATCHES=(
28 + "${FILESDIR}/${PN}-2.2.2-midi.patch"
29 +)
30 +
31 +src_prepare() {
32 + epatch "${PATCHES[@]}"
33 +}
34 +
35 src_configure() {
36 local WX_GTK_VER="3.0"
37 need-wxwidgets unicode
38
39 diff --git a/media-sound/audacity/files/audacity-2.2.2-midi.patch b/media-sound/audacity/files/audacity-2.2.2-midi.patch
40 new file mode 100644
41 index 00000000000..10a0f1f6eb0
42 --- /dev/null
43 +++ b/media-sound/audacity/files/audacity-2.2.2-midi.patch
44 @@ -0,0 +1,168 @@
45 +https://bugs.gentoo.org/637110
46 +
47 +Original patch by Matt Whitlock
48 +Forward-ported from version 2.2.0 to 2.2.2
49 +
50 +--- audacity-minsrc-2.2.2-rc1/src/AudioIO.cpp
51 ++++ audacity-minsrc-2.2.2-rc1/src/AudioIO.cpp
52 +@@ -976,6 +976,7 @@
53 + };
54 + #endif
55 +
56 ++#ifdef EXPERIMENTAL_MIDI_OUT
57 + // return the system time as a double
58 + static double streamStartTime = 0; // bias system time to small number
59 +
60 +@@ -995,6 +996,7 @@
61 +
62 + return PaUtil_GetTime() - streamStartTime;
63 + }
64 ++#endif
65 +
66 + const int AudioIO::StandardRates[] = {
67 + 8000,
68 +@@ -1803,6 +1805,7 @@
69 + }
70 + #endif
71 +
72 ++#ifdef EXPERIMENTAL_MIDI_OUT
73 + // We use audio latency to estimate how far ahead of DACS we are writing
74 + if (mPortStreamV19 != NULL && mLastPaError == paNoError) {
75 + const PaStreamInfo* info = Pa_GetStreamInfo(mPortStreamV19);
76 +@@ -1811,6 +1814,7 @@
77 + mAudioOutLatency = info->outputLatency;
78 + mSystemMinusAudioTimePlusLatency += mAudioOutLatency;
79 + }
80 ++#endif
81 +
82 + return (mLastPaError == paNoError);
83 + }
84 +@@ -1955,8 +1959,10 @@
85 +
86 + double playbackTime = 4.0;
87 +
88 ++#ifdef EXPERIMENTAL_MIDI_OUT
89 + streamStartTime = 0;
90 + streamStartTime = SystemTime(mUsingAlsa);
91 ++#endif
92 +
93 + #ifdef EXPERIMENTAL_SCRUBBING_SUPPORT
94 + bool scrubbing = (options.pScrubbingOptions != nullptr);
95 +@@ -2830,7 +2836,9 @@
96 +
97 + mPlaybackTracks.clear();
98 + mCaptureTracks.clear();
99 ++#ifdef HAVE_MIDI
100 + mMidiPlaybackTracks.clear();
101 ++#endif
102 +
103 + #ifdef EXPERIMENTAL_SCRUBBING_SUPPORT
104 + mScrubQueue.reset();
105 +@@ -4669,13 +4677,13 @@
106 + (float *)alloca(framesPerBuffer*numPlaybackChannels * sizeof(float)) :
107 + (float *)outputBuffer;
108 +
109 ++#ifdef EXPERIMENTAL_MIDI_OUT
110 + if (gAudioIO->mCallbackCount++ == 0) {
111 + // This is effectively mSystemMinusAudioTime when the buffer is empty:
112 + gAudioIO->mStartTime = SystemTime(gAudioIO->mUsingAlsa) - gAudioIO->mT0;
113 + // later, mStartTime - mSystemMinusAudioTime will tell us latency
114 + }
115 +
116 +-#ifdef EXPERIMENTAL_MIDI_OUT
117 + /* GSW: Save timeInfo in case MidiPlayback needs it */
118 + gAudioIO->mAudioCallbackClockTime = PaUtil_GetTime();
119 +
120 +@@ -5051,7 +5059,9 @@
121 + : gAudioIO->mTime >= gAudioIO->mT1))
122 + // PRL: singalling MIDI output complete is necessary if
123 + // not USE_MIDI_THREAD, otherwise it's harmlessly redundant
124 ++#ifdef EXPERIMENTAL_MIDI_OUT
125 + gAudioIO->mMidiOutputComplete = true,
126 ++#endif
127 + callbackReturn = paComplete;
128 + }
129 +
130 +@@ -5114,7 +5124,9 @@
131 +
132 + // PRL: singalling MIDI output complete is necessary if
133 + // not USE_MIDI_THREAD, otherwise it's harmlessly redundant
134 ++#ifdef EXPERIMENTAL_MIDI_OUT
135 + gAudioIO->mMidiOutputComplete = true,
136 ++#endif
137 + callbackReturn = paComplete;
138 + }
139 + }
140 +--- audacity-minsrc-2.2.2-rc1/src/Project.cpp
141 ++++ audacity-minsrc-2.2.2-rc1/src/Project.cpp
142 +@@ -460,10 +460,11 @@
143 + } );
144 +
145 + for (const auto &name : sortednames) {
146 +-
147 ++#ifdef USE_MIDI
148 + if (Importer::IsMidi(name))
149 + AudacityProject::DoImportMIDI(mProject, name);
150 + else
151 ++#endif
152 + mProject->Import(name);
153 + }
154 +
155 +@@ -3046,9 +3047,11 @@
156 + #endif
157 +
158 + {
159 ++#ifdef USE_MIDI
160 + if (Importer::IsMidi(fileName))
161 + DoImportMIDI(this, fileName);
162 + else
163 ++#endif
164 + Import(fileName);
165 +
166 + ZoomAfterImport(nullptr);
167 +--- audacity-minsrc-2.2.2-rc1/src/tracks/playabletrack/notetrack/ui/NoteTrackButtonHandle.cpp
168 ++++ audacity-minsrc-2.2.2-rc1/src/tracks/playabletrack/notetrack/ui/NoteTrackButtonHandle.cpp
169 +@@ -9,6 +9,9 @@
170 + **********************************************************************/
171 +
172 + #include "../../../../Audacity.h"
173 ++
174 ++#ifdef USE_MIDI
175 ++
176 + #include "NoteTrackButtonHandle.h"
177 +
178 + #include "../../../../HitTestResult.h"
179 +@@ -113,3 +116,4 @@
180 + return RefreshCode::RefreshNone;
181 + }
182 +
183 ++#endif
184 +--- audacity-minsrc-2.2.2-rc1/src/tracks/playabletrack/notetrack/ui/NoteTrackVZoomHandle.cpp
185 ++++ audacity-minsrc-2.2.2-rc1/src/tracks/playabletrack/notetrack/ui/NoteTrackVZoomHandle.cpp
186 +@@ -9,6 +9,9 @@
187 + **********************************************************************/
188 +
189 + #include "../../../../Audacity.h"
190 ++
191 ++#ifdef USE_MIDI
192 ++
193 + #include "NoteTrackVZoomHandle.h"
194 + #include "../../../../Experimental.h"
195 + #include "NoteTrackVRulerControls.h"
196 +@@ -332,3 +335,5 @@
197 + TrackVRulerControls::DrawZooming
198 + ( dc, mRect, panelRect, mZoomStart, mZoomEnd );
199 + }
200 ++
201 ++#endif
202 +--- audacity-minsrc-2.2.2-rc1/src/tracks/ui/TimeShiftHandle.cpp
203 ++++ audacity-minsrc-2.2.2-rc1/src/tracks/ui/TimeShiftHandle.cpp
204 +@@ -604,7 +604,7 @@
205 + {
206 + trySnap = true;
207 + if (pTrack->GetKind() == Track::Wave) {
208 +- auto wt = static_cast<const WaveTrack *>(pTrack);
209 ++ auto wt = static_cast<const WaveTrack *>(pTrack.get());
210 + const double rate = wt->GetRate();
211 + // set it to a sample point
212 + desiredSlideAmount = rint(desiredSlideAmount * rate) / rate;