build: Use python interpreter and modules for qt commands in Makefile

The Qt5 commands for creating UI, resources and language files have
now been switched from the shell scripts to the direct call of the
Python modules.

Signed-off-by: Sven Sager <akira@narux.de>
This commit is contained in:
2023-08-31 15:28:03 +02:00
parent 6ee53595e2
commit e95bf70993

View File

@@ -18,12 +18,6 @@ endif
# If virtualenv exists, use it. If not, use PATH to find commands # If virtualenv exists, use it. If not, use PATH to find commands
SYSTEM_PYTHON = python3 SYSTEM_PYTHON = python3
PYTHON = $(or $(wildcard $(VENV_PATH)/bin/python), $(SYSTEM_PYTHON)) PYTHON = $(or $(wildcard $(VENV_PATH)/bin/python), $(SYSTEM_PYTHON))
SYSTEM_PYUIC5 = $(shell which pyuic5)
PYUIC5 = $(or $(wildcard $(VENV_PATH)/bin/pyuic5), $(SYSTEM_PYUIC5))
SYSTEM_PYRCC5 = $(shell which pyrcc5)
PYRCC5 = $(or $(wildcard $(VENV_PATH)/bin/pyrcc5), $(SYSTEM_PYRCC5))
SYSTEM_PYLUP5 = $(shell which pylupdate5)
PYLUP5 = $(or $(wildcard $(VENV_PATH)/bin/pylupdate5), $(SYSTEM_PYLUP5))
APP_VERSION = $(shell $(PYTHON) src/$(PACKAGE) --version) APP_VERSION = $(shell $(PYTHON) src/$(PACKAGE) --version)
@@ -49,19 +43,19 @@ venv:
build_ui: build_ui:
cd ui_dev && for ui_file in *.ui; do \ cd ui_dev && for ui_file in *.ui; do \
file_name=$${ui_file%.ui}; \ file_name=$${ui_file%.ui}; \
$(PYUIC5) $${ui_file} -o ../src/$(PACKAGE)/ui/$${file_name}_ui.py -x --from-imports; \ $(PYTHON) -m PyQt5.uic.pyuic $${ui_file} -o ../src/$(PACKAGE)/ui/$${file_name}_ui.py -x --from-imports; \
echo $${file_name}; \ echo $${file_name}; \
done done
build_rc: build_rc:
cd ui_dev && for rc_file in *.qrc; do \ cd ui_dev && for rc_file in *.qrc; do \
file_name=$${rc_file%.qrc}; \ file_name=$${rc_file%.qrc}; \
$(PYRCC5) $${rc_file} -o ../src/$(PACKAGE)/ui/$${file_name}_rc.py; \ $(PYTHON) -m PyQt5.pyrcc_main $${rc_file} -o ../src/$(PACKAGE)/ui/$${file_name}_rc.py; \
echo $${file_name}; \ echo $${file_name}; \
done done
update_translation: update_translation:
$(PYLUP5) translate.pro $(PYTHON) -m PyQt5.pylupdate_main translate.pro
.PHONY: build_ui build_rc update_translation .PHONY: build_ui build_rc update_translation