• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python toolchain.info函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中pythonforandroid.toolchain.info函数的典型用法代码示例。如果您正苦于以下问题:Python info函数的具体用法?Python info怎么用?Python info使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了info函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: build_armeabi

    def build_armeabi(self):
        # AND: Should use an i386 recipe system
        warning('Running hostpython build. Arch is armeabi! '
                'This is naughty, need to fix the Arch system!')

        # AND: Fix armeabi again
        with current_directory(self.get_build_dir('armeabi')):

            if exists('hostpython'):
                info('hostpython already exists, skipping build')
                self.ctx.hostpython = join(self.get_build_dir('armeabi'),
                                           'hostpython')
                self.ctx.hostpgen = join(self.get_build_dir('armeabi'),
                                           'hostpgen')
                return
            
            configure = sh.Command('./configure')

            shprint(configure)
            shprint(sh.make, '-j5')

            shprint(sh.mv, join('Parser', 'pgen'), 'hostpgen')

            if exists('python.exe'):
                shprint(sh.mv, 'python.exe', 'hostpython')
            elif exists('python'):
                shprint(sh.mv, 'python', 'hostpython')
            else:
                warning('Unable to find the python executable after '
                        'hostpython build! Exiting.')
                exit(1)

        self.ctx.hostpython = join(self.get_build_dir('armeabi'), 'hostpython')
        self.ctx.hostpgen = join(self.get_build_dir('armeabi'), 'hostpgen')
开发者ID:micahjohnson150,项目名称:python-for-android,代码行数:34,代码来源:__init__.py


示例2: install_python_package

    def install_python_package(self, arch):
        env = self.get_recipe_env(arch)

        info('Installing {} into site-packages'.format(self.name))

        with current_directory(join(self.get_build_dir(arch.arch), 'python')):
            hostpython = sh.Command(self.hostpython_location)

            if self.ctx.python_recipe.from_crystax:
                hpenv = env.copy()
                shprint(hostpython, 'setup.py', 'install', '-O2',
                        '--root={}'.format(self.ctx.get_python_install_dir()),
                        '--install-lib=.',
                        '--cpp_implementation',
                        _env=hpenv, *self.setup_extra_args)
            else:
                hppath = join(dirname(self.hostpython_location), 'Lib',
                              'site-packages')
                hpenv = env.copy()
                if 'PYTHONPATH' in hpenv:
                    hpenv['PYTHONPATH'] = ':'.join([hppath] +
                                                   hpenv['PYTHONPATH'].split(':'))
                else:
                    hpenv['PYTHONPATH'] = hppath
                shprint(hostpython, 'setup.py', 'install', '-O2',
                        '--root={}'.format(self.ctx.get_python_install_dir()),
                        '--install-lib=lib/python2.7/site-packages',
                        '--cpp_implementation',
                        _env=hpenv, *self.setup_extra_args)
开发者ID:KeyWeeUsr,项目名称:python-for-android,代码行数:29,代码来源:__init__.py


示例3: build_arch

    def build_arch(self, arch):
        # AND: Should use an i386 recipe system
        warning("Running hostpython build. Arch is armeabi! " "This is naughty, need to fix the Arch system!")

        # AND: Fix armeabi again
        with current_directory(self.get_build_dir(arch.arch)):

            if exists("hostpython"):
                info("hostpython already exists, skipping build")
                self.ctx.hostpython = join(self.get_build_dir("armeabi"), "hostpython")
                self.ctx.hostpgen = join(self.get_build_dir("armeabi"), "hostpgen")
                return

            configure = sh.Command("./configure")

            shprint(configure)
            shprint(sh.make, "-j5", "BUILDPYTHON=hostpython", "hostpython", "PGEN=Parser/hostpgen", "Parser/hostpgen")

            shprint(sh.mv, join("Parser", "hostpgen"), "hostpgen")

            # if exists('python.exe'):
            #     shprint(sh.mv, 'python.exe', 'hostpython')
            # elif exists('python'):
            #     shprint(sh.mv, 'python', 'hostpython')
            if exists("hostpython"):
                pass  # The above commands should automatically create
                # the hostpython binary, unlike with python2
            else:
                warning("Unable to find the python executable after " "hostpython build! Exiting.")
                exit(1)

        self.ctx.hostpython = join(self.get_build_dir(arch.arch), "hostpython")
        self.ctx.hostpgen = join(self.get_build_dir(arch.arch), "hostpgen")
开发者ID:hottwaj,项目名称:python-for-android,代码行数:33,代码来源:__init__.py


示例4: prebuild_arch

    def prebuild_arch(self, arch):
        build_dir = self.get_build_container_dir(arch.arch)
        if exists(join(build_dir, '.patched')):
            info('Python2 already patched, skipping.')
            return
        self.apply_patch(join('patches', 'Python-{}-xcompile.patch'.format(self.version)),
                         arch.arch)
        self.apply_patch(join('patches', 'Python-{}-ctypes-disable-wchar.patch'.format(self.version)),
                         arch.arch)
        self.apply_patch(join('patches', 'disable-modules.patch'), arch.arch)
        self.apply_patch(join('patches', 'fix-locale.patch'), arch.arch)
        self.apply_patch(join('patches', 'fix-gethostbyaddr.patch'), arch.arch)
        self.apply_patch(join('patches', 'fix-setup-flags.patch'), arch.arch)
        self.apply_patch(join('patches', 'fix-filesystemdefaultencoding.patch'), arch.arch)
        self.apply_patch(join('patches', 'fix-termios.patch'), arch.arch)
        self.apply_patch(join('patches', 'custom-loader.patch'), arch.arch)
        self.apply_patch(join('patches', 'verbose-compilation.patch'), arch.arch)
        self.apply_patch(join('patches', 'fix-remove-corefoundation.patch'), arch.arch)
        self.apply_patch(join('patches', 'fix-dynamic-lookup.patch'), arch.arch)
        self.apply_patch(join('patches', 'fix-dlfcn.patch'), arch.arch)
        self.apply_patch(join('patches', 'parsetuple.patch'), arch.arch)
        # self.apply_patch(join('patches', 'ctypes-find-library.patch'), arch.arch)
        self.apply_patch(join('patches', 'ctypes-find-library-updated.patch'), arch.arch)

        if uname()[0] == 'Linux':
            self.apply_patch(join('patches', 'fix-configure-darwin.patch'), arch.arch)
            self.apply_patch(join('patches', 'fix-distutils-darwin.patch'), arch.arch)

        if self.ctx.android_api > 19:
            self.apply_patch(join('patches', 'fix-ftime-removal.patch'), arch.arch)

        shprint(sh.touch, join(build_dir, '.patched'))
开发者ID:zdzhjx,项目名称:python-for-android,代码行数:32,代码来源:__init__.py


示例5: build_arch

    def build_arch(self, arch):
        with current_directory(self.get_build_dir()):

            if exists('hostpython'):
                info('hostpython already exists, skipping build')
                self.ctx.hostpython = join(self.get_build_dir(),
                                           'hostpython')
                self.ctx.hostpgen = join(self.get_build_dir(),
                                           'hostpgen')
                return
            
            configure = sh.Command('./configure')

            shprint(configure)
            shprint(sh.make, '-j5')

            shprint(sh.mv, join('Parser', 'pgen'), 'hostpgen')

            if exists('python.exe'):
                shprint(sh.mv, 'python.exe', 'hostpython')
            elif exists('python'):
                shprint(sh.mv, 'python', 'hostpython')
            else:
                warning('Unable to find the python executable after '
                        'hostpython build! Exiting.')
                exit(1)

        self.ctx.hostpython = join(self.get_build_dir(), 'hostpython')
        self.ctx.hostpgen = join(self.get_build_dir(), 'hostpgen')
开发者ID:423230557,项目名称:python-for-android,代码行数:29,代码来源:__init__.py


