# Copyright 1999-2003 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 # $Header: $ # # Tavis Ormandy 2003 # DESCRIPTION="Compaq's enhanced C compiler for the ALPHA platform" HOMEPAGE="http://www.support.compaq.com/alpha-tools" #SRC_URI="ftp://ftp.compaq.com/pub/products/C-Cxx/linux/compaq_c_beta/ccc-6.5.6.002-1.alpha.rpm" LICENSE="CCC" SLOT="0" # NOTE: ALPHA Only! KEYWORDS="-* ~alpha" IUSE="doc" DEPEND="virtual/glibc sys-devel/gcc-config app-arch/rpm2targz dev-libs/libots dev-libs/libcpml" S=${WORKDIR}/${P} RELEASE="6.5.6.002-1" src_unpack() { # convert rpm into tar archive ccc_rpm="ccc-${RELEASE}.alpha.rpm" if [ ! -f ${DISTDIR}/${ccc_rpm} ]; then eerror "" eerror "Please download ${ccc_rpm} from" eerror "${HOMEPAGE}, and place it in" eerror "${DISTDIR}" eerror "" eerror "Then resart this emerge." eerror "" die "CCC Distribution (${ccc_rpm}) not found" else ebegin "Converting RPM Package to Tar Archive..." rpm2targz ${DISTDIR}/${ccc_rpm} || { eend ${?} die "Failed to Convert ${ccc_rpm}" } eend ${?} ebegin "Unpacking CCC Distribution..." tar -C ${WORKDIR} -zxf ${WORKDIR}/${ccc_rpm%*.rpm}.tar.gz || { eend ${?} die "Failed to Extract ${ccc_rpm%*.rpm}.tar.gz" } eend ${?} einfo "CCC Distribution Successfully Prepared for Portage." rm -f ${WORKDIR}/${ccc_rpm%*.rpm}.tar.gz fi } src_compile() { # remove unwanted documentation if [ ! "`use doc`" ]; then ebegin "Removing Unwanted Documentation (USE=\"-doc\" ?)..." rm -rf ${WORKDIR}/usr/doc || { eend 1 ewarn "Documentation Removal Failed, Continuing..." } eend ${?} fi # fix up lib paths - bug #15719, comment 6 ebegin "Fixing symlinks..." gcc_libs_path="`gcc-config --get-lib-path`" if [ ! -d ${gcc_libs_path} ]; then eend 1 eerror "gcc-config Returned an Invalid Library Path" die "${gcc_libs_path} is not a Directory" else ln -fs ${gcc_libs_path}/crtbegin.o \ ${WORKDIR}/usr/lib/compaq/ccc-${RELEASE}/alpha-linux/bin/crtbegin.o ln -fs ${gcc_libs_path}/crtend.o \ ${WORKDIR}/usr/lib/compaq/ccc-${RELEASE}/alpha-linux/bin/crtend.o eend 0 fi # add gcc-lib path to ccc's search path # check man ccc for file format info. einfo "Configuring CCC to observe GCC Library Path..." echo -n "-L${gcc_libs_path}" > ${WORKDIR}/usr/lib/compaq/ccc-${RELEASE}/alpha-linux/bin/comp.config einfo "Configuring CCC to observe Common Include Paths..." echo " -SysIncDir /usr/lib/compaq/ccc-${RELEASE}/alpha-linux/include -SysIncDir /usr/include/linux" >> ${WORKDIR}/usr/lib/compaq/ccc-${RELEASE}/alpha-linux/bin/comp.config einfo "Additional Paths can be set by users using \$DEC_CC variable." # man pages are in the wrong place einfo "Reorganising man structure..." rm -rf ${WORKDIR}/usr/man mkdir ${WORKDIR}/usr/share mv ${WORKDIR}/usr/lib/compaq/ccc-${RELEASE}/alpha-linux/man ${WORKDIR}/usr/share/man if [ "`use doc`" ]; then einfo "Reorganising Documentation structure..." mv ${WORKDIR}/usr/doc ${WORKDIR}/usr/share/ fi } src_install() { # move files over mv ${WORKDIR}/usr ${D} || die "CCC Installation Failed" # prep manpages prepman ${D}/usr/share/man/man1/ccc.1 prepman ${D}/usr/share/man/man8/protect_headers_setup.8 prepalldocs } pkg_config () { # some information for users einfo ewarn "Ignore any errors about Compaq Testing..." einfo einfo "Attempting configuration of CCC..." echo echo '<------- Begin CCC configuration output ------->' # NOTE: _must_ hide distcc, ccache, etc during this step PATH=/bin:/usr/bin:/sbin:/usr/sbin \ /usr/lib/compaq/ccc-${RELEASE}/alpha-linux/bin/create-comp-config.sh \ ccc-${RELEASE} ${gcc_libs_path} echo '<------- End CCC configuration output ------->' echo einfo einfo "CCC has been configured, you can now use it as usual." einfo } pkg_postinst () { einfo einfo "CCC has been merged successfully, the EULA" einfo "is available in " einfo einfo "/usr/lib/compaq/ccc-${RELEASE}/alpha-linux/bin/LICENSE.txt" if [ "`use doc`" ]; then einfo einfo "you can also view the compiler documentation" einfo "in /usr/share/doc/ccc-${RELEASE%*-1}" fi einfo ewarn ewarn "you _MUST_ now run:" ewarn "ebuild /var/db/pkg/dev-lang/${PF}/${PF}.ebuild config" ewarn "to complete the installation" ewarn einfo "Hopefullly soon we will get a ccc USE flag" einfo "on packages (or at least individual " einfo "components) that can be successfully built" einfo "using this compiler, until then you will " einfo "just have to experiment :) " einfo einfo "Please report successes/failures with ccc " einfo "to http://bugs.gentoo.org so that the USE " einfo "flags can be updated. " einfo }