summaryrefslogtreecommitdiffstats
path: root/src/aubio-1-fixes.patch
blob: 84fb628c32e8649e5e9bb7ab770820c63e7f3244 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
This file is part of MXE. See LICENSE.md for licensing information.

Contains ad hoc patches for cross building.

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Paul Brossier <piem@piem.org>
Date: Tue, 5 Jan 2016 21:28:06 -0500
Subject: [PATCH] wscript: check HAVE_AV* from ctx.env

From https://github.com/aubio/aubio/commit/eb6899125ac83900710180c02b94bc593a1426d2

diff --git a/wscript b/wscript
index 1111111..2222222 100644
--- a/wscript
+++ b/wscript
@@ -226,7 +226,7 @@ def configure(ctx):
                 args = '--cflags --libs', uselib_store = 'AVUTIL', mandatory = False)
         ctx.check_cfg(package = 'libavresample', atleast_version = '1.0.1',
                 args = '--cflags --libs', uselib_store = 'AVRESAMPLE', mandatory = False)
-        if all ( 'HAVE_' + i in ctx.env.define_key
+        if all ( 'HAVE_' + i in ctx.env
                 for i in ['AVCODEC', 'AVFORMAT', 'AVUTIL', 'AVRESAMPLE'] ):
             ctx.define('HAVE_LIBAV', 1)
             ctx.msg('Checking for all libav libraries', 'yes')

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Timothy Gu <timothygu99@gmail.com>
Date: Tue, 5 Jan 2016 21:47:01 -0500
Subject: [PATCH] wscript: check more variables from ctx.env


diff --git a/wscript b/wscript
index 1111111..2222222 100644
--- a/wscript
+++ b/wscript
@@ -192,11 +192,11 @@ def configure(ctx):
         ctx.define('HAVE_FFTW3', 1)
 
     # fftw not enabled, use vDSP or ooura
-    if 'HAVE_FFTW3F' in ctx.env.define_key:
+    if 'HAVE_FFTW3F' in ctx.env:
         ctx.msg('Checking for FFT implementation', 'fftw3f')
-    elif 'HAVE_FFTW3' in ctx.env.define_key:
+    elif 'HAVE_FFTW3' in ctx.env:
         ctx.msg('Checking for FFT implementation', 'fftw3')
-    elif 'HAVE_ACCELERATE' in ctx.env.define_key:
+    elif 'HAVE_ACCELERATE' in ctx.env:
         ctx.msg('Checking for FFT implementation', 'vDSP')
     else:
         ctx.msg('Checking for FFT implementation', 'ooura')

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Timothy Gu <timothygu99@gmail.com>
Date: Tue, 5 Jan 2016 22:48:20 -0500
Subject: [PATCH] wscript: fftw3 support requires pthreads


diff --git a/wscript b/wscript
index 1111111..2222222 100644
--- a/wscript
+++ b/wscript
@@ -194,8 +194,10 @@ def configure(ctx):
     # fftw not enabled, use vDSP or ooura
     if 'HAVE_FFTW3F' in ctx.env:
         ctx.msg('Checking for FFT implementation', 'fftw3f')
+        ctx.env.LINKFLAGS += ['-pthread']
     elif 'HAVE_FFTW3' in ctx.env:
         ctx.msg('Checking for FFT implementation', 'fftw3')
+        ctx.env.LINKFLAGS += ['-pthread']
     elif 'HAVE_ACCELERATE' in ctx.env:
         ctx.msg('Checking for FFT implementation', 'vDSP')
     else:

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Timothy Gu <timothygu99@gmail.com>
Date: Tue, 5 Jan 2016 22:18:21 -0500
Subject: [PATCH] wscript: Install static library


diff --git a/src/wscript_build b/src/wscript_build
index 1111111..2222222 100644
--- a/src/wscript_build
+++ b/src/wscript_build
@@ -38,3 +38,7 @@ for target in build_features:
 ctx.install_files('${PREFIX}/include/aubio/',
         ctx.path.ant_glob('**/*.h', excl = ['**_priv.h', 'config.h']),
         relative_trick=True)
+
+# install static libs
+from waflib.Tools.c import cstlib
+cstlib.inst_to = '${LIBDIR}'

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Timothy Gu <timothygu99@gmail.com>
Date: Tue, 5 Jan 2016 21:15:37 -0500
Subject: [PATCH] Add options for enabling shared and/or static libraries


diff --git a/src/wscript_build b/src/wscript_build
index 1111111..2222222 100644
--- a/src/wscript_build
+++ b/src/wscript_build
@@ -18,13 +18,11 @@ ctx(features = 'c',
         lib = 'm',
         target = 'lib_objects')
 
-# build libaubio.so (cshlib) and/or libaubio.a (cstlib)
-if ctx.env['DEST_OS'] in ['ios', 'iosimulator']:
-    build_features = ['cstlib']
-elif ctx.env['DEST_OS'] in ['win32', 'win64']:
-    build_features = ['cshlib']
-else: #linux, darwin, android, mingw, ...
-    build_features = ['cshlib', 'cstlib']
+build_features = []
+if ctx.env.HAVE_SHARED:
+    build_features += ['cshlib']
+if ctx.env.HAVE_STATIC:
+    build_features += ['cstlib']
 
 for target in build_features:
     ctx(features = 'c ' + target,
diff --git a/wscript b/wscript
index 1111111..2222222 100644
--- a/wscript
+++ b/wscript
@@ -76,6 +76,13 @@ def options(ctx):
             help_str = 'build fat binaries (darwin only)',
             help_disable_str = 'do not build fat binaries (default)')
 
+    add_option_enable_disable(ctx, 'shared', default = True,
+            help_str = 'compile shared libraries (default)',
+            help_disable_str = 'do not compile shared library')
+    add_option_enable_disable(ctx, 'static', default = True,
+            help_str = 'compile static libraries (default)',
+            help_disable_str = 'do not compile static library')
+
     ctx.add_option('--with-target-platform', type='string',
             help='set target platform for cross-compilation', dest='target_platform')
 
@@ -99,7 +106,10 @@ def configure(ctx):
     else:
         ctx.env.CFLAGS += ['-Wall']
 
-    if target_platform not in ['win32', 'win64']:
+    ctx.env.HAVE_SHARED = int(ctx.options.enable_shared)
+    ctx.env.HAVE_STATIC = int(ctx.options.enable_static)
+
+    if not ctx.options.enable_shared and target_platform not in ['win32', 'win64']:
         ctx.env.CFLAGS += ['-fPIC']
     else:
         ctx.define('HAVE_WIN_HACKS', 1)

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Timothy Gu <timothygu99@gmail.com>
Date: Tue, 5 Jan 2016 21:25:46 -0500
Subject: [PATCH] Add static deps to pkgconfig file


diff --git a/aubio.pc.in b/aubio.pc.in
index 1111111..2222222 100644
--- a/aubio.pc.in
+++ b/aubio.pc.in
@@ -6,5 +6,7 @@ includedir=@includedir@
 Name: aubio
 Description: a library for audio labelling
 Version: @VERSION@
+Requires.private: @PCREQUIRES@
 Libs: -L${libdir} -laubio
+Libs.private: @PCLIBS@
 Cflags: -I${includedir} 
diff --git a/wscript b/wscript
index 1111111..2222222 100644
--- a/wscript
+++ b/wscript
@@ -183,6 +183,8 @@ def configure(ctx):
     if (ctx.options.enable_complex == True):
         ctx.check(header_name='complex.h')
 
+    pcrequires = []
+    pclibs = []
     # check for fftw3
     if (ctx.options.enable_fftw3 != False or ctx.options.enable_fftw3f != False):
         # one of fftwf or fftw3f
@@ -204,9 +206,13 @@ def configure(ctx):
     # fftw not enabled, use vDSP or ooura
     if 'HAVE_FFTW3F' in ctx.env:
         ctx.msg('Checking for FFT implementation', 'fftw3f')
+        pcrequires += ['fftw3f >= 3.0.0']
+        pclibs += ['-pthread']
         ctx.env.LINKFLAGS += ['-pthread']
     elif 'HAVE_FFTW3' in ctx.env:
         ctx.msg('Checking for FFT implementation', 'fftw3')
+        pcrequires += ['fftw3 >= 3.0.0']
+        pclibs += ['-pthread']
         ctx.env.LINKFLAGS += ['-pthread']
     elif 'HAVE_ACCELERATE' in ctx.env:
         ctx.msg('Checking for FFT implementation', 'vDSP')
@@ -217,16 +223,22 @@ def configure(ctx):
     if (ctx.options.enable_sndfile != False):
         ctx.check_cfg(package = 'sndfile', atleast_version = '1.0.4',
                 args = '--cflags --libs', mandatory = False)
+    if 'HAVE_SNDFILE' in ctx.env:
+        pcrequires += ['sndfile >= 1.0.4']
 
     # check for libsamplerate
     if (ctx.options.enable_samplerate != False):
         ctx.check_cfg(package = 'samplerate', atleast_version = '0.0.15',
                 args = '--cflags --libs', mandatory = False)
+    if 'HAVE_SAMPLERATE' in ctx.env:
+        pcrequires += ['samplerate >= 0.0.15']
 
     # check for jack
     if (ctx.options.enable_jack != False):
         ctx.check_cfg(package = 'jack',
                 args = '--cflags --libs', mandatory = False)
+    if 'HAVE_JACK' in ctx.env:
+        pcrequires += ['jack']
 
     # check for libav
     if (ctx.options.enable_avcodec != False):
@@ -242,9 +254,13 @@ def configure(ctx):
                 for i in ['AVCODEC', 'AVFORMAT', 'AVUTIL', 'AVRESAMPLE'] ):
             ctx.define('HAVE_LIBAV', 1)
             ctx.msg('Checking for all libav libraries', 'yes')
