# Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils gnat DESCRIPTION="GPS, the GNAT Programming System" HOMEPAGE="http://libre.act-europe.fr/gps" SRC_URI="http://libre.act-europe.fr/gps/gps-${PV}-gpl-src.tgz" KEYWORDS="~x86" LICENSE="GPL-2" SLOT="0" IUSE="python pygtk xml" DEPEND="!dev-ada/gps-bin virtual/gnat >=dev-ada/gtkada-2.10.0 sys-libs/db xml? ( >=dev-ada/xmlada-2.2.0 ) python? ( dev-lang/python ) pygtk? ( dev-python/pygtk ) " S="${WORKDIR}/gps-${PV}" # TODO # - make gnat properly use -jn # - fix CFLAGS in files # - check wether we really need gps and can not just use gps_exe # - enable xmlada as soon it's ready src_unpack() { unpack ${A} epatch "${FILESDIR}/${P}-gtkada.patch" cd ${S} #einfo "Patching build files..." # Use our flags, not theirs: #find . -iname 'Makefile*' -exec sed -i \ # -e "s|-g -O2|CFLAGSfixme|g" \ # -e "s|-O2 -g|CFLAGSfixme|g" \ # -e "s|-O2|CFLAGSfixme|g" \ # -e "s|^CFLAGS=$|CFLAGS = CFLAGSfixme|g" \ # {} \; # Need to replace "-g" too, but "s|-g|CFLAGSfixme|" breaks the -gnatX options. # #find . -iname 'Makefile*' -exec sed -i "s|CFLAGSfixme|${CFLAGS}|g" {} \; # Fix project files to use a consistent build-naming scheme, # so we can catch everything with the same environment variable # setting: find . -iname '*.gpr' -exec sed -i \ -e "s|PRODUCTION|Production|g" \ -e "s|Release|Production|g" \ -e "s|BUILD|Build|g" \ {} \; # Fix an install-time sandbox violation: sed -i -e "s|INSTALL_ROOT =|INSTALL_ROOT = ${D}|" \ kernel/src_info/sn/snsrc/tcl8.1/unix/Makefile.in } src_compile() { # Configure: #use xml && export ADA_PROJECT_PATH="/usr/lib/ada/`get_active_profile`/xmlada/lib/gnat" econf $(use_enable python) $(use_with python python=/usr ) || die "econf failed!" # Compile: A="Production" Build="Production" emake || die "make failed" } src_install () { # Install in the sandbox: emake prefix=${D}usr install || die "install failed" # Fix the locations: mv ${D}usr/share/doc/gps ${D}usr/share/doc/${PF} mv ${D}usr/share/examples ${D}usr/share/doc/${PF} # Install the distribution documents: dodoc COPYING INSTALL README # remove libdb, not needed rm ${D}usr/lib/libdb.a # Set up environment variables: dodir /etc/env.d echo "GPS_DOC_PATH=/usr/share/doc/${PF}/html" > ${D}etc/env.d/55gps # I don't think we need this anymore: # Point to the project files provided by GtkAda: #echo "ADA_PROJECTS_PATH=/usr/projects" >> ${D}etc/env.d/55gps } pkg_postinst() { einfo "GPS is now installed." einfo "Please update your environment variables with" einfo " env-update && source /etc/profile" einfo "before running GPS." einfo "Invoke GPS with the 'gps' command." einfo "Documentation can be found in /usr/share/doc/${PF}/" }