From b57db079d0ea079eaaf9a2982c3fe0227a1be323 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Rast?= Date: Sun, 27 Oct 2019 17:04:33 +0100 Subject: [PATCH] Updated pyinstaller spec file to support windows builds --- scripts/borg.exe.spec | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/scripts/borg.exe.spec b/scripts/borg.exe.spec index 3d0217f2d..93b3503af 100644 --- a/scripts/borg.exe.spec +++ b/scripts/borg.exe.spec @@ -3,17 +3,27 @@ import os, sys -basepath = '/vagrant/borg/borg' +is_win32 = sys.platform.startswith('win32') + +# Note: SPEC contains the spec file argument given to pyinstaller +here = os.path.dirname(os.path.abspath(SPEC)) + +if is_win32: + basepath = os.path.abspath(os.path.join(here, '..')) + hiddenimports = [] +else: + basepath = '/vagrant/borg/borg' + hiddenimports = ['borg.platform.posix'] block_cipher = None -a = Analysis([os.path.join(basepath, 'src/borg/__main__.py'), ], +a = Analysis([os.path.join(basepath, 'src', 'borg', '__main__.py'), ], pathex=[basepath, ], binaries=[], datas=[ - ('../src/borg/paperkey.html', 'borg'), + (os.path.join(basepath, 'src', 'borg', 'paperkey.html'), 'borg'), ], - hiddenimports=['borg.platform.posix'], + hiddenimports=hiddenimports, hookspath=[], runtime_hooks=[], excludes=[ @@ -39,7 +49,7 @@ exe = EXE(pyz, debug=False, strip=False, upx=True, - console=True ) + console=True) if False: # Enable this block to build a directory-based binary instead of