https://bugs.kde.org/show_bug.cgi?id=429103

--- Comment #30 from caulier.gil...@gmail.com ---
Git commit 8c33718ee8c6335d15cfd894fbec51dfd0161795 by Gilles Caulier.
Committed on 05/12/2020 at 05:54.
Pushed by cgilles into branch 'master'.

fix detection of MacOS BigSur and fix Clang install failure due to wrong major
version tested

M  +1    -1    project/bundles/macports/01-build-macports.sh
M  +48   -32   project/bundles/macports/common.sh

https://invent.kde.org/graphics/digikam/commit/8c33718ee8c6335d15cfd894fbec51dfd0161795

diff --git a/project/bundles/macports/01-build-macports.sh
b/project/bundles/macports/01-build-macports.sh
index 75dd1fb5d6..c163d7fab9 100755
--- a/project/bundles/macports/01-build-macports.sh
+++ b/project/bundles/macports/01-build-macports.sh
@@ -218,7 +218,7 @@ echo "---------- Building digiKam dependencies with
Macports"

 # With OSX less than El Capitan, we need a more recent Clang compiler than one
provided by XCode.

-if [[ $MAJOR_OSX_VERSION -lt 10 ]]; then
+if [[ $MAJOR_OSX_VERSION -lt 11 && $MINOR_OSX_VERSION -lt 10 ]]; then

     echo "---------- Install more recent Clang compiler from Macports for
specific ports"
     port install clang_select
diff --git a/project/bundles/macports/common.sh
b/project/bundles/macports/common.sh
index c4b4fc2b91..fc283d824b 100755
--- a/project/bundles/macports/common.sh
+++ b/project/bundles/macports/common.sh
@@ -110,44 +110,60 @@ echo "Elaspsed time for script execution :
$(($difftimelps / 3600 )) hours $((($

 ########################################################################
 # Set strings with detected MacOS info :
-#    $MAJOR_OSX_VERSION : detected MacOS major ID (as 7 for 10.7 or 10 for
10.10)
+#    $MAJOR_OSX_VERSION : detected MacOS major ID (as 10 or 11)
+#    $MINOR_OSX_VERSION : detected MacOS minor ID (as 7 for 10.7 or 10 for
10.10)
 #    $OSX_CODE_NAME     : detected MacOS code name
 OsxCodeName()
 {

-MAJOR_OSX_VERSION=$(sw_vers -productVersion | awk -F '.' '{print $1 "." $2}'|
cut -d . -f 2)
-
-if   [[ $MAJOR_OSX_VERSION == "13" ]]
-    then OSX_CODE_NAME="HighSierra"
-elif [[ $MAJOR_OSX_VERSION == "12" ]]
-    then OSX_CODE_NAME="Sierra"
-elif [[ $MAJOR_OSX_VERSION == "11" ]]
-    then OSX_CODE_NAME="ElCapitan"
-elif [[ $MAJOR_OSX_VERSION == "10" ]]
-    then OSX_CODE_NAME="Yosemite"
-elif [[ $MAJOR_OSX_VERSION == "9" ]]
-    then OSX_CODE_NAME="Mavericks"
-elif [[ $MAJOR_OSX_VERSION == "8" ]]
-    then OSX_CODE_NAME="MountainLion"
-elif [[ $MAJOR_OSX_VERSION == "7" ]]
-    then OSX_CODE_NAME="Lion"
-elif [[ $MAJOR_OSX_VERSION == "6" ]]
-    then OSX_CODE_NAME="SnowLeopard"
-elif [[ $MAJOR_OSX_VERSION == "5" ]]
-    then OSX_CODE_NAME="Leopard"
-elif [[ $MAJOR_OSX_VERSION == "4" ]]
-    then OSX_CODE_NAME="Tiger"
-elif [[ $MAJOR_OSX_VERSION == "3" ]]
-    then OSX_CODE_NAME="Panther"
-elif [[ $MAJOR_OSX_VERSION == "2" ]]
-    then OSX_CODE_NAME="Jaguar"
-elif [[ $MAJOR_OSX_VERSION == "1" ]]
-    then OSX_CODE_NAME="Puma"
-elif [[ $MAJOR_OSX_VERSION == "0" ]]
-    then OSX_CODE_NAME="Cheetah"
+MAJOR_OSX_VERSION=$(sw_vers -productVersion | awk -F '.' '{print $1 "." $2}'|
cut -d . -f 1)
+MINOR_OSX_VERSION=$(sw_vers -productVersion | awk -F '.' '{print $1 "." $2}'|
cut -d . -f 2)
+
+if   [[ $MAJOR_OSX_VERSION == "10" ]] ; then
+
+    if   [[ $MAJOR_OSX_VERSION == "16" ]]
+        then OSX_CODE_NAME="Catalina"
+    elif [[ $MAJOR_OSX_VERSION == "14" ]]
+        then OSX_CODE_NAME="Mojave"
+    elif [[ $MAJOR_OSX_VERSION == "13" ]]
+        then OSX_CODE_NAME="HighSierra"
+    elif [[ $MAJOR_OSX_VERSION == "12" ]]
+        then OSX_CODE_NAME="Sierra"
+    elif [[ $MAJOR_OSX_VERSION == "11" ]]
+        then OSX_CODE_NAME="ElCapitan"
+    elif [[ $MAJOR_OSX_VERSION == "10" ]]
+        then OSX_CODE_NAME="Yosemite"
+    elif [[ $MAJOR_OSX_VERSION == "9" ]]
+        then OSX_CODE_NAME="Mavericks"
+    elif [[ $MAJOR_OSX_VERSION == "8" ]]
+        then OSX_CODE_NAME="MountainLion"
+    elif [[ $MAJOR_OSX_VERSION == "7" ]]
+        then OSX_CODE_NAME="Lion"
+    elif [[ $MAJOR_OSX_VERSION == "6" ]]
+        then OSX_CODE_NAME="SnowLeopard"
+    elif [[ $MAJOR_OSX_VERSION == "5" ]]
+        then OSX_CODE_NAME="Leopard"
+    elif [[ $MAJOR_OSX_VERSION == "4" ]]
+        then OSX_CODE_NAME="Tiger"
+    elif [[ $MAJOR_OSX_VERSION == "3" ]]
+        then OSX_CODE_NAME="Panther"
+    elif [[ $MAJOR_OSX_VERSION == "2" ]]
+        then OSX_CODE_NAME="Jaguar"
+    elif [[ $MAJOR_OSX_VERSION == "1" ]]
+        then OSX_CODE_NAME="Puma"
+    elif [[ $MAJOR_OSX_VERSION == "0" ]]
+        then OSX_CODE_NAME="Cheetah"
+    fi
+
+elif [[ $MAJOR_OSX_VERSION == "11" ]] ; then
+
+    if   [[ $MAJOR_OSX_VERSION == "0" ]]
+        then OSX_CODE_NAME="BigSur"
+    fi
+
 fi

-echo -e "---------- Detected OSX version 10.$MAJOR_OSX_VERSION and code name
$OSX_CODE_NAME"
+echo -e "---------- Detected OSX version $MAJOR_OSX_VERSION.$MINOR_OSX_VERSION
and code name $OSX_CODE_NAME"

 }

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to