Browse Source

makewheel: Add libpython to deploy_libs

TODO: See if there is a better way to do this and to test/implement macOS support.
Mitchell Stokes 9 years ago
parent
commit
3347a6e2cb
1 changed files with 9 additions and 0 deletions
  1. 9 0
      makepanda/makewheel.py

+ 9 - 0
makepanda/makewheel.py

@@ -590,6 +590,15 @@ def makewheel(version, output_dir, platform=default_platform):
     whl.write_file(info_dir + '/README.md', readme_src)
     whl.write_file(info_dir + '/README.md', readme_src)
     whl.write_file_data(info_dir + '/top_level.txt', 'direct\npanda3d\npandac\npanda3d_tools\n')
     whl.write_file_data(info_dir + '/top_level.txt', 'direct\npanda3d\npandac\npanda3d_tools\n')
 
 
+    # Add libpython for deployment
+    if sys.platform in ('win32', 'cygwin'):
+        pylib_name = 'python{0}{1}.dll'.format(*sys.version_info)
+        pylib_path = os.path.join(get_config_var('BINDIR'), pylib_name)
+    else:
+        pylib_name = get_config_var('LDLIBRARY')
+        pylib_path = os.path.join(get_config_var('LIBDIR'), pylib_name)
+    whl.write_file('/deploy_libs/' + pylib_name, pylib_path)
+
     whl.close()
     whl.close()