[78924] trunk/base

jmr at macports.org jmr at macports.org
Thu May 26 23:43:49 PDT 2011


Revision: 78924
          http://trac.macports.org/changeset/78924
Author:   jmr at macports.org
Date:     2011-05-26 23:43:48 -0700 (Thu, 26 May 2011)
Log Message:
-----------
add 'installs_libs' option that allows us to skip several checks when set to 'no'

Modified Paths:
--------------
    trunk/base/doc/portfile.7
    trunk/base/portmgr/jobs/port_binary_distributable.tcl
    trunk/base/src/macports1.0/macports.tcl
    trunk/base/src/port/portindex.tcl
    trunk/base/src/port1.0/portmain.tcl

Modified: trunk/base/doc/portfile.7
===================================================================
--- trunk/base/doc/portfile.7	2011-05-27 02:42:34 UTC (rev 78923)
+++ trunk/base/doc/portfile.7	2011-05-27 06:43:48 UTC (rev 78924)
@@ -401,6 +401,26 @@
 .Dl add_users squid group=squid realname=Squid\e Proxy home=${prefix}/var/squid
 .sp
 .Dl add_users user1 group=mygroup user2 group=mygroup
+.It Ic installs_libs
+By default, it is assumed that ports may install libraries or headers that can
+be incorporated into their dependents. If this is not the case, set
+.Cm installs_libs
+to
+.Em no .
+This means that this port's dependents need not check that it is installed
+for the same architectures as them; that it is permissible to distribute
+binaries of the dependents even if their licenses conflict with the license
+of this port; and that updates to this port can never result in broken dynamic
+linking in its dependents.
+.br
+.Sy Type:
+.Em optional
+.br
+.Sy Default:
+.Em none
+.br
+.Sy Example:
+.Dl installs_libs no
 .El
 .Sh TARGET HOOKS
 A number of hooks are available for customizing many of the standard

Modified: trunk/base/portmgr/jobs/port_binary_distributable.tcl
===================================================================
--- trunk/base/portmgr/jobs/port_binary_distributable.tcl	2011-05-27 02:42:34 UTC (rev 78923)
+++ trunk/base/portmgr/jobs/port_binary_distributable.tcl	2011-05-27 06:43:48 UTC (rev 78924)
@@ -80,7 +80,14 @@
         }
     }
 
-    return [list $dependencyList $portInfo(license)]
+    set ret [list $dependencyList $portInfo(license)]
+    if {[info exists portInfo(installs_libs)]} {
+        lappend ret $portInfo(installs_libs)
+    } else {
+        # when in doubt, assume code from the dep is incorporated
+        lappend ret yes
+    }
+    return $ret
 }
 
 # return license with any trailing dash followed by a number and/or plus sign removed
@@ -116,8 +123,16 @@
     set portList [lindex $top_info 0]
     while {[llength $portList] > 0} {
         set aPort [lindex $portList 0]
+        # mark as seen and remove from the list
+        set portSeen($aPort) 1
+        set portList [lreplace $portList 0 0]
+
         set aPortInfo [infoForPort $aPort $variantInfo]
         set aPortLicense [lindex $aPortInfo 1]
+        set installs_libs [lindex $aPortInfo 2]
+        if {!$installs_libs} {
+            continue
+        }
         foreach full_lic $aPortLicense {
             # check that this dependency's license(s) are good
             set lic [remove_version [string tolower $full_lic]]
@@ -140,9 +155,7 @@
             }
         }
 
-        # mark it seen and add its deps to the list
-        set portSeen($aPort) 1
-        set portList [lreplace $portList 0 0]
+        # add its deps to the list
         foreach possiblyNewPort [lindex $aPortInfo 0] {
             if {![info exists portSeen($possiblyNewPort)]} {
                 lappend portList $possiblyNewPort

Modified: trunk/base/src/macports1.0/macports.tcl
===================================================================
--- trunk/base/src/macports1.0/macports.tcl	2011-05-27 02:42:34 UTC (rev 78923)
+++ trunk/base/src/macports1.0/macports.tcl	2011-05-27 06:43:48 UTC (rev 78924)
@@ -1711,6 +1711,11 @@
                         set res [mportlookup $dep_portname]
                         array unset dep_portinfo
                         array set dep_portinfo [lindex $res 1]
+                        if {[info exists dep_portinfo(installs_libs)] && !$dep_portinfo(installs_libs)} {
+                            set missing {}
+                        }
+                    }
+                    if {[llength $missing] > 0} {
                         if {[info exists dep_portinfo(variants)] && [lsearch $dep_portinfo(variants) universal] != -1} {
                             # dep offers a universal variant
                             if {[llength $active_archs] == 1} {
@@ -2497,6 +2502,8 @@
                     }
                     ui_error "Dependency '$dep_portname' not found."
                     return 1
+                } elseif {[info exists dep_portinfo(installs_libs)] && !$dep_portinfo(installs_libs)} {
+                    set check_archs 0
                 }
                 lappend options subport $dep_portname
                 # Figure out the subport. Check the open_mports list first, since

Modified: trunk/base/src/port/portindex.tcl
===================================================================
--- trunk/base/src/port/portindex.tcl	2011-05-27 02:42:34 UTC (rev 78923)
+++ trunk/base/src/port/portindex.tcl	2011-05-27 06:43:48 UTC (rev 78924)
@@ -259,7 +259,7 @@
 foreach key {categories depends_fetch depends_extract depends_build \
              depends_lib depends_run description epoch homepage \
              long_description maintainers name platforms revision variants \
-             version portdir portarchive replaced_by license} {
+             version portdir portarchive replaced_by license installs_libs} {
     set keepkeys($key) 1
 }
 mporttraverse pindex $directory

Modified: trunk/base/src/port1.0/portmain.tcl
===================================================================
--- trunk/base/src/port1.0/portmain.tcl	2011-05-27 02:42:34 UTC (rev 78923)
+++ trunk/base/src/port1.0/portmain.tcl	2011-05-27 06:43:48 UTC (rev 78924)
@@ -51,7 +51,7 @@
         os.platform os.subplatform os.version os.major os.arch os.endian \
         platforms default_variants install.user install.group \
         macosx_deployment_target universal_variant os.universal_supported \
-        supported_archs depends_skip_archcheck \
+        supported_archs depends_skip_archcheck installs_libs \
         copy_log_files \
         compiler.cpath compiler.library_path \
         add_users
@@ -64,7 +64,7 @@
 option_proc notes handle_option_string
 
 # Export options via PortInfo
-options_export name version revision epoch categories maintainers platforms description long_description notes homepage license provides conflicts replaced_by
+options_export name version revision epoch categories maintainers platforms description long_description notes homepage license provides conflicts replaced_by installs_libs
 
 default subport {[portmain::get_default_subport]}
 proc portmain::get_default_subport {} {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110526/b07352b4/attachment.html>


More information about the macports-changes mailing list