Page MenuHomeFreeBSD

Add x11-wm/weston port
Needs ReviewPublic

Authored by johalun0_gmail.com on May 4 2017, 12:49 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Mar 26, 9:52 PM
Unknown Object (File)
Mon, Mar 11, 9:30 PM
Unknown Object (File)
Fri, Mar 8, 2:55 AM
Unknown Object (File)
Feb 23 2024, 11:35 PM
Unknown Object (File)
Feb 14 2024, 3:59 AM
Unknown Object (File)
Feb 11 2024, 7:46 PM
Unknown Object (File)
Feb 8 2024, 1:39 PM
Unknown Object (File)
Feb 5 2024, 8:22 AM

Details

Reviewers
bapt
mat
Summary

This patch adds a port for Weston, now in version 2.0 and a GID for 'weston-launch'.

Weston is a reference implementation of a compositor using the Wayland protocol and libraries.

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

Changed libglapi dependency from port libglapi -> mesa-libs to conform to consolidated mesa-libs suggested in https://reviews.freebsd.org/D10448

mat requested changes to this revision.May 4 2017, 1:29 PM
mat added inline comments.
x11-servers/xorg-server/Makefile
88 ↗(On Diff #28018)

What are you trying to achieve with this NONEXISTENT value here ?
The first label in the dependencies list is:

  • a full path
  • a binary name
  • a packagename>=version

And it must exist after the package have been installed. NONEXISTENT will never exist.

89 ↗(On Diff #28018)

The following line already brings in graphics/wayland as a build and run depends, no need to add it again here.

x11-toolkits/gtk30/Makefile
31–32 ↗(On Diff #28018)

No need to add the same port twice.

x11-wm/weston/Makefile
9

Add empty line before this.

15–16

Remove this.

54–56

Only list dependencies once, not two, three, or more times, once.

69

Why += ? It is not defined before.

Also, the BUILD_DEPENDS definition must be before LIB_DEPENDS.

70

This is already taken care of by the LIB_DEPENDS before, remove it.

84

Change the += by =, there is no previous definition.

100–102

This is:

CAIROIMAGE_CONFIGURE_ON= --with-cairo=image
103–108

Same here.

110

Not needed, you already have USES=autoreconf.

This revision now requires changes to proceed.May 4 2017, 1:29 PM
johalun0_gmail.com edited edge metadata.

Cleaned up weston/Makefile.
Removed xorg-server and gtk30 patches that didn't belong here.

x11-wm/weston/Makefile
22–39

It would be nice if you could split the OPTIONS_* from the *_DESC to make it more readable.

54

The BUILD_DEPENDS, LIB_DEPENDS and RUN_DEPENDS must appear earlier in the Makefile, just after the LICENSE block.
See the Order of Variables in Port Makefiles section of the Porter's Handbook.

56

This one stays with the options, it should, maybe be right after the DRM_CONFIGURE_ENABLE line.

Reordered rows and clean up in weston/Makefile.

x11-wm/weston/Makefile
10

Before assigning that port to x11@freebsd.org (it should be spelled FreeBSD.org) make sure to ask the group if they are ok with it.

13

If the software come with a file containing the license, it should be added below this line, something like:

LICENSE_FILE=  ${WRKSRC}/license-file
16

Remove empty line.

37

Remove empty line.

x11-wm/weston/Makefile
10

I'm part of x11@ and I'm ok with it :)

Unfortunately the differential is without full context so I cannot inline the comments pertaining to graphics/wayland/Makefile.

Does wayland need WITH_DEBUG=1, or could that be an option or removed entirely?

The space after LIB_DEPENDS should be replaced by a tab to maintain proper alignment.

graphics/wayland/files/patch-configure.ac
1 ↗(On Diff #28023)

Drop this extraneous change. If the change is only to dates, no line numbers changed and no content changed, then it need not be committed.

x11-wm/weston/Makefile
10

I second that OK as member of x11@

38

This should not be needed. USE_GL with any of egl, gbm, gl, or gles2 provides libglapi.so. After D10448 those will all be effectively the same anyway, simply adding BUILD and RUN_DEPENDS on mesa-libs.

79

Only the latter part is needed, ${LOCALBASE}/include is added by USES=localbase already.

x11-wm/weston/pkg-descr
2

This should provide more than a repeat of the comment. Copying the summary from the website is a good start, e.g.
"Weston is a reference implementation of a Wayland compositor. Weston can run as an X client or under KMS and ships with a few demo clients. The Weston compositor is a minimal and fast compositor and is suitable for many embedded and mobile use cases."

johalun0_gmail.com marked 20 inline comments as done.

Remove patch for file with only date change.
Cleaned up weston/Makefile

Removed graphics/wayland patches since it has already been updated to 1.13

johalun0_gmail.com retitled this revision from Add Weston port and update Wayland to Add Weston port.Jun 2 2017, 10:45 AM
johalun0_gmail.com edited the summary of this revision. (Show Details)
adridg added inline comments.
x11-wm/weston/Makefile
25

WAYLAND is an option, not on by default, so this can fail when mesa-libs is installed without that option.

26

The port has since been renamed:

commit 37fb9cacff2d0bdfd35e4db2eb0bcce97f6b0c61
Author: jbeich <jbeich@FreeBSD.org>
Date:   Mon Feb 20 02:57:04 2017 +0000

devel/libevent2: drop historical suffix after r362796
PR:             216777

After fixing the two little bits I mentioned earlier, this new port builds on 10.3 x64, can be installed, and can run as a standalone Wayland compositor inside X11. A Wayland hello-world can connect and display things. After building qt5-wayland, Qt applications can use -platform wayland to display to the Weston window in X11 as well.

So from the perspective of running-in-X11, this is fine for kde@ as well. Excellent, in fact. Strongly desired.

I'm working on getting weston into the tree, just chasing some details now. I chased the libevent rename, I also cleanup the makefile a bit (mostly whitespace/location).
For the wayland-egl.so problem, I dropped the wayland-egl line from LIB_DEPENDS but I added a pre-configure hook that check with pkg-config if wayland-egl is present if not to bails. The check is the same is x11-toolkits/gtk30 has for cairo-xlib.

I want to put some info together which the user can use the get started, because I had to fight with XDG_RUNTIME_DIR before I could use weston-launch.

Update to Weston 3.0

oh wow, I thought you abandoned this, and a few days ago I recreated the patch for weston git master :D

Anyway, consider using SHM_ANON in os_create_anonymous_file — with the current implementation, if XDG_RUNTIME_DIR is on ZFS (e.g. ~/.tmp), it will fail because posix_allocated is now unsupported on ZFS.

Improve Makefile. Fix portlint warnings.
Use anonymous shared memory instead of /tmp filesystem because posix_allocated won't work with ZFS.

x11-wm/weston/Makefile
55–56

Why would one want to build something that is not installed ?

59

Is there any interest of having this not always installed as suid ?

98–100
CLIENTS_INSTALL_USE= gnome=glib20

Thanks for the feedback. Will update the patch.

x11-toolkits/gtk30/Makefile
31–32 ↗(On Diff #28018)

Actually this shouldn't be here.. xorg and gtk was added by mistake.

x11-wm/weston/Makefile
10

Yeah I was thinking about that.. I'm basically the only one working on wayland/weston ports. I don't mind being the maintainer for now. On the other hand, I kind of am part of x11 team so whichever makes most sense.

55–56

True. Ask the original author of this Makefile :) I will remove that option.

59

Hmm. Maybe not for weston since it has a separate binaries for kms vs x11 backends.

84

Doesn't _CONFIGURE_ENABLE or something similar write to CONFIGURE_ARGS? I remember having some weird bug were configure flags "disappeared" because they were overwritten.

x11-wm/weston/Makefile
84

Well, make(1) is not magic. You use += when there is a previous definition you wish to append to. Here, looking up in the Makefile, there is no previous definition, so there is no need for +=.
The options helpers are handled during the include of bsd.port.options.mk, so if you need to put things in a variable after including it, you do need to use +=. Otherwise, it just confuses people because they try to find out what is in the variable before, fail to find anything, and wonder wtf.

linimon retitled this revision from Add Weston port to Add x11-wm/weston port.Jul 18 2018, 12:59 PM

As an interested user, I wonder if using a group named 'weston-launch' is the best thing to do. My alternative thought would be to use something like 'wayland-launch', since there are two popular compositors today (weston and sway), and may be more in the future.

You could get into a situation where a Wayland app would be launchable under one compositor but not another.

I really wish I had available time to help with this effort. Thank you for pursuing this.

As an interested user, I wonder if using a group named 'weston-launch' is the best thing to do. My alternative thought would be to use something like 'wayland-launch', since there are two popular compositors today (weston and sway), and may be more in the future.

You could get into a situation where a Wayland app would be launchable under one compositor but not another.

This has nothing to do with apps! 'weston-launch' is a group for users who are allowed to launch Weston itself using the 'weston-launch' setuid binary. That binary actually checks for that exact group name.

Greg, thanks for the clarification. I was under the impression (from a short-lived Wayland/(Weston || Sway) adventure about 1.5 years ago) that each app started its own compositor. Some discussion on the Sway github led me to believe that, IIRC.

Incidentally, that adventure took place on FreeBSD. It was rough, but I could run a graphic terminal under Weston (no X11), as well as the demo apps. Sway had some blocking Linux-isms I didn't have time to chase down. Super nice to see progress here.

Greg, thanks for the clarification. I was under the impression (from a short-lived Wayland/(Weston || Sway) adventure about 1.5 years ago) that each app started its own compositor. Some discussion on the Sway github led me to believe that, IIRC.

Nah.
Some complex apps (i.e. WebKit) can act like subcompositors.
Also you can run a compositor in windowed mode under X or Wayland.

But the "launch" stuff doesn't matter for any of that.
Launch is all about *being a display server*, i.e. running directly on hardware, with access to GPU and input devices.

Has mesa gained option WAYLAND by default yet? I think that's what's blocking this, and (for instance) switching on Wayland in the KDE compositor (that is, KWin, which is one of the compositors which you can use to run a KDE desktop session or KDE applications).

Has mesa gained option WAYLAND by default yet?

Not yet, but it is on the way as far as I know.

I think that's what's blocking this.

Not only this. There is also absence of evdev in GENERIC kernel so in
order to get Weston works you need to re-compile the whole kernel.
Also I have problems running this with amdgpu driver (SIGBUS signal
and core dump) while i950kms driver works well. Also there are small
problems like absence of XDG_RUNTIME_DIR with correct permission (700)
after installation of this port (the best way is to add this
requirement into post-install message), lack of mouse cursors and one
missing runtime dependecy (xkb-something ...)

Regards,
Denis