2015-02-26 23:21:05 +01:00
|
|
|
from toolchain import Recipe, shprint
|
|
|
|
from os.path import join, exists
|
|
|
|
import sh
|
|
|
|
import os
|
|
|
|
import fnmatch
|
|
|
|
import shutil
|
|
|
|
|
|
|
|
|
|
|
|
class HostSetuptools(Recipe):
|
|
|
|
depends = ["hostpython"]
|
2016-02-14 14:49:25 +01:00
|
|
|
archs = ["x86_64"]
|
2015-02-26 23:21:05 +01:00
|
|
|
url = ""
|
|
|
|
|
|
|
|
def prebuild_arch(self, arch):
|
|
|
|
hostpython = sh.Command(self.ctx.hostpython)
|
|
|
|
sh.curl("-O", "https://bootstrap.pypa.io/ez_setup.py")
|
2016-02-14 14:49:25 +01:00
|
|
|
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)
|
2015-02-26 23:21:05 +01:00
|
|
|
|
2016-02-14 14:49:25 +01:00
|
|
|
# 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)
|
2015-02-26 23:21:05 +01:00
|
|
|
|
2016-02-14 14:49:25 +01:00
|
|
|
recipe = HostSetuptools()
|