From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- third_party/libwebrtc/build/linux/unbundle/README | 57 +++++ .../libwebrtc/build/linux/unbundle/ffmpeg.gn | 38 +++ third_party/libwebrtc/build/linux/unbundle/flac.gn | 30 +++ .../libwebrtc/build/linux/unbundle/fontconfig.gn | 13 ++ .../libwebrtc/build/linux/unbundle/freetype.gn | 14 ++ .../libwebrtc/build/linux/unbundle/harfbuzz-ng.gn | 13 ++ third_party/libwebrtc/build/linux/unbundle/icu.gn | 254 +++++++++++++++++++++ .../libwebrtc/build/linux/unbundle/libdrm.gn | 20 ++ .../libwebrtc/build/linux/unbundle/libevent.gn | 15 ++ .../libwebrtc/build/linux/unbundle/libjpeg.gn | 12 + .../libwebrtc/build/linux/unbundle/libpng.gn | 23 ++ .../libwebrtc/build/linux/unbundle/libvpx.gn | 32 +++ .../libwebrtc/build/linux/unbundle/libwebp.gn | 35 +++ .../libwebrtc/build/linux/unbundle/libxml.gn | 55 +++++ .../libwebrtc/build/linux/unbundle/libxslt.gn | 13 ++ .../libwebrtc/build/linux/unbundle/openh264.gn | 36 +++ third_party/libwebrtc/build/linux/unbundle/opus.gn | 43 ++++ third_party/libwebrtc/build/linux/unbundle/re2.gn | 27 +++ .../linux/unbundle/remove_bundled_libraries.py | 107 +++++++++ .../build/linux/unbundle/replace_gn_files.py | 83 +++++++ .../libwebrtc/build/linux/unbundle/snappy.gn | 20 ++ third_party/libwebrtc/build/linux/unbundle/zlib.gn | 64 ++++++ 22 files changed, 1004 insertions(+) create mode 100644 third_party/libwebrtc/build/linux/unbundle/README create mode 100644 third_party/libwebrtc/build/linux/unbundle/ffmpeg.gn create mode 100644 third_party/libwebrtc/build/linux/unbundle/flac.gn create mode 100644 third_party/libwebrtc/build/linux/unbundle/fontconfig.gn create mode 100644 third_party/libwebrtc/build/linux/unbundle/freetype.gn create mode 100644 third_party/libwebrtc/build/linux/unbundle/harfbuzz-ng.gn create mode 100644 third_party/libwebrtc/build/linux/unbundle/icu.gn create mode 100644 third_party/libwebrtc/build/linux/unbundle/libdrm.gn create mode 100644 third_party/libwebrtc/build/linux/unbundle/libevent.gn create mode 100644 third_party/libwebrtc/build/linux/unbundle/libjpeg.gn create mode 100644 third_party/libwebrtc/build/linux/unbundle/libpng.gn create mode 100644 third_party/libwebrtc/build/linux/unbundle/libvpx.gn create mode 100644 third_party/libwebrtc/build/linux/unbundle/libwebp.gn create mode 100644 third_party/libwebrtc/build/linux/unbundle/libxml.gn create mode 100644 third_party/libwebrtc/build/linux/unbundle/libxslt.gn create mode 100644 third_party/libwebrtc/build/linux/unbundle/openh264.gn create mode 100644 third_party/libwebrtc/build/linux/unbundle/opus.gn create mode 100644 third_party/libwebrtc/build/linux/unbundle/re2.gn create mode 100755 third_party/libwebrtc/build/linux/unbundle/remove_bundled_libraries.py create mode 100755 third_party/libwebrtc/build/linux/unbundle/replace_gn_files.py create mode 100644 third_party/libwebrtc/build/linux/unbundle/snappy.gn create mode 100644 third_party/libwebrtc/build/linux/unbundle/zlib.gn (limited to 'third_party/libwebrtc/build/linux/unbundle') diff --git a/third_party/libwebrtc/build/linux/unbundle/README b/third_party/libwebrtc/build/linux/unbundle/README new file mode 100644 index 0000000000..b6b6321b38 --- /dev/null +++ b/third_party/libwebrtc/build/linux/unbundle/README @@ -0,0 +1,57 @@ +This directory contains files that make it possible for Linux +distributions to build Chromium using system libraries and exclude the +source code for Chromium's bundled copies of system libraries in a +consistent manner. Nothing here is used in normal developer builds. + + +For more info on the Linux distros' philosophy on bundling system +libraries and why this exists, please read the following: + + - https://fedoraproject.org/wiki/Packaging:No_Bundled_Libraries + - https://wiki.gentoo.org/wiki/Why_not_bundle_dependencies + - http://www.debian.org/doc/debian-policy/ch-source.html#s-embeddedfiles + +For more Chromium-specific context please read +http://spot.livejournal.com/312320.html . + +Additional resources which might provide even more context: + + - http://events.linuxfoundation.org/sites/events/files/slides/LinuxCon%202014%20Slides_0.pdf + - https://lwn.net/Articles/619158/ + + +This directory is provided in the source tree so one can follow the +above guidelines without having to download additional tools and worry +about having the right version of the tool. It is a compromise solution +which takes into account Chromium developers who want to avoid the +perceived burden of more conditional code in build files, and +expectations of Open Source community, where using system-provided +libraries is the norm. + +Usage: + +1. remove_bundled_libraries.py + + For example: remove_bundled_libraries.py third_party/zlib + + The script scans sources looking for third_party directories. + Everything that is not explicitly preserved is removed (except for + GYP/GN build files), and the script fails if any directory passed on + command line does not exist (to ensure list is kept up to date). + + This is intended to be used on source code extracted from a tarball, + not on a git repository. + + NOTE: by default this will not remove anything (for safety). Pass + the --do-remove flag to actually remove files. + +2. replace_gn_files.py --system-libraries lib... + + This swaps out a normal library GN build file that is intended for + use with a bundled library for a build file that is set up to use + the system library. While some build files have use_system_libfoo + build flags, using unbundled build files has the advantage that Linux + distros can build Chromium without having to specify many additional + build flags. + + For example: replace_gn_files.py --system-libraries libxml diff --git a/third_party/libwebrtc/build/linux/unbundle/ffmpeg.gn b/third_party/libwebrtc/build/linux/unbundle/ffmpeg.gn new file mode 100644 index 0000000000..16e2074470 --- /dev/null +++ b/third_party/libwebrtc/build/linux/unbundle/ffmpeg.gn @@ -0,0 +1,38 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/buildflag_header.gni") +import("//build/config/linux/pkg_config.gni") +import("//build/shim_headers.gni") + +pkg_config("system_ffmpeg") { + packages = [ + "libavcodec", + "libavformat", + "libavutil", + ] +} + +buildflag_header("ffmpeg_features") { + header = "ffmpeg_features.h" + flags = [ "USE_SYSTEM_FFMPEG=true" ] +} + +shim_headers("ffmpeg_shim") { + root_path = "." + headers = [ + "libavcodec/avcodec.h", + "libavcodec/packet.h", + "libavformat/avformat.h", + "libavutil/imgutils.h", + ] +} + +source_set("ffmpeg") { + deps = [ + ":ffmpeg_features", + ":ffmpeg_shim", + ] + public_configs = [ ":system_ffmpeg" ] +} diff --git a/third_party/libwebrtc/build/linux/unbundle/flac.gn b/third_party/libwebrtc/build/linux/unbundle/flac.gn new file mode 100644 index 0000000000..ced81d6550 --- /dev/null +++ b/third_party/libwebrtc/build/linux/unbundle/flac.gn @@ -0,0 +1,30 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/linux/pkg_config.gni") +import("//build/shim_headers.gni") + +pkg_config("system_flac") { + packages = [ "flac" ] +} + +shim_headers("flac_shim") { + root_path = "include" + headers = [ + "FLAC/all.h", + "FLAC/assert.h", + "FLAC/callback.h", + "FLAC/export.h", + "FLAC/format.h", + "FLAC/metadata.h", + "FLAC/ordinals.h", + "FLAC/stream_decoder.h", + "FLAC/stream_encoder.h", + ] +} + +source_set("flac") { + deps = [ ":flac_shim" ] + public_configs = [ ":system_flac" ] +} diff --git a/third_party/libwebrtc/build/linux/unbundle/fontconfig.gn b/third_party/libwebrtc/build/linux/unbundle/fontconfig.gn new file mode 100644 index 0000000000..49236c9c8a --- /dev/null +++ b/third_party/libwebrtc/build/linux/unbundle/fontconfig.gn @@ -0,0 +1,13 @@ +# Copyright 2017 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +assert(is_linux || is_chromeos) + +config("fontconfig_config") { + libs = [ "fontconfig" ] +} + +group("fontconfig") { + public_configs = [ ":fontconfig_config" ] +} diff --git a/third_party/libwebrtc/build/linux/unbundle/freetype.gn b/third_party/libwebrtc/build/linux/unbundle/freetype.gn new file mode 100644 index 0000000000..cafa9db6b7 --- /dev/null +++ b/third_party/libwebrtc/build/linux/unbundle/freetype.gn @@ -0,0 +1,14 @@ +# Copyright 2017 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +declare_args() { + # Blink needs a recent and properly build-configured FreeType version to + # support OpenType variations, color emoji and avoid security bugs. By default + # we ship and link such a version as part of Chrome. For distributions that + # prefer to keep linking to the version the system, FreeType must be newer + # than version 2.7.1 and have color bitmap support compiled in. WARNING: + # System FreeType configurations other than as described WILL INTRODUCE TEXT + # RENDERING AND SECURITY REGRESSIONS. + use_system_freetype = true +} diff --git a/third_party/libwebrtc/build/linux/unbundle/harfbuzz-ng.gn b/third_party/libwebrtc/build/linux/unbundle/harfbuzz-ng.gn new file mode 100644 index 0000000000..b4ba17a9b8 --- /dev/null +++ b/third_party/libwebrtc/build/linux/unbundle/harfbuzz-ng.gn @@ -0,0 +1,13 @@ +# Copyright 2017 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +declare_args() { + # Blink uses a cutting-edge version of Harfbuzz (version listed in + # third_party/harfbuzz-ng/README.chromium); most Linux distros do not contain + # a new enough version of the code to work correctly. However, ChromeOS + # chroots (i.e. real ChromeOS builds for devices) do contain a new enough + # version of the library, and so this variable exists so that ChromeOS can + # build against the system lib and keep binary sizes smaller. + use_system_harfbuzz = true +} diff --git a/third_party/libwebrtc/build/linux/unbundle/icu.gn b/third_party/libwebrtc/build/linux/unbundle/icu.gn new file mode 100644 index 0000000000..6f3f8438bd --- /dev/null +++ b/third_party/libwebrtc/build/linux/unbundle/icu.gn @@ -0,0 +1,254 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/linux/pkg_config.gni") +import("//build/shim_headers.gni") + +group("icu") { + public_deps = [ + ":icui18n", + ":icuuc", + ] +} + +config("icu_config") { + defines = [ + "USING_SYSTEM_ICU=1", + "ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC", + + # U_EXPORT (defined in unicode/platform.h) is used to set public visibility + # on classes through the U_COMMON_API and U_I18N_API macros (among others). + # When linking against the system ICU library, we want its symbols to have + # public LTO visibility. This disables CFI checks for the ICU classes and + # allows whole-program optimization to be applied to the rest of Chromium. + # + # Both U_COMMON_API and U_I18N_API macros would be defined to U_EXPORT only + # when U_COMBINED_IMPLEMENTATION is defined (see unicode/utypes.h). Because + # we override the default system UCHAR_TYPE (char16_t), it is not possible + # to use U_COMBINED_IMPLEMENTATION at this moment, meaning the U_COMMON_API + # and U_I18N_API macros are set to U_IMPORT which is an empty definition. + # + # Until building with UCHAR_TYPE=char16_t is supported, one way to apply + # public visibility (and thus public LTO visibility) to all ICU classes is + # to define U_IMPORT to have the same value as U_EXPORT. For more details, + # please see: https://crbug.com/822820 + "U_IMPORT=U_EXPORT", + ] +} + +pkg_config("system_icui18n") { + packages = [ "icu-i18n" ] +} + +pkg_config("system_icuuc") { + packages = [ "icu-uc" ] +} + +source_set("icui18n") { + deps = [ ":icui18n_shim" ] + public_configs = [ + ":icu_config", + ":system_icui18n", + ] +} + +source_set("icuuc") { + deps = [ ":icuuc_shim" ] + public_configs = [ + ":icu_config", + ":system_icuuc", + ] +} + +shim_headers("icui18n_shim") { + root_path = "source/i18n" + headers = [ + # This list can easily be updated using the commands below: + # cd third_party/icu/source/i18n + # find unicode -iname '*.h' -printf ' "%p",\n' | LC_ALL=C sort -u + "unicode/alphaindex.h", + "unicode/basictz.h", + "unicode/calendar.h", + "unicode/choicfmt.h", + "unicode/coleitr.h", + "unicode/coll.h", + "unicode/compactdecimalformat.h", + "unicode/curramt.h", + "unicode/currpinf.h", + "unicode/currunit.h", + "unicode/datefmt.h", + "unicode/dcfmtsym.h", + "unicode/decimfmt.h", + "unicode/dtfmtsym.h", + "unicode/dtitvfmt.h", + "unicode/dtitvinf.h", + "unicode/dtptngen.h", + "unicode/dtrule.h", + "unicode/fieldpos.h", + "unicode/fmtable.h", + "unicode/format.h", + "unicode/fpositer.h", + "unicode/gender.h", + "unicode/gregocal.h", + "unicode/listformatter.h", + "unicode/measfmt.h", + "unicode/measunit.h", + "unicode/measure.h", + "unicode/msgfmt.h", + "unicode/numfmt.h", + "unicode/numsys.h", + "unicode/plurfmt.h", + "unicode/plurrule.h", + "unicode/rbnf.h", + "unicode/rbtz.h", + "unicode/regex.h", + "unicode/region.h", + "unicode/reldatefmt.h", + "unicode/scientificnumberformatter.h", + "unicode/search.h", + "unicode/selfmt.h", + "unicode/simpletz.h", + "unicode/smpdtfmt.h", + "unicode/sortkey.h", + "unicode/stsearch.h", + "unicode/tblcoll.h", + "unicode/timezone.h", + "unicode/tmunit.h", + "unicode/tmutamt.h", + "unicode/tmutfmt.h", + "unicode/translit.h", + "unicode/tzfmt.h", + "unicode/tznames.h", + "unicode/tzrule.h", + "unicode/tztrans.h", + "unicode/ucal.h", + "unicode/ucol.h", + "unicode/ucoleitr.h", + "unicode/ucsdet.h", + "unicode/udat.h", + "unicode/udateintervalformat.h", + "unicode/udatpg.h", + "unicode/ufieldpositer.h", + "unicode/uformattable.h", + "unicode/ugender.h", + "unicode/ulocdata.h", + "unicode/umsg.h", + "unicode/unirepl.h", + "unicode/unum.h", + "unicode/unumsys.h", + "unicode/upluralrules.h", + "unicode/uregex.h", + "unicode/uregion.h", + "unicode/ureldatefmt.h", + "unicode/usearch.h", + "unicode/uspoof.h", + "unicode/utmscale.h", + "unicode/utrans.h", + "unicode/vtzone.h", + ] +} + +shim_headers("icuuc_shim") { + root_path = "source/common" + headers = [ + # This list can easily be updated using the commands below: + # cd third_party/icu/source/common + # find unicode -iname '*.h' -printf ' "%p",\n' | LC_ALL=C sort -u + "unicode/appendable.h", + "unicode/brkiter.h", + "unicode/bytestream.h", + "unicode/bytestrie.h", + "unicode/bytestriebuilder.h", + "unicode/caniter.h", + "unicode/casemap.h", + "unicode/char16ptr.h", + "unicode/chariter.h", + "unicode/dbbi.h", + "unicode/docmain.h", + "unicode/dtintrv.h", + "unicode/edits.h", + "unicode/enumset.h", + "unicode/errorcode.h", + "unicode/filteredbrk.h", + "unicode/icudataver.h", + "unicode/icuplug.h", + "unicode/idna.h", + "unicode/localematcher.h", + "unicode/localpointer.h", + "unicode/locdspnm.h", + "unicode/locid.h", + "unicode/messagepattern.h", + "unicode/normalizer2.h", + "unicode/normlzr.h", + "unicode/parseerr.h", + "unicode/parsepos.h", + "unicode/platform.h", + "unicode/ptypes.h", + "unicode/putil.h", + "unicode/rbbi.h", + "unicode/rep.h", + "unicode/resbund.h", + "unicode/schriter.h", + "unicode/simpleformatter.h", + "unicode/std_string.h", + "unicode/strenum.h", + "unicode/stringpiece.h", + "unicode/stringtriebuilder.h", + "unicode/symtable.h", + "unicode/ubidi.h", + "unicode/ubiditransform.h", + "unicode/ubrk.h", + "unicode/ucasemap.h", + "unicode/ucat.h", + "unicode/uchar.h", + "unicode/ucharstrie.h", + "unicode/ucharstriebuilder.h", + "unicode/uchriter.h", + "unicode/uclean.h", + "unicode/ucnv.h", + "unicode/ucnv_cb.h", + "unicode/ucnv_err.h", + "unicode/ucnvsel.h", + "unicode/uconfig.h", + "unicode/ucurr.h", + "unicode/udata.h", + "unicode/udisplaycontext.h", + "unicode/uenum.h", + "unicode/uidna.h", + "unicode/uiter.h", + "unicode/uldnames.h", + "unicode/ulistformatter.h", + "unicode/uloc.h", + "unicode/umachine.h", + "unicode/umisc.h", + "unicode/unifilt.h", + "unicode/unifunct.h", + "unicode/unimatch.h", + "unicode/uniset.h", + "unicode/unistr.h", + "unicode/unorm.h", + "unicode/unorm2.h", + "unicode/uobject.h", + "unicode/urename.h", + "unicode/urep.h", + "unicode/ures.h", + "unicode/uscript.h", + "unicode/uset.h", + "unicode/usetiter.h", + "unicode/ushape.h", + "unicode/usprep.h", + "unicode/ustring.h", + "unicode/ustringtrie.h", + "unicode/utext.h", + "unicode/utf.h", + "unicode/utf16.h", + "unicode/utf32.h", + "unicode/utf8.h", + "unicode/utf_old.h", + "unicode/utrace.h", + "unicode/utypes.h", + "unicode/uvernum.h", + "unicode/uversion.h", + ] +} diff --git a/third_party/libwebrtc/build/linux/unbundle/libdrm.gn b/third_party/libwebrtc/build/linux/unbundle/libdrm.gn new file mode 100644 index 0000000000..30cdcef3ef --- /dev/null +++ b/third_party/libwebrtc/build/linux/unbundle/libdrm.gn @@ -0,0 +1,20 @@ +# Copyright 2017 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/linux/pkg_config.gni") +import("//build/shim_headers.gni") + +pkg_config("system_libdrm") { + packages = [ "libdrm" ] +} + +shim_headers("libdrm_shim") { + root_path = "src/include" + headers = [ "drm.h" ] +} + +source_set("libdrm") { + deps = [ ":libdrm_shim" ] + public_configs = [ ":system_libdrm" ] +} diff --git a/third_party/libwebrtc/build/linux/unbundle/libevent.gn b/third_party/libwebrtc/build/linux/unbundle/libevent.gn new file mode 100644 index 0000000000..7e1c34d337 --- /dev/null +++ b/third_party/libwebrtc/build/linux/unbundle/libevent.gn @@ -0,0 +1,15 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/shim_headers.gni") + +shim_headers("libevent_shim") { + root_path = "." + headers = [ "event.h" ] +} + +source_set("libevent") { + deps = [ ":libevent_shim" ] + libs = [ "event" ] +} diff --git a/third_party/libwebrtc/build/linux/unbundle/libjpeg.gn b/third_party/libwebrtc/build/linux/unbundle/libjpeg.gn new file mode 100644 index 0000000000..17398ea60b --- /dev/null +++ b/third_party/libwebrtc/build/linux/unbundle/libjpeg.gn @@ -0,0 +1,12 @@ +# Copyright 2018 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +declare_args() { + # Uses system libjpeg. If true, overrides use_libjpeg_turbo. + use_system_libjpeg = true + + # Uses libjpeg_turbo as the jpeg implementation. Has no effect if + # use_system_libjpeg is set. + use_libjpeg_turbo = true +} diff --git a/third_party/libwebrtc/build/linux/unbundle/libpng.gn b/third_party/libwebrtc/build/linux/unbundle/libpng.gn new file mode 100644 index 0000000000..1d6590dcae --- /dev/null +++ b/third_party/libwebrtc/build/linux/unbundle/libpng.gn @@ -0,0 +1,23 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/linux/pkg_config.gni") +import("//build/shim_headers.gni") + +pkg_config("libpng_config") { + packages = [ "libpng" ] +} + +shim_headers("libpng_shim") { + root_path = "." + headers = [ + "png.h", + "pngconf.h", + ] +} + +source_set("libpng") { + deps = [ ":libpng_shim" ] + public_configs = [ ":libpng_config" ] +} diff --git a/third_party/libwebrtc/build/linux/unbundle/libvpx.gn b/third_party/libwebrtc/build/linux/unbundle/libvpx.gn new file mode 100644 index 0000000000..87be30d170 --- /dev/null +++ b/third_party/libwebrtc/build/linux/unbundle/libvpx.gn @@ -0,0 +1,32 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/linux/pkg_config.gni") +import("//build/shim_headers.gni") + +pkg_config("system_libvpx") { + packages = [ "vpx" ] +} + +shim_headers("libvpx_shim") { + root_path = "source/libvpx" + headers = [ + "vpx/vp8.h", + "vpx/vp8cx.h", + "vpx/vp8dx.h", + "vpx/vpx_codec.h", + "vpx/vpx_codec_impl_bottom.h", + "vpx/vpx_codec_impl_top.h", + "vpx/vpx_decoder.h", + "vpx/vpx_encoder.h", + "vpx/vpx_frame_buffer.h", + "vpx/vpx_image.h", + "vpx/vpx_integer.h", + ] +} + +source_set("libvpx") { + deps = [ ":libvpx_shim" ] + public_configs = [ ":system_libvpx" ] +} diff --git a/third_party/libwebrtc/build/linux/unbundle/libwebp.gn b/third_party/libwebrtc/build/linux/unbundle/libwebp.gn new file mode 100644 index 0000000000..de0c230318 --- /dev/null +++ b/third_party/libwebrtc/build/linux/unbundle/libwebp.gn @@ -0,0 +1,35 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/linux/pkg_config.gni") +import("//build/shim_headers.gni") + +pkg_config("system_libwebp") { + packages = [ + "libwebp", + "libwebpdemux", + "libwebpmux", + ] +} + +shim_headers("libwebp_shim") { + root_path = "src" + headers = [ + "webp/decode.h", + "webp/demux.h", + "webp/encode.h", + "webp/mux.h", + "webp/mux_types.h", + "webp/types.h", + ] +} + +source_set("libwebp_webp") { + deps = [ ":libwebp_shim" ] + public_configs = [ ":system_libwebp" ] +} + +group("libwebp") { + deps = [ ":libwebp_webp" ] +} diff --git a/third_party/libwebrtc/build/linux/unbundle/libxml.gn b/third_party/libwebrtc/build/linux/unbundle/libxml.gn new file mode 100644 index 0000000000..3587881eea --- /dev/null +++ b/third_party/libwebrtc/build/linux/unbundle/libxml.gn @@ -0,0 +1,55 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/linux/pkg_config.gni") + +pkg_config("system_libxml") { + packages = [ "libxml-2.0" ] +} + +source_set("libxml") { + public_configs = [ ":system_libxml" ] +} + +static_library("libxml_utils") { + # Do not expand this visibility list without first consulting with the + # Security Team. + visibility = [ + ":xml_reader", + ":xml_writer", + "//base/test:test_support", + "//services/data_decoder:xml_parser_fuzzer", + ] + sources = [ + "chromium/libxml_utils.cc", + "chromium/libxml_utils.h", + ] + public_configs = [ ":system_libxml" ] +} + +static_library("xml_reader") { + # Do not expand this visibility list without first consulting with the + # Security Team. + visibility = [ + "//base/test:test_support", + "//components/policy/core/common:unit_tests", + "//services/data_decoder:*", + "//tools/traffic_annotation/auditor:auditor_sources", + ] + sources = [ + "chromium/xml_reader.cc", + "chromium/xml_reader.h", + ] + deps = [ ":libxml_utils" ] +} + +static_library("xml_writer") { + # The XmlWriter is considered safe to use from any target. + visibility = [ "*" ] + sources = [ + "chromium/xml_writer.cc", + "chromium/xml_writer.h", + ] + deps = [ ":libxml_utils" ] +} diff --git a/third_party/libwebrtc/build/linux/unbundle/libxslt.gn b/third_party/libwebrtc/build/linux/unbundle/libxslt.gn new file mode 100644 index 0000000000..885574ef89 --- /dev/null +++ b/third_party/libwebrtc/build/linux/unbundle/libxslt.gn @@ -0,0 +1,13 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/linux/pkg_config.gni") + +pkg_config("system_libxslt") { + packages = [ "libxslt" ] +} + +source_set("libxslt") { + public_configs = [ ":system_libxslt" ] +} diff --git a/third_party/libwebrtc/build/linux/unbundle/openh264.gn b/third_party/libwebrtc/build/linux/unbundle/openh264.gn new file mode 100644 index 0000000000..882e0a8223 --- /dev/null +++ b/third_party/libwebrtc/build/linux/unbundle/openh264.gn @@ -0,0 +1,36 @@ +# Copyright 2017 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/linux/pkg_config.gni") +import("//build/shim_headers.gni") + +pkg_config("config") { + packages = [ "openh264" ] +} + +shim_headers("openh264_shim") { + prefix = "wels/" + root_path = "src/codec/api/svc" + headers = [ + "codec_api.h", + "codec_app_def.h", + "codec_def.h", + "codec_ver.h", + ] +} + +source_set("common") { + deps = [ ":openh264_shim" ] + public_configs = [ ":config" ] +} + +source_set("processing") { + deps = [ ":openh264_shim" ] + public_configs = [ ":config" ] +} + +source_set("encoder") { + deps = [ ":openh264_shim" ] + public_configs = [ ":config" ] +} diff --git a/third_party/libwebrtc/build/linux/unbundle/opus.gn b/third_party/libwebrtc/build/linux/unbundle/opus.gn new file mode 100644 index 0000000000..504d7d27f0 --- /dev/null +++ b/third_party/libwebrtc/build/linux/unbundle/opus.gn @@ -0,0 +1,43 @@ +# Copyright 2017 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/linux/pkg_config.gni") +import("//build/shim_headers.gni") + +pkg_config("opus_config") { + packages = [ "opus" ] +} + +shim_headers("opus_shim") { + root_path = "src/include" + headers = [ + "opus.h", + "opus_defines.h", + "opus_multistream.h", + "opus_types.h", + ] +} + +source_set("opus") { + deps = [ ":opus_shim" ] + public_configs = [ ":opus_config" ] +} + +source_set("opus_compare") { +} + +source_set("opus_demo") { +} + +source_set("test_opus_api") { +} + +source_set("test_opus_decode") { +} + +source_set("test_opus_encode") { +} + +source_set("test_opus_padding") { +} diff --git a/third_party/libwebrtc/build/linux/unbundle/re2.gn b/third_party/libwebrtc/build/linux/unbundle/re2.gn new file mode 100644 index 0000000000..824d778813 --- /dev/null +++ b/third_party/libwebrtc/build/linux/unbundle/re2.gn @@ -0,0 +1,27 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/c++/c++.gni") +import("//build/shim_headers.gni") + +assert(!use_custom_libcxx, + "Usage of the system libre2.so is not supported with " + + "use_custom_libcxx=true because the library's interface relies on " + + "libstdc++'s std::string and std::vector.") + +shim_headers("re2_shim") { + root_path = "src" + headers = [ + "re2/filtered_re2.h", + "re2/re2.h", + "re2/set.h", + "re2/stringpiece.h", + "re2/variadic_function.h", + ] +} + +source_set("re2") { + deps = [ ":re2_shim" ] + libs = [ "re2" ] +} diff --git a/third_party/libwebrtc/build/linux/unbundle/remove_bundled_libraries.py b/third_party/libwebrtc/build/linux/unbundle/remove_bundled_libraries.py new file mode 100755 index 0000000000..899877a165 --- /dev/null +++ b/third_party/libwebrtc/build/linux/unbundle/remove_bundled_libraries.py @@ -0,0 +1,107 @@ +#!/usr/bin/env python +# Copyright 2013 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +""" +Removes bundled libraries to make sure they are not used. + +See README for more details. +""" + +from __future__ import print_function + +import optparse +import os.path +import sys + + +def DoMain(argv): + my_dirname = os.path.abspath(os.path.dirname(__file__)) + source_tree_root = os.path.abspath( + os.path.join(my_dirname, '..', '..', '..')) + + if os.path.join(source_tree_root, 'build', 'linux', 'unbundle') != my_dirname: + print('Sanity check failed: please run this script from ' + 'build/linux/unbundle directory.') + return 1 + + parser = optparse.OptionParser() + parser.add_option('--do-remove', action='store_true') + + options, args = parser.parse_args(argv) + + exclusion_used = {} + for exclusion in args: + exclusion_used[exclusion] = False + + for root, dirs, files in os.walk(source_tree_root, topdown=False): + # Only look at paths which contain a "third_party" component + # (note that e.g. third_party.png doesn't count). + root_relpath = os.path.relpath(root, source_tree_root) + if 'third_party' not in root_relpath.split(os.sep): + continue + + for f in files: + path = os.path.join(root, f) + relpath = os.path.relpath(path, source_tree_root) + + excluded = False + for exclusion in args: + # Require precise exclusions. Find the right-most third_party + # in the relative path, and if there is more than one ignore + # the exclusion if it's completely contained within the part + # before right-most third_party path component. + split = relpath.rsplit(os.sep + 'third_party' + os.sep, 1) + if len(split) > 1 and split[0].startswith(exclusion): + continue + + if relpath.startswith(exclusion): + # Multiple exclusions can match the same path. Go through all of them + # and mark each one as used. + exclusion_used[exclusion] = True + excluded = True + if excluded: + continue + + # Deleting gyp files almost always leads to gyp failures. + # These files come from Chromium project, and can be replaced if needed. + if f.endswith('.gyp') or f.endswith('.gypi'): + continue + + # Same about GN files. + if f.endswith('.gn') or f.endswith('.gni'): + continue + + # Deleting .isolate files leads to gyp failures. They are usually + # not used by a distro build anyway. + # See http://www.chromium.org/developers/testing/isolated-testing + # for more info. + if f.endswith('.isolate'): + continue + + if options.do_remove: + # Delete the file - best way to ensure it's not used during build. + os.remove(path) + else: + # By default just print paths that would be removed. + print(path) + + exit_code = 0 + + # Fail if exclusion list contains stale entries - this helps keep it + # up to date. + for exclusion, used in exclusion_used.items(): + if not used: + print('%s does not exist' % exclusion) + exit_code = 1 + + if not options.do_remove: + print('To actually remove files printed above, please pass ' + '--do-remove flag.') + + return exit_code + + +if __name__ == '__main__': + sys.exit(DoMain(sys.argv[1:])) diff --git a/third_party/libwebrtc/build/linux/unbundle/replace_gn_files.py b/third_party/libwebrtc/build/linux/unbundle/replace_gn_files.py new file mode 100755 index 0000000000..eba4bd1fb3 --- /dev/null +++ b/third_party/libwebrtc/build/linux/unbundle/replace_gn_files.py @@ -0,0 +1,83 @@ +#!/usr/bin/env python +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +""" +Replaces GN files in tree with files from here that +make the build use system libraries. +""" + +from __future__ import print_function + +import argparse +import os +import shutil +import sys + + +REPLACEMENTS = { + 'ffmpeg': 'third_party/ffmpeg/BUILD.gn', + 'flac': 'third_party/flac/BUILD.gn', + 'fontconfig': 'third_party/fontconfig/BUILD.gn', + 'freetype': 'build/config/freetype/freetype.gni', + 'harfbuzz-ng': 'third_party/harfbuzz-ng/harfbuzz.gni', + 'icu': 'third_party/icu/BUILD.gn', + 'libdrm': 'third_party/libdrm/BUILD.gn', + 'libevent': 'base/third_party/libevent/BUILD.gn', + 'libjpeg': 'third_party/libjpeg.gni', + 'libpng': 'third_party/libpng/BUILD.gn', + 'libvpx': 'third_party/libvpx/BUILD.gn', + 'libwebp': 'third_party/libwebp/BUILD.gn', + 'libxml': 'third_party/libxml/BUILD.gn', + 'libxslt': 'third_party/libxslt/BUILD.gn', + 'openh264': 'third_party/openh264/BUILD.gn', + 'opus': 'third_party/opus/BUILD.gn', + 're2': 'third_party/re2/BUILD.gn', + 'snappy': 'third_party/snappy/BUILD.gn', + 'zlib': 'third_party/zlib/BUILD.gn', +} + + +def DoMain(argv): + my_dirname = os.path.dirname(__file__) + source_tree_root = os.path.abspath( + os.path.join(my_dirname, '..', '..', '..')) + + parser = argparse.ArgumentParser() + parser.add_argument('--system-libraries', nargs='*', default=[]) + parser.add_argument('--undo', action='store_true') + + args = parser.parse_args(argv) + + handled_libraries = set() + for lib, path in REPLACEMENTS.items(): + if lib not in args.system_libraries: + continue + handled_libraries.add(lib) + + if args.undo: + # Restore original file, and also remove the backup. + # This is meant to restore the source tree to its original state. + os.rename(os.path.join(source_tree_root, path + '.orig'), + os.path.join(source_tree_root, path)) + else: + # Create a backup copy for --undo. + shutil.copyfile(os.path.join(source_tree_root, path), + os.path.join(source_tree_root, path + '.orig')) + + # Copy the GN file from directory of this script to target path. + shutil.copyfile(os.path.join(my_dirname, '%s.gn' % lib), + os.path.join(source_tree_root, path)) + + unhandled_libraries = set(args.system_libraries) - handled_libraries + if unhandled_libraries: + print('Unrecognized system libraries requested: %s' % ', '.join( + sorted(unhandled_libraries)), file=sys.stderr) + return 1 + + return 0 + + +if __name__ == '__main__': + sys.exit(DoMain(sys.argv[1:])) diff --git a/third_party/libwebrtc/build/linux/unbundle/snappy.gn b/third_party/libwebrtc/build/linux/unbundle/snappy.gn new file mode 100644 index 0000000000..966666f800 --- /dev/null +++ b/third_party/libwebrtc/build/linux/unbundle/snappy.gn @@ -0,0 +1,20 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/shim_headers.gni") + +shim_headers("snappy_shim") { + root_path = "src" + headers = [ + "snappy-c.h", + "snappy-sinksource.h", + "snappy-stubs-public.h", + "snappy.h", + ] +} + +source_set("snappy") { + deps = [ ":snappy_shim" ] + libs = [ "snappy" ] +} diff --git a/third_party/libwebrtc/build/linux/unbundle/zlib.gn b/third_party/libwebrtc/build/linux/unbundle/zlib.gn new file mode 100644 index 0000000000..97d6aebe6d --- /dev/null +++ b/third_party/libwebrtc/build/linux/unbundle/zlib.gn @@ -0,0 +1,64 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/shim_headers.gni") + +shim_headers("zlib_shim") { + root_path = "." + headers = [ "zlib.h" ] +} + +config("system_zlib") { + defines = [ "USE_SYSTEM_ZLIB=1" ] +} + +config("zlib_config") { + configs = [ ":system_zlib" ] +} + +source_set("zlib") { + deps = [ ":zlib_shim" ] + libs = [ "z" ] + public_configs = [ ":system_zlib" ] +} + +shim_headers("minizip_shim") { + root_path = "contrib" + headers = [ + "minizip/crypt.h", + "minizip/ioapi.h", + "minizip/iowin32.h", + "minizip/mztools.h", + "minizip/unzip.h", + "minizip/zip.h", + ] +} + +source_set("minizip") { + deps = [ ":minizip_shim" ] + libs = [ "minizip" ] +} + +static_library("zip") { + sources = [ + "google/zip.cc", + "google/zip.h", + "google/zip_internal.cc", + "google/zip_internal.h", + "google/zip_reader.cc", + "google/zip_reader.h", + ] + deps = [ + ":minizip", + "//base", + ] +} + +static_library("compression_utils") { + sources = [ + "google/compression_utils.cc", + "google/compression_utils.h", + ] + deps = [ ":zlib" ] +} -- cgit v1.2.3