summaryrefslogtreecommitdiffstats
path: root/contrib/Jamfile
blob: e197787c141d32c23b1f11cc3da08b3a28090aba (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
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
SubDir TOP contrib ;

# Use curl on Mac OS X since it's always installed, and assume wget
# is installed for all other systems
if $(OS) = MACOSX
{
    WGET = curl -L -o ;
}
else
{
    WGET = wget -O ;
}

if $(OS) = UNKNOWN
{
    OS = CYGWIN ;
}

# Wget rule: downloads $(<) from the link in $(>)
rule Wget
{
    Depends $(<) : $(>) ;
}
actions Wget
{
    $(RM) $(<) &&
    $(WGET) $(<) `cat $(>)` &&
    ( touch $(<) || true )
}

# liba52
rule LibA52
{
    Depends $(<) : $(>) ;
    Depends lib  : $(<) ;
}
actions LibA52
{

    cd `dirname $(>)` && CONTRIB=`pwd` &&
    rm -rf a52dec && tar xzf a52dec.tar.gz && cd a52dec && patch -p1 < ../patch-a52dec.patch &&
    ./configure --prefix=$(CONTRIB) --cache-file=$(CONTRIB)/config.cache && make && make install &&
    strip -S $(CONTRIB)/lib/liba52.a
}
Wget   $(SUBDIR)/a52dec.tar.gz : $(SUBDIR)/version_a52dec.txt ;
LibA52 $(SUBDIR)/lib/liba52.a  : $(SUBDIR)/a52dec.tar.gz ;

# libavcodec
rule LibAvCodec
{
    FFMPEG_PATCH = "patch -p0 < ../patch-ffmpeg.patch" ;
    if $(OS) = CYGWIN
    {
        FFMPEG_PATCH += " && patch -p1 < ../patch-ffmpeg-cygwin.patch " ;
    }
    Depends $(<) : $(>) ;
    Depends lib  : $(<) ;
}
actions LibAvCodec
{
    cd `dirname $(>)` && CONTRIB=`pwd` &&
    rm -rf ffmpeg && tar xzf ffmpeg.tar.gz &&
    cd ffmpeg && $(FFMPEG_PATCH) &&
    ./configure --prefix=$(CONTRIB) --enable-gpl --enable-swscaler --disable-audio-beos --disable-shared --enable-static \
        --disable-decoders --enable-decoder=mp2 --disable-parsers --enable-parser=mpegaudio \
        --disable-encoders --enable-encoder=mpeg4 --enable-encoder=ac3 --enable-encoder=snow \
        --disable-muxers --disable-demuxers --disable-protocols --disable-bsfs &&
    make && make install &&
    strip -S $(CONTRIB)/lib/libavcodec.a
}
Wget       $(SUBDIR)/ffmpeg.tar.gz    : $(SUBDIR)/version_ffmpeg.txt ;
LibAvCodec $(SUBDIR)/lib/libavcodec.a : $(SUBDIR)/ffmpeg.tar.gz ;

rule LibAvUtil
{
    Depends $(<) : $(>) ;
    Depends lib  : $(<) ;
}
actions LibAvUtil
{
    strip -S $(<)
}
#LibAvUtil $(SUBDIR)/lib/libavutil.a : $(SUBDIR)/lib/libavcodec.a ;
#LibAvUtil $(SUBDIR)/lib/libavformat.a : $(SUBDIR)/lib/libavcodec.a ;
LibAvUtil $(SUBDIR)/lib/libswscale.a : $(SUBDIR)/lib/libavcodec.a ;

# CSS doesn't work on Cygwin/Windows as of now, so don't use it.
if $(OS) != CYGWIN
{
    # libdvdcss
    # We need libdvdcss.so for libdvdread's configure to work...
    rule LibDvdCss
    {
        Depends $(<) : $(>) ;
        Depends lib  : $(<) ;
    }
    actions LibDvdCss
    {
        cd `dirname $(>)` && CONTRIB=`pwd` &&
        rm -rf libdvdcss && tar xzf libdvdcss.tar.gz && cd libdvdcss &&
        ./configure --prefix=$(CONTRIB) --cache-file=$(CONTRIB)/config.cache && make && make install &&
        strip -S $(CONTRIB)/lib/libdvdcss.a
    }
    Wget      $(SUBDIR)/libdvdcss.tar.gz : $(SUBDIR)/version_libdvdcss.txt ;
    LibDvdCss $(SUBDIR)/lib/libdvdcss.a  : $(SUBDIR)/libdvdcss.tar.gz ;
}

# libdca
rule LibDCA
{
    Depends $(<) : $(>) ;
    Depends lib  : $(<) ;
}
actions LibDCA
{
    cd `dirname $(>)` && CONTRIB=`pwd` &&
    rm -rf libdca && tar xzf libdca.tar.gz && cd libdca && patch -p1 < ../patch-libdca.patch &&
    ./configure --prefix=$(CONTRIB) --cache-file=$(CONTRIB)/config.cache && make && make install &&
    strip -S $(CONTRIB)/lib/libdca.a
}
Wget   $(SUBDIR)/libdca.tar.gz : $(SUBDIR)/version_libdca.txt ;
LibDCA $(SUBDIR)/lib/libdca.a  : $(SUBDIR)/libdca.tar.gz ;

# libdvdread
rule LibDvdRead
{
    Depends $(<) : $(>) ;
    Depends lib  : $(<) ;
}
if $(OS) != CYGWIN
{
    actions LibDvdRead
    {
        cd `dirname $(>)` && CONTRIB=`pwd` &&
        rm -rf libdvdread && tar xzf libdvdread.tar.gz && cd libdvdread &&
        ./configure --prefix=$(CONTRIB) --cache-file=$(CONTRIB)/config.cache --disable-shared --with-libdvdcss=$CONTRIB &&
        make && make install &&
        strip -S $(CONTRIB)/lib/libdvdread.a
    }
}
else {
    # Cygwin/Windows doesn't use CSS as of now, so don't include it on the
    # configure line.
    actions LibDvdRead
    {
        cd `dirname $(>)` && CONTRIB=`pwd` &&
        rm -rf libdvdread && tar xzf libdvdread.tar.gz && cd libdvdread &&
        ./configure --prefix=$(CONTRIB) --cache-file=$(CONTRIB)/config.cache --disable-shared &&
        make && make install &&
        strip -S $(CONTRIB)/lib/libdvdread.a
    }
}
Wget       $(SUBDIR)/libdvdread.tar.gz : $(SUBDIR)/version_libdvdread.txt ;
LibDvdRead $(SUBDIR)/lib/libdvdread.a  : $(SUBDIR)/libdvdread.tar.gz ;

# libfaac
rule LibFaac
{
    Depends $(<) : $(>) ;
    Depends lib  : $(<) ;
}
actions LibFaac
{
    cd `dirname $(>)` && CONTRIB=`pwd` &&
    rm -rf faac && tar xzf faac.tar.gz && cd faac &&
    ./configure --prefix=$(CONTRIB) --cache-file=$(CONTRIB)/config.cache --disable-shared --enable-static &&
    make && make install &&
    strip -S $(CONTRIB)/lib/libfaac.a
}
Wget    $(SUBDIR)/faac.tar.gz   : $(SUBDIR)/version_faac.txt ;
LibFaac $(SUBDIR)/lib/libfaac.a : $(SUBDIR)/faac.tar.gz ;

# libmp3lame
rule LibMp3Lame
{
    Depends $(<) : $(>) ;
    Depends lib  : $(<) ;
}
actions LibMp3Lame
{
    cd `dirname $(>)` && CONTRIB=`pwd` &&
    rm -rf lame && tar xzf lame.tar.gz && cd lame &&
    ./configure --prefix=$(CONTRIB) --cache-file=$(CONTRIB)/config.cache --disable-shared &&
    make && make install &&
    strip -S $(CONTRIB)/lib/libmp3lame.a
}
Wget       $(SUBDIR)/lame.tar.gz      : $(SUBDIR)/version_lame.txt ;
LibMp3Lame $(SUBDIR)/lib/libmp3lame.a : $(SUBDIR)/lame.tar.gz ;

# libmp4v2
rule LibMp4v2
{
    Depends $(<) : $(>) ;
    Depends lib  : $(<) ;
}
if $(OS) != CYGWIN
{
    actions LibMp4v2
    {
        cd `dirname $(>)` && CONTRIB=`pwd` &&
        rm -rf mpeg4ip && tar xzf mpeg4ip.tar.gz && cd mpeg4ip &&
        patch -p1 < ../patch-mpeg4ip.patch && patch -p0 < ../patch-mpeg4ip-pascal-str.patch &&
        ./bootstrap --cache-file=$(CONTRIB)/config.cache --disable-mp3lame --disable-faac --disable-x264 --disable-server --disable-player &&
        make -C lib/mp4v2 libmp4v2.la && cp lib/mp4v2/.libs/libmp4v2.a $(CONTRIB)/lib &&
        cp mpeg4ip_config.h include/mpeg4ip.h include/mpeg4ip_version.h \
            include/mpeg4ip_win32.h lib/mp4v2/*.h $(CONTRIB)/include &&
        strip -S $(CONTRIB)/lib/libmp4v2.a
    }
}
else
{
    actions LibMp4v2
    {
        cd `dirname $(>)` && CONTRIB=`pwd` &&
        rm -rf mpeg4ip && tar xzf mpeg4ip.tar.gz && cd mpeg4ip &&
        patch -p1 < ../patch-mpeg4ip.patch && patch -p1 < ../patch_mpeg4ip_cygwin.patch && patch -p0 < ../patch-mpeg4ip-pascal-str.patch &&
        ./bootstrap --cache-file=$(CONTRIB)/config.cache --disable-mp3lame --disable-faac --disable-x264 --disable-server --disable-player &&
        make -C lib/mp4v2 libmp4v2.la && cp lib/mp4v2/.libs/libmp4v2.a $(CONTRIB)/lib &&
        cp mpeg4ip_config.h include/mpeg4ip.h include/mpeg4ip_version.h \
            include/mpeg4ip_win32.h lib/mp4v2/*.h $(CONTRIB)/include &&
        strip -S $(CONTRIB)/lib/libmp4v2.a
    }
}
Wget     $(SUBDIR)/mpeg4ip.tar.gz : $(SUBDIR)/version_mpeg4ip.txt ;
LibMp4v2 $(SUBDIR)/lib/libmp4v2.a : $(SUBDIR)/mpeg4ip.tar.gz ;

rule LibMkv
{
    Depends $(<) : $(>) ;
    Depends lib  : $(<) ;
}
actions LibMkv
{
    cd `dirname $(>)` && CONTRIB=`pwd` &&
    rm -rf libmkv && tar xzf libmkv.tar.gz && cd libmkv &&
    ./configure --disable-shared --enable-static --prefix=$(CONTRIB) --cache-file=$(CONTRIB)/config.cache &&
    make && make install &&
    strip -S $(CONTRIB)/lib/libmkv.a
}
Wget    $(SUBDIR)/libmkv.tar.gz : $(SUBDIR)/version_libmkv.txt ;
LibMkv  $(SUBDIR)/lib/libmkv.a  : $(SUBDIR)/libmkv.tar.gz ;

# libmpeg2
rule LibMpeg2
{
    Depends $(<) : $(>) ;
    Depends lib  : $(<) ;
}
actions LibMpeg2
{
    cd `dirname $(>)` && CONTRIB=`pwd` &&
    rm -rf mpeg2dec && tar xzf mpeg2dec.tar.gz && cd mpeg2dec && patch -p1 < ../patch-libmpeg2.patch &&
    ./configure --prefix=$(CONTRIB) --cache-file=$(CONTRIB)/config.cache --disable-shared --disable-sdl &&
    make && make install &&
    strip -S $(CONTRIB)/lib/libmpeg2.a
}
Wget     $(SUBDIR)/mpeg2dec.tar.gz : $(SUBDIR)/version_mpeg2dec.txt ;
LibMpeg2 $(SUBDIR)/lib/libmpeg2.a  : $(SUBDIR)/mpeg2dec.tar.gz ;

# libogg
rule LibOgg
{
    Depends $(<) : $(>) ;
    Depends lib  : $(<) ;
}
actions LibOgg
{
    cd `dirname $(>)` && CONTRIB=`pwd` &&
    rm -rf libogg && tar xzf libogg.tar.gz && cd libogg &&
    ./configure --prefix=$(CONTRIB) --cache-file=$(CONTRIB)/config.cache --disable-shared &&
    make && make install &&
    strip -S $(CONTRIB)/lib/libogg.a
}
Wget   $(SUBDIR)/libogg.tar.gz : $(SUBDIR)/version_libogg.txt ;
LibOgg $(SUBDIR)/lib/libogg.a  : $(SUBDIR)/libogg.tar.gz ;

# libsamplerate
rule LibSampleRate
{
    Depends $(<) : $(>) ;
    Depends lib  : $(<) ;
}
actions LibSampleRate
{
    cd `dirname $(>)` && CONTRIB=`pwd` &&
    rm -rf libsamplerate && tar xzf libsamplerate.tar.gz && cd libsamplerate &&
    ./configure --prefix=$(CONTRIB) --cache-file=$(CONTRIB)/config.cache --disable-shared &&
    make && make install &&
    strip -S $(CONTRIB)/lib/libsamplerate.a
}
Wget          $(SUBDIR)/libsamplerate.tar.gz : $(SUBDIR)/version_libsamplerate.txt ;
LibSampleRate $(SUBDIR)/lib/libsamplerate.a  : $(SUBDIR)/libsamplerate.tar.gz ;

# libvorbis
rule LibVorbis
{
    Depends $(<) : $(>) ;
    Depends lib  : $(<) ;
}
actions LibVorbis
{
    cd `dirname $(>)` && CONTRIB=`pwd` &&
    rm -rf libvorbis && tar xzf libvorbis.tar.gz && cd libvorbis &&
    ./configure --prefix=$(CONTRIB) --with-ogg=$(CONTRIB) --cache-file=$(CONTRIB)/config.cache --disable-shared &&
    make && make install &&
    strip -S $(CONTRIB)/lib/libvorbis.a
}
Wget      $(SUBDIR)/libvorbis.tar.gz : $(SUBDIR)/version_libvorbis.txt ;
LibVorbis $(SUBDIR)/lib/libvorbis.a  : $(SUBDIR)/libvorbis.tar.gz ;

rule LibVorbisEnc
{
    Depends $(<) : $(>) ;
    Depends lib  : $(<) ;
}
actions LibVorbisEnc
{
    strip -S $(<)
}
LibVorbisEnc $(SUBDIR)/lib/libvorbisenc.a : $(SUBDIR)/lib/libvorbis.a ;

# libx264
rule LibX264
{
    LIBX264_PATCH = "" ;
    if $(OS) = MACOSX && $(OSPLAT) = X86
    {
        LIBX264_PATCH += "patch -p1 < ../patch-x264-macintel.patch && " ;
    }
    else if $(OS) = CYGWIN
    {
        LIBX264_PATCH += "patch -p1 < ../patch-x264-cygwin.patch && " ;
    }
    LIBX264_PATCH += "patch -p0 < ../patch-x264-aq.patch && " ;
    Depends $(<) : $(>) ;
    Depends lib  : $(<) ;
}
actions LibX264
{
    cd `dirname $(>)` && CONTRIB=`pwd` &&
    rm -rf x264 && tar xzf x264.tar.gz && cd x264 && $(LIBX264_PATCH)
    ./configure --prefix=$(CONTRIB) --enable-pthread && make &&
    make install &&
    strip -S $CONTRIB/lib/libx264.a
}
Wget    $(SUBDIR)/x264.tar.gz   : $(SUBDIR)/version_x264.txt ;
LibX264 $(SUBDIR)/lib/libx264.a : $(SUBDIR)/x264.tar.gz ;

# libxvidcore
rule LibXvidCore
{
    LIBXVIDCORE_PATCH = "" ;
    if $(OS) = MACOSX
    {
        LIBXVIDCORE_PATCH = "patch -p1 < ../patch-xvidcore-macosx.patch && " ;
    }
    else if $(OS) = CYGWIN
    {
        LIBXVIDCORE_PATCH = "patch -p1 < ../patch-xvidcore-cygwin.patch && " ;
    }
    Depends $(<) : $(>) ;
    Depends lib  : $(<) ;
}
actions LibXvidCore
{
    cd `dirname $(>)` && CONTRIB=`pwd` &&
    rm -rf xvidcore && tar xzf xvidcore.tar.gz &&
    cd xvidcore && $(LIBXVIDCORE_PATCH)
    cd build/generic/ && ./configure --prefix=$(CONTRIB) --cache-file=$(CONTRIB)/config.cache && make libxvidcore.a &&
    cp ./=build/libxvidcore.a $CONTRIB/lib/ &&
    cp ../../src/xvid.h $CONTRIB/include/ &&
    strip -S $(CONTRIB)/lib/libxvidcore.a
}
Wget        $(SUBDIR)/xvidcore.tar.gz   : $(SUBDIR)/version_xvidcore.txt ;
LibXvidCore $(SUBDIR)/lib/libxvidcore.a : $(SUBDIR)/xvidcore.tar.gz ;

# zlib
if $(OS) = CYGWIN
{
    rule Zlib
    {
        Depends $(<) : $(>) ;
        Depends lib  : $(<) ;
    }
    actions Zlib
    {
        cd `dirname $(>)` && CONTRIB=`pwd` &&
        rm -rf zlib && tar xzf zlib.tar.gz &&
        cd zlib && ./configure --prefix=$(CONTRIB) --cache-file=$(CONTRIB)/config.cache &&
        make && make install && touch $(CONTRIB)/.contrib &&
        strip -S $(CONTRIB)/lib/libz.a
    }
    Wget  $(SUBDIR)/zlib.tar.gz : $(SUBDIR)/version_zlib.txt ;
    Zlib  $(SUBDIR)/lib/libz.a  : $(SUBDIR)/zlib.tar.gz ;
}