[45194] trunk/dports/python

mcalhoun at macports.org mcalhoun at macports.org
Sat Jan 10 03:26:54 PST 2009


Revision: 45194
          http://trac.macports.org/changeset/45194
Author:   mcalhoun at macports.org
Date:     2009-01-10 03:26:46 -0800 (Sat, 10 Jan 2009)
Log Message:
-----------
py26-sip: New Port

Added Paths:
-----------
    trunk/dports/python/py26-sip/
    trunk/dports/python/py26-sip/Portfile
    trunk/dports/python/py26-sip/files/
    trunk/dports/python/py26-sip/files/patch-siputils.py.diff

Added: trunk/dports/python/py26-sip/Portfile
===================================================================
--- trunk/dports/python/py26-sip/Portfile	                        (rev 0)
+++ trunk/dports/python/py26-sip/Portfile	2009-01-10 11:26:46 UTC (rev 45194)
@@ -0,0 +1,77 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
+# $Id$
+
+PortSystem 1.0
+
+name         py26-sip
+version      4.7.9
+categories   python devel
+maintainers  mcalhoun openmaintainer
+platforms    macosx
+description  create Python bindings for C and C++ libraries
+long_description \
+    SIP is a tool that makes it very easy to create \
+    Python bindings for C and C++ libraries. \
+    It was originally developed to create PyQt, \
+    the Python bindings for the Qt toolkit, \
+    but can be used to create bindings for any \
+    C or C++ library.
+homepage http://www.riverbankcomputing.co.uk/sip/
+master_sites \
+    http://www.riverbankcomputing.com/static/Downloads/sip4/ \
+    http://gentoo.mirrors.easynews.com/linux/gentoo/distfiles/ \
+    http://gentoo.osuosl.org/distfiles/ \
+    http://www.gtlib.gatech.edu/pub/gentoo/distfiles/
+
+distname sip-${version}
+checksums \
+    md5     597d7ff7edb42a18421c806ffd18a136 \
+    sha1    a8eabe3890a1fc42ec77ac82fa41344ad23abe09 \
+    rmd160  719f7c7ae211ceb2bb7609c5e70d864054ccd23d
+
+set pyversion 2.6
+depends_lib-append port:python[strsed ${pyversion} {g/[.]//}]
+set pybin ${prefix}/bin/python${pyversion}
+
+# For linking sip.so, replace
+#    -F${frameworks_dir}/Library/Frameworks -framework Python
+#    with
+#    ${frameworks_dir}/Python.framework/Versions/${pyversion}/Python
+patchfiles patch-siputils.py.diff
+post-patch {
+    reinplace \
+        "s|__MacPorts_Required_Python_Lib__|${frameworks_dir}/Python.framework/Versions/${pyversion}/Python|" \
+        ${worksrcpath}/siputils.py
+}
+
+configure.cmd ${pybin} configure.py
+
+pre-configure {
+    # Ensure correct compilers are used
+    reinplace "s| cc\$| ${configure.cc}|" \
+        ${worksrcpath}/specs/macx-g++
+    reinplace "s| c++\$| ${configure.cxx}|" \
+        ${worksrcpath}/specs/macx-g++
+}
+
+# By default, everything gets installed in the Python Frameworks directory
+configure.pre_args-delete  --prefix=${prefix}
+
+test.run  yes
+test.cmd  cd siplib && ${pybin} -c 'import sip'
+
+post-destroot {
+    ln -s ${frameworks_dir}/Python.framework/Versions/${pyversion}/bin/sip ${destroot}${prefix}/bin/sip-${pyversion}
+
+    # Install documentation
+	xinstall -m 755 -d ${destroot}${prefix}/share/doc
+	file copy ${worksrcpath}/doc ${destroot}${prefix}/share/doc/${name}
+	xinstall -m 644 -W ${worksrcpath} ChangeLog NEWS README TODO \
+		${destroot}${prefix}/share/doc/${name}
+    xinstall -m 644 -W ${worksrcpath}/doc sipref.html sipref.txt \
+        ${destroot}${prefix}/share/doc/${name}
+}
+
+livecheck.check  regex
+livecheck.url    http://www.riverbankcomputing.co.uk/news
+livecheck.regex  "SIP v(\\d+(?:\\.\\d+)*) Released"

Added: trunk/dports/python/py26-sip/files/patch-siputils.py.diff
===================================================================
--- trunk/dports/python/py26-sip/files/patch-siputils.py.diff	                        (rev 0)
+++ trunk/dports/python/py26-sip/files/patch-siputils.py.diff	2009-01-10 11:26:46 UTC (rev 45194)
@@ -0,0 +1,20 @@
+--- siputils.py.org.py	2006-11-04 14:09:43.000000000 -0800
++++ siputils.py	2006-11-06 20:23:11.000000000 -0800
+@@ -1378,11 +1378,11 @@
+             # This allows Apple's Python to be used even if a later python.org
+             # version is also installed.
+             dl = string.split(sys.exec_prefix, os.sep)
+-            try:
+-                dl = dl[:dl.index("Python.framework")]
+-            except ValueError:
+-                error("SIP requires Python to be built as a framework")
+-            self.LFLAGS.append("-F%s" % string.join(dl, os.sep))
+-            self.LFLAGS.append("-framework Python")
++            # try:
++               # dl = dl[:dl.index("Python.framework")]
++            # except ValueError:
++               # error("SIP requires Python to be built as a framework")
++            # self.LFLAGS.append("-F%s" % string.join(dl, os.sep))
++            self.LFLAGS.append("__MacPorts_Required_Python_Lib__")
+ 
+         Makefile.finalise(self)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090110/cbca9ac2/attachment.html>


More information about the macports-changes mailing list