mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 08:44:19 -04:00
Don't link extension modules with libpython; changes to help w/ building whls
This fixes compatibility issues with homebrew Python on Mac OS X. This introduces a --no-directscripts flag to disable building packpanda and eggcacher, which require linking with libpython (which is not available on manylinux). When building a wheel, the packpanda and eggcacher modules can instead be added to console_scripts in the entry_points definition.
This commit is contained in:
parent
92302942fe
commit
c1d6e93166
@ -88,3 +88,7 @@ class EggCacher:
|
|||||||
progress += size
|
progress += size
|
||||||
|
|
||||||
cacher = EggCacher(sys.argv[1:])
|
cacher = EggCacher(sys.argv[1:])
|
||||||
|
|
||||||
|
# Dummy main function so this can be added to console_scripts.
|
||||||
|
def main():
|
||||||
|
return 0
|
||||||
|
@ -419,3 +419,6 @@ else:
|
|||||||
if not(os.path.exists("/usr/bin/rpmbuild") or os.path.exists("/usr/bin/dpkg-deb")):
|
if not(os.path.exists("/usr/bin/rpmbuild") or os.path.exists("/usr/bin/dpkg-deb")):
|
||||||
exit("To build an installer, either rpmbuild or dpkg-deb must be present on your system!")
|
exit("To build an installer, either rpmbuild or dpkg-deb must be present on your system!")
|
||||||
|
|
||||||
|
# Dummy main function so this can be added to console_scripts.
|
||||||
|
def main():
|
||||||
|
return 0
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
This issue fixes several bugs that were still found in 1.9.2.
|
This issue fixes several bugs that were still found in 1.9.2.
|
||||||
|
|
||||||
|
* Fix crash when using homebrew Python on Mac OS X
|
||||||
* Fix crash when running in Steam on Linux when using OpenAL
|
* Fix crash when running in Steam on Linux when using OpenAL
|
||||||
* Fix crash using wx/tkinter on Mac as long as want-wx/tk is set
|
* Fix crash using wx/tkinter on Mac as long as want-wx/tk is set
|
||||||
* Fix loading models from 'models' package with models/ prefix
|
* Fix loading models from 'models' package with models/ prefix
|
||||||
|
@ -74,6 +74,7 @@ STRDXSDKVERSION = 'default'
|
|||||||
STRMSPLATFORMVERSION = 'default'
|
STRMSPLATFORMVERSION = 'default'
|
||||||
BOOUSEINTELCOMPILER = False
|
BOOUSEINTELCOMPILER = False
|
||||||
OPENCV_VER_23 = False
|
OPENCV_VER_23 = False
|
||||||
|
DIRECTSCRIPTS = True
|
||||||
|
|
||||||
if "MACOSX_DEPLOYMENT_TARGET" in os.environ:
|
if "MACOSX_DEPLOYMENT_TARGET" in os.environ:
|
||||||
OSXTARGET=os.environ["MACOSX_DEPLOYMENT_TARGET"]
|
OSXTARGET=os.environ["MACOSX_DEPLOYMENT_TARGET"]
|
||||||
@ -169,7 +170,7 @@ def usage(problem):
|
|||||||
def parseopts(args):
|
def parseopts(args):
|
||||||
global INSTALLER,RTDIST,RUNTIME,GENMAN,DISTRIBUTOR,VERSION
|
global INSTALLER,RTDIST,RUNTIME,GENMAN,DISTRIBUTOR,VERSION
|
||||||
global COMPRESSOR,THREADCOUNT,OSXTARGET,OSX_ARCHS,HOST_URL
|
global COMPRESSOR,THREADCOUNT,OSXTARGET,OSX_ARCHS,HOST_URL
|
||||||
global DEBVERSION,RPMRELEASE,GIT_COMMIT,P3DSUFFIX
|
global DEBVERSION,RPMRELEASE,GIT_COMMIT,P3DSUFFIX,DIRECTSCRIPTS
|
||||||
global STRDXSDKVERSION, STRMSPLATFORMVERSION, BOOUSEINTELCOMPILER
|
global STRDXSDKVERSION, STRMSPLATFORMVERSION, BOOUSEINTELCOMPILER
|
||||||
longopts = [
|
longopts = [
|
||||||
"help","distributor=","verbose","runtime","osxtarget=",
|
"help","distributor=","verbose","runtime","osxtarget=",
|
||||||
@ -177,7 +178,7 @@ def parseopts(args):
|
|||||||
"version=","lzma","no-python","threads=","outputdir=","override=",
|
"version=","lzma","no-python","threads=","outputdir=","override=",
|
||||||
"static","host=","debversion=","rpmrelease=","p3dsuffix=",
|
"static","host=","debversion=","rpmrelease=","p3dsuffix=",
|
||||||
"directx-sdk=", "platform-sdk=", "use-icl", "clean",
|
"directx-sdk=", "platform-sdk=", "use-icl", "clean",
|
||||||
"universal", "target=", "arch=", "git-commit="]
|
"universal", "target=", "arch=", "git-commit=", "no-directscripts"]
|
||||||
anything = 0
|
anything = 0
|
||||||
optimize = ""
|
optimize = ""
|
||||||
target = None
|
target = None
|
||||||
@ -223,6 +224,7 @@ def parseopts(args):
|
|||||||
# Backward compatibility, OPENGL was renamed to GL
|
# Backward compatibility, OPENGL was renamed to GL
|
||||||
elif (option=="--use-opengl"): PkgEnable("GL")
|
elif (option=="--use-opengl"): PkgEnable("GL")
|
||||||
elif (option=="--no-opengl"): PkgDisable("GL")
|
elif (option=="--no-opengl"): PkgDisable("GL")
|
||||||
|
elif (option=="--no-directscripts"): DIRECTSCRIPTS=False
|
||||||
elif (option=="--directx-sdk"):
|
elif (option=="--directx-sdk"):
|
||||||
STRDXSDKVERSION = value.strip().lower()
|
STRDXSDKVERSION = value.strip().lower()
|
||||||
if STRDXSDKVERSION == '':
|
if STRDXSDKVERSION == '':
|
||||||
@ -799,7 +801,7 @@ if (COMPILER=="GCC"):
|
|||||||
if GetTarget() != 'darwin':
|
if GetTarget() != 'darwin':
|
||||||
# CgGL is covered by the Cg framework, and we don't need X11 components on OSX
|
# CgGL is covered by the Cg framework, and we don't need X11 components on OSX
|
||||||
if not PkgSkip("NVIDIACG") and not RUNTIME:
|
if not PkgSkip("NVIDIACG") and not RUNTIME:
|
||||||
SmartPkgEnable("CGGL", "", ("CgGL"), "Cg/cgGL.h")
|
SmartPkgEnable("CGGL", "", ("CgGL"), "Cg/cgGL.h", thirdparty_dir = "nvidiacg")
|
||||||
if not RUNTIME:
|
if not RUNTIME:
|
||||||
SmartPkgEnable("X11", "x11", "X11", ("X11", "X11/Xlib.h"))
|
SmartPkgEnable("X11", "x11", "X11", ("X11", "X11/Xlib.h"))
|
||||||
SmartPkgEnable("XRANDR", "xrandr", "Xrandr", "X11/extensions/Xrandr.h")
|
SmartPkgEnable("XRANDR", "xrandr", "Xrandr", "X11/extensions/Xrandr.h")
|
||||||
@ -1646,6 +1648,11 @@ def CompileLink(dll, obj, opts):
|
|||||||
if LDFLAGS != "":
|
if LDFLAGS != "":
|
||||||
cmd += " " + LDFLAGS
|
cmd += " " + LDFLAGS
|
||||||
|
|
||||||
|
# Don't link libraries with Python.
|
||||||
|
if "PYTHON" in opts and GetOrigExt(dll) != ".exe" and not RTDIST:
|
||||||
|
opts = opts[:]
|
||||||
|
opts.remove("PYTHON")
|
||||||
|
|
||||||
for (opt, dir) in LIBDIRECTORIES:
|
for (opt, dir) in LIBDIRECTORIES:
|
||||||
if (opt=="ALWAYS") or (opt in opts):
|
if (opt=="ALWAYS") or (opt in opts):
|
||||||
cmd += ' -L' + BracketNameWithQuotes(dir)
|
cmd += ' -L' + BracketNameWithQuotes(dir)
|
||||||
@ -4822,7 +4829,7 @@ if (PkgSkip("DIRECT")==0):
|
|||||||
OPTS=['DIR:direct/src/directbase', 'PYTHON']
|
OPTS=['DIR:direct/src/directbase', 'PYTHON']
|
||||||
TargetAdd('p3directbase_directbase.obj', opts=OPTS+['BUILDING:DIRECT'], input='directbase.cxx')
|
TargetAdd('p3directbase_directbase.obj', opts=OPTS+['BUILDING:DIRECT'], input='directbase.cxx')
|
||||||
|
|
||||||
if (PkgSkip("PYTHON")==0 and not RTDIST and not RUNTIME):
|
if (PkgSkip("PYTHON")==0 and not RTDIST and not RUNTIME and DIRECTSCRIPTS):
|
||||||
DefSymbol("BUILDING:PACKPANDA", "IMPORT_MODULE", "direct.directscripts.packpanda")
|
DefSymbol("BUILDING:PACKPANDA", "IMPORT_MODULE", "direct.directscripts.packpanda")
|
||||||
TargetAdd('packpanda.obj', opts=OPTS+['BUILDING:PACKPANDA'], input='ppython.cxx')
|
TargetAdd('packpanda.obj', opts=OPTS+['BUILDING:PACKPANDA'], input='ppython.cxx')
|
||||||
TargetAdd('packpanda.exe', input='packpanda.obj')
|
TargetAdd('packpanda.exe', input='packpanda.obj')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user