From 349b4c05fd4042847b89a55ea411e70859608cae Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Thu, 23 May 2013 15:13:09 +0200 Subject: [PATCH] new package: add package 'libamlplayer-m3' Signed-off-by: Stephan Raue --- packages/multimedia/libamlplayer-m3/build | 168 ++++++++++++++++++ packages/multimedia/libamlplayer-m3/install | 33 ++++ packages/multimedia/libamlplayer-m3/meta | 36 ++++ ...yer-m3-crosscompiling_and_buildfixes.patch | 126 +++++++++++++ tools/mkpkg/mkpkg_libamlplayer-m3 | 43 +++++ 5 files changed, 406 insertions(+) create mode 100755 packages/multimedia/libamlplayer-m3/build create mode 100755 packages/multimedia/libamlplayer-m3/install create mode 100644 packages/multimedia/libamlplayer-m3/meta create mode 100644 packages/multimedia/libamlplayer-m3/patches/libamlplayer-m3-crosscompiling_and_buildfixes.patch create mode 100755 tools/mkpkg/mkpkg_libamlplayer-m3 diff --git a/packages/multimedia/libamlplayer-m3/build b/packages/multimedia/libamlplayer-m3/build new file mode 100755 index 0000000000..085f3b9bc9 --- /dev/null +++ b/packages/multimedia/libamlplayer-m3/build @@ -0,0 +1,168 @@ +#!/bin/sh + +################################################################################ +# This file is part of OpenELEC - http://www.openelec.tv +# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv) +# +# This Program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This Program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with OpenELEC.tv; see the file COPYING. If not, write to +# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA. +# http://www.gnu.org/copyleft/gpl.html +################################################################################ + +. config/options $1 + +if [ "$DEBUG" = yes ]; then + AMFFMPEG_DEBUG="--enable-debug --disable-stripping" +else + AMFFMPEG_DEBUG="--disable-debug --enable-stripping" +fi + +if [ "$OPTIMIZATIONS" = size ]; then + AMFFMPEG_OPTIM="--disable-small" +else + AMFFMPEG_OPTIM="--disable-small" +fi + +case "$TARGET_FPU" in + neon*) + AMFFMPEG_FPU="--enable-neon" + ;; + vfp*) + AMFFMPEG_FPU="" + ;; + *) + AMFFMPEG_FPU="" + ;; +esac + +export pkg_config="$ROOT/$TOOLCHAIN/bin/pkg-config" + +# ffmpeg fails building with LTO support + strip_lto + +# ffmpeg fails running with GOLD support + strip_gold + +# dont use -Wl,--as-needed because of linking problems + LDFLAGS=`echo $LDFLAGS | sed -e "s|-Wl,--as-needed||"` + +cd $PKG_BUILD/ + +echo "### building amavutils ###" +cd amavutils + make + mkdir -p $SYSROOT_PREFIX/usr/lib + cp -PR libamavutils.so $SYSROOT_PREFIX/usr/lib + +echo "### building amffmpeg ###" +cd ../amffmpeg +./configure --prefix=/usr \ + --cpu=$TARGET_CPU \ + --arch=$TARGET_ARCH \ + --enable-cross-compile \ + --cross-prefix=$TARGET_PREFIX \ + --sysroot=$SYSROOT_PREFIX \ + --sysinclude="$SYSROOT_PREFIX/usr/include" \ + --target-os="linux" \ + --nm="$NM" \ + --ar="$AR" \ + --as="$CC" \ + --cc="$CC" \ + --ld="$CC" \ + --host-cc="$HOST_CC" \ + --host-cflags="$HOST_CFLAGS" \ + --host-ldflags="$HOST_LDFLAGS" \ + --host-libs="-lm" \ + --extra-cflags="$CFLAGS -I$ROOT/$PKG_BUILD/amavutils/include" \ + --extra-ldflags="$LDFLAGS" \ + --extra-libs="-lamavutils" \ + --extra-version="" \ + --build-suffix="_aml" \ + --disable-static \ + --enable-shared \ + --enable-gpl \ + --disable-doc \ + $AMFFMPEG_DEBUG \ + --enable-pic \ + --disable-ffprobe \ + --disable-ffplay \ + --disable-ffserver \ + --disable-ffmpeg \ + --enable-postproc \ + --enable-avfilter \ + --enable-pthreads \ + $AMFFMPEG_OPTIM \ + --enable-runtime-cpudetect \ + --disable-amd3dnow \ + --disable-amd3dnowext \ + --disable-mmx \ + --disable-mmx2 \ + --disable-sse \ + --disable-ssse3 \ + --disable-armv5te \ + --disable-armv6t2 \ + --disable-iwmmxt \ + --enable-hardcoded-tables \ + --disable-encoders \ + --disable-muxers \ + --disable-bzlib \ + --enable-librtmp \ + --disable-libschroedinger \ + --disable-libspeex \ + --disable-libtheora \ + --disable-libvo-aacenc \ + --disable-libvo-amrwbenc \ + --disable-libvorbis \ + --disable-libvpx \ + --disable-libx264 \ + --disable-libxavs \ + --disable-libxvid \ + --enable-zlib \ + --enable-asm \ + --disable-altivec \ + $AMFFMPEG_FPU \ + --disable-vis \ + --enable-yasm \ + +make V=1 + +mkdir -p $SYSROOT_PREFIX/usr/lib + cp -PR */lib*.so* $SYSROOT_PREFIX/usr/lib + +echo "### building amadec ###" +cd ../amadec + make + + mkdir -p $SYSROOT_PREFIX/usr/lib + cp -PR libamadec.so $SYSROOT_PREFIX/usr/lib + +echo "### building amcodec ###" +cd ../amcodec + make -j1 + + mkdir -p $SYSROOT_PREFIX/usr/lib + cp -PR libamcodec.so.0.0 $SYSROOT_PREFIX/usr/lib/libamcodec.so + + mkdir -p $SYSROOT_PREFIX/usr/include/amlplayer/ + cp -PR include/* $SYSROOT_PREFIX/usr/include/amlplayer/ + +echo "### building amplayer ###" +cd ../amplayer + make -j1 CC="$TARGET_CC" LD="$TARGET_LD" PREFIX="$SYSROOT_PREFIX/usr" -f Makefile.mk + + mkdir -p $SYSROOT_PREFIX/usr/lib + cp -PR libamplayer.so $SYSROOT_PREFIX/usr/lib + + mkdir -p $SYSROOT_PREFIX/usr/include/amlplayer/ + cp -PR player/include/* $SYSROOT_PREFIX/usr/include/amlplayer/ diff --git a/packages/multimedia/libamlplayer-m3/install b/packages/multimedia/libamlplayer-m3/install new file mode 100755 index 0000000000..06f27d3567 --- /dev/null +++ b/packages/multimedia/libamlplayer-m3/install @@ -0,0 +1,33 @@ +#!/bin/sh + +################################################################################ +# This file is part of OpenELEC - http://www.openelec.tv +# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv) +# +# This Program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This Program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with OpenELEC.tv; see the file COPYING. If not, write to +# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA. +# http://www.gnu.org/copyleft/gpl.html +################################################################################ + +. config/options $1 + +mkdir -p $INSTALL/usr/lib + cp -P $PKG_BUILD/amavutils/libamavutils.so $INSTALL/usr/lib + cp -P $PKG_BUILD/amffmpeg/*/lib*.so* $INSTALL/usr/lib + cp -P $PKG_BUILD/amadec/libamadec.so $INSTALL/usr/lib + cp -P $PKG_BUILD/amcodec/libamcodec.so.0.0 $INSTALL/usr/lib/libamcodec.so + cp -P $PKG_BUILD/amplayer/libamplayer.so $INSTALL/usr/lib + +mkdir -p $INSTALL/lib/firmware + cp -P $PKG_BUILD/amadec/firmware/*.bin $INSTALL/lib/firmware diff --git a/packages/multimedia/libamlplayer-m3/meta b/packages/multimedia/libamlplayer-m3/meta new file mode 100644 index 0000000000..4ee7326400 --- /dev/null +++ b/packages/multimedia/libamlplayer-m3/meta @@ -0,0 +1,36 @@ +################################################################################ +# This file is part of OpenELEC - http://www.openelec.tv +# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv) +# +# This Program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This Program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with OpenELEC.tv; see the file COPYING. If not, write to +# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA. +# http://www.gnu.org/copyleft/gpl.html +################################################################################ + +PKG_NAME="libamlplayer-m3" +PKG_VERSION="e690701" +PKG_REV="1" +PKG_ARCH="any" +PKG_LICENSE="LGPL" +PKG_SITE="http://openlinux.amlogic.com" +PKG_URL="$DISTRO_SRC/$PKG_NAME-$PKG_VERSION.tar.xz" +PKG_DEPENDS="alsa-lib rtmpdump" +PKG_BUILD_DEPENDS="toolchain alsa-lib rtmpdump" +PKG_PRIORITY="optional" +PKG_SECTION="multimedia" +PKG_SHORTDESC="libamlplayer: tools for Amlogic Meson3 support." +PKG_LONGDESC="libamlplayer: tools for Amlogic Meson3 support." + +PKG_IS_ADDON="no" +PKG_AUTORECONF="no" diff --git a/packages/multimedia/libamlplayer-m3/patches/libamlplayer-m3-crosscompiling_and_buildfixes.patch b/packages/multimedia/libamlplayer-m3/patches/libamlplayer-m3-crosscompiling_and_buildfixes.patch new file mode 100644 index 0000000000..7461697481 --- /dev/null +++ b/packages/multimedia/libamlplayer-m3/patches/libamlplayer-m3-crosscompiling_and_buildfixes.patch @@ -0,0 +1,126 @@ +diff -Naur libamlplayer-m3-e690701/amadec/Makefile libamlplayer-m3-e690701.patch/amadec/Makefile +--- libamlplayer-m3-e690701/amadec/Makefile 2013-05-21 16:47:00.000000000 +0200 ++++ libamlplayer-m3-e690701.patch/amadec/Makefile 2013-05-22 17:37:18.340730344 +0200 +@@ -19,18 +19,16 @@ + + LDFLAGS += -shared -lpthread -lm -lasound -lrt + +-TARGET_DIR=$(shell pwd)/../../../target +-STAGING_DIR=$(shell pwd)/../../../staging +-CFLAGS+=-O2 +-CFLAGS+=-I$(shell pwd) -I$(shell pwd)/include -I${STAGING_DIR}/include -I${STAGING_DIR}/usr/include -L${TARGET_DIR}/lib -L${TARGET_DIR}/usr/lib ++CFLAGS+=-O2 -fPIC ++CFLAGS+=-I$(shell pwd) -I$(shell pwd)/include + CFLAGS+=-DALSA_OUT -DENABLE_WAIT_FORMAT + + export CC CFLAGS + +-all: $(TARGET) ++all: $(TARGET) + + $(TARGET): $(TARGET_OBJS) +- $(CC) $(CFLAGS) $(LDFLAGS) $(TARGET_OBJS:%.o=%.c) -o $@ ++ $(CC) $(CFLAGS) $(LDFLAGS) $(TARGET_OBJS:%.o=%.c) -o $@ + + install:$(TARGET) + -install -m 555 ${TARGET} $(INSTALL_DIR) +diff -Naur libamlplayer-m3-e690701/amavutils/Makefile libamlplayer-m3-e690701.patch/amavutils/Makefile +--- libamlplayer-m3-e690701/amavutils/Makefile 2013-05-21 16:47:00.000000000 +0200 ++++ libamlplayer-m3-e690701.patch/amavutils/Makefile 2013-05-22 15:21:28.235921298 +0200 +@@ -4,18 +4,15 @@ + + LDFLAGS += -shared -lm -lrt + +-TARGET_DIR=$(shell pwd)/../../../target +-STAGING_DIR=$(shell pwd)/../../../staging +- + CFLAGS+=-O2 +-CFLAGS+=-I$(shell pwd) -I$(shell pwd)/include -I${STAGING_DIR}/include -I${STAGING_DIR}/usr/include -L${TARGET_DIR}/lib -L${TARGET_DIR}/usr/lib ++CFLAGS+=-I$(shell pwd) -I$(shell pwd)/include + + export CC CFLAGS + +-all: $(TARGET) ++all: $(TARGET) + + $(TARGET): $(TARGET_OBJS) +- $(CC) $(CFLAGS) $(LDFLAGS) $(TARGET_OBJS:%.o=%.c) -o $@ ++ $(CC) $(CFLAGS) $(LDFLAGS) $(TARGET_OBJS:%.o=%.c) -o $@ + + clean: + -rm -rf *.o $(TARGET) +\ Kein Zeilenumbruch am Dateiende. +diff -Naur libamlplayer-m3-e690701/amcodec/include/amports/aformat.h libamlplayer-m3-e690701.patch/amcodec/include/amports/aformat.h +--- libamlplayer-m3-e690701/amcodec/include/amports/aformat.h 2013-05-21 16:47:00.000000000 +0200 ++++ libamlplayer-m3-e690701.patch/amcodec/include/amports/aformat.h 2013-05-22 17:49:43.661363212 +0200 +@@ -76,7 +76,7 @@ + ||(afmt == AFORMAT_AMR)\ + ||(afmt == AFORMAT_ALAC)\ + ||(afmt == AFORMAT_AC3) \ +- ||(afmt == AFORMAT_EAC3) \ ++ ||(afmt == AFORMAT_EAC3) \ + ||(afmt == AFORMAT_APE) \ + ||(afmt == AFORMAT_FLAC) ) + +diff -Naur libamlplayer-m3-e690701/amcodec/Makefile libamlplayer-m3-e690701.patch/amcodec/Makefile +--- libamlplayer-m3-e690701/amcodec/Makefile 2013-05-21 16:47:00.000000000 +0200 ++++ libamlplayer-m3-e690701.patch/amcodec/Makefile 2013-05-22 15:25:05.214211763 +0200 +@@ -35,9 +35,6 @@ + INCLUDE=${SRCTREE}/include/ + #CFLAGS=-O0 -gdwarf-2 -g + CFLAGS=-O2 -I$(SRC)/include -I${SRCTREE}/audio_ctl -I${SRCTREE}/codec -I${SRCTREE}/../amadec/include -fPIC +-CFLAGS+=-mfloat-abi=softfp -mfpu=neon -mtune=cortex-a9 -march=armv7-a +- +- + + + target_all= $(TARGET)$(LIB_VERSION)$(LIB_SUB_VERSION) +@@ -51,9 +48,6 @@ + $(target_all):$(DIROBJ) + $(call ld_mk,$(OUT_DIR)$@,$^) + +- +- +- + include $(SRCTREE)/rules.mk + export CC CPP AS AR LD TOPDIR SRCTREE CFLAGS LDFLAGS Q + +diff -Naur libamlplayer-m3-e690701/amcodec/rules.mk libamlplayer-m3-e690701.patch/amcodec/rules.mk +--- libamlplayer-m3-e690701/amcodec/rules.mk 2013-05-21 16:47:00.000000000 +0200 ++++ libamlplayer-m3-e690701.patch/amcodec/rules.mk 2013-05-22 17:51:41.657996800 +0200 +@@ -19,10 +19,10 @@ + + ld_mk=$(Q)echo "LD $(1) $(2) $(3)";\ + $(CC) $(LDFLAGS) \ +- --start-group \ ++ -Wl,--start-group \ + $(2:%-dir=%/build-in.o) \ + $(3:%-dir=%/build-in.o) \ +- --end-group \ ++ -Wl,--end-group \ + -o $(1) + + clr_mk=$(Q)echo "CLEAN $(1)";\ +diff -Naur libamlplayer-m3-e690701/amplayer/Makefile.mk libamlplayer-m3-e690701.patch/amplayer/Makefile.mk +--- libamlplayer-m3-e690701/amplayer/Makefile.mk 2013-05-21 16:47:00.000000000 +0200 ++++ libamlplayer-m3-e690701.patch/amplayer/Makefile.mk 2013-05-22 19:25:03.376837984 +0200 +@@ -33,7 +33,7 @@ + + + +-LDFLAGS+= -L$(PREFIX)/lib -lavutil -lavformat -lswscale -lavcodec -lavutil -lm -lpthread -lamcodec -lamavutils ++LDFLAGS+= -L$(PREFIX)/lib -lavutil_aml -lavformat_aml -lswscale_aml -lavcodec_aml -lavutil_aml -lm -lpthread -lamcodec -lamavutils + + INSTALL_DIR?=$(PREFIX)/lib + LDFLAGS+=-shared +@@ -43,9 +43,8 @@ + DIRS = player/ + DIRS += player/system/ + +-CFLAGS+=-I${SRCTREE}/../amffmpeg -I${SRCTREE}/../amcodec/include -I${SRCTREE}/../amadec/include ++CFLAGS+=-I${SRCTREE}/../amffmpeg -I${SRCTREE}/../amcodec/include -I${SRCTREE}/../amadec/include -I${SRCTREE}/../amavutils/include + CFLAGS+=-fPIC -DENABLE_FREE_SCALE +-CFLAGS+=-mfloat-abi=softfp -mfpu=neon -mtune=cortex-a9 -march=armv7-a + target_all= $(TARGET) + + diff --git a/tools/mkpkg/mkpkg_libamlplayer-m3 b/tools/mkpkg/mkpkg_libamlplayer-m3 new file mode 100755 index 0000000000..0cbd56d9a2 --- /dev/null +++ b/tools/mkpkg/mkpkg_libamlplayer-m3 @@ -0,0 +1,43 @@ +#!/bin/sh +################################################################################ +# This file is part of OpenELEC - http://www.openelec.tv +# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv) +# +# This Program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This Program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with OpenELEC.tv; see the file COPYING. If not, write to +# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA. +# http://www.gnu.org/copyleft/gpl.html +################################################################################ + +echo "getting sources..." + if [ ! -d libamlplayer-m3.git ]; then + git clone git://github.com/Pivosgroup/libamplayer-m3.git libamlplayer-m3.git + fi + + cd libamlplayer-m3.git + git pull + GIT_REV=`git log -n1 --format=%h` + cd .. + +echo "copying sources..." + rm -rf libamlplayer-m3-$GIT_REV + cp -R libamlplayer-m3.git libamlplayer-m3-$GIT_REV + +echo "cleaning sources..." + rm -rf libamlplayer-m3-$GIT_REV/.git + +echo "packing sources..." + tar cvJf libamlplayer-m3-$GIT_REV.tar.xz libamlplayer-m3-$GIT_REV + +echo "remove temporary sourcedir..." + rm -rf libamlplayer-m3-$GIT_REV