From a8dafdc2b55299eb109fb2bd98bf4e1dc5bd028d Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Sat, 6 Mar 2021 01:55:47 +0530 Subject: [PATCH] Fix cubrid setup on Ubuntu 16.04 --- src/scripts/ext/cubrid.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/scripts/ext/cubrid.sh b/src/scripts/ext/cubrid.sh index 2d4913e0..36e8d6d4 100644 --- a/src/scripts/ext/cubrid.sh +++ b/src/scripts/ext/cubrid.sh @@ -7,6 +7,15 @@ add_license_log() { echo "::endgroup::" } +# Function to setup gcc-7 and g++-7 +setup_compiler() { + if ! command -v gcc-7 >/dev/null || ! command -v g++-7 >/dev/null; then + add_ppa ubuntu-toolchain-r/test + add_packages gcc-7 g++-7 -y + fi + printf "gcc g++" | xargs -d ' ' -I {} sudo update-alternatives --install /usr/bin/{} {} /usr/bin/{}-7 7 +} + # Function to set cubrid repo for the extension. set_cubrid_repo() { case "${ext:?}" in @@ -30,11 +39,13 @@ add_cubrid_helper() { status='Installed and enabled' set_cubrid_repo set_cubrid_branch + [ "$DISTRIB_RELEASE" = "16.04" ] && setup_compiler ( git clone -b "$cubrid_branch" --recursive "https://github.com/CUBRID/$cubrid_repo" "/tmp/$cubrid_repo" cd "/tmp/$cubrid_repo" || exit ! [[ "$version" =~ ${old_versions:?} ]] && add_devtools - phpize && ./configure --with-php-config="$(command -v php-config)" --with-"${ext/_/-}"=shared + phpize + sudo ./configure --with-php-config="$(command -v php-config)" --with-"${ext/_/-}"=shared make -j"$(nproc)" sudo make install )