[86921] trunk/dports/python

jmr at macports.org jmr at macports.org
Sun Nov 6 21:02:57 PST 2011


Revision: 86921
          http://trac.macports.org/changeset/86921
Author:   jmr at macports.org
Date:     2011-11-06 21:02:55 -0800 (Sun, 06 Nov 2011)
Log Message:
-----------
py-readline: unify, update to 6.2.1

Modified Paths:
--------------
    trunk/dports/python/py-readline/Portfile

Added Paths:
-----------
    trunk/dports/python/py-readline/files/build.sh.patch
    trunk/dports/python/py-readline/files/readline.pth
    trunk/dports/python/py-readline/files/readline_path.py
    trunk/dports/python/py-readline/files/setup.py.patch

Removed Paths:
-------------
    trunk/dports/python/py-readline/files/setup.py
    trunk/dports/python/py25-readline/

Modified: trunk/dports/python/py-readline/Portfile
===================================================================
--- trunk/dports/python/py-readline/Portfile	2011-11-07 04:57:04 UTC (rev 86920)
+++ trunk/dports/python/py-readline/Portfile	2011-11-07 05:02:55 UTC (rev 86921)
@@ -1,37 +1,30 @@
 # $Id$
 
 PortSystem 1.0
-PortGroup python24 1.0
+PortGroup python 1.0
 
 name			py-readline
-version			2.4.6
-categories		python
+version			6.2.1
 platforms		darwin
+license			GPL-3+ PSF
 maintainers		mww
-description		readline extension for Python
+description		GNU readline extension for Python
 long_description	${description}
 
 homepage		http://www.python.org/
-master_sites	http://www.python.org/ftp/python/${version}/
-distname		Python-${version}
-dist_subdir		python24
-checksums		sha1 cb1972a554a458f6a26d3e047b359251865d7c96
-use_bzip2		yes
+master_sites	http://pypi.python.org/packages/source/r/readline/
+distname		readline-${version}
+checksums		md5 9604527863378512247fcaf938100797 \
+			sha256 2e789683f826e45e1580dddf814af6db0e00038e15ac641a36c365bf3f48ff5d
 
-depends_lib-append	port:readline
+python.versions	24 25 26 27 31 32
 
