From 36aab41d691aac52540d9c75b044e73afab2e61e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20M=C3=BCller?= Date: Mon, 20 Nov 2023 08:16:36 +0100 Subject: [PATCH] build: setup pipeline --- build-recipes/ChipStreamLauncherCLI.py | 4 + build-recipes/macos_ChipStream.spec | 2 +- build-recipes/win_ChipStream.spec | 103 ++++++++++++++++--------- build-recipes/win_chipstream.iss_dummy | 10 +-- build-recipes/win_make_iss.py | 6 +- 5 files changed, 79 insertions(+), 46 deletions(-) create mode 100644 build-recipes/ChipStreamLauncherCLI.py diff --git a/build-recipes/ChipStreamLauncherCLI.py b/build-recipes/ChipStreamLauncherCLI.py new file mode 100644 index 0000000..bf5ad6f --- /dev/null +++ b/build-recipes/ChipStreamLauncherCLI.py @@ -0,0 +1,4 @@ +from chipstream.cli import main + +if __name__ == "__main__": + main() diff --git a/build-recipes/macos_ChipStream.spec b/build-recipes/macos_ChipStream.spec index add30d9..c39638c 100644 --- a/build-recipes/macos_ChipStream.spec +++ b/build-recipes/macos_ChipStream.spec @@ -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" diff --git a/build-recipes/win_ChipStream.spec b/build-recipes/win_ChipStream.spec index 691b391..5b6e39f 100644 --- a/build-recipes/win_ChipStream.spec +++ b/build-recipes/win_ChipStream.spec @@ -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) diff --git a/build-recipes/win_chipstream.iss_dummy b/build-recipes/win_chipstream.iss_dummy index 8f3eba0..1a3e226 100644 --- a/build-recipes/win_chipstream.iss_dummy +++ b/build-recipes/win_chipstream.iss_dummy @@ -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. diff --git a/build-recipes/win_make_iss.py b/build-recipes/win_make_iss.py index 6a8eacc..6c78081 100644 --- a/build-recipes/win_make_iss.py +++ b/build-recipes/win_make_iss.py @@ -4,7 +4,7 @@ import platform import sys -import mpl_data_cast +import chipstream # make library available cdir = op.dirname(op.abspath(__file__)) @@ -12,10 +12,10 @@ 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