示例6: build_armeabi

    def build_armeabi(self):
        # AND: I'm going to ignore any extra pythonrecipe or cythonrecipe behaviour for now
        
        arch = ArchAndroid(self.ctx)
        env = self.get_recipe_env(arch)
        
        env['CFLAGS'] = env['CFLAGS'] + ' -I{jni_path}/png -I{jni_path}/jpeg'.format(
            jni_path=join(self.ctx.bootstrap.build_dir, 'jni'))
        env['CFLAGS'] = env['CFLAGS'] + ' -I{jni_path}/sdl/include -I{jni_path}/sdl_mixer'.format(
            jni_path=join(self.ctx.bootstrap.build_dir, 'jni'))
        env['CFLAGS'] = env['CFLAGS'] + ' -I{jni_path}/sdl_ttf -I{jni_path}/sdl_image'.format(
            jni_path=join(self.ctx.bootstrap.build_dir, 'jni'))
        debug('pygame cflags', env['CFLAGS'])

        
        env['LDFLAGS'] = env['LDFLAGS'] + ' -L{libs_path} -L{src_path}/obj/local/{arch} -lm -lz'.format(
            libs_path=self.ctx.libs_dir, src_path=self.ctx.bootstrap.build_dir, arch=env['ARCH'])

        env['LDSHARED'] = join(self.ctx.root_dir, 'tools', 'liblink')

        with current_directory(self.get_build_dir('armeabi')):
            info('hostpython is ' + self.ctx.hostpython)
            hostpython = sh.Command(self.ctx.hostpython)
            shprint(hostpython, 'setup.py', 'install', '-O2', _env=env)

            info('strip is ' + env['STRIP'])
            build_lib = glob.glob('./build/lib*')
            assert len(build_lib) == 1
            print('stripping pygame')
            shprint(sh.find, build_lib[0], '-name', '*.o', '-exec',
                    env['STRIP'], '{}', ';')

        python_install_path = join(self.ctx.build_dir, 'python-install')
        # AND: Should do some deleting here!
        print('Should remove pygame tests etc. here, but skipping for now')
开发者ID:radiodee1,项目名称:python-for-android,代码行数:35,代码来源:__init__.py


示例7: run_distribute

    def run_distribute(self):
        info_main('# Creating Android project from build and {} bootstrap'.format(
            self.name))

        shprint(sh.rm, '-rf', self.dist_dir)
        shprint(sh.cp, '-r', self.build_dir, self.dist_dir)
        with current_directory(self.dist_dir):
            with open('local.properties', 'w') as fileh:
                fileh.write('sdk.dir={}'.format(self.ctx.sdk_dir))

        arch = self.ctx.archs[0]
        if len(self.ctx.archs) > 1:
            raise ValueError('built for more than one arch, but bootstrap cannot handle that yet')
        info('Bootstrap running with arch {}'.format(arch))

        with current_directory(self.dist_dir):
            info('Copying python distribution')

            self.distribute_libs(arch, [self.ctx.get_libs_dir(arch.arch)])
            self.distribute_aars(arch)
            self.distribute_javaclasses(self.ctx.javaclass_dir)

            python_bundle_dir = join('_python_bundle', '_python_bundle')
            ensure_dir(python_bundle_dir)
            site_packages_dir = self.ctx.python_recipe.create_python_bundle(
                join(self.dist_dir, python_bundle_dir), arch)

            if 'sqlite3' not in self.ctx.recipe_build_order:
                with open('blacklist.txt', 'a') as fileh:
                    fileh.write('\nsqlite3/*\nlib-dynload/_sqlite3.so\n')

        self.strip_libraries(arch)
        self.fry_eggs(site_packages_dir)
        super(WebViewBootstrap, self).run_distribute()
开发者ID:kronenpj,项目名称:python-for-android,代码行数:34,代码来源:__init__.py


