summaryrefslogtreecommitdiff
path: root/app-emulation/spim
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
commit8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch)
tree7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /app-emulation/spim
parent30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff)
gentoo resync : 14.07.2018
Diffstat (limited to 'app-emulation/spim')
-rw-r--r--app-emulation/spim/Manifest5
-rw-r--r--app-emulation/spim/files/spim-8.0-r1-respect_env.patch183
-rw-r--r--app-emulation/spim/files/xspim.svg216
-rw-r--r--app-emulation/spim/metadata.xml13
-rw-r--r--app-emulation/spim/spim-8.0-r3.ebuild80
5 files changed, 497 insertions, 0 deletions
diff --git a/app-emulation/spim/Manifest b/app-emulation/spim/Manifest
new file mode 100644
index 000000000000..b3d6443f80b2
--- /dev/null
+++ b/app-emulation/spim/Manifest
@@ -0,0 +1,5 @@
+AUX spim-8.0-r1-respect_env.patch 5058 BLAKE2B dabd459ef87e3c9db6304703d2067297f4be53af269ab9b1335dc38302c2e828ab6e9b357e45619fbe4dbdb375abb2dd91795e728a25e9772b3bdaf0a7e3e846 SHA512 adc8bb7815f15a0dfbd67e14875d7f5773c3b0153e9f031a957a9b6deeb0cf2dfd1983b835d7446467433c044a1caea0c13ba43ee5e4f77d5096cd62e2c27948
+AUX xspim.svg 8364 BLAKE2B 0a2f13b78c87e821b6d669a750ea1be0003442f75c20c5387954c1e6c11f99f80b9e1a42ea88bc4e894011ff08cb8b40450674ec415d1be18eb63d5e2a9b0188 SHA512 1860705ef2677b5bd84b7cdf4daf3143033050e5ed014e22d63fc3bec48a0a296a9767fa7cbf7ab71f31c5cc712e40be0799a9c43b96c789273de7604d57c0d5
+DIST spim-8.0.tar.gz 355204 BLAKE2B c7da952df552c5e070c601e7c3d251f15988d377e1c9943730f6cf8eee1e3b64ec4a05b56d4bdbc181b811aa349e3b08fccf0b9ccfc3efe2c0e410580e70dd7f SHA512 c4eb66863a931b74d6c6ecd92860d16fd6369c85caecba1e71a1149e73e708502d1070f17a9beb6d0af1368db1ee5a85c040b596866a1236275cdd410a661adf
+EBUILD spim-8.0-r3.ebuild 1549 BLAKE2B eba11163cd0f515042e89a8c34e663eb09fdc82cfff503e9072ca9173b29d64b3b93819f5c38ee3cf03f444b7886361f7ab6361ef47af006079e713d04d630af SHA512 dacf57993cc1ea5dc0969baebf3c61bac34ea18f2c52851711252354ccc78308cab58c4fa8d8f9a8644831947129c3e3630aa3b5e89efba791a1e55a4ba29154
+MISC metadata.xml 465 BLAKE2B a26e388f7a6a0610e0fb4d4c59b0d1a60c3934927f41e0d953dfab8cef1c9fc5da06902263ba29d984db1f0d1d3f636d503b8fe605571f4976e9bbd3e28cf4be SHA512 624df1312b5a85232c892f18eb39a62877c085d79461cf875b46a107eeaf5b99a9062e8f175a62c80565d42b26144ab2227d2f97b2d67fe16e66890e2843fe6c
diff --git a/app-emulation/spim/files/spim-8.0-r1-respect_env.patch b/app-emulation/spim/files/spim-8.0-r1-respect_env.patch
new file mode 100644
index 000000000000..2d2ca0cf0f3d
--- /dev/null
+++ b/app-emulation/spim/files/spim-8.0-r1-respect_env.patch
@@ -0,0 +1,183 @@
+--- a/spim/Makefile 2010-08-01 22:14:53.352906061 +0200
++++ b/spim/Makefile 2010-08-01 22:15:00.994905920 +0200
+@@ -66,13 +66,13 @@
+
+
+ # Full path for the directory that will hold the executable files:
+-BIN_DIR = /usr/local/bin
++BIN_DIR = $(DESTDIR)/usr/bin
+
+ # Full path for the directory that will hold the exception handler:
+-EXCEPTION_DIR = /usr/local/lib/spim
++EXCEPTION_DIR = $(DESTDIR)/var/lib/spim
+
+ # Full path for the directory that will hold the man files:
+-MAN_DIR = /usr/local/man/en
++MAN_DIR = $(DESTDIR)/usr/share/man
+
+
+ # If you have flex, use it instead of lex. If you use flex, define this
+@@ -104,11 +104,10 @@
+
+ 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
++CC ?= gcc
++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.
+@@ -122,10 +121,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
+@@ -143,19 +142,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
+
+@@ -166,13 +165,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
+
+@@ -192,8 +191,6 @@
+ install -m 0444 $(CPU_DIR)/exceptions.s $(EXCEPTION_DIR)/exceptions.s
+
+ install-man:
+- install -d $(MAN_DIR)
+- install -m 0444 $(DOC_DIR)/spim.man $(MAN_DIR)
+
+ very-clean: clean
+ rm -f configuration
+--- a/xspim/Makefile 2010-08-01 22:14:53.351905921 +0200
++++ b/xspim/Makefile 2010-08-01 22:26:08.361917058 +0200
+@@ -169,18 +169,18 @@
+
+ VARDBDIR = $(VARDIR)/lib
+
+- AR = ar clq
++ AR = $(AR) clq
+
+ # Nice try but useless: make will inherit BOOTSTRAPCFLAGS
+ # from top Makefile
+ BOOTSTRAPCFLAGS =
+
+- CC = gcc -m32
+- AS = gcc -m32 -c -x assembler
++ CC ?= gcc -m32
++ AS ?= gcc -m32 -c -x assembler
+
+ .SUFFIXES: .cc
+
+- CXX = c++ -m32
++ CXX ?= c++ -m32
+
+ CXXFILT = c++filt
+
+@@ -199,14 +199,14 @@
+ COMPRESS = compress
+ GZIPCMD = gzip
+
+- CPP = cpp $(STD_CPP_DEFINES)
+- RAWCPP = cpp -undef $(STD_CPP_OPTIONS)
+- PREPROCESSCMD = gcc -m32 -E $(STD_CPP_DEFINES)
++ CPP = $(CPP) $(STD_CPP_DEFINES)
++ RAWCPP = $(CPP) -undef $(STD_CPP_OPTIONS)
++ PREPROCESSCMD = $(CC) -E $(STD_CPP_DEFINES)
+
+ INSTALL = install
+ INSTALLFLAGS = -c
+
+- LD = gcc -m32 -nostdlib
++ LD ?= $(CC) -nostdlib
+
+ LEX = flex -l
+ M4 = m4
+@@ -270,18 +270,18 @@
+ COL = col
+ COLFLAGS = -b
+
+- MODCC = gcc -m32
++ MODCC ?= $(CC)
+
+- MODCPP = cpp
++ MODCPP = $(CPP)
+ MODCFLAGS = $(CFLAGS)
+- MODAS = gcc -m32 -c -x assembler
++ MODAS ?= $(CC) -c -x assembler
+ MODASFLAGS =
+
+- MODLD = gcc -m32 -nostdlib
++ MODLD ?= $(CC) -nostdlib
+
+ MODLDFLAGS =
+ MODLDCOMBINEFLAGS = -r
+- MODAR = ar clq
++ MODAR ?= $(AR) clq
+
+ MODRANLIB = ranlib
+
+@@ -330,7 +330,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 += $(CCOPTIONS) $(THREADS_CFLAGS) $(MODULE_CFLAGS) $(ALLDEFINES)
+ LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES) $(DEPEND_DEFINES)
+ LDPRELIB = $(INSTALLED_LIBS)
+ LDPOSTLIB =
+@@ -339,9 +339,9 @@
+
+ LDLIBS = $(LDPOSTLIBS) $(THREADS_LIBS) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
+
+- CCLINK = $(CC)
++ CCLINK = $(CC) $(LDFLAGS)
+
+- CXXLINK = $(CXX)
++ CXXLINK = $(CXX) $(LDFLAGS)
+
+ LDSTRIPFLAGS = -x
+ LDCOMBINEFLAGS = -r
diff --git a/app-emulation/spim/files/xspim.svg b/app-emulation/spim/files/xspim.svg
new file mode 100644
index 000000000000..4840b752e16a
--- /dev/null
+++ b/app-emulation/spim/files/xspim.svg
@@ -0,0 +1,216 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="48"
+ height="48"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.47pre1 r21720"
+ inkscape:export-filename="/home/maco/src/spim/spim-7.5/debian/16x16.png"
+ inkscape:export-xdpi="30"
+ inkscape:export-ydpi="30"
+ sodipodi:docname="icon.svg"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <defs
+ id="defs4">
+ <linearGradient
+ id="linearGradient5060">
+ <stop
+ style="stop-color:#000000;stop-opacity:1;"
+ offset="0"
+ id="stop5062" />
+ <stop
+ style="stop-color:#000000;stop-opacity:0;"
+ offset="1"
+ id="stop5064" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient3598">
+ <stop
+ style="stop-color:#000000;stop-opacity:1;"
+ offset="0"
+ id="stop3600" />
+ <stop
+ id="stop5056"
+ offset="1"
+ style="stop-color:#000000;stop-opacity:0.49803922;" />
+ <stop
+ style="stop-color:#000000;stop-opacity:0;"
+ offset="1"
+ id="stop3602" />
+ </linearGradient>
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ id="perspective10" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient5060"
+ id="linearGradient5070"
+ x1="52.067394"
+ y1="1029.1332"
+ x2="53.406746"
+ y2="1029.1332"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-5.4933245,-1.255617)" />
+ <filter
+ inkscape:collect="always"
+ id="filter5100"
+ x="-3.8212016"
+ width="8.6424033"
+ y="-0.029297812"
+ height="1.0585956">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="0.54030659"
+ id="feGaussianBlur5102" />
+ </filter>
+ <inkscape:perspective
+ id="perspective5112"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient5060-1"
+ id="linearGradient5070-5"
+ x1="52.067394"
+ y1="1029.1332"
+ x2="53.406746"
+ y2="1029.1332"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-5.4933245,-1.255617)" />
+ <linearGradient
+ id="linearGradient5060-1">
+ <stop
+ style="stop-color:#000000;stop-opacity:1;"
+ offset="0"
+ id="stop5062-6" />
+ <stop
+ style="stop-color:#000000;stop-opacity:0;"
+ offset="1"
+ id="stop5064-0" />
+ </linearGradient>
+ <filter
+ color-interpolation-filters="sRGB"
+ inkscape:collect="always"
+ id="filter5100-9"
+ x="-3.8212016"
+ width="8.6424036"
+ y="-0.029297812"
+ height="1.0585957">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="0.54030659"
+ id="feGaussianBlur5102-1" />
+ </filter>
+ <linearGradient
+ y2="1029.1332"
+ x2="53.406746"
+ y1="1029.1332"
+ x1="52.067394"
+ gradientTransform="translate(17.106625,4.0807905)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient5123"
+ xlink:href="#linearGradient5060-1"
+ inkscape:collect="always" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="6.3713695"
+ inkscape:cx="51.128112"
+ inkscape:cy="24.031581"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ inkscape:window-width="1278"
+ inkscape:window-height="770"
+ inkscape:window-x="0"
+ inkscape:window-y="28"
+ inkscape:window-maximized="0"
+ inkscape:snap-global="false"
+ inkscape:snap-grids="true">
+ <inkscape:grid
+ type="xygrid"
+ id="grid5169"
+ emppacing="5"
+ visible="true"
+ enabled="true"
+ snapvisiblegridlinesonly="true" />
+ </sodipodi:namedview>
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1004.3622)">
+ <path
+ style="fill:none;stroke:url(#linearGradient5070);stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter5100)"
+ d="m 47.242591,1005.7474 c 0.02394,0.2045 -0.04024,0.4266 0,0.6278 0.0423,0.2116 0.135488,0.4132 0.156952,0.6279 0.03123,0.3123 0,0.6278 0,0.9417 0,0.7847 0,1.5695 0,2.3542 0,5.4411 0,10.8821 0,16.3231 0,1.8834 0,3.7668 0,5.6502 0,0.6279 0,1.2557 0,1.8835 0,0.2092 0.02311,0.4198 0,0.6278 -0.02946,0.2651 -0.123863,0.52 -0.156952,0.7847 -0.03894,0.3115 0,0.6278 0,0.9418 0,0.4185 0,0.837 0,1.2556 0,0.8894 0,1.7788 0,2.6682 0,0.3139 0.02842,0.6291 0,0.9417 -0.02415,0.2656 -0.130408,0.5193 -0.156952,0.7847 -0.02603,0.2603 0,0.5232 0,0.7848 0,0.2616 0,0.5232 0,0.7848 0,1.3602 0,2.7205 0,4.0807 0,0.074 -0.0071,0.7777 0,0.7848 0.03699,0.037 0.119958,-0.037 0.156952,0 0.005,0 0,0.4328 0,0.4708 0,0.2093 0,0.4186 0,0.6278 0,0.052 0,0.1047 0,0.157 0,0.052 0.05232,0.1569 0,0.1569 -0.05232,0 -0.03699,-0.1199 0,-0.1569 0.03699,-0.037 0.104635,0 0.156952,0"
+ id="path5058" />
+ <path
+ style="fill:none;stroke:url(#linearGradient5123);stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter5100-9)"
+ d="m 69.842541,1011.0837 c 0.02394,0.2045 -0.04024,0.4266 0,0.6278 0.0423,0.2116 0.135488,0.4132 0.156952,0.6279 0.03123,0.3123 0,0.6278 0,0.9417 0,0.7847 0,1.5695 0,2.3542 0,5.4411 0,10.8821 0,16.3231 0,1.8834 0,3.7668 0,5.6502 0,0.6279 0,1.2557 0,1.8835 0,0.2092 0.02311,0.4198 0,0.6278 -0.02946,0.2651 -0.123863,0.52 -0.156952,0.7847 -0.03894,0.3115 0,0.6278 0,0.9418 0,0.4185 0,0.837 0,1.2556 0,0.8894 0,1.7788 0,2.6682 0,0.3139 0.02842,0.6291 0,0.9417 -0.02415,0.2656 -0.130408,0.5193 -0.156952,0.7847 -0.02603,0.2603 0,0.5232 0,0.7848 0,0.2616 0,0.5232 0,0.7848 0,1.3602 0,2.7205 0,4.0807 0,0.074 -0.0071,0.7777 0,0.7848 0.03699,0.037 0.119958,-0.037 0.156952,0 0.005,0 0,0.4328 0,0.4708 0,0.2093 0,0.4186 0,0.6278 0,0.052 0,0.1047 0,0.157 0,0.052 0.05232,0.1569 0,0.1569 -0.05232,0 -0.03699,-0.1199 0,-0.1569 0.03699,-0.037 0.104635,0 0.156952,0"
+ id="path5058-2"
+ transform="matrix(0.00689565,0.99997622,-0.99997622,0.00689565,1057.4614,973.82277)" />
+ <rect
+ style="fill:#4e9a06;stroke:#142701;stroke-opacity:1"
+ id="rect2816"
+ width="45"
+ height="45"
+ x="1.5777434"
+ y="1005.2093"
+ rx="1.365"
+ ry="1.3395145" />
+ <rect
+ style="fill:#555753;stroke:#2e3436;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ id="rect3590"
+ width="26.054052"
+ height="25.426245"
+ x="10.829698"
+ y="1015.1646"
+ rx="1.365"
+ ry="1.3395145" />
+ <text
+ xml:space="preserve"
+ style="font-size:17.58400536px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans"
+ x="3.1478038"
+ y="1042.1913"
+ id="text3592"
+ transform="scale(1.0064984,0.99354354)"><tspan
+ sodipodi:role="line"
+ id="tspan3594"
+ x="3.1478038"
+ y="1042.1913">MIPS</tspan></text>
+ </g>
+</svg>
diff --git a/app-emulation/spim/metadata.xml b/app-emulation/spim/metadata.xml
new file mode 100644
index 000000000000..9d9f29c5239c
--- /dev/null
+++ b/app-emulation/spim/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <!-- maintainer-needed -->
+ <longdescription lang="en">
+ A self-contained simulator that will run MIPS32 assembly language
+ programs. It also provides a simple debugger and a minimal set of
+ operating system services.
+ </longdescription>
+ <upstream>
+ <remote-id type="sourceforge">spimsimulator</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-emulation/spim/spim-8.0-r3.ebuild b/app-emulation/spim/spim-8.0-r3.ebuild
new file mode 100644
index 000000000000..2717b50ee23c
--- /dev/null
+++ b/app-emulation/spim/spim-8.0-r3.ebuild
@@ -0,0 +1,80 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit toolchain-funcs
+
+DESCRIPTION="MIPS Simulator"
+HOMEPAGE="http://spimsimulator.sourceforge.net/"
+SRC_URI="http://www.cs.wisc.edu/~larus/SPIM/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="amd64 ~ppc ~sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
+IUSE="doc X"
+
+RDEPEND="
+ X? (
+ media-fonts/font-adobe-100dpi
+ x11-libs/libXaw )
+"
+DEPEND="${RDEPEND}
+ X? (
+ x11-base/xorg-proto
+ x11-misc/imake
+ )
+ sys-devel/bison
+"
+# test hangs forever, disabling it
+RESTRICT="test"
+
+src_prepare() {
+ # fix bugs 240005 and 243588
+ eapply "${FILESDIR}/${P}-r1-respect_env.patch"
+
+ #fix bug 330389
+ sed -i -e 's:-12-\*-75-:-14-\*-100-:g' xspim/xspim.c || die
+
+ default
+}
+
+src_configure() {
+ tc-export CC
+ emake -C spim configuration
+
+ if use X; then
+ emake -C xspim configuration
+ fi
+}
+
+src_compile() {
+ emake DESTDIR="${EPREFIX}" -C spim
+
+ if use X; then
+ emake DESTDIR="${EPREFIX}" EXCEPTION_DIR=/var/lib/spim \
+ -C xspim -j1 xspim
+ fi
+}
+
+src_install() {
+ emake DESTDIR="${ED}" -C spim install
+ newman Documentation/spim.man spim.1
+
+ if use X; then
+ emake DESTDIR="${ED}" -C xspim install
+ newman Documentation/xspim.man xspim.1
+ fi
+
+ doicon "${FILESDIR}"/xspim.svg
+ make_desktop_entry xspim xSPIM xspim "ComputerScience;Science;Education"
+
+ dodoc Documentation/SPIM.html
+ dodoc ChangeLog Documentation/BLURB README VERSION
+ if use doc ; then
+ dodoc Documentation/TeX/{cycle,spim}.ps
+ fi
+}
+
+src_test() {
+ emake -C spim test
+}