+            pcrequires += ['libavcodec >= 54.35.0', 'libavformat >= 52.3.0',
+                           'libavutil >= 52.3.0', 'libavresample >= 1.0.1']
         else:
             ctx.msg('Checking for all libav libraries', 'not found', color = 'YELLOW')
 
+    ctx.env.PCREQUIRES = ', '.join(pcrequires)
+    ctx.env.PCLIBS = ', '.join(pclibs)
     ctx.define('HAVE_WAVREAD', 1)
     ctx.define('HAVE_WAVWRITE', 1)
 

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Timothy Gu <timothygu99@gmail.com>
Date: Tue, 5 Jan 2016 21:27:05 -0500
Subject: [PATCH] [MXE] disable tests and examples


diff --git a/wscript b/wscript
index 1111111..2222222 100644
--- a/wscript
+++ b/wscript
@@ -297,9 +297,9 @@ def build(bld):
     bld.recurse('src')
     if bld.env['DEST_OS'] not in ['ios', 'iosimulator']:
         pass
-    if bld.env['DEST_OS'] not in ['ios', 'iosimulator', 'android']:
-        bld.recurse('examples')
-        bld.recurse('tests')
+    #if bld.env['DEST_OS'] not in ['ios', 'iosimulator', 'android']:
+    #    bld.recurse('examples')
+    #    bld.recurse('tests')
 
     bld( source = 'aubio.pc.in' )