Guest User

Untitled

a guest
Dec 22nd, 2016
401
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ################################################################################
  2. # This file is part of LibreELEC - https://libreelec.tv
  3. # Copyright (C) 2016 Team LibreELEC
  4. #
  5. # LibreELEC is free software: you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation, either version 2 of the License, or
  8. # (at your option) any later version.
  9. #
  10. # LibreELEC is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU General Public License
  16. # along with LibreELEC. If not, see <http://www.gnu.org/licenses/>.
  17. ################################################################################
  18.  
  19. PKG_NAME="ffmpegx"
  20. PKG_VERSION="libreelec"
  21. PKG_REV="5"
  22. PKG_ARCH="any"
  23. PKG_LICENSE="LGPLv2.1+"
  24. PKG_SITE="https://ffmpeg.org"
  25. PKG_DEPENDS_TARGET="toolchain ffmpeg lame x264"
  26. PKG_SECTION="multimedia"
  27. PKG_SHORTDESC="FFmpeg+"
  28. PKG_LONGDESC="FFmpeg built static with additional features"
  29.  
  30. PKG_IS_ADDON="no"
  31. PKG_AUTORECONF="no"
  32.  
  33. pre_configure_target() {
  34. cd "$ROOT/$PKG_BUILD"
  35. rm -rf ".$TARGET_NAME"
  36. cp -PR $(get_build_dir ffmpeg)/* .
  37. make clean
  38.  
  39. # ffmpeg builds better with these options
  40. strip_gold
  41. strip_lto
  42.  
  43. CFLAGS="-DRPI=1 -I$SYSROOT_PREFIX/usr/include/IL -I$SYSROOT_PREFIX/usr/include/interface/vcos/pthreads -I$SYSROOT_PREFIX/usr/include/interface/vmcs_host/linux $CFLAGS"
  44. FFMPEG_LIBS="-lbcm_host -ldl -lmmal -lmmal_core -lmmal_util -lvchiq_arm -lvcos -lvcsm"
  45. FFMPEG_RPI_HADE="--enable-mmal --enable-omx-rpi"
  46.  
  47.  
  48. # ffmpeg does not build with libx264 on aarch64
  49. if [ "$TARGET_ARCH" != "aarch64" ]; then
  50. FFMPEG_X264="--enable-libx264"
  51. fi
  52.  
  53. if [ "$TARGET_ARCH" == "arm" ]; then
  54. FFMPEG_ARM_AO="--enable-hardcoded-tables"
  55. fi
  56. }
  57.  
  58. configure_target() {
  59. ./configure \
  60. \
  61. `#Licensing options` \
  62. --enable-gpl \
  63. \
  64. `#Documentation options` \
  65. --disable-doc \
  66. \
  67. `#Hardware accelerated decoding encoding` \
  68. $FFMPEG_RPI_HADE \
  69. \
  70. `#External library support` \
  71. --enable-libmp3lame \
  72. $FFMPEG_X264 \
  73. --enable-openssl \
  74. \
  75. `#Toolchain options` \
  76. --arch="$TARGET_ARCH" \
  77. --cpu="$TARGET_CPU" \
  78. --cross-prefix="$TARGET_PREFIX" \
  79. --enable-cross-compile \
  80. --sysroot="$SYSROOT_PREFIX" \
  81. --sysinclude="$SYSROOT_PREFIX/usr/include" \
  82. --target-os="linux" \
  83. --nm="$NM" \
  84. --ar="$AR" \
  85. --as="$CC" \
  86. --cc="$CC" \
  87. --ld="$CC" \
  88. --pkg-config="$ROOT/$TOOLCHAIN/bin/pkg-config" \
  89. --host-cc="$HOST_CC" \
  90. --host-cflags="$HOST_CFLAGS" \
  91. --host-ldflags="$HOST_LDFLAGS" \
  92. --host-libs="-lm" \
  93. --extra-cflags="$CFLAGS" \
  94. --extra-ldflags="$LDFLAGS" \
  95. --extra-libs="$FFMPEG_LIBS" \
  96. --extra-version="x" \
  97. --enable-pic \
  98. \
  99. `#Advanced options` \
  100. $FFMPEG_ARM_AO \
  101.  
  102. }
  103.  
  104. post_makeinstall_target() {
  105. for ff in $INSTALL/usr/local/bin/*; do mv $ff ${ff}x; done
  106. rm -fr $INSTALL/usr/local/include
  107. rm -fr $INSTALL/usr/local/share/ffmpeg/examples
  108. }
RAW Paste Data