示例8: prebuild_arch

 def prebuild_arch(self, arch):
     super(LibSDL2Image, self).prebuild_arch(arch)
     build_dir = self.get_build_dir(arch.arch)
     if exists(join(build_dir, ".patched")):
         info("SDL2_image already patched, skipping")
         return
     self.apply_patch("disable_webp.patch")
     shprint(sh.touch, join(build_dir, ".patched"))
开发者ID:micahjohnson150,项目名称:python-for-android,代码行数:8,代码来源:__init__.py


示例9: prebuild_armeabi

 def prebuild_armeabi(self):
     if exists(join(self.get_build_container_dir('armeabi'), '.patched')):
         info('Pygame already patched, skipping.')
         return
     shprint(sh.cp, join(self.get_recipe_dir(), 'Setup'),
             join(self.get_build_dir('armeabi'), 'Setup'))
     self.apply_patch(join('patches', 'fix-surface-access.patch'))
     self.apply_patch(join('patches', 'fix-array-surface.patch'))
     shprint(sh.touch, join(self.get_build_container_dir('armeabi'), '.patched'))
开发者ID:radiodee1,项目名称:python-for-android,代码行数:9,代码来源:__init__.py


示例10: build_compiled_components

    def build_compiled_components(self, arch):
        info('Configuring compiled components in {}'.format(self.name))

        env = self.get_recipe_env(arch)
        with current_directory(self.get_build_dir(arch.arch)):
            configure = sh.Command('./configure')
            shprint(configure, '--host=arm-eabi',
                    '--prefix={}'.format(self.ctx.get_python_install_dir()),
                    '--enable-shared', _env=env)
        super(PyCryptoRecipe, self).build_compiled_components(arch)
开发者ID:423230557,项目名称:python-for-android,代码行数:10,代码来源:__init__.py


示例11: run_distribute

    def run_distribute(self):
        info_main("# Creating Android project ({})".format(self.name))

        arch = self.ctx.archs[0]
        python_install_dir = self.ctx.get_python_install_dir()
        from_crystax = self.ctx.python_recipe.from_crystax

        if len(self.ctx.archs) > 1:
            raise ValueError("SDL2/gradle support only one arch")

        info("Copying SDL2/gradle build for {}".format(arch))
        shprint(sh.rm, "-rf", self.dist_dir)
        shprint(sh.cp, "-r", self.build_dir, self.dist_dir)

        # either the build use environment variable (ANDROID_HOME)
        # or the local.properties if exists
        with current_directory(self.dist_dir):
            with open('local.properties', 'w') as fileh:
                fileh.write('sdk.dir={}'.format(self.ctx.sdk_dir))

        with current_directory(self.dist_dir):
            info("Copying Python distribution")

            hostpython = sh.Command(self.ctx.hostpython)
            if self.ctx.python_recipe.name == 'python2':
                try:
                    shprint(hostpython, '-OO', '-m', 'compileall',
                            python_install_dir,
                            _tail=10, _filterout="^Listing")
                except sh.ErrorReturnCode:
                    pass
                if 'python2' in self.ctx.recipe_build_order and not exists('python-install'):
                    shprint(
                        sh.cp, '-a', python_install_dir, './python-install')

            self.distribute_libs(arch, [self.ctx.get_libs_dir(arch.arch)])
            self.distribute_javaclasses(self.ctx.javaclass_dir,
                                        dest_dir=join("src", "main", "java"))

            python_bundle_dir = join('_python_bundle', '_python_bundle')
            if 'python2' in self.ctx.recipe_build_order:
                # Python 2 is a special case with its own packaging location
                python_bundle_dir = 'private'
            ensure_dir(python_bundle_dir)

            site_packages_dir = self.ctx.python_recipe.create_python_bundle(
                join(self.dist_dir, python_bundle_dir), arch)

            if 'sqlite3' not in self.ctx.recipe_build_order:
                with open('blacklist.txt', 'a') as fileh:
                    fileh.write('\nsqlite3/*\nlib-dynload/_sqlite3.so\n')

        self.strip_libraries(arch)
        self.fry_eggs(site_packages_dir)
        super(SDL2GradleBootstrap, self).run_distribute()
