From 2157130f69e7d6936cb88a98017ae5b0e3278473 Mon Sep 17 00:00:00 2001 From: dj2ls Date: Sun, 16 Jan 2022 17:57:31 +0100 Subject: [PATCH] changed build action tnc and daemon now in subdirectory which is not build as single application for easier debugging. --- .github/workflows/build-project.yml | 35 +++++------- tnc/freedata.spec | 87 +++++++++++++++++++++++++++++ 2 files changed, 101 insertions(+), 21 deletions(-) create mode 100644 tnc/freedata.spec diff --git a/.github/workflows/build-project.yml b/.github/workflows/build-project.yml index bd8ad5db..5146b91b 100644 --- a/.github/workflows/build-project.yml +++ b/.github/workflows/build-project.yml @@ -58,7 +58,7 @@ jobs: if: matrix.os == 'windows-latest' working-directory: tnc run: | - pyinstaller -F --add-binary="lib/codec2/windows/*;lib/codec2/windows/" --add-binary="lib/hamlib/win32/*;lib/hamlib/win32" --add-binary="lib/hamlib/win64/*;lib/hamlib/win64" main.py -n tnc + pyinstaller -F --add-binary="libcodec2.dll;lib/codec2/windows/" --add-binary="lib/hamlib/win32/*;lib/hamlib/win32" --add-binary="lib/hamlib/win64/*;lib/hamlib/win64" main.py -n tnc @@ -186,9 +186,8 @@ jobs: - name: Build codec2 Linux if: matrix.os == 'ubuntu-20.04' - #working-directory: tnc + working-directory: tnc run: | - cd ~ git clone https://github.com/drowe67/codec2.git cd codec2 && mkdir build_linux && cd build_linux cmake ../ @@ -199,14 +198,8 @@ jobs: if: matrix.os == 'ubuntu-20.04' working-directory: tnc run: | - pyinstaller -F --add-binary lib/hamlib/linux/libhamlib.so:./lib/hamlib/linux/ -n daemon daemon.py - - - name: Build Linux TNC - if: matrix.os == 'ubuntu-20.04' - working-directory: tnc - run: | - pyinstaller -F --add-binary ~/codec2/build_linux/src/libcodec2.so.1.0:. --add-binary lib/hamlib/linux/libhamlib.so:./lib/hamlib/linux/ -n tnc main.py - + pyinstaller freedata.spec + - name: LIST ALL FILES shell: bash run: | @@ -226,17 +219,18 @@ jobs: name: tnc-artifact path: ./tnc/dist/compressed/* + - name: Copy TNC to GUI Linux + if: matrix.os == 'ubuntu-20.04' + run: | + cp -R ./tnc/dist/tnc ./gui/tnc + ls -R + - name: Install Node.js, NPM and Yarn uses: actions/setup-node@v1 with: node-version: 14 - - name: Copy TNC to GUI Linux - if: matrix.os == 'ubuntu-20.04' - run: | - cp -R ./tnc/dist ./gui/tnc - ls -R - + - name: Build/release Electron app uses: samuelmeuli/action-electron-builder@v1 with: @@ -259,10 +253,9 @@ jobs: run: | mkdir gui-bundle cp ./gui/dist/*.AppImage gui-bundle - cp ./tnc/dist/daemon gui-bundle - cp ./tnc/dist/tnc gui-bundle - chmod +x ./gui-bundle/tnc - chmod +x ./gui-bundle/daemon + cp -R ./tnc/dist/tnc gui-bundle + chmod +x ./gui-bundle/tnc/tnc + chmod +x ./gui-bundle/tnc/daemon cd ./gui-bundle zip -r FreeDATA_linux.zip . ls -R diff --git a/tnc/freedata.spec b/tnc/freedata.spec new file mode 100644 index 00000000..ee590792 --- /dev/null +++ b/tnc/freedata.spec @@ -0,0 +1,87 @@ +# -*- mode: python ; coding: utf-8 -*- + + +block_cipher = None + +# DAEMON -------------------------------------------------- +daemon_a = Analysis(['daemon.py'], + pathex=[], + binaries=[], + datas=[( './lib/hamlib/linux/python3.8/site-packages/libhamlib.so.4', '.' )], + hiddenimports=[], + hookspath=[], + hooksconfig={}, + runtime_hooks=[], + excludes=[], + win_no_prefer_redirects=False, + win_private_assemblies=False, + cipher=block_cipher, + noarchive=False) +daemon_pyz = PYZ(daemon_a.pure, daemon_a.zipped_data, + cipher=block_cipher) + +daemon_exe = EXE(daemon_pyz, + daemon_a.scripts, + [], + exclude_binaries=True, + name='daemon', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + console=True, + disable_windowed_traceback=False, + target_arch=None, + codesign_identity=None, + entitlements_file=None ) + +# add lib folder to system path. We only need to do this once +daemon_a.datas += Tree('./lib', prefix='lib') +daemon_a.datas += Tree('./codec2', prefix='codec2') + + +# TNC -------------------------------------------------- +tnc_a = Analysis(['main.py'], + pathex=[], + binaries=[], + datas=[], + hiddenimports=[], + hookspath=[], + hooksconfig={}, + runtime_hooks=[], + excludes=[], + win_no_prefer_redirects=False, + win_private_assemblies=False, + cipher=block_cipher, + noarchive=False) +tnc_pyz = PYZ(tnc_a.pure, tnc_a.zipped_data, + cipher=block_cipher) + +tnc_exe = EXE(tnc_pyz, + tnc_a.scripts, + [], + exclude_binaries=True, + name='tnc', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + console=True, + disable_windowed_traceback=False, + target_arch=None, + codesign_identity=None, + entitlements_file=None ) + + +coll = COLLECT(daemon_exe, + daemon_a.binaries, + daemon_a.zipfiles, + daemon_a.datas, + tnc_exe, + tnc_a.binaries, + tnc_a.zipfiles, + tnc_a.datas, + strip=False, + upx=True, + upx_exclude=[], + name='tnc')