Skip to content
Snippets Groups Projects
Unverified Commit b9f8766d authored by Kali Kaneko's avatar Kali Kaneko
Browse files

[pkg] native pyinstaller packaging

parent d063b5a2
No related branches found
No related tags found
No related merge requests found
include versioneer.py include versioneer.py
include src/leap/bitmask/_version.py include src/leap/bitmask/_version.py
include src/leap/bitmask/core/bitmaskd.tac
include *.bin include *.bin
# -*- mode: python -*- # -*- mode: python -*-
import platform
block_cipher = None block_cipher = None
hiddenimports = [
'scrypt', 'zope.interface', 'zope.proxy',
'pysqlcipher', 'service_identity',
'leap.common', 'leap.bitmask',
'leap.bitmask.core.logs',
'leap.soledad.common.document',
'leap.bitmask_js']
if platform.system() == 'Windows':
print "Platform=Windows, using pyside..."
hiddenimports.extend(
['PySide.QtCore', 'PySide.QtGui', 'PySide.QtWebKit',
# for some reason pyinstaller 3.1 complains about missing
# packages that should have been vendored
'appdirs',
'packaging', 'packaging.version', 'packaging.specifiers',
'packaging.requirements',
'python-gnupg'])
excludes = ['PyQt5']
else:
hiddenimports.extend(
['PyQt5.QtCore', 'PyQt5.QtGui', 'PyQt5.QtWebKit'])
excludes = ['PySide']
import os
VENV = os.environ.get('VIRTUAL_ENV', '')
a = Analysis(['../../src/leap/bitmask/gui/app.py'], a = Analysis(['../../src/leap/bitmask/gui/app.py'],
pathex=[ pathex=[
'/usr/lib/python2.7/dist-packages/'], '/usr/lib/python2.7/dist-packages/',
VENV + '/Lib/site-packages/',
VENV + '/Lib/site-packages/leap/soledad'],
binaries=None, binaries=None,
datas=None, datas=None,
hiddenimports=[ hiddenimports=hiddenimports,
'scrypt',
'zope.interface', 'zope.proxy',
'PyQt5.QtCore', 'PyQt5.QtGui', 'PyQt5.QtWebKit',
'pysqlcipher', 'service_identity',
'leap.common', 'leap.bitmask',
'leap.bitmask.core.logs',
'leap.bitmask_js',
],
hookspath=[], hookspath=[],
runtime_hooks=[], runtime_hooks=[],
excludes=[], excludes=excludes,
win_no_prefer_redirects=False, win_no_prefer_redirects=False,
win_private_assemblies=False, win_private_assemblies=False,
cipher=block_cipher) cipher=block_cipher)
...@@ -29,9 +51,10 @@ exe = EXE(pyz, ...@@ -29,9 +51,10 @@ exe = EXE(pyz,
a.scripts, a.scripts,
exclude_binaries=True, exclude_binaries=True,
name='bitmask', name='bitmask',
debug=False, debug=True,
strip=False, strip=False,
upx=True, upx=True,
# TODO remove console for win
console=True ) console=True )
coll = COLLECT(exe, coll = COLLECT(exe,
a.binaries, a.binaries,
......
...@@ -10,6 +10,13 @@ bundle: bundle_clean ...@@ -10,6 +10,13 @@ bundle: bundle_clean
cd pkg/launcher && make cd pkg/launcher && make
cp pkg/launcher/bitmask $(DIST_VERSION) cp pkg/launcher/bitmask $(DIST_VERSION)
bundle_win:
pyinstaller -y pkg/pyinst/app.spec
cp ${VIRTUAL_ENV}/Lib/site-packages/_scrypt.pyd $(DIST)
cp ${VIRTUAL_ENV}/Lib/site-packages/zmq/libzmq.pyd $(DIST)
cp src/leap/bitmask/core/bitmaskd.tac $(DIST)
bundle_tar: bundle_tar:
cd dist/ && tar cvzf Bitmask.$(NEXT_VERSION).tar.gz bitmask-$(NEXT_VERSION) cd dist/ && tar cvzf Bitmask.$(NEXT_VERSION).tar.gz bitmask-$(NEXT_VERSION)
...@@ -20,5 +27,5 @@ bundle_upload: ...@@ -20,5 +27,5 @@ bundle_upload:
rsync --rsh='ssh' -avztlpog --progress --partial dist/Bitmask.$(NEXT_VERSION).* downloads.leap.se:./ rsync --rsh='ssh' -avztlpog --progress --partial dist/Bitmask.$(NEXT_VERSION).* downloads.leap.se:./
bundle_clean: bundle_clean:
rm -rf dist build rm -rf "dist" "build"
SET DIST=%CD%\dist\bitmask
cp %VIRTUAL_ENV%/Lib/site-packages/_scrypt.pyd %DIST%
cp %VIRTUAL_ENV%/Lib/site-packages/zmq/libzmq.pyd %DIST%
cp %VIRTUAL_ENV%/Lib/site-packages/leap/common/cacert.pem %DIST%
cp %CD%\src\leap\bitmask\core\bitmaskd.tac %DIST%
mkdir %DIST%\leap
mkdir %DIST%\leap\soledad\common\l2db\backends
mkdir %DIST%\apps\mail
cp %CD%/../gpg/* %DIST%\apps\mail\
cp %VIRTUAL_ENV%/Lib/site-packages/leap/soledad/common/l2db/backends/dbschema.sql %DIST%\leap\soledad\common\l2db\backends
cp -r %VIRTUAL_ENV%/Lib/site-packages/leap/bitmask_js %DIST%\leap\
pypiwin32
pyinstaller==3.1
appdirs
packaging
...@@ -4,5 +4,4 @@ zope.interface ...@@ -4,5 +4,4 @@ zope.interface
service-identity service-identity
leap.common leap.common
leap.soledad.client leap.soledad.client
vext.pyqt5
gnupg gnupg
#!/bin/sh
rm -rf dist build
pip uninstall leap.bitmask
python setup.py bdist_wheel
pip install dist/*.whl
pyinstaller.exe -y pkg/pyinst/app.spec
pkg/pyinst/win_postbuild.bat
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
Setup file for leap.bitmask Setup file for leap.bitmask
""" """
from setuptools import setup, find_packages from setuptools import setup, find_packages
import platform
import versioneer import versioneer
...@@ -20,6 +21,11 @@ required = [ ...@@ -20,6 +21,11 @@ required = [
'leap.common', 'leap.common',
] ]
if platform.system() == "Windows":
required.append(['pypiwin32'])
required.append(['appdirs'])
required.append(['python-gnupg'])
mail_deps = ['leap.soledad.client', 'gnupg'] mail_deps = ['leap.soledad.client', 'gnupg']
gui_deps = ['vext.pyqt5', 'leap.bitmask_js'] gui_deps = ['vext.pyqt5', 'leap.bitmask_js']
extras = { extras = {
...@@ -77,7 +83,7 @@ setup( ...@@ -77,7 +83,7 @@ setup(
package_data={'': ['*.pem', '*.bin']}, package_data={'': ['*.pem', '*.bin']},
packages=find_packages('src'), packages=find_packages('src'),
include_package_data=True, include_package_data=True,
zip_safe=True, zip_safe=False,
entry_points={ entry_points={
'console_scripts': [gui_launcher, bitmask_cli, bitmaskd] 'console_scripts': [gui_launcher, bitmask_cli, bitmaskd]
}, },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment