From 5c0da5e5a944b19e3f33c88d761c1ed63c8fc68b Mon Sep 17 00:00:00 2001 From: Max Krummenacher Date: Wed, 15 May 2019 16:28:58 +0200 Subject: x-window-simple-app: create common inc file and rename recipe Pull out common code so that the bb file only contains information about the application which is to be started. Rename the recipe so that one knows what is going to be started. Signed-off-by: Max Krummenacher --- .../x-window-qtsmarthome_1.0.bb | 9 ++++++ .../x-window-simple-app/x-window-simple-app.inc | 34 ++++++++++++++++++++ .../x-window-simple-app/x-window-simple-app_1.0.bb | 37 ---------------------- recipes-images/images/qt5-x11-image.bb | 5 ++- 4 files changed, 45 insertions(+), 40 deletions(-) create mode 100644 recipes-graphics/x-window-simple-app/x-window-qtsmarthome_1.0.bb create mode 100644 recipes-graphics/x-window-simple-app/x-window-simple-app.inc delete mode 100644 recipes-graphics/x-window-simple-app/x-window-simple-app_1.0.bb diff --git a/recipes-graphics/x-window-simple-app/x-window-qtsmarthome_1.0.bb b/recipes-graphics/x-window-simple-app/x-window-qtsmarthome_1.0.bb new file mode 100644 index 0000000..2e44da9 --- /dev/null +++ b/recipes-graphics/x-window-simple-app/x-window-qtsmarthome_1.0.bb @@ -0,0 +1,9 @@ +# set the following variable to your one and only application which should +# be started + +RDEPENDS ?= "qtsmarthome" +INITIAL_PATH ?= "/usr/share/qtsmarthome-1.0" +X_APPLICATION ?= "${INITIAL_PATH}/smarthome" + +FILESEXTRAPATHS_prepend := "${THISDIR}/x-window-simple-app:" +require recipes-graphics/x-window-simple-app/x-window-simple-app.inc diff --git a/recipes-graphics/x-window-simple-app/x-window-simple-app.inc b/recipes-graphics/x-window-simple-app/x-window-simple-app.inc new file mode 100644 index 0000000..2c5ecc1 --- /dev/null +++ b/recipes-graphics/x-window-simple-app/x-window-simple-app.inc @@ -0,0 +1,34 @@ +SECTION = "x11/libs" +SUMMARY = "x11 application autostart" +DESCRIPTION = \ +"This installs a /usr/bin/x-window-manager script. The script will start the \ +one and only application X_APPLICATION as the last step of the \ +xserver-nodm-init X initialization. \ +If the script ever returns, X will be killed." + +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +inherit allarch + +S = "${WORKDIR}" + +SRC_URI = " \ + file://x-window-manager.in \ + file://set_have_touch.sh \ +" + +do_compile () { + sed -e "s:@PATH@:${INITIAL_PATH}:" -e "s:@APP@:${X_APPLICATION}:" x-window-manager.in > x-window-manager +} + +do_install () { + install -d ${D}/${bindir} ${D}${sysconfdir}/X11/Xsession.d + install -m 0755 ${S}/x-window-manager ${D}/${bindir} + install -m 0644 ${S}/set_have_touch.sh ${D}/${sysconfdir}/X11/Xsession.d/29set_have_touch.sh +} + +# make sure xinput_calibrator is only started once +pkg_postinst_${PN}() { + rm -f /etc/xdg/autostart/xinput_calibrator.desktop +} diff --git a/recipes-graphics/x-window-simple-app/x-window-simple-app_1.0.bb b/recipes-graphics/x-window-simple-app/x-window-simple-app_1.0.bb deleted file mode 100644 index 1bfb7e2..0000000 --- a/recipes-graphics/x-window-simple-app/x-window-simple-app_1.0.bb +++ /dev/null @@ -1,37 +0,0 @@ -SECTION = "x11/libs" -SUMMARY = "x11 application autostart" -DESCRIPTION = \ -"This installs a /usr/bin/x-window-manager script. The script will start the \ -one and only application X_APPLICATION as the last step of the \ -xserver-nodm-init X initialization. \ -If the script ever returns, X will be killed." - -LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" - -inherit allarch - -S = "${WORKDIR}" - -INITIAL_PATH ?= "/usr/share/qtsmarthome-1.0" -X_APPLICATION ?= "${INITIAL_PATH}/smarthome" - -SRC_URI = " \ - file://x-window-manager.in \ - file://set_have_touch.sh \ -" - -do_compile () { - sed -e "s:@PATH@:${INITIAL_PATH}:" -e "s:@APP@:${X_APPLICATION}:" x-window-manager.in > x-window-manager -} - -do_install () { - install -d ${D}/${bindir} ${D}${sysconfdir}/X11/Xsession.d - install -m 0755 ${S}/x-window-manager ${D}/${bindir} - install -m 0644 ${S}/set_have_touch.sh ${D}/${sysconfdir}/X11/Xsession.d/29set_have_touch.sh -} - -# make sure xinput_calibrator is only started once -pkg_postinst_${PN}() { - rm -f /etc/xdg/autostart/xinput_calibrator.desktop -} diff --git a/recipes-images/images/qt5-x11-image.bb b/recipes-images/images/qt5-x11-image.bb index 9a2a911..b0d9ce5 100644 --- a/recipes-images/images/qt5-x11-image.bb +++ b/recipes-images/images/qt5-x11-image.bb @@ -3,7 +3,7 @@ SUMMARY_append_apalis-tk1-mainline = " (Mainline)" DESCRIPTION = "Image with the Qt5 Framework and the X11 server" # after the boot systemd starts X and then a qt5 application, check -# recipes-graphics/x-window-simple-app/x-window-simple-app and +# recipes-graphics/x-window-simple-app/x-window-qtsmarthome and # https://developer.toradex.com/knowledge-base/how-to-autorun-application-at-the-start-up-in-linux#X11_with_One_User_Application # for how this is done. @@ -136,8 +136,7 @@ GSTREAMER_append_tegra124 = " \ IMAGE_INSTALL_QT5 = " \ packagegroup-qt5 \ liberation-fonts \ - qtsmarthome \ - x-window-simple-app \ + x-window-qtsmarthome \ " IMAGE_INSTALL_append_tegra124 = " \ -- cgit v1.2.3