Patchwork [1/1] xinput-calibrator: move it from meta-oe to oe-core

login
register
mail settings
Submitter Laurentiu Palcu
Date June 17, 2013, 12:26 p.m.
Message ID <6a4980046a3175ecdd4216cdd75c754b0b0ffa16.1371471166.git.laurentiu.palcu@intel.com>
Download mbox | patch
Permalink /patch/51821/
State New
Headers show

Comments

Laurentiu Palcu - June 17, 2013, 12:26 p.m.
People using xserver-xorg that need to calibrate their touchscreen
devices would also need meta-oe. Bringing the recipes to oe-core will
make it easier for them.

Aditionaly, drop xterm RDEPENDS. Terminal is not needed to run the menu
item.

[YOCTO #4416]

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
---
 .../pointercal-xinput/pointercal.xinput            |    1 +
 .../xinput-calibrator/pointercal-xinput_0.0.bb     |   17 ++++++++
 .../xinput-calibrator/xinput-calibrator.service    |   11 ++++++
 .../xinput-calibrator/xinput-calibrator_git.bb     |   41 ++++++++++++++++++++
 4 files changed, 70 insertions(+)
 create mode 100644 meta/recipes-graphics/xinput-calibrator/pointercal-xinput/pointercal.xinput
 create mode 100644 meta/recipes-graphics/xinput-calibrator/pointercal-xinput_0.0.bb
 create mode 100644 meta/recipes-graphics/xinput-calibrator/xinput-calibrator/xinput-calibrator.service
 create mode 100644 meta/recipes-graphics/xinput-calibrator/xinput-calibrator_git.bb
Ross Burton - June 17, 2013, 3:15 p.m.
On 17 June 2013 13:26, Laurentiu Palcu <laurentiu.palcu@intel.com> wrote:
> People using xserver-xorg that need to calibrate their touchscreen
> devices would also need meta-oe. Bringing the recipes to oe-core will
> make it easier for them.
>
> Aditionaly, drop xterm RDEPENDS. Terminal is not needed to run the menu
> item.

I don't really like how there's a xdg-autostart desktop file and a
systemd service file for loading the calibration and performing
calibration - a single xsession file as xtscal does will be sufficient
and actually work in Sato as it can block the rest of the UI before
continuing.

Also persistent calibration doesn't work with non-root X users, so
maybe the tool should use ~/.pointercal.xinput if it can't write to
/etc.

Apart from that I've got a touchscreen that isn't X-axis-reversed now. :)

Ross
Laurentiu Palcu - June 18, 2013, 10:58 a.m.
On Mon, Jun 17, 2013 at 04:15:58PM +0100, Burton, Ross wrote:
> On 17 June 2013 13:26, Laurentiu Palcu <laurentiu.palcu@intel.com> wrote:
> > People using xserver-xorg that need to calibrate their touchscreen
> > devices would also need meta-oe. Bringing the recipes to oe-core will
> > make it easier for them.
> >
> > Aditionaly, drop xterm RDEPENDS. Terminal is not needed to run the menu
> > item.
> 
> I don't really like how there's a xdg-autostart desktop file and a
> systemd service file for loading the calibration and performing
> calibration - a single xsession file as xtscal does will be sufficient
> and actually work in Sato as it can block the rest of the UI before
> continuing.

I'm not sure I understand what's wrong with using xdg-autostart.
Xsession parses each .desktop file in xdg/autostart and executes the
application listed in 'Exec'. Having a separate xsession file created
in /etc/X11/Xsession.d (like xtscal does) is, basically, the same thing.
Only the moment of execution differs. Or, maybe, I misunderstood your
point.

> 
> Also persistent calibration doesn't work with non-root X users, so
> maybe the tool should use ~/.pointercal.xinput if it can't write to
> /etc.

We could easily change xinput_calibrator_once.sh to save/read the calibration
data either to/from /etc or ~.

Laurentiu

> 
> Apart from that I've got a touchscreen that isn't X-axis-reversed now. :)
> 
> Ross
Ross Burton - June 18, 2013, 1:02 p.m.
On 18 June 2013 11:58, Laurentiu Palcu <laurentiu.palcu@intel.com> wrote:
> I'm not sure I understand what's wrong with using xdg-autostart.
> Xsession parses each .desktop file in xdg/autostart and executes the
> application listed in 'Exec'. Having a separate xsession file created
> in /etc/X11/Xsession.d (like xtscal does) is, basically, the same thing.
> Only the moment of execution differs. Or, maybe, I misunderstood your
> point.

XDG autostart doesn't block the app, so the rest of the system starts
up.  Really calibration should pause the startup and only when the
input is calibrated, continue.

