summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDror Levin <spatz@gentoo.org>2009-12-22 19:53:10 +0000
committerDror Levin <spatz@gentoo.org>2009-12-22 19:53:10 +0000
commitd093282ee85a6445c1080c84bfa775f526609f05 (patch)
tree36a5c3048a42cb286ed40b08e51077134adb833c /app-emulation/spim
parentVersion bump. (diff)
downloadgentoo-2-d093282ee85a6445c1080c84bfa775f526609f05.tar.gz
gentoo-2-d093282ee85a6445c1080c84bfa775f526609f05.tar.bz2
gentoo-2-d093282ee85a6445c1080c84bfa775f526609f05.zip
Version bump and ebuild overhaul. Respect CC, CFLAGS and LDFLAGS. Fix bugs 240005, 243588, 246447.
(Portage version: 2.2_rc60/cvs/Linux x86_64)
Diffstat (limited to 'app-emulation/spim')
-rw-r--r--app-emulation/spim/ChangeLog9
-rw-r--r--app-emulation/spim/files/spim-7.5-respect_env.patch178
-rw-r--r--app-emulation/spim/spim-7.5.ebuild81
3 files changed, 267 insertions, 1 deletions
diff --git a/app-emulation/spim/ChangeLog b/app-emulation/spim/ChangeLog
index 182c30bb3f8b..4dd76e821485 100644
--- a/app-emulation/spim/ChangeLog
+++ b/app-emulation/spim/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for app-emulation/spim
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-emulation/spim/ChangeLog,v 1.48 2009/09/12 03:50:48 vostorga Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/spim/ChangeLog,v 1.49 2009/12/22 19:53:09 spatz Exp $
+
+*spim-7.5 (22 Dec 2009)
+
+ 22 Dec 2009; Dror Levin <spatz@gentoo.org> +spim-7.5.ebuild,
+ +files/spim-7.5-respect_env.patch:
+ Version bump and ebuild overhaul. Respect CC, CFLAGS and LDFLAGS. Fix bugs
+ 240005, 243588, 246447.
12 Sep 2009; Víctor Ostorga <vostorga@gentoo.org>
-files/spim-7.2.1-font.patch:
diff --git a/app-emulation/spim/files/spim-7.5-respect_env.patch b/app-emulation/spim/files/spim-7.5-respect_env.patch
new file mode 100644
index 000000000000..1f1e6633dc5c
--- /dev/null
+++ b/app-emulation/spim/files/spim-7.5-respect_env.patch
@@ -0,0 +1,178 @@
+diff -ur spim-7.5-orig/spim/Makefile spim-7.5/spim/Makefile
+--- spim-7.5-orig/spim/Makefile 2009-08-15 06:16:36.000000000 +0300
++++ spim-7.5/spim/Makefile 2009-12-22 21:35:38.679967575 +0200
+@@ -54,13 +54,13 @@
+
+
+ # Full path for the directory that will hold the executable files:
+-BIN_DIR = /usr/bin
++BIN_DIR = $(DESTDIR)/usr/bin
+
+ # Full path for the directory that will hold the exception handler:
+-EXCEPTION_DIR = /usr/lib/spim
++EXCEPTION_DIR = $(DESTDIR)/var/lib/spim
+
+ # Full path for the directory that will hold the man files:
+-MAN_DIR = /usr/share/man/en
++MAN_DIR = $(DESTDIR)/usr/share/man
+
+
+ # If you have flex, use it instead of lex. If you use flex, define this
+@@ -92,11 +92,9 @@
+
+ DEFINES = $(ENDIAN) $(MEM_SIZES) -DDEFAULT_EXCEPTION_HANDLER="\"$(EXCEPTION_DIR)/exceptions.s\"" -DSPIM_VERSION="\"`cat ../VERSION`\""
+
+-CC = gcc
+-CFLAGS = -I. -I$(CPU_DIR) $(DEFINES) -g -Wall
++CFLAGS += -I. -I$(CPU_DIR) $(DEFINES) -Wall
+ YFLAGS = -d --file-prefix=y
+ YCFLAGS =
+-LDFLAGS = -lm
+ CSH = bash
+
+ # lex.yy.c is usually compiled with -O to speed it up.
+@@ -110,10 +108,10 @@
+
+
+ spim: force
+- make -f Makefile spim2
++ $(MAKE) -f Makefile spim2
+
+ spim2: $(OBJS) spim.o
+- $(CC) -g $(OBJS) spim.o $(LDFLAGS) -o spim -lm
++ $(CC) $(OBJS) spim.o $(LDFLAGS) -o spim -lm
+
+
+ force: configuration
+@@ -131,19 +129,19 @@
+ @echo
+ @echo "Testing tt.bare.s:"
+ $(CSH) -c "./spim -delayed_branches -delayed_loads -noexception -file $(TEST_DIR)/tt.bare.s >& test.out"
+- @tail -2 test.out
++ @tail -n2 test.out
+ @echo
+
+ @echo
+ @echo "Testing tt.core.s:"
+ $(CSH) -c "./spim -ef $(CPU_DIR)/exceptions.s -file $(TEST_DIR)/tt.core.s < $(TEST_DIR)/tt.in >& test.out"
+- @tail -2 test.out
++ @tail -n2 test.out
+ @echo
+
+ @echo
+ @echo "Testing tt.endian.s:"
+ $(CSH) -c "./spim -ef $(CPU_DIR)/exceptions.s -file $(TEST_DIR)/tt.endian.s >& test.out"
+- @tail -2 test.out
++ @tail -n2 test.out
+ @echo
+ @echo
+
+@@ -154,13 +152,13 @@
+ @echo
+ @echo "Testing tt.alu.bare.s:"
+ $(CSH) -c "./spim -bare -noexception -file $(TEST_DIR)/tt.alu.bare.s >& test.out"
+- @tail -2 test.out
++ @tail -n2 test.out
+ @echo
+
+ @echo
+ @echo "Testing tt.fpt.bare.s:"
+ $(CSH) -c "./spim -bare -noexception -file $(TEST_DIR)/tt.fpu.bare.s >& test.out"
+- @tail -2 test.out
++ @tail -n2 test.out
+ @echo
+ @echo
+
+@@ -178,7 +176,6 @@
+ install -D -m 0444 $(CPU_DIR)/exceptions.s $(EXCEPTION_DIR)/exceptions.s
+
+ install-man:
+- install -D -m 0444 $(DOC_DIR)/spim.man $(MAN_DIR)
+
+ very-clean: clean
+ rm -f configuration
+diff -ur spim-7.5-orig/xspim/Makefile spim-7.5/xspim/Makefile
+--- spim-7.5-orig/xspim/Makefile 2009-08-15 06:16:37.000000000 +0300
++++ spim-7.5/xspim/Makefile 2009-12-22 21:36:52.583871429 +0200
+@@ -175,8 +175,7 @@
+ # from top Makefile
+ BOOTSTRAPCFLAGS =
+
+- CC = gcc -m32
+- AS = gcc -m32 -c -x assembler
++ AS = $(CC) -m32 -c -x assembler
+
+ .SUFFIXES: .cc
+
+@@ -201,12 +200,12 @@
+
+ CPP = cpp $(STD_CPP_DEFINES)
+ RAWCPP = cpp -undef $(STD_CPP_OPTIONS)
+- PREPROCESSCMD = gcc -m32 -E $(STD_CPP_DEFINES)
++ PREPROCESSCMD = $(CC) -m32 -E $(STD_CPP_DEFINES)
+
+ INSTALL = install
+ INSTALLFLAGS = -c
+
+- LD = gcc -m32 -nostdlib
++ LD = $(CC) -m32 -nostdlib
+
+ LEX = flex -l
+ M4 = m4
+@@ -220,7 +219,6 @@
+ LINTLIBFLAG = -C
+ LINTOPTS = -axz
+ LN = ln -s
+- MAKE = make
+ MV = mv -f
+ CP = cp
+
+@@ -270,14 +268,14 @@
+ COL = col
+ COLFLAGS = -b
+
+- MODCC = gcc -m32
++ MODCC = $(CC) -m32
+
+ MODCPP = cpp
+ MODCFLAGS = $(CFLAGS)
+- MODAS = gcc -m32 -c -x assembler
++ MODAS = $(CC) -m32 -c -x assembler
+ MODASFLAGS =
+
+- MODLD = gcc -m32 -nostdlib
++ MODLD = $(CC) -m32 -nostdlib
+
+ MODLDFLAGS =
+ MODLDCOMBINEFLAGS = -r
+@@ -330,7 +328,7 @@
+
+ ALLINCLUDES = $(INCLUDES) $(EXTRA_INCLUDES) $(TOP_INCLUDES) $(INSTALLED_INCLUDES) $(STD_INCLUDES)
+ ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(PROTO_DEFINES) $(THREADS_DEFINES) $(MODULE_DEFINES) $(DEFINES) $(EXTRA_DEFINES)
+- CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(THREADS_CFLAGS) $(MODULE_CFLAGS) $(ALLDEFINES)
++ CFLAGS += $(MODULE_CFLAGS) $(ALLDEFINES)
+ LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES) $(DEPEND_DEFINES)
+ LDPRELIB = $(INSTALLED_LIBS)
+ LDPOSTLIB =
+@@ -339,7 +337,7 @@
+
+ LDLIBS = $(LDPOSTLIBS) $(THREADS_LIBS) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
+
+- CCLINK = $(CC)
++ CCLINK = $(CC) $(LDFLAGS)
+
+ CXXLINK = $(CXX)
+
+@@ -1079,10 +1077,10 @@
+ BIN_DIR = /usr/bin
+
+ # Full path for the directory that will hold the exception handler:
+-EXCEPTION_DIR = /usr/lib/spim
++EXCEPTION_DIR = /var/lib/spim
+
+ # Full path for the directory that will hold the man files:
+-MAN_DIR = /usr/share/man/en
++MAN_DIR = /usr/share/man
+
+ # If you have flex, use it instead of lex. If you use flex, define this
+ # variable and set LEXFLAGS.
diff --git a/app-emulation/spim/spim-7.5.ebuild b/app-emulation/spim/spim-7.5.ebuild
new file mode 100644
index 000000000000..273b1303d168
--- /dev/null
+++ b/app-emulation/spim/spim-7.5.ebuild
@@ -0,0 +1,81 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/spim/spim-7.5.ebuild,v 1.1 2009/12/22 19:53:09 spatz Exp $
+
+EAPI="2"
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="MIPS Simulator"
+HOMEPAGE="http://www.cs.wisc.edu/~larus/spim.html"
+SRC_URI="http://www.cs.wisc.edu/~larus/SPIM/${P}.tar.gz"
+
+LICENSE="as-is"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~sparc ~x86"
+IUSE="X"
+
+RDEPEND="X? ( x11-libs/libXaw
+ x11-libs/libXp )"
+DEPEND="${RDEPEND}
+ X? ( x11-misc/imake
+ x11-proto/xproto )
+ >=sys-apps/sed-4
+ sys-devel/bison"
+
+src_prepare() {
+ # fix bugs 240005 and 243588
+ epatch "${FILESDIR}/${P}-respect_env.patch"
+ tc-export CC
+
+ # Fix documentation files
+ cd "${S}/Documentation"
+ mv spim.man spim.1
+ mv xspim.man xspim.1
+}
+
+src_configure() {
+ cd "${S}/spim"
+ ./Configure || die "Configure Failed!"
+
+ if use X; then
+ cd "${S}/xspim"
+ ./Configure || die "Configure Failed!"
+ fi
+}
+
+src_compile() {
+ cd "${S}/spim"
+ emake || die
+
+ if use X; then
+ cd "${S}/xspim"
+ emake -j1 xspim || die
+ fi
+}
+
+src_install() {
+ dodir /var/lib/spim || die
+ dodoc README VERSION ChangeLog || die
+
+ cd "${S}/spim"
+ emake DESTDIR="${D}" install || die "Unable to install spim"
+
+ if use X; then
+ cd "${S}/xspim"
+ emake DESTDIR="${D}" install || die "Unable to install xspim"
+
+ doman "${S}/Documentation/xspim.1"
+ fi
+
+ cd "${S}/Documentation"
+ doman spim.1 || die
+
+ dohtml SPIM.html || die
+ dodoc BLURB || die
+}
+
+src_test() {
+ cd "${S}/spim"
+ make test || die "Failed to pass tests!"
+}