Bug 222905 - x11/libinput: Update to 1.12.1
Summary: x11/libinput: Update to 1.12.1
Status: In Progress
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-x11 mailing list
Depends on: 217248 223530 233787
  Show dependency treegraph
Reported: 2017-10-10 16:23 UTC by Greg V
Modified: 2018-12-05 03:53 UTC (History)
10 users (show)

See Also:
tcberner: maintainer-feedback-

libinput.patch (3.36 KB, patch)
2017-10-10 16:23 UTC, Greg V
no flags Details | Diff
libinput-1.9.1.patch (9.04 KB, patch)
2017-11-08 12:37 UTC, Greg V
no flags Details | Diff
libinput-1.9.1.patch (10.53 KB, patch)
2017-11-08 12:42 UTC, Greg V
no flags Details | Diff
libinput-1.9.3.patch (19.28 KB, patch)
2017-12-05 23:26 UTC, Vladimir Kondratyev
no flags Details | Diff
libinput-1.9.4.patch (19.28 KB, patch)
2017-12-16 22:12 UTC, Vladimir Kondratyev
no flags Details | Diff
libinput-1.9.901.patch (16.64 KB, patch)
2018-01-22 14:56 UTC, Greg V
no flags Details | Diff
libinput-1.10.4.patch (16.68 KB, patch)
2018-04-10 14:46 UTC, Greg V
no flags Details | Diff
libinput-1.12.1.patch (15.17 KB, patch)
2018-10-14 12:00 UTC, Greg V
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Greg V 2017-10-10 16:23:35 UTC
Created attachment 187052 [details]

We're behind on libinput, Wayland compositors (https://github.com/swaywm/wlroots) are already starting to use new features… Here's 1.8.0.
Comment 2 Greg V 2017-11-08 12:42:16 UTC
Created attachment 187854 [details]

oops, here's the diff from 1.6.0 instead of 1.8.0
Comment 3 Vladimir Kondratyev freebsd_committer 2017-12-05 23:26:38 UTC
Created attachment 188571 [details]

Some improvements over v1.9.1:

1. Add patch for breaking of deadlock on detaching of webcamd-backed devices
2. Do not compile/install udev tools and rules
3. Add python dependencies required by some libinput tools
4. New port devel/py-pyudev (required by tools written in python)
5. epoll-shim update included.

Requires fixed evdev headers from PR/217248 (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=217248)
Comment 4 Niclas Zeising freebsd_committer 2017-12-16 20:49:27 UTC
I'm currently working on this and PRs that this one depends on.
Comment 5 Vladimir Kondratyev freebsd_committer 2017-12-16 22:12:08 UTC
Created attachment 188894 [details]

bump libinput and epoll-shim versions to 1.9.4 and 20171213 respectively. No other changes
Comment 6 Greg V 2018-01-22 14:56:43 UTC
Created attachment 189969 [details]

Update to 1.9.901 + add a new 'reopen' patch…

