blob: aad2fed0410d79b45525d69cf6b49ca83999f59f [file] [log] [blame]
Patrick Williams8b8bc412016-08-17 15:02:23 -05001SUMMARY = "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=94d55d512a9ba36caa9b7df079bae19f"
9
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080010DEPENDS = "libpcre libav virtual/egl boost freetype dbus openssl libssh libomxil coreutils-native curl-native userland"
11
Patrick Williams8b8bc412016-08-17 15:02:23 -050012PR = "r4"
13
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080014SRCREV_default = "b4bbef8fac5e8c2ddafa895f98456ba715b39c6b"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050015
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#
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080022# This SRCREV corresponds to the v4.0.3 release of ffmpeg.
23SRCREV_ffmpeg = "fcbd117df3077bad495e99e20f01cf93737bce76"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050024
Patrick Williams8b8bc412016-08-17 15:02:23 -050025SRC_URI = "git://github.com/popcornmix/omxplayer.git;protocol=git;branch=master \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080026 git://github.com/FFmpeg/FFmpeg;branch=release/4.0;protocol=git;depth=1;name=ffmpeg;destsuffix=git/ffmpeg \
Patrick Williams8b8bc412016-08-17 15:02:23 -050027 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 \
Brad Bishopd7bf8c12018-02-25 22:55:05 -050032 file://0005-Don-t-require-internet-connection-during-build.patch \
33 file://0006-Prevent-ffmpeg-configure-compile-race-condition.patch \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080034 file://0001-Specify-cc-cxx-and-ld-variables-from-environment.patch \
35 file://cross-crompile-ffmpeg.patch \
Patrick Williams8b8bc412016-08-17 15:02:23 -050036 "
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080037
38SRC_URI_append = "${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", " file://0001-Fix-build-with-vc4-driver.patch ", "", d)}"
39
Patrick Williams8b8bc412016-08-17 15:02:23 -050040S = "${WORKDIR}/git"
41
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080042COMPATIBLE_MACHINE = "^rpi$"
43
44def cpu(d):
45 for arg in (d.getVar('TUNE_CCARGS') or '').split():
46 if arg.startswith('-mcpu='):
47 return arg[6:]
48 return 'generic'
49
50export CPU = "${@cpu(d)}"
Patrick Williams8b8bc412016-08-17 15:02:23 -050051
52inherit autotools-brokensep pkgconfig
53
Brad Bishop316dfdd2018-06-25 12:45:53 -040054# This isn't used directly by omxplayer, but applied to Makefile.ffmpeg which
55# runs the ffmpeg configuration
56PACKAGECONFIG ??= ""
57PACKAGECONFIG[samba] = "--enable-libsmbclient,--disable-libsmbclient,samba"
58
Patrick Williams8b8bc412016-08-17 15:02:23 -050059# Needed in ffmpeg configure
60export TEMPDIR = "${S}/tmp"
61
62# Needed in Makefile.ffmpeg
63export HOST = "${HOST_SYS}"
64export WORK = "${S}"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050065export FFMPEG_EXTRA_CFLAGS = "${TUNE_CCARGS} ${TOOLCHAIN_OPTIONS}"
66export FFMPEG_EXTRA_LDFLAGS = "${TUNE_CCARGS} ${TOOLCHAIN_OPTIONS}"
Patrick Williams8b8bc412016-08-17 15:02:23 -050067
68# Needed in top Makefile
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080069
Patrick Williams8b8bc412016-08-17 15:02:23 -050070export LDFLAGS = "-L${S}/ffmpeg_compiled/usr/lib \
71 -L${STAGING_DIR_HOST}/lib \
72 -L${STAGING_DIR_HOST}/usr/lib \
73 "
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080074export INCLUDES = "${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", " -D__GBM__", "", d)} \
75 -isystem${STAGING_DIR_HOST}/usr/include/interface/vcos/pthreads \
Patrick Williams8b8bc412016-08-17 15:02:23 -050076 -isystem${STAGING_DIR_HOST}/usr/include/freetype2 \
77 -isystem${STAGING_DIR_HOST}/usr/include/interface/vmcs_host/linux \
78 -isystem${STAGING_DIR_HOST}/usr/include/dbus-1.0 \
79 -isystem${STAGING_DIR_HOST}/usr/lib/dbus-1.0/include \
80 "
81export DIST = "${D}"
82
83do_compile() {
84 # Needed for compiler test in ffmpeg's configure
85 mkdir -p tmp
86
Brad Bishop316dfdd2018-06-25 12:45:53 -040087 sed -i 's/--enable-libsmbclient/${@bb.utils.contains("PACKAGECONFIG", "samba", "--enable-libsmbclient", "--disable-libsmbclient", d)}/g' Makefile.ffmpeg
88
Brad Bishopd7bf8c12018-02-25 22:55:05 -050089 oe_runmake -f Makefile.ffmpeg
90 oe_runmake -f Makefile.ffmpeg install
Patrick Williams8b8bc412016-08-17 15:02:23 -050091 oe_runmake
92}
93
94do_install() {
95 oe_runmake STRIP='echo skipping strip' dist
96 mkdir -p ${D}${datadir}/fonts/truetype/freefont/
97 install ${S}/fonts/* ${D}${datadir}/fonts/truetype/freefont/
98}
99
100FILES_${PN} = "${bindir}/omxplayer* \
101 ${libdir}/omxplayer/lib*${SOLIBS} \
102 ${datadir}/fonts"
103
104FILES_${PN}-dev += "${libdir}/omxplayer/*.so"
105
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800106RDEPENDS_${PN} += "bash procps userland"