# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $ inherit eutils DESCRIPTION="MIPS Simulator" HOMEPAGE="http://www.cs.wisc.edu/~larus/spim.html" SRC_URI="mirror://gentoo/${PF}.tar.gz" LICENSE="as-is" SLOT="0" KEYWORDS="~x86 -amd64 ~ppc ~ppc-macos" IUSE="X" RDEPEND="X? ( virtual/x11 )" DEPEND="${RDEPEND} >=sys-apps/sed-4 X? ( x11-base/xorg-x11 )" src_unpack() { unpack ${A} cd ${S} # The font issue is still with us (Bug #73510) cd ${S}/xspim epatch ${FILESDIR}/${PF}-font.patch # Fix Documentation for install cd ${S}/Documentation mv spim.man spim.1 mv xspim.man xspim.1 } src_compile() { cd ${S}/spim ./Configure || die "Configure Failed!" sed -i \ -e 's:@make:@$(MAKE):' \ -e 's:\(BIN_DIR = \).*$:\1\$(DESTDIR)/usr/bin:' \ -e 's:\(MAN_DIR = \).*$:\1\$(DESTDIR)/usr/share/man:' \ -e 's:\(EXCEPTION_DIR = \).*$:\1$(DESTDIR)/var/lib/spim:' \ -e 's:\(^\W*install.*\) exceptions.s \(.*$\):\1 \$(CPU_DIR)/exceptions.s \2:' \ -e "s:^\W*install.* spim.man .*$::" \ -e "s:tail -2:tail -n2:" \ Makefile emake if use X ; then cd ${S}/xspim ./Configure || die "Configure Failed!" xmkmf sed -i \ -e 's:@make:@$(MAKE):' \ -e "s:\(BIN_DIR = \).*$:\1/usr/bin:" \ -e "s:\(MAN_DIR = \).*$:\1/usr/share/man:" \ -e "s:\(EXCEPTION_PATH = \).*$:\1/var/lib/spim/exceptions.s:" \ Makefile emake xspim fi } src_test() { cd ${S}/spim make test || die "Failed to pass tests!" } src_install() { dodir /usr/bin dodir /usr/share/man dodir /var/lib/spim cd ${S}/spim make DESTDIR=${D} install || die "Unable to install spim" if use X ; then cd ${S}/xspim make DESTDIR=${D} install || die "Unable to install xspim" fi cd ${S}/Documentation doman spim.1 use X && doman xspim.1 dodoc BLURB cd ${S} dodoc README VERSION ChangeLog }