From ae41a074e8c7e0c9e4808a440722f41d9fe090c8 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 6 Apr 2016 20:34:09 +0200 Subject: [PATCH] build_release: Add basic OS X build --- scripts/dev/build_release.py | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/scripts/dev/build_release.py b/scripts/dev/build_release.py index 57fa1d724..3a8f8305b 100755 --- a/scripts/dev/build_release.py +++ b/scripts/dev/build_release.py @@ -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()