Skip to content

Commit 7711757

Browse files
committed
makewheel: add Python DLL before adding panda3d modules
This should ensure that dependencies of Python (such as VCRUNTIME140.DLL) make it into the deploy_libs folder, rather than the panda3d folder.
1 parent c646924 commit 7711757

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

makepanda/makewheel.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,26 @@ def makewheel(version, output_dir, platform=None):
604604

605605
whl.ignore_deps.update(MANYLINUX_LIBS)
606606

607+
# Add libpython for deployment.
608+
if sys.platform in ('win32', 'cygwin'):
609+
pylib_name = 'python{0}{1}.dll'.format(*sys.version_info)
610+
pylib_path = os.path.join(get_config_var('BINDIR'), pylib_name)
611+
elif sys.platform == 'darwin':
612+
pylib_name = 'libpython{0}.{1}.dylib'.format(*sys.version_info)
613+
pylib_path = os.path.join(get_config_var('LIBDIR'), pylib_name)
614+
else:
615+
pylib_name = get_config_var('LDLIBRARY')
616+
pylib_arch = get_config_var('MULTIARCH')
617+
libdir = get_config_var('LIBDIR')
618+
if pylib_arch and os.path.exists(os.path.join(libdir, pylib_arch, pylib_name)):
619+
pylib_path = os.path.join(libdir, pylib_arch, pylib_name)
620+
else:
621+
pylib_path = os.path.join(libdir, pylib_name)
622+
623+
# If Python was linked statically, we don't need to include this.
624+
if not pylib_name.endswith('.a'):
625+
whl.write_file('deploy_libs/' + pylib_name, pylib_path)
626+
607627
# Add the trees with Python modules.
608628
whl.write_directory('direct', direct_dir)
609629

@@ -723,26 +743,6 @@ def makewheel(version, output_dir, platform=None):
723743
whl.write_file(info_dir + '/README.md', readme_src)
724744
whl.write_file_data(info_dir + '/top_level.txt', 'direct\npanda3d\npandac\npanda3d_tools\n')
725745

726-
# Add libpython for deployment
727-
if sys.platform in ('win32', 'cygwin'):
728-
pylib_name = 'python{0}{1}.dll'.format(*sys.version_info)
729-
pylib_path = os.path.join(get_config_var('BINDIR'), pylib_name)
730-
elif sys.platform == 'darwin':
731-
pylib_name = 'libpython{0}.{1}.dylib'.format(*sys.version_info)
732-
pylib_path = os.path.join(get_config_var('LIBDIR'), pylib_name)
733-
else:
734-
pylib_name = get_config_var('LDLIBRARY')
735-
pylib_arch = get_config_var('MULTIARCH')
736-
libdir = get_config_var('LIBDIR')
737-
if pylib_arch and os.path.exists(os.path.join(libdir, pylib_arch, pylib_name)):
738-
pylib_path = os.path.join(libdir, pylib_arch, pylib_name)
739-
else:
740-
pylib_path = os.path.join(libdir, pylib_name)
741-
742-
# If Python was linked statically, we don't need to include this.
743-
if not pylib_name.endswith('.a'):
744-
whl.write_file('deploy_libs/' + pylib_name, pylib_path)
745-
746746
whl.close()
747747

748748

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy