summaryrefslogtreecommitdiff
path: root/ffmpeg-rpi/APKBUILD
blob: a370eab82b3fdc5aafae6a10ca3a8589ca78f59f (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
# Maintainer: Karel Kočí <cynerd@email.cz>
pkgname=ffmpeg-rpi
pkgver=4.2.2
pkgrel=2
pkgdesc="Complete and free Internet live audio and video broadcasting solution for Linux/Unix - Raspberry Pi"
url="https://ffmpeg.org/"
arch="armhf aarch64"
license="GPL-2.0-or-later AND LGPL-2.1-or-later"
options="!check"
subpackages="$pkgname-dev $pkgname-doc $pkgname-libs"
provides="ffmpeg"
makedepends="
	alsa-lib-dev
	coreutils
	bzip2-dev
	gnutls-dev
	imlib2-dev
	lame-dev
	libass-dev
	libssh-dev
	libtheora-dev
	libvorbis-dev
	libvpx-dev
	libxfixes-dev
	opus-dev
	perl-dev
	raspberrypi-dev
	sdl2-dev
	x264-dev
	x265-dev
	xvidcore-dev
	yasm
	zlib-dev
	"
checkdepends="rsync"
source="https://ffmpeg.org/releases/ffmpeg-$pkgver.tar.xz
	0001-libavutil-clean-up-unused-FF_SYMVER-macro.patch
	"

# add support for AV1 codec for all archies except armhf and armv7
# as aom is not available on them
_aom="";

case "$CARCH" in
	aarch64)
		_aom="--enable-libaom"; makedepends="$makedepends aom-dev" ;;
esac

unpack() {
	default_unpack
	mv "ffmpeg-$pkgver" "$builddir"
}

build() {
	local _dbg="--disable-debug"
	[ -n "$DEBUG" ] && _dbg="--enable-debug"

	./configure \
		--prefix=/usr \
		--enable-avresample \
		--enable-avfilter \
		--enable-gnutls \
		--enable-gpl \
		--enable-libass \
		--enable-libmp3lame \
		--enable-libvorbis \
		--enable-libvpx \
		--enable-libxvid \
		--enable-libx264 \
		--enable-libx265 \
		--enable-libtheora \
		--enable-postproc \
		--enable-pic \
		--enable-pthreads \
		--enable-shared \
		--enable-libxcb \
		--enable-libssh \
		--disable-stripping \
		--disable-static \
		--disable-librtmp \
		--disable-vaapi \
		--disable-vdpau \
		--enable-libopus \
		--disable-v4l2_m2m \
		--enable-omx \
		--enable-omx-rpi \
		--enable-mmal \
		--extra-cflags="-I/opt/vc/include -I/opt/vc/include/IL" \
		--extra-ldflags="-L/opt/vc/lib" \
		--extra-libs="-lbcm_host -lvcos -lvchiq_arm -lmmal -lmmal_core -lmmal_util -lvcsm" \
		$_aom $_dbg
	make
	${CC:-gcc} -o tools/qt-faststart $CFLAGS tools/qt-faststart.c
	make doc/ffmpeg.1 doc/ffplay.1
}

package() {
	make DESTDIR="$pkgdir" install install-man
	install -D -m755 tools/qt-faststart "$pkgdir/usr/bin/qt-faststart"
}

libs() {
	pkgdesc="Libraries for ffmpeg"
	replaces="ffmpeg-rpi ffmpeg"
	provides="ffmpeg-libs"
	mkdir -p "$subpkgdir"/usr
	mv "$pkgdir"/usr/lib "$subpkgdir"/usr
}

sha512sums="381cd6732fa699eb89000621cf34256920596ed1f9de3c2194dbad35fdf2165269eb7d3a147a0eb75dc18fbb6d601382b5801750e09fc63547766842f84208e3  ffmpeg-4.2.2.tar.xz
1047a23eda51b576ac200d5106a1cd318d1d5291643b3a69e025c0a7b6f3dbc9f6eb0e1e6faa231b7e38c8dd4e49a54f7431f87a93664da35825cc2e9e8aedf4  0001-libavutil-clean-up-unused-FF_SYMVER-macro.patch"