Commits

Brandon Rhodes  committed b1ac4d4

Created a successful build process for Linux.

  • Participants
  • Parent commits 2071110

Comments (0)

Files changed (3)

 ^build$
 ^pyzmq-2.0.7$
+^uuid$
+^uuid-nt$
 ^util-linux-ng-2.18$
 ^tmp$
 ^zeromq-2.0.9$
 tar xvfz tmp/util-linux-ng-2.18.tar.gz
 tar xvfz tmp/zeromq-2.0.9.tar.gz
 tar xvfz tmp/pyzmq-2.0.7.tar.gz
+
+# Segregate out the UUID sources by operating system.
+rm -rf uuid
+mkdir uuid
+cp util-linux-ng-2.18/shlibs/uuid/src/*.c uuid
+
+mkdir uuid-nt
+cp util-linux-ng-2.18/shlibs/uuid/src/uuid.sym uuid-nt
+mv uuid/gen_uuid_nt.c uuid-nt
 import os
+import sys
 from distutils.core import setup, Extension
+from glob import glob
 
 def _(path):
-    return os.path.join(*path.split('/'))
+    return glob(os.path.join(*path.split('/')))
+
+sources = (
+    _('uuid/*.c') +
+    _('zeromq-2.0.9/src/*.cpp') +
+    _('pyzmq-2.0.7/zmq/_zmq.c')
+    )
+include_dirs = (
+    _('util-linux-ng-2.18/shlibs/uuid/src/') +
+    _('zeromq-2.0.9/include')
+    )
+extra_link_args = []
+
+if hasattr(sys, 'getwindowsversion'):
+    sources.extend(_('uuid-nt/*.c'))
+    extra_link_args.append(
+        '-Wl,--version-script=$(ul_libuuid_srcdir)/uuid.sym'
+        )
+
+ext = Extension('zmq._zmq', sources, include_dirs,
+                extra_link_args=extra_link_args)
 
 setup(name='pyzmq-static',
       version='2.0.7a',
       author_email='brandon@rhodesmill.org',
       url='http://bitbucket.org/brandon/pyzmq-static',
       packages=['zmq'],
-      package_dir={'zmq': _('pyzmq-2.0.7/zmq')},
-      ext_modules=[
-        #Extension('foo', ['foo.c'])
-        ],
+      package_dir={'zmq': os.path.join('pyzmq-2.0.7', 'zmq')},
+      ext_modules=[ ext ],
       )