[119919] trunk/dports/devel

mcalhoun at macports.org mcalhoun at macports.org
Fri May 9 20:15:11 PDT 2014


Revision: 119919
          https://trac.macports.org/changeset/119919
Author:   mcalhoun at macports.org
Date:     2014-05-09 20:15:11 -0700 (Fri, 09 May 2014)
Log Message:
-----------
devel/dbus-python*:
 * unify various ports
 * update version 0.84.0 -> 1.2.0 for versions of python that support it
 * increase number of python versions supported (3.1, 3.2, and 3.3)
 * create variant to build extra documentation
 * create variant to install examples
 * create test variant for versions of python that support it
 * depend on py-gobject only if testing (not used otherwise)
 * Fixes #34703

Modified Paths:
--------------
    trunk/dports/devel/dbus-python/Portfile

Added Paths:
-----------
    trunk/dports/devel/dbus-python/

Removed Paths:
-------------
    trunk/dports/devel/dbus-python24/
    trunk/dports/devel/dbus-python25/
    trunk/dports/devel/dbus-python26/
    trunk/dports/devel/dbus-python27/

Modified: trunk/dports/devel/dbus-python/Portfile
===================================================================
--- trunk/dports/devel/dbus-python27/Portfile	2014-05-10 00:52:49 UTC (rev 119918)
+++ trunk/dports/devel/dbus-python/Portfile	2014-05-10 03:15:11 UTC (rev 119919)
@@ -3,54 +3,161 @@
 
 PortSystem      1.0
 
-name            dbus-python27
-set my_name     dbus-python
-version         0.84.0
-maintainers     nomaintainer
+name            dbus-python
+version         1.2.0
+maintainers     mcalhoun openmaintainer
 license         MIT
 categories      devel python
 platforms       darwin
 description     Python bindings for the dbus message bus system.
 
+set python_versions {24 25 26 27 31 32 33}
+
+# this default version should stay synchronized with python_get_default_version
+#    in the python PortGroup
+set python_default_version 27
+
 long_description \
     ${description}
 
 homepage        http://www.freedesktop.org/Software/dbus/
 master_sites    http://dbus.freedesktop.org/releases/dbus-python/
-distname        ${my_name}-${version}
 
-checksums           rmd160  ec5912e28e49e89ff3f9a3a5a05292c27f11de2c \
-                    sha256  b85bc7aaf1a976627ca461b1ca7b0c4ddddff709f52fe44c9b2d1d7d8fac5906
+if {${name} eq ${subport}} {
+    # set up dbus-python as a stub port that depends on the default dbus-pythonXY
+    fetch {}
+    checksum {}
+    extract {}
+    supported_archs noarch
+        
+    depends_lib port:${name}${python_default_version}
+    
+    patch {}
+    use_configure no
+    build {}
+    destroot {
+        xinstall -d ${destroot}${prefix}/share/doc/${name}
+        system "echo $name is a stub port > ${destroot}${prefix}/share/doc/${name}/README"
+    }    
+}
 
-depends_build   port:pkgconfig
+foreach python_version ${python_versions} {
 
-depends_lib     path:bin/dbus-daemon:dbus \
-                port:dbus-glib \
-                port:gettext \
-                path:lib/pkgconfig/glib-2.0.pc:glib2 \
-                port:libiconv \
-                port:py27-gobject
+    set python_branch [string range ${python_version} 0 end-1].[string index ${python_version} end]
+    
+    subport ${name}${python_version} {
+        
+        checksums           rmd160  cba09a1ca259bfa49c943142110a968241f40360 \
+                            sha256  e12c6c8b2bf3a9302f75166952cbe41d6b38c3441bbc6767dbd498942316c6df
+        
+        livecheck.type  regex
+        livecheck.url   ${master_sites}?C=M&O=D
+        livecheck.regex ${name}-(\\d+(?:\\.\\d+)*)
+        
+        # dbus-python 1.x only supports Python 2.6 and above
+        if { [vercmp ${python_branch} 2.5] <= 0 } {
+            version 0.84.0
+            
+            checksums           rmd160  ec5912e28e49e89ff3f9a3a5a05292c27f11de2c \
+                                sha256  b85bc7aaf1a976627ca461b1ca7b0c4ddddff709f52fe44c9b2d1d7d8fac5906
+            
+            livecheck.regex ${name}-(0(?:\\.\\d+)*)
+        }
+        
+        distname        ${name}-${version}
 
-set python_prefix ${frameworks_dir}/Python.framework/Versions/2.7
+        depends_build   port:pkgconfig
+        
+        depends_lib                               \
+            path:bin/dbus-daemon:dbus             \
+            port:dbus-glib                        \
+            port:gettext                          \
+            path:lib/pkgconfig/glib-2.0.pc:glib2  \
+            port:libiconv
+        
+        set python_prefix ${frameworks_dir}/Python.framework/Versions/${python_branch}
+                
+        configure.pre_args-replace --prefix=${prefix} --prefix=${python_prefix}
+        
+        configure.args                                                    \
+            --docdir=${prefix}/share/doc/${subport}                       \
+            --includedir=${python_prefix}/include/python${python_branch}  \
+            --disable-html-docs                                           \
+            --disable-api-docs
+        
+        configure.pkg_config_path  ${python_prefix}/lib/pkgconfig
+        
+        configure.python    ${prefix}/bin/python${python_branch}
+        
+        variant html description {Enable HTML documentation building} {}
+        
+        # pyXY-epydoc, which is required to build the api, is only supported on certain versions of python
+        if { [lsearch -exact {25 26 27} ${python_version}] != -1 } {
+            variant doc description {Enable API documentation building} {}
+        }
+        
+        variant examples description {Install examples} {
+            post-destroot {
+                set docdir ${prefix}/share/doc/${subport}
+                set exdir ${docdir}/examples
+                xinstall -d ${destroot}${exdir}
+                eval xinstall -m 644 [glob ${worksrcpath}/examples/*] ${destroot}${exdir}
+            }
+        }
+        
+        # pyXY-gobject, which is required to test, is only supported on certain versions of python
+        if { [lsearch -exact {26 27 32 33 34} ${python_version}] != -1 } {            
+            variant test {}
+            
+            test.run yes
+            test.target check
+        }
+        
+        # ${python_version} and ${python_branch} do not have the right value inside variant block,
+        #    so put it here.
+        if { [variant_isset html] || ([variant_exists doc] && [variant_isset doc]) } {
+            depends_build-append port:py${python_version}-docutils
+            configure.env-append RST2HTML=${prefix}/bin/rst2html-${python_branch}.py
+        }
 
-configure.pre_args-delete --prefix=${prefix}
-configure.pre_args-append --prefix=${python_prefix}
+        if { [variant_isset html] } {
+            configure.args-replace --disable-html-docs --enable-html-docs
+        }
 
-configure.args  --mandir=${prefix}/share/man \
-                --docdir=${prefix}/share/doc/${name} \
-                --includedir=${python_prefix}/include/python2.7
-
-configure.pkg_config_path  ${python_prefix}/lib/pkgconfig
-configure.python    ${prefix}/bin/python2.7
-
-platform darwin 9 {
-    post-patch {
-        reinplace "s| -export-symbols-regex.*| \\\\|g" \
-            ${worksrcpath}/_dbus_bindings/Makefile.in \
-            ${worksrcpath}/_dbus_glib_bindings/Makefile.in
+        # ${python_version} and ${python_branch} do not have the right value inside variant block,
+        #    so put it here.
+        if { [variant_exists doc] && [variant_isset doc] } {
+            depends_build-append port:py${python_version}-epydoc
+            configure.args-replace --disable-api-docs --enable-api-docs
+            configure.env-append EPYDOC=${prefix}/bin/epydoc-${python_branch}
+            
+            post-destroot {
+                set docdir ${prefix}/share/doc/${subport}
+                set apidir ${docdir}/api
+                xinstall -d ${destroot}${apidir}
+                eval xinstall -m 644 [glob ${worksrcpath}/api/*] ${destroot}${apidir}
+            }
+        }
+        
+        # ${python_version} and ${python_branch} do not have the right value inside variant block,
+        #    so put it here.
+        if { [variant_exists test] } {
+            if { [variant_isset test] } {
+                depends_build-append port:py${python_version}-gobject
+            } else {
+                pre-test {
+                    ui_error "test variant must be activated to enable test support."
+                    error "Please enable test variant."
+                }
+            }
+        }
+        
+        platform darwin 9 {
+            post-patch {
+                reinplace "s| -export-symbols-regex.*| \\\\|g" \
+                    ${worksrcpath}/_dbus_bindings/Makefile.in \
+                    ${worksrcpath}/_dbus_glib_bindings/Makefile.in
+            }
+        }
     }
 }
-
-livecheck.type  regex
-livecheck.url   ${master_sites}?C=M&O=D
-livecheck.regex ${my_name}-(\\d+(?:\\.\\d+)*)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140509/4bf0d5af/attachment-0001.html>


More information about the macports-changes mailing list