summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorkali <kali@leap.se>2017-08-02 18:40:21 -0700
committerKali Kaneko <kali@leap.se>2017-08-14 18:09:06 -0400
commit9c74ffb925325de98e8dd73acdf1602dd40bfcc0 (patch)
treeb0cb7e5ab25b86927c2c95d51df172ae91824986 /pkg
parente40e28b51312cd1e257022bfcb74b37d619dc0ea (diff)
[pkg] working bundle in osx using pywebview + pyobjc
Diffstat (limited to 'pkg')
-rw-r--r--pkg/pyinst/app.spec28
-rw-r--r--pkg/pyinst/build.mk3
2 files changed, 20 insertions, 11 deletions
diff --git a/pkg/pyinst/app.spec b/pkg/pyinst/app.spec
index a14dbcb5..9e99d7e9 100644
--- a/pkg/pyinst/app.spec
+++ b/pkg/pyinst/app.spec
@@ -1,10 +1,12 @@
# -*- mode: python -*-
-import platform
+import os
import sys
+import platform
block_cipher = None
IS_MAC = sys.platform.startswith('darwin')
+IS_WIN = platform.system() == 'Windows'
BITMASK_VERSION = open('pkg/next-version').read()
if IS_MAC:
@@ -19,7 +21,6 @@ hiddenimports = [
'pysqlcipher', 'service_identity',
'leap.common', 'leap.bitmask',
'leap.bitmask.core.logs',
- 'leap.bitmask.gui.icons_rc',
'leap.soledad.common',
'leap.soledad.common.document',
'leap.soledad.common.l2db',
@@ -28,7 +29,7 @@ hiddenimports = [
'packaging', 'packaging.version', 'packaging.specifiers',
'packaging.requirements']
-if platform.system() == 'Windows':
+if IS_WIN:
print "Platform=Windows, using pyside..."
hiddenimports.extend(
['PySide.QtCore', 'PySide.QtGui', 'PySide.QtWebKit',
@@ -39,19 +40,28 @@ if platform.system() == 'Windows':
'packaging.requirements',
'python-gnupg'])
excludes = ['PyQt5']
+ QT5PATH = ['']
+elif IS_MAC:
+ hiddenimports.extend(['pywebview', 'pyobjc'])
+ excludes = ['PyQt5', 'IPython', 'PySide']
+ QT5PATH = ['']
else:
hiddenimports.extend(
- ['PyQt5.QtCore', 'PyQt5.QtGui', 'PyQt5.QtWebKit'])
+ ['PyQt5.QtCore', 'PyQt5.QtGui', 'PyQt5.QtWebEngine',
+ 'leap.bitmask.gui.icons_rc'])
excludes = ['PySide']
-import os
VENV = os.environ.get('VIRTUAL_ENV', '')
-a = Analysis(['../../src/leap/bitmask/gui/app.py'],
+if IS_MAC:
+ # experimental pywebview entrypoint
+ ENTRYPOINT = ['../../src/leap/bitmask/gui/app2.py']
+else:
+ ENTRYPOINT = ['../../src/leap/bitmask/gui/app.py']
+
+a = Analysis(ENTRYPOINT,
pathex=[
- '/usr/lib/python2.7/dist-packages/',
- VENV + '/Lib/site-packages/',
- VENV + '/Lib/site-packages/leap/soledad'],
+ '/usr/lib/python2.7/dist-packages/'] + QT5PATH,
binaries=None,
datas=None,
hiddenimports=hiddenimports,
diff --git a/pkg/pyinst/build.mk b/pkg/pyinst/build.mk
index a9df4974..b6dea151 100644
--- a/pkg/pyinst/build.mk
+++ b/pkg/pyinst/build.mk
@@ -11,7 +11,7 @@ bundle: bundle_clean
pyinstaller -y pkg/pyinst/app.spec
cp $(VIRTUAL_ENV)/lib/python2.7/site-packages/_scrypt.so $(DIST)
cp src/leap/bitmask/core/bitmaskd.tac $(DIST)
- mkdir $(DIST)/leap
+ mkdir -p $(DIST)/leap
# if you find yourself puzzled becase the following files are not found in your
# virtualenv, make sure that you're installing the packages from wheels and not eggs.
mkdir -p $(DIST)/leap/soledad/client/_db
@@ -58,7 +58,6 @@ bundle_osx: bundle bundle_osx_helpers
cp $(DIST_VERSION)/lib/_scrypt.so $(OSX_CON)/
cp $(DIST_VERSION)/lib/bitmaskd.tac $(OSX_CON)/
cp -r $(DIST_VERSION)/lib/leap $(OSX_CON)/
- cp -r $(DIST_VERSION)/lib/pixelated_www $(OSX_CON)/
mv dist/Bitmask.app/Contents/MacOS/bitmask $(OSX_CON)/bitmask-app
cp pkg/osx/bitmask-wrapper $(OSX_CON)/bitmask
mkdir -p $(OSX_RES)/bitmask-helper