public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Justin Lecher" <jlec@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/sci:master commit in: eclass/
Date: Tue, 27 Nov 2012 19:33:52 +0000 (UTC)	[thread overview]
Message-ID: <1354044116.85f8fc569d35d6691cec47ad5d594629ea9457f2.jlec@gentoo> (raw)

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


             reply	other threads:[~2012-11-27 19:34 UTC|newest]

Thread overview: 169+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-27 19:33 Justin Lecher [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-01-30 15:24 [gentoo-commits] proj/sci:master commit in: eclass/ Andrew Ammerlaan
2021-01-30 10:04 Andrew Ammerlaan
2021-01-19 17:02 Andrew Ammerlaan
2020-12-19 21:38 Aisha Tammy
2020-12-19 21:36 Aisha Tammy
2020-10-01  1:43 Aisha Tammy
2018-10-28  6:21 Justin Lecher
2018-08-31  3:04 Matthias Maier
2018-04-03 16:44 Matthias Maier
2018-04-03 16:44 Matthias Maier
2018-04-02 11:20 Justin Lecher
2018-01-27 20:29 [gentoo-commits] proj/sci:jlec/scilab " Justin Lecher
2018-01-27 20:28 ` [gentoo-commits] proj/sci:master " Justin Lecher
2017-12-25 20:33 Justin Lecher
2017-08-29 13:52 Benda XU
2017-08-25  6:10 Benda XU
2017-08-23  3:15 Benda XU
2017-06-06  4:12 Benda XU
2017-04-30  7:47 Justin Lecher
2017-03-07  7:45 Marius Brehler
2017-02-24 14:14 Marius Brehler
2017-02-24 13:59 Marius Brehler
2016-12-10 10:51 Justin Lecher
2016-08-29 20:45 Justin Bronder
2016-07-31 21:13 Justin Lecher
2016-02-22 13:25 Justin Lecher
2016-02-19 10:12 Justin Lecher
2016-02-15  8:19 Justin Lecher
2016-02-15  8:19 Justin Lecher
2016-02-10 18:27 Justin Lecher
2016-02-10 18:27 Justin Lecher
2016-02-10 18:27 Justin Lecher
2016-02-10 18:27 Justin Lecher
2015-12-27 16:19 Justin Lecher
2015-12-27 16:19 Justin Lecher
2015-12-27 16:19 Justin Lecher
2015-12-14  7:53 Justin Lecher
2015-12-04  7:01 Justin Lecher
2015-12-03 10:03 Justin Lecher
2015-11-29 10:17 Justin Lecher
2015-11-29 10:17 Justin Lecher
2015-11-29 10:17 Justin Lecher
2015-11-29 10:17 Justin Lecher
2015-11-29 10:17 Justin Lecher
2015-11-28 18:59 Justin Lecher
2015-08-20 23:29 Christoph Junghans
2015-05-24  8:14 Justin Lecher
2015-03-28 18:29 Justin Lecher
2015-03-28 16:41 Justin Lecher
2015-02-21 10:01 Justin Lecher
2015-02-18  9:06 Justin Lecher
2015-02-05  8:01 Justin Lecher
2015-01-26  7:19 Justin Lecher
2015-01-10 13:35 Justin Lecher
2014-12-02 15:36 Justin Lecher
2014-12-02 15:36 Justin Lecher
2014-12-02 15:36 Justin Lecher
2014-09-15 12:01 Justin Lecher
2014-05-26  7:07 Justin Lecher
2014-05-23  9:14 Justin Lecher
2014-01-22 10:11 Reinis Danne
2014-01-22 10:09 Reinis Danne
2014-01-22 10:09 Reinis Danne
2014-01-22 10:09 Reinis Danne
2014-01-22 10:09 Reinis Danne
2014-01-22 10:09 Reinis Danne
2014-01-22 10:09 Reinis Danne
2014-01-22 10:09 Reinis Danne
2014-01-22 10:09 Reinis Danne
2014-01-22 10:09 Reinis Danne
2014-01-22 10:09 Reinis Danne
2014-01-22 10:09 Reinis Danne
2014-01-22 10:09 Reinis Danne
2014-01-22 10:09 Reinis Danne
2014-01-21 19:38 Reinis Danne
2014-01-04 18:11 Justin Lecher
2013-11-26  5:28 Sebastien Fabbro
2013-11-26  5:28 Sebastien Fabbro
2013-07-24  9:17 Justin Lecher
2013-07-24  9:17 Justin Lecher
2013-07-22 13:14 Justin Lecher
2013-07-19 18:27 Alexey Shvetsov
2013-07-09  1:17 Justin Bronder
2013-07-02  2:15 Justin Bronder
2013-07-02  0:09 Justin Bronder
2013-02-14 16:32 Denis Dupeyron
2013-02-14 16:32 Denis Dupeyron
2013-01-24 19:47 Sebastien Fabbro
2013-01-15 15:27 Justin Lecher
2013-01-11 20:45 Justin Bronder
2012-11-30  3:31 Christoph Junghans
2012-11-29 21:05 Justin Lecher
2012-11-29 21:05 Justin Lecher
2012-11-29  7:03 Justin Lecher
2012-11-29  7:03 Justin Lecher
2012-11-29  7:03 Justin Lecher
2012-11-29  7:03 Justin Lecher
2012-11-28  7:22 Justin Lecher
2012-11-28  5:29 Christoph Junghans
2012-11-27 19:33 Justin Lecher
2012-11-27 19:33 Justin Lecher
2012-11-27 19:33 Justin Lecher
2012-11-27 19:33 Justin Lecher
2012-11-27 19:33 Justin Lecher
2012-11-27 19:33 Justin Lecher
2012-11-27 19:33 Justin Lecher
2012-11-27 19:33 Justin Lecher
2012-11-27 19:33 Justin Lecher
2012-11-27 19:33 Justin Lecher
2012-11-26 22:02 Justin Lecher
2012-11-26 22:02 Justin Lecher
2012-11-26 22:02 Justin Lecher
2012-11-26 22:02 Justin Lecher
2012-11-26 22:02 Justin Lecher
2012-11-02 19:54 Justin Lecher
2012-11-02 19:46 Justin Lecher
2012-11-02 19:43 Justin Lecher
2012-10-04 14:39 Christoph Junghans
2012-09-20 12:45 Justin Lecher
2012-08-30  8:38 Justin Lecher
2012-08-09  5:15 Christoph Junghans
2012-07-27 22:10 Sebastien Fabbro
2012-04-27 11:42 Justin Lecher
2012-04-27 11:42 Justin Lecher
2012-02-16 22:35 Sebastien Fabbro
2012-01-31 18:15 Sebastien Fabbro
2011-10-25 17:16 Justin Lecher
2011-10-23 21:53 Justin Lecher
2011-10-23 21:53 Justin Lecher
2011-10-05  7:54 Justin Lecher
2011-08-03 23:55 Andrea Arteaga
2011-07-18  9:09 Andreas Hüttel
2011-07-17 19:55 Andreas Hüttel
2011-07-17 18:26 Andreas Hüttel
2011-07-17 18:02 Andreas Hüttel
2011-07-17 17:53 Andreas Hüttel
2011-07-17 17:03 Andreas Hüttel
2011-07-17 17:03 Andreas Hüttel
2011-06-30 16:57 Alexey Shvetsov
2011-06-30 16:47 Alexey Shvetsov
2011-06-30 16:45 Alexey Shvetsov
2011-06-21 11:54 Justin Lecher
2011-06-20  5:20 Justin Lecher
2011-06-20  5:20 Justin Lecher
2011-06-15 21:30 Justin Lecher
2011-06-15 20:50 Justin Lecher
2011-06-15  6:32 Justin Lecher
2011-06-13 10:27 Justin Lecher
2011-06-13  8:29 Kacper Kowalik
2011-06-13  8:20 Justin Lecher
2011-06-12 15:09 Kacper Kowalik
2011-06-12 14:52 Kacper Kowalik
2011-06-12 14:39 Justin Lecher
2011-06-12 13:41 Justin Lecher
2011-06-12 12:16 Justin Lecher
2011-06-12 11:57 Kacper Kowalik
2011-06-12 11:24 Kacper Kowalik
2011-06-12 10:53 Justin Lecher
2011-05-19  5:56 Justin Lecher
2011-04-04 11:18 Justin Lecher
2011-03-22  6:58 Justin Lecher
2011-03-20 16:28 Justin Lecher
2011-03-15 10:24 Justin Lecher
2011-03-15  7:25 Justin Lecher
2011-03-15  7:16 Justin Lecher
2011-03-14  9:25 Justin Lecher
2011-03-10 19:00 Justin Lecher
2011-03-10 19:00 Justin Lecher
2011-03-10 19:00 Justin Lecher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1354044116.85f8fc569d35d6691cec47ad5d594629ea9457f2.jlec@gentoo \
    --to=jlec@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox