-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
523 lines (447 loc) · 16.9 KB
/
Dockerfile
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
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
FROM ubuntu
MAINTAINER Wincent Balin <[email protected]>
# Update all packages
RUN DEBIAN_FRONTEND=noninteractive \
apt-get update && \
apt-get -y upgrade && \
apt-get -y clean && \
apt-get -y autoremove
# Install compilation prerequisites
RUN DEBIAN_FRONTEND=noninteractive \
apt-get install -y \
build-essential \
mingw-w64 \
gperf \
pkg-config \
cmake \
python \
python-lxml \
man \
wget \
unzip \
zip \
less && \
apt-get -y clean
# Enter versions!!!
ENV LIBICONV_VERSION 1.15
ENV ZLIB_VERSION 1.2.11
ENV LIBMAD_VERSION 0.15.1b
ENV LIBID3TAG_VERSION 0.15.1b
ENV LIBOGG_VERSION 1.3.4
ENV LIBVORBIS_VERSION 1.3.6
ENV FLAC_VERSION 1.3.3
ENV LIBSNDFILE_VERSION 1.0.28
ENV LIBPNG_VERSION 1.6.37
ENV JPEG_VERSION 9c
ENV JBIGKIT_VERSION 2.1
ENV TIFF_VERSION 4.0.10
ENV LIBWEBP_VERSION 1.0.3
ENV LIQ_VERSION 2.11.9
ENV FREETYPE2_VERSION 2.10.1
ENV EXPAT_VERSION 2.2.8
ENV EXPAT_VERSION_MANGLED 2_2_8
ENV FONTCONFIG_VERSION 2.13.92
ENV LIBGD_VERSION 2.2.5
ENV BOOST_VERSION 1.65.1
ENV BOOST_VERSION_MANGLED 1_65_1
ENV AUDIOWAVEFORM_VERSION master
# Prepare compilation directories
ENV C /tmp/compile
WORKDIR ${C}
ENV BOOST_BUILD_PATH ${C}/boost-build
# Set environment variables
ENV PATH ${C}/lib:$PATH
ENV PATH ${C}/bin:$PATH
ENV LD_RUN_PATH ${C}/lib:${LD_RUN_PATH}
# Compile for Win32
ENV CROSS_ARCH i686-w64-mingw32
ENV BUILD_ARCH x86_64-pc-linux-gnu
# Create pkg-config
WORKDIR bin
COPY pkg-config .
RUN chmod 0755 pkg-config && \
mv pkg-config ${CROSS_ARCH}-pkg-config
WORKDIR ..
# Download and compile libiconv
RUN wget -q -O - ftp://ftp.gnu.org/gnu/libiconv/libiconv-${LIBICONV_VERSION}.tar.gz | \
tar zxvf -
WORKDIR libiconv-${LIBICONV_VERSION}
RUN ./configure --prefix=${C} --host=${CROSS_ARCH} --build=${BUILD_ARCH} --disable-shared --enable-static && \
make && \
make install
WORKDIR ..
# Download and compile zlib
RUN wget -q -O - http://sourceforge.net/projects/libpng/files/zlib/${ZLIB_VERSION}/zlib-${ZLIB_VERSION}.tar.gz | \
tar zxvf -
WORKDIR zlib-${ZLIB_VERSION}
RUN CC=${CROSS_ARCH}-gcc ./configure --prefix ${C} --static && \
make && \
make install
WORKDIR ..
# Download and compile libmad
RUN wget -q -O - http://sourceforge.net/projects/mad/files/libmad/${LIBMAD_VERSION}/libmad-${LIBMAD_VERSION}.tar.gz | \
tar zxvf -
WORKDIR libmad-${LIBMAD_VERSION}
RUN ./configure --prefix=${C} --host=${CROSS_ARCH} --build=${BUILD_ARCH} --enable-static --disable-shared CFLAGS="-I${C}/include -L${C}/lib" && \
make && \
make install
WORKDIR ..
# Download and compile libid3tag
RUN wget -q -O - http://sourceforge.net/projects/mad/files/libid3tag/${LIBID3TAG_VERSION}/libid3tag-${LIBID3TAG_VERSION}.tar.gz | \
tar zxvf -
WORKDIR libid3tag-${LIBID3TAG_VERSION}
RUN ./configure --prefix=${C} --host=${CROSS_ARCH} --build=${BUILD_ARCH} --enable-static --disable-shared CFLAGS="-I${C}/include -L${C}/lib" && \
make && \
make install
WORKDIR ..
# Download and compile libogg
RUN wget -q -O - http://downloads.xiph.org/releases/ogg/libogg-${LIBOGG_VERSION}.tar.gz | \
tar zxvf -
WORKDIR libogg-${LIBOGG_VERSION}
RUN ./configure --prefix=${C} --host=${CROSS_ARCH} --build=${BUILD_ARCH} --enable-static --disable-shared CFLAGS="-I${C}/include -L${C}/lib" && \
make && \
make install
WORKDIR ..
# Download and compile libvorbis
RUN wget -q -O - http://downloads.xiph.org/releases/vorbis/libvorbis-${LIBVORBIS_VERSION}.tar.gz | \
tar zxvf -
WORKDIR libvorbis-${LIBVORBIS_VERSION}
RUN ./configure --prefix=${C} --host=${CROSS_ARCH} --build=${BUILD_ARCH} --enable-static --disable-shared CFLAGS="-I${C}/include -L${C}/lib" && \
make && \
make install
WORKDIR ..
# Download and compile FLAC
RUN wget -q -O - http://downloads.xiph.org/releases/flac/flac-${FLAC_VERSION}.tar.xz | \
tar Jxvf -
WORKDIR flac-${FLAC_VERSION}
RUN ./configure --prefix=${C} --host=${CROSS_ARCH} --build=${BUILD_ARCH} --enable-static --disable-shared CFLAGS="-I${C}/include -L${C}/lib" --disable-doxygen-docs && \
make && \
make install
WORKDIR ..
# Download and compile libsndfile
RUN wget -q -O - http://www.mega-nerd.com/libsndfile/files/libsndfile-${LIBSNDFILE_VERSION}.tar.gz | \
tar zxvf -
WORKDIR libsndfile-${LIBSNDFILE_VERSION}
RUN ./configure --prefix=${C} --host=${CROSS_ARCH} --build=${BUILD_ARCH} --enable-static --disable-shared CFLAGS="-I${C}/include -L${C}/lib" --disable-sqlite && \
make && \
make install
WORKDIR ..
ENV SNDFILE_CFLAGS "-I${C}/include"
ENV SNDFILE_LIBS "-L${C}/lib -lFLAC -lvorbisenc -lvorbis -lm -logg -lsndfile"
# Download and compile libpng
RUN wget -q -O - http://sourceforge.net/projects/libpng/files/libpng16/${LIBPNG_VERSION}/libpng-${LIBPNG_VERSION}.tar.gz | \
tar zxvf -
WORKDIR libpng-${LIBPNG_VERSION}
RUN ./configure --prefix=${C} --host=${CROSS_ARCH} --build=${BUILD_ARCH} --enable-static --disable-shared CFLAGS="-I${C}/include -L${C}/lib" CPPFLAGS="-I${C}/include" && \
make && \
make install
WORKDIR ..
# Download and compile jpeg
#RUN wget -q -O - http://www.ijg.org/files/jpegsrc.v${JPEG_VERSION}.tar.gz | \
# tar zxvf -
#WORKDIR jpeg-${JPEG_VERSION}
#RUN ./configure --prefix=${C} --host=${CROSS_ARCH} --build=${BUILD_ARCH} --enable-static --disable-shared && \
# make && \
# make install
#WORKDIR ..
# Download and compile tiff
#RUN wget -q -O - http://www.cl.cam.ac.uk/~mgk25/jbigkit/download/jbigkit-${JBIGKIT_VERSION}.tar.gz | \
# tar zxvf -
#WORKDIR jbigkit-${JBIGKIT_VERSION}/libjbig
#RUN make CC=${CROSS_ARCH}-gcc && \
# cp *.a ${C}/lib && \
# cp *.h ${C}/include
#WORKDIR ../..
# Download and compile tiff
#RUN wget -q -O - ftp://download.osgeo.org/libtiff/tiff-${TIFF_VERSION}.tar.gz | \
# tar zxvf -
#WORKDIR tiff-${TIFF_VERSION}
#RUN CPPFLAGS="-I${C}/include -L${C}/lib" LDFLAGS="-L${C}/lib" ./configure --prefix=${C} --host=${CROSS_ARCH} --build=${BUILD_ARCH} --enable-static --disable-shared && \
# make && \
# make install
#WORKDIR ..
# Download and compile libwebp
#RUN wget -q -O - https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-${LIBWEBP_VERSION}.tar.gz | \
# tar zxvf -
#WORKDIR libwebp-${LIBWEBP_VERSION}
#RUN sed -ie 's/LIBPNG_CONFIG --ldflags/LIBPNG_CONFIG --static --ldflags/' configure && \
# CPPFLAGS="-I${C}/include -L${C}/lib" ./configure --prefix=${C} --host=${CROSS_ARCH} --build=${BUILD_ARCH} --enable-static --disable-shared --enable-libwebpmux --enable-libwebpdemux --enable-libwebpdecoder && \
# make && \
# make install
#WORKDIR ..
# Download and compile liq (libimagequant)
RUN wget -q -O - https://github.com/ImageOptim/libimagequant/archive/${LIQ_VERSION}.tar.gz | \
tar zxvf -
WORKDIR libimagequant-${LIQ_VERSION}
RUN make CC=${CROSS_ARCH}-gcc static && \
${CROSS_ARCH}-ranlib libimagequant.a && \
cp libimagequant.h ${C}/include && \
cp libimagequant.a ${C}/lib
WORKDIR ..
# Download and compile freetype
RUN wget -q -O - https://sourceforge.net/projects/freetype/files/freetype2/${FREETYPE2_VERSION}/freetype-${FREETYPE2_VERSION}.tar.gz | \
tar zxvf -
WORKDIR freetype-${FREETYPE2_VERSION}
RUN ./configure --prefix=${C} --host=${CROSS_ARCH} --build=${BUILD_ARCH} --enable-static --disable-shared && \
make && \
make install
WORKDIR ..
# Download and compile expat
RUN wget -q -O - https://github.com/libexpat/libexpat/releases/download/R_${EXPAT_VERSION_MANGLED}/expat-${EXPAT_VERSION}.tar.bz2 | \
tar jxvf -
WORKDIR expat-${EXPAT_VERSION}
RUN ./configure --prefix=${C} --host=${CROSS_ARCH} --build=${BUILD_ARCH} --enable-static --disable-shared --without-xmlwf && \
make && \
make install
WORKDIR ..
# Download and compile fontconfig
RUN wget -q -O - https://www.freedesktop.org/software/fontconfig/release/fontconfig-${FONTCONFIG_VERSION}.tar.gz | \
tar zxvf -
WORKDIR fontconfig-${FONTCONFIG_VERSION}
RUN ./configure --prefix=${C} --host=${CROSS_ARCH} --build=${BUILD_ARCH} --enable-static --disable-shared && \
make && \
make install
WORKDIR ..
# Download and compile libgd
RUN wget -q -O - https://github.com/libgd/libgd/releases/download/gd-${LIBGD_VERSION}/libgd-${LIBGD_VERSION}.tar.gz | \
tar zxvf -
WORKDIR libgd-${LIBGD_VERSION}
# Defines and sed command taken from https://github.com/mxe/mxe/blob/master/src/gd.mk
RUN sed -i 's,-I@includedir@,-I@includedir@ -DNONDLL -DBGDWIN32,' 'config/gdlib-config.in' && \
CFLAGS="-DNONDLL" ./configure --prefix=${C} --host=${CROSS_ARCH} --build=${BUILD_ARCH} --enable-static --disable-shared && \
make && \
make install
WORKDIR ..
# Download and compile boost
RUN wget -q -O - https://sourceforge.net/projects/boost/files/boost/${BOOST_VERSION}/boost_${BOOST_VERSION_MANGLED}.tar.gz | \
tar zxvf -
WORKDIR ${BOOST_BUILD_PATH}
RUN echo "using gcc : mingw : ${CROSS_ARCH}-g++ ;" > user-config.jam
WORKDIR ..
WORKDIR boost_${BOOST_VERSION_MANGLED}
RUN ./bootstrap.sh && \
./b2 install --prefix=${C} toolset=gcc-mingw target-os=windows --with-filesystem --with-program_options --with-regex variant=release link=static runtime-link=static
WORKDIR ..
# Download and compile audiowaveform
RUN wget -q -O - https://github.com/bbc/audiowaveform/archive/${AUDIOWAVEFORM_VERSION}.tar.gz | \
tar zxvf -
WORKDIR audiowaveform-${AUDIOWAVEFORM_VERSION}
COPY audiowaveform-mingw.patch .
RUN patch -p0 < audiowaveform-mingw.patch
WORKDIR build
COPY ${CROSS_ARCH}.cmake .
RUN cmake -DCMAKE_TOOLCHAIN_FILE=${C}/audiowaveform-${AUDIOWAVEFORM_VERSION}/build/${CROSS_ARCH}.cmake -DCMAKE_INSTALL_PREFIX=${C} -DENABLE_TESTS=0 -DCMAKE_CXX_FLAGS_RELEASE="-O3 -DNDEBUG -DBGDWIN32 -static-libgcc -static-libstdc++ -static" -DCMAKE_FIND_LIBRARY_SUFFIXES=".a" -DEXTRA_LIBS="-L${C}/lib -lFLAC -lvorbisenc -lvorbis -logg -lpng -lz" .. && \
make && \
make install
WORKDIR ../..
# Strip binaries
RUN $CROSS_ARCH-strip bin/*.exe
# Create mingw32 archive
RUN zip -r -9 audiowaveform-mingw32.zip bin/ etc/ include/ lib/ share/
# Clean up everything
RUN rm -rf bin/ etc/ include/ lib/ share/
WORKDIR libiconv-${LIBICONV_VERSION}
RUN make distclean
WORKDIR ..
WORKDIR zlib-${ZLIB_VERSION}
RUN make distclean
WORKDIR ..
WORKDIR libmad-${LIBMAD_VERSION}
RUN make distclean
WORKDIR ..
WORKDIR libid3tag-${LIBID3TAG_VERSION}
RUN make distclean
WORKDIR ..
WORKDIR libogg-${LIBOGG_VERSION}
RUN make distclean
WORKDIR ..
WORKDIR libvorbis-${LIBVORBIS_VERSION}
RUN make distclean
WORKDIR ..
WORKDIR flac-${FLAC_VERSION}
RUN make distclean
WORKDIR ..
WORKDIR libsndfile-${LIBSNDFILE_VERSION}
RUN make distclean
WORKDIR ..
WORKDIR libpng-${LIBPNG_VERSION}
RUN make distclean
WORKDIR ..
#WORKDIR jpeg-${JPEG_VERSION}
#RUN make distclean
#WORKDIR ..
#WORKDIR jbigkit-${JBIGKIT_VERSION}/libjbig
#RUN make distclean
#WORKDIR ../..
#WORKDIR tiff-${TIFF_VERSION}
#RUN make distclean
#WORKDIR ..
#WORKDIR libwebp-${LIBWEBP_VERSION}
#RUN make distclean
#WORKDIR ..
WORKDIR libimagequant-${LIQ_VERSION}
RUN make distclean
WORKDIR ..
WORKDIR freetype-${FREETYPE2_VERSION}
RUN make distclean
WORKDIR ..
WORKDIR expat-${EXPAT_VERSION}
RUN make distclean
WORKDIR ..
WORKDIR fontconfig-${FONTCONFIG_VERSION}
RUN make distclean
WORKDIR ..
WORKDIR libgd-${LIBGD_VERSION}
RUN make distclean
WORKDIR ..
WORKDIR boost_${BOOST_VERSION_MANGLED}
RUN ./b2 install --prefix=${C} toolset=gcc-mingw target-os=windows --with-filesystem --with-program_options --with-regex variant=release link=static runtime-link=static --clean && \
rm -r bin.v2
WORKDIR ..
WORKDIR audiowaveform-${AUDIOWAVEFORM_VERSION}
WORKDIR build
RUN make clean
WORKDIR ..
RUN rm -r build
WORKDIR ..
# Compile for Win64
ENV CROSS_ARCH x86_64-w64-mingw32
ENV BUILD_ARCH x86_64-pc-linux-gnu
# Create pkg-config
WORKDIR bin
COPY pkg-config .
RUN chmod 0755 pkg-config && \
mv pkg-config ${CROSS_ARCH}-pkg-config
WORKDIR ..
# Compile libiconv
WORKDIR libiconv-${LIBICONV_VERSION}
RUN ./configure --prefix=${C} --host=${CROSS_ARCH} --build=${BUILD_ARCH} --disable-shared --enable-static && \
make && \
make install
WORKDIR ..
# Compile zlib
WORKDIR zlib-${ZLIB_VERSION}
RUN CC=${CROSS_ARCH}-gcc ./configure --prefix ${C} --static && \
make && \
make install
WORKDIR ..
# Compile libmad
WORKDIR libmad-${LIBMAD_VERSION}
RUN ./configure --prefix=${C} --host=${CROSS_ARCH} --build=${BUILD_ARCH} --enable-static --disable-shared CFLAGS="-I${C}/include -L${C}/lib" && \
make && \
make install
WORKDIR ..
# Compile libid3tag
WORKDIR libid3tag-${LIBID3TAG_VERSION}
RUN ./configure --prefix=${C} --host=${CROSS_ARCH} --build=${BUILD_ARCH} --enable-static --disable-shared CFLAGS="-I${C}/include -L${C}/lib" && \
make && \
make install
WORKDIR ..
# Compile libogg
WORKDIR libogg-${LIBOGG_VERSION}
RUN ./configure --prefix=${C} --host=${CROSS_ARCH} --build=${BUILD_ARCH} --enable-static --disable-shared CFLAGS="-I${C}/include -L${C}/lib" && \
make && \
make install
WORKDIR ..
# Compile libvorbis
WORKDIR libvorbis-${LIBVORBIS_VERSION}
RUN ./configure --prefix=${C} --host=${CROSS_ARCH} --build=${BUILD_ARCH} --enable-static --disable-shared CFLAGS="-I${C}/include -L${C}/lib" && \
make && \
make install
WORKDIR ..
# Compile FLAC
WORKDIR flac-${FLAC_VERSION}
RUN ./configure --prefix=${C} --host=${CROSS_ARCH} --build=${BUILD_ARCH} --enable-static --disable-shared CFLAGS="-I${C}/include -L${C}/lib" --disable-doxygen-docs && \
make && \
make install
WORKDIR ..
# Compile libsndfile
WORKDIR libsndfile-${LIBSNDFILE_VERSION}
RUN ./configure --prefix=${C} --host=${CROSS_ARCH} --build=${BUILD_ARCH} --enable-static --disable-shared CFLAGS="-I${C}/include -L${C}/lib" --disable-sqlite && \
make && \
make install
WORKDIR ..
ENV SNDFILE_CFLAGS "-I${C}/include"
ENV SNDFILE_LIBS "-L${C}/lib -lFLAC -lvorbisenc -lvorbis -lm -logg -lsndfile"
# Compile libpng
WORKDIR libpng-${LIBPNG_VERSION}
RUN ./configure --prefix=${C} --host=${CROSS_ARCH} --build=${BUILD_ARCH} --enable-static --disable-shared CFLAGS="-I${C}/include -L${C}/lib" CPPFLAGS="-I${C}/include" && \
make && \
make install
WORKDIR ..
# Compile jpeg
#WORKDIR jpeg-${JPEG_VERSION}
#RUN ./configure --prefix=${C} --host=${CROSS_ARCH} --build=${BUILD_ARCH} --enable-static --disable-shared && \
# make && \
# make install
#WORKDIR ..
# Compile tiff
#WORKDIR jbigkit-${JBIGKIT_VERSION}/libjbig
#RUN make CC=${CROSS_ARCH}-gcc && \
# cp *.a ${C}/lib && \
# cp *.h ${C}/include
#WORKDIR ../..
# Compile tiff
#WORKDIR tiff-${TIFF_VERSION}
#RUN CPPFLAGS="-I${C}/include -L${C}/lib" LDFLAGS="-L${C}/lib" ./configure --prefix=${C} --host=${CROSS_ARCH} --build=${BUILD_ARCH} --enable-static --disable-shared && \
# make && \
# make install
#WORKDIR ..
# Compile libwebp
#WORKDIR libwebp-${LIBWEBP_VERSION}
#RUN CPPFLAGS="-I${C}/include -L${C}/lib" ./configure --prefix=${C} --host=${CROSS_ARCH} --build=${BUILD_ARCH} --enable-static --disable-shared --enable-libwebpmux --enable-libwebpdemux --enable-libwebpdecoder && \
# make && \
# make install
#WORKDIR ..
# Compile liq (libimagequant)
WORKDIR libimagequant-${LIQ_VERSION}
RUN make CC=${CROSS_ARCH}-gcc static && \
${CROSS_ARCH}-ranlib libimagequant.a && \
cp libimagequant.h ${C}/include && \
cp libimagequant.a ${C}/lib
WORKDIR ..
# Compile freetype
WORKDIR freetype-${FREETYPE2_VERSION}
RUN ./configure --prefix=${C} --host=${CROSS_ARCH} --build=${BUILD_ARCH} --enable-static --disable-shared && \
make && \
make install
WORKDIR ..
# Compile expat
WORKDIR expat-${EXPAT_VERSION}
RUN ./configure --prefix=${C} --host=${CROSS_ARCH} --build=${BUILD_ARCH} --enable-static --disable-shared --without-xmlwf && \
make && \
make install
WORKDIR ..
# Compile fontconfig
WORKDIR fontconfig-${FONTCONFIG_VERSION}
RUN ./configure --prefix=${C} --host=${CROSS_ARCH} --build=${BUILD_ARCH} --enable-static --disable-shared && \
make && \
make install
WORKDIR ..
# Compile libgd
WORKDIR libgd-${LIBGD_VERSION}
# Define taken from https://github.com/mxe/mxe/blob/master/src/gd.mk
RUN CFLAGS="-DNONDLL" ./configure --prefix=${C} --host=${CROSS_ARCH} --build=${BUILD_ARCH} --enable-static --disable-shared && \
make && \
make install
WORKDIR ..
# Compile boost
WORKDIR ${BOOST_BUILD_PATH}
RUN echo "using gcc : mingw : ${CROSS_ARCH}-g++ ;" > user-config.jam
WORKDIR ..
WORKDIR boost_${BOOST_VERSION_MANGLED}
RUN ./bootstrap.sh && \
./b2 install --prefix=${C} toolset=gcc-mingw target-os=windows --with-filesystem --with-program_options --with-regex variant=release link=static runtime-link=static address-model=64
WORKDIR ..
# Compile audiowaveform
WORKDIR audiowaveform-${AUDIOWAVEFORM_VERSION}
WORKDIR build
COPY ${CROSS_ARCH}.cmake .
RUN cmake -DCMAKE_TOOLCHAIN_FILE=${C}/audiowaveform-${AUDIOWAVEFORM_VERSION}/build/${CROSS_ARCH}.cmake -DCMAKE_INSTALL_PREFIX=${C} -DENABLE_TESTS=0 -DCMAKE_CXX_FLAGS_RELEASE="-O3 -DNDEBUG -DBGDWIN32 -static-libgcc -static-libstdc++ -static" -DCMAKE_FIND_LIBRARY_SUFFIXES=".a" -DEXTRA_LIBS="-L${C}/lib -lFLAC -lvorbisenc -lvorbis -logg -lpng -lz" .. && \
make && \
make install
WORKDIR ../..
# Strip binaries
RUN $CROSS_ARCH-strip bin/*.exe
# Create mingw64 archive
RUN zip -r -9 audiowaveform-mingw64.zip bin/ etc/ include/ lib/ share/