Dear all,
after much criticism, I present you with an improved eclass for
handling the Intel 2016 (and hopefully beyond) suite of software.
We have improved the following:
* Made variables names more clear, to separate upstream vars from
internal/Gentoo vars.
* Practically no more global state in the eclass. Everything is handled
by getter functions now. Due to strong concerns voiced with regards to
egencache, getter functions are NOT used in global scope, except for
one occurrence. We believe the improved abstraction/encapsulation makes
this one use of a function in global scope bearable.
Regards
David
diff --git a/eclass/intel-sdp-r1.eclass b/eclass/intel-sdp-r1.eclass
index 14467b7..1413109 100644
--- a/eclass/intel-sdp-r1.eclass
+++ b/eclass/intel-sdp-r1.eclass
@@ -9,62 +9,71 @@
# Sci Team
# @BLURB: Handling of Intel's Software Development Products package management
+MULTILIB_COMPAT=( abi_x86_{32,64} )
+
+inherit check-reqs eutils multilib-build versionator
+
+EXPORT_FUNCTIONS pkg_setup src_unpack src_install pkg_postinst pkg_postrm pkg_pretend
+
if [[ ! ${_INTEL_SDP_R1_ECLASS_} ]]; then
-case "${EAPI:-0}" in
+case "${EAPI}" in
6) ;;
*) die "EAPI=${EAPI} is not supported" ;;
esac
-# @ECLASS-VARIABLE: INTEL_DID
+# @ECLASS-VARIABLE: INTEL_DIST_SKU
# @DEFAULT_UNSET
# @DESCRIPTION:
# The package download ID from Intel.
-# To find out its value, see the links to download in
+# To determine its value, see the links to download in
# https://registrationcenter.intel.com/RegCenter/MyProducts.aspx
#
# e.g. 8365
#
-# Must be defined before inheriting the eclass
+# Must be defined before inheriting the eclass.
-# @ECLASS-VARIABLE: INTEL_DPN
+# @ECLASS-VARIABLE: INTEL_DIST_NAME
# @DEFAULT_UNSET
# @DESCRIPTION:
# The package name to download from Intel.
-# To find out its value, see the links to download in
+# To determine its value, see the links to download in
# https://registrationcenter.intel.com/RegCenter/MyProducts.aspx
#
# e.g. parallel_studio_xe
#
-# Must be defined before inheriting the eclass
+# Must be defined before inheriting the eclass.
-# @ECLASS-VARIABLE: INTEL_DPV
+# @ECLASS-VARIABLE: INTEL_DIST_PV
# @DEFAULT_UNSET
# @DESCRIPTION:
# The package download version from Intel.
-# To find out its value, see the links to download in
+# To determine its value, see the links to download in
# https://registrationcenter.intel.com/RegCenter/MyProducts.aspx
#
# e.g. 2016_update1
#
-# Must be defined before inheriting the eclass
+# Must be defined before inheriting the eclass.
# @ECLASS-VARIABLE: INTEL_TARX
# @DESCRIPTION:
-# The package extention.
-# To find out its value, see the links to download in
+# The package suffix.
+# To determine its value, see the links to download in
# https://registrationcenter.intel.com/RegCenter/MyProducts.aspx
#
# e.g. tar.gz
#
-# Must be defined before inheriting the eclass
+# Must be defined before inheriting the eclass.
: ${INTEL_TARX:=tgz}
# @ECLASS-VARIABLE: INTEL_SUBDIR
# @DEFAULT_UNSET
# @DESCRIPTION:
-# The package sub-directory where it will end-up in /opt/intel
-# To find out its value, you have to do a raw install from the Intel tar ball
+# The package sub-directory (without version numbers) where it will end-up in /opt/intel
+#
+# e.g. compilers_and_libraries
+#
+# To determine its value, you have to do a raw install from the Intel tarball.
# @ECLASS-VARIABLE: INTEL_SKIP_LICENSE
# @DEFAULT_UNSET
@@ -86,7 +95,7 @@ esac
# @ECLASS-VARIABLE: INTEL_BIN_RPMS
# @DESCRIPTION:
-# Functional name of rpm without any version/arch tag
+# Functional name of rpm without any version/arch tag.
# Has to be a bash array
#
# e.g. ("icc-l-all-devel")
@@ -94,63 +103,81 @@ esac
# if the rpm is located in a directory other than INTEL_RPMS_DIR you can
# specify the full path
#
-# e.g. CLI_install/rpm/intel-vtune-amplifier-xe-cli
-: ${INTEL_BIN_RPMS:=()}
+# e.g. ("CLI_install/rpm/intel-vtune-amplifier-xe-cli")
+[[ ${INTEL_BIN_RPMS[@]} ]] || INTEL_BIN_RPMS=()
# @ECLASS-VARIABLE: INTEL_AMD64_RPMS
# @DESCRIPTION:
-# AMD64 single arch rpms. Same syntax as INTEL_BIN_RPMS
-# Has to be a bash array
-: ${INTEL_AMD64_RPMS:=()}
+# AMD64 single arch rpms. Same syntax as INTEL_BIN_RPMS.
+# Has to be a bash array.
+[[ ${INTEL_AMD64_RPMS[@]} ]] || INTEL_AMD64_RPMS=()
# @ECLASS-VARIABLE: INTEL_X86_RPMS
# @DESCRIPTION:
-# X86 single arch rpms. Same syntax as INTEL_BIN_RPMS
-# Has to be a bash array
-: ${INTEL_X86_RPMS:=()}
+# X86 single arch rpms. Same syntax as INTEL_BIN_RPMS.
+# Has to be a bash array.
+[[ ${INTEL_X86_RPMS[@]} ]] || INTEL_X86_RPMS=()
# @ECLASS-VARIABLE: INTEL_DAT_RPMS
# @DESCRIPTION:
# Functional name of rpm of common data which are arch free
-# without any version tag
-# Has to be a bash array
+# without any version tag. Has to be a bash array.
#
# e.g. ("openmp-l-all-devel")
#
# if the rpm is located in a directory different to INTEL_RPMS_DIR you can
# specify the full path
#
-# e.g. CLI_install/rpm