Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
Stop referencing ffmpegsumo and fix usage of libffpeg.so.
Browse files Browse the repository at this point in the history
This is a follow-up to f5be873 ("Roll Chromium 44.0.2403.81").

That version of Chromium M44 includes changes in Chromium's version of
ffmpeg that got rid of the ffmpegsumo library: there is only
libffmpeg.so now, and it is a regular library.

In practice, this means the following changes had to be made for a build
from scratch to work again:

* References to libffmpegsumo.so in Tizen's spec files have been
  dropped. libffmpeg.so is built in lib/ and does not need special
  treatment.
* References to libffmegsumo.so in the Debian packaging files have also
  been dropped. This was a bit more intricate than the above, as some
  code in build.sh had to be moved to do_package() because even though
  the Debian packages are built with component=static_library the
  ffmpeg_component variable is set to shared_library.
  Consequently, when we called dpkg-shlibdeps in the xwalk binary in
  ${BUILDDIR} it had a dependency on lib/libffmpeg.so and this resulted
  in a lot of warnings like this:
    dpkg-shlibdeps: warning: $ORIGIN is used in RPATH of
    /path/to/out/Release/xwalk and the corresponding directory could not
    be identified due to lack of DEBIAN sub-directory in the root of
    package's build tree
  We now do the staging first so that the DEBIAN directory exists and
  call dpkg-shlibdeps on the staged binary instead of the one in the
  build directory.
* We build ffmpeg as a shared library only on Linux instead of all
  platforms. Building ffmpeg as a shared library on Windows and OS X is
  not completely tested anymore I think, and it was not clear whether
  the gyp code that copies ffmpeg to the Crosswalk Framework on Mac is
  supposed to work with libffmpeg.so instead of libffmpegsumo.so.

BUG=XWALK-3705
BUG=XWALK-4574
  • Loading branch information
rakuco committed Jul 17, 2015
1 parent bb32a8e commit 67847f6
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 76 deletions.
11 changes: 7 additions & 4 deletions build/common.gypi
Expand Up @@ -6,10 +6,6 @@
'use_webui_file_picker%': 0,
'disable_bundled_extensions%': 0,

# Build FFMPEG as a shared library. The default since M44 is building it as
# a static library. We do not want to do that for now, see XWALK-4574.
'ffmpeg_component%': 'shared_library',

