Skip to content

Commit

Permalink
add build instructions with pyinstaller
Browse files Browse the repository at this point in the history
  • Loading branch information
sorgmi committed Mar 25, 2021
1 parent 51041ac commit 559d695
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,10 @@ pip install buildozer
buildozer android debug
```

# Build Desktop Binary (Windows, Linux, Mac)
```
pip install pyinstaller kivymd plyer
pyinstaller main.spec
```
On Windows binary can be found now at dist/main.exe
44 changes: 44 additions & 0 deletions main.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# -*- mode: python ; coding: utf-8 -*-

from PyInstaller.building.build_main import *
import sys
import os

path = os.path.abspath(".")
#kivymd_repo_path = path.split("demos")[0]
#sys.path.insert(0, kivymd_repo_path)

from kivy_deps import sdl2, glew
from kivymd import hooks_path as kivymd_hooks_path

a = Analysis(
["main.py"],
pathex=[path],
binaries=[],
datas=[],
hiddenimports=[

],
hookspath=[kivymd_hooks_path],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=None,
noarchive=False,
)
pyz = PYZ(a.pure, a.zipped_data, cipher=None)

exe = EXE(
pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
*[Tree(p) for p in (sdl2.dep_bins + glew.dep_bins)],
debug=False,
strip=False,
upx=True,
console=True,
name='main'
)

0 comments on commit 559d695

Please sign in to comment.