|
@@ -8,7 +8,6 @@ from __future__ import print_function
|
|
|
|
|
|
|
|
import collections
|
|
import collections
|
|
|
import os
|
|
import os
|
|
|
-import pip
|
|
|
|
|
import plistlib
|
|
import plistlib
|
|
|
import sys
|
|
import sys
|
|
|
import subprocess
|
|
import subprocess
|
|
@@ -393,6 +392,8 @@ class build_apps(setuptools.Command):
|
|
|
directory containing the Python runtime libraries, which will be added
|
|
directory containing the Python runtime libraries, which will be added
|
|
|
to sys.path."""
|
|
to sys.path."""
|
|
|
|
|
|
|
|
|
|
+ import pip
|
|
|
|
|
+
|
|
|
self.announce('Gathering wheels for platform: {}'.format(platform), distutils.log.INFO)
|
|
self.announce('Gathering wheels for platform: {}'.format(platform), distutils.log.INFO)
|
|
|
|
|
|
|
|
whldir = os.path.join(self.build_base, '__whl_cache__')
|
|
whldir = os.path.join(self.build_base, '__whl_cache__')
|
|
@@ -639,6 +640,28 @@ class build_apps(setuptools.Command):
|
|
|
freezer_modules = set()
|
|
freezer_modules = set()
|
|
|
freezer_modpaths = set()
|
|
freezer_modpaths = set()
|
|
|
ext_suffixes = set()
|
|
ext_suffixes = set()
|
|
|
|
|
+
|
|
|
|
|
+ def get_search_path_for(source_path):
|
|
|
|
|
+ search_path = [os.path.dirname(source_path)]
|
|
|
|
|
+ if use_wheels:
|
|
|
|
|
+ search_path.append(os.path.join(p3dwhlfn, 'deploy_libs'))
|
|
|
|
|
+
|
|
|
|
|
+ # If the .whl containing this file has a .libs directory, add
|
|
|
|
|
+ # it to the path. This is an auditwheel/numpy convention.
|
|
|
|
|
+ if '.whl' + os.sep in source_path:
|
|
|
|
|
+ whl, wf = source_path.split('.whl' + os.path.sep)
|
|
|
|
|
+ whl += '.whl'
|
|
|
|
|
+ rootdir = wf.split(os.path.sep, 1)[0]
|
|
|
|
|
+ search_path.append(os.path.join(whl, rootdir, '.libs'))
|
|
|
|
|
+
|
|
|
|
|
+ # Also look for more specific per-package cases, defined in
|
|
|
|
|
+ # PACKAGE_LIB_DIRS at the top of this file.
|
|
|
|
|
+ whl_name = os.path.basename(whl).split('-', 1)[0]
|
|
|
|
|
+ extra_dirs = PACKAGE_LIB_DIRS.get(whl_name, [])
|
|
|
|
|
+ for extra_dir in extra_dirs:
|
|
|
|
|
+ search_path.append(os.path.join(whl, extra_dir.replace('/', os.path.sep)))
|
|
|
|
|
+ return search_path
|
|
|
|
|
+
|
|
|
def create_runtime(appname, mainscript, use_console):
|
|
def create_runtime(appname, mainscript, use_console):
|
|
|
freezer = FreezeTool.Freezer(platform=platform, path=path)
|
|
freezer = FreezeTool.Freezer(platform=platform, path=path)
|
|
|
freezer.addModule('__main__', filename=mainscript)
|
|
freezer.addModule('__main__', filename=mainscript)
|
|
@@ -781,26 +804,8 @@ class build_apps(setuptools.Command):
|
|
|
continue
|
|
continue
|
|
|
|
|
|
|
|
# If this is a dynamic library, search for dependencies.
|
|
# If this is a dynamic library, search for dependencies.
|
|
|
- search_path = [os.path.dirname(source_path)]
|
|
|
|
|
- if use_wheels:
|
|
|
|
|
- search_path.append(os.path.join(p3dwhlfn, 'deploy_libs'))
|
|
|
|
|
-
|
|
|
|
|
- # If the .whl containing this file has a .libs directory, add
|
|
|
|
|
- # it to the path. This is an auditwheel/numpy convention.
|
|
|
|
|
- if '.whl' + os.sep in source_path:
|
|
|
|
|
- whl, wf = source_path.split('.whl' + os.path.sep)
|
|
|
|
|
- whl += '.whl'
|
|
|
|
|
- rootdir = wf.split(os.path.sep, 1)[0]
|
|
|
|
|
- search_path.append(os.path.join(whl, rootdir, '.libs'))
|
|
|
|
|
-
|
|
|
|
|
- # Also look for more specific per-package cases, defined in
|
|
|
|
|
- # PACKAGE_LIB_DIRS at the top of this file.
|
|
|
|
|
- whl_name = os.path.basename(whl).split('-', 1)[0]
|
|
|
|
|
- extra_dirs = PACKAGE_LIB_DIRS.get(whl_name, [])
|
|
|
|
|
- for extra_dir in extra_dirs:
|
|
|
|
|
- search_path.append(os.path.join(whl, extra_dir.replace('/', os.path.sep)))
|
|
|
|
|
-
|
|
|
|
|
target_path = os.path.join(builddir, basename)
|
|
target_path = os.path.join(builddir, basename)
|
|
|
|
|
+ search_path = get_search_path_for(source_path)
|
|
|
self.copy_with_dependencies(source_path, target_path, search_path)
|
|
self.copy_with_dependencies(source_path, target_path, search_path)
|
|
|
|
|
|
|
|
# Copy over the tcl directory.
|
|
# Copy over the tcl directory.
|
|
@@ -846,12 +851,15 @@ class build_apps(setuptools.Command):
|
|
|
relpath = wf[len(source_dir) + 1:]
|
|
relpath = wf[len(source_dir) + 1:]
|
|
|
source_path = os.path.join(whl, wf)
|
|
source_path = os.path.join(whl, wf)
|
|
|
target_path = os.path.join(target_dir, relpath)
|
|
target_path = os.path.join(target_dir, relpath)
|
|
|
- self.copy(source_path, target_path)
|
|
|
|
|
|
|
|
|
|
if 'PKG_DATA_MAKE_EXECUTABLE' in flags:
|
|
if 'PKG_DATA_MAKE_EXECUTABLE' in flags:
|
|
|
|
|
+ search_path = get_search_path_for(source_path)
|
|
|
|
|
+ self.copy_with_dependencies(source_path, target_path, search_path)
|
|
|
mode = os.stat(target_path).st_mode
|
|
mode = os.stat(target_path).st_mode
|
|
|
mode |= stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH
|
|
mode |= stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH
|
|
|
os.chmod(target_path, mode)
|
|
os.chmod(target_path, mode)
|
|
|
|
|
+ else:
|
|
|
|
|
+ self.copy(source_path, target_path)
|
|
|
|
|
|
|
|
# Copy Game Files
|
|
# Copy Game Files
|
|
|
self.announce('Copying game files for platform: {}'.format(platform), distutils.log.INFO)
|
|
self.announce('Copying game files for platform: {}'.format(platform), distutils.log.INFO)
|