[58974] trunk/dports/emulators

ryandesign at macports.org ryandesign at macports.org
Wed Oct 7 17:28:46 PDT 2009


Revision: 58974
          http://trac.macports.org/changeset/58974
Author:   ryandesign at macports.org
Date:     2009-10-07 17:28:43 -0700 (Wed, 07 Oct 2009)
Log Message:
-----------
minivmac, minivmac-devel: Bootstrap using a Mini vMac built with the +bootstrap variant instead of the official universal binary. Ours is built with sound turned off, which is less annoying, and fixes some timing issues, because on laptops the sound hardware turns itself off when inactive, and turning it back on takes time. Ours is also built to run at full speed and in the background, fixing more timing issues and letting us remove the configure script bits which handled setting the speed. And since it's packaged as a zip, it can now be automatically extracted along with the other zip files.

Modified Paths:
--------------
    trunk/dports/emulators/minivmac/Portfile
    trunk/dports/emulators/minivmac-devel/Portfile

Added Paths:
-----------
    trunk/dports/emulators/minivmac/files/configure.applescript.in
    trunk/dports/emulators/minivmac-devel/files/configure.applescript.in

Removed Paths:
-------------
    trunk/dports/emulators/minivmac/files/configure.applescript
    trunk/dports/emulators/minivmac-devel/files/configure.applescript

Modified: trunk/dports/emulators/minivmac/Portfile
===================================================================
--- trunk/dports/emulators/minivmac/Portfile	2009-10-08 00:15:20 UTC (rev 58973)
+++ trunk/dports/emulators/minivmac/Portfile	2009-10-08 00:28:43 UTC (rev 58974)
@@ -28,12 +28,13 @@
 
 master_sites \
     sourceforge:${my_name}:minivmac \
+    macports:${my_name}:macports \
     http://download.info.apple.com/Apple_Support_Area/Apple_Software_Updates/English-North_American/Macintosh/System/Older_System/System_7.0.x/:apple
 
 distname                                    ${my_name}-${version}
 set my_src                                  ${distname}.src
 set my_src_distfile                         ${my_src}.zip
-set my_bootstrap_distfile                   ${my_name}-3.1.2-umch.bin.tgz
+set my_bootstrap_distfile                   ${my_name}-bootstrap-3.1.2_1.zip
 set my_clipin                               clipin-1.1.0
 set my_clipin_distfile                      ${my_clipin}.zip
 set my_icons                                icnsosx-1.0.0
@@ -43,13 +44,14 @@
 
 distfiles \
     ${my_src_distfile}:minivmac \
-    ${my_bootstrap_distfile}:minivmac \
+    ${my_bootstrap_distfile}:macports \
     ${my_icons_distfile}:minivmac \
     ${my_clipin_distfile}:minivmac \
     ${my_system_disk_container_distfile}:apple
 
 extract.only \
     ${my_src_distfile} \
+    ${my_bootstrap_distfile} \
     ${my_icons_distfile} \
     ${my_clipin_distfile}
 
@@ -59,9 +61,9 @@
         sha1    ff99aa72da0868a5306631f0d06ae190cbd2a03a \
         rmd160  b8f1f5269d21835ff3e9e428da12a7b6c224e60e \
     ${my_bootstrap_distfile} \
-        md5     53239cda5f1827fcc00d9254ee1ee9e0 \
-        sha1    d6c16c541d72241cabafcbb94eec7c198e8b1670 \
-        rmd160  f3925e194c59f704f6fac391609ccc72dd12c718 \
+        md5     65fa9b7fb19a24dc6c9e711387c1bc30 \
+        sha1    4ad44559e75894d45e91ae62cc7ddb420062f968 \
+        rmd160  58884cac487a537b5d00fc6093fdfecb6ccc5a2f \
     ${my_icons_distfile} \
         md5     2af006506de7549be14f94317918d59a \
         sha1    4ef79bb56b988fedfeb82a8b6cafd8066f5bbab2 \
@@ -81,7 +83,7 @@
 
 set my_app_dir          "${applications_dir}/Mini vMac"
 set my_rom_dir          "~/Library/Preferences/Gryphel/mnvm_rom"
