Skip to content

Commit

Permalink
Vendor google's version of fmtlib
Browse files Browse the repository at this point in the history
Fixes #44
  • Loading branch information
nmeum committed Jul 15, 2021
1 parent 53df642 commit 21061c1
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 10 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
run: |
sudo apt-get update
DEBIAN_FRONTEND=noninteractive sudo apt-get install -yq \
${{ matrix.pkgs }} cmake git golang libbrotli-dev libfmt-dev \
${{ matrix.pkgs }} cmake git golang libbrotli-dev \
libgtest-dev liblz4-dev libpcre2-dev libprotobuf-dev libunwind-dev \
libusb-1.0-0-dev libzstd-dev make pkg-config
- name: checkout
Expand Down Expand Up @@ -71,31 +71,31 @@ jobs:
run: |
zypper -n ref
zypper -n in ${{ matrix.pkgs }} cmake git go gtest pcre2-devel pkgconfig \
'pkgconfig(fmt)' 'pkgconfig(libbrotlicommon)' 'pkgconfig(liblz4)' \
'pkgconfig(libbrotlicommon)' 'pkgconfig(liblz4)' \
'pkgconfig(libunwind-generic)' 'pkgconfig(libusb-1.0)' \
'pkgconfig(libzstd)' 'pkgconfig(protobuf)' ninja
- name: prep archlinux
if: startsWith(matrix.os, 'archlinux')
run: |
pacman -Syu --needed --noconfirm \
${{ matrix.pkgs }} brotli cmake fmt git go gtest libunwind \
${{ matrix.pkgs }} brotli cmake git go gtest libunwind \
libusb lz4 pcre2 pkgconfig protobuf zstd ninja
- name: prep ubuntu
if: startsWith(matrix.os, 'ubuntu')
run: |
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -yq \
${{ matrix.pkgs }} cmake git golang libbrotli-dev libfmt-dev \
${{ matrix.pkgs }} cmake git golang libbrotli-dev \
libgtest-dev liblz4-dev libpcre2-dev libprotobuf-dev libunwind-dev \
libusb-1.0-0-dev libzstd-dev pkg-config protobuf-compiler ninja-build
- name: prep alpine
if: startsWith(matrix.os, 'alpine')
run: |
apk add build-base pcre2-dev linux-headers libusb-dev gtest-dev samurai \
go git perl cmake protobuf-dev brotli-dev zstd-dev lz4-dev fmt-dev
go git perl cmake protobuf-dev brotli-dev zstd-dev lz4-dev
# required for patches
- name: git config
Expand Down
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,7 @@
shallow = true
path = vendor/incremental_delivery
url = https://android.googlesource.com/platform/system/incremental_delivery
[submodule "vendor/fmtlib"]
shallow = true
path = vendor/fmtlib
url = https://android.googlesource.com/platform/external/fmtlib.git
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ The following libraries are required by android-tools:
5. [brotli][brotli]
6. [zstd][zstd]
7. [lz4][lz4]
8. [fmt][fmt]

Additionally the following software is required at compile-time:

Expand Down Expand Up @@ -109,5 +108,4 @@ have been copied from Anatol's ruby script.
[brotli]: https://github.com/google/brotli
[zstd]: https://facebook.github.io/zstd/
[lz4]: https://github.com/lz4/lz4
[fmt]: https://github.com/fmtlib/fmt
[anatol.pomozov]: https://github.com/anatol
3 changes: 2 additions & 1 deletion vendor/CMakeLists.fastboot.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ target_include_directories(libfsmgr PRIVATE
core/fs_mgr/liblp/include libbase/include
extras/ext4_utils/include core/libsparse/include
boringssl/include)
target_link_libraries(libfsmgr PUBLIC fmt::fmt)

add_library(libselinux STATIC
selinux/libselinux/src/booleans.c
Expand Down Expand Up @@ -134,4 +135,4 @@ target_compile_definitions(fastboot PRIVATE
target_link_libraries(fastboot
libsparse libzip libcutils liblog libfsmgr libutil
libbase libext4 libselinux libsepol libdiagnoseusb crypto
z pcre2-8 pthread dl fmt::fmt)
z pcre2-8 pthread dl)
1 change: 1 addition & 0 deletions vendor/CMakeLists.libandroidfw.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ target_include_directories(libandroidfw PUBLIC
native/include
libziparchive/include
incremental_delivery/incfs/util/include)
target_link_libraries(libandroidfw PUBLIC fmt::fmt)
4 changes: 2 additions & 2 deletions vendor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ set(android-vendored
f2fs-tools
e2fsprogs
incremental_delivery
fmtlib
boringssl)

if(EXISTS "${ANDROID_PATCH_DIR}/")
Expand All @@ -34,9 +35,8 @@ if(EXISTS "${ANDROID_PATCH_DIR}/")
endif()

add_subdirectory(boringssl EXCLUDE_FROM_ALL)
add_subdirectory(fmtlib EXCLUDE_FROM_ALL)
find_package(Protobuf REQUIRED)
find_package(fmt REQUIRED)
include_directories(${fmt_INCLUDE_DIRS})
include_directories(${PROTOBUF_INCLUDE_DIRS})
include_directories(${CMAKE_CURRENT_BINARY_DIR})

Expand Down
1 change: 1 addition & 0 deletions vendor/fmtlib
Submodule fmtlib added at fc2181

0 comments on commit 21061c1

Please sign in to comment.