source: users/ryandesign/minivmac/Portfile @ 36753

Last change on this file since 36753 was 36753, checked in by ryandesign@…, 9 years ago

minivmac: Mini vMac 3 has an entirely new configuration system which can only be run within Mini vMac 3 or greater... So now we download a bootstrap universal binary of Mini vMac and System 7.0.1 in addition to the Mini vMac source, add procedures for dealing with disk images, put everything where we want it in the extract phase, and open the Mini vMac bootstrap in the configure phase. Note that while the vMac.ROM file was previously only required to run Mini vMac, now it's also required to configure it.

This is not yet a complete solution; more commits to come.

The extra script files this revision necessitates were added in r36754.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 6.7 KB
Line 
1# $Id: Portfile 36753 2008-05-14 07:41:52Z ryandesign@macports.org $
2
3PortSystem          1.0
4
5name                minivmac
6version             3.0.4
7categories          emulators aqua
8maintainers         ryandesign
9homepage            http://minivmac.sourceforge.net/
10use_zip             yes
11platforms           macosx
12universal_variant   no
13
14description \
15        a Mac 128K, Mac 512K, Mac 512KE, Mac Plus and Mac SE emulator
16
17long_description \
18        Mini vMac is a Macintosh emulator. It emulates the earliest Macs, \
19        from the original Mac 128K (built 1984-85) to the Mac SE (1987-1990). \
20        The default is to emulate a Mac Plus (1986-1990)\; this is also \
21        the best-tested and therefore recommended emulation.
22
23master_sites \
24        sourceforge:${name}:minivmac \
25        http://download.info.apple.com/Apple_Support_Area/Apple_Software_Updates/English-International/Macintosh/System/Full_Installs/:apple
26
27set my_src                                  ${distname}.src
28set my_src_compressed                       ${my_src}.zip
29set my_bootstrap_version                    3.0.4
30set my_bootstrap                            "Mini vMac.app"
31set my_bootstrap_compressed                 ${name}-${my_bootstrap_version}-umch.bin.tgz
32set my_autoquit_compressed                  autquit7-1.1.0.zip
33set my_system_disk_container                Z-System_7.0.1.smi
34set my_system_disk_container_compressed     ${my_system_disk_container}.bin
35
36distfiles \
37        ${my_src_compressed}:minivmac \
38        ${my_autoquit_compressed}:minivmac \
39        ${my_system_disk_container_compressed}:apple
40
41extract.only \
42        ${my_src_compressed} \
43        ${my_autoquit_compressed}
44
45checksums \
46        ${my_src_compressed} \
47                md5 ab308459e98bd5103ad8bbb7dd158eb6 \
48                sha1 ff99aa72da0868a5306631f0d06ae190cbd2a03a \
49                rmd160 b8f1f5269d21835ff3e9e428da12a7b6c224e60e \
50        ${my_bootstrap_compressed} \
51                md5 298565ec1ccfe6876768156aaf5f76a0 \
52                sha1 34212dedb1cfb744e6ca8124693f2f6e40094833 \
53                rmd160 042eacfb9ec853589d661c86ffb99d509061eb0f \
54        ${my_autoquit_compressed} \
55                md5 eebe87a27d6db8e8f247f0fffe0f2bd5 \
56                sha1 8199e1da12d01fc210ae1eaa50f794e5b8c479c1 \
57                rmd160 f493a59fd637caa8a7937fbefaf6ebdf4a07c7f5 \
58        ${my_system_disk_container_compressed} \
59                md5 5e7b4c0ce13e65546eb795c35879751a \
60                sha1 bf37fde76dfd9d4ed35526954c149566d761c2a6 \
61                rmd160 08788cbcca023ea9a0713ecec4781c35aa5a9185
62
63depends_build \
64        port:macutil \
65        bin:expect:expect
66
67set my_appdir "/Applications/MacPorts/Mini vMac"
68set romfile vMac.ROM
69set romfile_model "Macintosh Plus or 512Ke"
70set my_mnvm_dat "${workpath}/${my_bootstrap}/Contents/mnvm_dat"
71
72pre-fetch {
73        if { ! [file exists ${my_appdir}/${romfile}] } {
74                ui_msg "**************************************************************"
75                ui_msg "Mini vMac requires a ROM file from the type of machine you're"
76                ui_msg "emulating in order to work. The ROM file is not included with"
77                ui_msg "this package because it is copyrighted Apple software."
78                ui_msg "Download the CopyRoms program from the Mini vMac web site"
79                ui_msg "(${homepage} > More > Extras)"
80                ui_msg "and transfer it to a real physical ${romfile_model}"
81                ui_msg "that you own. Run the CopyRoms program there, then transfer"
82                ui_msg "the ROM file back to this Mac, name it ${romfile},"
83                ui_msg "and put it in ${my_appdir}."
84                ui_msg "**************************************************************"
85                return -code error "missing ROM file"
86        }
87}
88
89post-extract {
90        system "tar -x -z -C ${workpath} -f ${distpath}/${my_bootstrap_compressed}"
91       
92        xinstall -W ${filespath} attach.exp demacbinary.sh ${workpath}
93       
94        system "${workpath}/demacbinary.sh ${distpath}/${my_system_disk_container_compressed} ${workpath}"
95       
96        file mkdir ${my_mnvm_dat}
97        file copy ${my_appdir}/${romfile} ${my_mnvm_dat}
98       
99        # Copy the disk tools image from the container image.
100        set my_system_disk_container_mount [attach_disk_image ${workpath}/${my_system_disk_container} 0]
101        file copy "${my_system_disk_container_mount}/Disk Tools.image" ${workpath}/startup.img
102        detach_disk_image ${my_system_disk_container_mount}
103       
104        # The disk image mounter likes images to have the .img extension.
105        file rename ${workpath}/${my_src}/${my_src}.dsk ${workpath}/src.img
106       
107        # Make room on the startup disk for our things.
108        set my_startup_disk_mount [attach_disk_image ${workpath}/startup.img 1]
109        file delete "${my_startup_disk_mount}/Apple HD SC Setup" "${my_startup_disk_mount}/Disk First Aid"
110        detach_disk_image ${my_startup_disk_mount}
111       
112        # Mini vMac looks for disks named disk1.dsk through disk3.dsk and automounts them.
113        file rename "${workpath}/startup.img" "${my_mnvm_dat}/disk1.dsk"
114        file rename "${workpath}/src.img" "${my_mnvm_dat}/disk2.dsk"
115       
116#       system "osascript -e 'tell app \"Finder\" to make new alias file at desktop to theFile'"
117       
118#       reinplace "s|maintained by unknown|maintained by MacPorts|" \
119#               ${worksrcpath}/config/Info.plist
120#       reinplace "s|#define kMaintainerName \"unknown\"|#define kMaintainerName \"MacPorts\"|" \
121#               ${worksrcpath}/config/CNFGGLOB.h
122}
123
124configure {
125        system "'${workpath}/${my_bootstrap}/Contents/MacOS/minivmac'"
126        return -code error "portfile incomplete! :("
127}
128
129if { ![variant_isset mac128k] && ![variant_isset mac512k] && ![variant_isset mac512ke] && ![variant_isset macse] } {
130        default_variants +macplus
131}
132
133variant mac128k conflicts mac512k mac512ke macplus macse description {Emulate a Macintosh with 128K RAM and 2 drives} {
134        patchfiles-append patch-CNFGGLOB.h-mac128k.diff
135        set romfile Mac128K.ROM
136        set romfile_model "Macintosh 128K or 512K"
137}
138
139variant mac512k conflicts mac128k mac512ke macplus macse description {Emulate a Macintosh 512K with 512K RAM and 2 drives} {
140        patchfiles-append patch-CNFGGLOB.h-mac512k.diff
141        set romfile Mac128K.ROM
142        set romfile_model "Macintosh 128K or 512K"
143}
144
145variant mac512ke conflicts mac128k mac512k macplus macse description {Emulate a Macintosh 512Ke with 512K RAM and 6 drives} {
146        patchfiles-append patch-CNFGGLOB.h-mac512ke.diff
147}
148
149variant macplus conflicts mac128k mac512k mac512ke macse description {Emulate a Macintosh Plus with 4 MB RAM and 6 drives (default)} {
150        # Mac Plus emulation is the default so we don't need to do anything here
151}
152
153variant macse conflicts mac128k mac512k mac512ke macplus description {Emulate a Macintosh SE with 4 MB RAM and 6 drives} {
154        patchfiles-append patch-CNFGGLOB.h-macse.diff
155        set romfile MacSE.ROM
156        set romfile_model "Macintosh SE"
157}
158
159proc attach_disk_image {disk_image allow_writing} {
160        global name workpath
161        set mountpoint [exec mktemp -d -q -t ${name}]
162        # Use this expect script instead of using hdiutil directly, because the
163        # system disk image has a license agreement we must agree to.
164        system "${workpath}/attach.exp '${disk_image}' '${mountpoint}' '${allow_writing}'"
165        return ${mountpoint}
166}
167
168proc detach_disk_image {mountpoint} {
169        system "hdiutil detach ${mountpoint}"
170        file delete -force ${mountpoint}
171}
172
173livecheck.check     regex
174livecheck.url       ${homepage}download.html
175livecheck.regex     ${name}-(\[0-9.\]+)\\.src
Note: See TracBrowser for help on using the repository browser.