-set my_bootstrap_app    "Mini vMac.app"
+set my_bootstrap_app    "Mini vMac Bootstrap.app"
 set my_rom_file         vMac.ROM
 set my_base_options     "-maintainer MacPorts -homepage http://www.macports.org/ -cl -eol unx -nex -im 1"
 set my_archs            {}
@@ -151,9 +153,6 @@
     file copy "${my_system_disk_container_mount}/Disk Tools.image" "${worksrcpath}/Disk Tools.dsk"
     my_detach_disk_image ${my_system_disk_container_mount}
     
-    # Extract the bootstrap version of Mini vMac.
-    my_system "tar -x -z -C ${worksrcpath} -f ${distpath}/${my_bootstrap_distfile}"
-    
     # Make the data directory, where Mini vMac looks for the files it needs.
     set my_mnvm_dat "${worksrcpath}/${my_bootstrap_app}/Contents/mnvm_dat"
     file mkdir ${my_mnvm_dat}
@@ -169,6 +168,10 @@
 }
 
 pre-configure {
+    # Set the name of the bootstrap app in the configure script.
+    xinstall -m 755 ${filespath}/configure.applescript.in ${worksrcpath}/configure.applescript
+    reinplace "s|@BOOTSTRAP_APP@|${my_bootstrap_app}|g" ${worksrcpath}/configure.applescript
+    
     # Copy the source disk image to store the output.
     # Use the .img extension so that we can mount it on Mac OS X later.
     copy -force ${worksrcpath}/${my_src}/${my_src}.dsk ${worksrcpath}/${my_src}/${my_src}.img
@@ -194,12 +197,12 @@
         }
     }
     
-    # Launch Mini vMac so the configure script can talk to it.
+    # Launch the bootstrap Mini vMac so the configure script can talk to it.
     my_system "open '${worksrcpath}/${my_bootstrap_app}'"
 }
 
 configure.cmd           osascript
-configure.pre_args      ${filespath}/configure.applescript
+configure.pre_args      ./configure.applescript
 
 build.dir               ${workpath}/variations
 

