GNOME Bugzilla – Bug 792379
Enable wayland and udev conditions on FreeBSD
Last modified: 2018-01-20 16:31:10 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.
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.
Created attachment 366569 [details] [review] world: Replace gudev with libgudev and move them to udev condition
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.
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.
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.
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.
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.
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