From e48f8014171e99bfc7234dae47771c8c08cb7e0b Mon Sep 17 00:00:00 2001 From: suika <2320837+Suika@users.noreply.github.com> Date: Fri, 7 May 2021 20:44:19 +0200 Subject: [PATCH] Linux build files pyinstaller, files to delete for smaller package --- static/build_files/linux/client.spec | 49 ++++++++++ static/build_files/linux/files_to_delete.txt | 97 ++++++++++++++++++++ static/build_files/linux/linux_build.yml | 59 ++++++++++++ static/build_files/linux/server.spec | 36 ++++++++ 4 files changed, 241 insertions(+) create mode 100644 static/build_files/linux/client.spec create mode 100644 static/build_files/linux/files_to_delete.txt create mode 100644 static/build_files/linux/linux_build.yml create mode 100644 static/build_files/linux/server.spec diff --git a/static/build_files/linux/client.spec b/static/build_files/linux/client.spec new file mode 100644 index 00000000..3d88c089 --- /dev/null +++ b/static/build_files/linux/client.spec @@ -0,0 +1,49 @@ +# -*- mode: python -*- + +block_cipher = None + + +a = Analysis(['hydrus/client.py'], + pathex=['.'], + binaries=[], + datas=[ + ('hydrus/bin', 'bin'), + ('hydrus/help', 'help'), + ('hydrus/static', 'static'), + ('hydrus/client.pyw', '.'), + ('hydrus/client.py', '.'), + ('hydrus/server.py', '.'), + ('dist/server/server', '.'), + ('hydrus/license.txt', '.'), + ('hydrus/Readme.txt', '.'), + ('hydrus/help my client will not boot.txt', '.'), + ('hydrus/db', 'db') + ], + hiddenimports=['hydrus/server.py'], + hookspath=[], + runtime_hooks=[], + excludes=[], + win_no_prefer_redirects=False, + win_private_assemblies=False, + cipher=block_cipher, + noarchive=False) +pyz = PYZ(a.pure, a.zipped_data, + cipher=block_cipher) +exe = EXE(pyz, + a.scripts, + [], + exclude_binaries=True, + name='client', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + console=False ) +coll = COLLECT(exe, + a.binaries, + a.zipfiles, + a.datas, + strip=False, + upx=True, + upx_exclude=[], + name='client') \ No newline at end of file diff --git a/static/build_files/linux/files_to_delete.txt b/static/build_files/linux/files_to_delete.txt new file mode 100644 index 00000000..45225623 --- /dev/null +++ b/static/build_files/linux/files_to_delete.txt @@ -0,0 +1,97 @@ +ld-linux.so.2 +ld-linux-x86-64.so.2 +libanl.so.1 +libasound.so.2 +libBrokenLocale.so.1 +libcidn.so.1 +libcom_err.so.2 +libc.so.6 +libdl.so.2 +libdrm.so.2 +libEGL.so.1 +libexpat.so.1 +libfontconfig.so.1 +libfreetype.so.6 +libfribidi.so.0 +libgbm.so.1 +libgcc_s.so.1 +libgdk_pixbuf-2.0.so.0 +libgio-2.0.so.0 +libglapi.so.0 +libGLdispatch.so.0 +libglib-2.0.so.0 +libGL.so.1 +libGLX.so.0 +libgobject-2.0.so.0 +libharfbuzz.so.0 +libICE.so.6 +libjack.so.0 +libm.so.6 +libmvec.so.1 +libnss_compat.so.2 +libnss_db.so.2 +libnss_dns.so.2 +libnss_files.so.2 +libnss_hesiod.so.2 +libnss_nisplus.so.2 +libnss_nis.so.2 +libp11-kit.so.0 +libpango-1.0.so.0 +libpangocairo-1.0.so.0 +libpangoft2-1.0.so.0 +libpthread.so.0 +libresolv.so.2 +librt.so.1 +libSM.so.6 +libstdc++.so.6 +libthai.so.0 +libthread_db.so.1 +libusb-1.0.so.0 +libutil.so.1 +libuuid.so.1 +libX11.so.6 +libxcb-dri2.so.0 +libxcb-dri3.so.0 +libxcb.so.1 +libz.so.1 +libQt53DAnimation.so* +libQt53DCore.so* +libQt53DExtras.so* +libQt53DInput.so* +libQt53DLogic.so* +libQt53DQuick.so* +libQt53DQuickAnimation.so* +libQt53DQuickExtras.so* +libQt53DQuickInput.so* +libQt53DQuickRender.so* +libQt53DQuickScene2D.so* +libQt53DRender.so* +libQt5Bluetooth.so* +libQt5Bodymovin.so* +libQt5Concurrent.so* +libQt5DataVisualization.so* +libQt5EglFSDeviceIntegration.so* +libQt5Gamepad.so* +libQt5Location.so* +libQt5Multimedia.so* +libQt5MultimediaQuick.so* +libQt5Nfc.so* +libQt5Positioning.so* +libQt5PositioningQuick.so* +libQt5Purchasing.so* +libQt5QuickControls2.so* +libQt5QuickParticles.so* +libQt5QuickShapes.so* +libQt5QuickTemplates2.so* +libQt5QuickTest.so* +libQt5RemoteObjects.so* +libQt5Scxml.so* +libQt5Sensors.so* +libQt5Sql.so* +libQt5Test.so* +libQt5WaylandClient.so* +libQt5WaylandCompositor.so* +libQt5WebChannel.so* +libQt5WebEngine.so* +libQt5WebEngineCore.so* +libQt5WebView.so* \ No newline at end of file diff --git a/static/build_files/linux/linux_build.yml b/static/build_files/linux/linux_build.yml new file mode 100644 index 00000000..8ff4a786 --- /dev/null +++ b/static/build_files/linux/linux_build.yml @@ -0,0 +1,59 @@ +name: Release +on: + push: + tags: + - 'v*' + +jobs: + build-ubuntu: + runs-on: ubuntu-18.04 + steps: + - + name: Checkout + uses: actions/checkout@v2 + with: + path: hydrus + - + name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: 3.8 + architecture: x64 + #- name: Cache Qt + # id: cache-qt + # uses: actions/cache@v1 + # with: + # path: Qt + # key: ${{ runner.os }}-QtCache + #- + # name: Install Qt + # uses: jurplel/install-qt-action@v2 + # with: + # install-deps: true + # setup-python: 'false' + # modules: qtcharts qtwidgets qtgui qtcore + # cached: ${{ steps.cache-qt.outputs.cache-hit }} + - name: APT Install + run: | + sudo apt-get update + sudo apt-get install -y libmpv1 + - name: Pip Installer + uses: BSFishy/pip-action@v1 + with: + packages: pyinstaller + requirements: hydrus/requirements.txt + - name: PyInstaller + run: | + cp hydrus/static/build_files/linux/client.spec client.spec + cp hydrus/static/build_files/linux/server.spec server.spec + pyinstaller server.spec + pyinstaller client.spec + - name: Remove Files + run: | + cd hydrus + while read line; do rm -vf ${line} ; done < static/build_files/linux/files_to_delete.txt + - name: Upload a Build Artifact + uses: actions/upload-artifact@v2 + with: + name: Hydrus Ubuntu LTS Extract + path: dist/client \ No newline at end of file diff --git a/static/build_files/linux/server.spec b/static/build_files/linux/server.spec new file mode 100644 index 00000000..0804ec75 --- /dev/null +++ b/static/build_files/linux/server.spec @@ -0,0 +1,36 @@ +# -*- mode: python -*- + +block_cipher = None + + +a = Analysis(['hydrus/server.py'], + pathex=['.'], + binaries=[], + datas=[], + hiddenimports=[], + hookspath=[], + runtime_hooks=[], + excludes=[], + win_no_prefer_redirects=False, + win_private_assemblies=False, + cipher=block_cipher, + noarchive=False) +pyz = PYZ(a.pure, a.zipped_data, + cipher=block_cipher) +exe = EXE(pyz, + a.scripts, + [], + exclude_binaries=True, + name='server', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + console=True ) +coll = COLLECT(exe, + a.binaries, + a.zipfiles, + a.datas, + strip=False, + upx=True, + name='server') \ No newline at end of file