From 59e087d4166d1147defa53073a51a5399599c654 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org> Date: Thu, 18 Mar 2021 15:42:28 +0100 Subject: [PATCH] macOS: improve the algorithm that determines the install location on the disk --- macOS/build.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/macOS/build.sh b/macOS/build.sh index 752a180c70..b188675dcd 100755 --- a/macOS/build.sh +++ b/macOS/build.sh @@ -49,16 +49,18 @@ if [[ -z $VERSION ]]; then fi fi -# Install location must be truncated for installation of `gcc` -# If it's too long, the headers of the compiled libraries cannot be modified -# obliging recompilation on the user's system. Truncate to 5 characters -# To allow for distribution version to appear -LOCATION=$(echo "$VERSION" | cut -f1 -d"-" | cut -c 1-5) -if [[ "$VERSION" == *-unstable* || "$VERSION" == [a-zA-Z]* ]]; then - LOCATION="$LOCATION"-"$DATE" +# Install location must not be too long for gcc. +# Otherwise, the headers of the compiled libraries cannot be modified +# obliging recompilation on the user's system. +# If VERSION is not a official release number, then do some magic +# to get something not too long, still more or less unique. +if [[ "$VERSION" =~ ^[0-9\.]+$ ]]; then + LOCATION=$VERSION +else + # Get the first component, truncate it to 5 characters, and add the date + LOCATION=$(echo "$VERSION" | cut -f1 -d"-" | cut -c 1-5)-"$DATE" fi - ## ## Compile Dynare doc, dynare++, preprocessor, mex for MATLAB < 2018a ## -- GitLab