build_release: Add basic OS X build

This commit is contained in:
Florian Bruhin 2016-04-06 20:34:09 +02:00
parent bfb4f20510
commit ae41a074e8

View File

@ -50,17 +50,18 @@ def call_script(name, *args, python=sys.executable):
subprocess.check_call([python, path] + list(args))
def call_freeze(*args, python=sys.executable):
"""Call freeze.py via tox.
def call_tox(toxenv, *args, python=sys.executable):
"""Call tox.
Args:
toxenv: Which tox environment to use
*args: The arguments to pass.
python: The python interpreter to use.
"""
env = os.environ.copy()
env['PYTHON'] = python
subprocess.check_call(
[sys.executable, '-m', 'tox', '-e', 'cxfreeze-windows'] + list(args),
[sys.executable, '-m', 'tox', '-e', toxenv] + list(args),
env=env)
@ -88,6 +89,12 @@ def smoke_test(executable):
'--temp-basedir', 'about:blank', ':later 500 quit'])
def build_osx():
"""Build OS X .dmg/.app."""
utils.print_title("Building .app via pyinstaller")
call_tox('pyinstaller')
def build_windows():
"""Build windows executables/setups."""
utils.print_title("Updating 3rdparty content")
@ -101,13 +108,13 @@ def build_windows():
python_x64 = r'C:\Python{}'.format(ver)
utils.print_title("Running 32bit freeze.py build_exe")
call_freeze('build_exe', python=python_x86)
call_tox('cxfreeze-windows', 'build_exe', python=python_x86)
utils.print_title("Running 32bit freeze.py bdist_msi")
call_freeze('bdist_msi', python=python_x86)
call_tox('cxfreeze-windows', 'bdist_msi', python=python_x86)
utils.print_title("Running 64bit freeze.py build_exe")
call_freeze('build_exe', python=python_x64)
call_tox('cxfreeze-windows', 'build_exe', python=python_x64)
utils.print_title("Running 64bit freeze.py bdist_msi")
call_freeze('bdist_msi', python=python_x64)
call_tox('cxfreeze-windows', 'bdist_msi', python=python_x64)
utils.print_title("Running 32bit smoke test")
smoke_test('build/exe.win32-{}/qutebrowser.exe'.format(dotver))
@ -201,6 +208,8 @@ def main():
sys.exit(1)
run_asciidoc2html(args)
build_windows()
elif sys.platform == 'darwin':
build_osx()
else:
build_sdist()