mirror of https://github.com/tp4a/teleport
构建脚本加入对macOS版本助手的构建过程。
parent
8dc0acd21b
commit
947332078b
|
@ -15,6 +15,7 @@ cmake_install.cmake
|
|||
Makefile
|
||||
cmake-build
|
||||
cmake-build-debug
|
||||
client/tp_assist_macos/build
|
||||
|
||||
# for Python
|
||||
__pycache__
|
||||
|
|
|
@ -200,7 +200,7 @@ def make_options():
|
|||
# options = list()
|
||||
# options_idx = 0
|
||||
|
||||
if ctx.host_os == 'windows':
|
||||
if ctx.host_os in ['windows', 'macos']:
|
||||
add_option('x86', 'ver', 'Update version setting')
|
||||
add_option('x86', 'pysrt', 'Make Python-Runtime for python%s-x86' % env.py_ver_str)
|
||||
add_option('x64', 'external', 'Build external dependency')
|
||||
|
|
|
@ -97,6 +97,75 @@ class BuilderWin(BuilderBase):
|
|||
utils.nsis_build(os.path.join(env.root_path, 'dist', 'client', 'windows', 'assist', 'installer.nsi'))
|
||||
|
||||
|
||||
class BuilderMacOS(BuilderBase):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
|
||||
def build_exe(self):
|
||||
cc.i('build tp_assist...')
|
||||
|
||||
configuration = ctx.target_path.capitalize()
|
||||
|
||||
proj_file = os.path.join(env.root_path, 'client', 'tp_assist_macos', 'tp_assist.xcodeproj')
|
||||
out_file = os.path.join(env.root_path, 'client', 'tp_assist_macos', 'build', ctx.target_path, 'tp_assist.app')
|
||||
if os.path.exists(out_file):
|
||||
utils.remove(out_file)
|
||||
utils.xcode_build(proj_file, 'tp_assist', configuration, False)
|
||||
utils.ensure_file_exists(os.path.join(out_file, 'Contents', 'Info.plist'))
|
||||
|
||||
def build_installer(self):
|
||||
cc.i('build assist installer...')
|
||||
|
||||
# name = 'teleport-assist-{}-{}'.format(ctx.dist, VER_TP_ASSIST)
|
||||
#
|
||||
# out_path = os.path.join(env.root_path, 'out', 'installer')
|
||||
# utils.makedirs(out_path)
|
||||
#
|
||||
# out_file = os.path.join(out_path, '{}.exe'.format(name))
|
||||
# utils.remove(out_file)
|
||||
#
|
||||
# self._build_installer()
|
||||
#
|
||||
# utils.ensure_file_exists(out_file)
|
||||
|
||||
|
||||
@staticmethod
|
||||
def _build_installer():
|
||||
return
|
||||
# tmp_path = os.path.join(env.root_path, 'dist', 'client', 'windows', 'assist')
|
||||
# tmp_app_path = os.path.join(tmp_path, 'apps')
|
||||
# tmp_cfg_path = os.path.join(tmp_app_path, 'cfg')
|
||||
#
|
||||
# if os.path.exists(tmp_app_path):
|
||||
# utils.remove(tmp_app_path)
|
||||
#
|
||||
# utils.makedirs(tmp_app_path)
|
||||
# utils.makedirs(tmp_cfg_path)
|
||||
#
|
||||
# utils.copy_file(os.path.join(env.root_path, 'out', 'client', ctx.bits_path, ctx.target_path), tmp_app_path, 'tp_assist.exe')
|
||||
# utils.copy_file(os.path.join(env.root_path, 'client', 'tp_assist_win', 'cfg'), tmp_cfg_path, ('tp-assist.default.json', 'tp-assist.json'))
|
||||
#
|
||||
# utils.copy_ex(os.path.join(env.root_path, 'client', 'tp_assist_win'), tmp_app_path, 'site')
|
||||
#
|
||||
# utils.makedirs(os.path.join(tmp_app_path, 'tools', 'putty'))
|
||||
# utils.copy_file(os.path.join(env.root_path, 'client', 'tools', 'putty'), os.path.join(tmp_app_path, 'tools', 'putty'), 'putty.exe')
|
||||
#
|
||||
# utils.makedirs(os.path.join(tmp_app_path, 'tools', 'winscp'))
|
||||
# utils.copy_file(os.path.join(env.root_path, 'client', 'tools', 'winscp'), os.path.join(tmp_app_path, 'tools', 'winscp'), 'WinSCP.exe')
|
||||
# utils.copy_file(os.path.join(env.root_path, 'client', 'tools', 'winscp'), os.path.join(tmp_app_path, 'tools', 'winscp'), 'license.txt')
|
||||
#
|
||||
# utils.makedirs(os.path.join(tmp_app_path, 'tools', 'tprdp'))
|
||||
# utils.copy_file(os.path.join(env.root_path, 'client', 'tools', 'tprdp'), os.path.join(tmp_app_path, 'tools', 'tprdp'), 'tprdp-client.exe')
|
||||
# utils.copy_file(os.path.join(env.root_path, 'client', 'tools', 'tprdp'), os.path.join(tmp_app_path, 'tools', 'tprdp'), 'tprdp-replay.exe')
|
||||
# utils.copy_file(os.path.join(env.root_path, 'client', 'tools', 'tprdp'), os.path.join(tmp_app_path, 'tools', 'tprdp'), 'libeay32.dll')
|
||||
# utils.copy_file(os.path.join(env.root_path, 'client', 'tools', 'tprdp'), os.path.join(tmp_app_path, 'tools', 'tprdp'), 'ssleay32.dll')
|
||||
# utils.copy_file(os.path.join(env.root_path, 'client', 'tools', 'tprdp'), os.path.join(tmp_app_path, 'tools', 'tprdp'), 'msvcr120.dll')
|
||||
#
|
||||
# utils.copy_file(os.path.join(env.root_path, 'client', 'tools'), os.path.join(tmp_app_path, 'tools'), 'securecrt-telnet.vbs')
|
||||
#
|
||||
# utils.nsis_build(os.path.join(env.root_path, 'dist', 'client', 'windows', 'assist', 'installer.nsi'))
|
||||
|
||||
|
||||
class BuilderLinux(BuilderBase):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
|
@ -114,6 +183,8 @@ class BuilderLinux(BuilderBase):
|
|||
def gen_builder(dist):
|
||||
if dist == 'windows':
|
||||
builder = BuilderWin()
|
||||
elif dist == 'macos':
|
||||
builder = BuilderMacOS()
|
||||
elif dist == 'linux':
|
||||
builder = BuilderLinux()
|
||||
else:
|
||||
|
|
|
@ -579,8 +579,8 @@ class BuilderMacOS(BuilderBase):
|
|||
os.chdir(old_p)
|
||||
|
||||
def _build_libuv(self, file_name):
|
||||
cc.w('build libuv...skip')
|
||||
return
|
||||
cc.w('build libuv...')
|
||||
# return
|
||||
if not os.path.exists(self.LIBUV_PATH_SRC):
|
||||
# os.system('tar -zxvf "{}/{}" -C "{}"'.format(PATH_DOWNLOAD, file_name, PATH_TMP))
|
||||
os.system('unzip "{}/{}" -d "{}"'.format(PATH_DOWNLOAD, file_name, self.PATH_TMP))
|
||||
|
@ -592,7 +592,7 @@ class BuilderMacOS(BuilderBase):
|
|||
cc.v('')
|
||||
|
||||
# we need following...
|
||||
# apt-get install autoconf aptitude libtool gcc-c++
|
||||
# brew install automake libtool
|
||||
|
||||
old_p = os.getcwd()
|
||||
os.chdir(self.LIBUV_PATH_SRC)
|
||||
|
|
|
@ -307,6 +307,21 @@ def msvc_build(sln_file, proj_name, target, platform, force_rebuild):
|
|||
raise RuntimeError('build MSVC project `{}` failed.'.format(proj_name))
|
||||
|
||||
|
||||
def xcode_build(proj_file, proj_name, target, force_rebuild):
|
||||
# if env.msbuild is None:
|
||||
# raise RuntimeError('where is `msbuild`?')
|
||||
|
||||
if force_rebuild:
|
||||
cmd = 'xcodebuild -project "{}" -target {} -configuration {} clean'.format(proj_file, proj_name, target)
|
||||
ret, _ = sys_exec(cmd, direct_output=True)
|
||||
cc.v('ret:', ret)
|
||||
|
||||
cmd = 'xcodebuild -project "{}" -target {} -configuration {}'.format(proj_file, proj_name, target)
|
||||
ret, _ = sys_exec(cmd, direct_output=True)
|
||||
if ret != 0:
|
||||
raise RuntimeError('build MSVC project `{}` failed.'.format(proj_name))
|
||||
|
||||
|
||||
def nsis_build(nsi_file, _define=''):
|
||||
if env.nsis is None:
|
||||
raise RuntimeError('where is `nsis`?')
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
<file url="file://$PROJECT_DIR$/tp_core/core/ts_session.h" charset="GBK" />
|
||||
<file url="file://$PROJECT_DIR$/tp_core/core/ts_web_rpc.cpp" charset="GBK" />
|
||||
<file url="file://$PROJECT_DIR$/tp_core/core/ts_web_rpc.h" charset="GBK" />
|
||||
<file url="file://$PROJECT_DIR$/tp_core/protocol/rdp/rdp_conn.h" charset="GBK" />
|
||||
<file url="file://$PROJECT_DIR$/tp_core/protocol/rdp/rdp_proxy.cpp" charset="GBK" />
|
||||
<file url="file://$PROJECT_DIR$/tp_core/protocol/ssh/ssh_proxy.cpp" charset="GBK" />
|
||||
<file url="file://$PROJECT_DIR$/tp_core/protocol/ssh/ssh_proxy.h" charset="GBK" />
|
||||
|
|
|
@ -11,8 +11,9 @@ ADD_DEFINITIONS(
|
|||
-DMG_DISABLE_HTTP_DIGEST_AUTH
|
||||
-DMG_DISABLE_MQTT
|
||||
-DMG_DISABLE_SSI
|
||||
# -DMG_DISABLE_FILESYSTEM
|
||||
-DHAVE_CONFIG_H
|
||||
-DCS_COMMON_MD5_H_
|
||||
# -DCS_COMMON_MD5_H_
|
||||
-DCS_DISABLE_MD5
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue