How to use the crossenv.utils.install_script function in crossenv

To help you get started, we’ve selected a few crossenv examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github benfogle / crossenv / crossenv / __init__.py View on Github external
libs = ''
                inc = ''

            libs = glob.glob(libs)
            if not libs:
                logger.warning("No libs in sysroot. Does it exist?")
            else:
                libs = os.pathsep.join(libs)
                extra_envs.append(('LIBRARY_PATH', ':=', libs))

            if not os.path.isdir(inc):
                logger.warning("No include/ in sysroot. Does it exist?")
            else:
                extra_envs.append(('CPATH', ':=', inc))

        utils.install_script('pywrapper.py.tmpl', context.cross_env_exe, locals())

        for exe in ('python', 'python3'):
            exe = os.path.join(context.cross_bin_path, exe)
            if not os.path.exists(exe):
                utils.symlink(context.python_exe, exe)

        # Install patches to environment
        utils.install_script('site.py.tmpl',
                os.path.join(context.lib_path, 'site.py'),
                locals())
        self.copy_and_patch_sysconfigdata(context)

        # cross-python is ready. We will use build-pip to install cross-pip
        # because 'python -m ensurepip' is likely to get confused and think
        # that there's nothing to do.
        if self.with_cross_pip:
github benfogle / crossenv / crossenv / __init__.py View on Github external
def post_setup(self, context):
        """
        Extra processing. Put scripts/binaries in the right place.
        """

        utils.install_script('cross-expose.py.tmpl',
                os.path.join(context.bin_path, 'cross-expose'),
                locals())

        # Don't trust these to be symlinks. A symlink to Python will mess up
        # the virtualenv.

        # Add cross-python alias to the path. This is just for
        # convenience and clarity.
        for exe in os.listdir(context.cross_bin_path):
            target = os.path.join(context.cross_bin_path, exe)
            if not os.path.isfile(target) or not os.access(target, os.X_OK):
                continue
            dest = os.path.join(context.bin_path, 'cross-' + exe)
            utils.make_launcher(target, dest)

        # Add build-python and build-pip to the path.
github benfogle / crossenv / crossenv / __init__.py View on Github external
extra_envs.append(('LIBRARY_PATH', ':=', libs))

            if not os.path.isdir(inc):
                logger.warning("No include/ in sysroot. Does it exist?")
            else:
                extra_envs.append(('CPATH', ':=', inc))

        utils.install_script('pywrapper.py.tmpl', context.cross_env_exe, locals())

        for exe in ('python', 'python3'):
            exe = os.path.join(context.cross_bin_path, exe)
            if not os.path.exists(exe):
                utils.symlink(context.python_exe, exe)

        # Install patches to environment
        utils.install_script('site.py.tmpl',
                os.path.join(context.lib_path, 'site.py'),
                locals())
        self.copy_and_patch_sysconfigdata(context)

        # cross-python is ready. We will use build-pip to install cross-pip
        # because 'python -m ensurepip' is likely to get confused and think
        # that there's nothing to do.
        if self.with_cross_pip:
            logger.info("Installing cross-pip")

            # Make sure we install the same version of pip and setuptools to
            logger.debug("Installing: %s", context.build_pip_reqs)
            subprocess.check_output([context.cross_env_exe, '-m', 'pip',
                '--disable-pip-version-check',
                'install',
                '--ignore-installed',