mirror of
https://github.com/expo/bsdiff.git
synced 2026-11-14 17:49:03 -10:00
Merge changes I41ddfc48,I0fffc870
* changes: bsdiff: migrate to BUILD.gn from bsdiff.gyp bsdiff: Add .pc files
This commit is contained in:
commit
e80e224395
4 files changed
+189
-190
No files matched your search
@@ -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",
|
||||
]
|
||||
}
|
||||
}
|
||||
-190
@@ -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',
|
||||
],
|
||||
},
|
||||
],
|
||||
}],
|
||||
],
|
||||
}
|
||||
@@ -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
|
||||
@@ -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
|
||||
Reference in new issue
Block a user