After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 792379 - Enable wayland and udev conditions on FreeBSD
Enable wayland and udev conditions on FreeBSD
Status: RESOLVED FIXED
Product: jhbuild
Classification: Infrastructure
Component: module sets
unspecified
Other FreeBSD
: Normal normal
: ---
Assigned To: Jhbuild maintainers
Jhbuild QA
Depends on:
Blocks:
 
 
Reported: 2018-01-09 18:37 UTC by Ting-Wei Lan
Modified: 2018-01-20 16:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
moduleset.rnc: The order of elements in <if> is not significant (2.75 KB, patch)
2018-01-09 18:40 UTC, Ting-Wei Lan
committed Details | Review
world: Replace gudev with libgudev and move them to udev condition (2.31 KB, patch)
2018-01-09 18:41 UTC, Ting-Wei Lan
committed Details | Review
3.28: Replace gudev with libgudev and move them to udev condition (5.23 KB, patch)
2018-01-09 18:41 UTC, Ting-Wei Lan
committed Details | Review
3.28: Enable wayland and udev condition on FreeBSD (5.92 KB, patch)
2018-01-09 18:41 UTC, Ting-Wei Lan
committed Details | Review
3.28: Set the path of Xwayland on FreeBSD for mutter (1007 bytes, patch)
2018-01-09 18:46 UTC, Ting-Wei Lan
committed Details | Review
3.28: colord hard-depends on libgudev (2.08 KB, patch)
2018-01-20 08:29 UTC, Ting-Wei Lan
committed Details | Review

Description Ting-Wei Lan 2018-01-09 18:37:49 UTC
Wayland has been committed to FreeBSD ports since one year ago. libinput requires libudev, and there is now an library called 'libudev-devd' which is an API-compatible implementation using FreeBSD devd. Although wayland support is still not enabled by default on FreeBSD, I believe they are good enough for testing. We cannot lose any feature by enabling udev because nothing still supports HAL.

Users who want to use JHBuild to build GNOME on FreeBSD will have to recompile Mesa with wayland option enabled. Recompiling a package is very easy with FreeBSD ports, so I don't think this is a problem.

To enable wayland and udev conditions on FreeBSD, a few changes to modulesets are required:

1. All <dep> for 'wayland' and 'libinput' have to be moved to 'linux' condition blocks nested inside the original 'wayland' condition blocks because upstream wayland and libinput are still Linux-only. We have to use patched wayland and libinput from FreeBSD ports.

2. Update moduleset.rnc to ignore the order of elements in <if>. Since we are going to have nested <if> because of the above change, the order of <if> and <dep> inside an <if> will become a problem because rnc is ordered by default. I think the order of <dep> and <if> is not important and can be ignored.

3. Use 'udev' condition for 'libudev' and 'libgudev'. There are still many modules which enable or disable udev based on 'linux' condition. They should be changed to use 'udev' condition so we can use libudev-devd on FreeBSD.

4. Add a new condition 'udev-hwdb' for Linux because FreeBSD libudev-devd doesn't implement udev hwdb API. There are some modules which requires udev hwdb when udev is enabled.

After applying these patches, running JHBuild with both wayland and udev conditions disabled on FreeBSD is still supposed to work. However, disabling only one of them is not supported because some modules automatically enable the use of wayland when udev is found.
Comment 1 Ting-Wei Lan 2018-01-09 18:40:42 UTC
Created attachment 366568 [details] [review]
moduleset.rnc: The order of elements in <if> is not significant

It is possible to have <if> elements nested inside <if>. Since the
introduction of <if> and condition set is intended to make modulesets
more flexible, I think we should ignore the order of elements inside
<if> to avoid unneeded validation error.
Comment 2 Ting-Wei Lan 2018-01-09 18:41:28 UTC
Created attachment 366569 [details] [review]
world: Replace gudev with libgudev and move them to udev condition
Comment 3 Ting-Wei Lan 2018-01-09 18:41:42 UTC
Created attachment 366570 [details] [review]
3.28: Replace gudev with libgudev and move them to udev condition

We are going to allow udev dependency on FreeBSD.
Comment 4 Ting-Wei Lan 2018-01-09 18:41:54 UTC
Created attachment 366571 [details] [review]
3.28: Enable wayland and udev condition on FreeBSD

FreeBSD has wayland in ports since a year ago although most packages are
still not built with wayland enabled by default. I think it is time to
test GNOME with wayland on FreeBSD.

FreeBSD also has a new port called 'libudev-devd', which is intended to
be a API-compatible libudev implementation on the top of FreeBSD devd.
Although there are only a few packages using it, it is already good
enough to allow building libgudev successfully without patches.

However, since downstream patches are still required to build wayland on
FreeBSD, we have to rely on the version installed in the system. To get
modulesets work with FreeBSD, all <dep package="wayland"/> are moved to
nested <if condition-set="linux"/> blocks because we are unable to build
wayland in JHBuild on FreeBSD.

libudev-devd on FreeBSD doesn't implement udev hwdb API. A new condition
'udev-hwdb' is added to Linux to indicate that its udev implementation
supports hwdb because there are a few modules depending on hwdb.
Comment 5 Ting-Wei Lan 2018-01-09 18:46:17 UTC
Created attachment 366572 [details] [review]
3.28: Set the path of Xwayland on FreeBSD for mutter

I am not sure whether it is allowed to add this kind of argument to moduleset ...
I think most GNU/Linux users also need --with-xwayland-path=/usr/bin/Xwayland
in their jhbuildrc because Xwayland is not installed inside JHBuild prefix.
Comment 6 Ting-Wei Lan 2018-01-20 08:29:02 UTC
Created attachment 367134 [details] [review]
3.28: colord hard-depends on libgudev

I am not sure whether the dependency on libgudev is acceptable for other
operating systems, but I think it is OK for FreeBSD because we already
have a libudev implementation based on FreeBSD devd.
Comment 7 Ting-Wei Lan 2018-01-20 14:49:44 UTC
Since the release team has moved to BuildStream and all patches attached here don't change any dependencies and build arguments on Linux, I am going to push these changes to JHBuild. If these commits really break anything, please revert them and leave a message in this bug report.
Comment 8 Ting-Wei Lan 2018-01-20 16:30:47 UTC
Attachment 366568 [details] pushed as 903106b - moduleset.rnc: The order of elements in <if> is not significant
Attachment 366569 [details] pushed as 24ff85a - world: Replace gudev with libgudev and move them to udev condition
Attachment 366570 [details] pushed as 62007e0 - 3.28: Replace gudev with libgudev and move them to udev condition
Attachment 366571 [details] pushed as 065837d - 3.28: Enable wayland and udev condition on FreeBSD
Attachment 366572 [details] pushed as ebc5da6 - 3.28: Set the path of Xwayland on FreeBSD for mutter
Attachment 367134 [details] pushed as 3876d00 - 3.28: colord hard-depends on libgudev