From 0228c06e2c6d2a04d2ae658ea1b879d7540142da Mon Sep 17 00:00:00 2001 From: John Date: Tue, 27 Jun 2023 12:02:59 +0200 Subject: [PATCH] bloaty: rebuild against protobuf-23.3_1 --- srcpkgs/bloaty/patches/cpp17.patch | 20 ++++++++ srcpkgs/bloaty/patches/system-abseil.patch | 58 ++++++++++++++++++++++ srcpkgs/bloaty/template | 2 +- 3 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/bloaty/patches/cpp17.patch create mode 100644 srcpkgs/bloaty/patches/system-abseil.patch diff --git a/srcpkgs/bloaty/patches/cpp17.patch b/srcpkgs/bloaty/patches/cpp17.patch new file mode 100644 index 00000000000..ca458dd79fb --- /dev/null +++ b/srcpkgs/bloaty/patches/cpp17.patch @@ -0,0 +1,20 @@ +--- bloaty-1.1/CMakeLists.txt 2020-05-24 06:43:55.000000000 +0200 ++++ - 2023-07-08 12:51:24.115742363 +0200 +@@ -2,7 +2,7 @@ + cmake_policy(SET CMP0048 NEW) + project (Bloaty VERSION 1.0) + project (Bloaty VERSION 1.1) +-set(CMAKE_CXX_STANDARD 11) ++set(CMAKE_CXX_STANDARD 17) + + # Options we define for users. + option(BLOATY_ENABLE_ASAN "Enable address sanitizer." OFF) +@@ -93,7 +93,7 @@ + include_directories("${CMAKE_CURRENT_BINARY_DIR}/src") + + # Baseline build flags. +-set(CMAKE_CXX_FLAGS "-std=c++11 -W -Wall -Wno-sign-compare") ++set(CMAKE_CXX_FLAGS "-W -Wall -Wno-sign-compare") + set(CMAKE_CXX_FLAGS_DEBUG "-g1") + set(CMAKE_CXX_FLAGS_RELEASE "-O2") + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g1") diff --git a/srcpkgs/bloaty/patches/system-abseil.patch b/srcpkgs/bloaty/patches/system-abseil.patch new file mode 100644 index 00000000000..799e10a3b54 --- /dev/null +++ b/srcpkgs/bloaty/patches/system-abseil.patch @@ -0,0 +1,58 @@ +--- bloaty-1.1/CMakeLists.txt 2020-05-24 06:43:55.000000000 +0200 ++++ - 2023-07-08 13:07:06.559266321 +0200 +@@ -35,6 +35,12 @@ + MESSAGE(STATUS "pkg-config not found, using bundled dependencies") + endif(${PKG_CONFIG_FOUND}) + endif(UNIX) ++find_package(absl CONFIG) ++if(absl_FOUND) ++ MESSAGE(STATUS "System absl found, using") ++else() ++ MESSAGE(STATUS "System absl not found, using bundled version") ++endif() + + # Set default build type. + if(NOT CMAKE_BUILD_TYPE) +@@ -89,7 +95,6 @@ + + include_directories(.) + include_directories(src) +-include_directories(third_party/abseil-cpp) + include_directories("${CMAKE_CURRENT_BINARY_DIR}/src") + + # Baseline build flags. +@@ -159,24 +164,6 @@ + src/macho.cc + src/range_map.cc + src/webassembly.cc +- # Until Abseil has a proper CMake build system +- third_party/abseil-cpp/absl/base/internal/raw_logging.cc # Grrrr... +- third_party/abseil-cpp/absl/base/internal/throw_delegate.cc +- third_party/abseil-cpp/absl/numeric/int128.cc +- third_party/abseil-cpp/absl/strings/ascii.cc +- third_party/abseil-cpp/absl/strings/charconv.cc +- third_party/abseil-cpp/absl/strings/escaping.cc +- third_party/abseil-cpp/absl/strings/internal/charconv_bigint.cc +- third_party/abseil-cpp/absl/strings/internal/charconv_parse.cc +- third_party/abseil-cpp/absl/strings/internal/memutil.cc +- third_party/abseil-cpp/absl/strings/internal/utf8.cc +- third_party/abseil-cpp/absl/strings/match.cc +- third_party/abseil-cpp/absl/strings/numbers.cc +- third_party/abseil-cpp/absl/strings/str_cat.cc +- third_party/abseil-cpp/absl/strings/string_view.cc +- third_party/abseil-cpp/absl/strings/str_split.cc +- third_party/abseil-cpp/absl/strings/substitute.cc +- third_party/abseil-cpp/absl/types/bad_optional_access.cc + # One source file, no special build system needed. + third_party/demumble/third_party/libcxxabi/cxa_demangle.cpp + ) +@@ -214,6 +201,9 @@ + endif(${PROTOBUF_FOUND}) + endif(UNIX) + ++list(APPEND LIBBLOATY_LIBS absl::strings) ++list(APPEND LIBBLOATY_LIBS absl::optional) ++ + if(DEFINED ENV{LIB_FUZZING_ENGINE}) + message("LIB_FUZZING_ENGINE set, building fuzz_target instead of Bloaty") + add_executable(fuzz_target tests/fuzz_target.cc) diff --git a/srcpkgs/bloaty/template b/srcpkgs/bloaty/template index 226d2f30ffc..2a79fb502f9 100644 --- a/srcpkgs/bloaty/template +++ b/srcpkgs/bloaty/template @@ -1,7 +1,7 @@ # Template file for 'bloaty' pkgname=bloaty version=1.1 -revision=11 +revision=12 build_style=cmake hostmakedepends="pkg-config protobuf" makedepends="capstone-devel protobuf-devel re2-devel zlib-devel"