Skip to content

Commit

Permalink
Update build scripts from master
Browse files Browse the repository at this point in the history
  • Loading branch information
The-Compiler committed Jul 26, 2016
1 parent 614794a commit 2795ae9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
9 changes: 2 additions & 7 deletions scripts/dev/Makefile-dmg
Expand Up @@ -24,7 +24,7 @@ SOURCE_DIR ?= .
SOURCE_FILES ?= dist/qutebrowser.app COPYING SOURCE_FILES ?= dist/qutebrowser.app COPYING


TEMPLATE_DMG ?= template.dmg TEMPLATE_DMG ?= template.dmg
TEMPLATE_SIZE ?= 120m TEMPLATE_SIZE ?= 300m


################################################################################ ################################################################################
# DMG building. No editing should be needed beyond this point. # DMG building. No editing should be needed beyond this point.
Expand All @@ -37,17 +37,12 @@ WC_DIR=wc
.PHONY: all .PHONY: all
all: $(MASTER_DMG) all: $(MASTER_DMG)


$(TEMPLATE_DMG): $(TEMPLATE_DMG).bz2 $(TEMPLATE_DMG):
bunzip2 -k $<

$(TEMPLATE_DMG).bz2:
@echo @echo
@echo --------------------- Generating empty template -------------------- @echo --------------------- Generating empty template --------------------
mkdir template mkdir template
hdiutil create -fs HFSX -layout SPUD -size $(TEMPLATE_SIZE) "$(TEMPLATE_DMG)" -srcfolder template -format UDRW -volname "$(NAME)" -quiet hdiutil create -fs HFSX -layout SPUD -size $(TEMPLATE_SIZE) "$(TEMPLATE_DMG)" -srcfolder template -format UDRW -volname "$(NAME)" -quiet
rmdir template rmdir template
bzip2 "$(TEMPLATE_DMG)"
@echo


$(WC_DMG): $(TEMPLATE_DMG) $(WC_DMG): $(TEMPLATE_DMG)
cp $< $@ cp $< $@
Expand Down
16 changes: 15 additions & 1 deletion scripts/dev/build_release.py
Expand Up @@ -28,6 +28,7 @@
import subprocess import subprocess
import argparse import argparse
import tarfile import tarfile
import tempfile
import collections import collections


sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir, sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir,
Expand Down Expand Up @@ -94,7 +95,7 @@ def build_osx():
utils.print_title("Updating 3rdparty content") utils.print_title("Updating 3rdparty content")
update_3rdparty.update_pdfjs() update_3rdparty.update_pdfjs()
utils.print_title("Building .app via pyinstaller") utils.print_title("Building .app via pyinstaller")
call_tox('pyinstaller') call_tox('pyinstaller', '-r')
utils.print_title("Building .dmg") utils.print_title("Building .dmg")
subprocess.check_call(['make', '-f', 'scripts/dev/Makefile-dmg']) subprocess.check_call(['make', '-f', 'scripts/dev/Makefile-dmg'])
utils.print_title("Cleaning up...") utils.print_title("Cleaning up...")
Expand All @@ -103,6 +104,17 @@ def build_osx():
for d in ['dist', 'build']: for d in ['dist', 'build']:
shutil.rmtree(d) shutil.rmtree(d)


utils.print_title("Running smoke test")
with tempfile.TemporaryDirectory() as tmpdir:
subprocess.check_call(['hdiutil', 'attach', 'qutebrowser.dmg',
'-mountpoint', tmpdir])
try:
binary = os.path.join(tmpdir, 'qutebrowser.app', 'Contents',
'MacOS', 'qutebrowser')
smoke_test(binary)
finally:
subprocess.check_call(['hdiutil', 'detach', tmpdir])



def build_windows(): def build_windows():
"""Build windows executables/setups.""" """Build windows executables/setups."""
Expand All @@ -116,6 +128,8 @@ def build_windows():
python_x86 = r'C:\Python{}_x32'.format(ver) python_x86 = r'C:\Python{}_x32'.format(ver)
python_x64 = r'C:\Python{}'.format(ver) python_x64 = r'C:\Python{}'.format(ver)


utils.print_title("Rebuilding tox environment")
call_tox('cxfreeze-windows', '-r', '--notest')
utils.print_title("Running 32bit freeze.py build_exe") utils.print_title("Running 32bit freeze.py build_exe")
call_tox('cxfreeze-windows', 'build_exe', python=python_x86) call_tox('cxfreeze-windows', 'build_exe', python=python_x86)
utils.print_title("Running 32bit freeze.py bdist_msi") utils.print_title("Running 32bit freeze.py bdist_msi")
Expand Down

0 comments on commit 2795ae9

Please sign in to comment.