SUMMARY="A simulator for historical computers, such as Vax & PDP-11"
DESCRIPTION="SIMH is a highly portable, multi-system simulator.

SIMH implements simulators for:
- Data General Nova, Eclipse
- Digital Equipment Corporation PDP-1, PDP-4, PDP-7, PDP-8, PDP-9, PDP-10, \
PDP-11, PDP-15, VAX
- GRI Corporation GRI-909, GRI-99
- IBM 1401, 1620, 1130,  7090/7094, System 3
- Interdata (Perkin-Elmer) 16b and 32b systems
- Hewlett-Packard 2114, 2115, 2116, 2100, 21MX, 1000
- Honeywell H316/H516
- MITS Altair 8800, with both 8080 and Z80
- Royal-Mcbee LGP-30, LGP-21
- Scientific Data Systems SDS 940
- SWTP 6800"
HOMEPAGE="http://simh.trailing-edge.com/"
COPYRIGHT="1993-2008 Robert M Supnik"
LICENSE="MIT"
REVISION="5"
srcGitRev="a92dc610a4d39354f890b0263077b0686a60a407"
SOURCE_URI="https://github.com/simh/simh/archive/$srcGitRev.tar.gz"
CHECKSUM_SHA256="89ed93b7f30f33f4af40012bcbcb476d8337da6a6cccaf13a79aa8a3bf57fdb7"
SOURCE_FILENAME="simh-$portVersion-$srcGitRev.tar.gz"
SOURCE_DIR="simh-$srcGitRev"
PATCHES="simh-4.0.0_git.patchset"

ARCHITECTURES="?all !x86_gcc2"
SECONDARY_ARCHITECTURES="?x86"

commandSuffix=$secondaryArchSuffix
commandBinDir=$binDir
if [ "$targetArchitecture" = x86_gcc2 ]; then
	commandSuffix=
	commandBinDir=$prefix/bin
fi

PROVIDES="
	simh$secondaryArchSuffix = $portVersion
	cmd:3b2$commandSuffix = $portVersion
	cmd:altair$commandSuffix = $portVersion
	cmd:altairz80$commandSuffix = $portVersion
	cmd:b5500$commandSuffix = $portVersion
	cmd:cdc1700$commandSuffix = $portVersion
	cmd:eclipse$commandSuffix = $portVersion
	cmd:gri$commandSuffix = $portVersion
	cmd:h316$commandSuffix = $portVersion
	cmd:hp2100$commandSuffix = $portVersion
	cmd:hp3000$commandSuffix = $portVersion
	cmd:i1401$commandSuffix = $portVersion
	cmd:i1620$commandSuffix = $portVersion
	cmd:i650$commandSuffix = $portVersion
	cmd:i701$commandSuffix = $portVersion
	cmd:i7010$commandSuffix = $portVersion
	cmd:i704$commandSuffix = $portVersion
	cmd:i7070$commandSuffix = $portVersion
	cmd:i7080$commandSuffix = $portVersion
	cmd:i7090$commandSuffix = $portVersion
	cmd:i7094$commandSuffix = $portVersion
	cmd:ibm1130$commandSuffix = $portVersion
	cmd:id16$commandSuffix = $portVersion
	cmd:id32$commandSuffix = $portVersion
	cmd:imds_225$commandSuffix = $portVersion
	cmd:isys8010$commandSuffix = $portVersion
	cmd:isys8020$commandSuffix = $portVersion
	cmd:isys8024$commandSuffix = $portVersion
	cmd:isys8030$commandSuffix = $portVersion
	cmd:lgp$commandSuffix = $portVersion
	cmd:microvax1$commandSuffix = $portVersion
	cmd:microvax2$commandSuffix = $portVersion
	cmd:microvax3900$commandSuffix = $portVersion
	cmd:nova$commandSuffix = $portVersion
	cmd:pdp1$commandSuffix = $portVersion
	cmd:pdp10$commandSuffix = $portVersion
	cmd:pdp11$commandSuffix = $portVersion
	cmd:pdp15$commandSuffix = $portVersion
	cmd:pdp4$commandSuffix = $portVersion
	cmd:pdp7$commandSuffix = $portVersion
	cmd:pdp8$commandSuffix = $portVersion
	cmd:pdp9$commandSuffix = $portVersion
	cmd:rtvax1000$commandSuffix = $portVersion
	cmd:s3$commandSuffix = $portVersion
	cmd:scelbi$commandSuffix = $portVersion
	cmd:sds$commandSuffix = $portVersion
	cmd:ssem$commandSuffix = $portVersion
	cmd:swtp6800mp_a$commandSuffix = $portVersion
	cmd:swtp6800mp_a2$commandSuffix = $portVersion
	cmd:tx_0$commandSuffix = $portVersion
	cmd:vax$commandSuffix = $portVersion
	cmd:vax730$commandSuffix = $portVersion
	cmd:vax750$commandSuffix = $portVersion
	cmd:vax780$commandSuffix = $portVersion
	cmd:vax8600$commandSuffix = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libpcap$secondaryArchSuffix
	lib:libSDL2_2.0$secondaryArchSuffix
	lib:libSDL2_ttf$secondaryArchSuffix
	dejavu
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libpcap$secondaryArchSuffix
	devel:libSDL2$secondaryArchSuffix
	devel:libSDL2_ttf$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:awk
	cmd:gcc$secondaryArchSuffix
	cmd:git
	cmd:ld$secondaryArchSuffix
	cmd:make
	cmd:find
	cmd:which
	dejavu
	"

defineDebugInfoPackage simh$secondaryArchSuffix \
	"$commandBinDir"/3b2 \
	"$commandBinDir"/altair \
	"$commandBinDir"/altairz80 \
	"$commandBinDir"/b5500 \
	"$commandBinDir"/cdc1700 \
	"$commandBinDir"/eclipse \
	"$commandBinDir"/gri \
	"$commandBinDir"/h316 \
	"$commandBinDir"/hp2100 \
	"$commandBinDir"/hp3000 \
	"$commandBinDir"/i1401 \
	"$commandBinDir"/i1620 \
	"$commandBinDir"/i650 \
	"$commandBinDir"/i701 \
	"$commandBinDir"/i7010 \
	"$commandBinDir"/i704 \
	"$commandBinDir"/i7070 \
	"$commandBinDir"/i7080 \
	"$commandBinDir"/i7090 \
	"$commandBinDir"/i7094 \
	"$commandBinDir"/ibm1130 \
	"$commandBinDir"/id16 \
	"$commandBinDir"/id32 \
	"$commandBinDir"/imds-225 \
	"$commandBinDir"/isys8010 \
	"$commandBinDir"/isys8020 \
	"$commandBinDir"/isys8024 \
	"$commandBinDir"/isys8030 \
	"$commandBinDir"/lgp \
	"$commandBinDir"/microvax1 \
	"$commandBinDir"/microvax2 \
	"$commandBinDir"/microvax3900 \
	"$commandBinDir"/nova \
	"$commandBinDir"/pdp1 \
	"$commandBinDir"/pdp10 \
	"$commandBinDir"/pdp11 \
	"$commandBinDir"/pdp15 \
	"$commandBinDir"/pdp4 \
	"$commandBinDir"/pdp7 \
	"$commandBinDir"/pdp8 \
	"$commandBinDir"/pdp9 \
	"$commandBinDir"/rtvax1000 \
	"$commandBinDir"/s3 \
	"$commandBinDir"/scelbi \
	"$commandBinDir"/sds \
	"$commandBinDir"/ssem \
	"$commandBinDir"/swtp6800mp-a \
	"$commandBinDir"/swtp6800mp-a2 \
	"$commandBinDir"/tx-0 \
	"$commandBinDir"/vax \
	"$commandBinDir"/vax730 \
	"$commandBinDir"/vax750 \
	"$commandBinDir"/vax780 \
	"$commandBinDir"/vax8600

BUILD()
{
	make \
		FONTPATH=$(finddir B_SYSTEM_FONTS_DIRECTORY) \
		$jobArgs
}

INSTALL()
{
	install -d "$commandBinDir"
	install -t "$commandBinDir" BIN/*
}
