vips: moved to github
[openwrt.org/packages.git] / multimedia / Makefile
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
#
# Copyright (C) 2006-2013 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
 
include $(TOPDIR)/rules.mk
 
PKG_NAME:=ffmpeg
PKG_VERSION:=0.11.5
PKG_RELEASE:=1
 
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://ffmpeg.org/releases/
PKG_MD5SUM:=ea25fc252c132141f12988ed5506bfe8
 
PKG_LICENSE:=LGPLv2.1+ GPLv2+ LGPLv3
PKG_LICENSE_FILES:=COPYING.GPLv2 COPYING.GPLv3 COPYING.LGPLv2.1 COPYING.LGPLv3
 
FFMPEG_CUSTOM_ENCODERS:= \
        ac3 \
        jpegls \
        mpeg1video \
        mpeg2video \
        mpeg4 \
        pcm_s16be \
        pcm_s16le \
        png \
        vorbis \
        zlib \
 
FFMPEG_CUSTOM_DECODERS:= \
        aac \
        ac3 \
        atrac3 \
        flac \
        gif \
        h264 \
        jpegls \
        mp2 \
        mp3 \
        mpeg1video \
        mpeg2video \
        mpeg4 \
        mpegvideo \
        pcm_s16be \
        pcm_s16le \
        png \
        vorbis \
        wmav1 \
        wmav2 \
        zlib \
 
FFMPEG_CUSTOM_MUXERS:= \
        ac3 \
        ffm \
        h264 \
        mp3 \
        mp4 \
        mpeg1video \
        mpeg2video \
        mpegts \
        ogg \
        rtp \
 
FFMPEG_CUSTOM_DEMUXERS:= \
        aac \
        ac3 \
        avi \
        flac \
        ffm \
        h264 \
        matroska \
        mov \
        mp3 \
        mpegps \
        mpegts \
        mpegvideo \
        ogg \
        rm \
        rtsp \
        sdp \
        v4l2 \
 
FFMPEG_CUSTOM_PARSERS:= \
        aac \
        ac3 \
        h264 \
        mpegaudio \
        mpeg4video \
        mpegvideo \
 
FFMPEG_CUSTOM_PROTOCOLS:= \
        file http pipe rtp tcp udp
 
FFMPEG_MINI_ENCODERS:= \
 
FFMPEG_MINI_DECODERS:= \
        aac \
        ac3 \
        atrac3 \
        flac \
        h263 \
        h264 \
        jpegls \
        mp3 \
        mpeg1video \
        mpeg2video \
        mpeg4 \
        mpegvideo \
        png \
        wmav1 \
        wmav2 \
 
FFMPEG_MINI_MUXERS:= \
        ffm \
 
FFMPEG_MINI_DEMUXERS := \
        aac \
        ac3 \
        asf \
        avi \
        ffm \
        flac \
        h264 \
        matroska \
        mov \
        mp3 \
        mpegts \
        mpegvideo \
        rtsp \
 
FFMPEG_MINI_PARSERS:= \
        ac3 \
        flac \
        h263 \
        h264 \
        mpeg4video \
        mpegaudio \
 
FFMPEG_MINI_PROTOCOLS := \
        file http rtp tcp udp \
 
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
 
PKG_CONFIG_DEPENDS:= \
        $(patsubst %,CONFIG_FFMPEG_CUSTOM_ENCODER_%,$(FFMPEG_CUSTOM_ENCODERS)) \
        $(patsubst %,CONFIG_FFMPEG_CUSTOM_DECODER_%,$(FFMPEG_CUSTOM_DECODERS)) \
        $(patsubst %,CONFIG_FFMPEG_CUSTOM_MUXER_%,$(FFMPEG_CUSTOM_DEMUXERS)) \
        $(patsubst %,CONFIG_FFMPEG_CUSTOM_DEMUXER_%,$(FFMPEG_CUSTOM_DEMUXERS)) \
        $(patsubst %,CONFIG_FFMPEG_CUSTOM_PARSER_%,$(FFMPEG_CUSTOM_PARSERS)) \
        $(patsubst %,CONFIG_FFMPEG_CUSTOM_PROTOCOL_%,$(FFMPEG_CUSTOM_PROTOCOLS))
 
include $(INCLUDE_DIR)/package.mk
 
define Package/ffmpeg/Default
 TITLE:=FFmpeg
 URL:=http://ffmpeg.mplayerhq.hu/
endef
 
define Package/ffmpeg/Default/description
 FFmpeg is a a software package that can record, convert and stream digital
 audio and video in numerous formats.
endef
 
 
define Package/ffmpeg
$(call Package/ffmpeg/Default)
 SECTION:=multimedia
 CATEGORY:=Multimedia
 TITLE+= program
 DEPENDS+= +libpthread +libffmpeg-full
 VARIANT:=full
endef
 
define Package/ffmpeg/description
$(call Package/ffmpeg/Default/description)
 .
 This package contains the FFmpeg command line tool.