Deleted: trunk/dports/emulators/minivmac/files/configure.applescript
===================================================================
--- trunk/dports/emulators/minivmac/files/configure.applescript	2009-10-08 00:15:20 UTC (rev 58973)
+++ trunk/dports/emulators/minivmac/files/configure.applescript	2009-10-08 00:28:43 UTC (rev 58974)
@@ -1,105 +0,0 @@
--- $Id$
-
-global configuration_delay
-
-on run argv
-	set save_delims to text item delimiters of AppleScript
-	set text item delimiters of AppleScript to " "
-	set configure_args to argv as string
-	set text item delimiters of AppleScript to ";"
-	set number_of_variations to count of every text item of configure_args
-	set text item delimiters of AppleScript to save_delims
-	
-	-- Base the delay for the configuration run on the processor speed.
-	-- The multiplier was chosen based on observations of a 2.2-GHz
-	-- MacBook Pro and a 466-MHz Power Mac G4.
-	set cpu_mhz to (system attribute "pclk") / 1000000
-	set configuration_delay to 1400 * number_of_variations / cpu_mhz
-	
-	delay 2 -- wait for Mini vMac to start launching
-	
-	activate application "Mini vMac"
-	tell application "System Events"
-		tell process "Mini vMac"
-			key down control -- open Mini vMac control menu
-			my key_code(1) -- "S" -- speed submenu
-			my key_code(0) -- "A" -- as fast as possible
-			my key_code(1) -- "S" -- speed submenu
-			my key_code(11) -- "B" -- run in background too
-			key up control -- close Mini vMac control menu
-		end tell
-	end tell
-	
-	delay 2 -- wait for system software to finish starting up
-	
-	my key_code(22) -- "6" -- select the 6-ClipIn program
-	set the clipboard to configure_args -- copy the configure args to the clipboard
-	my menu_file_open() -- open ClipIn, transferring the clipboard into the emulated machine; ClipIn auto-quits
-	my menu_file_close() -- close Finder window
-	
-	my key_code(11) -- "B" -- select the Build program
-	my menu_file_open() -- open it
-	my menu_edit_paste() -- paste the clipboard contents into the window
-	my menu_file_go() -- do the build
-	my menu_file_quit() -- quit
-	my menu_file_close() -- close Finder window
-	my menu_file_put_away() -- eject the minivmac disk
-	
-	activate application "Mini vMac"
-	tell application "System Events"
-		tell process "Mini vMac"
-			key down control -- open Mini vMac control menu
-			my key_code(12) -- "Q" -- quit
-			my key_code(16) -- "Y" -- yes, really quit
-			key up control -- close Mini vMac control menu
-		end tell
-	end tell
-	
-	return "Variations: " & number_of_variations & ". CPU speed: " & (round cpu_mhz rounding up) & " MHz. Configuration delay: " & ((round configuration_delay * 100 rounding up) / 100) & " seconds."
-end run
-
-on key_code(key_code)
-	my key_code_with_modifiers(key_code, {})
-end key_code
-
--- Key codes are used instead of keystrokes because keystrokes would be
--- translated through the currently-selected Mac OS X keyboard layout
--- but the system software being used on the emulated machine is using
--- the US English keyboard layout.
-on key_code_with_modifiers(key_code, key_modifiers)
-	activate application "Mini vMac"
-	tell application "System Events"
-		tell process "Mini vMac"
-			delay 0.3
-			key code key_code using key_modifiers
-		end tell
-	end tell
-end key_code_with_modifiers
-
-on menu_file_open()
-	my key_code_with_modifiers(31, {command down}) -- "Command-O"
-	delay 0.5 -- wait for zoomrects to draw
-end menu_file_open
-
-on menu_file_close()
-	my key_code_with_modifiers(13, {command down}) -- "Command-W"
-	delay 0.5 -- wait for zoomrects to draw
-end menu_file_close
-
-on menu_file_put_away()
-	my key_code_with_modifiers(16, {command down}) -- "Command-Y"
-	delay 0.5 -- wait for zoomrects to draw
-end menu_file_put_away
-
-on menu_file_go()
-	my key_code_with_modifiers(5, {command down}) -- "Command-G"
-	delay configuration_delay -- wait for configuration to run
-end menu_file_go
-
-on menu_file_quit()
-	my key_code_with_modifiers(12, {command down}) -- "Command-Q"
-end menu_file_quit
-
-on menu_edit_paste()
-	my key_code_with_modifiers(9, {command down}) -- "Command-V"
-end menu_edit_paste