So, here's the story about that patch. I'm working on Wayland compositor stuff (https://github.com/myfreeweb/weston-rs + https://github.com/myfreeweb/loginw). I've been trying to figure out why in the heck does *only my compositor* (not Weston proper) reject input devices *only on my laptop* (not on my desktop)…

/dev/input devices were readable and writable for group video. My setuid wrapper (loginw) was only setting the user when dropping privileges for the compositor (i.e. wasn't setting groups). I was testing unprivileged access, but I thought I was still testing privileged access.

Anyway, it is very desirable to have the compositor unprivileged. The setuid wrapper passes it file descriptors to input devices, it does not need to open them directly.

libudev-devd does open them — to enumerate devices. When it is unprivileged, it does not set the right properties, which leads to rejection (the "not tagged as supported input device" message).

libinput opens the device via the compositor-provided mechanism (fd passing) only to compare to the device it got from libudev(-devd) enumeration. They have the same path, but the libudev one lacks properties. The correct one gets thrown away.

This patch uses the correct one instead of throwing it away :) which allows compositors to be unprivileged.
Comment 7 Greg V 2018-01-22 15:01:49 UTC
Oh also the fixdrop patch is new here. It's from https://blog.grem.de/pages/t470s.html and it prevents trackpads from dropping out after SYN_DROPPED events.
Comment 8 Niclas Zeising freebsd_committer 2018-01-22 15:04:36 UTC
Last time I looked at this, I think there was issues in one of the PRs this depends on.  I'll try to look at this again ASAP.
Comment 9 Greg V 2018-04-10 14:46:07 UTC
Created attachment 192391 [details]

Updated to 1.10.4.
Comment 10 Tobias C. Berner freebsd_committer 2018-04-29 20:08:29 UTC
Moin moin

It would be great if this and the related issues could be committed soon.

mfg Tobias
Comment 11 Johannes Lundberg 2018-05-30 20:46:33 UTC
Build fails, missing two macros that I guess we need to add to v4l_compat

Comment 12 Vladimir Kondratyev freebsd_committer 2018-05-30 21:10:39 UTC
(In reply to Johannes Lundberg from comment #11)
> Build fails

Please look at "Depends on" header. This libinput does not depend on v4l_compat as it requires PR/217248 and PR/223530 to be applied.
Comment 13 Johannes Lundberg 2018-05-31 07:50:18 UTC
Why not set a minimum port version for dependencies?
Comment 14 Vladimir Kondratyev freebsd_committer 2018-05-31 08:55:13 UTC
(In reply to Johannes Lundberg from comment #13)
Libinput depends on devel/evdev-proto which is split off v4l_compat in PR/217248. Latter is not committed to ports tree yet.
Comment 15 Johannes Lundberg 2018-05-31 09:20:23 UTC
Hmm ok I see. So in my case it (make) found the file and was happy with that, even though I'm missing the evdev-proto package...
Comment 16 Niclas Zeising freebsd_committer 2018-06-10 06:57:00 UTC
I've added this update, as well as a whole bunch of other updates to a branch in our development Github tree.  The branch updates a whole lot of ports that has to do with input devices and similar.  Please help me test it.
The branch can be found here:


It contains upates to libinput, libeevdev, libwacom, xf86-input-libinput and dependencies.
Comment 17 Tobias C. Berner freebsd_committer 2018-06-10 08:04:07 UTC
kde@ has been using these patches for a while now on the KDE CI cluster (build.kde.org) and in our own development repo for a long time.
No dead kittens.

Mfg Tobias
Comment 18 Tobias C. Berner freebsd_committer 2018-07-07 07:35:36 UTC
(In reply to Tobias C. Berner from comment #17)
ping with hat kde@ -- it even rhymes.
Comment 19 Niclas Zeising freebsd_committer 2018-07-07 07:38:24 UTC
(In reply to Tobias C. Berner from comment #18)

I've had to put this a bit to the side because of other stuff.  I'm getting to it again.  Have you run KDE with libinput 1.11 (it's in the branch) as well, or just 1.10.4?
Comment 20 Tobias C. Berner freebsd_committer 2018-07-13 18:36:55 UTC
(In reply to Niclas Zeising from comment #19)

I merged the update to 1.11-update (i.e. your feature/input branch) into our plasma-5.13 branch last weekend, and have been using it for the past week. Seems to build (and run) fine.

mfg Tobias
Comment 21 Adriaan de Groot freebsd_committer 2018-09-06 19:40:22 UTC
This is now blocking updates to KDE -- Plasma 5.13, which was released a few months ago, needs libinput 1.10. As tcberner@ points out, it's been in testing in our own plasma-5.13 branch for some time as well (as well as on KDE's CI systems).
Comment 22 Tobias C. Berner freebsd_committer 2018-09-21 18:16:20 UTC
This is your weekly "still no dead kittens" ping :)
Comment 23 Tobias C. Berner freebsd_committer 2018-10-13 07:17:55 UTC
The kittens are now cats, still not dead.

@x11 what is blocking this on your side?
Comment 24 Denis Polygalov 2018-10-14 02:59:45 UTC
(In reply to Tobias C. Berner from comment #23)


I'm trying to test your patch but run into troubles:

% git clone https://github.com/freebsd/freebsd-ports.git
% cd freebsd-ports
% curl "https://bz-attachments.freebsd.org/attachment.cgi?id=192391" > libinput-1.10.4.patch
% git apply libinput-1.10.4.patch
libinput-1.10.4.patch:149: trailing whitespace.

libinput-1.10.4.patch:151: trailing whitespace.

libinput-1.10.4.patch:156: space before tab in indent.
        udev_dir = join_paths(get_option('prefix'), 'lib', 'udev')
libinput-1.10.4.patch:158: space before tab in indent.
               output : '90-libinput-model-quirks-litest.rules',
libinput-1.10.4.patch:159: space before tab in indent.
               install : false,
error: patch failed: x11/libinput/Makefile:1
error: x11/libinput/Makefile: patch does not apply
error: patch failed: x11/libinput/pkg-descr:4
error: x11/libinput/pkg-descr: patch does not apply

Comment 25 Greg V 2018-10-14 12:00:25 UTC
Created attachment 198118 [details]

Here's libinput 1.12.1.

I worked with upstream to improve FreeBSD support. They now have cross-compilation to FreeBSD 11 as part of their CI. Also, our evdev header is included in the tree.

BTW @Denis keep in mind that you need patches from bug 217248 & bug 223530 — libinput (well the various libinput tools, not the core library) depends on py-evdev and py-pyudev
Comment 26 Tobias C. Berner freebsd_committer 2018-10-14 12:04:22 UTC
(In reply to Greg V from comment #25)
Comment 27 Tobias C. Berner freebsd_committer 2018-10-14 12:21:00 UTC
(In reply to Greg V from comment #25)
There seems to be an issue with this patch:
=> FreeBSD patch patch-src_evdev.c.fixdrop failed to apply cleanly.
Comment 28 Greg V 2018-10-14 12:24:36 UTC
(In reply to Tobias C. Berner from comment #27)
hm, I can 'clean extract patch' just fine. Make sure the files/ directory looks like this:


(without any extra stuff left over from previous patches)
Comment 29 Tobias C. Berner freebsd_committer 2018-10-14 12:58:30 UTC
(In reply to Greg V from comment #28)
Sorry, my bad :) -- I integrated it into kde@'s tree on github in the meantime.
Comment 30 Gleb Popov freebsd_committer 2018-10-14 16:34:13 UTC
(In reply to Greg V from comment #25)

> I worked with upstream to improve FreeBSD support. They now have cross-compilation to FreeBSD 11 as part of their CI. Also, our evdev header is included in the tree.

Wow, this is super-awesome. Thanks for working on this!
Comment 31 Tobias C. Berner freebsd_committer 2018-10-18 05:11:49 UTC
Maintainer: timeout.

Greg, could you create patch against ports head with all the required changes for an update? (And open a review in phab).

Let's get this in.

mfg Tobias
Comment 32 Niclas Zeising freebsd_committer 2018-10-18 05:25:14 UTC
This item was discussed during the Graphics Team meeting last night.  We are working on a plan to get this better tested and to get it into the FreeBSD ports tree.  I know it's been long in the making, but can you please hold of committing anything just yet, and give us a chance to work this out.

There is already a branch in our ports tree with these changes.  It's out of date, but please work on that and make pull requests for it, so that we have all changes and patches in one place: https://github.com/FreeBSDDesktop/freebsd-ports/tree/feature/input

Thank you!

Niclas Zeising
FreeBSD Graphics Team
Comment 33 Tobias C. Berner freebsd_committer 2018-10-18 05:36:21 UTC
(In reply to Niclas Zeising from comment #32)
This has been open for more than two 2 years. It does not need a test plan, it needs a commit :-)

Reminder: we cannot upgrade Plasma desktop to anything past 5.12.x because of this. We could have 5.14.x by now. 

mfg Tobias
Comment 34 Niclas Zeising freebsd_committer 2018-10-18 05:46:58 UTC
(In reply to Tobias C. Berner from comment #33)

I'm well aware of the situation.  It has a lot of moving parts though, which is why I'm asking you to work with us.
Comment 35 Tobias C. Berner freebsd_committer 2018-10-18 05:50:28 UTC
(In reply to Niclas Zeising from comment #34)
Let me know if kde@ can do anything to help :)

mfg Tobias
Comment 36 Tamas Szakaly 2018-10-18 09:17:24 UTC
Hi all,

Sorry for chiming in with something that might be off-topic, but since x11/libinput depends on devel/libepoll-shim, this might be important: the jiixyj/epoll-shim repo on GitHub contains two fixes that are not yet pulled into FreeBSDDesktop/epoll-shim, and I'm also experiencing problems while using the latest master with sway (input is lost when switching TTYs). I did not yet have the time to investigate this last issue, and I don't know if those fixes affect KDE/Plasma or even libinput in any way, but I think it's important to know that at least one of the components required here has some issues.

Comment 37 Adriaan de Groot freebsd_committer 2018-10-18 10:05:31 UTC
Sway and Plasma/Wayland are pretty closely aligned, upstream, as to what they need; what's good for the goose is good for the gander, as they say. I remember adding some things to epoll-shim as well -- also having PRs ignored long enough that I forgot why I needed them.
Comment 38 Niclas Zeising freebsd_committer 2018-10-18 11:00:33 UTC
(In reply to Tamas Szakaly from comment #36)

Thank you for pointing this out!  I'll make sure to include the changes to our libepoll-shim as well.
Comment 39 Greg V 2018-10-19 18:16:23 UTC
(In reply to Niclas Zeising from comment #34)

What "moving parts" exactly does libinput have?

https://abi-laboratory.pro/?view=timeline&l=libinput — the ABI has been backwards compatible since 0.13.0 (!)
Unsurprisingly, libevdev has been ABI stable for even longer: https://abi-laboratory.pro/?view=timeline&l=libevdev

If it works for kde@, it should definitely work for everyone.

The only way to get "more testing" is to test in production ;)
Comment 40 Tobias C. Berner freebsd_committer 2018-10-31 22:07:29 UTC
(In reply to Niclas Zeising from comment #38)
It has been another two weeks, without any sign of progress. 

x11@ could you give some information on what needs to be done to move this forward?

mfg Tobias
Comment 41 Niclas Zeising freebsd_committer 2018-11-03 10:56:10 UTC
(In reply to Tobias C. Berner from comment #40)

I've rebased our github branch on the latest ports tree, so it should be up to date.

The next step is to work out how to handle v4l_compat and and evdev-proto.  This change probably needs an exp run, to be sure I caught all users.

What build resources does the KDE team have?
Comment 42 Greg V 2018-11-03 12:26:23 UTC
(In reply to Niclas Zeising from comment #41)

Our input.h is now bundled with libinput (since 1.12.1) :)

But the libevdev update (bug 217248) still needs to happen as well.
Comment 43 Niclas Zeising freebsd_committer 2018-11-03 14:13:08 UTC
(In reply to Greg V from comment #42)

I have to look at the input.h header. Currently it seems it's supplied from multiple places, and as far as I know used in multiple places as well.  Looking at the branch, input.h is needed as a dependency for a number of packages.  It might be possible to have them use the one in FreeBSD base instead, especially since FreeBSD 10, which does not have that header, is EOL.

Do you know why the header is bundled with libinput, rather than libinput using the one provided with the OS (FreeBSD in this case)?

My original idea is to take the branch as it is and merge it in to the FreeBSD ports tree.  Then I can update libinput (and other packages as needed) again.

The update to libevdev is included in the branch, and will happen in connection with this update.
Comment 44 Greg V 2018-11-03 15:17:41 UTC
(In reply to Niclas Zeising from comment #43)

> regarding input.h: libinput expects input.h to never change which is why we can ship it with libinput. The ioctls themselves don't actually matter that much, libevdev abstracts those away. What matters are the #defines and structs. It may be technically allowed to change in FreeBSD but I'd argue that doing so would be misguided since it's a explicit "let's have linux compatibility" interface. So I think it may be better to just ship the header regardless and deal with the fallout if it ever changes. Otherwise, we're just trying to solve a problem that may never occur in the first place.

— Peter Hutterer @whot — https://gitlab.freedesktop.org/libinput/libinput/merge_requests/36
Comment 45 Vladimir Kondratyev freebsd_committer 2018-11-03 16:32:56 UTC
(In reply to Niclas Zeising from comment #43)
> It might be possible to have them use the one in FreeBSD
> base instead, especially since FreeBSD 10, which does not
> have that header, is EOL.
Back in 2015-2016 when current evdev was just a fork of jceel@ GSOC project running on my laptop, evdev headers were too volatile so I had to update them every 2 or 3 month to make fresh libinput and libevdev buildable.
Just now libevdev development is mostly stalled and libinput has a private copy of evdev headers so I think we can replace "linux/u?input*.h" files with "#include <dev/evdev/*.h>" oneliners or with symlinks to reduce header duplication.
Note: some ports like libevdev and py-evdev do a header parsing at build stage so they should be instructed to parse actual headers rather then "#include" stubs.
Comment 46 Vladimir Kondratyev freebsd_committer 2018-11-03 17:24:10 UTC
(In reply to Vladimir Kondratyev from comment #45)
> libevdev development is mostly stalled
libevdev 1.6.0 requires Linux kernel headers v4.16 which are not included with FreeBSD 11.2
Comment 47 Niclas Zeising freebsd_committer 2018-11-03 17:42:04 UTC
(In reply to Vladimir Kondratyev from comment #46)

It sounds like I should look into getting ports to use our own input.h headers instead of the ones provided with v4l_compat or evdev-proto.

I do think, however, that it should be done separate from the update of libinput, libevdev and others in this patch.

libevdev, similar to libinput, comes with it's own input.h and associated includes.  It might be possible to get upstream to include our such drivers as well, similar to how it's handled for and updated libinput.
Comment 48 Vladimir Kondratyev freebsd_committer 2018-11-03 18:29:58 UTC
(In reply to Niclas Zeising from comment #47)
> It sounds like I should look into getting ports to use
> our own input.h headers instead of the ones provided
> with v4l_compat or evdev-proto.
No, it means the opposite! "Use our own headers" is what evdev development started from. Some traces of it can still be found at some ports e.g. /usr/ports/devel/py-evdev/files/patch-v4l_compat . But it quickly turned out that supporting of linux/input* set of files as a port is much easier as you do not have to patch any sources and do not stick to a particular FreeBSD version!
Comment 49 Tobias C. Berner freebsd_committer 2018-11-04 13:51:57 UTC
(In reply to Niclas Zeising from comment #41)

We have our branches on github:
  - update-libinput 
  - plasma5-5.13 (aka kde@-trunk)
which contain the updates.

What kind of resources do you mean?

mfg Tobias
Comment 50 Tobias C. Berner freebsd_committer 2018-11-24 20:43:11 UTC
Moin moin

I will commit this by Decembre 22 if there is no sign of progress or status update.

Mfg Tobias
Comment 51 Niclas Zeising freebsd_committer 2018-12-04 22:20:12 UTC
First part of patch, the switch to devel/evdev-proto from v4l_compat for some headers has been submitted for exp-run here: 233787 .

I'll prepare patches for the rest of the updates so that everything is ready once the exp-run is done.
Comment 52 Tobias C. Berner freebsd_committer 2018-12-05 03:53:50 UTC
(In reply to Niclas Zeising from comment #51)
Awsome,  thanks.

Mfg Tobias