endef
 
 
define Package/ffprobe
$(call Package/ffmpeg/Default)
 SECTION:=multimedia
 CATEGORY:=Multimedia
 TITLE+= CLI media identifier
 DEPENDS+= +libffmpeg-full
 VARIANT:=full
endef
 
define Package/ffprobe/description
$(call Package/ffmpeg/Default/description)
 .
 This package contains the FFprobe command line tool.
endef
 
 
define Package/ffserver
$(call Package/ffserver/Default)
 SECTION:=multimedia
 CATEGORY:=Multimedia
 TITLE+= streaming server
 DEPENDS+= +libpthread +libffmpeg-full
 VARIANT:=full
endef
 
define Package/ffserver/description
$(call Package/ffmpeg/Default/description)
 .
 This package contains the FFmpeg streaming server.
endef
 
 
define Package/libffmpeg/Default
$(call Package/ffmpeg/Default)
 SECTION:=libs
 CATEGORY:=Libraries
 TITLE+= libraries
 DEPENDS+= +libpthread +zlib +libbz2
 PROVIDES:= libffmpeg
endef
 
 
define Package/libffmpeg-custom
$(call Package/libffmpeg/Default)
 TITLE+= (mini)
 DEPENDS+= @DEVEL
 VARIANT:=custom
 MENU:=1
endef
 
define Package/libffmpeg-custom/config
source "$(SOURCE)/Config.in"
endef
 
define Package/libffmpeg-custom/description
$(call Package/ffmpeg/Default/description)
 .
 This package contains customized FFmpeg shared libraries.
endef
 
 
define Package/libffmpeg-full
$(call Package/libffmpeg/Default)
 TITLE+= (full)
 DEPENDS+= @BUILD_PATENTED +alsa-lib
 VARIANT:=full
endef
 
define Package/libffmpeg-full/description
$(call Package/ffmpeg/Default/description)
 .
 This package contains full-featured FFmpeg shared libraries.
endef
 
 
define Package/libffmpeg-mini
$(call Package/libffmpeg/Default)
 TITLE+= (mini)
 DEPENDS+= @BUILD_PATENTED
 VARIANT:=mini
endef
 
define Package/libffmpeg-mini/description
$(call Package/ffmpeg/Default/description)
 .
 This package contains minimal-featured FFmpeg shared libraries.
endef
 
 
FFMPEG_CONFIGURE:= \
        CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(FPIC)" \
        LDFLAGS="$(TARGET_LDFLAGS)" \
        ./configure \
        --enable-cross-compile \
        --cross-prefix="$(TARGET_CROSS)" \
        --arch="$(ARCH)" \
        --target-os=linux \
        --prefix="/usr" \
        --enable-shared \
        --enable-static \
        --disable-debug \
        --pkg-config="pkg-config" \
        \
        --enable-gpl \
        --enable-version3 \
        \
        --disable-altivec \
        --disable-asm \
        --disable-doc \
        --disable-dxva2 \
        --enable-pthreads \
        --enable-small \
        --disable-stripping \
        --enable-zlib \
        --disable-outdevs
 
ifeq ($(BUILD_VARIANT),custom)
 
  FFMPEG_ENABLE= \
        $(foreach c, $(2), \
                $(if $($(3)_$(c)),--enable-$(1)="$(c)") \
        )
 
  FFMPEG_CONFIGURE+= \
        --disable-ffmpeg \
        --disable-ffplay \
        --disable-ffprobe \
        --disable-ffserver \
        --disable-avfilter \
        --disable-postproc \
        --disable-swresample \
        --disable-swscale \
        --disable-everything \
        $(call FFMPEG_ENABLE,encoder,$(FFMPEG_CUSTOM_ENCODERS),CONFIG_FFMPEG_CUSTOM_ENCODER) \
        $(call FFMPEG_ENABLE,decoder,$(FFMPEG_CUSTOM_DECODERS),CONFIG_FFMPEG_CUSTOM_DECODER) \
        $(call FFMPEG_ENABLE,muxer,$(FFMPEG_CUSTOM_MUXERS),CONFIG_FFMPEG_CUSTOM_MUXER) \
        $(call FFMPEG_ENABLE,demuxer,$(FFMPEG_CUSTOM_DEMUXERS),CONFIG_FFMPEG_CUSTOM_DEMUXER) \
        $(call FFMPEG_ENABLE,parser,$(FFMPEG_CUSTOM_PARSERS),CONFIG_FFMPEG_CUSTOM_PARSER) \
        $(call FFMPEG_ENABLE,protocol,$(FFMPEG_CUSTOM_PROTOCOLS),CONFIG_FFMPEG_CUSTOM_PROTOCOL) \
 
endif
 