Copied: trunk/dports/emulators/minivmac/files/configure.applescript.in (from rev 58957, trunk/dports/emulators/minivmac/files/configure.applescript)
===================================================================
--- trunk/dports/emulators/minivmac/files/configure.applescript.in	                        (rev 0)
+++ trunk/dports/emulators/minivmac/files/configure.applescript.in	2009-10-08 00:28:43 UTC (rev 58974)
@@ -0,0 +1,91 @@
+-- $Id$
+
+global configuration_delay
+
+on run argv
+	set save_delims to text item delimiters of AppleScript
+	set text item delimiters of AppleScript to " "
+	set configure_args to argv as string
+	set text item delimiters of AppleScript to ";"
+	set number_of_variations to count of every text item of configure_args
+	set text item delimiters of AppleScript to save_delims
+	
+	-- Base the delay for the configuration run on the processor speed.
+	-- The multiplier was chosen based on observations of a 2.2-GHz
+	-- MacBook Pro and a 466-MHz Power Mac G4.
+	set cpu_mhz to (system attribute "pclk") / 1000000
+	set configuration_delay to 1400 * number_of_variations / cpu_mhz
+	
+	delay 3 -- wait 1 second for each disk image Mini vMac needs to mount
+	
+	my key_code(22) -- "6" -- select the 6-ClipIn program
+	set the clipboard to configure_args -- copy the configure args to the clipboard
+	my menu_file_open() -- open ClipIn, transferring the clipboard into the emulated machine; ClipIn auto-quits
+	my menu_file_close() -- close Finder window
+	
+	my key_code(11) -- "B" -- select the Build program
+	my menu_file_open() -- open it
+	my menu_edit_paste() -- paste the clipboard contents into the window
+	my menu_file_go() -- do the build
+	my menu_file_quit() -- quit
+	my menu_file_close() -- close Finder window
+	my menu_file_put_away() -- eject the minivmac disk
+	
+	activate application "@BOOTSTRAP_APP@"
+	tell application "System Events"
+		tell process "Mini vMac"
+			key down control -- open Mini vMac control menu
+			my key_code(12) -- "Q" -- quit
+			my key_code(16) -- "Y" -- yes, really quit
+			key up control -- close Mini vMac control menu
+		end tell
+	end tell
+	
+	return "Variations: " & number_of_variations & ". CPU speed: " & (round cpu_mhz rounding up) & " MHz. Configuration delay: " & ((round configuration_delay * 100 rounding up) / 100) & " seconds."
+end run
+
+on key_code(key_code)
+	my key_code_with_modifiers(key_code, {})
+end key_code
+
+-- Key codes are used instead of keystrokes because keystrokes would be
+-- translated through the currently-selected Mac OS X keyboard layout
+-- but the system software being used on the emulated machine is using
+-- the US English keyboard layout.
+on key_code_with_modifiers(key_code, key_modifiers)
+	activate application "@BOOTSTRAP_APP@"
+	tell application "System Events"
+		tell process "Mini vMac"
+			delay 0.3
+			key code key_code using key_modifiers
+		end tell
+	end tell
+end key_code_with_modifiers
+
+on menu_file_open()
+	my key_code_with_modifiers(31, {command down}) -- "Command-O"
+	delay 0.5 -- wait for zoomrects to draw
+end menu_file_open
+
+on menu_file_close()
+	my key_code_with_modifiers(13, {command down}) -- "Command-W"
+	delay 0.5 -- wait for zoomrects to draw
+end menu_file_close
+
+on menu_file_put_away()
+	my key_code_with_modifiers(16, {command down}) -- "Command-Y"
+	delay 0.5 -- wait for zoomrects to draw
+end menu_file_put_away
+
+on menu_file_go()
+	my key_code_with_modifiers(5, {command down}) -- "Command-G"
+	delay configuration_delay -- wait for configuration to run
+end menu_file_go
+
+on menu_file_quit()
+	my key_code_with_modifiers(12, {command down}) -- "Command-Q"
+end menu_file_quit
+
+on menu_edit_paste()
+	my key_code_with_modifiers(9, {command down}) -- "Command-V"
+end menu_edit_paste

Modified: trunk/dports/emulators/minivmac-devel/Portfile
===================================================================
--- trunk/dports/emulators/minivmac-devel/Portfile	2009-10-08 00:15:20 UTC (rev 58973)
+++ trunk/dports/emulators/minivmac-devel/Portfile	2009-10-08 00:28:43 UTC (rev 58974)
@@ -28,12 +28,13 @@
 
 master_sites \
     sourceforge:${my_name}:minivmac \
+    macports:${my_name}:macports \
     http://download.info.apple.com/Apple_Support_Area/Apple_Software_Updates/English-North_American/Macintosh/System/Older_System/System_7.0.x/:apple
 
 distname                                    ${my_name}-${version}
 set my_src                                  ${distname}.src
 set my_src_distfile                         ${my_src}.zip
-set my_bootstrap_distfile                   ${my_name}-3.1.2-umch.bin.tgz
+set my_bootstrap_distfile                   ${my_name}-bootstrap-3.1.2_1.zip
 set my_blanks                               blanks
 set my_blanks_distfile                      ${my_blanks}-0.2.0.zip
 set my_clipin                               clipin-1.1.0
@@ -45,7 +46,7 @@
 
 distfiles \
     ${my_src_distfile}:minivmac \
-    ${my_bootstrap_distfile}:minivmac \
+    ${my_bootstrap_distfile}:macports \
     ${my_icons_distfile}:minivmac \
     ${my_clipin_distfile}:minivmac \
     ${my_blanks_distfile}:minivmac \
@@ -53,6 +54,7 @@
 
 extract.only \
     ${my_src_distfile} \
+    ${my_bootstrap_distfile} \
     ${my_icons_distfile} \
     ${my_blanks_distfile} \
     ${my_clipin_distfile}
@@ -63,9 +65,9 @@
         sha1    b395715983ba651b96ef941e27b0f5e18f624aea \
         rmd160  186d2672bf3d67f9bf61b0960a157fa36a616f4c \
     ${my_bootstrap_distfile} \
-        md5     53239cda5f1827fcc00d9254ee1ee9e0 \
-        sha1    d6c16c541d72241cabafcbb94eec7c198e8b1670 \
-        rmd160  f3925e194c59f704f6fac391609ccc72dd12c718 \
+        md5     65fa9b7fb19a24dc6c9e711387c1bc30 \
+        sha1    4ad44559e75894d45e91ae62cc7ddb420062f968 \
+        rmd160  58884cac487a537b5d00fc6093fdfecb6ccc5a2f \
     ${my_icons_distfile} \
         md5     2af006506de7549be14f94317918d59a \
         sha1    4ef79bb56b988fedfeb82a8b6cafd8066f5bbab2 \
@@ -90,7 +92,7 @@
 
 set my_app_dir          "${applications_dir}/Mini vMac"
 set my_rom_dir          "~/Library/Preferences/Gryphel/mnvm_rom"
-set my_bootstrap_app    "Mini vMac.app"
+set my_bootstrap_app    "Mini vMac Bootstrap.app"
 set my_rom_file         vMac.ROM
 set my_base_options     "-maintainer MacPorts -homepage http://www.macports.org/ -cl -eol unx -nex"
 set my_archs            {}
@@ -175,9 +177,6 @@
     # Get a large empty disk image to store the output.
     my_system "unzip -q ${worksrcpath}/${my_blanks}/hfs24M.zip -d ${worksrcpath}"
     
-    # Extract the bootstrap version of Mini vMac.
-    my_system "tar -x -z -C ${worksrcpath} -f ${distpath}/${my_bootstrap_distfile}"
-    
     # Make the data directory, where Mini vMac looks for the files it needs.
     set my_mnvm_dat "${worksrcpath}/${my_bootstrap_app}/Contents/mnvm_dat"
     file mkdir ${my_mnvm_dat}
@@ -194,6 +193,10 @@
 }
 
 pre-configure {
+    # Set the name of the bootstrap app in the configure script.
+    xinstall -m 755 ${filespath}/configure.applescript.in ${worksrcpath}/configure.applescript
+    reinplace "s|@BOOTSTRAP_APP@|${my_bootstrap_app}|g" ${worksrcpath}/configure.applescript
+    
     # Copy the large blank disk image to store the output.
     # Use the .img extension so that we can mount it on Mac OS X later.
     copy -force ${worksrcpath}/hfs24M.DSK ${worksrcpath}/output.img
@@ -219,12 +222,12 @@
         }
     }
     
-    # Launch Mini vMac so the configure script can talk to it.
+    # Launch the bootstrap Mini vMac so the configure script can talk to it.
     my_system "open '${worksrcpath}/${my_bootstrap_app}'"
 }
 
 configure.cmd           osascript
-configure.pre_args      ${filespath}/configure.applescript
+configure.pre_args      ./configure.applescript
 
 build.dir               ${workpath}/variations
 