开发者ID:KeyWeeUsr,项目名称:python-for-android,代码行数:55,代码来源:__init__.py


示例12: install_python_package

    def install_python_package(self, arch):
        env = self.get_recipe_env(arch)

        info('Installing {} into site-packages'.format(self.name))

        with current_directory(join(self.get_build_dir(arch.arch), 'python')):
            hostpython = sh.Command(self.hostpython_location)

            hpenv = env.copy()
            shprint(hostpython, 'setup.py', 'install', '-O2',
                    '--root={}'.format(self.ctx.get_python_install_dir()),
                    '--install-lib=.',
                    '--cpp_implementation',
                    _env=hpenv, *self.setup_extra_args)
开发者ID:PKRoma,项目名称:python-for-android,代码行数:14,代码来源:__init__.py


示例13: run_distribute

    def run_distribute(self):
        info_main('# Creating Android project from build and {} bootstrap'.format(
            self.name))

        # src_path = join(self.ctx.root_dir, 'bootstrap_templates',
        #                 self.name)
        src_path = join(self.bootstrap_dir, 'build')

        arch = self.ctx.archs[0]
        if len(self.ctx.archs) > 1:
            raise ValueError('built for more than one arch, but bootstrap cannot handle that yet')
        info('Bootstrap running with arch {}'.format(arch))

        with current_directory(self.dist_dir):

            info('Creating initial layout')
            for dirname in ('assets', 'bin', 'private', 'res', 'templates'):
                if not exists(dirname):
                    shprint(sh.mkdir, dirname)

            info('Copying default files')
            shprint(sh.cp, '-a', join(self.build_dir, 'project.properties'), '.')
            shprint(sh.cp, '-a', join(src_path, 'build.py'), '.')
            shprint(sh.cp, '-a', join(src_path, 'buildlib'), '.')
            shprint(sh.cp, '-a', join(src_path, 'src'), '.')
            shprint(sh.cp, '-a', join(src_path, 'templates'), '.')
            shprint(sh.cp, '-a', join(src_path, 'res'), '.')
            shprint(sh.cp, '-a', join(src_path, 'blacklist.txt'), '.')
            shprint(sh.cp, '-a', join(src_path, 'whitelist.txt'), '.')

            with open('local.properties', 'w') as fileh:
                fileh.write('sdk.dir={}'.format(self.ctx.sdk_dir))

            info('Copying python distribution')

            python_bundle_dir = join('_python_bundle', '_python_bundle')
            if 'python2legacy' in self.ctx.recipe_build_order:
                # a special case with its own packaging location
                python_bundle_dir = 'private'
                # And also must had an install directory, make sure of that
                self.ctx.python_recipe.create_python_install(self.dist_dir)

            self.distribute_libs(
                arch, [join(self.build_dir, 'libs', arch.arch),
                       self.ctx.get_libs_dir(arch.arch)])
            self.distribute_aars(arch)
            self.distribute_javaclasses(self.ctx.javaclass_dir)

            ensure_dir(python_bundle_dir)
            site_packages_dir = self.ctx.python_recipe.create_python_bundle(
                join(self.dist_dir, python_bundle_dir), arch)

            if 'sqlite3' not in self.ctx.recipe_build_order:
                with open('blacklist.txt', 'a') as fileh:
                    fileh.write('\nsqlite3/*\nlib-dynload/_sqlite3.so\n')

        self.strip_libraries(arch)
        self.fry_eggs(site_packages_dir)
        super(PygameBootstrap, self).run_distribute()
开发者ID:kivy,项目名称:python-for-android,代码行数:59,代码来源:__init__.py


示例14: build_arch

    def build_arch(self, arch):
        build_dir = self.get_build_dir(arch.arch)

        info("create links to icu libs")
        lib_dir = join(self.ctx.get_python_install_dir(), "lib")
        icu_libs = [f for f in os.listdir(lib_dir) if f.startswith("libicu")]

        for l in icu_libs:
            raw = l.rsplit(".", 1)[0]
            try:
                shprint(sh.ln, "-s", join(lib_dir, l), join(build_dir, raw))
            except Exception:
                pass

        super(PyICURecipe, self).build_arch(arch)
开发者ID:KeyWeeUsr,项目名称:python-for-android,代码行数:15,代码来源:__init__.py


示例15: build_armeabi

    def build_armeabi(self):

        if exists(join(self.ctx.libs_dir, 'libsdl.so')):
            info('libsdl.so already exists, skipping sdl build.')
            return
        
        env = ArchAndroid(self.ctx).get_env()

        with current_directory(self.get_jni_dir()):
            shprint(sh.ndk_build, 'V=1', _env=env)

        libs_dir = join(self.ctx.bootstrap.build_dir, 'libs', 'armeabi')
        import os
        contents = list(os.walk(libs_dir))[0][-1]
        for content in contents:
            shprint(sh.cp, '-a', join(self.ctx.bootstrap.build_dir, 'libs', 'armeabi', content),
                    self.ctx.libs_dir)
开发者ID:inclement,项目名称:python-for-android-revamp,代码行数:17,代码来源:__init__.py


示例16: build_arch

    def build_arch(self, arch):

        if not exists(join(self.get_build_dir(arch.arch), "libpython2.7.so")):
            self.do_python_build(arch)

        if not exists(self.ctx.get_python_install_dir()):
            shprint(
                sh.cp, "-a", join(self.get_build_dir(arch.arch), "python-install"), self.ctx.get_python_install_dir()
            )

        # This should be safe to run every time
        info("Copying hostpython binary to targetpython folder")
        shprint(sh.cp, self.ctx.hostpython, join(self.ctx.get_python_install_dir(), "bin", "python.host"))
        self.ctx.hostpython = join(self.ctx.get_python_install_dir(), "bin", "python.host")

        if not exists(join(self.ctx.get_libs_dir(arch.arch), "libpython2.7.so")):
            shprint(sh.cp, join(self.get_build_dir(arch.arch), "libpython2.7.so"), self.ctx.get_libs_dir(arch.arch))
开发者ID:latin1593,项目名称:python-for-android,代码行数:17,代码来源:__init__.py


示例17: build_arch

    def build_arch(self, arch):

        if not exists(join(self.get_build_dir(arch.arch), 'libpython2.7.so')):
            self.do_python_build(arch)

        if not exists(self.ctx.get_python_install_dir()):
            shprint(sh.cp, '-a', join(self.get_build_dir(arch.arch), 'python-install'),
                    self.ctx.get_python_install_dir())

        # This should be safe to run every time
        info('Copying hostpython binary to targetpython folder')
        shprint(sh.cp, self.ctx.hostpython,
                join(self.ctx.get_python_install_dir(), 'bin', 'python.host'))
        self.ctx.hostpython = join(self.ctx.get_python_install_dir(), 'bin', 'python.host')

        if not exists(join(self.ctx.get_libs_dir(arch.arch), 'libpython2.7.so')):
            shprint(sh.cp, join(self.get_build_dir(arch.arch), 'libpython2.7.so'), self.ctx.get_libs_dir(arch.arch))
开发者ID:hjw21century,项目名称:python-for-android,代码行数:17,代码来源:__init__.py


示例18: build_arch

 def build_arch(self, arch):
     super(VlcRecipe, self).build_arch(arch)
     build_dir = self.get_build_dir(arch.arch)
     port_dir = join(build_dir, 'vlc-port-android')
     aar = self.aars[arch]
     if not exists(aar):
         with current_directory(port_dir):
             env = dict(environ)
             env.update({
                 'ANDROID_ABI': arch.arch,
                 'ANDROID_NDK': self.ctx.ndk_dir,
                 'ANDROID_SDK': self.ctx.sdk_dir,
             })
             info("compiling vlc from sources")
             debug("environment: {}".format(env))
             if not exists(join('bin', 'VLC-debug.apk')):
                  shprint(sh.Command('./compile.sh'), _env=env,
                               _tail=50, _critical=True)
             shprint(sh.Command('./compile-libvlc.sh'), _env=env,
                         _tail=50, _critical=True)
     shprint(sh.cp, '-a', aar, self.ctx.aars_dir)