ifeq ($(BUILD_VARIANT),mini)
 
  FFMPEG_ENABLE= \
        $(foreach c, $(2), \
                --enable-$(1)="$(c)" \
        )
 
  FFMPEG_CONFIGURE+= \
        --disable-ffmpeg \
        --disable-ffplay \
        --disable-ffprobe \
        --disable-ffserver \
        --disable-avfilter \
        --disable-postproc \
        --disable-swresample \
        --disable-swscale \
        --disable-everything \
        $(call FFMPEG_ENABLE,encoder,$(FFMPEG_MINI_ENCODERS)) \
        $(call FFMPEG_ENABLE,decoder,$(FFMPEG_MINI_DECODERS)) \
        $(call FFMPEG_ENABLE,muxer,$(FFMPEG_MINI_MUXERS)) \
        $(call FFMPEG_ENABLE,demuxer,$(FFMPEG_MINI_DEMUXERS)) \
        $(call FFMPEG_ENABLE,parser,$(FFMPEG_MINI_PARSERS)) \
        $(call FFMPEG_ENABLE,protocol,$(FFMPEG_MINI_PROTOCOLS)) \
 
endif
 
ifneq ($(CONFIG_TARGET_x86),)
  TARGET_CFLAGS += -fomit-frame-pointer
endif
 
define Build/Configure
        ( cd $(PKG_BUILD_DIR); $(FFMPEG_CONFIGURE) )
endef
 
define Build/Compile
        $(MAKE) -C $(PKG_BUILD_DIR) \
                DESTDIR="$(PKG_INSTALL_DIR)" \
                all install
endef
 
define Build/InstallDev/custom
        $(INSTALL_DIR) $(1)/usr/include
        $(CP) $(PKG_INSTALL_DIR)/usr/include/lib{avcodec,avdevice,avformat,avutil} $(1)/usr/include/
        $(INSTALL_DIR) $(1)/usr/lib
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avformat,avutil}.{a,so*} $(1)/usr/lib/
        $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lib{avcodec,avdevice,avformat,avutil}.pc $(1)/usr/lib/pkgconfig/
endef
 
define Build/InstallDev/full
        $(INSTALL_DIR) $(1)/usr/include
        $(CP) $(PKG_INSTALL_DIR)/usr/include/lib{avcodec,avdevice,avfilter,avformat,avutil,postproc,swresample,swscale} $(1)/usr/include/
        $(INSTALL_DIR) $(1)/usr/lib
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avfilter,avformat,avutil,postproc,swresample,swscale}.{a,so*} $(1)/usr/lib/
        $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lib{avcodec,avdevice,avfilter,avformat,avutil,postproc,swresample,swscale}.pc $(1)/usr/lib/pkgconfig/
endef
 
Build/InstallDev/mini = $(Build/InstallDev/custom)
 
# XXX: attempt at installing "best" dev files available
ifeq ($(BUILD_VARIANT),custom)
  # XXX: only install "custom" dev files if -full & -mini are not selected
  ifeq ($(CONFIG_PACKAGE_libffmpeg-full)$(CONFIG_PACKAGE_libffmpeg-mini),)
    Build/InstallDev = $(Build/InstallDev/custom)
  endif
endif
ifeq ($(BUILD_VARIANT),full)
  # XXX: always install "full" dev files if -full is selected
  Build/InstallDev = $(Build/InstallDev/full)
endif
ifeq ($(BUILD_VARIANT),mini)
  # XXX: only install "mini" dev files if -full is not selected
  ifeq ($(CONFIG_PACKAGE_libffmpeg-full),)
    Build/InstallDev = $(Build/InstallDev/mini)
  endif
endif
 
define Package/ffmpeg/install
        $(INSTALL_DIR) $(1)/usr/bin
        $(CP) $(PKG_INSTALL_DIR)/usr/bin/ffmpeg $(1)/usr/bin/
endef
 
define Package/ffprobe/install
        $(INSTALL_DIR) $(1)/usr/bin
        $(CP) $(PKG_INSTALL_DIR)/usr/bin/ffprobe $(1)/usr/bin/
endef
 
define Package/ffserver/install
        $(INSTALL_DIR) $(1)/usr/bin
        $(CP) $(PKG_INSTALL_DIR)/usr/bin/ffserver $(1)/usr/bin/
endef
 
define Package/libffmpeg-custom/install
        $(INSTALL_DIR) $(1)/usr/lib
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avformat,avutil}.so.* $(1)/usr/lib/
endef
 
define Package/libffmpeg-full/install
        $(INSTALL_DIR) $(1)/usr/lib
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avfilter,avformat,avutil,postproc,swresample,swscale}.so.* $(1)/usr/lib/
endef
 
Package/libffmpeg-mini/install = $(Package/libffmpeg-custom/install)
 
$(eval $(call BuildPackage,ffmpeg))
$(eval $(call BuildPackage,ffprobe))
$(eval $(call BuildPackage,ffserver))
$(eval $(call BuildPackage,libffmpeg-custom))
$(eval $(call BuildPackage,libffmpeg-full))
$(eval $(call BuildPackage,libffmpeg-mini))
 
comments