python3: update to 3.11.10
[openadk.git] / package / ffmpeg / Makefile
blob8c00cdef49877c2a29c8ed941a22ea7198b87089
1 # This file is part of the OpenADK project. OpenADK is copyrighted
2 # material, please see the LICENCE file in the top-level directory.
4 include $(ADK_TOPDIR)/rules.mk
6 PKG_NAME:= ffmpeg
7 PKG_VERSION:= 6.1.1
8 PKG_RELEASE:= 1
9 PKG_HASH:= 5e3133939a61ef64ac9b47ffd29a5ea6e337a4023ef0ad972094b4da844e3a20
10 PKG_DESCR:= record, convert and stream audio & video
11 PKG_SECTION:= libs/video
12 PKG_NEEDS:= threads
13 PKG_DEPENDS:= libncurses libressl
14 PKG_BUILDDEP:= ncurses libressl
15 PKG_URL:= http://www.ffmpeg.org/
16 PKG_SITES:= http://www.ffmpeg.org/releases/
17 PKG_LIBNAME:= libffmpeg
18 PKG_OPTS:= dev
20 PKG_CHOICES_FFMPEG:= WITH_LIBRESSL WITH_OPENSSL
21 PKGCD_WITH_LIBRESSL:= use libressl for crypto
22 PKGCS_WITH_LIBRESSL:= libressl ca-certificates
23 PKGCB_WITH_LIBRESSL:= libressl
24 PKGCD_WITH_OPENSSL:= use libopenssl for crypto
25 PKGCS_WITH_OPENSSL:= libopenssl ca-certificates
26 PKGCB_WITH_OPENSSL:= openssl
29 PKG_SUBPKGS:= LIBFFMPEG FFPROBE FFMPEG
30 PKGSD_FFMPEG:= video converter
31 PKGSC_FFMPEG:= mm/video
32 PKGSS_FFMPEG:= libffmpeg
33 PKGSD_FFPROBE:= simple multimedia stream analyzer
34 PKGSC_FFPROBE:= mm/video
35 PKGSS_FFPROBE:= libffmpeg
36 PKGSD_LIBFFMPEG:= video library
37 PKGSC_LIBFFMPEG:= libs/video
39 PKG_FLAVOURS_LIBFFMPEG:= WITH_MP3 WITH_VP8 WITH_THEORA
40 PKG_FLAVOURS_LIBFFMPEG+= WITH_XVID WITH_VORBIS WITH_X264 WITH_X265
41 PKG_FLAVOURS_LIBFFMPEG+= WITH_ZLIB WITH_BZIP2
43 PKGFD_WITH_BZIP2:= with bzip2 compression support
44 PKGFS_WITH_BZIP2:= bzip2
45 PKGFB_WITH_BZIP2:= bzip2
47 PKGFD_WITH_ZLIB:= with zlib compression support
48 PKGFS_WITH_ZLIB:= zlib
49 PKGFB_WITH_ZLIB:= zlib
51 PKGFD_WITH_X264:= with x264 decoding support
52 PKGFS_WITH_X264:= libx264
53 PKGFB_WITH_X264:= libx264
54 ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_X264),y)
55 PKG_FDEPENDS+= libx264
56 endif
58 PKGFD_WITH_X265:= with x265 decoding support
59 PKGFS_WITH_X265:= libx265
60 PKGFB_WITH_X265:= libx265
61 ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_X265),y)
62 PKG_FDEPENDS+= libx265
63 endif
65 PKGFD_WITH_MP3:= with mp3 encoding support
66 PKGFS_WITH_MP3:= libmp3lame
67 PKGFB_WITH_MP3:= lame
68 ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_MP3),y)
69 PKG_FDEPENDS+= libmp3lame
70 endif
72 PKGFD_WITH_VP8:= with vp8 encoding support
73 PKGFS_WITH_VP8:= libvpx
74 PKGFB_WITH_VP8:= libvpx
75 ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_VP8),y)
76 PKG_FDEPENDS+= libvpx
77 endif
79 PKGFD_WITH_THEORA:= with theora encoding support
80 PKGFS_WITH_THEORA:= libtheora
81 PKGFB_WITH_THEORA:= libtheora
82 ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_THEORA),y)
83 PKG_FDEPENDS+= libtheora
84 endif
86 PKGFD_WITH_XVID:= with xvid encoding support
87 PKGFS_WITH_XVID:= libxvid
88 PKGFB_WITH_XVID:= xvidcore
89 ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_XVID),y)
90 PKG_FDEPENDS+= libxvid
91 endif
93 PKGFD_WITH_VORBIS:= with vorbis encoding support
94 PKGFS_WITH_VORBIS:= libvorbisenc
95 PKGFB_WITH_VORBIS:= libvorbis
96 ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_VORBIS),y)
97 PKG_FDEPENDS+= libvorbisenc
98 endif
100 DISTFILES:= $(PKG_NAME)-$(PKG_VERSION).tar.bz2
102 include $(ADK_TOPDIR)/mk/package.mk
104 $(eval $(call PKG_template,LIBFFMPEG,libffmpeg,$(PKG_VERSION)-$(PKG_RELEASE),$(PKG_FDEPENDS),$(PKGSD_LIBFFMPEG),$(PKGSC_LIBFFMPEG),$(PKG_OPTS)))
105 $(eval $(call PKG_template,FFMPEG,ffmpeg,$(PKG_VERSION)-$(PKG_RELEASE),$(PKG_DEPENDS),$(PKGSD_FFMPEG),$(PKGSC_FFMPEG)))
106 $(eval $(call PKG_template,FFPROBE,ffprobe,$(PKG_VERSION)-$(PKG_RELEASE),$(PKG_DEPENDS),$(PKGSD_FFPROBE),$(PKGSC_FFPROBE)))
108 ifeq ($(ADK_DEBUG),y)
109 TARGET_CFLAGS:= $(subst O0,O2,$(TARGET_CFLAGS))
110 else
111 TARGET_CFLAGS:= $(subst Os,O2,$(TARGET_CFLAGS))
112 endif
113 TARGET_CPPFLAGS+= -D_POSIX_SOURCE -D_GNU_SOURCE
114 TARGET_LDFLAGS+= -latomic
116 ifeq ($(ADK_TARGET_CPU_WITH_MMX),y)
117 CONFIGURE_CPU_OPTS+= --enable-mmx
118 else
119 CONFIGURE_CPU_OPTS+= --disable-mmx
120 endif
121 ifeq ($(ADK_TARGET_CPU_WITH_MMXEXT),y)
122 CONFIGURE_CPU_OPTS+= --enable-mmxext
123 else
124 CONFIGURE_CPU_OPTS+= --disable-mmxext
125 endif
126 ifeq ($(ADK_TARGET_CPU_WITH_SSE4_2),y)
127 CONFIGURE_CPU_OPTS+= --enable-sse42 \
128 --disable-sse4 \
129 --disable-ssse3 \
130 --disable-sse3 \
131 --disable-sse2 \
132 --disable-sse
133 else
134 CONFIGURE_CPU_OPTS+= --disable-sse42
135 ifeq ($(ADK_TARGET_CPU_WITH_SSE4_1),y)
136 CONFIGURE_CPU_OPTS+= --enable-sse4 \
137 --disable-ssse3 \
138 --disable-sse3 \
139 --disable-sse2 \
140 --disable-sse
141 else
142 CONFIGURE_CPU_OPTS+= --disable-sse4
143 ifeq ($(ADK_TARGET_CPU_WITH_SSSE3),y)
144 CONFIGURE_CPU_OPTS+= --enable-ssse3 \
145 --disable-sse3 \
146 --disable-sse2 \
147 --disable-sse
148 else
149 CONFIGURE_CPU_OPTS+= --disable-ssse3
150 ifeq ($(ADK_TARGET_CPU_WITH_SSE3),y)
151 CONFIGURE_CPU_OPTS+= --enable-sse3 \
152 --disable-sse2 \
153 --disable-sse
154 else
155 CONFIGURE_CPU_OPTS+= --disable-sse3
156 ifeq ($(ADK_TARGET_CPU_WITH_SSE2),y)
157 CONFIGURE_CPU_OPTS+= --enable-sse2 \
158 --disable-sse
159 else
160 CONFIGURE_CPU_OPTS+= --disable-sse2
161 ifeq ($(ADK_TARGET_CPU_WITH_SSE),y)
162 CONFIGURE_CPU_OPTS+= --enable-sse
163 else
164 CONFIGURE_CPU_OPTS+= --disable-sse
165 endif
166 endif
167 endif
168 endif
169 endif
170 endif
171 ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI),y)
172 CONFIGURE_CPU_OPTS:= --enable-armv6
173 endif
174 ifeq ($(ADK_TARGET_CPU_MIPS_MIPS32),y)
175 CONFIGURE_CPU_OPTS+= --disable-mipsdsp --disable-mipsdspr2
176 endif
178 ifeq ($(ADK_TARGET_ARCH_ARM_WITH_NEON),y)
179 CONFIGURE_CPU_OPTS+= --enable-neon
180 else ifeq ($(ADK_TARGET_ARCH_AARCH64),y)
181 CONFIGURE_CPU_OPTS+= --enable-neon
182 else
183 CONFIGURE_CPU_OPTS+= --disable-neon
184 endif
186 CONFIG_STYLE:= minimal
187 CONFIGURE_ARGS:= --prefix=/usr \
188 --target-os=linux \
189 --arch=$(ADK_TARGET_CPU_ARCH) \
190 --enable-cross-compile \
191 --sysroot=$(STAGING_TARGET_DIR) \
192 --cross-prefix=$(TARGET_CROSS) \
193 --cc='$(TARGET_CC)' \
194 --host-cc='$(HOST_CC)' \
195 --pkg-config='$(STAGING_HOST_DIR)/usr/bin/pkg-config' \
196 --disable-doc \
197 --disable-debug \
198 --disable-iconv \
199 --disable-yasm \
200 --disable-optimizations \
201 --disable-stripping \
202 --enable-shared \
203 --enable-static \
204 --enable-gpl \
205 --enable-nonfree \
206 --enable-swscale \
207 --enable-postproc \
208 --enable-openssl \
209 $(CONFIGURE_CPU_OPTS)
211 ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_BZIP2),y)
212 CONFIGURE_ARGS+= --enable-bzlib
213 else
214 CONFIGURE_ARGS+= --disable-bzlib
215 endif
217 ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_ZLIB),y)
218 CONFIGURE_ARGS+= --enable-zlib
219 else
220 CONFIGURE_ARGS+= --disable-zlib
221 endif
223 ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_X264),y)
224 CONFIGURE_ARGS+= --enable-libx264
225 endif
226 ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_X265),y)
227 CONFIGURE_ARGS+= --enable-libx265
228 endif
229 ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_MP3),y)
230 CONFIGURE_ARGS+= --enable-libmp3lame
231 endif
232 ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_VP8),y)
233 CONFIGURE_ARGS+= --enable-libvpx
234 endif
235 ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_THEORA),y)
236 CONFIGURE_ARGS+= --enable-libtheora
237 endif
238 ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_XVID),y)
239 CONFIGURE_ARGS+= --enable-libxvid
240 endif
241 ifeq ($(ADK_PACKAGE_LIBFFMPEG_WITH_VORBIS),y)
242 CONFIGURE_ARGS+= --enable-libvorbis \
243 --enable-muxer=ogg \
244 --enable-encoder=libvorbis
245 endif
247 libffmpeg-install:
248 $(INSTALL_DIR) $(IDIR_LIBFFMPEG)/usr/lib
249 $(CP) $(WRKINST)/usr/lib/libavdevice.so* $(IDIR_LIBFFMPEG)/usr/lib
250 $(CP) $(WRKINST)/usr/lib/libavformat.so* $(IDIR_LIBFFMPEG)/usr/lib
251 $(CP) $(WRKINST)/usr/lib/libavfilter.so* $(IDIR_LIBFFMPEG)/usr/lib
252 $(CP) $(WRKINST)/usr/lib/libavcodec.so* $(IDIR_LIBFFMPEG)/usr/lib
253 $(CP) $(WRKINST)/usr/lib/libavutil.so* $(IDIR_LIBFFMPEG)/usr/lib
254 $(CP) $(WRKINST)/usr/lib/libpostproc.so* $(IDIR_LIBFFMPEG)/usr/lib
255 $(CP) $(WRKINST)/usr/lib/libswscale.so* $(IDIR_LIBFFMPEG)/usr/lib
256 $(CP) $(WRKINST)/usr/lib/libswresample.so* $(IDIR_LIBFFMPEG)/usr/lib
258 ffmpeg-install:
259 $(INSTALL_DIR) $(IDIR_FFMPEG)/usr/bin
260 $(INSTALL_BIN) $(WRKINST)/usr/bin/ffmpeg \
261 $(IDIR_FFMPEG)/usr/bin
263 ffprobe-install:
264 $(INSTALL_DIR) $(IDIR_FFPROBE)/usr/bin
265 $(INSTALL_BIN) $(WRKINST)/usr/bin/ffprobe \
266 $(IDIR_FFPROBE)/usr/bin
268 include $(ADK_TOPDIR)/mk/pkg-bottom.mk