kde5-functions.eclass: Make gcc version check configurable
authorAndreas Sturmlechner <andreas.sturmlechner@gmail.com>
Wed, 23 Sep 2015 14:33:59 +0000 (16:33 +0200)
committerMichael Palimaka <kensington@gentoo.org>
Thu, 24 Sep 2015 19:38:24 +0000 (05:38 +1000)
eclass/kde5-functions.eclass

index e19d7fdbed6d13bf9d2753f2d0d4780b965f99de..6bebf7f66126d15b21f54b14541267ecc14a75af 100644 (file)
@@ -38,6 +38,11 @@ esac
 # Minimal KDE Applicaions version to require for the package.
 : ${KDE_APPS_MINIMAL:=14.12.0}
 
+# @ECLASS-VARIABLE: KDE_GCC_MINIMAL
+# @DESCRIPTION:
+# Minimal GCC version to require for the package.
+: ${KDE_GCC_MINIMAL:=4.8}
+
 # @ECLASS-VARIABLE: KDEBASE
 # @DESCRIPTION:
 # This gets set to a non-zero value when a package is considered a kde or
@@ -79,10 +84,12 @@ _check_gcc_version() {
                local version=$(gcc-version)
                local major=${version%.*}
                local minor=${version#*.}
+               local min_major=${KDE_GCC_MINIMAL%.*}
+               local min_minor=${KDE_GCC_MINIMAL#*.}
 
-               [[ ${major} -lt 4 ]] || \
-                               ( [[ ${major} -eq 4 && ${minor} -lt 8 ]] ) \
-                       && die "Sorry, but gcc-4.8 or later is required for KDE 5."
+               [[ ${major} -lt ${min_major} ]] || \
+                               ( [[ ${major} -eq ${min_major} && ${minor} -lt ${min_minor} ]] ) \
+                       && die "Sorry, but gcc-${KDE_GCC_MINIMAL} or later is required for this package."
        fi
 }