summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2018-10-21 03:02:44 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2018-10-21 03:02:44 +0000
commitb3fe46ea0c8c4de58ff677060796fd6825ae65c9 (patch)
tree7ef9eda9a39061de912ceca05c9e23fe48eb6c06
parent169ede1b81e73e5ee5ef805b710b1d766700408c (diff)
parent7e741b3d8cbdbe0610147817d242e4f945277b9b (diff)
downloadbsdiff-b3fe46ea0c8c4de58ff677060796fd6825ae65c9.tar.gz
Snap for 5082210 from 7e741b3d8cbdbe0610147817d242e4f945277b9b to qt-release
Change-Id: Ida8dba388fb5a312d2bf583efa645890490c2922
-rw-r--r--BUILD.gn171
-rw-r--r--bsdiff.gyp190
-rw-r--r--libbsdiff.pc9
-rw-r--r--libbspatch.pc9
4 files changed, 189 insertions, 190 deletions
diff --git a/BUILD.gn b/BUILD.gn
new file mode 100644
index 0000000..a65dbda
--- /dev/null
+++ b/BUILD.gn
@@ -0,0 +1,171 @@
+# Copyright (C) 2018 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import("//common-mk/pkg_config.gni")
+
+group("all") {
+ deps = [
+ ":bsdiff",
+ ":bspatch",
+ ":libbsdiff",
+ ":libbspatch",
+ ]
+ if (use.test) {
+ deps += [ ":bsdiff_test" ]
+ }
+ if (use.fuzzer) {
+ deps += [ ":bspatch_fuzzer" ]
+ }
+}
+
+pkg_config("target_defaults") {
+ pkg_deps = []
+ cflags = [
+ "-Wextra",
+ "-Wno-unused-parameter",
+ ]
+ cflags_cc = [ "-Wnon-virtual-dtor" ]
+ defines = [ "_FILE_OFFSET_BITS=64" ]
+ include_dirs = [
+ "include",
+ # We need this include dir because we include all the local code as
+ # "bsdiff/...".
+ "${platform2_root}/../aosp/external",
+ ]
+ libs = [ "-lbz2" ]
+}
+
+pkg_config("libbspatch_config") {
+ pkg_deps = [ "libbrotlidec" ]
+}
+
+static_library("libbspatch") {
+ configs += [
+ "//common-mk:nouse_thin_archive",
+ ":target_defaults",
+ ":libbspatch_config"
+ ]
+ configs -= [ "//common-mk:use_thin_archive" ]
+ sources = [
+ "brotli_decompressor.cc",
+ "bspatch.cc",
+ "buffer_file.cc",
+ "bz2_decompressor.cc",
+ "decompressor_interface.cc",
+ "extents.cc",
+ "extents_file.cc",
+ "file.cc",
+ "logging.cc",
+ "memory_file.cc",
+ "patch_reader.cc",
+ "sink_file.cc",
+ "utils.cc",
+ ]
+}
+
+executable("bspatch") {
+ configs += [ ":target_defaults" ]
+ deps = [ ":libbspatch" ]
+ sources = [
+ "bspatch_main.cc",
+ ]
+}
+
+pkg_config("libbsdiff_config") {
+ pkg_deps = [
+ "libbrotlienc",
+ "libdivsufsort",
+ "libdivsufsort64",
+ ]
+}
+
+static_library("libbsdiff") {
+ configs += [
+ "//common-mk:nouse_thin_archive",
+ ":target_defaults",
+ ":libbsdiff_config",
+ ]
+ configs -= [ "//common-mk:use_thin_archive" ]
+ sources = [
+ "brotli_compressor.cc",
+ "bsdiff.cc",
+ "bz2_compressor.cc",
+ "compressor_buffer.cc",
+ "diff_encoder.cc",
+ "endsley_patch_writer.cc",
+ "logging.cc",
+ "patch_writer.cc",
+ "patch_writer_factory.cc",
+ "split_patch_writer.cc",
+ "suffix_array_index.cc",
+ ]
+}
+
+executable("bsdiff") {
+ configs += [ ":target_defaults" ]
+ deps = [ ":libbsdiff" ]
+ sources = [
+ "bsdiff_arguments.cc",
+ "bsdiff_main.cc",
+ ]
+}
+
+if (use.test) {
+ pkg_config("bsdiff_test_config") {
+ pkg_deps = [ "libchrome-${libbase_ver}" ]
+ }
+ executable("bsdiff_test") {
+ configs += [
+ "//common-mk:test",
+ ":target_defaults",
+ ":bsdiff_test_config",
+ ]
+ deps = [
+ "//common-mk/testrunner",
+ ":libbspatch",
+ ":libbsdiff",
+ ]
+ sources = [
+ "brotli_compressor_unittest.cc",
+ "brotli_decompressor_unittest.cc",
+ "bsdiff_arguments.cc",
+ "bsdiff_arguments_unittest.cc",
+ "bsdiff_unittest.cc",
+ "bspatch_unittest.cc",
+ "bz2_decompressor_unittest.cc",
+ "diff_encoder_unittest.cc",
+ "endsley_patch_writer_unittest.cc",
+ "extents_file_unittest.cc",
+ "extents_unittest.cc",
+ "patch_reader_unittest.cc",
+ "patch_writer_unittest.cc",
+ "split_patch_writer_unittest.cc",
+ "suffix_array_index_unittest.cc",
+ "test_utils.cc",
+ ]
+ }
+}
+
+if (use.fuzzer) {
+ executable("bspatch_fuzzer") {
+ configs += [
+ "//common-mk/common_fuzzer",
+ ":target_defaults",
+ ]
+ deps = [ ":libbspatch" ]
+ sources = [
+ "bspatch_fuzzer.cc",
+ ]
+ }
+}
diff --git a/bsdiff.gyp b/bsdiff.gyp
deleted file mode 100644
index 65802f4..0000000
--- a/bsdiff.gyp
+++ /dev/null
@@ -1,190 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-{
- 'target_defaults': {
- 'cflags': [
- '-Wextra',
- '-Wno-unused-parameter',
- ],
- 'cflags_cc': [
- '-Wnon-virtual-dtor',
- ],
- 'include_dirs': [
- 'include',
- # We need this include dir because we include all the local code as
- # "bsdiff/...".
- '<(platform2_root)/../aosp/external',
- ],
- 'defines': [
- '_FILE_OFFSET_BITS=64',
- ],
- },
- 'targets': [
- # bsdiff static library
- {
- 'target_name': 'libbsdiff-static',
- 'type': 'static_library',
- 'cflags!': ['-fPIE'],
- 'cflags': ['-fPIC'],
- 'all_dependent_settings': {
- 'link_settings': {
- 'libraries': [
- '-lbz2',
- '-lbrotlienc',
- '-ldivsufsort',
- '-ldivsufsort64',
- ],
- },
- },
- 'sources': [
- 'brotli_compressor.cc',
- 'bsdiff.cc',
- 'bz2_compressor.cc',
- 'compressor_buffer.cc',
- 'diff_encoder.cc',
- 'endsley_patch_writer.cc',
- 'logging.cc',
- 'patch_writer.cc',
- 'patch_writer_factory.cc',
- 'split_patch_writer.cc',
- 'suffix_array_index.cc',
- ],
- },
- # bsdiff shared library
- {
- 'target_name': 'libbsdiff',
- 'type': 'shared_library',
- 'dependencies': [
- 'libbsdiff-static',
- ],
- },
- # bsdiff executable
- {
- 'target_name': 'bsdiff',
- 'type': 'executable',
- 'dependencies': [
- 'libbsdiff',
- ],
- 'sources': [
- 'bsdiff_arguments.cc',
- 'bsdiff_main.cc',
- ],
- },
- # bspatch static library
- {
- 'target_name': 'libbspatch-static',
- 'type': 'static_library',
- 'cflags!': ['-fPIE'],
- 'cflags': ['-fPIC'],
- 'all_dependent_settings': {
- 'link_settings': {
- 'libraries': [
- '-lbz2',
- '-lbrotlidec',
- ],
- },
- },
- 'sources': [
- 'brotli_decompressor.cc',
- 'bspatch.cc',
- 'buffer_file.cc',
- 'bz2_decompressor.cc',
- 'decompressor_interface.cc',
- 'extents.cc',
- 'extents_file.cc',
- 'file.cc',
- 'logging.cc',
- 'memory_file.cc',
- 'patch_reader.cc',
- 'sink_file.cc',
- 'utils.cc',
- ],
- },
- # bspatch shared library
- {
- 'target_name': 'libbspatch',
- 'type': 'shared_library',
- 'dependencies': [
- 'libbspatch-static',
- ],
- },
- # bspatch executable
- {
- 'target_name': 'bspatch',
- 'type': 'executable',
- 'dependencies': [
- 'libbspatch',
- ],
- 'sources': [
- 'bspatch_main.cc',
- ],
- },
- ],
- 'conditions': [
- ['USE_test == 1', {
- 'targets': [
- {
- 'target_name': 'bsdiff_unittest',
- 'type': 'executable',
- 'dependencies': [
- 'libbsdiff-static',
- 'libbspatch-static',
- '../common-mk/testrunner.gyp:testrunner',
- ],
- 'variables': {
- 'deps': [
- 'libchrome-<(libbase_ver)',
- ],
- },
- 'includes': ['../common-mk/common_test.gypi'],
- 'sources': [
- 'brotli_compressor_unittest.cc',
- 'brotli_decompressor_unittest.cc',
- 'bsdiff_arguments.cc',
- 'bsdiff_arguments_unittest.cc',
- 'bsdiff_unittest.cc',
- 'bspatch_unittest.cc',
- 'bz2_decompressor_unittest.cc',
- 'diff_encoder_unittest.cc',
- 'endsley_patch_writer_unittest.cc',
- 'extents_file_unittest.cc',
- 'extents_unittest.cc',
- 'patch_reader_unittest.cc',
- 'patch_writer_unittest.cc',
- 'split_patch_writer_unittest.cc',
- 'suffix_array_index_unittest.cc',
- 'test_utils.cc',
- ],
- },
- ],
- }],
- # fuzzer target
- ['USE_fuzzer == 1', {
- 'targets': [
- {
- 'target_name': 'bspatch_fuzzer',
- 'type': 'executable',
- 'dependencies': [
- 'libbspatch-static',
- ],
- 'includes': ['../../platform2/common-mk/common_fuzzer.gypi'],
- 'sources': [
- 'bspatch_fuzzer.cc',
- ],
- },
- ],
- }],
- ],
-}
diff --git a/libbsdiff.pc b/libbsdiff.pc
new file mode 100644
index 0000000..9b8f9f1
--- /dev/null
+++ b/libbsdiff.pc
@@ -0,0 +1,9 @@
+# This file is for libbsdiff in Chrome OS.
+
+Name: libbsdiff
+Description: bsdiff library for generating delta patches
+Version: 4.3.1
+# libbsdiff library is static lib ATM, so we don't use private versions of Libs
+# and Requires fields.
+Libs: -lbsdiff -lbz2
+Requires: libbrotlienc libdivsufsort libdivsufsort64
diff --git a/libbspatch.pc b/libbspatch.pc
new file mode 100644
index 0000000..c3c73db
--- /dev/null
+++ b/libbspatch.pc
@@ -0,0 +1,9 @@
+# This file is for libbspatch in Chrome OS.
+
+Name: libbspatch
+Description: bspatch library for applying delta patches
+Version: 4.3.1
+# libbspatch library is static lib ATM, so we don't use private versions of Libs
+# and Requires fields.
+Libs: -lbspatch -lbz2
+Requires: libbrotlidec