summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2023-01-02 11:35:50 +0100
committerMichael Olbrich <m.olbrich@pengutronix.de>2023-01-31 10:28:06 +0100
commita3dfab17f6089fb22087b7772e7f80d1751d13d3 (patch)
treee2587f3b7c0061f4ae9d1203b113b32d36af995b
parenta78e1b48b16e24e9d9e1c6affa788e2604c921d5 (diff)
downloadptxdist-a3dfab17f6089fb22087b7772e7f80d1751d13d3.tar.gz
ptxdist-a3dfab17f6089fb22087b7772e7f80d1751d13d3.tar.xz
rules: templates: improve Qt templates
Allow selecting the version and set <PKG>_PATH accordingly. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r--rules/templates/template-src-qmake-prog-make2
-rw-r--r--rules/templates/template-target-make2
-rw-r--r--scripts/lib/ptxd_lib_template.sh16
3 files changed, 17 insertions, 3 deletions
diff --git a/rules/templates/template-src-qmake-prog-make b/rules/templates/template-src-qmake-prog-make
index a86c4c44f..3d9156499 100644
--- a/rules/templates/template-src-qmake-prog-make
+++ b/rules/templates/template-src-qmake-prog-make
@@ -39,7 +39,7 @@ PACKAGES-$(PTXCONF_@PACKAGE@) += @package@
#
# qmake
#
-@PACKAGE@_PATH := PATH=$(PTXDIST_SYSROOT_CROSS)/usr/bin/qt5:$(CROSS_PATH)
+@PACKAGE@_PATH := PATH=$(PTXDIST_SYSROOT_CROSS)/usr/bin/qt@QT_VERSION@:$(CROSS_PATH)
@PACKAGE@_CONF_TOOL := qmake
@PACKAGE@_CONF_OPT := $(CROSS_QMAKE_OPT) PREFIX=/usr
diff --git a/rules/templates/template-target-make b/rules/templates/template-target-make
index 1a0f9e2e6..6add94b3d 100644
--- a/rules/templates/template-target-make
+++ b/rules/templates/template-target-make
@@ -41,7 +41,7 @@ PACKAGES-$(PTXCONF_@PACKAGE@) += @package@
#
# @conf_tool@
#
-@PACKAGE@_CONF_TOOL := @conf_tool@
+@PACKAGE_PATH@@PACKAGE@_CONF_TOOL := @conf_tool@
#@PACKAGE@_CONF_OPT := @CONF_OPT@
#$(STATEDIR)/@package@.prepare:
diff --git a/scripts/lib/ptxd_lib_template.sh b/scripts/lib/ptxd_lib_template.sh
index 979e6fcb1..3db9744b8 100644
--- a/scripts/lib/ptxd_lib_template.sh
+++ b/scripts/lib/ptxd_lib_template.sh
@@ -146,6 +146,7 @@ ptxd_template_read_conf_tool() {
qmake)
CONF_OPT="\$(CROSS_QMAKE_OPT)"
SELECT="QT5"
+ ptxd_template_read_qt_version
;;
perl)
SELECT="PERL"
@@ -171,6 +172,15 @@ ptxd_template_read_conf_tool() {
}
export -f ptxd_template_read_conf_tool
+ptxd_template_read_qt_version() {
+ local qt_version
+ ptxd_template_read_options "Qt version" qt_version "Qt 5" "Qt 6"
+ export QT_VERSION="${qt_version}"
+ PACKAGE_PATH="${PACKAGE}_PATH := PATH=\$(PTXDIST_SYSROOT_CROSS)/bin/qt${qt_version}:\$(CROSS_PATH)
+"
+}
+export -f ptxd_template_read_qt_version
+
ptxd_template_read_basic() {
ptxd_template_read_name &&
ptxd_template_read_version
@@ -349,6 +359,7 @@ ptxd_template_new() {
export action="${1}"
export template="template-${action}"
export YEAR="$(date +%Y)"
+ export PACKAGE_PATH=""
local func="ptxd_template_new_${action//-/_}"
if ! declare -F | grep -q "${func}$"; then
@@ -459,7 +470,10 @@ ptxd_template_help_list[${#ptxd_template_help_list[@]}]="src-cmake-prog"
ptxd_template_help_list[${#ptxd_template_help_list[@]}]="create cmake binary"
ptxd_template_new_src_qmake_prog() {
- ptxd_template_src_base
+ ptxd_template_read_local &&
+ ptxd_template_read_qt_version &&
+ ptxd_template_write_rules &&
+ ptxd_template_write_src
}
export -f ptxd_template_new_src_qmake_prog
ptxd_template_help_list[${#ptxd_template_help_list[@]}]="src-qmake-prog"