From 6647bb651f1f33f4ab761c4aa129928fe3ae5f87 Mon Sep 17 00:00:00 2001 From: Andrei Gherzan Date: Mon, 27 Aug 2012 16:51:26 +0300 Subject: omxplayer: Integrate git revision 231c08b42005e3de565013bc1cee18bd5a349c1f Add four patches: 1. don-t-strip-while-installing.patch Don't strip binaries because buildsystem will strip them after all. 2. libraries-are-installed-in-usr-lib.patch Libraries are installed in /usr/lib not in /usr/local/lib 3, remove-hardcoded-directory-omxplayer-dist.patch We want files to be installed in ${D}. Add a variable in Makefile to let users install omxplayer in a specific location. 4. remove-makefile-include.patch Remove Makefile.include as it includes hardcoded paths. Rely on variables provided by build system. [GITHUB #34] Signed-off-by: Andrei Gherzan --- .../omxplayer/don-t-strip-while-installing.patch | 28 +++++++++ .../libraries-are-installed-in-usr-lib.patch | 37 ++++++++++++ ...remove-hardcoded-directory-omxplayer-dist.patch | 32 ++++++++++ .../omxplayer/remove-makefile-include.patch | 69 ++++++++++++++++++++++ recipes-multimedia/omxplayer/omxplayer_git.bb | 62 +++++++++++++++++++ 5 files changed, 228 insertions(+) create mode 100644 recipes-multimedia/omxplayer/omxplayer/don-t-strip-while-installing.patch create mode 100644 recipes-multimedia/omxplayer/omxplayer/libraries-are-installed-in-usr-lib.patch create mode 100644 recipes-multimedia/omxplayer/omxplayer/remove-hardcoded-directory-omxplayer-dist.patch create mode 100644 recipes-multimedia/omxplayer/omxplayer/remove-makefile-include.patch create mode 100644 recipes-multimedia/omxplayer/omxplayer_git.bb diff --git a/recipes-multimedia/omxplayer/omxplayer/don-t-strip-while-installing.patch b/recipes-multimedia/omxplayer/omxplayer/don-t-strip-while-installing.patch new file mode 100644 index 0000000..4f12cc0 --- /dev/null +++ b/recipes-multimedia/omxplayer/omxplayer/don-t-strip-while-installing.patch @@ -0,0 +1,28 @@ +Build system will strip binaries so remove strip step in Makefile. +Avoid warnings/errors like: +WARNING: File '/usr/lib/omxplayer/libavutil.so.51.56.100' from +omxplayer was already stripped, this will prevent future debugging! + +Upstream-Status: Inappropriate [embedded specific] +Signed-off-by: Andrei Gherzan + +Index: git/Makefile.ffmpeg +=================================================================== +--- git.orig/Makefile.ffmpeg 2012-08-26 15:38:45.099379852 +0300 ++++ git/Makefile.ffmpeg 2012-08-26 15:46:51.913055176 +0300 +@@ -52,7 +52,8 @@ + --enable-hardcoded-tables \ + --disable-runtime-cpudetect \ + --disable-debug \ +- --cross-prefix=$(HOST)- ++ --cross-prefix=$(HOST)- \ ++ --disable-stripping + + clean: + @rm -rf ffmpeg +@@ -63,5 +64,4 @@ + + install: + cd ffmpeg; make -j9 DESTDIR="$(WORK)/ffmpeg_compiled" install +- $(HOST)-strip ffmpeg_compiled/usr/lib/*.so + diff --git a/recipes-multimedia/omxplayer/omxplayer/libraries-are-installed-in-usr-lib.patch b/recipes-multimedia/omxplayer/omxplayer/libraries-are-installed-in-usr-lib.patch new file mode 100644 index 0000000..1126bfb --- /dev/null +++ b/recipes-multimedia/omxplayer/omxplayer/libraries-are-installed-in-usr-lib.patch @@ -0,0 +1,37 @@ +Libraries and headers from ffmpeg are installed in usr/lib. + +Upstream-Status: Pending +Signed-off-by: Andrei Gherzan + +Index: git/Makefile.ffmpeg +=================================================================== +--- git.orig/Makefile.ffmpeg 2012-08-26 02:46:40.380518313 +0300 ++++ git/Makefile.ffmpeg 2012-08-26 02:46:40.512511177 +0300 +@@ -63,5 +63,5 @@ + + install: + cd ffmpeg; make -j9 DESTDIR="$(WORK)/ffmpeg_compiled" install +- $(HOST)-strip ffmpeg_compiled/usr/local/lib/*.so ++ $(HOST)-strip ffmpeg_compiled/usr/lib/*.so + +Index: git/Makefile +=================================================================== +--- git.orig/Makefile 2012-08-26 02:52:11.578611542 +0300 ++++ git/Makefile 2012-08-26 02:52:53.952320465 +0300 +@@ -1,7 +1,7 @@ + CFLAGS+=-std=c++0x -DSTANDALONE -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -D_LINUX -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CMAKE_CONFIG -D__VIDEOCORE4__ -U_FORTIFY_SOURCE -Wall -DHAVE_OMXLIB -DUSE_EXTERNAL_FFMPEG -DHAVE_LIBAVCODEC_AVCODEC_H -DHAVE_LIBAVUTIL_OPT_H -DHAVE_LIBAVUTIL_MEM_H -DHAVE_LIBAVUTIL_AVUTIL_H -DHAVE_LIBAVFORMAT_AVFORMAT_H -DHAVE_LIBAVFILTER_AVFILTER_H -DOMX -DOMX_SKIP64BIT -ftree-vectorize -DUSE_EXTERNAL_OMX -DTARGET_RASPBERRY_PI -DUSE_EXTERNAL_LIBBCM_HOST + +-LDFLAGS+=-L./ -lc -lWFC -lGLESv2 -lEGL -lbcm_host -lopenmaxil -lfreetype -lz -Lffmpeg_compiled/usr/local/lib/ +-INCLUDES+=-I./ -Ilinux -Iffmpeg_compiled/usr/local/include/ ++LDFLAGS+=-L./ -lc -lWFC -lGLESv2 -lEGL -lbcm_host -lopenmaxil -lfreetype -lz -Lffmpeg_compiled/usr/lib/ ++INCLUDES+=-I./ -Ilinux -Iffmpeg_compiled/usr/include/ + + SRC=linux/XMemUtils.cpp \ + utils/log.cpp \ +@@ -63,5 +63,5 @@ + cp omxplayer omxplayer.bin omxplayer-dist/usr/usr/bin + cp COPYING omxplayer-dist/usr/share/doc/ + cp README.md omxplayer-dist/usr/share/doc/README +- cp -a ffmpeg_compiled/usr/local/lib/*.so* omxplayer-dist/usr/lib/omxplayer/ ++ cp -a ffmpeg_compiled/usr/lib/*.so* omxplayer-dist/usr/lib/omxplayer/ + tar -czf omxplayer-dist.tar.gz omxplayer-dist diff --git a/recipes-multimedia/omxplayer/omxplayer/remove-hardcoded-directory-omxplayer-dist.patch b/recipes-multimedia/omxplayer/omxplayer/remove-hardcoded-directory-omxplayer-dist.patch new file mode 100644 index 0000000..99fbbf8 --- /dev/null +++ b/recipes-multimedia/omxplayer/omxplayer/remove-hardcoded-directory-omxplayer-dist.patch @@ -0,0 +1,32 @@ +Modify install rule to use /usr/bin path and not /usr/usr/bin for +installing omxplayer binary and script. +As well, add a variable to let the user specify where to install +the files. + +Upstream-Status: Pending +Signed-off-by: Andrei Gherzan + +Index: git/Makefile +=================================================================== +--- git.orig/Makefile 2012-08-26 05:03:31.710678243 +0300 ++++ git/Makefile 2012-08-26 05:03:11.000000000 +0300 +@@ -59,11 +57,11 @@ + make -f Makefile.ffmpeg install + + dist: omxplayer.bin +- mkdir -p omxplayer-dist/usr/lib/omxplayer +- mkdir -p omxplayer-dist/usr/usr/bin +- mkdir -p omxplayer-dist/usr/share/doc +- cp omxplayer omxplayer.bin omxplayer-dist/usr/usr/bin +- cp COPYING omxplayer-dist/usr/share/doc/ +- cp README.md omxplayer-dist/usr/share/doc/README +- cp -a ffmpeg_compiled/usr/lib/*.so* omxplayer-dist/usr/lib/omxplayer/ +- tar -czf omxplayer-dist.tar.gz omxplayer-dist ++ mkdir -p $(DEST)/usr/lib/omxplayer ++ mkdir -p $(DEST)/usr/bin ++ mkdir -p $(DEST)/usr/share/doc ++ cp omxplayer omxplayer.bin $(DEST)/usr/bin ++ cp COPYING $(DEST)/usr/share/doc/ ++ cp README.md $(DEST)/usr/share/doc/README ++ cp -a ffmpeg_compiled/usr/lib/*.so* $(DEST)/usr/lib/omxplayer/ ++ tar -czf omxplayer-dist.tar.gz $(DEST) diff --git a/recipes-multimedia/omxplayer/omxplayer/remove-makefile-include.patch b/recipes-multimedia/omxplayer/omxplayer/remove-makefile-include.patch new file mode 100644 index 0000000..b4f3cd6 --- /dev/null +++ b/recipes-multimedia/omxplayer/omxplayer/remove-makefile-include.patch @@ -0,0 +1,69 @@ +Remove Makefile.include which includes hardcoded paths and rely on +variables provided by build system. + +Upstream-Status: Inappropriate [embedded specific] +Signed-off-by: Andrei Gherzan + +Index: git/Makefile.ffmpeg +=================================================================== +--- git.orig/Makefile.ffmpeg 2012-08-26 01:04:27.208235775 +0300 ++++ git/Makefile.ffmpeg 2012-08-26 01:05:03.958245731 +0300 +@@ -1,5 +1,3 @@ +-include Makefile.include +- + CFLAGS=-D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -D_LINUX -fPIC -DPIC -D_REENTRANT -D_HAVE_SBRK -D_LARGEFILE64_SOURCE -DHAVE_CMAKE_CONFIG -DHAVE_VMCS_CONFIG -D_REENTRANT -DUSE_VCHIQ_ARM -DVCHI_BULK_ALIGN=1 -DVCHI_BULK_GRANULARITY=1 -DEGL_SERVER_DISPMANX -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D__VIDEOCORE4__ -DGRAPHICS_X_VG=1 -U_FORTIFY_SOURCE -Wall -DHAVE_OMXLIB -DUSE_EXTERNAL_FFMPEG -DHAVE_LIBAVCODEC_AVCODEC_H -DHAVE_LIBAVUTIL_MEM_H -DHAVE_LIBAVUTIL_AVUTIL_H -DHAVE_LIBAVFORMAT_AVFORMAT_H -DHAVE_LIBAVFILTER_AVFILTER_H -DOMX -DOMX_SKIP64BIT + + WORK=$(PWD) +Index: git/Makefile +=================================================================== +--- git.orig/Makefile 2012-08-25 21:46:44.771745783 +0300 ++++ git/Makefile 2012-08-25 21:48:59.220406089 +0300 +@@ -1,5 +1,3 @@ +-include Makefile.include +- + CFLAGS+=-std=c++0x -DSTANDALONE -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -D_LINUX -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CMAKE_CONFIG -D__VIDEOCORE4__ -U_FORTIFY_SOURCE -Wall -DHAVE_OMXLIB -DUSE_EXTERNAL_FFMPEG -DHAVE_LIBAVCODEC_AVCODEC_H -DHAVE_LIBAVUTIL_OPT_H -DHAVE_LIBAVUTIL_MEM_H -DHAVE_LIBAVUTIL_AVUTIL_H -DHAVE_LIBAVFORMAT_AVFORMAT_H -DHAVE_LIBAVFILTER_AVFILTER_H -DOMX -DOMX_SKIP64BIT -ftree-vectorize -DUSE_EXTERNAL_OMX -DTARGET_RASPBERRY_PI -DUSE_EXTERNAL_LIBBCM_HOST + + LDFLAGS+=-L./ -lc -lWFC -lGLESv2 -lEGL -lbcm_host -lopenmaxil -lfreetype -lz -Lffmpeg_compiled/usr/local/lib/ +Index: git/Makefile.include +=================================================================== +--- git.orig/Makefile.include 2012-08-25 21:46:44.771745783 +0300 ++++ /dev/null 1970-01-01 00:00:00.000000000 +0000 +@@ -1,38 +0,0 @@ +-USE_BUILDROOT=1 +-FLOAT=hard +- +-ifeq ($(USE_BUILDROOT), 1) +-BUILDROOT :=/opt/xbmc-bcm/buildroot +-SDKSTAGE :=$(BUILDROOT)/output/staging +-TARGETFS :=$(BUILDROOT)/output/target +-TOOLCHAIN :=$(BUILDROOT)/output/host/usr/ +-HOST :=arm-unknown-linux-gnueabi +-SYSROOT :=$(BUILDROOT)/output/host/usr/arm-unknown-linux-gnueabi/sysroot +-else +-BUILDROOT :=/opt/bcm-rootfs +-SDKSTAGE :=/opt/bcm-rootfs +-TARGETFS :=/opt/bcm-rootfs +-TOOLCHAIN :=/usr/local/bcm-gcc +-HOST :=bcm2708 +-SYSROOT :=$(TOOLCHAIN)/arm-bcm2708-linux-gnueabi/sys-root +-endif +- +-JOBS=7 +- +-CFLAGS := -isystem$(PREFIX)/include +-CXXFLAGS := $(CFLAGS) +-CPPFLAGS := $(CFLAGS) +-LDFLAGS := -L$(BUILDROOT)/lib +-LD := $(TOOLCHAIN)/bin/$(HOST)-ld --sysroot=$(SYSROOT) +-CC := $(TOOLCHAIN)/bin/$(HOST)-gcc --sysroot=$(SYSROOT) +-CXX := $(TOOLCHAIN)/bin/$(HOST)-g++ --sysroot=$(SYSROOT) +-OBJDUMP := $(TOOLCHAIN)/bin/$(HOST)-objdump +-RANLIB := $(TOOLCHAIN)/bin/$(HOST)-ranlib +-STRIP := $(TOOLCHAIN)/bin/$(HOST)-strip +-AR := $(TOOLCHAIN)/bin/$(HOST)-ar +-CXXCP := $(CXX) -E +-PATH := $(PREFIX)/bin:$(BUILDROOT)/output/host/usr/bin:$(PATH) +- +-CFLAGS += -pipe -mfloat-abi=$(FLOAT) -mcpu=arm1176jzf-s -fomit-frame-pointer -mabi=aapcs-linux -mtune=arm1176jzf-s -mfpu=vfp -Wno-psabi -mno-apcs-stack-check -O3 -mstructure-size-boundary=32 -mno-sched-prolog +-LDFLAGS += -L$(SDKSTAGE)/lib -L$(SDKSTAGE)/usr/lib -L$(SDKSTAGE)/opt/vc/lib/ +-INCLUDES += -isystem$(SDKSTAGE)/usr/include -isystem$(SDKSTAGE)/opt/vc/include -isystem$(SYSROOT)/usr/include -isystem$(SDKSTAGE)/opt/vc/include/interface/vcos/pthreads -isystem$(SDKSTAGE)/usr/include/freetype2 diff --git a/recipes-multimedia/omxplayer/omxplayer_git.bb b/recipes-multimedia/omxplayer/omxplayer_git.bb new file mode 100644 index 0000000..b637ba6 --- /dev/null +++ b/recipes-multimedia/omxplayer/omxplayer_git.bb @@ -0,0 +1,62 @@ +DESCRIPTION = "OMXPlayer is a commandline OMX player for the Raspberry Pi" +HOMEPAGE = "https://github.com/huceke/omxplayer" +SECTION = "console/utils" +LICENSE = "GPLv2" + +LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" + +DEPENDS = "libpcre libav virtual/egl boost freetype" + +PR = "r0" + +SRCREV = "231c08b42005e3de565013bc1cee18bd5a349c1f" +SRC_URI = "git://github.com/huceke/omxplayer.git;protocol=git;branch=master \ + file://remove-makefile-include.patch \ + file://libraries-are-installed-in-usr-lib.patch \ + file://remove-hardcoded-directory-omxplayer-dist.patch \ + file://don-t-strip-while-installing.patch \ + " +S = "${WORKDIR}/git" + +COMPATIBLE_MACHINE = "raspberrypi" + +inherit autotools + +# Variable added in Makefile to INCLUDE +export ADD_INCDIR = "-I${STAGING_INCDIR}/interface/vcos/pthreads -I${STAGING_INCDIR}/freetype2" + +# Needed in configure from Makefile.ffmpeg +export HOST = "${HOST_SYS}" +export WORK = "${S}" +export TEMPDIR = "${S}/tmp" +export FLOAT = "softfp" + +export LDFLAGS = "-L${S}/ffmpeg_compiled/usr/lib \ + -L${STAGING_DIR_HOST}/lib \ + -L${STAGING_DIR_HOST}/usr/lib \ + " + +export INCLUDES = "-isystem${STAGING_DIR_HOST}/usr/include \ + -isystem${STAGING_DIR_HOST}/usr/include/interface/vcos/pthreads \ + -isystem${STAGING_DIR_HOST}/usr/include/freetype2 \ + " + +# Install in ${D} +export DEST = "${D}" + +do_compile() { + # Needed for compiler test in ffmpeg's configure + mkdir -p tmp + + oe_runmake ffmpeg + oe_runmake +} + +do_install() { + oe_runmake dist +} + +FILES_${PN} = "${bindir}/omxplayer* \ + ${libdir}/omxplayer/lib*${SOLIBS}" + +FILES_${PN}-dev += "${libdir}/omxplayer/*.so" -- cgit v1.2.3-54-g00ecf