[51490] users/ryandesign
ryandesign at macports.org
ryandesign at macports.org
Tue May 26 10:28:11 PDT 2009
Revision: 51490
http://trac.macports.org/changeset/51490
Author: ryandesign at macports.org
Date: 2009-05-26 10:28:10 -0700 (Tue, 26 May 2009)
Log Message:
-----------
minivmac-devel: New port based on work-in-progress minivmac version 3 port. The
build system can now be compiled and run on Mac OS X, which means I could remove
all the code that dealt with setting up a minivmac bootstrap. The patch to the
build system allows it to read configuration options from a text file, and then
automatically runs the build and quits. The patch has been sent upstream.
Modified Paths:
--------------
users/ryandesign/minivmac-devel/Portfile
Added Paths:
-----------
users/ryandesign/minivmac-devel/
users/ryandesign/minivmac-devel/files/patch-build.diff
users/ryandesign/minivmac-devel/files/runbuild.sh
Removed Paths:
-------------
users/ryandesign/minivmac-devel/files/demacbinary.sh
Modified: users/ryandesign/minivmac-devel/Portfile
===================================================================
--- users/ryandesign/minivmac/Portfile 2009-05-26 09:54:06 UTC (rev 51487)
+++ users/ryandesign/minivmac-devel/Portfile 2009-05-26 17:28:10 UTC (rev 51490)
@@ -2,9 +2,12 @@
PortSystem 1.0
-name minivmac
-version 3.0.4
-revision 1
+name minivmac-devel
+set my_name minivmac
+version 3.1.0-20090402
+set version_number [lindex [split ${version} -] 0]
+set version_date [lindex [split ${version} -] 1]
+set version_short_date [string range ${version_date} 2 end]
categories emulators aqua
maintainers ryandesign
homepage http://minivmac.sourceforge.net/
@@ -13,6 +16,7 @@
universal_variant no
build.target
use_parallel_build yes
+dist_subdir ${my_name}
description \
a Mac 128K, Mac 512K, Mac 512KE, Mac Plus and Mac SE emulator
@@ -23,63 +27,37 @@
The default is to emulate a Mac Plus (1986-1990)\; this is also \
the best-tested and therefore recommended emulation.
-master_sites \
- sourceforge:${name}:minivmac \
- http://download.info.apple.com/Apple_Support_Area/Apple_Software_Updates/English-International/Macintosh/System/Full_Installs/:apple
+master_sites sourceforge:${my_name}
+distname ${my_name}${version_short_date}
set my_src ${distname}.src
set my_src_compressed ${my_src}.zip
-set my_bootstrap_version 3.0.4
-set my_bootstrap "Mini vMac.app"
-set my_bootstrap_compressed ${name}-${my_bootstrap_version}-umch.bin.tgz
-set my_autoquit autquit7-1.1.0
-set my_autoquit_compressed ${my_autoquit}.zip
set my_icons icnsosx-1.0.0
set my_icons_compressed ${my_icons}.zip
-set my_system_disk_container Z-System_7.0.1.smi
-set my_system_disk_container_compressed ${my_system_disk_container}.bin
distfiles \
- ${my_src_compressed}:minivmac \
- ${my_icons_compressed}:minivmac \
- ${my_autoquit_compressed}:minivmac \
- ${my_system_disk_container_compressed}:apple
-
-extract.only \
${my_src_compressed} \
- ${my_icons_compressed} \
- ${my_autoquit_compressed}
+ ${my_icons_compressed}
checksums \
${my_src_compressed} \
- md5 ab308459e98bd5103ad8bbb7dd158eb6 \
- sha1 ff99aa72da0868a5306631f0d06ae190cbd2a03a \
- rmd160 b8f1f5269d21835ff3e9e428da12a7b6c224e60e \
- ${my_bootstrap_compressed} \
- md5 298565ec1ccfe6876768156aaf5f76a0 \
- sha1 34212dedb1cfb744e6ca8124693f2f6e40094833 \
- rmd160 042eacfb9ec853589d661c86ffb99d509061eb0f \
+ md5 7defdcb859cdda0df3bdc3c252370a70 \
+ sha1 f4a80b326380746b88993d53eeb6a7d46768358b \
+ rmd160 828eb032ea3ac0f52054d0c8af1d6910ded1dff0 \
${my_icons_compressed} \
md5 2af006506de7549be14f94317918d59a \
sha1 4ef79bb56b988fedfeb82a8b6cafd8066f5bbab2 \
- rmd160 cef6d7d7578464538d0042b0d98379ae7f18fab7 \
- ${my_autoquit_compressed} \
- md5 eebe87a27d6db8e8f247f0fffe0f2bd5 \
- sha1 8199e1da12d01fc210ae1eaa50f794e5b8c479c1 \
- rmd160 f493a59fd637caa8a7937fbefaf6ebdf4a07c7f5 \
- ${my_system_disk_container_compressed} \
- md5 5e7b4c0ce13e65546eb795c35879751a \
- sha1 bf37fde76dfd9d4ed35526954c149566d761c2a6 \
- rmd160 08788cbcca023ea9a0713ecec4781c35aa5a9185
+ rmd160 cef6d7d7578464538d0042b0d98379ae7f18fab7
depends_build \
- port:macutil \
bin:expect:expect
+patchfiles \
+ patch-build.diff
+
set my_appdir "${applications_dir}/Mini vMac"
set romfile vMac.ROM
set romfile_model "Macintosh Plus or 512Ke"
-set my_mnvm_dat "${workpath}/${my_bootstrap}/Contents/mnvm_dat"
set my_options_file options.txt
set my_base_options "-maintainer MacPorts -homepage http://www.macports.org/ -cl -eol unx -nex"
set my_target ""
@@ -112,97 +90,58 @@
}
post-extract {
- system "tar -x -z -C ${workpath} -f ${distpath}/${my_bootstrap_compressed}"
+ xinstall -W ${filespath} attach.exp runbuild.sh ${workpath}
- xinstall -W ${filespath} attach.exp demacbinary.sh ${workpath}
-
- system "${workpath}/demacbinary.sh ${distpath}/${my_system_disk_container_compressed} ${workpath}"
-
- file mkdir ${my_mnvm_dat}
- ln -s ${my_appdir}/${romfile} ${my_mnvm_dat}
-
- # Copy the Disk Tools and Tidbits images from the container image.
- set my_system_disk_container_mount [my_attach_disk_image ${workpath}/${my_system_disk_container} 0]
- file copy "${my_system_disk_container_mount}/Disk Tools.image" ${workpath}/startup.img
- file copy "${my_system_disk_container_mount}/Tidbits.image" ${workpath}/tidbits.img
- my_detach_disk_image ${my_system_disk_container_mount}
-
# The disk image mounter likes images to have the .img extension.
file rename ${workpath}/${my_src}/${my_src}.dsk ${workpath}/src.img
- file rename ${workpath}/${my_autoquit}/${my_autoquit}.dsk ${workpath}/autoquit.img
- # Mount the startup disk and make room on it for our things.
- set my_startup_disk_mount [my_attach_disk_image ${workpath}/startup.img 1]
- file delete "${my_startup_disk_mount}/Apple HD SC Setup" "${my_startup_disk_mount}/Disk First Aid"
+ # Mount the source disk image.
+ set my_src_disk_mount [my_attach_disk_image ${workpath}/src.img 0]
- # Copy autoquit to the startup disk and make it open at startup.
- # Need to use ditto to preserve the resource fork.
- set my_autoquit_disk_mount [my_attach_disk_image ${workpath}/autoquit.img 0]
- set my_startup_disk_autoquit_dir "${my_startup_disk_mount}/autoquit"
- file mkdir "${my_startup_disk_autoquit_dir}"
- system "ditto --rsrc ${my_autoquit_disk_mount}/AutQuit7 ${my_startup_disk_autoquit_dir}"
- my_detach_disk_image ${my_autoquit_disk_mount}
- my_make_alias "${my_startup_disk_autoquit_dir}/AutQuit7" "${my_startup_disk_mount}/System Folder/Startup Items"
+ # Copy the source from the disk image into the workpath.
+ file mkdir ${worksrcpath}
+ foreach thing {COPYING.txt README.txt output projects source} {
+ copy ${my_src_disk_mount}/${thing} ${worksrcpath}
+ }
- # Mount the source disk.
- set my_src_disk_mount [my_attach_disk_image ${workpath}/src.img 1]
-
- # Copy TeachText to the source disk. (No room on the startup disk.)
- set my_tidbits_disk_mount [my_attach_disk_image ${workpath}/tidbits.img 0]
- system "ditto --rsrc ${my_tidbits_disk_mount}/TeachText ${my_src_disk_mount}"
- my_detach_disk_image ${my_tidbits_disk_mount}
-
- # Force a rebuild of the Desktop files, both to add info about TeachText and
- # to remove that of Apple HD SC Setup and Disk First Aid (to make more room).
- file delete ${my_startup_disk_mount}/Desktop ${my_src_disk_mount}/Desktop
-
- # Create an empty options file so we can make an alias to it.
- set my_options_file_id [open ${my_src_disk_mount}/${my_options_file} "w"]
- close ${my_options_file_id}
- system "/Developer/Tools/SetFile -c ttxt -t TEXT ${my_src_disk_mount}/${my_options_file}"
-
- # Have autoquit launch the build system. If there's an alias "app" in the same directory,
- # autoquit will open it. If there's also an alias "doc" in the same directory, autoquit
- # will open the document "doc" into the application "app".
- my_make_alias "${my_src_disk_mount}/Build" "${my_startup_disk_autoquit_dir}/app"
- # The build system doesn't support reading text files yet.
-# my_make_alias "${my_src_disk_mount}/${my_options_file}" "${my_startup_disk_autoquit_dir}/doc"
- my_make_alias "${my_src_disk_mount}/${my_options_file}" "${my_startup_disk_mount}/System Folder/Startup Items"
-
- # Unmount disk images.
- my_detach_disk_image ${my_startup_disk_mount}
+ # Unmount the disk image.
my_detach_disk_image ${my_src_disk_mount}
- # Mini vMac looks for disks named disk1.dsk through disk3.dsk and automounts them.
- file rename "${workpath}/startup.img" "${my_mnvm_dat}/disk1.dsk"
+ # Convert CR to LF line endings.
+ fs-traverse thing ${worksrcpath} {
+ if {[file isfile ${thing}]} {
+ foreach extension {.a .c .h .i .plist .r Makefile} {
+ if {[string match "*${extension}" ${thing}]} {
+ reinplace "s/\r/\\\n/g" ${thing}
+ }
+ }
+ }
+ }
}
configure {
+ # Build the build system.
+ if {![file exists ${worksrcpath}/Build.app]} {
+ set my_cmd "cd ${worksrcpath}/projects/gcc_${my_target} && make"
+ ui_debug ${my_cmd}
+ system ${my_cmd}
+ file rename ${worksrcpath}/projects/gcc_${my_target}/Build.app ${worksrcpath}
+ }
+
# Write our options file.
set my_variation [my_get_variation]
set my_options "${my_base_options} -t ${my_target} -m ${my_machine} -n ${my_variation}"
- set my_src_disk_mount [my_attach_disk_image ${workpath}/src.img 1]
- set my_options_file_id [open ${my_src_disk_mount}/${my_options_file} "w"]
+ set my_options_file_id [open ${worksrcpath}/${my_options_file} "w"]
puts -nonewline ${my_options_file_id} ${my_options}
close ${my_options_file_id}
- my_detach_disk_image ${my_src_disk_mount}
- # Move the source disk where Mini vMac will find it.
- file rename "${workpath}/src.img" "${my_mnvm_dat}/disk2.dsk"
-
# Run the build system.
- system "'${workpath}/${my_bootstrap}/Contents/MacOS/minivmac'"
+ set my_cmd "${workpath}/runbuild.sh ${worksrcpath} ${worksrcpath}/${my_options_file}"
+ ui_debug ${my_cmd}
+ system ${my_cmd}
- # Give the source disk image the .img extension to appease the disk image mounter.
- file rename "${my_mnvm_dat}/disk2.dsk" "${workpath}/src.img"
-
# Get the build product.
- set my_src_disk_mount [my_attach_disk_image ${workpath}/src.img 1]
- if {[file exists ${my_src_disk_mount}/output/${my_variation}]} {
- file copy ${my_src_disk_mount}/output/${my_variation} ${workpath}
- file delete -force ${my_src_disk_mount}/output/${my_variation}
- }
- my_detach_disk_image ${my_src_disk_mount}
+ file rename ${worksrcpath}/output/${my_variation} ${workpath}
}
pre-build {
@@ -266,24 +205,13 @@
file delete -force ${mountpoint}
}
-proc my_make_alias {src dst} {
- set dst_is_dir [file isdirectory "${dst}"]
- if {${dst_is_dir}} {
- set dst_dir "${dst}"
- } else {
- set dst_dir "[file dirname ${dst}]"
- }
- system "osascript -e 'set src to POSIX file \"${src}\"' -e 'set dst_dir to POSIX file \"${dst_dir}\"' -e 'tell app \"Finder\" to make new alias file at dst_dir to src' -e 'return'"
- if {!${dst_is_dir}} {
- file rename "[file join ${dst_dir} [file tail ${src}]]" "${dst}"
- }
-}
-
proc my_get_variation {} {
- global name version revision my_variation_machine my_target
- return ${name}-${version}_${revision}-${my_variation_machine}-${my_target}
+ global version revision my_variation_machine
+ # Due to limitations of the build system, the variation name cannot be longer than 27 characters.
+ return ${version}_${revision}-${my_variation_machine}
}
livecheck.check regex
-livecheck.url ${homepage}download.html
-livecheck.regex ${name}-(\[0-9.\]+)\\.src
+livecheck.version ${version_short_date}
+livecheck.url ${homepage}develop/
+livecheck.regex ${my_name}(\[0-9\]+)\\.src
Deleted: users/ryandesign/minivmac-devel/files/demacbinary.sh
===================================================================
--- users/ryandesign/minivmac/files/demacbinary.sh 2009-05-26 09:54:06 UTC (rev 51487)
+++ users/ryandesign/minivmac-devel/files/demacbinary.sh 2009-05-26 17:28:10 UTC (rev 51490)
@@ -1,36 +0,0 @@
-#!/bin/sh
-
-INFILE="$1"
-OUT="$2"
-
-if [ $# -ne 2 ]; then
- echo "usage: $0 <infile> <outfile or outdir>" 1>&2
- exit 1
-fi
-
-if [ ! -f "$INFILE" ]; then
- echo "$0: $INFILE: No such file" 1>&2
- exit 1
-fi
-
-if [ -d "$OUT" ]; then
- OUTDIR="$OUT"
- OUTFILE="$OUTDIR/`basename "$INFILE" .bin`"
-else
- OUTFILE="$OUT"
- OUTDIR="`dirname "$OUTFILE"`"
-fi
-
-if [ ! -d "$OUTDIR" ]; then
- echo "$0: $OUTDIR: No such directory" 1>&2
- exit 1
-fi
-
-DATAFORKFILE="$OUTFILE.data"
-RSRCFORKFILE="$OUTFILE.rsrc"
-INFOFILE="$OUTFILE.info"
-
-(cd "$OUTDIR" && macunpack -3 "$INFILE" || exit $?)
-cp "$DATAFORKFILE" "$OUTFILE" || exit $?
-cp "$RSRCFORKFILE" "$OUTFILE/rsrc" || exit $?
-rm -f "$DATAFORKFILE" "$RSRCFORKFILE" "$INFOFILE"
Added: users/ryandesign/minivmac-devel/files/patch-build.diff
===================================================================
--- users/ryandesign/minivmac-devel/files/patch-build.diff (rev 0)
+++ users/ryandesign/minivmac-devel/files/patch-build.diff 2009-05-26 17:28:10 UTC (rev 51490)
@@ -0,0 +1,79 @@
+--- source/build/c_src/CMDARGW1.i
++++ source/build/c_src/CMDARGW1.i
+@@ -1496,12 +1496,47 @@
+ return noErr;
+ }
+
++#define WantRealInputFile 1
++
+ #if WantRealInputFile
+ #define openOnly 1
+ #define openPrint 2
+ #endif
+
+ #if WantRealInputFile
++ProcessInputFileFSSpec(FSSpec *myFSS)
++{
++ /*Adapted from IM: Text*/
++ int dataRefNum;
++ Handle textBuffer;
++ Ptr textBufferAddr;
++ long textLength;
++
++ if (CheckSysErr(FSpOpenDF(myFSS, fsRdPerm, &dataRefNum))) {
++ if (CheckSysErr(SetFPos(dataRefNum, fsFromStart, 0))) {
++ if (CheckSysErr(GetEOF(dataRefNum, &textLength))) {
++ textBuffer = NewHandle(textLength);
++ if (CheckSysErr(MemError())) {
++ HLock(textBuffer);
++ textBufferAddr = /*StripAddress*/(*textBuffer);
++ if (CheckSysErr(FSRead(dataRefNum, &textLength, textBufferAddr))) {
++ TESetText(textBufferAddr, textLength, MyDocTE);
++ }
++ HUnlock(textBuffer);
++ DisposeHandle(textBuffer);
++ DrawWindow();
++ ParseHandle = (Handle) TEGetText(MyDocTE);
++ ParseRangeStart = 0;
++ ParseRangeStop = (*MyDocTE)->teLength;
++ GoRequested = trueblnr;
++ DoQuit();
++ }
++ }
++ }
++ CheckSysErr(FSClose(dataRefNum));
++ }
++}
++
+ static pascal OSErr OpenOrPrintFiles(const AppleEvent *theAppleEvent, AppleEvent *reply, long handlerRefcon)
+ {
+ #pragma unused(reply, handlerRefcon)
+@@ -1509,19 +1544,16 @@
+ /*Adapted from IM VI: AppleEvent Manager: Handling Required AppleEvents*/
+ AEDescList docList;
+
+-#if 0
+ FSSpec myFSS;
+ simr index;
+ simr itemsInList;
+ Size actualSize;
+ AEKeyword keywd;
+ DescType typeCode;
+-#endif
+
+ /* put the direct parameter (a list of descriptors) into docList */
+ if (CheckSysErr(AEGetParamDesc(theAppleEvent, keyDirectObject, typeAEList, &docList))) {
+ if (GotRequiredParams0(theAppleEvent)) { /* Check for missing required parameters */
+-#if 0
+ if (CheckSysErr(AECountItems(&docList, &itemsInList))) {
+ for (index = 1; index <= itemsInList; ++index) { /* Get each descriptor from the list, get the alias record, open the file, maybe print it. */
+ if (CheckSysErr(AEGetNthPtr(&docList, index, typeFSS, &keywd, &typeCode,
+@@ -1530,7 +1562,6 @@
+ }
+ }
+ }
+-#endif
+ }
+ vCheckSysErr(AEDisposeDesc(&docList));
+ }
+
Added: users/ryandesign/minivmac-devel/files/runbuild.sh
===================================================================
--- users/ryandesign/minivmac-devel/files/runbuild.sh (rev 0)
+++ users/ryandesign/minivmac-devel/files/runbuild.sh 2009-05-26 17:28:10 UTC (rev 51490)
@@ -0,0 +1,11 @@
+#!/bin/bash
+# $Id$
+
+DIR="$1"
+OPTIONS_FILE="$2"
+
+"$DIR/Build.app/Contents/MacOS/Build" &
+PID=$!
+sleep 1
+open -a "$DIR/Build.app" "$OPTIONS_FILE"
+wait $PID
Property changes on: users/ryandesign/minivmac-devel/files/runbuild.sh
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090526/47910812/attachment-0001.html>
More information about the macports-changes
mailing list