'conditions': [
['OS=="android"', {
# Enable WebCL by default on android.
Expand All @@ -18,6 +14,13 @@
}, {
'enable_webcl%': 0,
}],
['OS=="linux"', {
# Since M44, ffmpeg is built as a static library by default. On Linux,
# keep the previous behavior or building it as a shared library while
# we figure out if it makes sense to switch to a static library by
# default.
'ffmpeg_component%': 'shared_library',
}],
],
},
'target_defaults': {
Expand Down
2 changes: 0 additions & 2 deletions packaging/crosswalk-libs.spec
Expand Up @@ -237,15 +237,13 @@ rm -f src/out/Release/lib/libxwalk_backend_lib.so
install -d %{buildroot}%{_libdir}/xwalk/lib
install -m 0644 -p -D src/out/Release/lib/*.so %{buildroot}%{_libdir}/xwalk/lib/
install -m 0644 -p -D src/out/Release/icudtl.dat %{buildroot}%{_libdir}/xwalk/icudtl.dat
install -m 0644 -p -D src/out/Release/libffmpegsumo.so %{buildroot}%{_libdir}/xwalk/libffmpegsumo.so
install -m 0644 -p -D src/out/Release/natives_blob.bin %{buildroot}%{_libdir}/xwalk/natives_blob.bin
install -m 0644 -p -D src/out/Release/snapshot_blob.bin %{buildroot}%{_libdir}/xwalk/snapshot_blob.bin

%files
%manifest crosswalk-libs.manifest
%{_libdir}/xwalk/icudtl.dat
%{_libdir}/xwalk/lib/lib*.so
%{_libdir}/xwalk/libffmpegsumo.so
%if ! %{_disable_nacl}
%{_libdir}/xwalk/nacl_bootstrap_raw
%{_libdir}/xwalk/nacl_helper
Expand Down
4 changes: 0 additions & 4 deletions tools/build/linux/FILES.cfg
Expand Up @@ -35,8 +35,4 @@ FILES = [
'filename': 'xwalk.pak',
'buildtype': ['dev', 'official'],
},
{
'filename': 'libffmpegsumo.so',
'buildtype': ['dev'],
},
]
9 changes: 0 additions & 9 deletions tools/build/win/FILES.cfg
Expand Up @@ -37,10 +37,6 @@ FILES = [
'filename': 'xwalk.pak',
'buildtype': ['dev', 'official'],
},
{
'filename': 'ffmpegsumo.dll',
'buildtype': ['dev'],
},
{
'filename': 'icudt.dll',
'buildtype': ['dev', 'official'],
Expand All @@ -63,11 +59,6 @@ FILES = [
'buildtype': ['dev', 'official'],
'archive': 'xwalk-win32-syms.zip',
},
{
'filename': 'ffmpegsumo.dll.pdb',
'buildtype': ['dev'],
'archive': 'xwalk-win32-syms.zip',
},
{
'filename': 'libEGL.dll.pdb',
'buildtype': ['dev', 'official'],
Expand Down
5 changes: 4 additions & 1 deletion tools/installer/common/installer.include
Expand Up @@ -172,7 +172,10 @@ stage_install_common() {
done

# ffmpeg libs
install -m 644 -s "${BUILDDIR}/libffmpegsumo.so" "${STAGEDIR}/${INSTALLDIR}/"
if [ -f "${BUILDDIR}/lib/libffmpeg.so" ]; then
install -m 755 -d "${STAGEDIR}/${INSTALLDIR}/lib/"
install -m 644 -s "${BUILDDIR}/lib/libffmpeg.so" "${STAGEDIR}/${INSTALLDIR}/lib/"
fi

# launcher script and symlink
process_template "${BUILDDIR}/installer/common/wrapper" \
Expand Down
86 changes: 40 additions & 46 deletions tools/installer/debian/build.sh
Expand Up @@ -67,6 +67,46 @@ stage_install_debian() {
# Actually generate the package file.
do_package() {
echo "Packaging ${ARCHITECTURE}..."

# Need a dummy debian/control file for dpkg-shlibdeps.
DUMMY_STAGING_DIR="${TMPFILEDIR}/dummy_staging"
mkdir "$DUMMY_STAGING_DIR"
pushd "$DUMMY_STAGING_DIR"
mkdir debian
touch debian/control
# Generate the dependencies,
# TODO(mmoss): This is a workaround for a problem where dpkg-shlibdeps was
# resolving deps using some of our build output shlibs (i.e.
# out/Release/lib.target/libfreetype.so.6), and was then failing with:
# dpkg-shlibdeps: error: no dependency information found for ...
# It's not clear if we ever want to look in LD_LIBRARY_PATH to resolve deps,
# but it seems that we don't currently, so this is the most expediant fix.
SAVE_LDLP=${LD_LIBRARY_PATH:-}
unset LD_LIBRARY_PATH
DPKG_SHLIB_DEPS=$(dpkg-shlibdeps -O "${STAGEDIR}/${INSTALLDIR}/${PROGNAME}" | \
sed 's/^shlibs:Depends=//')
if [ -n "$SAVE_LDLP" ]; then
LD_LIBRARY_PATH=$SAVE_LDLP
fi
rm -rf "$DUMMY_STAGING_DIR"
popd

# Additional dependencies not in the dpkg-shlibdeps output.
# - Pull a more recent version of NSS than required by runtime linking, for
# security and stability updates in NSS.
ADDITION_DEPS="ca-certificates, libnss3 (>= 3.14.3), lsb-base (>=3.2), \
xdg-utils (>= 1.0.2)"

# Fix-up libnspr dependency due to renaming in Ubuntu (the old package still
# exists, but it was moved to "universe" repository, which isn't installed by
# default).
DPKG_SHLIB_DEPS=$(sed \
's/\(libnspr4-0d ([^)]*)\), /\1 | libnspr4 (>= 4.9.5-0ubuntu0), /g' \
<<< $DPKG_SHLIB_DEPS)

COMMON_DEPS="${DPKG_SHLIB_DEPS}, ${ADDITION_DEPS}"
COMMON_PREDEPS="dpkg (>= 1.14.0)"

PREDEPENDS="$COMMON_PREDEPS"
DEPENDS="${COMMON_DEPS}"
REPLACES=""
Expand Down Expand Up @@ -163,52 +203,6 @@ source ${BUILDDIR}/installer/common/crosswalk.info
export DEBFULLNAME="${MAINTNAME}"
export DEBEMAIL="${MAINTMAIL}"

# We'd like to eliminate more of these deps by relying on the 'lsb' package, but
# that brings in tons of unnecessary stuff, like an mta and rpm. Until that full
# 'lsb' package is installed by default on DEB distros, we'll have to stick with
# the LSB sub-packages, to avoid pulling in all that stuff that's not installed
# by default.

# Need a dummy debian/control file for dpkg-shlibdeps.
DUMMY_STAGING_DIR="${TMPFILEDIR}/dummy_staging"
mkdir "$DUMMY_STAGING_DIR"
cd "$DUMMY_STAGING_DIR"
mkdir debian
touch debian/control

# Generate the dependencies,
# TODO(mmoss): This is a workaround for a problem where dpkg-shlibdeps was
# resolving deps using some of our build output shlibs (i.e.
# out/Release/lib.target/libfreetype.so.6), and was then failing with:
# dpkg-shlibdeps: error: no dependency information found for ...
# It's not clear if we ever want to look in LD_LIBRARY_PATH to resolve deps,
# but it seems that we don't currently, so this is the most expediant fix.
SAVE_LDLP=${LD_LIBRARY_PATH:-}
unset LD_LIBRARY_PATH
DPKG_SHLIB_DEPS=$(dpkg-shlibdeps -O "$BUILDDIR/${PROGNAME}" | \
sed 's/^shlibs:Depends=//')
if [ -n "$SAVE_LDLP" ]; then
LD_LIBRARY_PATH=$SAVE_LDLP
fi

rm -rf "$DUMMY_STAGING_DIR"

# Additional dependencies not in the dpkg-shlibdeps output.
# - Pull a more recent version of NSS than required by runtime linking, for
# security and stability updates in NSS.
ADDITION_DEPS="ca-certificates, libnss3 (>= 3.14.3), lsb-base (>=3.2), \
xdg-utils (>= 1.0.2)"

# Fix-up libnspr dependency due to renaming in Ubuntu (the old package still
# exists, but it was moved to "universe" repository, which isn't installed by
# default).
DPKG_SHLIB_DEPS=$(sed \
's/\(libnspr4-0d ([^)]*)\), /\1 | libnspr4 (>= 4.9.5-0ubuntu0), /g' \
<<< $DPKG_SHLIB_DEPS)

COMMON_DEPS="${DPKG_SHLIB_DEPS}, ${ADDITION_DEPS}"
COMMON_PREDEPS="dpkg (>= 1.14.0)"

# Make everything happen in the OUTPUTDIR.
cd "${OUTPUTDIR}"

Expand Down
9 changes: 0 additions & 9 deletions xwalk.gyp
Expand Up @@ -880,15 +880,6 @@
'runtime/app/xwalk_content_main.cc',
'runtime/app/xwalk_content_main.h',
],
'copies': [
{
# Copy FFmpeg binaries for audio/video support.
'destination': '<(PRODUCT_DIR)/$(CONTENTS_FOLDER_PATH)/Libraries',
'files': [
'<(PRODUCT_DIR)/ffmpegsumo.so',
],
},
],
'conditions': [
['enable_webrtc==1', {
'variables': {
Expand Down
6 changes: 5 additions & 1 deletion xwalk_installer.gypi
Expand Up @@ -22,7 +22,6 @@
],
'packaging_files_binaries': [
'<(PRODUCT_DIR)/xwalk',
'<(PRODUCT_DIR)/libffmpegsumo.so',

# Commented out for the time being because non-Ozone Linux builds
# depend on the gtk2ui target in src/chrome, which can cause
Expand All @@ -35,6 +34,11 @@
'deb_cmd': ['<@(flock_bash)', '<(deb_build)', '-o' '<(PRODUCT_DIR)',
'-b', '<(PRODUCT_DIR)', '-a', '<(target_arch)'],
'conditions': [
['ffmpeg_component=="shared_library"', {
'packaging_files_binaries': [
'<(PRODUCT_DIR)/lib/libffmpeg.so',
],
}],
['target_arch=="ia32"', {
'deb_arch': 'i386',
'packaging_files_common': [
Expand Down

0 comments on commit 67847f6

Please sign in to comment.