don't rely on unset env vars

This commit is contained in:
Ben Morse 2018-05-14 10:05:21 -07:00
parent 7e0480e2ef
commit cac0362377

View File

@ -30,7 +30,7 @@ INSTALL_ROOT = os.path.join(SCRIPT_PATH, 'builds', 'install')
def get_signtool(): def get_signtool():
""" get path to code signing tool """ """ get path to code signing tool """
if PLATFORM == 'win': if PLATFORM == 'win':
sdk_dir = os.environ['WindowsSdkDir'] sdk_dir = 'c:\\Program Files (x86)\\Windows Kits\\10' # os.environ['WindowsSdkDir']
return os.path.join(sdk_dir, 'bin', 'x86', 'signtool.exe') return os.path.join(sdk_dir, 'bin', 'x86', 'signtool.exe')
elif PLATFORM == 'osx': elif PLATFORM == 'osx':
return '/usr/bin/codesign' return '/usr/bin/codesign'
@ -70,14 +70,7 @@ def cli(ctx, clean):
@click.pass_context @click.pass_context
def unity(ctx): def unity(ctx):
""" build just dynamic libs for use in unity project """ """ build just dynamic libs for use in unity project """
ctx.invoke( ctx.invoke(libs, clean=False, static=False, shared=True, skip_formatter=True, just_release=True)
libs,
clean=False,
static=False,
shared=True,
skip_formatter=True,
just_release=True
)
BUILDS = [] BUILDS = []
click.echo('--- Copying libs and header into unity example') click.echo('--- Copying libs and header into unity example')
@ -97,7 +90,8 @@ def unity(ctx):
LIBRARY_NAME = 'discord-rpc.bundle' LIBRARY_NAME = 'discord-rpc.bundle'
BUILD_BASE_PATH = os.path.join(SCRIPT_PATH, 'builds', 'osx-dynamic', 'src') BUILD_BASE_PATH = os.path.join(SCRIPT_PATH, 'builds', 'osx-dynamic', 'src')
UNITY_DLL_PATH = UNITY_PROJECT_PATH UNITY_DLL_PATH = UNITY_PROJECT_PATH
os.rename(os.path.join(BUILD_BASE_PATH, 'libdiscord-rpc.dylib'), os.path.join(BUILD_BASE_PATH, 'discord-rpc.bundle')) os.rename(
os.path.join(BUILD_BASE_PATH, 'libdiscord-rpc.dylib'), os.path.join(BUILD_BASE_PATH, 'discord-rpc.bundle'))
BUILDS.append({BUILD_BASE_PATH: UNITY_DLL_PATH}) BUILDS.append({BUILD_BASE_PATH: UNITY_DLL_PATH})
@ -122,14 +116,7 @@ def unity(ctx):
@click.pass_context @click.pass_context
def unreal(ctx): def unreal(ctx):
""" build libs and copy them into the unreal project """ """ build libs and copy them into the unreal project """
ctx.invoke( ctx.invoke(libs, clean=False, static=False, shared=True, skip_formatter=True, just_release=True)
libs,
clean=False,
static=False,
shared=True,
skip_formatter=True,
just_release=True
)
BUILDS = [] BUILDS = []
click.echo('--- Copying libs and header into unreal example') click.echo('--- Copying libs and header into unreal example')
@ -178,11 +165,7 @@ def build_lib(build_name, generator, options, just_release):
mkdir_p(build_path) mkdir_p(build_path)
mkdir_p(install_path) mkdir_p(install_path)
with cd(build_path): with cd(build_path):
initial_cmake = [ initial_cmake = ['cmake', SCRIPT_PATH, '-DCMAKE_INSTALL_PREFIX=%s' % os.path.join('..', 'install', build_name)]
'cmake',
SCRIPT_PATH,
'-DCMAKE_INSTALL_PREFIX=%s' % os.path.join('..', 'install', build_name)
]
if generator: if generator:
initial_cmake.extend(['-G', generator]) initial_cmake.extend(['-G', generator])
for key in options: for key in options:
@ -224,22 +207,28 @@ def sign():
sign_command_base = [ sign_command_base = [
tool, tool,
'sign', 'sign',
'/n', 'Discord Inc.', '/n',
'Discord Inc.',
'/a', '/a',
'/tr', 'http://timestamp.digicert.com/rfc3161', '/tr',
'http://timestamp.digicert.com/rfc3161',
'/as', '/as',
'/td', 'sha256', '/td',
'/fd', 'sha256', 'sha256',
'/fd',
'sha256',
] ]
elif PLATFORM == 'osx': elif PLATFORM == 'osx':
signable_extensions.add('.dylib') signable_extensions.add('.dylib')
sign_command_base = [ sign_command_base = [
tool, tool,
'--keychain', os.path.expanduser('~/Library/Keychains/login.keychain'), '--keychain',
os.path.expanduser('~/Library/Keychains/login.keychain'),
'-vvvv', '-vvvv',
'--deep', '--deep',
'--force', '--force',
'--sign', 'Developer ID Application: Hammer & Chisel Inc. (53Q6R32WPB)', '--sign',
'Developer ID Application: Hammer & Chisel Inc. (53Q6R32WPB)',
] ]
else: else:
click.secho('Not signing things on this platform yet', fg='red') click.secho('Not signing things on this platform yet', fg='red')