# -*- coding: utf-8; mode: tcl; tab-width: 4; truncate-lines: t; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
# $Id: Portfile 47763 2009-03-05 19:21:54Z krischik@macports.org $
# vim: set fileencoding=utf-8 tabstop=4 shiftwidth=4 softtabstop=4 noexpandtab filetype=tcl :

PortSystem 1.0

name				nonpareil	
version				0.79
#revision			4
platforms			darwin
categories			emulators
maintainers			krischik@me.com
description			a high-fidelity simulator for calculators.
long_description	Nonpareil is a high-fidelity simulator for calculators. \
					It currently supports many HP calculators models		\
					introduced between 1972 and 1982. Simulation fidelity	\
					is achieved through the use of the actual microcode of	\
					the calculators, thus in most cases the simulation		\
					behavior exactly matches that of the real calculator.	\
					In particular, numerical results will be identical,		\
					because the simulator is using the BCD arithmetic		\
					algorithms from the calculator.

homepage			http://nonpareil.brouhaha.com/
master_sites		http://nonpareil.brouhaha.com/download

set prog			nonpareil-${version}.tar.gz

distfiles			${prog}

checksums			${prog} sha1 83bc2f57e6ece9ce19e3449cce075ef246a9f4c2

depends_lib			port:bison								\
					port:flex								\
					port:glib2								\
					port:gtk2								\
					port:libxml2							\
					port:netpbm								\
					port:pkgconfig							\
					port:python23							\
					port:scons								

patchfiles          patch-src-util.diff

worksrcdir			${name}-${version}
use_parallel_build	yes
use_configure		no
build.cmd			"scons-local/scons.py"
build.args			prefix=${prefix}
build.target

destroot.cmd		"scons-local/scons.py"
build.args			prefix=${prefix} destdir=${destroot}

post-extract {
	system "cd ${workpath}/${name}-${version}/scons-local; tar -xzf scons-local-0.96.90.tar.gz"
}

