Skip to content

Commit

Permalink
Added a pyinstaller spec file for building on windows.
Browse files Browse the repository at this point in the history
This incorperates a work-around from here:
pyinstaller/pyinstaller#1966

This isn't perfect:

 - you need to modify your python directory on windows (copy
   c:/python27/lib/site-packages/gnome/shared to c:/python27/shared)

 - after generating the exe file, you also need to copy the glade file
   and the svg files into the dist dir, or the exe will crash.

This relates to issue #15.

I also updated the .gitignore file.
  • Loading branch information
Aeva Palecek committed Jan 2, 2017
1 parent 97bc795 commit 37d82f9
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
*.nw
*.png
*.gif
build/
dist/
*.zip
sprites/
out/
*~
Expand Down
32 changes: 32 additions & 0 deletions converter_gui.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# -*- mode: python -*-

import os
import site

block_cipher = None

typelib_path = os.path.join(site.getsitepackages()[1], 'gnome', 'lib', 'girepository-1.0')

a = Analysis(['converter_gui.py', 'converter_gui.spec'],
pathex=['C:\\Users\\Mym\\Downloads\\nw-converter'],
binaries=[(os.path.join(typelib_path, tl), 'gi_typelibs') for tl in os.listdir(typelib_path)],
datas=None,
hiddenimports=[],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
name='converter_gui',
debug=False,
strip=False,
upx=True,
console=True )

0 comments on commit 37d82f9

Please sign in to comment.