mirror of
https://github.com/borgbase/vorta
synced 2024-12-22 07:43:09 +00:00
pyinstaller / vorta.spec: make platform independent (#122)
* pyinstaller / vorta.spec: make platform independent - cwd must be the repo dir, __FILE__ is not available here - the borg binary for the platform must be in bin/borg (no matter whether we build for Linux or macOS or ...) - moved some settings to top of the file - whitespace clean up * fat binary: must not fork on linux either also: refactor slightly
This commit is contained in:
parent
c5494f455c
commit
d2f618babf
3 changed files with 30 additions and 21 deletions
|
@ -15,10 +15,9 @@ def main():
|
|||
args = parse_args()
|
||||
|
||||
frozen_binary = getattr(sys, 'frozen', False)
|
||||
# Don't fork if user specifies it or when running from onedir app bundle on macOS.
|
||||
if (hasattr(args, 'foreground') and args.foreground) or (frozen_binary and sys.platform == 'darwin'):
|
||||
pass
|
||||
else:
|
||||
need_foreground = frozen_binary and sys.platform in ('darwin', 'linux')
|
||||
want_foreground = getattr(args, 'foreground', False)
|
||||
if not (want_foreground or need_foreground):
|
||||
print('Forking to background (see system tray).')
|
||||
if os.fork():
|
||||
sys.exit()
|
||||
|
|
32
vorta.spec
32
vorta.spec
|
@ -1,27 +1,37 @@
|
|||
# -*- mode: python -*-
|
||||
|
||||
block_cipher = None
|
||||
import os
|
||||
|
||||
CREATE_VORTA_DIR = False # create dist/vorta-dir/ output?
|
||||
BLOCK_CIPHER = None
|
||||
|
||||
# it is assumed that the cwd is the git repo dir:
|
||||
REPO_DIR = os.path.abspath('.')
|
||||
SRC_DIR = os.path.join(REPO_DIR, 'src')
|
||||
|
||||
|
||||
a = Analysis(['src/vorta/__main__.py'],
|
||||
pathex=['/Users/manu/Workspace/vorta/src'],
|
||||
pathex=[SRC_DIR],
|
||||
binaries=[
|
||||
('bin/macosx64/borg', 'bin'),
|
||||
('bin/borg', 'bin'), # (<borg fat binary for this platform>, <dest. folder>)
|
||||
],
|
||||
datas=[
|
||||
('src/vorta/assets/UI/*', 'assets/UI'),
|
||||
('src/vorta/assets/icons/*', 'assets/icons'),
|
||||
],
|
||||
hiddenimports=['vorta.views.collection_rc',
|
||||
hiddenimports=[
|
||||
'vorta.views.collection_rc',
|
||||
],
|
||||
hookspath=[],
|
||||
runtime_hooks=[],
|
||||
excludes=[],
|
||||
win_no_prefer_redirects=False,
|
||||
win_private_assemblies=False,
|
||||
cipher=block_cipher,
|
||||
cipher=BLOCK_CIPHER,
|
||||
noarchive=False)
|
||||
pyz = PYZ(a.pure, a.zipped_data,
|
||||
cipher=block_cipher)
|
||||
|
||||
pyz = PYZ(a.pure, a.zipped_data, cipher=BLOCK_CIPHER)
|
||||
|
||||
exe = EXE(pyz,
|
||||
a.scripts,
|
||||
a.binaries,
|
||||
|
@ -46,10 +56,10 @@ app = BUNDLE(exe,
|
|||
'CFBundleShortVersionString': '0.6.4',
|
||||
'CFBundleVersion': '0.6.4',
|
||||
'NSAppleEventsUsageDescription': 'Please allow',
|
||||
'SUFeedURL': 'https://borgbase.github.io/vorta/appcast.xml'
|
||||
},
|
||||
)
|
||||
if False:
|
||||
'SUFeedURL': 'https://borgbase.github.io/vorta/appcast.xml',
|
||||
})
|
||||
|
||||
if CREATE_VORTA_DIR:
|
||||
coll = COLLECT(exe,
|
||||
a.binaries,
|
||||
a.zipfiles,
|
||||
|
|
Loading…
Reference in a new issue