本文整理汇总了Python中toolchain.shprint函数的典型用法代码示例。如果您正苦于以下问题:Python shprint函数的具体用法?Python shprint怎么用?Python shprint使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了shprint函数的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: install
def install(self):
"""
Do the equivalent of
python setup.py build_ext install
while setting the proper environment variables
"""
arch = list(self.filtered_archs)[0]
build_env = self.get_recipe_env(arch)
hostpython = sh.Command(self.ctx.hostpython)
subdir_path = self.get_build_dir(arch.arch)
setup_path = join(subdir_path,"setup.py")
dest_dir = join (self.ctx.dist_dir, "root", "python")
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
#Note: Throws error if PATH is not set. I am not sure if this will cause problems
# in other architectures.
build_env['PATH']= os.environ.get('PATH')
shprint(hostpython,
setup_path,
"build_ext",
#"--compiler=mingw32", #note: throws clang error
"install",
_env=build_env)
开发者ID:kivy,项目名称:kivy-ios,代码行数:25,代码来源:__init__.py
示例2: install
def install(self):
arch = list(self.filtered_archs)[0]
build_env = arch.get_env()
build_dir = self.get_build_dir(arch.arch)
build_env["PATH"] = os.environ["PATH"]
# Compiling sometimes looks for Python-ast.py in the 'Python' i.s.o.
# the 'hostpython' folder. Create a symlink to fix. See issue #201
shprint(sh.ln, "-s",
join(build_dir, "hostpython"),
join(build_dir, "Python"))
shprint(sh.make, self.ctx.concurrent_make,
"-C", build_dir,
"bininstall", "inclinstall",
_env=build_env)
pylib_dir = join(self.ctx.dist_dir, "hostpython", "lib", "python2.7")
if exists(pylib_dir):
shutil.rmtree(pylib_dir)
shutil.copytree(
join(build_dir, "Lib"),
pylib_dir)
ensure_dir(join(pylib_dir, "config"))
shutil.copy(
join(build_dir, "Makefile"),
join(pylib_dir, "config", "Makefile"))
shutil.copy(
join(build_dir, "Parser", "pgen"),
join(self.ctx.dist_dir, "hostpython", "bin", "pgen"))
开发者ID:tonibagur,项目名称:kivy-ios,代码行数:27,代码来源:__init__.py
示例3: build_arch
def build_arch(self, arch):
build_env = arch.get_env()
configure = sh.Command(join(self.build_dir, "configure"))
shprint(configure,
"CC={}".format(build_env["CC"]),
"LD={}".format(build_env["LD"]),
"CFLAGS={}".format(build_env["CFLAGS"]),
"LDFLAGS={} -undefined dynamic_lookup".format(build_env["LDFLAGS"]),
"--without-pymalloc",
"--disable-toolbox-glue",
"--host={}-apple-darwin".format(arch),
"--prefix=/python",
"--with-system-ffi",
"--without-doc-strings",
"--enable-ipv6",
_env=build_env)
self._patch_pyconfig()
self.apply_patch("ctypes_duplicate.patch")
self.apply_patch("ctypes_duplicate_longdouble.patch")
shprint(sh.make, self.ctx.concurrent_make,
"CROSS_COMPILE_TARGET=yes",
"HOSTPYTHON={}".format(self.ctx.hostpython),
"HOSTPGEN={}".format(self.ctx.hostpgen))
开发者ID:kivy,项目名称:kivy-ios,代码行数:25,代码来源:__init__.py
示例4: biglink
def biglink(self):
dirs = []
for root, dirnames, filenames in os.walk(self.build_dir):
if fnmatch.filter(filenames, "*.so.libs"):
dirs.append(root)
cmd = sh.Command(join(self.ctx.root_dir, "tools", "biglink"))
shprint(cmd, join(self.build_dir, "libpil.a"), *dirs)
开发者ID:jadeblaquiere,项目名称:kivy-ios,代码行数:7,代码来源:__init__.py
示例5: build_x86_64
def build_x86_64(self):
sdk_path = sh.xcrun("--sdk", "macosx", "--show-sdk-path").strip()
build_env = self.ctx.env.copy()
ccache = (build_env["CCACHE"] + ' ') if 'CCACHE' in build_env else ''
build_env["CC"] = ccache + "clang -Qunused-arguments -fcolor-diagnostics"
build_env["LDFLAGS"] = " ".join([
"-lsqlite3",
"-lffi",
"-L{}".format(join(self.ctx.dist_dir, "hostlibffi", "usr", "local", "lib"))
])
build_env["CFLAGS"] = " ".join([
"--sysroot={}".format(sdk_path),
"-I{}".format(join(self.ctx.dist_dir, "hostlibffi", "usr", "local", "include"))
])
if "openssl.build_all" in self.ctx.state:
build_env["CFLAGS"] += " -I{}".format(join(self.ctx.dist_dir, "include",
"x86_64", "openssl"))
configure = sh.Command(join(self.build_dir, "configure"))
shprint(configure,
"--prefix={}".format(join(self.ctx.dist_dir, "hostpython")),
"--disable-toolbox-glue",
"--without-gcc",
_env=build_env)
shprint(sh.make, "-C", self.build_dir, self.ctx.concurrent_make, "python", "Parser/pgen",
_env=build_env)
shutil.move("python", "hostpython")
shutil.move("Parser/pgen", "Parser/hostpgen")
开发者ID:tonibagur,项目名称:kivy-ios,代码行数:29,代码来源:__init__.py
示例6: build_arch
def build_arch(self, arch):
shprint(sh.xcodebuild,
"ONLY_ACTIVE_ARCH=NO",
"ARCHS={}".format(arch.arch),
"-sdk", arch.sdk,
"-project", "libffi.xcodeproj",
"-target", "libffi-iOS",
"-configuration", "Release")
开发者ID:524430632,项目名称:kivy-ios,代码行数:8,代码来源:__init__.py
示例7: prebuild_arch
def prebuild_arch(self, arch):
hostpython = sh.Command(self.ctx.hostpython)
sh.curl("-O", "https://bootstrap.pypa.io/ez_setup.py")
dest_dir = join(self.ctx.dist_dir, "root", "python")
build_env = arch.get_env()
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
# shprint(hostpython, "./ez_setup.py", "--to-dir", dest_dir)
shprint(hostpython, "./ez_setup.py", _env=build_env)
开发者ID:byrot,项目名称:kivy-ios,代码行数:8,代码来源:__init__.py
示例8: install
def install(self):
arch = list(self.filtered_archs)[0]
build_dir = self.get_build_dir(arch.arch)
os.chdir(build_dir)
hostpython = sh.Command(self.ctx.hostpython)
build_env = arch.get_env()
dest_dir = join(self.ctx.dist_dir, "root", "python")
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
开发者ID:524430632,项目名称:kivy-ios,代码行数:9,代码来源:__init__.py
示例9: reduce_python
def reduce_python(self):
logger.info("Reduce python")
oldpwd = os.getcwd()
try:
logger.info("Remove files unlikely to be used")
os.chdir(join(self.ctx.dist_dir, "root", "python3"))
# os.execve("/bin/bash", ["/bin/bash"], env=os.environ)
sh.rm("-rf", "bin", "share")
# platform binaries and configuration
os.chdir(join(
self.ctx.dist_dir, "root", "python3", "lib",
"python3.7", "config-3.7m-darwin"))
sh.rm("libpython3.7m.a")
sh.rm("python.o")
sh.rm("config.c.in")
sh.rm("makesetup")
sh.rm("install-sh")
# cleanup pkgconfig and compiled lib
os.chdir(join(self.ctx.dist_dir, "root", "python3", "lib"))
sh.rm("-rf", "pkgconfig")
sh.rm("-f", "libpython3.7m.a")
# cleanup python libraries
os.chdir(join(
self.ctx.dist_dir, "root", "python3", "lib", "python3.7"))
sh.rm("-rf", "wsgiref", "curses", "idlelib", "lib2to3",
"ensurepip", "turtledemo", "lib-dynload", "venv",
"pydoc_data")
sh.find(".", "-path", "*/test*/*", "-delete")
sh.find(".", "-name", "*.exe", "-type", "f", "-delete")
sh.find(".", "-name", "test*", "-type", "d", "-delete")
sh.find(".", "-iname", "*.pyc", "-delete")
sh.find(".", "-path", "*/__pycache__/*", "-delete")
sh.find(".", "-name", "__pycache__", "-type", "d", "-delete")
# now precompile to Python bytecode
hostpython = sh.Command(self.ctx.hostpython)
shprint(hostpython, "-m", "compileall", "-f", "-b")
# sh.find(".", "-iname", "*.py", "-delete")
# some pycache are recreated after compileall
sh.find(".", "-path", "*/__pycache__/*", "-delete")
sh.find(".", "-name", "__pycache__", "-type", "d", "-delete")
# create the lib zip
logger.info("Create a python3.7.zip")
sh.mv("config-3.7m-darwin", "..")
sh.mv("site-packages", "..")
sh.zip("-r", "../python37.zip", sh.glob("*"))
sh.rm("-rf", sh.glob("*"))
sh.mv("../config-3.7m-darwin", ".")
sh.mv("../site-packages", ".")
finally:
os.chdir(oldpwd)
开发者ID:kivy,项目名称:kivy-ios,代码行数:56,代码来源:__init__.py
示例10: prebuild_arch
def prebuild_arch(self, arch):
if self.has_marker("patched"):
return
# XCode 10 minimum is 8.0 now.
shprint(sh.sed,
"-i.bak",
"s/-miphoneos-version-min=5.1.1/-miphoneos-version-min=8.0/g",
"generate-darwin-source-and-headers.py")
self.apply_patch("fix-win32-unreferenced-symbol.patch")
self.set_marker("patched")
开发者ID:kivy,项目名称:kivy-ios,代码行数:10,代码来源:__init__.py
示例11: build_arch
def build_arch(self, arch):
shprint(sh.xcodebuild, self.ctx.concurrent_xcodebuild,
"ONLY_ACTIVE_ARCH=NO",
"ARCHS={}".format(arch.arch),
"-sdk", "macosx",
"install", "installhdrs",
"-project", "libffi.xcodeproj",
"-target", "libffi-Mac",
"-configuration", "Release",
"DSTROOT={}/hostlibffi".format(self.ctx.dist_dir))
开发者ID:schemacs,项目名称:kivy-ios,代码行数:10,代码来源:__init__.py
示例12: build_arch
def build_arch(self, arch):
self.apply_patch('pil_setup.patch')
build_env = self.get_pil_env(arch)
#build_dir = self.get_build_dir(arch.arch)
hostpython = sh.Command(self.ctx.hostpython)
#build_env["PYTHONHOME"] = hostpython
# first try to generate .h
shprint(hostpython, "setup.py", "build_ext", "-g",
_env=build_env)
self.biglink()
开发者ID:jadeblaquiere,项目名称:kivy-ios,代码行数:10,代码来源:__init__.py
示例13: build_x86_64
def build_x86_64(self):
build_env = self.get_build_env()
configure = sh.Command(join(self.build_dir, "configure"))
shprint(configure,
"--prefix={}".format(join(self.ctx.dist_dir, "hostpython3")),
# "--disable-toolbox-glue",
# "--without-gcc",
_env=build_env)
shprint(sh.make, "-C", self.build_dir, self.ctx.concurrent_make,
_env=build_env)
开发者ID:kivy,项目名称:kivy-ios,代码行数:10,代码来源:__init__.py
示例14: cythonize_build
def cythonize_build(self):
# don't use the cythonize, pyobjus don't support method rewriting
shprint(sh.find, self.build_dir, "-iname", "*.pyx",
"-exec", "cython", "{}", ";")
# ffi is installed somewhere else, this include doesn't work
# XXX ideally, we need to fix libffi installation...
shprint(sh.sed,
"-i.bak",
"s/ffi\///g",
"pyobjus/pyobjus.c")
开发者ID:524430632,项目名称:kivy-ios,代码行数:10,代码来源:__init__.py
示例15: install
def install(self):
arch = list(self.filtered_archs)[0]
build_env = arch.get_env()
build_dir = self.get_build_dir(arch.arch)
build_env["PATH"] = os.environ["PATH"]
shprint(sh.make, "-C", build_dir, "bininstall", "inclinstall", _env=build_env)
pylib_dir = join(self.ctx.dist_dir, "hostpython", "lib", "python2.7")
if exists(pylib_dir):
shutil.rmtree(pylib_dir)
shutil.copytree(join(build_dir, "Lib"), pylib_dir)
ensure_dir(join(pylib_dir, "config"))
shutil.copy(join(build_dir, "Makefile"), join(pylib_dir, "config", "Makefile"))
shutil.copy(join(build_dir, "Parser", "pgen"), join(self.ctx.dist_dir, "hostpython", "bin", "pgen"))
开发者ID:niavlys,项目名称:kivy-ios,代码行数:13,代码来源:__init__.py
示例16: install
def install(self):
arch = list(self.filtered_archs)[0]
build_dir = self.get_build_dir(arch.arch)
os.chdir(build_dir)
hostpython = sh.Command(self.ctx.hostpython)
build_env = arch.get_env()
dest_dir = join(self.ctx.dist_dir, "root", "python")
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
cmd = sh.Command("sed")
shprint(cmd, "-i", "", "s/,.*Feature//g", "./setup.py", _env=build_env)
shprint(cmd, "-i", "", "s/setuptools/distutils.core/g", "./setup.py", _env=build_env)
shprint(cmd, "-i", "", "/^speedups = Feature/,/^)$/s/.*//g", "./setup.py", _env=build_env)
shprint(cmd, "-i", "", "s/features\['speedups'\].*=.*speedups/pass/g", "./setup.py", _env=build_env)
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
开发者ID:byrot,项目名称:kivy-ios,代码行数:14,代码来源:__init__.py
示例17: prebuild_arch
def prebuild_arch(self, arch):
hostpython = sh.Command(self.ctx.hostpython)
sh.curl("-O", "https://bootstrap.pypa.io/ez_setup.py")
shprint(hostpython, "./ez_setup.py")
# Extract setuptools egg and remove .pth files. Otherwise subsequent
# python package installations using setuptools will raise exceptions.
# Setuptools version 28.3.0
site_packages_path = join(
self.ctx.dist_dir, 'hostpython',
'lib', 'python2.7', 'site-packages')
os.chdir(site_packages_path)
with open('setuptools.pth', 'r') as f:
setuptools_egg_path = f.read().strip('./').strip('\n')
unzip = sh.Command('unzip')
shprint(unzip, setuptools_egg_path)
os.remove(setuptools_egg_path)
os.remove('setuptools.pth')
os.remove('easy-install.pth')
shutil.rmtree('EGG-INFO')
开发者ID:cbenhagen,项目名称:kivy-ios,代码行数:19,代码来源:__init__.py
示例18: build_i386
def build_i386(self):
sdk_path = sh.xcrun("--sdk", "macosx", "--show-sdk-path").strip()
build_env = self.ctx.env.copy()
build_env["CC"] = "clang -Qunused-arguments -fcolor-diagnostics"
build_env["LDFLAGS"] = " ".join(["-lsqlite3", "-lffi", "-L{}".format(join(self.ctx.dist_dir, "lib"))])
build_env["CFLAGS"] = " ".join(
["--sysroot={}".format(sdk_path), "-I{}".format(join(self.ctx.dist_dir, "include", "i386", "libffi"))]
)
configure = sh.Command(join(self.build_dir, "configure"))
shprint(
configure,
"--prefix={}".format(join(self.ctx.dist_dir, "hostpython")),
"--disable-toolbox-glue",
"--without-gcc",
_env=build_env,
)
shprint(sh.make, "-C", self.build_dir, "-j4", "python.exe", "Parser/pgen", _env=build_env)
shutil.move("python.exe", "hostpython")
shutil.move("Parser/pgen", "Parser/hostpgen")
开发者ID:niavlys,项目名称:kivy-ios,代码行数:19,代码来源:__init__.py
示例19: build_arch
def build_arch(self, arch):
options_iphoneos = (
"-isysroot {}".format(arch.sysroot),
"-DOPENSSL_THREADS",
"-D_REENTRANT",
"-DDSO_DLFCN",
"-DHAVE_DLFCN_H",
"-fomit-frame-pointer",
"-fno-common",
"-O3"
)
build_env = arch.get_env()
target = arch_mapper[arch.arch]
shprint(sh.env, _env=build_env)
sh.perl(join(self.build_dir, "Configure"),
target,
_env=build_env)
if target == 'iphoneos-cross':
sh.sed("-ie", "s!^CFLAG=.*!CFLAG={} {}!".format(build_env['CFLAGS'],
" ".join(options_iphoneos)),
"Makefile")
sh.sed("-ie", "s!static volatile sig_atomic_t intr_signal;!static volatile intr_signal;! ",
"crypto/ui/ui_openssl.c")
else:
sh.sed("-ie", "s!^CFLAG=!CFLAG={} !".format(build_env['CFLAGS']),
"Makefile")
shprint(sh.make, "clean")
shprint(sh.make, "-j4", "build_libs")
开发者ID:arcticshores,项目名称:kivy-ios,代码行数:28,代码来源:__init__.py
注:本文中的toolchain.shprint函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论