[106242] trunk/dports/emulators
ryandesign at macports.org
ryandesign at macports.org
Mon May 20 05:12:42 PDT 2013
Revision: 106242
https://trac.macports.org/changeset/106242
Author: ryandesign at macports.org
Date: 2013-05-20 05:12:42 -0700 (Mon, 20 May 2013)
Log Message:
-----------
minivmac, minivmac-devel: instead of transferring the configure args from MacPorts to the emulated system using the clipboard (which hasn't worked ever since the gsoc08-privileges branch was merged in), use a binary diff to install a fixed-size (8K) placeholder "configure.args" file on the output disk image, then use reinplace to put the real configure args into the file before launching the emulator. This removes the need to download and use the ClipIn program, and avoids clobbering the user's clipboard, but necessitates the extraction and use of the Tidbits disk image to get the TeachText program to read the file.
Modified Paths:
--------------
trunk/dports/emulators/minivmac/Portfile
trunk/dports/emulators/minivmac/files/configure.applescript.in
trunk/dports/emulators/minivmac-devel/Portfile
trunk/dports/emulators/minivmac-devel/files/configure.applescript.in
Added Paths:
-----------
trunk/dports/emulators/minivmac/files/patch-hfs24M.DSK.bsdiff
trunk/dports/emulators/minivmac-devel/files/patch-hfs24M.DSK.bsdiff
Modified: trunk/dports/emulators/minivmac/Portfile
===================================================================
--- trunk/dports/emulators/minivmac/Portfile 2013-05-20 11:54:05 UTC (rev 106241)
+++ trunk/dports/emulators/minivmac/Portfile 2013-05-20 12:12:42 UTC (rev 106242)
@@ -38,8 +38,6 @@
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
-set my_clipin_distfile ${my_clipin}.zip
set my_icons icnsosx-1.0.0
set my_icons_distfile ${my_icons}.zip
set my_system_disk_container System_7.0.1.smi
@@ -48,15 +46,13 @@
distfiles ${my_src_distfile}:minivmacsource \
${my_bootstrap_distfile}:macports \
${my_icons_distfile}:minivmacextras6 \
- ${my_clipin_distfile}:minivmacextras6 \
${my_blanks_distfile}:minivmacblanks \
${my_system_disk_container_distfile}:apple
extract.only ${my_src_distfile} \
${my_bootstrap_distfile} \
${my_icons_distfile} \
- ${my_blanks_distfile} \
- ${my_clipin_distfile}
+ ${my_blanks_distfile}
checksums ${my_src_distfile} \
md5 5243ae167cc00920e03b4abca2b40af5 \
@@ -70,10 +66,6 @@
md5 2af006506de7549be14f94317918d59a \
sha1 4ef79bb56b988fedfeb82a8b6cafd8066f5bbab2 \
rmd160 cef6d7d7578464538d0042b0d98379ae7f18fab7 \
- ${my_clipin_distfile} \
- md5 e094de97d1c6c214a80fb74895124c3e \
- sha1 725f622ad6681c77e7f9f4a64d05ac1d6a103beb \
- rmd160 5699b56c8db62b2568c8de88b6d419180b1fb73d \
${my_blanks_distfile} \
md5 b16321d0d78048d5ec9b635f4f86b19c \
sha1 9b8d7e77bd05633709907f8806d976279d7a20b7 \
@@ -170,12 +162,12 @@
# The images on the container image. Images we don't need are commented out for future reference.
set my_images {
{Disk Tools.image} 233472 eb1979132c843560ebab490faeb7520d9a94757ecef3121a21abace8d3ae63ff
+ {Tidbits.image} 7611392 3e3600bed1b5c7c595bc176b5eaadcc8c1517032489efc548b9b781c0ee1f062
}
# {Fonts.image} 1709056 8b06f086a96b75bd23b16ae018bd334696239cb56e65bfa20166ea00d14cdef0
# {Install 1.image} 3184640 8c3ea898eeb88b795041108cd8a09bf4ebdf920d7d4763e4419df14713dbd952
# {Install 2.image} 4660224 0fc558475df55f3aed217d2eceebfa29e4a465a795807cd627b258740a9ec55b
# {Printing.image} 6135808 246cbf69ad1c2e588ee482fddec781135a67fbfe02734bb0f732eb055faa15fa
-# {Tidbits.image} 7611392 3e3600bed1b5c7c595bc176b5eaadcc8c1517032489efc548b9b781c0ee1f062
# Extract the disk images from the system disk container image. `hdiutil` on OS X 10.8 Mountain Lion
# does not mount this disk image correctly, so extract the files manually using `dd`.
@@ -203,15 +195,21 @@
# Symlink the disk images into the data directory with sequentially-numbered
# names so Mini vMac will find them and automatically mount them.
ln -s "${worksrcpath}/Disk Tools.image" "${my_mnvm_dat}/disk1.dsk"
- ln -s ${worksrcpath}/output.img "${my_mnvm_dat}/disk2.dsk"
+ ln -s ${worksrcpath}/Tidbits.image "${my_mnvm_dat}/disk2.dsk"
ln -s ${worksrcpath}/${my_src}/${my_src}.dsk "${my_mnvm_dat}/disk3.dsk"
- ln -s ${worksrcpath}/${my_clipin}/${my_clipin}.dsk "${my_mnvm_dat}/disk4.dsk"
+ ln -s ${worksrcpath}/output.img "${my_mnvm_dat}/disk4.dsk"
}
post-patch {
# Place an alias of the output disk at System Folder:Preferences:Gryphel:Build:output.
system -W ${worksrcpath} "${prefix}/bin/bspatch 'Disk Tools.image' 'Disk Tools.image.tmp' '${filespath}/patch-Disk Tools.image.bsdiff'"
move -force "${worksrcpath}/Disk Tools.image.tmp" "${worksrcpath}/Disk Tools.image"
+
+ # Place an 8192-byte TeachText file called "configure.args" (containing "@START@",
+ # 8180 spaces, and "@END@") onto the root of the output disk and set the disk's
+ # window to open when the disk is mounted.
+ system -W ${worksrcpath} "${prefix}/bin/bspatch hfs24M.DSK hfs24M.DSK.tmp '${filespath}/patch-hfs24M.DSK.bsdiff'"
+ move -force ${worksrcpath}/hfs24M.DSK.tmp ${worksrcpath}/hfs24M.DSK
}
pre-configure {
@@ -233,9 +231,9 @@
set my_target [my_arch_to_target ${my_arch}]
foreach {my_machine my_variation_options} ${my_variations} {
if {${i} > 0} {
- configure.args-append {\;}
+ lappend configure_args \;
}
- configure.args-append \
+ lappend configure_args \
${my_base_options} \
-t ${my_target} \
${my_variation_options} \
@@ -244,7 +242,19 @@
}
}
- # Launch the bootstrap Mini vMac so the configure script can talk to it.
+ # Write the configure args into the configure.args file on the output disk image.
+ set max_configure_args_length 8192
+ set padded_args [format "%-${max_configure_args_length}s" [join ${configure_args}]]
+ if {[string length ${padded_args}] > ${max_configure_args_length}} {
+ return -code error "configure args too long"
+ }
+ reinplace -locale C "s|@START@ *@END@|${padded_args}|" ${worksrcpath}/output.img
+
+ # Set the real configure.args that get passed to the AppleScript to the number
+ # of variations being assembled, so that it knows how long to wait.
+ configure.args ${i}
+
+ # Launch the bootstrap Mini vMac so the configure AppleScript can talk to it.
global my_bootstrap_pid
if {[catch {exec "${worksrcpath}/${my_bootstrap_app}/Contents/MacOS/minivmac" &} my_bootstrap_pid]} {
return -code error "couldn't launch bootstrap"
Modified: trunk/dports/emulators/minivmac/files/configure.applescript.in
===================================================================
--- trunk/dports/emulators/minivmac/files/configure.applescript.in 2013-05-20 11:54:05 UTC (rev 106241)
+++ trunk/dports/emulators/minivmac/files/configure.applescript.in 2013-05-20 12:12:42 UTC (rev 106242)
@@ -3,12 +3,7 @@
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
+ set number_of_variations to item 1 of argv
-- Base the delay for the configuration run on the processor speed.
-- The multiplier was chosen based on observations of a 2.2-GHz
@@ -18,14 +13,16 @@
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 key_code(8) -- "C" -- select the configure.args file
+ my menu_file_open() -- open it
+ my menu_edit_select_all() -- select its contents
+ my menu_edit_copy() -- copy it
+ my menu_file_quit() -- quit
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_edit_paste() -- paste the configure args into the window
my menu_file_go() -- do the build
my menu_file_quit() -- quit
my menu_file_close() -- close Finder window
@@ -78,6 +75,14 @@
my key_code_with_modifiers(12, {command down}) -- "Command-Q"
end menu_file_quit
+on menu_edit_copy()
+ my key_code_with_modifiers(8, {command down}) -- "Command-C"
+end menu_edit_copy
+
on menu_edit_paste()
my key_code_with_modifiers(9, {command down}) -- "Command-V"
end menu_edit_paste
+
+on menu_edit_select_all()
+ my key_code_with_modifiers(0, {command down}) -- "Command-A"
+end menu_edit_select_all
Added: trunk/dports/emulators/minivmac/files/patch-hfs24M.DSK.bsdiff
===================================================================
(Binary files differ)
Property changes on: trunk/dports/emulators/minivmac/files/patch-hfs24M.DSK.bsdiff
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: trunk/dports/emulators/minivmac-devel/Portfile
===================================================================
--- trunk/dports/emulators/minivmac-devel/Portfile 2013-05-20 11:54:05 UTC (rev 106241)
+++ trunk/dports/emulators/minivmac-devel/Portfile 2013-05-20 12:12:42 UTC (rev 106242)
@@ -46,8 +46,6 @@
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
-set my_clipin_distfile ${my_clipin}.zip
set my_icons icnsosx-1.0.0
set my_icons_distfile ${my_icons}.zip
set my_system_disk_container System_7.0.1.smi
@@ -56,15 +54,13 @@
distfiles ${my_src_distfile}:minivmacsource \
${my_bootstrap_distfile}:macports \
${my_icons_distfile}:minivmacextras6 \
- ${my_clipin_distfile}:minivmacextras6 \
${my_blanks_distfile}:minivmacblanks \
${my_system_disk_container_distfile}:apple
extract.only ${my_src_distfile} \
${my_bootstrap_distfile} \
${my_icons_distfile} \
- ${my_blanks_distfile} \
- ${my_clipin_distfile}
+ ${my_blanks_distfile}
checksums ${my_src_distfile} \
md5 0a6a38ca6bcd42fdfa100a7c0fe276b7 \
@@ -78,10 +74,6 @@
md5 2af006506de7549be14f94317918d59a \
sha1 4ef79bb56b988fedfeb82a8b6cafd8066f5bbab2 \
rmd160 cef6d7d7578464538d0042b0d98379ae7f18fab7 \
- ${my_clipin_distfile} \
- md5 e094de97d1c6c214a80fb74895124c3e \
- sha1 725f622ad6681c77e7f9f4a64d05ac1d6a103beb \
- rmd160 5699b56c8db62b2568c8de88b6d419180b1fb73d \
${my_blanks_distfile} \
md5 b16321d0d78048d5ec9b635f4f86b19c \
sha1 9b8d7e77bd05633709907f8806d976279d7a20b7 \
@@ -178,12 +170,12 @@
# The images on the container image. Images we don't need are commented out for future reference.
set my_images {
{Disk Tools.image} 233472 eb1979132c843560ebab490faeb7520d9a94757ecef3121a21abace8d3ae63ff
+ {Tidbits.image} 7611392 3e3600bed1b5c7c595bc176b5eaadcc8c1517032489efc548b9b781c0ee1f062
}
# {Fonts.image} 1709056 8b06f086a96b75bd23b16ae018bd334696239cb56e65bfa20166ea00d14cdef0
# {Install 1.image} 3184640 8c3ea898eeb88b795041108cd8a09bf4ebdf920d7d4763e4419df14713dbd952
# {Install 2.image} 4660224 0fc558475df55f3aed217d2eceebfa29e4a465a795807cd627b258740a9ec55b
# {Printing.image} 6135808 246cbf69ad1c2e588ee482fddec781135a67fbfe02734bb0f732eb055faa15fa
-# {Tidbits.image} 7611392 3e3600bed1b5c7c595bc176b5eaadcc8c1517032489efc548b9b781c0ee1f062
# Extract the disk images from the system disk container image. `hdiutil` on OS X 10.8 Mountain Lion
# does not mount this disk image correctly, so extract the files manually using `dd`.
@@ -211,15 +203,21 @@
# Symlink the disk images into the data directory with sequentially-numbered
# names so Mini vMac will find them and automatically mount them.
ln -s "${worksrcpath}/Disk Tools.image" "${my_mnvm_dat}/disk1.dsk"
- ln -s ${worksrcpath}/output.img "${my_mnvm_dat}/disk2.dsk"
+ ln -s ${worksrcpath}/Tidbits.image "${my_mnvm_dat}/disk2.dsk"
ln -s ${worksrcpath}/${my_src}/${my_src}.dsk "${my_mnvm_dat}/disk3.dsk"
- ln -s ${worksrcpath}/${my_clipin}/${my_clipin}.dsk "${my_mnvm_dat}/disk4.dsk"
+ ln -s ${worksrcpath}/output.img "${my_mnvm_dat}/disk4.dsk"
}
post-patch {
# Place an alias of the output disk at System Folder:Preferences:Gryphel:Build:output.
system -W ${worksrcpath} "${prefix}/bin/bspatch 'Disk Tools.image' 'Disk Tools.image.tmp' '${filespath}/patch-Disk Tools.image.bsdiff'"
move -force "${worksrcpath}/Disk Tools.image.tmp" "${worksrcpath}/Disk Tools.image"
+
+ # Place an 8192-byte TeachText file called "configure.args" (containing "@START@",
+ # 8180 spaces, and "@END@") onto the root of the output disk and set the disk's
+ # window to open when the disk is mounted.
+ system -W ${worksrcpath} "${prefix}/bin/bspatch hfs24M.DSK hfs24M.DSK.tmp '${filespath}/patch-hfs24M.DSK.bsdiff'"
+ move -force ${worksrcpath}/hfs24M.DSK.tmp ${worksrcpath}/hfs24M.DSK
}
pre-configure {
@@ -241,9 +239,9 @@
set my_target [my_arch_to_target ${my_arch}]
foreach {my_machine my_variation_options} ${my_variations} {
if {${i} > 0} {
- configure.args-append {\;}
+ lappend configure_args \;
}
- configure.args-append \
+ lappend configure_args \
${my_base_options} \
-t ${my_target} \
${my_variation_options} \
@@ -252,7 +250,19 @@
}
}
- # Launch the bootstrap Mini vMac so the configure script can talk to it.
+ # Write the configure args into the configure.args file on the output disk image.
+ set max_configure_args_length 8192
+ set padded_args [format "%-${max_configure_args_length}s" [join ${configure_args}]]
+ if {[string length ${padded_args}] > ${max_configure_args_length}} {
+ return -code error "configure args too long"
+ }
+ reinplace -locale C "s|@START@ *@END@|${padded_args}|" ${worksrcpath}/output.img
+
+ # Set the real configure.args that get passed to the AppleScript to the number
+ # of variations being assembled, so that it knows how long to wait.
+ configure.args ${i}
+
+ # Launch the bootstrap Mini vMac so the configure AppleScript can talk to it.
global my_bootstrap_pid
if {[catch {exec "${worksrcpath}/${my_bootstrap_app}/Contents/MacOS/minivmac" &} my_bootstrap_pid]} {
return -code error "couldn't launch bootstrap"
Modified: trunk/dports/emulators/minivmac-devel/files/configure.applescript.in
===================================================================
--- trunk/dports/emulators/minivmac-devel/files/configure.applescript.in 2013-05-20 11:54:05 UTC (rev 106241)
+++ trunk/dports/emulators/minivmac-devel/files/configure.applescript.in 2013-05-20 12:12:42 UTC (rev 106242)
@@ -3,12 +3,7 @@
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
+ set number_of_variations to item 1 of argv
-- Base the delay for the configuration run on the processor speed.
-- The multiplier was chosen based on observations of a 2.2-GHz
@@ -18,14 +13,16 @@
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 key_code(8) -- "C" -- select the configure.args file
+ my menu_file_open() -- open it
+ my menu_edit_select_all() -- select its contents
+ my menu_edit_copy() -- copy it
+ my menu_file_quit() -- quit
my menu_file_close() -- close Finder window
my key_code(46) -- "M" -- select the MnvM_bld program
my menu_file_open() -- open it
- my menu_edit_paste() -- paste the clipboard contents into the window
+ my menu_edit_paste() -- paste the configure args into the window
my menu_file_go() -- do the build
my menu_file_quit() -- quit
my menu_file_close() -- close Finder window
@@ -78,6 +75,14 @@
my key_code_with_modifiers(12, {command down}) -- "Command-Q"
end menu_file_quit
+on menu_edit_copy()
+ my key_code_with_modifiers(8, {command down}) -- "Command-C"
+end menu_edit_copy
+
on menu_edit_paste()
my key_code_with_modifiers(9, {command down}) -- "Command-V"
end menu_edit_paste
+
+on menu_edit_select_all()
+ my key_code_with_modifiers(0, {command down}) -- "Command-A"
+end menu_edit_select_all
Added: trunk/dports/emulators/minivmac-devel/files/patch-hfs24M.DSK.bsdiff
===================================================================
(Binary files differ)
Property changes on: trunk/dports/emulators/minivmac-devel/files/patch-hfs24M.DSK.bsdiff
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130520/474943ff/attachment.html>
More information about the macports-changes
mailing list