Deleted: trunk/dports/emulators/minivmac-devel/files/configure.applescript
===================================================================
--- trunk/dports/emulators/minivmac-devel/files/configure.applescript	2009-10-08 00:15:20 UTC (rev 58973)
+++ trunk/dports/emulators/minivmac-devel/files/configure.applescript	2009-10-08 00:28:43 UTC (rev 58974)
@@ -1,107 +0,0 @@
--- $Id$
-
-global configuration_delay
-
-on run argv
-	set save_delims to text item delimiters of AppleScript
-	set text item delimiters of AppleScript to " "
-	set configure_args to argv as string
-	set text item delimiters of AppleScript to ";"
-	set number_of_variations to count of every text item of configure_args
-	set text item delimiters of AppleScript to save_delims
-	
-	-- Base the delay for the configuration run on the processor speed.
-	-- The multiplier was chosen based on observations of a 2.2-GHz
-	-- MacBook Pro and a 466-MHz Power Mac G4.
-	set cpu_mhz to (system attribute "pclk") / 1000000
-	set configuration_delay to 1400 * number_of_variations / cpu_mhz
-	
-	delay 2 -- wait for Mini vMac to start launching
-	
-	activate application "Mini vMac"
-	tell application "System Events"
-		tell process "Mini vMac"
-			key down control -- open Mini vMac control menu
-			my key_code(1) -- "S" -- speed submenu
-			my key_code(0) -- "A" -- as fast as possible
-			my key_code(1) -- "S" -- speed submenu
-			my key_code(11) -- "B" -- run in background too
-			key up control -- close Mini vMac control menu
-		end tell
-	end tell
-	
-	delay 2 -- wait for system software to finish starting up
-	
-	my key_code(22) -- "6" -- select the 6-ClipIn program
-	set the clipboard to configure_args -- copy the configure args to the clipboard
-	my menu_file_open() -- open ClipIn, transferring the clipboard into the emulated machine; ClipIn auto-quits
-	my menu_file_close() -- close Finder window
-	
-	my key_code(11) -- "B" -- select the Build program
-	my menu_file_open() -- open it
-	my menu_edit_paste() -- paste the clipboard contents into the window
-	my menu_file_go() -- do the build
-	my menu_file_quit() -- quit
-	my menu_file_close() -- close Finder window
-	
-	my key_code(32) -- "U" -- select the untitled output disk
-	my menu_file_put_away() -- eject the output disk
-	
-	activate application "Mini vMac"
-	tell application "System Events"
-		tell process "Mini vMac"
-			key down control -- open Mini vMac control menu
-			my key_code(12) -- "Q" -- quit
-			my key_code(16) -- "Y" -- yes, really quit
-			key up control -- close Mini vMac control menu
-		end tell
-	end tell
-	
-	return "Variations: " & number_of_variations & ". CPU speed: " & (round cpu_mhz rounding up) & " MHz. Configuration delay: " & ((round configuration_delay * 100 rounding up) / 100) & " seconds."
-end run
-
-on key_code(key_code)
-	my key_code_with_modifiers(key_code, {})
-end key_code
-
--- Key codes are used instead of keystrokes because keystrokes would be
--- translated through the currently-selected Mac OS X keyboard layout
--- but the system software being used on the emulated machine is using
--- the US English keyboard layout.
-on key_code_with_modifiers(key_code, key_modifiers)
-	activate application "Mini vMac"
-	tell application "System Events"
-		tell process "Mini vMac"
-			delay 0.3
-			key code key_code using key_modifiers
-		end tell
-	end tell
-end key_code_with_modifiers
-
-on menu_file_open()
-	my key_code_with_modifiers(31, {command down}) -- "Command-O"
-	delay 0.5 -- wait for zoomrects to draw
-end menu_file_open
-
-on menu_file_close()
-	my key_code_with_modifiers(13, {command down}) -- "Command-W"
-	delay 0.5 -- wait for zoomrects to draw
-end menu_file_close
-
-on menu_file_put_away()
-	my key_code_with_modifiers(16, {command down}) -- "Command-Y"
-	delay 0.5 -- wait for zoomrects to draw
-end menu_file_put_away
-
-on menu_file_go()
-	my key_code_with_modifiers(5, {command down}) -- "Command-G"
-	delay configuration_delay -- wait for configuration to run
-end menu_file_go
-
-on menu_file_quit()
-	my key_code_with_modifiers(12, {command down}) -- "Command-Q"
-end menu_file_quit
-
-on menu_edit_paste()
-	my key_code_with_modifiers(9, {command down}) -- "Command-V"
-end menu_edit_paste

