diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fff7e9c2..d515769b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -47,8 +47,8 @@ jobs: - name: Install dependencies run: pip install -r requirements.txt - - name: Build with pyinstaller - run: pyinstaller torrent-client/main.py --distpath resources/dist --icon=images/icon.ico -n hydra-download-manager + - name: Build with cx_Freeze + run: python torrent-client/setup.py build - name: Publish run: yarn run publish diff --git a/README.md b/README.md index 8c2a5d9b..a737756e 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ yarn start Build the bittorrent client by using this command: ```bash -pyinstaller torrent-client/main.py --distpath resources/dist --icon=images/icon.ico -n hydra-download-manager +python torrent-client/setup.py build ``` ### Build the Electron application diff --git a/forge.config.ts b/forge.config.ts index 3bc8bf23..21718764 100644 --- a/forge.config.ts +++ b/forge.config.ts @@ -13,6 +13,16 @@ import { ElectronegativityPlugin } from "@electron-forge/plugin-electronegativit import { mainConfig } from "./webpack.main.config"; import { rendererConfig } from "./webpack.renderer.config"; +const linuxPkgConfig = { + mimeType: ["x-scheme-handler/hydralauncher"], + bin: "./Hydra", + desktopTemplate: "./hydra-launcher.desktop", + icon: "images/icon.png", + genericName: "Games Launcher", + name: "hydra-launcher", + productName: "Hydra" +}; + const config: ForgeConfig = { packagerConfig: { asar: true, @@ -40,16 +50,10 @@ const config: ForgeConfig = { }), new MakerZIP({}, ["darwin", "linux"]), new MakerRpm({ - options: { - mimeType: ["x-scheme-handler/hydralauncher"], - bin: "./Hydra", - }, + options: linuxPkgConfig }), new MakerDeb({ - options: { - mimeType: ["x-scheme-handler/hydralauncher"], - bin: "./Hydra", - }, + options: linuxPkgConfig }), ], publishers: [ diff --git a/hydra-launcher.desktop b/hydra-launcher.desktop new file mode 100644 index 00000000..e9e10e91 --- /dev/null +++ b/hydra-launcher.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Name=Hydra +Comment=No bullshit. Just play. +GenericName=Games Launcher +Exec=hydra-launcher %U +Icon=hydra-launcher +Type=Application +StartupNotify=true +Categories=GNOME;GTK;Utility; +MimeType=x-scheme-handler/hydralauncher; +StartupWMClass=Hydra diff --git a/requirements.txt b/requirements.txt index b2778d60..6cee730a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,5 @@ libtorrent -pyinstaller +cx_Freeze +cx_Logging; sys_platform == 'win32' +lief; sys_platform == 'win32' pywin32; sys_platform == 'win32' diff --git a/torrent-client/setup.py b/torrent-client/setup.py new file mode 100644 index 00000000..e098ec80 --- /dev/null +++ b/torrent-client/setup.py @@ -0,0 +1,16 @@ +from cx_Freeze import setup, Executable + +# Dependencies are automatically detected, but it might need fine tuning. +build_exe_options = { + "packages": ["libtorrent"], + "build_exe": "resources/dist/hydra-download-manager", + "include_msvcr": True +} + +setup( + name="hydra-download-manager", + version="0.1", + description="Hydra Torrent Client", + options={"build_exe": build_exe_options}, + executables=[Executable("torrent-client/main.py", target_name="hydra-download-manager")] +)