Files
TheRock/third-party/grpc/patch_install_linux.sh
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

62 lines
2.3 KiB
Bash
Executable File

#!/bin/bash
# Copyright Advanced Micro Devices, Inc.
# SPDX-License-Identifier: MIT
set -e
PREFIX="${1:?Expected install prefix argument}"
THEROCK_SOURCE_DIR="${THEROCK_SOURCE_DIR:?THEROCK_SOURCE_DIR not defined}"
# NOTE: gRPC is built as static libraries (.a), not shared libraries (.so).
# SONAME rewriting is not needed for static libraries.
# Only .pc and .cmake file modifications are necessary for relocatability.
# Update .pc files to use relative paths
if [ -d "$PREFIX/lib/pkgconfig" ]; then
echo "Updating pkgconfig files"
for pcfile in "$PREFIX/lib/pkgconfig"/*.pc; do
if [ -f "$pcfile" ]; then
sed -i -E 's|^prefix=.+|prefix=${pcfiledir}/../..|' "$pcfile"
sed -i -E 's|^exec_prefix=.+|exec_prefix=${prefix}|' "$pcfile"
sed -i -E 's|^libdir=.+|libdir=${prefix}/lib|' "$pcfile"
sed -i -E 's|^includedir=.+|includedir=${prefix}/include|' "$pcfile"
fi
done
fi
# Update CMake config files to be relocatable
echo "Updating CMake config files"
# Update gRPC CMake configs
if [ -d "$PREFIX/lib/cmake/grpc" ]; then
for cmfile in "$PREFIX/lib/cmake/grpc"/*.cmake; do
if [ -f "$cmfile" ]; then
# Make paths relative by using CMAKE_CURRENT_LIST_DIR
sed -i 's|INTERFACE_INCLUDE_DIRECTORIES "[^"]*include|INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include|g' "$cmfile"
sed -i 's|IMPORTED_LOCATION "[^"]*lib/\([^"]*\)"|IMPORTED_LOCATION "${_IMPORT_PREFIX}/lib/\1"|g' "$cmfile"
fi
done
fi
# Update protobuf CMake configs
if [ -d "$PREFIX/lib/cmake/protobuf" ]; then
for cmfile in "$PREFIX/lib/cmake/protobuf"/*.cmake; do
if [ -f "$cmfile" ]; then
sed -i 's|INTERFACE_INCLUDE_DIRECTORIES "[^"]*include|INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include|g' "$cmfile"
sed -i 's|IMPORTED_LOCATION "[^"]*lib/\([^"]*\)"|IMPORTED_LOCATION "${_IMPORT_PREFIX}/lib/\1"|g' "$cmfile"
fi
done
fi
# Update absl CMake configs
if [ -d "$PREFIX/lib/cmake/absl" ]; then
for cmfile in "$PREFIX/lib/cmake/absl"/*.cmake; do
if [ -f "$cmfile" ]; then
sed -i 's|INTERFACE_INCLUDE_DIRECTORIES "[^"]*include|INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include|g' "$cmfile"
sed -i 's|IMPORTED_LOCATION "[^"]*lib/\([^"]*\)"|IMPORTED_LOCATION "${_IMPORT_PREFIX}/lib/\1"|g' "$cmfile"
fi
done
fi
echo "gRPC patching completed successfully"