Copied: trunk/dports/emulators/minivmac-devel/files/configure.applescript.in (from rev 58957, trunk/dports/emulators/minivmac-devel/files/configure.applescript)
===================================================================
--- trunk/dports/emulators/minivmac-devel/files/configure.applescript.in	                        (rev 0)
+++ trunk/dports/emulators/minivmac-devel/files/configure.applescript.in	2009-10-08 00:28:43 UTC (rev 58974)
@@ -0,0 +1,93 @@
+-- $Id$
+
+global configuration_delay
+
+on run argv
+	set save_delims to text item delimiters of AppleScript
+	set text item delimiters of AppleScript to " "
+	set configure_args to argv as string
+	set text item delimiters of AppleScript to ";"
+	set number_of_variations to count of every text item of configure_args
+	set text item delimiters of AppleScript to save_delims
+	
+	-- Base the delay for the configuration run on the processor speed.
+	-- The multiplier was chosen based on observations of a 2.2-GHz
+	-- MacBook Pro and a 466-MHz Power Mac G4.
+	set cpu_mhz to (system attribute "pclk") / 1000000
+	set configuration_delay to 1400 * number_of_variations / cpu_mhz
+	
+	delay 4 -- wait 1 second for each disk image Mini vMac needs to mount
+	
+	my key_code(22) -- "6" -- select the 6-ClipIn program
+	set the clipboard to configure_args -- copy the configure args to the clipboard
+	my menu_file_open() -- open ClipIn, transferring the clipboard into the emulated machine; ClipIn auto-quits
+	my menu_file_close() -- close Finder window
+	
+	my key_code(11) -- "B" -- select the Build program
+	my menu_file_open() -- open it
+	my menu_edit_paste() -- paste the clipboard contents into the window
+	my menu_file_go() -- do the build
+	my menu_file_quit() -- quit
+	my menu_file_close() -- close Finder window
+	
+	my key_code(32) -- "U" -- select the untitled output disk
+	my menu_file_put_away() -- eject the output disk
+	
+	activate application "@BOOTSTRAP_APP@"
+	tell application "System Events"
+		tell process "Mini vMac"
+			key down control -- open Mini vMac control menu
+			my key_code(12) -- "Q" -- quit
+			my key_code(16) -- "Y" -- yes, really quit
+			key up control -- close Mini vMac control menu
+		end tell
+	end tell
+	
+	return "Variations: " & number_of_variations & ". CPU speed: " & (round cpu_mhz rounding up) & " MHz. Configuration delay: " & ((round configuration_delay * 100 rounding up) / 100) & " seconds."
+end run
+
+on key_code(key_code)
+	my key_code_with_modifiers(key_code, {})
+end key_code
+
+-- Key codes are used instead of keystrokes because keystrokes would be
+-- translated through the currently-selected Mac OS X keyboard layout
+-- but the system software being used on the emulated machine is using
+-- the US English keyboard layout.
+on key_code_with_modifiers(key_code, key_modifiers)
+	activate application "@BOOTSTRAP_APP@"
+	tell application "System Events"
+		tell process "Mini vMac"
+			delay 0.3
+			key code key_code using key_modifiers
+		end tell
+	end tell
+end key_code_with_modifiers
+
+on menu_file_open()
+	my key_code_with_modifiers(31, {command down}) -- "Command-O"
+	delay 0.5 -- wait for zoomrects to draw
+end menu_file_open
+
+on menu_file_close()
+	my key_code_with_modifiers(13, {command down}) -- "Command-W"
+	delay 0.5 -- wait for zoomrects to draw
+end menu_file_close
+
+on menu_file_put_away()
+	my key_code_with_modifiers(16, {command down}) -- "Command-Y"
+	delay 0.5 -- wait for zoomrects to draw
+end menu_file_put_away
+
+on menu_file_go()
+	my key_code_with_modifiers(5, {command down}) -- "Command-G"
+	delay configuration_delay -- wait for configuration to run
+end menu_file_go
+
+on menu_file_quit()
+	my key_code_with_modifiers(12, {command down}) -- "Command-Q"
+end menu_file_quit
+
+on menu_edit_paste()
+	my key_code_with_modifiers(9, {command down}) -- "Command-V"
+end menu_edit_paste
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20091007/3e2e76a4/attachment-0001.html>


More information about the macports-changes mailing list