Ross

Patch

diff --git a/meta/recipes-graphics/xinput-calibrator/pointercal-xinput/pointercal.xinput b/meta/recipes-graphics/xinput-calibrator/pointercal-xinput/pointercal.xinput
new file mode 100644
index 0000000..9633fc5
--- /dev/null
+++ b/meta/recipes-graphics/xinput-calibrator/pointercal-xinput/pointercal.xinput
@@ -0,0 +1 @@ 
+# replace with valid machine specific pointercal.xinput
diff --git a/meta/recipes-graphics/xinput-calibrator/pointercal-xinput_0.0.bb b/meta/recipes-graphics/xinput-calibrator/pointercal-xinput_0.0.bb
new file mode 100644
index 0000000..8423640
--- /dev/null
+++ b/meta/recipes-graphics/xinput-calibrator/pointercal-xinput_0.0.bb
@@ -0,0 +1,17 @@ 
+DESCRIPTION = "Touchscreen calibration data from xinput-calibrator"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+SRC_URI = "file://pointercal.xinput"
+S = "${WORKDIR}"
+
+do_install() {
+    # Only install file if it has a contents
+    if [ -s ${S}/pointercal.xinput ]; then
+        install -d ${D}${sysconfdir}/
+        install -m 0644 ${S}/pointercal.xinput ${D}${sysconfdir}/
+    fi
+}
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+CONFFILES_${PN} = "${sysconfdir}/pointercal.xinput"
diff --git a/meta/recipes-graphics/xinput-calibrator/xinput-calibrator/xinput-calibrator.service b/meta/recipes-graphics/xinput-calibrator/xinput-calibrator/xinput-calibrator.service
new file mode 100644
index 0000000..2301876
--- /dev/null
+++ b/meta/recipes-graphics/xinput-calibrator/xinput-calibrator/xinput-calibrator.service
@@ -0,0 +1,11 @@ 
+[Unit]
+Description=Loads xinput calibration data
+ConditionPathExists=/etc/pointercal.xinput
+Requires=display-manager.service
+After=display-manager.service
+
+[Service]
+ExecStart=/usr/bin/xinput_calibrator_once.sh
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta/recipes-graphics/xinput-calibrator/xinput-calibrator_git.bb b/meta/recipes-graphics/xinput-calibrator/xinput-calibrator_git.bb
new file mode 100644
index 0000000..31e20f7
--- /dev/null
+++ b/meta/recipes-graphics/xinput-calibrator/xinput-calibrator_git.bb
@@ -0,0 +1,41 @@ 
+DESCRIPTION = "A generic touchscreen calibration program for X.Org"
+HOMEPAGE = "http://www.freedesktop.org/wiki/Software/xinput_calibrator"
+LICENSE = "MIT-X"
+LIC_FILES_CHKSUM = "file://src/calibrator.cpp;endline=22;md5=1bcba08f67cdb56f34021557898e4b5a"
+DEPENDS = "virtual/libx11 libxi"
+
+PV = "0.7.5+git${SRCPV}"
+
+inherit autotools systemd
+
+SRCREV = "c01c5af807cb4b0157b882ab07a893df9a810111"
+SRC_URI = "git://github.com/tias/xinput_calibrator.git;protocol=git \
+           file://xinput-calibrator.service"
+
+S = "${WORKDIR}/git"
+
+# force native X11 ui as we don't have gtk+ in DEPENDS
+EXTRA_OECONF += "--with-gui=x11"
+
+do_install_append() {
+    install -d ${D}${bindir}
+    install -m 0755 scripts/xinput_calibrator_pointercal.sh ${D}${bindir}/xinput_calibrator_once.sh
+
+    install -d ${D}${sysconfdir}/xdg/autostart
+    sed -i -e 's,^Exec=.*,Exec=${bindir}/xinput_calibrator_once.sh,' scripts/xinput_calibrator.desktop
+    install -m 0644 scripts/xinput_calibrator.desktop ${D}${sysconfdir}/xdg/autostart
+
+    if ${@base_contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+        install -d ${D}${systemd_unitdir}/system
+        install -m 0644 ${WORKDIR}/xinput-calibrator.service ${D}${systemd_unitdir}/system
+    fi
+}
+
+FILES_${PN} += "${sysconfdir}/xdg/autostart"
+RDEPENDS_${PN} = "xinput"
+RRECOMMENDS_${PN} = "pointercal-xinput"
+
+RPROVIDES_${PN} += "${PN}-systemd"
+RREPLACES_${PN} += "${PN}-systemd"
+RCONFLICTS_${PN} += "${PN}-systemd"
+SYSTEMD_SERVICE_${PN} = "${PN}.service"