diff options
author | Eric Hameleers <alien@slackware.com> | 2018-02-05 20:14:40 +0000 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2018-02-05 20:14:40 +0000 |
commit | c74ad1527d43772c3403a1350b2ddfc0edab4a32 (patch) | |
tree | 96dce63985c84a6a6e19b9f0827e84325bfafe9a /chromium/build | |
parent | 865800d94b1c22a5d496adbcffb77cf6d8b682a3 (diff) | |
download | asb-c74ad1527d43772c3403a1350b2ddfc0edab4a32.tar.gz asb-c74ad1527d43772c3403a1350b2ddfc0edab4a32.tar.xz |
chromium: this seems to produce a functional hevc/h.265 playback support
Diffstat (limited to 'chromium/build')
-rwxr-xr-x | chromium/build/chromium.SlackBuild | 90 |
1 files changed, 55 insertions, 35 deletions
diff --git a/chromium/build/chromium.SlackBuild b/chromium/build/chromium.SlackBuild index ed91d13c..7dbbe30c 100755 --- a/chromium/build/chromium.SlackBuild +++ b/chromium/build/chromium.SlackBuild @@ -342,12 +342,20 @@ else USE_PA=${USE_PA:-0} fi -# By default the ffmpeg library is built statically into the chromium binary. -# You can also build a shared library libffmpeg.so (formerly libffmpegsumo.so): -USE_FFMPEG=${USE_FFMPEG:-shared} # other option is "static" +# By default the ffmpeg and other component libraries are built statically +# into the chromium binary. This takes more time at the linking stage but +# will speed up the browser's startup. +# You can instead build shared libraries, among which will be libffmpeg.so +# (formerly libffmpegsumo.so) if you want to be able to swap the libffmpeg.so +# library for someone else's library with more features: +SHARED_FFMPEG=${SHARED_FFMPEG:-false} # other option is 'true' # The branding determines what (proprietary) codec support will be added: -FFMPEG_BRANDING=${FFMPEG_BRANDING:-ChromeOS} # or "Chrome", or "Chromium" +FFMPEG_BRANDING=${FFMPEG_BRANDING:-Chrome} # or "ChromeOS", or "Chromium" + +# HEVC support. Not guaranteed to work! Set to '0' to disable, '1' to enable: +FFMPEG_HEVC=${FFMPEG_HEVC:-1} +[ $FFMPEG_HEVC -eq 0 ] && do_hevc=false || do_hevc=true # You can build with NaCl (native client) if you set USE_NACL to "1", # and gain some Chrome functionality like using in-browser applications. @@ -557,9 +565,14 @@ if ! gzip --help |grep -q rsyncable ; then cat $SRCDIR/patches/chromium_no_rsyncable.patch | patch -p1 --verbose \ 2>&1 | tee -a $OUTPUT/patch-${PRGNAM}.log fi -# Advertize HEVC/X.265 support: -cat $SRCDIR/patches/chromium_hevc_supported.patch | patch -p1 --verbose \ - 2>&1 | tee -a $OUTPUT/patch-${PRGNAM}.log +if [ $FFMPEG_HEVC -eq 1 ]; then + # Add essential proprietary codecs to the "chrome" branding of ffmpeg: + cat $SRCDIR/patches/chromium_ffmpeg_prop.patch | patch -p1 --verbose \ + 2>&1 | tee -a $OUTPUT/patch-${PRGNAM}.log + # Advertize HEVC/X.265 support: + cat $SRCDIR/patches/chromium_hevc_supported.patch | patch -p1 --verbose \ + 2>&1 | tee -a $OUTPUT/patch-${PRGNAM}.log +fi ## Enable VAAPI hardware decoding on Linux platform: #cat $SRCDIR/patches/chromium_vaapi.patch | patch -p1 --verbose \ # 2>&1 | tee -a $OUTPUT/patch-${PRGNAM}.log @@ -641,7 +654,7 @@ export PATH="$TMP/tmp-$PRGNAM/privatebin:$PATH" _chromium_conf=( "clang_use_chrome_plugins=${do_clang}" 'enable_hangout_services_extension=true' - 'enable_hevc_demuxing=true' + "enable_hevc_demuxing=${do_hevc}" 'enable_hidpi=true' "enable_hotwording=${do_hotword}" 'enable_glibc=false' @@ -654,13 +667,14 @@ _chromium_conf=( 'exclude_unwind_tables=true' 'fatal_linker_warnings=false' "ffmpeg_branding=\"${FFMPEG_BRANDING}\"" - "ffmpeg_component=\"${USE_FFMPEG}_library\"" 'fieldtrial_testing_like_official_build=true' "google_api_key=\"$_google_api_key\"" "google_default_client_id=\"$_google_default_client_id\"" "google_default_client_secret=\"$_google_default_client_secret\"" "is_clang=${do_clang}" 'is_debug=false' + "is_component_build=${SHARED_FFMPEG}" + "is_component_ffmpeg=${SHARED_FFMPEG}" "linux_sandbox_path=\"/usr/lib${LIBDIRSUFFIX}/${PRGNAM}/chrome_sandbox\"" 'linux_strip_binary=true' 'linux_use_bundled_binutils=false' @@ -681,8 +695,6 @@ _chromium_conf=( "use_pulseaudio=${do_pa}" 'use_sysroot=false' ) - # Not used, perhaps try later: - #'is_component_build=true' # Change this back when CRBUG 592268 is fixed (error during final link: # undefined reference to `base::i18n::GetRawIcuMemory()) @@ -769,28 +781,36 @@ if [ ${USE_CLANG} -eq 1 -o ${USE_NACL} -eq 1 ]; then fi # Re-configure bundled ffmpeg to make it compile on 32bit Slackware: -echo "Configuring bundled ffmpeg..." -FFMPEG_CUSTOM_ARGS=" --enable-decoder=hevc --enable-demuxer=hevc --enable-parser=hevc" -if [ "${FFMPEG_ARCH}" = "ia32" ]; then - FFMPEG_CUSTOM_ARGS="${FFMPEG_CUSTOM_ARGS} --disable-asm" +if [ ${FFMPEG_HEVC} -eq 1 -o "${FFMPEG_ARCH}" = "ia32" ]; then + echo "-- Re-configuring bundled ffmpeg..." + #if [ ${FFMPEG_HEVC} -eq 1 ]; then + # echo " +- Adding HEVC support..." + # FFMPEG_CUSTOM_ARGS="--enable-decoder=hevc --enable-demuxer=hevc --enable-parser=hevc" + #else + FFMPEG_CUSTOM_ARGS="" + #fi + if [ "${FFMPEG_ARCH}" = "ia32" ]; then + echo " +- Disabling assembler code..." + FFMPEG_CUSTOM_ARGS="${FFMPEG_CUSTOM_ARGS} --disable-asm" + fi + cd third_party/ffmpeg + ## To prevent error on x86_64: + ## "clang-5.0: error: invalid linker name in argument '-fuse-ld=lld'" + ## in third_party/ffmpeg/build.x64.linux/ChromeOS/ffbuild/config.log + #sed -e "s/--extra-ldflags=-fuse-ld=lld/--extra-ldflags=''/" \ + # -i chromium/scripts/build_ffmpeg.py + # Actual reconfigure steps: + PATH="$TMP/tmp-$PRGNAM/${SRCNAM}-${VERSION}/third_party/llvm-build/Release+Asserts/bin:${PATH}" \ + python2 chromium/scripts/build_ffmpeg.py linux ${FFMPEG_ARCH} \ + --branding ${FFMPEG_BRANDING} -- ${FFMPEG_CUSTOM_ARGS} \ + 2>&1 | tee $OUTPUT/ffmpeg_configure-${PRGNAM}.log + ./chromium/scripts/copy_config.sh \ + 2>&1 | tee -a $OUTPUT/ffmpeg_configure-${PRGNAM}.log + ./chromium/scripts/generate_gn.py \ + 2>&1 | tee -a $OUTPUT/ffmpeg_configure-${PRGNAM}.log + cd - 2>/dev/null fi -cd third_party/ffmpeg - # To prevent error on x86_64: - # "clang-5.0: error: invalid linker name in argument '-fuse-ld=lld'" - # in third_party/ffmpeg/build.x64.linux/ChromeOS/ffbuild/config.log - sed -e "s/--extra-ldflags=-fuse-ld=lld/--extra-ldflags=''/" \ - -i chromium/scripts/build_ffmpeg.py - # Actual reconfigure steps: - python2 chromium/scripts/build_ffmpeg.py linux ${FFMPEG_ARCH} \ - --branding ${FFMPEG_BRANDING} -- ${FFMPEG_CUSTOM_ARGS} \ - 2>&1 | tee $OUTPUT/ffmpeg_configure-${PRGNAM}.log - ./chromium/scripts/copy_config.sh \ - 2>&1 | tee -a $OUTPUT/ffmpeg_configure-${PRGNAM}.log - ./chromium/scripts/generate_gn.py \ - 2>&1 | tee -a $OUTPUT/ffmpeg_configure-${PRGNAM}.log -cd - 2>/dev/null - # Generate the ninja build files: echo "-- Bootstrapping 'gn'." python2 tools/gn/bootstrap/bootstrap.py \ @@ -840,12 +860,12 @@ cp -a \ $PKG/usr/lib${LIBDIRSUFFIX}/${PRGNAM}/ if [ -f out/Release/libffmpeg*.so ]; then cp -a \ - out/Release/libffmpeg*.so \ + out/Release/lib*.so* \ $PKG/usr/lib${LIBDIRSUFFIX}/${PRGNAM}/ elif [ -f out/Release/lib/libffmpeg.so ]; then mkdir -p $PKG/usr/lib${LIBDIRSUFFIX}/${PRGNAM}/lib/ cp -a \ - out/Release/lib/libffmpeg.so \ + out/Release/lib/lib*.so* \ $PKG/usr/lib${LIBDIRSUFFIX}/${PRGNAM}/lib/ fi if [ -f out/Release/natives_blob.bin ]; then @@ -874,10 +894,10 @@ strip --strip-unneeded \ $PKG/usr/lib${LIBDIRSUFFIX}/${PRGNAM}/chromedriver if [ -f $PKG/usr/lib${LIBDIRSUFFIX}/${PRGNAM}/libffmpeg*.so ]; then strip --strip-unneeded \ - $PKG/usr/lib${LIBDIRSUFFIX}/${PRGNAM}/libffmpeg*.so + $PKG/usr/lib${LIBDIRSUFFIX}/${PRGNAM}/lib*.so elif [ -f $PKG/usr/lib${LIBDIRSUFFIX}/${PRGNAM}/lib/libffmpeg*.so ]; then strip --strip-unneeded \ - $PKG/usr/lib${LIBDIRSUFFIX}/${PRGNAM}/lib/libffmpeg*.so + $PKG/usr/lib${LIBDIRSUFFIX}/${PRGNAM}/lib/lib*.so fi if [ ${USE_NACL} -eq 1 ]; then strip --strip-unneeded \ |