Skip to content

Commit

Permalink
Remove requirement for separate Qt installation
Browse files Browse the repository at this point in the history
The only reason to require a standalone Qt installation was the
`lrelease` tool used to convert the translation files.

It turns out PySide6, which we install through `pip`, already includes
this tool under the name `pyside6-lrelease`.

This changes the call from `lrelease` to `pyside6-lrelease`, and removes
the installation of Qt from the GitHub Actions workflow and from the
development setup instructions, except on Linux where we install Qt tools
just to bring in the required system libraries.
  • Loading branch information
jonathanperret authored and dl1com committed Jul 30, 2024
1 parent 889a624 commit 2e4adef
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 19 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-multi-os.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,9 @@ jobs:
(steps.e-cache.outputs.cache-hit != 'true') ||
(steps.qm-cache.outputs.cache-hit != 'true') }}
run: |
sudo apt install -y qt6-base-dev qt6-tools-dev-tools qt6-l10n-tools
PATH=/usr/lib/qt6/bin:$PATH bash setup-environment.ps1
# Install qt6 packages to bring in system dependencies only
sudo apt install -y qt6-base-dev qt6-tools-dev-tools
bash setup-environment.ps1
- name: Cache gui files (1)
if: ${{ (steps.gui1-cache.outputs.cache-hit != 'true') }}
uses: actions/cache/save@v3
Expand Down Expand Up @@ -312,7 +313,6 @@ jobs:
shell: zsh {0}
run: |
brew install avrdude
brew install qt
mkdir tmp-wheel/
python -m pip install delocate
Expand Down
19 changes: 5 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,18 @@ After cloning the repo and installing the development dependencies, you should r
Linux
</summary>

For flashing the firmware, avrdude has to be available on your system.
To be able to work on GUI elements and translation files, you will also need Qt Dev & Localization Tools.
For flashing the firmware, avrdude has to be available on your system.
To build or run the application, you will also need the system libraries required by Qt 6; installing the Qt 6 development tools is a concise (if heavy-handed) way of bringing in these dependencies.

#### Debian/Ubuntu
```bash
sudo apt install python3.11 python3.11-dev python3.11-venv
sudo apt install libasound2-dev avrdude qt6-tools-dev-tools build-essential qt6-l10n-tools
export PATH=/usr/lib/qt6/bin:$PATH
sudo apt install libasound2-dev avrdude qt6-tools-dev-tools build-essential
```
#### openSUSE
```bash
sudo zypper install python311 python311-pip python311-virtualenv python311-devel
sudo zypper install libasound2 alsa-devel avrdude qt6-tools qt6-tools-linguist
export PATH=/usr/lib/qt6/bin:$PATH
sudo zypper install libasound2 alsa-devel avrdude qt6-tools-dev-tools build-essential
```
#### All Distributions

Expand Down Expand Up @@ -70,9 +69,6 @@ Activate the virtual environment. The command prompt should now display
```
(You may skip the virtual environment setup below.)

To be able to work on GUI elements and translation files, the Qt Dev tools are needed.
Navigate to [https://www.qt.io/download-open-source](https://www.qt.io/download-open-source) in a web browser and follow the installation
instructions. From the available options, select "Custom install" and then "Qt 6.6.3".
You will also need to download and install Perl from [https://www.perl.org/get.html](https://www.perl.org/get.html).
</details>

Expand All @@ -89,10 +85,6 @@ You will also need the Xcode command line tools:
```bash
xcode-select --install
```
To be able to work on GUI elements and translation files, the Qt Dev tools are needed also:
```bash
brew install qt
```
Install python from [the official universal2 installer](https://www.python.org/ftp/python/3.11.8/python-3.11.8-macos11.pkg). (Conda does not produce universal binaries)

If you encounter the pip `SSL:TLSV1_ALERT_PROTOCOL_VERSION` problem:
Expand Down Expand Up @@ -127,7 +119,6 @@ Next, convert the PySide6 `.ui` files and generate the translation files:
```bash
bash ./setup-environment.ps1
```
If you get errors about missing `lrelease`, you can skip this (if you do not need the translation files). To do so, comment out lines [23:26] of `setup-environment.ps1`.

Finally, you can start AYAB with
```bash
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/base/ayab/translations/ayab_trans.pl
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ sub rm{
}

# now that the `.ts` files have been generated
# run `lrelease *.ts` to create binary `.qm` files
# run `pyside6-lrelease *.ts` to create binary `.qm` files
open(FILE, "<", $master);
system("lrelease *.ts");
system("pyside6-lrelease *.ts");
unlink glob "*.ts";

0 comments on commit 2e4adef

Please sign in to comment.