From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-528363-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	by finch.gentoo.org (Postfix) with ESMTP id 5418C1381F3
	for <garchives@archives.gentoo.org>; Tue, 27 Nov 2012 19:34:59 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 21C1521C0C3;
	Tue, 27 Nov 2012 19:33:57 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	(using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 53AD321C0C3
	for <gentoo-commits@lists.gentoo.org>; Tue, 27 Nov 2012 19:33:56 +0000 (UTC)
Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163])
	(using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id CE25033D9DB
	for <gentoo-commits@lists.gentoo.org>; Tue, 27 Nov 2012 19:33:54 +0000 (UTC)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by hornbill.gentoo.org (Postfix) with ESMTP id 7E6CEE5453
	for <gentoo-commits@lists.gentoo.org>; Tue, 27 Nov 2012 19:33:52 +0000 (UTC)
From: "Justin Lecher" <jlec@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Justin Lecher" <jlec@gentoo.org>
Message-ID: <1354044116.85f8fc569d35d6691cec47ad5d594629ea9457f2.jlec@gentoo>
Subject: [gentoo-commits] proj/sci:master commit in: eclass/
X-VCS-Repository: proj/sci
X-VCS-Files: eclass/intel-sdp.eclass
X-VCS-Directories: eclass/
X-VCS-Committer: jlec
X-VCS-Committer-Name: Justin Lecher
X-VCS-Revision: 85f8fc569d35d6691cec47ad5d594629ea9457f2
X-VCS-Branch: master
Date: Tue, 27 Nov 2012 19:33:52 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Archives-Salt: 9c0801fd-2e09-46d1-a184-96ee36e6f8d2
X-Archives-Hash: bf5f7b413bda2c44caf7263a12e7f45f

commit:     85f8fc569d35d6691cec47ad5d594629ea9457f2
Author:     Justin Lecher <jlec <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 23 19:04:28 2012 +0000
Commit:     Justin Lecher <jlec <AT> gentoo <DOT> org>
CommitDate: Tue Nov 27 19:21:56 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=85f8fc56

Resort general functions and variables at the beginning

---
 eclass/intel-sdp.eclass |  356 ++++++++++++++++++++++++-----------------------
 1 files changed, 180 insertions(+), 176 deletions(-)

diff --git a/eclass/intel-sdp.eclass b/eclass/intel-sdp.eclass
index 14dba83..2037ed3 100644
--- a/eclass/intel-sdp.eclass
+++ b/eclass/intel-sdp.eclass
@@ -75,6 +75,11 @@
 #
 # e.g. openmp
 
+# @ECLASS-VARIABLE: INTEL_SDP_DB
+# @DESCRIPTION:
+# Full path to intel registry db
+INTEL_SDP_DB="${EROOT%/}"/opt/intel/intel-sdp-products.db
+
 inherit check-reqs multilib versionator
 
 _INTEL_PV1=$(get_version_component_range 1)
@@ -133,6 +138,181 @@ intel-sdp_pkg_pretend() {
 #
 # e.g. amd64-multilib -> INTEL_ARCH="intel64 ia32"
 
+# @ECLASS-FUNCTION: intel_link_eclipse_plugins
+# @DESCRIPTION:
+# Creating necessary links to use intel compiler with eclipse
+intel_link_eclipse_plugins() {
+    local c f
+    pushd ${INTEL_SDP_DIR}/eclipse_support > /dev/null
+        for c in cdt*; do
+            local cv=${c#cdt} ev=3.$(( ${cv:0:1} - 1))
+            if has_version "dev-util/eclipse-sdk:${ev}"; then
+                einfo "Linking eclipse (v${ev}) plugin cdt (v${cv})"
+                for f in cdt${cv}/eclipse/features/*; do
+                    dodir /usr/$(get_libdir)/eclipse-${ev}/features
+                    dosym "${INTEL_SDP_EDIR}"/eclipse_support/${f} \
+                        /usr/$(get_libdir)/eclipse-${ev}/features/ || die
+                done
+                for f in cdt${cv}/eclipse/plugins/*; do
+                    dodir /usr/$(get_libdir)/eclipse-${ev}/plugins
+                    dosym "${INTEL_SDP_EDIR}"/eclipse_support/${f} \
+                        /usr/$(get_libdir)/eclipse-${ev}/plugins/ || die
+                done
+            fi
+        done
+    popd > /dev/null
+}
+
+# @ECLASS-FUNCTION: big-warning
+# @INTERNAL
+# warn user that we really require a license
+
+big-warning() {
+    case ${1} in
+        test-failed )
+            echo
+            ewarn "Function test failed. Most probably due to an invalid license."
+            ewarn "This means you already tried to bypass the license check once."
+            ;;
+    esac
+
+    echo ""
+    ewarn "Make sure you have recieved the an Intel license."
+    ewarn "To receive a non-commercial license, you need to register at:"
+    ewarn "http://software.intel.com/en-us/articles/non-commercial-software-development/"
+    ewarn "Install the license file into ${INTEL_SDP_EDIR}/licenses/"
+
+    case ${1} in
+        pre-check )
+            ewarn "before proceeding with installation of ${P}"
+            echo ""
+            ;;
+        * )
+            echo ""
+            ;;
+            esac
+}
+
+# @ECLASS-FUNCTION: _version_test
+# @INTERNAL
+# Testing for valid license by asking for version information of the compiler
+_version-test() {
+    local _comp _comp_full _arch _file _warn
+    case ${PN} in
+        ifc )
+            _comp=ifort
+            ;;
+        icc )
+            _comp=icc
+            ;;
+        *)
+            die "${PN} is not supported for testing"
+            ;;
+    esac
+
+    for _arch in ${INTEL_ARCH}; do
+        case ${EBUILD_PHASE} in
+            install )
+                _comp_full="${ED}/${INTEL_SDP_DIR}/bin/${_arch}/${_comp}"
+                ;;
+            postinst )
+                _comp_full="${INTEL_SDP_EDIR}/bin/${_arch}/${_comp}"
+                ;;
+            * )
+                ewarn "Compile test not supported in ${EBUILD_PHASE}"
+                continue
+                ;;
+        esac
+
+        debug-print "LD_LIBRARY_PATH=\"${INTEL_SDP_EDIR}/bin/${_arch}/\" \"${_comp_full}\" -V"
+
+        LD_LIBRARY_PATH="${INTEL_SDP_EDIR}/bin/${_arch}/" "${_comp_full}" -V &>/dev/null
+        [[ $? -ne 0 ]] && _warn=yes
+    done
+    [[ "${_warn}" == "yes" ]] && big-warning test-failed
+}
+
+# @ECLASS-FUNCTION: _compile-test
+# @INTERNAL
+# Testing for valid license with small compile test
+_compile-test() {
+    local _comp _comp_full _arch _file _warn
+    case ${1} in
+        fortran )
+            _file="${T}/${1}.f"
+            cat > "${_file}" <<- EOF
+            end
+            EOF
+            _comp=ifort
+            ;;
+        c )
+            _file="${T}/${1}.c"
+            cat > "${_file}" <<- EOF
+            main() {
+            ;
+            }
+            EOF
+            _comp=icc
+            ;;
+        *)
+            die "This ${1} is not supported for testing"
+            ;;
+    esac
+
+    for _arch in ${INTEL_ARCH}; do
+        case ${EBUILD_PHASE} in
+            install )
+                _comp_full="${ED}/${INTEL_SDP_DIR}/bin/${_arch}/${_comp}"
+                ;;
+            postinst )
+                _comp_full="${INTEL_SDP_EDIR}/bin/${_arch}/${_comp}"
+                ;;
+            * )
+                ewarn "Compile test not supported in ${EBUILD_PHASE}"
+                continue
+                ;;
+        esac
+
+#		debug-print "LD_LIBRARY_PATH=\"${INTEL_SDP_EDIR}/bin/${_arch}/\" \"${_comp_full}\" -c \"${_file}"
+
+#		LD_LIBRARY_PATH="${INTEL_SDP_EDIR}/bin/${_arch}/" "${_comp_full}" -c "${_file}" &>/dev/null
+
+        debug-print "LD_LIBRARY_PATH=\"${INTEL_SDP_EDIR}/bin/${_arch}/\" \"${_comp_full}\" -V"
+
+        LD_LIBRARY_PATH="${INTEL_SDP_EDIR}/bin/${_arch}/" "${_comp_full}" -V &>/dev/null
+        [[ $? -ne 0 ]] && _warn=yes
+    done
+    [[ "${_warn}" == "yes" ]] && big-warning test-failed
+}
+
+# @ECLASS-FUNCTION: _compile-fortran
+# @INTERNAL
+# Run fortran compile test
+_compile-fortran() { _compile-test fortran; }
+
+# @ECLASS-FUNCTION: _compile-c
+# @INTERNAL
+# Run c compile test
+_compile-c() { _compile-test c; }
+
+# @ECLASS-FUNCTION: run-test
+# @INTERNAL
+# Test if installed compiler is working
+run-test() {
+    case ${PN} in
+        ifc )
+            debug-print "Testing ifort"
+            _compile-fortran ;;
+        icc )
+            debug-print "Testing icc"
+            _compile-c ;;
+        * )
+            debug-print "No test available for ${PN}"
+            ;;
+    esac
+}
+
+
 # @ ECLASS-FUNCTION: intel-sdp_pkg_setup
 # @DESCRIPTION:
 # The setup finction serves two purposes:
@@ -214,28 +394,6 @@ intel-sdp_src_unpack() {
 	mv -v opt/intel/* ${INTEL_SDP_DIR} || die "mv to INTEL_SDP_DIR failed"
 }
 
-intel_link_eclipse_plugins() {
-	pushd ${INTEL_SDP_DIR}/eclipse_support > /dev/null
-	local c f
-	for c in cdt*; do
-		local cv=${c#cdt} ev=3.$(( ${cv:0:1} - 1))
-		if has_version "dev-util/eclipse-sdk:${ev}"; then
-			einfo "Linking eclipse (v${ev}) plugin cdt (v${cv})"
-			for f in cdt${cv}/eclipse/features/*; do
-				dodir /usr/$(get_libdir)/eclipse-${ev}/features
-				dosym "${INTEL_SDP_EDIR}"/eclipse_support/${f} \
-					/usr/$(get_libdir)/eclipse-${ev}/features/ || die
-			done
-			for f in cdt${cv}/eclipse/plugins/*; do
-				dodir /usr/$(get_libdir)/eclipse-${ev}/plugins
-				dosym "${INTEL_SDP_EDIR}"/eclipse_support/${f} \
-					/usr/$(get_libdir)/eclipse-${ev}/plugins/ || die
-			done
-		fi
-	done
-	popd > /dev/null
-}
-
 # @ ECLASS-FUNCTION: intel-sdp_src_install
 # @DESCRIPTION:
 # Install everything
@@ -281,160 +439,6 @@ intel-sdp_src_install() {
 	keepdir "${INTEL_SDP_EDIR}"/licenses
 }
 
-# @ECLASS-FUNCTION: big-warning
-# @INTERNAL
-# warn user that we really require a license
-
-big-warning() {
-	case ${1} in
-		test-failed )
-			echo
-			ewarn "Function test failed. Most probably due to an invalid license."
-			ewarn "This means you already tried to bypass the license check once."
-			;;
-	esac
-
-	echo ""
-	ewarn "Make sure you have recieved the an Intel license."
-	ewarn "To receive a non-commercial license, you need to register at:"
-	ewarn "http://software.intel.com/en-us/articles/non-commercial-software-development/"
-	ewarn "Install the license file into ${INTEL_SDP_EDIR}/licenses/"
-
-	case ${1} in
-		pre-check )
-			ewarn "before proceeding with installation of ${P}"
-			echo ""
-			;;
-		* )
-			echo ""
-			;;
-	esac
-}
-
-# @ECLASS-FUNCTION: _version_test
-# @INTERNAL
-# Testing for valid license by asking for version information of the compiler
-_version-test() {
-	local _comp _comp_full _arch _file _warn
-	case ${PN} in
-		ifc )
-			_comp=ifort
-			;;
-		icc )
-			_comp=icc
-			;;
-		*)
-			die "${PN} is not supported for testing"
-			;;
-	esac
-
-	for _arch in ${INTEL_ARCH}; do
-		case ${EBUILD_PHASE} in
-			install )
-				_comp_full="${ED}/${INTEL_SDP_DIR}/bin/${_arch}/${_comp}"
-				;;
-			postinst )
-				_comp_full="${INTEL_SDP_EDIR}/bin/${_arch}/${_comp}"
-				;;
-			* )
-				ewarn "Compile test not supported in ${EBUILD_PHASE}"
-				continue
-				;;
-		esac
-
-		debug-print "LD_LIBRARY_PATH=\"${INTEL_SDP_EDIR}/bin/${_arch}/\" \"${_comp_full}\" -V"
-
-		LD_LIBRARY_PATH="${INTEL_SDP_EDIR}/bin/${_arch}/" "${_comp_full}" -V &>/dev/null
-			[[ $? -ne 0 ]] && _warn=yes
-	done
-	[[ "${_warn}" == "yes" ]] && big-warning test-failed
-}
-
-# @ECLASS-FUNCTION: _compile-test
-# @INTERNAL
-# Testing for valid license with small compile test
-_compile-test() {
-	local _comp _comp_full _arch _file _warn
-	case ${1} in
-		fortran )
-			_file="${T}/${1}.f"
-			cat > "${_file}" <<- EOF
-			       end
-			EOF
-			_comp=ifort
-			;;
-		c )
-			_file="${T}/${1}.c"
-			cat > "${_file}" <<- EOF
-			main() {
-				;
-			}
-			EOF
-			_comp=icc
-			;;
-		*)
-			die "This ${1} is not supported for testing"
-			;;
-	esac
-
-	for _arch in ${INTEL_ARCH}; do
-		case ${EBUILD_PHASE} in
-			install )
-				_comp_full="${ED}/${INTEL_SDP_DIR}/bin/${_arch}/${_comp}"
-				;;
-			postinst )
-				_comp_full="${INTEL_SDP_EDIR}/bin/${_arch}/${_comp}"
-				;;
-			* )
-				ewarn "Compile test not supported in ${EBUILD_PHASE}"
-				continue
-				;;
-		esac
-
-#		debug-print "LD_LIBRARY_PATH=\"${INTEL_SDP_EDIR}/bin/${_arch}/\" \"${_comp_full}\" -c \"${_file}"
-
-#		LD_LIBRARY_PATH="${INTEL_SDP_EDIR}/bin/${_arch}/" "${_comp_full}" -c "${_file}" &>/dev/null
-
-		debug-print "LD_LIBRARY_PATH=\"${INTEL_SDP_EDIR}/bin/${_arch}/\" \"${_comp_full}\" -V"
-
-		LD_LIBRARY_PATH="${INTEL_SDP_EDIR}/bin/${_arch}/" "${_comp_full}" -V &>/dev/null
-			[[ $? -ne 0 ]] && _warn=yes
-	done
-	[[ "${_warn}" == "yes" ]] && big-warning test-failed
-}
-
-# @ECLASS-FUNCTION: _compile-fortran
-# @INTERNAL
-# Run fortran compile test
-_compile-fortran() { _compile-test fortran; }
-
-# @ECLASS-FUNCTION: _compile-c
-# @INTERNAL
-# Run c compile test
-_compile-c() { _compile-test c; }
-
-# @ECLASS-FUNCTION: run-test
-# @INTERNAL
-# Test if installed compiler is working
-run-test() {
-	case ${PN} in
-		ifc )
-			debug-print "Testing ifort"
-			_compile-fortran ;;
-		icc )
-			debug-print "Testing icc"
-			_compile-c ;;
-		* )
-			debug-print "No test available for ${PN}"
-			;;
-	esac
-}
-
-# @ECLASS-VARIABLE: INTEL_SDP_DB
-# @DESCRIPTION:
-# Full path to intel registry db
-INTEL_SDP_DB="${EROOT%/}"/opt/intel/intel-sdp-products.db
-
 # @ECLASS-FUNCTION
 # @DESCRIPTION:
 # Add things to intel database