Skip to content

Commit

Permalink
build: setup pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Nov 20, 2023
1 parent a14d524 commit 36aab41
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 46 deletions.
4 changes: 4 additions & 0 deletions build-recipes/ChipStreamLauncherCLI.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from chipstream.cli import main

if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion build-recipes/macos_ChipStream.spec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from os.path import exists
import warnings

from mpl_data_cast import __version__ as version
from chipstream import __version__ as version

NAME = "ChipStream"

Expand Down
103 changes: 66 additions & 37 deletions build-recipes/win_ChipStream.spec
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,76 @@
from os.path import exists
import warnings

import mpl_data_cast
import chipstream

NAME = "MPLDataCast"
NAME = "ChipStream"

if not exists("./{}Launcher.py".format(NAME)):
warnings.warn("Cannot find {}Launcher.py'! ".format(NAME) +
"Please run pyinstaller from the 'build-recipes' directory.")


a = Analysis([NAME + "Launcher.py"],
pathex=["."],
hookspath=["."],
runtime_hooks=None)

pyz = PYZ(a.pure)

splash = Splash('../docs/artwork/mpldc_splash.png',
binaries=a.binaries,
datas=a.datas,
text_pos=(44, 163),
text_size=10,
text_color='black',
minify_script=True)

exe = EXE(pyz,
a.scripts,
splash,
[],
exclude_binaries=True,
name=NAME + ".exe",
debug=False,
strip=False,
upx=False,
icon=NAME + ".ico",
console=bool(mpl_data_cast.__version__.count("post")),)

coll = COLLECT(exe,
a.binaries,
a.zipfiles,
a.datas,
splash.binaries,
strip=False,
upx=False,
name=NAME)
cli_a = Analysis(
[NAME + "LauncherCLI.py"],
pathex=["."],
hookspath=["."],
runtime_hooks=None)

cli_pyz = PYZ(cli_a.pure)

cli_exe = EXE(
cli_pyz,
cli_a.scripts,
[],
exclude_binaries=True,
name="chipstream-cli.exe",
debug=False,
strip=False,
upx=False,
icon=NAME + ".ico",
console=True)


gui_a = Analysis(
[NAME + "Launcher.py"],
pathex=["."],
hookspath=["."],
runtime_hooks=None)

gui_pyz = PYZ(gui_a.pure)

gui_splash = Splash(
'../docs/artwork/chipstream_splash.png',
binaries=gui_a.binaries,
datas=gui_a.datas,
text_pos=(44, 163),
text_size=10,
text_color='black',
minify_script=True)

gui_exe = EXE(
gui_pyz,
gui_a.scripts,
gui_splash,
[],
exclude_binaries=True,
name=NAME + ".exe",
debug=False,
strip=False,
upx=False,
icon=NAME + ".ico",
console=bool(chipstream.__version__.count("post")))

coll = COLLECT(
cli_exe,
cli_a.binaries,
cli_a.zipfiles,
cli_a.datas,
gui_exe,
gui_a.binaries,
gui_a.zipfiles,
gui_a.datas,
gui_splash.binaries,
strip=False,
upx=False,
name=NAME)
10 changes: 5 additions & 5 deletions build-recipes/win_chipstream.iss_dummy
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "MPL-Data-Cast"
#define MyAppNameSimple "MPL-Data-Cast"
#define MyzmAppName "MPL-Data-Cast"
#define MyAppName "ChipStream"
#define MyAppNameSimple "ChipStream"
#define MyzmAppName "ChipStream"
#define MyAppVersion "0.1.0"
#define MyAppPublisher "MPL"
#define MyAppURL "https://mpl.mpg.de"
#define MyAppPlatform "win32"
#define MyAppExeName "MPLDataCast.exe"
#define MyAppDir = SourcePath + "dist\MPL-Data-Cast\"
#define MyAppExeName "ChipStream.exe"
#define MyAppDir = SourcePath + "dist\ChipStream\"

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
Expand Down
6 changes: 3 additions & 3 deletions build-recipes/win_make_iss.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
import platform
import sys

import mpl_data_cast
import chipstream

# make library available
cdir = op.dirname(op.abspath(__file__))
pdir = op.dirname(cdir)
sys.path.insert(0, pdir)

# get version
version = mpl_data_cast.__version__
version = chipstream.__version__

# read dummy
with io.open(op.join(cdir, "win_mpl-data-cast.iss_dummy"), 'r') as dummy:
with io.open(op.join(cdir, "win_chipstream.iss_dummy"), 'r') as dummy:
iss = dummy.readlines()

# replace keywords
Expand Down

0 comments on commit 36aab41

Please sign in to comment.