platform macosx {
	post-destroot {
	xinstall -m 775 -d ${destroot}${applications_dir}
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-21.app
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-21.app/Contents
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-21.app/Contents/MacOS
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-21.app/Contents/Resources

	xinstall -m 644 -W ${filespath}																\
		HP-21.app/Contents/Info.plist													\
		${destroot}${applications_dir}/Nonpareil/HP-21.app/Contents/Info.plist
	xinstall -m 644 -W ${filespath}																\
		HP-21.app/Contents/Resources/HP-21.icns									\
		${destroot}${applications_dir}/Nonpareil/HP-21.app/Contents/Resources/HP-21.icns
	xinstall -m 755 -W ${filespath}																\
		HP-21.app/Contents/MacOS/HP-21.command									\
		${destroot}${applications_dir}/Nonpareil/HP-21.app/Contents/MacOS/HP-21.command

	reinplace																					\
		s|@PREFIX@|${prefix}|g																	\
		${destroot}${applications_dir}/Nonpareil/HP-21.app/Contents/MacOS/HP-21.command

	xinstall -m 775 -d ${destroot}${applications_dir}
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-25.app
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-25.app/Contents
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-25.app/Contents/MacOS
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-25.app/Contents/Resources

	xinstall -m 644 -W ${filespath}																\
		HP-25.app/Contents/Info.plist													\
		${destroot}${applications_dir}/Nonpareil/HP-25.app/Contents/Info.plist
	xinstall -m 644 -W ${filespath}																\
		HP-25.app/Contents/Resources/HP-25.icns									\
		${destroot}${applications_dir}/Nonpareil/HP-25.app/Contents/Resources/HP-25.icns
	xinstall -m 755 -W ${filespath}																\
		HP-25.app/Contents/MacOS/HP-25.command									\
		${destroot}${applications_dir}/Nonpareil/HP-25.app/Contents/MacOS/HP-25.command

	reinplace																					\
		s|@PREFIX@|${prefix}|g																	\
		${destroot}${applications_dir}/Nonpareil/HP-25.app/Contents/MacOS/HP-25.command

	xinstall -m 775 -d ${destroot}${applications_dir}
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-32E.app
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-32E.app/Contents
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-32E.app/Contents/MacOS
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-32E.app/Contents/Resources

	xinstall -m 644 -W ${filespath}																\
		HP-32E.app/Contents/Info.plist													\
		${destroot}${applications_dir}/Nonpareil/HP-32E.app/Contents/Info.plist
	xinstall -m 644 -W ${filespath}																\
		HP-32E.app/Contents/Resources/HP-32E.icns									\
		${destroot}${applications_dir}/Nonpareil/HP-32E.app/Contents/Resources/HP-32E.icns
	xinstall -m 755 -W ${filespath}																\
		HP-32E.app/Contents/MacOS/HP-32E.command									\
		${destroot}${applications_dir}/Nonpareil/HP-32E.app/Contents/MacOS/HP-32E.command

	reinplace																					\
		s|@PREFIX@|${prefix}|g																	\
		${destroot}${applications_dir}/Nonpareil/HP-32E.app/Contents/MacOS/HP-32E.command

	xinstall -m 775 -d ${destroot}${applications_dir}
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-33C.app
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-33C.app/Contents
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-33C.app/Contents/MacOS
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-33C.app/Contents/Resources

	xinstall -m 644 -W ${filespath}																\
		HP-33C.app/Contents/Info.plist													\
		${destroot}${applications_dir}/Nonpareil/HP-33C.app/Contents/Info.plist
	xinstall -m 644 -W ${filespath}																\
		HP-33C.app/Contents/Resources/HP-33C.icns									\
		${destroot}${applications_dir}/Nonpareil/HP-33C.app/Contents/Resources/HP-33C.icns
	xinstall -m 755 -W ${filespath}																\
		HP-33C.app/Contents/MacOS/HP-33C.command									\
		${destroot}${applications_dir}/Nonpareil/HP-33C.app/Contents/MacOS/HP-33C.command

	reinplace																					\
		s|@PREFIX@|${prefix}|g																	\
		${destroot}${applications_dir}/Nonpareil/HP-33C.app/Contents/MacOS/HP-33C.command

	xinstall -m 775 -d ${destroot}${applications_dir}
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-34C.app
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-34C.app/Contents
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-34C.app/Contents/MacOS
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-34C.app/Contents/Resources

	xinstall -m 644 -W ${filespath}																\
		HP-34C.app/Contents/Info.plist													\
		${destroot}${applications_dir}/Nonpareil/HP-34C.app/Contents/Info.plist
	xinstall -m 644 -W ${filespath}																\
		HP-34C.app/Contents/Resources/HP-34C.icns									\
		${destroot}${applications_dir}/Nonpareil/HP-34C.app/Contents/Resources/HP-34C.icns
	xinstall -m 755 -W ${filespath}																\
		HP-34C.app/Contents/MacOS/HP-34C.command									\
		${destroot}${applications_dir}/Nonpareil/HP-34C.app/Contents/MacOS/HP-34C.command

	reinplace																					\
		s|@PREFIX@|${prefix}|g																	\
		${destroot}${applications_dir}/Nonpareil/HP-34C.app/Contents/MacOS/HP-34C.command

	xinstall -m 775 -d ${destroot}${applications_dir}
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-35.app
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-35.app/Contents
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-35.app/Contents/MacOS
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-35.app/Contents/Resources

	xinstall -m 644 -W ${filespath}																\
		HP-35.app/Contents/Info.plist													\
		${destroot}${applications_dir}/Nonpareil/HP-35.app/Contents/Info.plist
	xinstall -m 644 -W ${filespath}																\
		HP-35.app/Contents/Resources/HP-35.icns									\
		${destroot}${applications_dir}/Nonpareil/HP-35.app/Contents/Resources/HP-35.icns
	xinstall -m 755 -W ${filespath}																\
		HP-35.app/Contents/MacOS/HP-35.command									\
		${destroot}${applications_dir}/Nonpareil/HP-35.app/Contents/MacOS/HP-35.command

	reinplace																					\
		s|@PREFIX@|${prefix}|g																	\
		${destroot}${applications_dir}/Nonpareil/HP-35.app/Contents/MacOS/HP-35.command

	xinstall -m 775 -d ${destroot}${applications_dir}
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-37E.app
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-37E.app/Contents
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-37E.app/Contents/MacOS
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-37E.app/Contents/Resources

	xinstall -m 644 -W ${filespath}																\
		HP-37E.app/Contents/Info.plist													\
		${destroot}${applications_dir}/Nonpareil/HP-37E.app/Contents/Info.plist
	xinstall -m 644 -W ${filespath}																\
		HP-37E.app/Contents/Resources/HP-37E.icns									\
		${destroot}${applications_dir}/Nonpareil/HP-37E.app/Contents/Resources/HP-37E.icns
	xinstall -m 755 -W ${filespath}																\
		HP-37E.app/Contents/MacOS/HP-37E.command									\
		${destroot}${applications_dir}/Nonpareil/HP-37E.app/Contents/MacOS/HP-37E.command

	reinplace																					\
		s|@PREFIX@|${prefix}|g																	\
		${destroot}${applications_dir}/Nonpareil/HP-37E.app/Contents/MacOS/HP-37E.command

	xinstall -m 775 -d ${destroot}${applications_dir}
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-38C.app
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-38C.app/Contents
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-38C.app/Contents/MacOS
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-38C.app/Contents/Resources

	xinstall -m 644 -W ${filespath}																\
		HP-38C.app/Contents/Info.plist													\
		${destroot}${applications_dir}/Nonpareil/HP-38C.app/Contents/Info.plist
	xinstall -m 644 -W ${filespath}																\
		HP-38C.app/Contents/Resources/HP-38C.icns									\
		${destroot}${applications_dir}/Nonpareil/HP-38C.app/Contents/Resources/HP-38C.icns
	xinstall -m 755 -W ${filespath}																\
		HP-38C.app/Contents/MacOS/HP-38C.command									\
		${destroot}${applications_dir}/Nonpareil/HP-38C.app/Contents/MacOS/HP-38C.command

	reinplace																					\
		s|@PREFIX@|${prefix}|g																	\
		${destroot}${applications_dir}/Nonpareil/HP-38C.app/Contents/MacOS/HP-38C.command

	xinstall -m 775 -d ${destroot}${applications_dir}
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-38E.app
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-38E.app/Contents
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-38E.app/Contents/MacOS
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-38E.app/Contents/Resources

	xinstall -m 644 -W ${filespath}																\
		HP-38E.app/Contents/Info.plist													\
		${destroot}${applications_dir}/Nonpareil/HP-38E.app/Contents/Info.plist
	xinstall -m 644 -W ${filespath}																\
		HP-38E.app/Contents/Resources/HP-38E.icns									\
		${destroot}${applications_dir}/Nonpareil/HP-38E.app/Contents/Resources/HP-38E.icns
	xinstall -m 755 -W ${filespath}																\
		HP-38E.app/Contents/MacOS/HP-38E.command									\
		${destroot}${applications_dir}/Nonpareil/HP-38E.app/Contents/MacOS/HP-38E.command

	reinplace																					\
		s|@PREFIX@|${prefix}|g																	\
		${destroot}${applications_dir}/Nonpareil/HP-38E.app/Contents/MacOS/HP-38E.command

	xinstall -m 775 -d ${destroot}${applications_dir}
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-41CV.app
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-41CV.app/Contents
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-41CV.app/Contents/MacOS
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-41CV.app/Contents/Resources

	xinstall -m 644 -W ${filespath}																\
		HP-41CV.app/Contents/Info.plist													\
		${destroot}${applications_dir}/Nonpareil/HP-41CV.app/Contents/Info.plist
	xinstall -m 644 -W ${filespath}																\
		HP-41CV.app/Contents/Resources/HP-41CV.icns									\
		${destroot}${applications_dir}/Nonpareil/HP-41CV.app/Contents/Resources/HP-41CV.icns
	xinstall -m 755 -W ${filespath}																\
		HP-41CV.app/Contents/MacOS/HP-41CV.command									\
		${destroot}${applications_dir}/Nonpareil/HP-41CV.app/Contents/MacOS/HP-41CV.command

	reinplace																					\
		s|@PREFIX@|${prefix}|g																	\
		${destroot}${applications_dir}/Nonpareil/HP-41CV.app/Contents/MacOS/HP-41CV.command

	xinstall -m 775 -d ${destroot}${applications_dir}
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-41CX.app
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-41CX.app/Contents
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-41CX.app/Contents/MacOS
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-41CX.app/Contents/Resources

	xinstall -m 644 -W ${filespath}																\
		HP-41CX.app/Contents/Info.plist													\
		${destroot}${applications_dir}/Nonpareil/HP-41CX.app/Contents/Info.plist
	xinstall -m 644 -W ${filespath}																\
		HP-41CX.app/Contents/Resources/HP-41CX.icns									\
		${destroot}${applications_dir}/Nonpareil/HP-41CX.app/Contents/Resources/HP-41CX.icns
	xinstall -m 755 -W ${filespath}																\
		HP-41CX.app/Contents/MacOS/HP-41CX.command									\
		${destroot}${applications_dir}/Nonpareil/HP-41CX.app/Contents/MacOS/HP-41CX.command

	reinplace																					\
		s|@PREFIX@|${prefix}|g																	\
		${destroot}${applications_dir}/Nonpareil/HP-41CX.app/Contents/MacOS/HP-41CX.command

	xinstall -m 775 -d ${destroot}${applications_dir}
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-45.app
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-45.app/Contents
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-45.app/Contents/MacOS
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-45.app/Contents/Resources

	xinstall -m 644 -W ${filespath}																\
		HP-45.app/Contents/Info.plist													\
		${destroot}${applications_dir}/Nonpareil/HP-45.app/Contents/Info.plist
	xinstall -m 644 -W ${filespath}																\
		HP-45.app/Contents/Resources/HP-45.icns									\
		${destroot}${applications_dir}/Nonpareil/HP-45.app/Contents/Resources/HP-45.icns
	xinstall -m 755 -W ${filespath}																\
		HP-45.app/Contents/MacOS/HP-45.command									\
		${destroot}${applications_dir}/Nonpareil/HP-45.app/Contents/MacOS/HP-45.command

	reinplace																					\
		s|@PREFIX@|${prefix}|g																	\
		${destroot}${applications_dir}/Nonpareil/HP-45.app/Contents/MacOS/HP-45.command

	xinstall -m 775 -d ${destroot}${applications_dir}
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-55.app
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-55.app/Contents
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-55.app/Contents/MacOS
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-55.app/Contents/Resources

	xinstall -m 644 -W ${filespath}																\
		HP-55.app/Contents/Info.plist													\
		${destroot}${applications_dir}/Nonpareil/HP-55.app/Contents/Info.plist
	xinstall -m 644 -W ${filespath}																\
		HP-55.app/Contents/Resources/HP-55.icns									\
		${destroot}${applications_dir}/Nonpareil/HP-55.app/Contents/Resources/HP-55.icns
	xinstall -m 755 -W ${filespath}																\
		HP-55.app/Contents/MacOS/HP-55.command									\
		${destroot}${applications_dir}/Nonpareil/HP-55.app/Contents/MacOS/HP-55.command

	reinplace																					\
		s|@PREFIX@|${prefix}|g																	\
		${destroot}${applications_dir}/Nonpareil/HP-55.app/Contents/MacOS/HP-55.command

	xinstall -m 775 -d ${destroot}${applications_dir}
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-80.app
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-80.app/Contents
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-80.app/Contents/MacOS
	xinstall -m 755 -d ${destroot}${applications_dir}/Nonpareil/HP-80.app/Contents/Resources

	xinstall -m 644 -W ${filespath}																\
		HP-80.app/Contents/Info.plist													\
		${destroot}${applications_dir}/Nonpareil/HP-80.app/Contents/Info.plist
	xinstall -m 644 -W ${filespath}																\
		HP-80.app/Contents/Resources/HP-80.icns									\
		${destroot}${applications_dir}/Nonpareil/HP-80.app/Contents/Resources/HP-80.icns
	xinstall -m 755 -W ${filespath}																\
		HP-80.app/Contents/MacOS/HP-80.command									\
		${destroot}${applications_dir}/Nonpareil/HP-80.app/Contents/MacOS/HP-80.command

	reinplace																					\
		s|@PREFIX@|${prefix}|g																	\
		${destroot}${applications_dir}/Nonpareil/HP-80.app/Contents/MacOS/HP-80.command
	}
}

