tmp: update build scripts.

dev
Apex Liu 2020-07-15 05:03:04 +08:00
parent 7bf682af0f
commit 74c4d08071
4 changed files with 238 additions and 219 deletions

View File

@ -164,10 +164,10 @@ def do_opt(opt):
script = 'build-server.py'
arg = '%s %s server' % (ctx.target_path, opt['bits'])
elif 'installer' == opt['name']:
elif 'server-installer' == opt['name']:
script = 'build-installer.py'
# arg = 'installer'
arg = '%s %s installer' % (ctx.dist, opt['bits'])
arg = '%s %s server-installer' % (ctx.dist, opt['bits'])
elif 'client' == opt['name']:
script = 'build-assist.py'
@ -229,44 +229,54 @@ def add_split(title=None):
def make_options():
if ctx.host_os in ['windows']:
add_split('common')
add_option('x86', 'ver', 'Update version setting')
add_split('client side')
add_split('prepare for client [build once]')
# add_option('x86', 'external', '[OBSOLETE] Build external dependency')
add_option('x86', 'ext-client', 'Build external libraries for client')
add_split('prepare for server [build once]')
add_option('x86', 'pysrt', 'Make Python-Runtime for python%s-x86' % env.py_ver_str)
add_option('x86', 'ext-server', 'Build external libraries for server')
add_split('version [build every release]')
add_option('x86', 'ver', 'Update version setting')
add_split('client side')
# add_option('x86', 'assist-exe', '[OBSOLETE] Assist Execute [%s]' % ctx.target_path)
add_option('x86', 'client', 'Build client applications [%s]' % ctx.target_path)
# add_option('x86', 'assist-rdp', 'Teleport RDP [%s]' % ctx.target_path)
# add_option('x86', 'assist-installer', '[OBSOLETE] Assist Installer')
add_option('x86', 'client-installer', 'Make client installer')
add_option('x86', 'clear-ext-client', 'Clear external libraries for client')
add_split('server side')
add_option('x86', 'pysrt', 'Make Python-Runtime for python%s-x86' % env.py_ver_str)
add_option('x86', 'ext-server', 'Build external libraries for server')
add_option('x86', 'server', 'Teleport Server [%s]' % ctx.target_path)
# add_option('x86', 'installer', '[OBSOLETE] Teleport Installer for %s' % ctx.host_os)
# add_option('x86', 'server', 'Teleport Server [%s]' % ctx.target_path)
add_option('x86', 'server-installer', 'Teleport Installer for %s' % ctx.host_os)
# add_option('x86', 'installer', '[OBSOLETE] Teleport Installer for %s' % ctx.host_os)
add_split('clear')
add_option('x86', 'clear-ext-client', 'Clear external libraries for client')
add_option('x86', 'clear-ext-server', 'Clear external libraries for server')
elif ctx.host_os == 'macos':
add_split('prepare for client [build once]')
add_option('x64', 'ext-client', 'Build external libraries for client')
add_split('version [build every release]')
add_option('x64', 'ver', 'Update version setting')
add_option('x86', 'ext-client', 'Build external libraries for client')
add_split('client side')
add_option('x64', 'assist-exe', 'Assist Execute [%s]' % ctx.target_path)
add_option('x64', 'assist-installer', 'Assist Installer')
add_split()
add_split('clear')
add_option('x86', 'clear-ext-client', 'Clear external libraries for client')
else:
add_option('x64', 'ver', 'Update version setting')
add_split()
add_split('prepare for server [build once]')
add_option('x64', 'pysrt', 'Make Python-Runtime for python%s-x64' % env.py_ver_str)
# add_option('x64', 'external', '[OBSOLETE] Build external dependency')
# add_option('x86', 'ext-client', 'Build external libraries for client')
add_option('x86', 'ext-server', 'Build external libraries for server')
add_option('x64', 'ext-server', 'Build external libraries for server')
add_split('version [build every release]')
add_option('x64', 'ver', 'Update version setting')
add_split('server side')
add_option('x64', 'server', 'Build server applications [%s]' % ctx.target_path)
# add_option('x64', 'installer', '[OBSOLETE] Make server installer for %s' % ctx.host_os)
add_option('x86', 'server-installer', 'Make server installer for %s' % ctx.host_os)
add_split()
add_option('x86', 'clear-ext-client', 'Clear external libraries for client')
add_option('x86', 'clear-ext-server', 'Clear external libraries for server')
add_option('x64', 'server-installer', 'Make server installer for %s' % ctx.host_os)
add_split('clear')
# add_option('x64', 'clear-ext-client', 'Clear external libraries for client')
add_option('x64', 'clear-ext-server', 'Clear external libraries for server')
def get_input(msg, log_func=cc.w):

View File

@ -88,7 +88,7 @@ class BuilderWin(BuilderBase):
utils.copy_ex(os.path.join(env.root_path, 'out', 'pysrt'), bin_path, (ctx.dist_path, 'pysrt'))
# 复制安装所需的脚本
# copy scripts
utils.copy_ex(os.path.join(self.dist_path), self.path_tmp, 'setup.bat')
utils.copy_ex(os.path.join(self.dist_path), self.path_tmp, 'script')
@ -140,7 +140,7 @@ class BuilderLinux(BuilderBase):
utils.copy_ex(os.path.join(env.root_path, 'out', 'pysrt'), bin_path, (ctx.dist_path, 'pysrt'))
# 复制安装所需的脚本
# copy scripts
utils.copy_ex(os.path.join(self.dist_path), self.path_tmp, 'setup.sh')
utils.copy_ex(os.path.join(self.dist_path), self.path_tmp, 'script')
utils.copy_ex(os.path.join(self.dist_path), self.path_tmp, 'daemon')
@ -186,7 +186,7 @@ def main():
if builder is None:
builder = gen_builder(ctx.host_os)
if 'installer' in argv:
if 'server-installer' in argv:
builder.build_installer()

View File

@ -91,8 +91,17 @@ class BuilderLinux(BuilderBase):
utils.makedirs(out_path)
utils.cmake(os.path.join(env.root_path, 'cmake-build'), ctx.target_path, False)
build_path = os.path.join(env.root_path, 'cmake-build')
if not os.path.exists(build_path):
utils.makedirs(build_path)
old_p = os.getcwd()
os.chdir(build_path)
utils.cmake(build_path, ctx.target_path, False)
os.chdir(build_path)
utils.sys_exec('make')
# utils.strip(out_file)
os.chdir(old_p)
for f in out_files:
if os.path.exists(f):

0
make.sh Normal file → Executable file
View File