-worksrcdir		${worksrcdir}/Modules
-
-extract.post_args	"| tar -xf - ${distname}/Modules/readline.c"
-post-extract {
-	file copy ${filespath}/setup.py ${worksrcpath}
+if {$subport != $name} {
+    patchfiles	build.sh.patch setup.py.patch
+    depends_build	port:py${python.version}-distribute
+    post-destroot {
+        copy -force ${filespath}/readline.pth ${filespath}/readline_path.py \
+            ${destroot}${python.pkgd}
+        reinplace "s|__LIBDIR__|${python.libdir}|" ${destroot}${python.pkgd}/readline_path.py
+    }
 }
-
-configure {
-	reinplace "s|__VERSION__|${version}|g" ${worksrcpath}/setup.py
-	reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/setup.py
-}
-
-livecheck.type	regex
-livecheck.url	http://www.python.org/download/releases/
-livecheck.regex	Python (2.4.\[0-9\]+)

Added: trunk/dports/python/py-readline/files/build.sh.patch
===================================================================
--- trunk/dports/python/py-readline/files/build.sh.patch	                        (rev 0)
+++ trunk/dports/python/py-readline/files/build.sh.patch	2011-11-07 05:02:55 UTC (rev 86921)
@@ -0,0 +1,35 @@
+--- rl/build.sh.orig	2011-09-01 17:50:34.000000000 +1000
++++ rl/build.sh	2011-11-07 14:02:32.000000000 +1100
+@@ -1,32 +1,6 @@
+ #! /bin/bash
+ set -e
+ 
+-# If we are on Mac OS X, look for the latest SDK and do a universal build
+-if [ `uname` == "Darwin" ]; then
+-  LATEST_SDK=''
+-  for sdk_dir in /Developer/SDKs/*; do
+-    LATEST_SDK=$sdk_dir
+-  done
+-  if [[ $LATEST_SDK == /Developer/SDKs/MacOSX10.4u.sdk ]]; then
+-    # Check if we have an old gcc on Mac OS 10.4 (from XCode < 2.4) which did not support x86_64
+-    gcc -arch x86_64 -v
+-    if [ $? -eq 0 ]; then
+-      export CFLAGS='-arch i386 -arch ppc -arch x86_64 -arch ppc64'
+-      export LDFLAGS='-arch i386 -arch ppc -arch x86_64 -arch ppc64'
+-    else
+-      export CFLAGS='-arch i386 -arch ppc -arch ppc64'
+-      export LDFLAGS='-arch i386 -arch ppc -arch ppc64'
+-    fi
+-  elif [[ $LATEST_SDK == /Developer/SDKs/MacOSX10.5.sdk ]]; then
+-    export CFLAGS='-isysroot '${LATEST_SDK}' -arch i386 -arch ppc -arch x86_64 -arch ppc64'
+-    export LDFLAGS='-syslibroot,'${LATEST_SDK}' -arch i386 -arch ppc -arch x86_64 -arch ppc64'
+-  else
+-    # Starting with 10.6 (Snow Leopard), only Intel architecture is supported
+-    export CFLAGS='-isysroot '${LATEST_SDK}' -arch i386 -arch x86_64'
+-    export LDFLAGS='-syslibroot,'${LATEST_SDK}' -arch i386 -arch x86_64'
+-  fi
+-fi
+-
+ rm -rf readline-lib
+ tar xzvf readline-6.2.tar.gz
+ mv readline-6.2 readline-lib

Added: trunk/dports/python/py-readline/files/readline.pth
===================================================================
--- trunk/dports/python/py-readline/files/readline.pth	                        (rev 0)
+++ trunk/dports/python/py-readline/files/readline.pth	2011-11-07 05:02:55 UTC (rev 86921)
@@ -0,0 +1 @@
+import readline_path

Added: trunk/dports/python/py-readline/files/readline_path.py
===================================================================
--- trunk/dports/python/py-readline/files/readline_path.py	                        (rev 0)
+++ trunk/dports/python/py-readline/files/readline_path.py	2011-11-07 05:02:55 UTC (rev 86921)
@@ -0,0 +1,7 @@
+import sys
+lib_dynload="__LIBDIR__/lib-dynload"
+site_packages="__LIBDIR__/site-packages"
+for i in range(len(sys.path)):
+    if sys.path[i] == lib_dynload:
+        sys.path.insert(i, site_packages+"/readline")
+        break

Deleted: trunk/dports/python/py-readline/files/setup.py
===================================================================
--- trunk/dports/python/py-readline/files/setup.py	2011-11-07 04:57:04 UTC (rev 86920)
+++ trunk/dports/python/py-readline/files/setup.py	2011-11-07 05:02:55 UTC (rev 86921)
@@ -1,22 +0,0 @@
-try:
-    import distutils
-    from distutils import sysconfig
-    from distutils.command.install import install
-    from distutils.core import setup, Extension
-except:
-    raise SystemExit, "Distutils problem"
-
-prefix = "__PREFIX__"
-inc_dirs = [prefix + "/include"]
-lib_dirs = [prefix + "/lib"]
-libs = ["readline"]
-
-setup(name = "readline",
-      version = "__VERSION__",
-      description = "Readline Extension to Python",
-      
-      ext_modules = [Extension('readline', ['readline.c'],
-                               include_dirs = inc_dirs,
-                               libraries = libs,
-                               library_dirs = lib_dirs)]
-      )

Added: trunk/dports/python/py-readline/files/setup.py.patch
===================================================================
--- trunk/dports/python/py-readline/files/setup.py.patch	                        (rev 0)
+++ trunk/dports/python/py-readline/files/setup.py.patch	2011-11-07 05:02:55 UTC (rev 86921)
@@ -0,0 +1,39 @@
+--- setup.py.orig	2011-09-01 18:09:18.000000000 +1000
++++ setup.py	2011-11-07 14:47:36.000000000 +1100
+@@ -30,18 +30,6 @@
+     'Topic :: Software Development :: Libraries :: Python Modules',
+ ]
+ 
+-# If we are on Mac OS 10.5 or later, attempt a universal binary, which is the way
+-# the original system version of readline.so was compiled. Set up flags here.
+-UNIVERSAL = ''
+-platform = distutils.util.get_platform()
+-if platform.startswith('macosx'):
+-    osx_version = platform.split('-')[1]
+-    if osx_version == '10.5':
+-        UNIVERSAL = '-isysroot /Developer/SDKs/MacOSX10.5.sdk -arch i386 -arch ppc -arch x86_64 -arch ppc64'
+-    elif osx_version > '10.5':
+-        # Starting with 10.6 (Snow Leopard), only Intel architecture is supported
+-        UNIVERSAL = '-isysroot /Developer/SDKs/MacOSX%s.sdk -arch i386 -arch x86_64' % (osx_version,)
+-
+ # Since we have the latest readline (post 4.2), enable all readline functionality
+ # These macros can be found in pyconfig.h.in in the main directory of the Python tarball
+ DEFINE_MACROS = [
+@@ -88,6 +76,7 @@
+     maintainer_email="ludwig.schwardt at gmail.com; github at srid.name",
+     url="http://github.com/ludwigschwardt/python-readline",
+     license="GNU GPL",
++    extra_path = 'readline',
+     platforms=['MacOS X', 'Posix'],
+     include_package_data=True,
+     ext_modules=[
+@@ -95,8 +84,7 @@
+                   sources=["Modules/%s.x/readline.c" % (sys.version_info[0],)],
+                   include_dirs=['.'],
+                   define_macros=DEFINE_MACROS,
+-                  extra_compile_args=['-Wno-strict-prototypes'] + UNIVERSAL.split(),
+-                  extra_link_args=UNIVERSAL.split(),
++                  extra_compile_args=['-Wno-strict-prototypes'],
+                   extra_objects=['readline/libreadline.a', 'readline/libhistory.a'], 
+                   libraries=['ncurses']
+         ),
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20111106/6d16451f/attachment.html>


More information about the macports-changes mailing list