[84109] trunk/dports/python

adfernandes at macports.org adfernandes at macports.org
Sat Sep 17 05:29:37 PDT 2011


Revision: 84109
          http://trac.macports.org/changeset/84109
Author:   adfernandes at macports.org
Date:     2011-09-17 05:29:34 -0700 (Sat, 17 Sep 2011)
Log Message:
-----------
new port: py27-pylibelf : using py27, cannot get it to work with the python portgroup, advice appreciated

Added Paths:
-----------
    trunk/dports/python/py27-pylibelf/
    trunk/dports/python/py27-pylibelf/Portfile
    trunk/dports/python/py27-pylibelf/files/
    trunk/dports/python/py27-pylibelf/files/setup.diff

Added: trunk/dports/python/py27-pylibelf/Portfile
===================================================================
--- trunk/dports/python/py27-pylibelf/Portfile	                        (rev 0)
+++ trunk/dports/python/py27-pylibelf/Portfile	2011-09-17 12:29:34 UTC (rev 84109)
@@ -0,0 +1,39 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
+# $Id$
+
+PortSystem      1.0
+PortGroup       python27 1.0
+
+set myname      pylibelf
+name            py27-${myname}
+version         0.1.20110915
+categories-append   devel
+platforms       darwin
+maintainers     adfernandes openmaintainer
+description     Pythonic wrapper for the libelf library.
+
+long_description \
+    ${description}
+
+homepage    http://eggy.yolky.org/pylibelf/static/docs/index.html
+fetch.type  hg
+hg.url      https://bitbucket.org/eggy/pylibelf
+hg.tag      81d39db22cbd
+worksrcdir  ${name}-${version}
+
+patch.pre_args  -p1
+patchfiles      setup.diff
+
+checksums   files/setup.diff \
+            sha1   33cff8a1ccfb1537e8d6b54899ec4d44eed499ac \
+            rmd160 89362c1af28818fb5d2cba83094269aa9c0afe0b
+
+post-patch {
+    reinplace "s|@@PREFIX@@|${prefix}|g" ${worksrcpath}/setup.py
+    reinplace "s|@@PREFIX@@|${prefix}|g" ${worksrcpath}/constfile2cython.py
+}
+
+depends_lib-append  port:py27-cython port:py27-ply
+
+livecheck.type  regex
+livecheck.regex ${myname}\\s+v\\d+(.\\d+)\\s+documentation


Property changes on: trunk/dports/python/py27-pylibelf/Portfile
___________________________________________________________________
Added: svn:keywords
   + Id
Added: svn:eol-style
   + native

Added: trunk/dports/python/py27-pylibelf/files/setup.diff
===================================================================
--- trunk/dports/python/py27-pylibelf/files/setup.diff	                        (rev 0)
+++ trunk/dports/python/py27-pylibelf/files/setup.diff	2011-09-17 12:29:34 UTC (rev 84109)
@@ -0,0 +1,74 @@
+diff -r 81d39db22cbd constfile2cython.py
+--- a/constfile2cython.py	Thu Sep 15 19:29:00 2011 +0100
++++ b/constfile2cython.py	Fri Sep 16 15:34:40 2011 -0400
+@@ -435,7 +435,7 @@
+ 
+ def defined(constant, *headers):
+     if not headers:
+-        headers = '<elf.h>', '<libelf/libelf.h>', '<libelf/gelf.h>'
++        headers = '<libelf/sys_elf.h>', '<libelf/libelf.h>', '<libelf/gelf.h>'
+ 
+     includes = '\n'.join('#include %s' % header for header in headers)
+     id1, id2 = uuid.uuid4().hex, uuid.uuid4().hex
+@@ -450,7 +450,7 @@
+ ''' % (includes, constant, id1, id2)
+ 
+     try:
+-        p = subprocess.Popen(['cpp'], stdin=subprocess.PIPE,
++        p = subprocess.Popen(['cpp','-I@@PREFIX@@/include'], stdin=subprocess.PIPE,
+                                       stdout=subprocess.PIPE,
+                                       stderr=subprocess.PIPE)
+     except OSError:
+@@ -509,7 +509,7 @@
+         '%s._%s' % (base.replace(os.sep, '.'), out_file),
+         [source],
+         depends=[pyxfn, pxdfn],
+-        include_dirs=[base],
++        include_dirs=['@@PREFIX@@/include',base],
+     )
+ 
+     if older(constfile, (pyfn, pyxfn, pxdfn)) or not generate:
+diff -r 81d39db22cbd pylibelf/constants_elf_h_relocation
+--- a/pylibelf/constants_elf_h_relocation	Thu Sep 15 19:29:00 2011 +0100
++++ b/pylibelf/constants_elf_h_relocation	Fri Sep 16 15:34:40 2011 -0400
+@@ -1,5 +1,5 @@
+ output_file: 'constants_elf_h_relocation'
+-header: 'elf.h'
++header: 'libelf/sys_elf.h'
+ 
+ dict relocationtype:
+     nesteddict EM_68K:
+diff -r 81d39db22cbd pylibelf/elfpy.h
+--- a/pylibelf/elfpy.h	Thu Sep 15 19:29:00 2011 +0100
++++ b/pylibelf/elfpy.h	Fri Sep 16 15:34:40 2011 -0400
+@@ -1,4 +1,4 @@
+-#include <elf.h>
++#include <libelf/sys_elf.h>
+ #include <libelf/libelf.h>
+ #include <libelf/gelf.h>
+ 
+diff -r 81d39db22cbd pylibelf/elftypes.pxd
+--- a/pylibelf/elftypes.pxd	Thu Sep 15 19:29:00 2011 +0100
++++ b/pylibelf/elftypes.pxd	Fri Sep 16 15:34:40 2011 -0400
+@@ -166,7 +166,7 @@
+     ctypedef GElf_Vernaux Elf32_Vernaux
+ 
+ 
+-    # "elf.h"
++    # "libelf/sys_elf.h"
+     ctypedef struct GElf_Ehdr:
+         unsigned char e_ident[16]         # Magic number and other info
+         GElf_Half    e_type            # Object file type
+diff -r 81d39db22cbd setup.py
+--- a/setup.py	Thu Sep 15 19:29:00 2011 +0100
++++ b/setup.py	Fri Sep 16 15:34:40 2011 -0400
+@@ -117,7 +117,8 @@
+     ext_modules = [
+         Extension('pylibelf.libelf', [source],
+                   depends=_libelf_depends,
+-                  libraries=['elf']),
++                  libraries=['elf'],
++				  include_dirs=['@@PREFIX@@/include'])
+     ]
+ 
+     setup(
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110917/d1f1233d/attachment.html>


More information about the macports-changes mailing list