diff --git a/.github/workflows/on_push.yml b/.github/workflows/on_push.yml index c46bed4..20e3936 100644 --- a/.github/workflows/on_push.yml +++ b/.github/workflows/on_push.yml @@ -2,16 +2,16 @@ name: Build & Test on: push jobs: - BuildExe: + build_exe: + name: Windows portable build runs-on: windows-latest steps: - - uses: actions/checkout@v4 - uses: pdm-project/setup-pdm@v4 with: - python-version: 3.13 - cache: true + python-version: 3.12.8 - name: Install Just - run: choco install just + run: choco install -y just + - uses: actions/checkout@v4 - run: just prepare - run: just --evaluate - run: just bump_version_git build win32_portable @@ -22,7 +22,8 @@ jobs: path: .\dist\* if-no-files-found: error - TestAndBuildDebian: + build_deb: + name: Run PyTest and build Debian package runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 @@ -32,7 +33,8 @@ jobs: cache: true - name: Install Just run: curl -s https://just.systems/install.sh | sudo bash -s -- --to /usr/local/bin - - run: just deps_debian prepare + - name: Install project dependencies + run: just deps_debian prepare - run: just --evaluate - run: just test - run: just bump_version_git build debian diff --git a/README.md b/README.md index 2046c01..d761999 100644 --- a/README.md +++ b/README.md @@ -54,82 +54,71 @@ May also work with newer/older devices in same series. If you want to get better Download & install ----------------- +Common installation options: + [![Download for Windows](./docs/img/windows.png)](https://mmk.pw/en/openfreebuds/download/) [![Available in FlatHub](./docs/img/flathub.png)](https://flathub.org/apps/pw.mmk.OpenFreebuds) -#### Windows package managers - -Winget (preinstalled): - -```powershell -winget install MelianMiko.OpenFreebuds -``` - -[Scoop](https://scoop.sh/): - -```powershell -scoop bucket add extras -scoop install openfreebuds -``` - -#### Debian/Ubuntu +All installation options: -```shell -curl -s https://deb.mmk.pw/setup | sudo bash - -sudo apt install openfreebuds -``` +| Platform | Package manager | Command/Linux | +|---|---|---| +| ![](./docs/img/i_win32.png) Windows | Direct install | [Website](https://mmk.pw/en/openfreebuds/download) or [releases](./releases)| +| ![](./docs/img/i_win32.png) Windows | [Winget](https://learn.microsoft.com/en-us/windows/package-manager/winget/) (preinstalled) |
winget install MelianMiko.OpenFreebuds
| +| ![](./docs/img/i_win32.png) Windows | [Scoop](https://scoop.sh/) |
scoop bucket add extras
scoop install openfreebuds
| +| ![](./docs/img/i_linux.png) Any linux | [Available at Flathub](https://flathub.org/apps/pw.mmk.OpenFreebuds) |
flatpak install pw.mmk.OpenFreebuds
| +| ![](./docs/img/i_debian.png) Debian/Ubuntu | APT |
curl -s https://deb.mmk.pw/setup \| sudo bash -
sudo apt install openfreebuds
| +| ![](./docs/img/i_arch.png) ArchLinux | [Yay](https://github.com/Jguer/yay) for AUR |
yay -S openfreebuds
| -#### Arch Linux +Most recent `dev`-binaries can be found as [GitHub Actions](https://github.com/melianmiko/OpenFreebuds/actions/workflows/on_push.yml) build artifacts. -`openfreebuds` [available in AUR](https://aur.archlinux.org/packages/openfreebuds). - -#### Test builds - -Most recent `dev`-binaries can be found in [GitHub Actions](https://github.com/melianmiko/OpenFreebuds/actions/workflows/on_push.yml) build artifacts. - -Build or start from sources +Build from sources ------------- +### Manual build + Requirements: - Windows 10/11, or enough modern Linux; -- Qt 6.0+ development tools, at least Linguist's `lrelease`; -- [Python](https://www.python.org/downloads/) (3.11+), [Poetry](https://python-poetry.org/docs/#installation) (1.8+); +- Qt 6.0+ development tools, at least Linguist's `lrelease` (under Windows, will be used auto-obtained from `PySide6`; +- [Just](https://github.com/casey/just) +- [Python](https://www.python.org/downloads/) (3.11+), [PDM](https://pdm-project.org/en/latest/); - (Windows, optional) [NSIS](https://nsis.sourceforge.io/Download), [UPX](https://upx.github.io/); -- (Linux, optional) Build essentials and some libraries. - -Also, some dev-scripts may have their own requirements, like `python3-polib` for -`./scripts/sync_translations.sh`. Setup poetry env and dependencies before -continue: - -```shell -poetry install -``` -### Just launch without installation +- (Debian/Ubuntu, optional) For Debian packaging, some native libs (command: `just deps_debian`). -```shell -./scripts/make.py build_launch -``` +
+Get all dependencies for Windows +
+winget install -e --no-upgrade --id Casey.Just
+winget install -e --no-upgrade --id NSIS.NSIS
+winget install -e --no-upgrade --id UPX.UPX
+winget install -e --no-upgrade --id Python.Python.3.12
+powershell -ExecutionPolicy ByPass -c "irm https://pdm-project.org/install-pdm.py | python -"
+# Only for Python 3.13+
+# winget install -e --no-upgrade --id Microsoft.VisualStudio.2022.BuildTools --override "--passive --wait --add Microsoft.VisualStudio.Workload.VCTools;includeRecommended"
+
+
-### Windows +When dependencies listed above are resolved, parepare project environment and build Python +wheel by running: `just prepare build`. -If everything above is installed & added to `PATH`, just run: +Now, you can try launching OpenFreebuds by `just start` command or package it via: -```shell -.\scripts\build_win32\make.cmd -``` +- `just win32` for Windows portable and installer; +- `just debian` for Debian `deb`-package; +- `just flatpak` for Flatpak bundle (will also automatically install application). -Output binaries will be located in `scripts\build_win32\dist` +### VM-based build (Vagrant) -### Debian/Ubuntu +> [!WARNING] +> This build method will require a machine with at least 16 GB of RAM and fast internet conneciton. -Install all packaging dependencies automated way: -`apt install build-essentials && ./scripts/install_dpkg_dependencies.sh`. +Install [Vagrant](https://developer.hashicorp.com/vagrant/install?product_intent=vagrant) and any +suitable hypervisor, I'm using VMware. Then just `vagrant up` in project root, it will automatically +deply Debian 12 & Windows 11 machines that will build OpenFreebuds in (mostly) all packages. -```shell -dpkg-buildpackage -b -``` +Don't forgot to `vagrant halt` after finish, to free CPU/RAM usage. -Output file will be located in parent folder (`../*.deb`). +--- ![Extra dialogs preview](docs/preview_2.png) diff --git a/Vagrantfile b/Vagrantfile index d0d227c..f7d3730 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -5,7 +5,7 @@ Vagrant.configure("2") do |config| debian.vm.provision "shell", run: 'once', - name: "Prepare base dependencies (Flatpak, Just, Poetry)", + name: "Prepare base dependencies (Python, Just, PDM)", privileged: true, inline: <<-SHELL apt update @@ -24,7 +24,7 @@ Vagrant.configure("2") do |config| curl -s https://just.systems/install.sh | bash -s -- --to /usr/local/bin fi - # Install Poetry for user + # Install PDM for user if [ ! -f /home/vagrant/.local/bin/pdm ] then curl -sSL https://pdm-project.org/install-pdm.py | sudo -u vagrant python3 - @@ -33,32 +33,37 @@ Vagrant.configure("2") do |config| debian.vm.provision "shell", run: 'always', - name: "Install Flatpak requirements", + name: "Install project dependencies", privileged: false, inline: <<-SHELL - flatpak remote-add --if-not-exists --user flathub https://dl.flathub.org/repo/flathub.flatpakrepo - flatpak install -y --user org.flatpak.Builder + cd ~/openfreebuds + just deps_debian prepare SHELL debian.vm.provision "shell", run: 'always', - name: "Install project dependencies", + name: "Build binaries", privileged: false, inline: <<-SHELL + export FLATPAKBUILDDIR=$HOME/flatpak + cd ~/openfreebuds - just deps_debian prepare + just --evaluate + just build debian SHELL - debian.vm.provision "shell", - run: 'always', - name: "Build binaries", + debian.vm.provision "shell", + run: 'once', + name: "Install Flatpak requirements and build Flatpak bundle", privileged: false, inline: <<-SHELL export FLATPAKBUILDDIR=$HOME/flatpak + flatpak remote-add --if-not-exists --user flathub https://dl.flathub.org/repo/flathub.flatpakrepo + flatpak install -y --user org.flatpak.Builder + cd ~/openfreebuds - just --evaluate - just build debian flatpak + just build flatpak SHELL end @@ -66,6 +71,8 @@ Vagrant.configure("2") do |config| win.vm.box = "gusztavvargadr/windows-11-24h2-enterprise" win.vm.synced_folder ".", "C:\\openfreebuds" win.vm.provider "vmware_desktop" do |v| + v.vmx["numvcpus"] = "4" + v.vmx["memsize"] = "4096" v.gui = true end @@ -86,8 +93,9 @@ Vagrant.configure("2") do |config| winget install -e --accept-source-agreements --no-upgrade --id Casey.Just winget install -e --no-upgrade --id NSIS.NSIS winget install -e --no-upgrade --id UPX.UPX - winget install -e --no-upgrade --id Python.Python.3.13 - winget install -e --no-upgrade --id Microsoft.VisualStudio.2022.BuildTools --override "--passive --wait --add Microsoft.VisualStudio.Workload.VCTools;includeRecommended" + winget install -e --no-upgrade --id Python.Python.3.12 + # Only for Python 3.13+ + # winget install -e --no-upgrade --id Microsoft.VisualStudio.2022.BuildTools --override "--passive --wait --add Microsoft.VisualStudio.Workload.VCTools;includeRecommended" SHELL win.vm.provision "shell", diff --git a/debian/control b/debian/control index ae64991..0c3d1ad 100644 --- a/debian/control +++ b/debian/control @@ -4,12 +4,7 @@ Priority: optional Maintainer: MelianMiko Build-Depends: debhelper-compat (= 12), build-essential, - python3-dev, python3-pip, - libcairo2-dev, - gobject-introspection, - libgirepository1.0-dev, - qt6-l10n-tools, fakeroot, make, git diff --git a/docs/img/i_arch.png b/docs/img/i_arch.png new file mode 100644 index 0000000..051b730 Binary files /dev/null and b/docs/img/i_arch.png differ diff --git a/docs/img/i_debian.png b/docs/img/i_debian.png new file mode 100644 index 0000000..d95a5f4 Binary files /dev/null and b/docs/img/i_debian.png differ diff --git a/docs/img/i_linux.png b/docs/img/i_linux.png new file mode 100644 index 0000000..ee40272 Binary files /dev/null and b/docs/img/i_linux.png differ diff --git a/docs/img/i_win32.png b/docs/img/i_win32.png new file mode 100644 index 0000000..cf26f9e Binary files /dev/null and b/docs/img/i_win32.png differ diff --git a/justfile b/justfile index 52266e0..799cf6e 100644 --- a/justfile +++ b/justfile @@ -4,7 +4,7 @@ set windows-shell := ["powershell.exe", "-c"] set script-interpreter := ["python"] # Tools -pyside6_dir := `python -c " +pyside6_dir := `pdm run python -c " import os try: import PySide6 @@ -65,6 +65,9 @@ test: prepare: pdm install +vg_all: + vagrant halt -f + vagrant up --parallel # ------------------------------------------------ @@ -203,8 +206,20 @@ debian_full: # Install build dependencies for Debian\Ubuntu [linux] deps_debian: - # TODO: Move inside Justfile - sudo bash ./scripts/install_dpkg_dependencies.sh + sudo apt install -y --no-install-recommends \ + build-essential \ + debhelper-compat \ + python3-dbus-next \ + python3-pyqt6 \ + python3-pil \ + python3-qasync \ + python3-aiohttp \ + python3-psutil \ + python3-pip \ + qt6-l10n-tools \ + fakeroot \ + make \ + git @@ -220,20 +235,20 @@ win32: win32_installer win32_portable [windows] win32_installer: win32_bundle New-Item -ItemType Directory -Force -Path ./dist - cd ./scripts/build_win32; makensis openfreebuds.nsi - mv ./scripts/build_win32/dist/openfreebuds.install.exe ./dist/openfreebuds_{{version}}_win32.exe + cd ./scripts; & "C:\Program Files (x86)\NSIS\Bin\makensis.exe" openfreebuds.nsi + mv -Force ./scripts/dist/openfreebuds.install.exe ./dist/openfreebuds_{{version}}_win32.exe # Make windows portable executable [windows] win32_portable: New-Item -ItemType Directory -Force -Path ./dist - cd ./scripts/build_win32; & pdm run pyinstaller openfreebuds_portable.spec - mv ./scripts/build_win32/dist/openfreebuds_portable.exe ./dist/openfreebuds_{{version}}_win32_portable.exe + cd ./scripts; & pdm run pyinstaller -y openfreebuds_portable.spec + mv -Force ./scripts/dist/openfreebuds_portable.exe ./dist/openfreebuds_{{version}}_win32_portable.exe # Prepare ./dist/ for win32 installer build [windows,private] win32_bundle: - cd ./scripts/build_win32; pdm run pyinstaller openfreebuds.spec + cd ./scripts; pdm run pyinstaller -y openfreebuds.spec diff --git a/pdm.lock b/pdm.lock index 55c6249..4819fae 100644 --- a/pdm.lock +++ b/pdm.lock @@ -5,7 +5,7 @@ groups = ["default", "dev"] strategy = ["inherit_metadata"] lock_version = "4.5.0" -content_hash = "sha256:4b56fcca4cf612b7c68edc0ead138ac9d751d2056f2f1e0a4c63f589028329ba" +content_hash = "sha256:c94dcb5b127d163a0541c8723b83176df64c3f647f51870f233a08f8f04625dd" [[metadata.targets]] requires_python = ">=3.10,<3.14" @@ -26,13 +26,13 @@ files = [ [[package]] name = "aiohappyeyeballs" -version = "2.4.4" -requires_python = ">=3.8" +version = "2.4.5" +requires_python = ">=3.9" summary = "Happy Eyeballs for asyncio" groups = ["default"] files = [ - {file = "aiohappyeyeballs-2.4.4-py3-none-any.whl", hash = "sha256:a980909d50efcd44795c4afeca523296716d50cd756ddca6af8c65b996e27de8"}, - {file = "aiohappyeyeballs-2.4.4.tar.gz", hash = "sha256:5fdd7d87889c63183afc18ce9271f9b0a7d32c2303e394468dd45d514a757745"}, + {file = "aiohappyeyeballs-2.4.5-py3-none-any.whl", hash = "sha256:67b5c2033c60048046863ed377f450bceb74634dc0f9abe4723b60ba12bfe135"}, + {file = "aiohappyeyeballs-2.4.5.tar.gz", hash = "sha256:950d95733a9c09011e75cf58550c68eb834ee5211106ad1a686b7259d3110bc4"}, ] [[package]] @@ -185,7 +185,6 @@ version = "0.2.3" requires_python = ">=3.6.0" summary = "A zero-dependency DBus library for Python with asyncio support" groups = ["default"] -marker = "sys_platform == \"linux\"" files = [ {file = "dbus_next-0.2.3-py3-none-any.whl", hash = "sha256:58948f9aff9db08316734c0be2a120f6dc502124d9642f55e90ac82ffb16a18b"}, {file = "dbus_next-0.2.3.tar.gz", hash = "sha256:f4eae26909332ada528c0a3549dda8d4f088f9b365153952a408e28023a626a5"}, @@ -805,6 +804,60 @@ files = [ {file = "pyqt6_sip-13.10.0.tar.gz", hash = "sha256:d6daa95a0bd315d9ec523b549e0ce97455f61ded65d5eafecd83ed2aa4ae5350"}, ] +[[package]] +name = "pyside6" +version = "6.8.2.1" +requires_python = "<3.14,>=3.9" +summary = "Python bindings for the Qt cross-platform application and UI framework" +groups = ["dev"] +marker = "sys_platform == \"win32\"" +dependencies = [ + "PySide6-Addons==6.8.2.1", + "PySide6-Essentials==6.8.2.1", + "shiboken6==6.8.2.1", +] +files = [ + {file = "PySide6-6.8.2.1-cp39-abi3-macosx_12_0_universal2.whl", hash = "sha256:3fcb551729f235475b2abe7d919027de54a65d850e744f60716f890202273720"}, + {file = "PySide6-6.8.2.1-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:23d2a1a77b25459a049c4276b4e0bbfb375b73d3921061b1a16bcfa64e1fe517"}, + {file = "PySide6-6.8.2.1-cp39-abi3-manylinux_2_39_aarch64.whl", hash = "sha256:bfefa80a93db06dc64c0e7beef0377c9b8ca51e007cfc34575defe065af893b6"}, + {file = "PySide6-6.8.2.1-cp39-abi3-win_amd64.whl", hash = "sha256:92361e41727910e3560ea5ba494fabecc76cd20892c9fcb2ced07619081c4e65"}, +] + +[[package]] +name = "pyside6-addons" +version = "6.8.2.1" +requires_python = "<3.14,>=3.9" +summary = "Python bindings for the Qt cross-platform application and UI framework (Addons)" +groups = ["dev"] +marker = "sys_platform == \"win32\"" +dependencies = [ + "PySide6-Essentials==6.8.2.1", + "shiboken6==6.8.2.1", +] +files = [ + {file = "PySide6_Addons-6.8.2.1-cp39-abi3-macosx_12_0_universal2.whl", hash = "sha256:5558816018042fecd0d782111ced529585a23ea9a010b518f8495764f578a01f"}, + {file = "PySide6_Addons-6.8.2.1-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:f3d85e676851ada8238bc76ebfacbee738fc0b35b3bc15c9765dd107b8ee6ec4"}, + {file = "PySide6_Addons-6.8.2.1-cp39-abi3-manylinux_2_39_aarch64.whl", hash = "sha256:d904179f16deeca4ba440b4ef78e8d54df2b994b46784ad9d53b741082f3b2a7"}, + {file = "PySide6_Addons-6.8.2.1-cp39-abi3-win_amd64.whl", hash = "sha256:c761cc45022aa79d8419e671e7fb34a4a3e5b3826f1e68fcb819bd6e3a387fbb"}, +] + +[[package]] +name = "pyside6-essentials" +version = "6.8.2.1" +requires_python = "<3.14,>=3.9" +summary = "Python bindings for the Qt cross-platform application and UI framework (Essentials)" +groups = ["dev"] +marker = "sys_platform == \"win32\"" +dependencies = [ + "shiboken6==6.8.2.1", +] +files = [ + {file = "PySide6_Essentials-6.8.2.1-cp39-abi3-macosx_12_0_universal2.whl", hash = "sha256:ae5cc48f7e9a08e73e3ec2387ce245c8150e620b8d5a87548ebd4b8e3aeae49b"}, + {file = "PySide6_Essentials-6.8.2.1-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:5ab31e5395a4724102edd6e8ff980fa3f7cde2aa79050763a1dcc30bb914195a"}, + {file = "PySide6_Essentials-6.8.2.1-cp39-abi3-manylinux_2_39_aarch64.whl", hash = "sha256:7aed46f91d44399b4c713cf7387f5fb6f0114413fbcdbde493a528fb8e19f6ed"}, + {file = "PySide6_Essentials-6.8.2.1-cp39-abi3-win_amd64.whl", hash = "sha256:18de224f09108998d194e60f2fb8a1e86367dd525dd8a6192598e80e6ada649e"}, +] + [[package]] name = "pytest" version = "8.3.4" @@ -887,6 +940,20 @@ files = [ {file = "setuptools-75.8.0.tar.gz", hash = "sha256:c5afc8f407c626b8313a86e10311dd3f661c6cd9c09d4bf8c15c0e11f9f2b0e6"}, ] +[[package]] +name = "shiboken6" +version = "6.8.2.1" +requires_python = "<3.14,>=3.9" +summary = "Python/C++ bindings helper module" +groups = ["dev"] +marker = "sys_platform == \"win32\"" +files = [ + {file = "shiboken6-6.8.2.1-cp39-abi3-macosx_12_0_universal2.whl", hash = "sha256:d3dedeb3732ecfc920c9f97da769c0022a1c3bda99346a9eba56fbf093deaa75"}, + {file = "shiboken6-6.8.2.1-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:c83e90056f13d0872cc4d2b7bf60b6d6e3b1b172f1f91910c0ba5b641af01758"}, + {file = "shiboken6-6.8.2.1-cp39-abi3-manylinux_2_39_aarch64.whl", hash = "sha256:8592401423acc693f51dbbfae5e7493cc3ed6738be79daaf90afa07f4da5bb25"}, + {file = "shiboken6-6.8.2.1-cp39-abi3-win_amd64.whl", hash = "sha256:1b751d47b759762b7ca31bad278d52eca4105d3028880d93979261ebbfba810c"}, +] + [[package]] name = "six" version = "1.17.0" diff --git a/pyproject.toml b/pyproject.toml index 4e6997f..08033d5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,8 +14,8 @@ dependencies = [ "qasync<1.0.0,>=0.27.1", "pynput<2.0.0,>=1.7.7", "pyqt6<7.0.0,>=6.7.1", + "dbus-next<1.0.0,>=0.2.3", "winsdk==1.0.0b10; sys_platform == 'win32'", - "dbus-next<1.0.0,>=0.2.3; sys_platform == 'linux'", ] [dependency-groups] @@ -23,6 +23,8 @@ dev = [ "pytest<9.0.0,>=8.3.2", "pytest-asyncio<1.0.0,>=0.24.0", "pyinstaller==6.10.0; sys_platform == 'win32'", + # lrelease.exe provider + "pyside6>=6.8.2.1; sys_platform == 'win32'", ] no_flatpak = [ "pyqt6<7.0.0,>=6.7.1", diff --git a/scripts/.gitignore b/scripts/.gitignore new file mode 100644 index 0000000..9d0b71a --- /dev/null +++ b/scripts/.gitignore @@ -0,0 +1,2 @@ +build +dist diff --git a/scripts/build_win32/.gitignore b/scripts/build_win32/.gitignore deleted file mode 100644 index 2247d5f..0000000 --- a/scripts/build_win32/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/build -/dist diff --git a/scripts/build_win32/make.cmd b/scripts/build_win32/make.cmd deleted file mode 100644 index bb75234..0000000 --- a/scripts/build_win32/make.cmd +++ /dev/null @@ -1,22 +0,0 @@ -@echo off -pushd . -cd /D "%~dp0" - -rem Clean up -rd /s /q dist > nul 2>&1 -rd /s /q build > nul 2>&1 - -rem Build Qt ui/ts files -call make_qt.cmd - -rem Build base bundle via pyinstaller -poetry run pyinstaller openfreebuds.spec - -rem Build setup.exe -"C:\Program Files (x86)\NSIS\Bin\makensis.exe" openfreebuds.nsi - -rem Build portable via pyinstaller -poetry run pyinstaller openfreebuds_portable.spec - -rem Rename release files -python rename_release.py diff --git a/scripts/build_win32/make_portable.cmd b/scripts/build_win32/make_portable.cmd deleted file mode 100644 index c4d8326..0000000 --- a/scripts/build_win32/make_portable.cmd +++ /dev/null @@ -1,16 +0,0 @@ -@echo off -pushd . -cd /D "%~dp0" - -rem Clean up -rd /s /q dist > nul 2>&1 -rd /s /q build > nul 2>&1 - -rem Build Qt ui/ts files -call make_qt.cmd - -rem Build portable via pyinstaller -poetry run pyinstaller openfreebuds_portable.spec - -rem Rename release files -python rename_release.py diff --git a/scripts/build_win32/make_qt.cmd b/scripts/build_win32/make_qt.cmd deleted file mode 100644 index dff15e5..0000000 --- a/scripts/build_win32/make_qt.cmd +++ /dev/null @@ -1,8 +0,0 @@ -@echo off -pushd . -cd /D "%~dp0" - -For %%i in ("%CD%\..\..\openfreebuds_qt\assets\i18n\*.ts")do lrelease %%~i -poetry run pyuic6 ..\..\openfreebuds_qt\designer - -popd . diff --git a/scripts/build_win32/rename_release.py b/scripts/build_win32/rename_release.py deleted file mode 100644 index 7984eae..0000000 --- a/scripts/build_win32/rename_release.py +++ /dev/null @@ -1,20 +0,0 @@ -from pathlib import Path - -VERSION_CODE = "noversion" -DIST = Path(__file__).parent / "dist" - -with open("openfreebuds.nsi", "r") as f: - for line in f.read().split("\n"): - if line.startswith("!define APP_VERSION"): - VERSION_CODE = line.split(" ")[2][1:-1] - break - -if (DIST / "openfreebuds_portable.exe").is_file(): - (DIST / "openfreebuds_portable.exe").rename( - DIST / f"openfreebuds_{VERSION_CODE}_win32_portable.exe" - ) - -if (DIST / "openfreebuds.install.exe").is_file(): - (DIST / "openfreebuds.install.exe").rename( - DIST / f"openfreebuds_{VERSION_CODE}_win32.exe" - ) diff --git a/scripts/bump_version.py b/scripts/bump_version.py index d79d560..718fcd4 100644 --- a/scripts/bump_version.py +++ b/scripts/bump_version.py @@ -142,7 +142,6 @@ def create_flatpak_staff(): continue new_export_data.append(line) - # TODO: Other place with open(PROJECT_ROOT / ".flatpak/requirements.txt", "w") as f: f.write("\n".join(new_export_data)) @@ -176,19 +175,19 @@ def main(): CHANGELOG.append("- Changelog not provided") # Set up tools - (PROJECT_ROOT / ".flatpak").mkdir(exist_ok=True, parents=True) - if not FLATPAK_PIP_GENERATOR_PATH.is_file(): - print(f"-- Downloading flatpak-pip-generator") - urllib.request.urlretrieve(URL_FLATPAK_PIP_GENERATOR, FLATPAK_PIP_GENERATOR_PATH) - os.chmod(FLATPAK_PIP_GENERATOR_PATH, 0o755) + # (PROJECT_ROOT / ".flatpak").mkdir(exist_ok=True, parents=True) + # if not FLATPAK_PIP_GENERATOR_PATH.is_file(): + # print(f"-- Downloading flatpak-pip-generator") + # urllib.request.urlretrieve(URL_FLATPAK_PIP_GENERATOR, FLATPAK_PIP_GENERATOR_PATH) + # os.chmod(FLATPAK_PIP_GENERATOR_PATH, 0o755) # Launch everything bump_pyproject(str(PROJECT_ROOT / "pyproject.toml")) - bump_nsis(str(PROJECT_ROOT / "scripts/build_win32/openfreebuds.nsi")) + bump_nsis(str(PROJECT_ROOT / "scripts/openfreebuds.nsi")) bump_debian(PROJECT_ROOT / "debian/changelog") bump_metainfo(str(PROJECT_ROOT / "openfreebuds_qt/assets/pw.mmk.OpenFreebuds.metainfo.xml")) create_version_info(PROJECT_ROOT / "openfreebuds_qt/version_info.py") - create_flatpak_staff() + # create_flatpak_staff() # Create release.json # with open(PROJECT_ROOT / "release.json", "w") as f: @@ -203,6 +202,7 @@ def main(): if __name__ == "__main__": if NEW_VERSION == "flatpak_deps": + # TODO: Move inside Justfile create_flatpak_staff() else: main() diff --git a/scripts/install_dpkg_dependencies.sh b/scripts/install_dpkg_dependencies.sh deleted file mode 100755 index 572d0fb..0000000 --- a/scripts/install_dpkg_dependencies.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env bash - -apt install -y --no-install-recommends $(awk ' - /^(Build-)?Depends:/ || /^ / && deps { - sub(/^[^ ]+: /, "") - deps = 1 - dep_str = dep_str ", " $0 - next - } - { deps=0 } - END { - split(dep_str, dep_array, /[,|] */) - for (d in dep_array) { - dep = dep_array[d] - gsub(/[^a-z0-9_.+-].*$/, "", dep) - if (dep && !seen[dep]++) print dep - } - }' debian/control) diff --git a/scripts/build_win32/openfreebuds.nsi b/scripts/openfreebuds.nsi similarity index 100% rename from scripts/build_win32/openfreebuds.nsi rename to scripts/openfreebuds.nsi diff --git a/scripts/build_win32/openfreebuds.spec b/scripts/openfreebuds.spec similarity index 81% rename from scripts/build_win32/openfreebuds.spec rename to scripts/openfreebuds.spec index 3ac7df9..090a0ee 100644 --- a/scripts/build_win32/openfreebuds.spec +++ b/scripts/openfreebuds.spec @@ -5,18 +5,18 @@ block_cipher = None a = Analysis( - ["..\\..\\openfreebuds_qt\\launcher.py"], + ["..\\openfreebuds_qt\\launcher.py"], pathex=[], binaries=[], datas=[ - ('..\\..\\openfreebuds\\assets', 'openfreebuds\\assets'), - ('..\\..\\openfreebuds_qt\\assets', 'openfreebuds_qt\\assets'), + ('..\\openfreebuds\\assets', 'openfreebuds\\assets'), + ('..\\openfreebuds_qt\\assets', 'openfreebuds_qt\\assets'), ], hiddenimports=[], hookspath=[], hooksconfig={}, runtime_hooks=[], - excludes=[], + excludes=['PySide6'], win_no_prefer_redirects=False, win_private_assemblies=False, cipher=block_cipher, diff --git a/scripts/build_win32/openfreebuds_portable.spec b/scripts/openfreebuds_portable.spec similarity index 78% rename from scripts/build_win32/openfreebuds_portable.spec rename to scripts/openfreebuds_portable.spec index 37e89ac..13a75c9 100644 --- a/scripts/build_win32/openfreebuds_portable.spec +++ b/scripts/openfreebuds_portable.spec @@ -2,18 +2,18 @@ a = Analysis( - ["..\\..\\openfreebuds_qt\\launcher.py"], + ["..\\openfreebuds_qt\\launcher.py"], pathex=[], binaries=[], datas=[ - ('..\\..\\openfreebuds\\assets', 'openfreebuds\\assets'), - ('..\\..\\openfreebuds_qt\\assets', 'openfreebuds_qt\\assets'), + ('..\\openfreebuds\\assets', 'openfreebuds\\assets'), + ('..\\openfreebuds_qt\\assets', 'openfreebuds_qt\\assets'), ], hiddenimports=[], hookspath=[], hooksconfig={}, runtime_hooks=[], - excludes=[], + excludes=['PySide6'], win_no_prefer_redirects=False, win_private_assemblies=False, noarchive=False, diff --git a/scripts/build_win32/pw.mmk.OpenFreebuds.ico b/scripts/pw.mmk.OpenFreebuds.ico similarity index 100% rename from scripts/build_win32/pw.mmk.OpenFreebuds.ico rename to scripts/pw.mmk.OpenFreebuds.ico