1SUMMARY = "A commandline OMX player for the Raspberry Pi"
2DESCRIPTION = "This player was developed as a testbed for the XBMC \
3Raspberry PI implementation and is quite handy to use standalone"
4HOMEPAGE = "https://github.com/popcornmix/omxplayer"
5SECTION = "console/utils"
6
7LICENSE = "GPLv2"
8LIC_FILES_CHKSUM = "file://COPYING;md5=00a27da7ac0f9bcd17320ec29ef4bbf6"
9
10DEPENDS = "libpcre libav virtual/egl boost freetype dbus openssl libssh virtual/libomxil coreutils-native curl-native userland"
11
12PR = "r5"
13
14SRCREV_default = "f543a0d0e707ab56415f17b0ca6d397394ee8b63"
15
16# omxplayer builds its own copy of ffmpeg from source instead of using the
17# system's ffmpeg library. This isn't ideal but it's ok for now. We do however
18# want to keep control of the exact version of ffmpeg used instead of just
19# fetching the latest commit on a release branch (which is what the checkout job
20# in Makefile.ffmpeg in the omxplayer source tree does).
21#
22# This SRCREV corresponds to the v4.0.3 release of ffmpeg.
23SRCREV_ffmpeg = "fcbd117df3077bad495e99e20f01cf93737bce76"
24
25SRC_URI = "git://github.com/popcornmix/omxplayer.git;protocol=https;branch=master \
26           git://github.com/FFmpeg/FFmpeg;branch=release/4.0;protocol=https;depth=1;name=ffmpeg;destsuffix=git/ffmpeg \
27           file://0002-Libraries-and-headers-from-ffmpeg-are-installed-in-u.patch \
28           file://0003-Remove-strip-step-in-Makefile.patch \
29           file://0004-Add-FFMPEG_EXTRA_CFLAGS-and-FFMPEG_EXTRA_LDFLAGS.patch \
30           file://fix-tar-command-with-DIST.patch \
31           file://use-native-pkg-config.patch \
32           file://0005-Don-t-require-internet-connection-during-build.patch \
33           file://0006-Prevent-ffmpeg-configure-compile-race-condition.patch \
34           file://0001-Specify-cc-cxx-and-ld-variables-from-environment.patch \
35           file://cross-crompile-ffmpeg.patch \
36           file://0007-Remove-Makefile-hardcoded-arch-tune.patch \
37           "
38
39SRC_URI:append = "${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", " file://0001-Fix-build-with-vc4-driver.patch ", "", d)}"
40
41S = "${WORKDIR}/git"
42
43COMPATIBLE_MACHINE = "^rpi$"
44COMPATIBLE_HOST:aarch64 = "null"
45
46def cpu(d):
47    for arg in (d.getVar('TUNE_CCARGS') or '').split():
48        if arg.startswith('-mcpu='):
49            return arg[6:]
50    return 'generic'
51
52export CPU = "${@cpu(d)}"
53
54inherit autotools-brokensep pkgconfig
55
56# This isn't used directly by omxplayer, but applied to Makefile.ffmpeg which
57# runs the ffmpeg configuration
58PACKAGECONFIG ??= ""
59PACKAGECONFIG[samba] = "--enable-libsmbclient,--disable-libsmbclient,samba"
60
61# Needed in ffmpeg configure
62export TEMPDIR = "${S}/tmp"
63
64# Needed in Makefile.ffmpeg
65export HOST = "${HOST_SYS}"
66export WORK = "${S}"
67export FFMPEG_EXTRA_CFLAGS  = "${TUNE_CCARGS} ${TOOLCHAIN_OPTIONS}"
68export FFMPEG_EXTRA_LDFLAGS  = "${TUNE_CCARGS} ${TOOLCHAIN_OPTIONS}"
69
70# Needed in top Makefile
71
72export LDFLAGS = "-L${S}/ffmpeg_compiled/usr/lib \
73                  -L${STAGING_DIR_HOST}/lib \
74                  -L${STAGING_DIR_HOST}/usr/lib \
75                 "
76export INCLUDES = "${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", " -D__GBM__", "", d)} \
77                   -isystem${STAGING_DIR_HOST}/usr/include/interface/vcos/pthreads \
78                   -isystem${STAGING_DIR_HOST}/usr/include/freetype2 \
79                   -isystem${STAGING_DIR_HOST}/usr/include/interface/vmcs_host/linux \
80                   -isystem${STAGING_DIR_HOST}/usr/include/dbus-1.0 \
81                   -isystem${STAGING_DIR_HOST}/usr/lib/dbus-1.0/include \
82                  "
83export DIST = "${D}"
84
85do_compile() {
86    # Needed for compiler test in ffmpeg's configure
87    mkdir -p tmp
88
89    sed -i 's/--enable-libsmbclient/${@bb.utils.contains("PACKAGECONFIG", "samba", "--enable-libsmbclient", "--disable-libsmbclient", d)}/g' Makefile.ffmpeg
90
91    oe_runmake -f Makefile.ffmpeg
92    oe_runmake -f Makefile.ffmpeg install
93    oe_runmake
94}
95
96do_install() {
97    oe_runmake STRIP='echo skipping strip' dist
98    mkdir -p ${D}${datadir}/fonts/truetype/freefont/
99    install ${S}/fonts/* ${D}${datadir}/fonts/truetype/freefont/
100}
101
102FILES:${PN} = "${bindir}/omxplayer* \
103               ${libdir}/omxplayer/lib*${SOLIBS} \
104               ${datadir}/fonts"
105
106FILES:${PN}-dev += "${libdir}/omxplayer/*.so"
107
108RDEPENDS:${PN} += "bash procps userland"
109