From 27f87bd821239fda40db72790d2eca4bde9e3ac0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 30 Sep 2020 17:31:20 -0700 Subject: [PATCH] feat: Enable change the system install path (#653) (#654) #### Problem: The current `CMAKE_INSTALL_PREFIX` value for the `system` build mode is `/usr`. However, in`macOS` as an example, you cannot write to `/usr` without `sudo` permission. #### Proposed solution: Enable changing the value to `/usr/local` (or any other path). This change makes the script use the value of the environment variable `SYSTEM_INSTALL_PREFIX` to select the installation path. If the variable is not set, it fallback to the path `/usr`. (cherry picked from commit 111185838cebe3415e47c75e67fb81295952ce68) Co-authored-by: Suhaib Mujahid --- script/build-libgit2.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/build-libgit2.sh b/script/build-libgit2.sh index a541849..8888ec9 100755 --- a/script/build-libgit2.sh +++ b/script/build-libgit2.sh @@ -47,7 +47,7 @@ if [ -z "${BUILD_SHARED_LIBS}" ]; then fi if [ "${BUILD_SYSTEM}" = "ON" ]; then - BUILD_INSTALL_PREFIX="/usr" + BUILD_INSTALL_PREFIX=${SYSTEM_INSTALL_PREFIX-"/usr"} else BUILD_INSTALL_PREFIX="${BUILD_PATH}/install" mkdir -p "${BUILD_PATH}/install/lib"