开发者ID:micahjohnson150,项目名称:python-for-android,代码行数:21,代码来源:__init__.py


示例19: build_armeabi

    def build_armeabi(self):
        # AND: Should use an i386 recipe system
        warning('Running hostpython build. Arch is armeabi! '
                'This is naughty, need to fix the Arch system!')

        # AND: Fix armeabi again
        with current_directory(self.get_build_dir('armeabi')):

            if exists('hostpython'):
                info('hostpython already exists, skipping build')
                self.ctx.hostpython = join(self.get_build_dir('armeabi'),
                                           'hostpython')
                self.ctx.hostpgen = join(self.get_build_dir('armeabi'),
                                         'hostpgen')
                return
            
            configure = sh.Command('./configure')

            shprint(configure)
            shprint(sh.make, '-j5', 'BUILDPYTHON=hostpython', 'hostpython',
                    'PGEN=Parser/hostpgen', 'Parser/hostpgen')

            shprint(sh.mv, join('Parser', 'hostpgen'), 'hostpgen')

            # if exists('python.exe'):
            #     shprint(sh.mv, 'python.exe', 'hostpython')
            # elif exists('python'):
            #     shprint(sh.mv, 'python', 'hostpython')
            if exists('hostpython'):
                pass  # The above commands should automatically create
                      # the hostpython binary, unlike with python2
            else:
                warning('Unable to find the python executable after '
                        'hostpython build! Exiting.')
                exit(1)

        self.ctx.hostpython = join(self.get_build_dir('armeabi'), 'hostpython')
        self.ctx.hostpgen = join(self.get_build_dir('armeabi'), 'hostpgen')
开发者ID:simudream,项目名称:python-for-android,代码行数:38,代码来源:__init__.py


示例20: build_cython_components

    def build_cython_components(self, arch):
        info('Cythonizing anything necessary in {}'.format(self.name))
        env = self.get_recipe_env(arch)
        with current_directory(self.get_build_dir(arch.arch)):
            hostpython = sh.Command(self.ctx.hostpython)
            info('Trying first build of {} to get cython files: this is '
                 'expected to fail'.format(self.name))
            try:
                shprint(hostpython, 'setup.py', 'build_ext', _env=env)
            except sh.ErrorReturnCode_1:
                print()
                info('{} first build failed (as expected)'.format(self.name))

            info('Running cython where appropriate')
            shprint(sh.find, self.get_build_dir('armeabi'), '-iname', '*.pyx', '-exec',
                    self.ctx.cython, '{}', ';', _env=env)
            info('ran cython')

            # shprint(hostpython, 'setup.py', 'build_ext', '-v', _env=env)

            print('stripping')
            build_lib = glob.glob('./build/lib*')
            shprint(sh.find, build_lib[0], '-name', '*.o', '-exec',
                    env['STRIP'], '{}', ';', _env=env)
            print('stripped!?')
            # exit(1)

            # Here we do *not* use the normal hostpython binary in the
            # target python dir, because twisted tries to import
            # _io.so which would fail.
            hostpython_build = sh.Command(join(
                Recipe.get_recipe('hostpython2', self.ctx).get_build_dir('armeabi'),
                'hostpython'))
            shprint(hostpython_build, 'setup.py', 'install', '-O2',
                    '--root={}'.format(self.ctx.get_python_install_dir()),
                    '--install-lib=/lib/python2.7/site-packages', _env=env)
开发者ID:warwickhunter,项目名称:python-for-android,代码行数:36,代码来源:__init__.py



注:本文中的pythonforandroid.toolchain.info函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python toolchain.shprint函数代码示例发布时间:2022-05-27
下一篇:
Python toolchain.current_directory函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap