void-packages/srcpkgs/grpc/patches/private-abseil.patch
Đoàn Trần Công Danh 7fc9190f0e srcpkgs/g*: convert patches to -Np1
* gcc is kept at -Np0, because of void-cross

```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

34 lines
1.3 KiB
Diff

gRPC requires abseil, but abseil can be statically linked to avoid installing
and tracking a ton of extra shared libs. Unfortunately, grpcpp headers now
include absl headers, so these need to be installed. Put them in a private
location because the full abseil installation is not provided.
diff -ur third_party/abseil-cpp/CMakeLists.txt third_party/abseil-cpp/CMakeLists.txt
--- a/third_party/abseil-cpp/CMakeLists.txt
+++ b/third_party/abseil-cpp/CMakeLists.txt
@@ -46,6 +46,7 @@
OPTION(BUILD_TESTING "Build tests" OFF)
project(absl LANGUAGES CXX VERSION 20210324)
+set(BUILD_SHARED_LIBS OFF)
include(CTest)
# Output directory is correct by default for most build setups. However, when
@@ -57,7 +58,7 @@
# when absl is included as subproject (i.e. using add_subdirectory(abseil-cpp))
# in the source tree of a project that uses it, install rules are disabled.
if(NOT CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
- option(ABSL_ENABLE_INSTALL "Enable install rule" OFF)
+ option(ABSL_ENABLE_INSTALL "Enable install rule" ON)
else()
option(ABSL_ENABLE_INSTALL "Enable install rule" ON)
endif()
@@ -176,7 +177,7 @@
endif() # absl_VERSION
install(DIRECTORY absl
- DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/grpc_absl
FILES_MATCHING
PATTERN "*.inc"
PATTERN "*.h"