<pre style='margin:0'>
Ryan Schmidt (ryandesign) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/5c0248dc0e4b5fa26a372df726e4e51164b56ee1">https://github.com/macports/macports-ports/commit/5c0248dc0e4b5fa26a372df726e4e51164b56ee1</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 5c0248dc0e4b5fa26a372df726e4e51164b56ee1
</span>Author: Ryan Schmidt <ryandesign@macports.org>
AuthorDate: Fri Jun 29 07:37:26 2018 -0500
<span style='display:block; white-space:pre;color:#404040;'> minivmac*: Add custom subport
</span>---
emulators/minivmac-devel/Portfile | 85 ++++++++++++++++++++++-
emulators/minivmac-devel/files/README-custom.md | 34 +++++++++
emulators/minivmac-devel/files/custom.conf.sample | 17 +++++
emulators/minivmac/Portfile | 85 ++++++++++++++++++++++-
emulators/minivmac/files/README-custom.md | 38 ++++++++++
emulators/minivmac/files/custom.conf.sample | 17 +++++
6 files changed, 274 insertions(+), 2 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/emulators/minivmac-devel/Portfile b/emulators/minivmac-devel/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 8ac1ded..307ebac 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/emulators/minivmac-devel/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/emulators/minivmac-devel/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -413,6 +413,89 @@ subport ${my_name}-ii${my_suffix} {
</span> set default_speed 4x
}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+subport ${my_name}-custom${my_suffix} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ long_description-append This subport allows the user to compile custom \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ variations of Mini vMac.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ archive_sites
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set custom_conf_name custom.conf
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set custom_conf ${prefix}/etc/${my_name}/${custom_conf_name}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set local_custom_conf ${worksrcpath}/${custom_conf_name}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ pre-configure {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[file exists ${custom_conf}]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ copy -force ${custom_conf} ${local_custom_conf}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ delete ${local_custom_conf}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ setup_custom_variations
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ pre-destroot {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ setup_custom_variations
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ proc custom_variation_error {err} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ global name
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_error "For instructions, see"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_error " https://github.com/macports/macports-ports/blob/master/emulators/${name}/files/README-custom.md"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return -code error ${err}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ proc add_custom_variation {variation_name variation_options} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {${variation_options} ne {}} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my_variations-append ${variation_name} ${variation_options}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ proc setup_custom_variations {} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ global custom_conf custom_conf_name local_custom_conf filespath
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {![file exists ${local_custom_conf}]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_error "This subport allows you to compile custom variations. Copy"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_error " ${filespath}/${custom_conf_name}.sample"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_error "to"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_error " ${custom_conf}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_error "and then edit ${custom_conf_name}."
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ custom_variation_error "missing ${custom_conf_name}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my_variations
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set fp [open ${local_custom_conf} r]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set custom_data [read ${fp}]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ close ${fp}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set custom_lines [split ${custom_data} "\n"]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set custom_name {Custom}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set custom_options {}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set custom_line_number 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set custom_line_continue no
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach custom_line ${custom_lines} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ incr custom_line_number
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if [regexp -- {^\s*[;#]} ${custom_line}] {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ continue
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } elseif ${custom_line_continue} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set custom_line_continue [regsub -- {^(.*)\\$} ${custom_line} {\1} custom_line]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ append custom_${custom_key} " [string trim ${custom_line}]"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } elseif [regexp -- {^([^=]+)=(.*)$} ${custom_line} -> custom_key custom_value] {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set custom_line_continue [regsub -- {^(.*)\\$} ${custom_value} {\1} custom_value]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set custom_key [string trim ${custom_key}]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set custom_${custom_key} [string trim ${custom_value}]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } elseif [regexp -- {^\s*\[([^\]]+)\]\s*$} ${custom_line} -> new_custom_name] {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ add_custom_variation ${custom_name} ${custom_options}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set custom_name ${new_custom_name}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set custom_options {}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } elseif ![regexp -- {^\s*$} ${custom_line}] {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_error "Syntax error on line ${custom_line_number} of ${custom_conf_name}: '${custom_line}'"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ custom_variation_error "syntax error in ${custom_conf_name}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ add_custom_variation ${custom_name} ${custom_options}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[option my_variations] eq {}} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_error "No custom variations defined in ${custom_conf_name}."
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ custom_variation_error "no variations in ${custom_conf_name}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> # To build the bootstrap application, use:
# sudo port destroot minivmac-devel bootstrap=yes subport=minivmac-bootstrap-devel
# The subport is hidden because it is useful only to the port maintainer.
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -457,7 +540,7 @@ if {[tbool bootstrap]} {
</span> }
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>-if {${my_subport} ni [list "${my_name}" "${my_name}-bootstrap"]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+if {${my_subport} ni [list "${my_name}" "${my_name}-bootstrap" "${my_name}-custom"]} {
</span> description a Macintosh [lindex ${my_variations} 0] emulator
long_description-append This subport emulates a Macintosh \
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/emulators/minivmac-devel/files/README-custom.md b/emulators/minivmac-devel/files/README-custom.md
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 0000000..45de288
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/emulators/minivmac-devel/files/README-custom.md
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,34 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Mini vMac Custom Variations
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Mini vMac only offers limited control over its settings at runtime, and
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+changes to those settings don't persist after the program quits. Instead,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Mini vMac has a wide range of [options that can be specified at build
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+time](http://www.gryphel.org/c/minivmac/options.html#in). The MacPorts Mini
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+vMac ports expose a few of those options using subports and variants, but
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+for complete control, you can define your own variations in the custom.conf
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+file and install the minivmac-custom-devel subport.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+For each variation that you want MacPorts to compile, add a line with the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+name of the variation between square brackets. Variation names should be
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+short and unique. Then add a line defining the options you want to use.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+You should not specify the target (the `-t` option); MacPorts sets it for
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+you.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+For example, to compile a Macintosh Plus variation designed to be used in
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+fullscreen mode on a 15" MacBook Pro, and also Macintosh II variation that
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+runs at quarter resolution and can be pixel-doubled to fill the screen,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+your conf file might contain:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+```
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+[1440x900 FS]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+options = -hres 1440 -vres 900 -fullscreen 1 -var-fullscreen 0 \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -mf 1 -gkf 0 -emm 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+[II 720x450]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+options = -m II -hres 720 -vres 450 -gkf 0 -emm 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+```
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+To rebuild after you've made changes to the configuration file, use:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sudo port -n upgrade --force minivmac-custom-devel
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/emulators/minivmac-devel/files/custom.conf.sample b/emulators/minivmac-devel/files/custom.conf.sample
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 0000000..9daa2f7
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/emulators/minivmac-devel/files/custom.conf.sample
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,17 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Mini vMac Custom Variations Configuration File
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Documentation:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# https://github.com/macports/macports-ports/blob/master/emulators/minivmac/files/README-custom.md
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Available options:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# http://www.gryphel.org/c/minivmac/options.html#in
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Example:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# [1440x900 FS]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# options = -hres 1440 -vres 900 -fullscreen 1 -var-fullscreen 0 \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# -mf 1 -gkf 0 -emm 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# [II 720x450]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# options = -m II -hres 720 -vres 450 -gkf 0 -emm 0
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/emulators/minivmac/Portfile b/emulators/minivmac/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 4943ac7..1a702b6 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/emulators/minivmac/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/emulators/minivmac/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -401,6 +401,89 @@ subport ${my_name}-ii${my_suffix} {
</span> set default_speed 4x
}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+subport ${my_name}-custom${my_suffix} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ long_description-append This subport allows the user to compile custom \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ variations of Mini vMac.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ archive_sites
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set custom_conf_name custom.conf
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set custom_conf ${prefix}/etc/${my_name}/${custom_conf_name}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set local_custom_conf ${worksrcpath}/${custom_conf_name}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ pre-configure {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[file exists ${custom_conf}]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ copy -force ${custom_conf} ${local_custom_conf}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ delete ${local_custom_conf}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ setup_custom_variations
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ pre-destroot {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ setup_custom_variations
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ proc custom_variation_error {err} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ global name
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_error "For instructions, see"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_error " https://github.com/macports/macports-ports/blob/master/emulators/${name}/files/README-custom.md"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return -code error ${err}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ proc add_custom_variation {variation_name variation_options} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {${variation_options} ne {}} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my_variations-append ${variation_name} ${variation_options}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ proc setup_custom_variations {} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ global custom_conf custom_conf_name local_custom_conf filespath
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {![file exists ${local_custom_conf}]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_error "This subport allows you to compile custom variations. Copy"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_error " ${filespath}/${custom_conf_name}.sample"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_error "to"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_error " ${custom_conf}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_error "and then edit ${custom_conf_name}."
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ custom_variation_error "missing ${custom_conf_name}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my_variations
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set fp [open ${local_custom_conf} r]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set custom_data [read ${fp}]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ close ${fp}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set custom_lines [split ${custom_data} "\n"]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set custom_name {Custom}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set custom_options {}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set custom_line_number 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set custom_line_continue no
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach custom_line ${custom_lines} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ incr custom_line_number
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if [regexp -- {^\s*[;#]} ${custom_line}] {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ continue
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } elseif ${custom_line_continue} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set custom_line_continue [regsub -- {^(.*)\\$} ${custom_line} {\1} custom_line]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ append custom_${custom_key} " [string trim ${custom_line}]"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } elseif [regexp -- {^([^=]+)=(.*)$} ${custom_line} -> custom_key custom_value] {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set custom_line_continue [regsub -- {^(.*)\\$} ${custom_value} {\1} custom_value]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set custom_key [string trim ${custom_key}]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set custom_${custom_key} [string trim ${custom_value}]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } elseif [regexp -- {^\s*\[([^\]]+)\]\s*$} ${custom_line} -> new_custom_name] {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ add_custom_variation ${custom_name} ${custom_options}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set custom_name ${new_custom_name}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set custom_options {}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } elseif ![regexp -- {^\s*$} ${custom_line}] {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_error "Syntax error on line ${custom_line_number} of ${custom_conf_name}: '${custom_line}'"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ custom_variation_error "syntax error in ${custom_conf_name}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ add_custom_variation ${custom_name} ${custom_options}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[option my_variations] eq {}} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_error "No custom variations defined in ${custom_conf_name}."
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ custom_variation_error "no variations in ${custom_conf_name}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> # To build the bootstrap application, use:
# sudo port destroot minivmac bootstrap=yes subport=minivmac-bootstrap
# The subport is hidden because it is useful only to the port maintainer.
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -445,7 +528,7 @@ if {[tbool bootstrap]} {
</span> }
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>-if {${my_subport} ni [list "${my_name}" "${my_name}-bootstrap"]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+if {${my_subport} ni [list "${my_name}" "${my_name}-bootstrap" "${my_name}-custom"]} {
</span> description a Macintosh [lindex ${my_variations} 0] emulator
long_description-append This subport emulates a Macintosh \
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/emulators/minivmac/files/README-custom.md b/emulators/minivmac/files/README-custom.md
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 0000000..1d0a6ae
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/emulators/minivmac/files/README-custom.md
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,38 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Mini vMac Custom Variations
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Mini vMac only offers limited control over its settings at runtime, and
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+changes to those settings don't persist after the program quits. Instead,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Mini vMac has a wide range of [options that can be specified at build
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+time](http://www.gryphel.org/c/minivmac/options.html#in). The MacPorts Mini
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+vMac ports expose a few of those options using subports and variants, but
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+for complete control, you can define your own variations in the custom.conf
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+file and install the minivmac-custom subport.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+For each variation that you want MacPorts to compile, add a line with the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+name of the variation between square brackets. Variation names should be
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+short and unique. Then add a line defining the options you want to use.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+You should not specify the target (the `-t` option); MacPorts sets it for
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+you.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+For example, to compile a Macintosh Plus variation designed to be used in
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+fullscreen mode on a 15" MacBook Pro, and also Macintosh II variation that
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+runs at quarter resolution and can be pixel-doubled to fill the screen,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+your conf file might contain:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+```
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+[1440x900 FS]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+options = -hres 1440 -vres 900 -fullscreen 1 -var-fullscreen 0 \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -mf 1 -gkf 0 -emm 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+[II 720x450]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+options = -m II -hres 720 -vres 450 -gkf 0 -emm 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+```
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+To rebuild after you've made changes to the configuration file, use:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sudo port -n upgrade --force minivmac-custom
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+If an error occurs during configuration, the Mini vMac 3.5.x build system
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+won't tell you what went wrong. This problem is fixed in Mini vMac 36.x,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+which is available in the minivmac-custom-devel port.
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/emulators/minivmac/files/custom.conf.sample b/emulators/minivmac/files/custom.conf.sample
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 0000000..9daa2f7
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/emulators/minivmac/files/custom.conf.sample
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,17 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Mini vMac Custom Variations Configuration File
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Documentation:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# https://github.com/macports/macports-ports/blob/master/emulators/minivmac/files/README-custom.md
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Available options:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# http://www.gryphel.org/c/minivmac/options.html#in
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Example:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# [1440x900 FS]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# options = -hres 1440 -vres 900 -fullscreen 1 -var-fullscreen 0 \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# -mf 1 -gkf 0 -emm 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# [II 720x450]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# options = -m II -hres 720 -vres 450 -gkf 0 -emm 0
</span></pre><pre style='margin:0'>
</pre>