mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
Fix Mac OS X Snow Leopard build
This commit is contained in:
parent
46c8990f40
commit
83507e413f
@ -38,7 +38,6 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
import random
|
import random
|
||||||
import time
|
import time
|
||||||
import importlib
|
|
||||||
|
|
||||||
__report_indent = 3
|
__report_indent = 3
|
||||||
|
|
||||||
@ -61,6 +60,42 @@ def Functor(function, *args, **kArgs):
|
|||||||
return functor
|
return functor
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
try:
|
||||||
|
import importlib
|
||||||
|
except ImportError:
|
||||||
|
# Backward compatibility for Python 2.6.
|
||||||
|
def _resolve_name(name, package, level):
|
||||||
|
if not hasattr(package, 'rindex'):
|
||||||
|
raise ValueError("'package' not set to a string")
|
||||||
|
dot = len(package)
|
||||||
|
for x in xrange(level, 1, -1):
|
||||||
|
try:
|
||||||
|
dot = package.rindex('.', 0, dot)
|
||||||
|
except ValueError:
|
||||||
|
raise ValueError("attempted relative import beyond top-level "
|
||||||
|
"package")
|
||||||
|
return "%s.%s" % (package[:dot], name)
|
||||||
|
|
||||||
|
def import_module(name, package=None):
|
||||||
|
if name.startswith('.'):
|
||||||
|
if not package:
|
||||||
|
raise TypeError("relative imports require the 'package' argument")
|
||||||
|
level = 0
|
||||||
|
for character in name:
|
||||||
|
if character != '.':
|
||||||
|
break
|
||||||
|
level += 1
|
||||||
|
name = _resolve_name(name[level:], package, level)
|
||||||
|
__import__(name)
|
||||||
|
return sys.modules[name]
|
||||||
|
|
||||||
|
imp = import_module('imp')
|
||||||
|
importlib = imp.new_module("importlib")
|
||||||
|
importlib._resolve_name = _resolve_name
|
||||||
|
importlib.import_module = import_module
|
||||||
|
sys.modules['importlib'] = importlib
|
||||||
|
|
||||||
|
|
||||||
class Functor:
|
class Functor:
|
||||||
def __init__(self, function, *args, **kargs):
|
def __init__(self, function, *args, **kargs):
|
||||||
assert callable(function), "function should be a callable obj"
|
assert callable(function), "function should be a callable obj"
|
||||||
|
@ -4599,7 +4599,7 @@ if (GetTarget() == 'darwin' and PkgSkip("COCOA")==0 and PkgSkip("GL")==0 and not
|
|||||||
if (PkgSkip('PANDAFX')==0):
|
if (PkgSkip('PANDAFX')==0):
|
||||||
TargetAdd('libpandagl.dll', input='libpandafx.dll')
|
TargetAdd('libpandagl.dll', input='libpandafx.dll')
|
||||||
TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
|
TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
|
||||||
TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'COCOA'])
|
TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'COCOA', 'CARBON'])
|
||||||
|
|
||||||
#
|
#
|
||||||
# DIRECTORY: panda/src/osxdisplay/
|
# DIRECTORY: panda/src/osxdisplay/
|
||||||
|
@ -2002,6 +2002,11 @@ def SdkLocatePython(prefer_thirdparty_python=False):
|
|||||||
SDK["PYTHONVERSION"] = "python" + ver
|
SDK["PYTHONVERSION"] = "python" + ver
|
||||||
SDK["PYTHONEXEC"] = "/System/Library/Frameworks/Python.framework/Versions/" + ver + "/bin/python" + ver
|
SDK["PYTHONEXEC"] = "/System/Library/Frameworks/Python.framework/Versions/" + ver + "/bin/python" + ver
|
||||||
|
|
||||||
|
# Avoid choosing the one in the thirdparty package dir.
|
||||||
|
PkgSetCustomLocation("PYTHON")
|
||||||
|
IncDirectory("PYTHON", py_fwx + "/include")
|
||||||
|
LibDirectory("PYTHON", "%s/usr/lib" % (SDK.get("MACOSX", "")))
|
||||||
|
|
||||||
if sys.version[:3] != ver:
|
if sys.version[:3] != ver:
|
||||||
print("Warning: building with Python %s instead of %s since you targeted a specific Mac OS X version." % (ver, sys.version[:3]))
|
print("Warning: building with Python %s instead of %s since you targeted a specific Mac OS X version." % (ver, sys.version[:3]))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user