[102977] trunk/base/src/port1.0/portbuild.tcl

cal at macports.org cal at macports.org
Mon Feb 11 05:32:49 PST 2013


Revision: 102977
          https://trac.macports.org/changeset/102977
Author:   cal at macports.org
Date:     2013-02-11 05:32:49 -0800 (Mon, 11 Feb 2013)
Log Message:
-----------
portbuild: use callbacks to simplify adding a bsdmake dependency

Modified Paths:
--------------
    trunk/base/src/port1.0/portbuild.tcl

Modified: trunk/base/src/port1.0/portbuild.tcl
===================================================================
--- trunk/base/src/port1.0/portbuild.tcl	2013-02-11 11:26:41 UTC (rev 102976)
+++ trunk/base/src/port1.0/portbuild.tcl	2013-02-11 13:32:49 UTC (rev 102977)
@@ -60,32 +60,22 @@
 default build.type "default"
 default use_parallel_build yes
 
-# proc to add dependency on bsdmake, if necessary
-option_proc build.type portbuild::set_build_type
-
 set_ui_prefix
 
-proc portbuild::set_build_type {option action args} {
-    array set build_type_map {
-        bsd     {bin:bsdmake:bsdmake}
-    }
+# Automatically called from macports1.0 after evaluating the Portfile. If
+# ${build.type} == bsd, ensures bsdmake is present by adding a bin:-style
+# dependency.
+proc portbuild::add_automatic_buildsystem_dependencies {} {
+    global build.type
 
-    if {$action == "set"} {
-        switch $option {
-            build.type {
-                # using [exists foo] doesn't work with arrays!
-                if {[info exists build_type_map([option build.type])]} {
-                    # remove dependencies added before when setting build.type more than once
-                    eval depends_build-delete $build_type_map([option build.type])
-                }
-                if {[info exists build_type_map($args)]} {
-                    # add dependency if needed
-                    eval depends_build-append $build_type_map($args)
-                }
-            }
-        }
+    if {${build.type} == "bsd"} {
+        ui_debug "build.type is BSD, adding bin:bsdmake:bsdmake build dependency"
+        depends_build-delete bin:bsdmake:bsdmake
+        depends_build-append bin:bsdmake:bsdmake
     }
 }
+# Register the above procedure as a callback after Portfile evaluation
+port::register_callback portbuild::add_automatic_buildsystem_dependencies
 
 proc portbuild::build_getmaketype {args} {
     if {[option build.type] == "default"} {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130211/ecdf11c1/attachment-0001.html>


More information about the macports-changes mailing list