|
|
5acdd80 |
From 12bee2a0828e2b6ec90e0641b7993c511b7e4c97 Mon Sep 17 00:00:00 2001
|
|
|
5acdd80 |
From: Robert Spanton <rspanton@zepler.net>
|
|
|
5acdd80 |
Date: Thu, 18 Jun 2009 19:48:01 +0100
|
|
|
5acdd80 |
Subject: [PATCH] Use the chipmunk shared library from the chipmunk package.
|
|
|
5acdd80 |
|
|
|
5acdd80 |
---
|
|
|
5acdd80 |
pymunk/libload.py | 33 ++-------------------------------
|
|
|
5acdd80 |
1 files changed, 2 insertions(+), 31 deletions(-)
|
|
|
5acdd80 |
|
|
|
5acdd80 |
diff --git a/pymunk/libload.py b/pymunk/libload.py
|
|
|
5acdd80 |
index e63c157..659525a 100644
|
|
|
5acdd80 |
--- pymunk/libload.py
|
|
|
5acdd80 |
+++ pymunk/libload.py
|
|
|
5acdd80 |
@@ -4,37 +4,8 @@ import sys, imp, os
|
|
|
5acdd80 |
import ctypes
|
|
|
5acdd80 |
|
|
|
5acdd80 |
def load_library(libname, print_path=True):
|
|
|
5acdd80 |
- # lib gets loaded from:
|
|
|
5acdd80 |
- # pymunk/libchipmunk.so, libchipmunk.dylib or chipmunk.dll
|
|
|
5acdd80 |
-
|
|
|
5acdd80 |
- s = platform.system()
|
|
|
5acdd80 |
- arch, _ = platform.architecture()
|
|
|
5acdd80 |
-
|
|
|
5acdd80 |
- path = os.path.dirname(os.path.abspath(__file__))
|
|
|
5acdd80 |
-
|
|
|
5acdd80 |
- try:
|
|
|
5acdd80 |
- if hasattr(sys, "frozen") or \
|
|
|
5acdd80 |
- hasattr(sys, "importers") or \
|
|
|
5acdd80 |
- hasattr(imp, "is_frozen") and imp.is_forzen("__main__"):
|
|
|
5acdd80 |
- if 'site-packages.zip' in __file__:
|
|
|
5acdd80 |
- path = os.path.join(os.path.dirname(os.getcwd()), 'Frameworks')
|
|
|
5acdd80 |
- else:
|
|
|
5acdd80 |
- path = os.path.dirname(os.path.abspath(sys.executable))
|
|
|
5acdd80 |
- except:
|
|
|
5acdd80 |
- pass
|
|
|
5acdd80 |
-
|
|
|
5acdd80 |
- if s == 'Linux':
|
|
|
5acdd80 |
- libfn = "lib%s.so" % libname
|
|
|
5acdd80 |
-
|
|
|
5acdd80 |
- elif s == 'Windows' or s == 'Microsoft':
|
|
|
5acdd80 |
- libfn = "%s.dll" % libname
|
|
|
5acdd80 |
-
|
|
|
5acdd80 |
- elif s == 'Darwin':
|
|
|
5acdd80 |
- libfn = "lib%s.dylib" % libname
|
|
|
5acdd80 |
-
|
|
|
5acdd80 |
- libfn = os.path.join(path, libfn)
|
|
|
5acdd80 |
+ # Library is always in this location on Fedora
|
|
|
5acdd80 |
+ libfn = "/usr/lib/libchipmunk.so"
|
|
|
5acdd80 |
|
|
|
5acdd80 |
- if print_path:
|
|
|
5acdd80 |
- print ("Loading chipmunk for %s (%s) [%s]" % (s, arch, libfn))
|
|
|
5acdd80 |
lib = ctypes.cdll.LoadLibrary(libfn)
|
|
|
5acdd80 |
return lib
|
|
|
5acdd80 |
--
|
|
|
5acdd80 |
1.6.2.2
|
|
|
5acdd80 |
|
|
|
5acdd80 |
--- setup.py.orig 2009-11-05 02:54:18.000000000 +0000
|
|
|
5acdd80 |
+++ setup.py 2009-11-05 02:54:10.000000000 +0000
|
|
|
5acdd80 |
@@ -73,12 +73,6 @@
|
|
|
5acdd80 |
, description='A wrapper for the 2d physics library Chipmunk'
|
|
|
5acdd80 |
, long_description=long_description
|
|
|
5acdd80 |
, packages=['pymunk'] #find_packages(exclude=['*.tests']),
|
|
|
5acdd80 |
- , package_data = {'pymunk': ['chipmunk.dll'
|
|
|
5acdd80 |
- , 'libchipmunk.so'
|
|
|
5acdd80 |
- , 'libchipmunk.dylib']}
|
|
|
5acdd80 |
- , eager_resources = [os.path.join('pymunk','chipmunk.dll')
|
|
|
5acdd80 |
- , os.path.join('pymunk','libchipmunk.so')
|
|
|
5acdd80 |
- , os.path.join('pymunk','libchipmunk.dylib')]
|
|
|
5acdd80 |
#, platforms=['win32']
|
|
|
5acdd80 |
, license='MIT License'
|
|
|
5acdd80 |
, classifiers=classifiers
|
|
|
5acdd80 |
--- pymunk.egg-info/SOURCES.txt~ 2009-11-05 02:58:38.000000000 +0000
|
|
|
5acdd80 |
+++ pymunk.egg-info/SOURCES.txt 2009-11-05 02:58:29.000000000 +0000
|
|
|
5acdd80 |
@@ -62,8 +62,6 @@
|
|
|
5acdd80 |
examples/pymunx_demo8_gravityfun.py
|
|
|
5acdd80 |
pymunk/__init__.py
|
|
|
5acdd80 |
pymunk/_chipmunk.py
|
|
|
5acdd80 |
-pymunk/chipmunk.dll
|
|
|
5acdd80 |
-pymunk/libchipmunk.so
|
|
|
5acdd80 |
pymunk/libload.py
|
|
|
5acdd80 |
pymunk/util.py
|
|
|
5acdd80 |
pymunk/vec2d.py
|