--- icc-11.1.056.ebuild.old 2009-10-04 01:06:33.000000000 +0200 +++ icc-11.1.056.ebuild 2009-10-04 00:39:06.000000000 +0200 @@ -25,7 +25,7 @@ LICENSE="Intel-SDP" SLOT="0" -IUSE="" +IUSE="eclipse" KEYWORDS="~amd64" RESTRICT="mirror strip binchecks" @@ -38,12 +38,15 @@ DEPEND="app-arch/rpm" RDEPEND="~virtual/libstdc++-3.3 - amd64? ( app-emulation/emul-linux-x86-compat )" + amd64? ( app-emulation/emul-linux-x86-compat ) + eclipse? ( >=dev-util/eclipse-sdk-3.4 )" S="${WORKDIR}/${PACKAGEID}" src_prepare() { use amd64 || rm -f rpm/*x86_64.rpm + use eclipse || rm -f rpm/*cdt*.rpm + # debugger installed with dev-lang/idb rm -f rpm/intel*idb*.rpm # performance primitives installed with sci-libs/ipp @@ -91,6 +94,16 @@ doenvd ${ENV_FILE} || die keepdir /opt/intel/licenses + + if use eclipse; then + if has_version 'dev-util/eclipse-sdk:3.4'; then + link_eclipse_plugins "3.4" "5.0" || die 'Unable to create links to eclipse v3.4 and cdt 5.0' + fi + + if has_version 'dev-util/eclipse-sdk:3.5'; then + link_eclipse_plugins "3.5" "6.0" || die 'Unable to create links to eclipse v3.5 and cdt 6.0' + fi + fi } pkg_postinst() { @@ -116,3 +129,25 @@ ewarn "You will have to update these lines every time you upgrade GCC for icpc to work." ewarn } + +link_eclipse_plugins() { + ECLIPSE_V="$1" + CDT_V="$2" + + einfo "Linking eclipse (v${ECLIPSE_V}) plugin cdt (v${CDT_V})" + + dodir "/usr/lib/eclipse-${ECLIPSE_V}/plugins/" + dodir "/usr/lib/eclipse-${ECLIPSE_V}/features/" + + for cdt_file in "${D}/${INSTALL_DIR}/eclipse_support/cdt${CDT_V}/eclipse/plugins"/*; do + cdt_file="`echo ${cdt_file} | sed \"s:^${D}/:${ROOT}:\"`" + dosym "${cdt_file}" "${ROOT}usr/lib/eclipse-${ECLIPSE_V}/plugins/" + done + + for cdt_file in "${D}/${INSTALL_DIR}/eclipse_support/cdt${CDT_V}/eclipse/features"/*; do + cdt_file="`echo ${cdt_file} | sed \"s:^${D}/:${ROOT}:\"`" + dosym "${cdt_file}" "${ROOT}usr/lib/eclipse-${ECLIPSE_V}/features/" + done + + eend $? +}