Bug 282326 - [NEW PORT] x11/sx: Start an X.Org Server
Summary: [NEW PORT] x11/sx: Start an X.Org Server
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-26 04:41 UTC by Vlad Biley
Modified: 2025-04-15 11:50 UTC (History)
4 users (show)

See Also:


Attachments
x11/sx: Start an X.Org Server (5.77 KB, patch)
2024-10-26 04:41 UTC, Vlad Biley
no flags Details | Diff
x11/sx: Add new port (5.82 KB, patch)
2024-10-30 13:14 UTC, Vlad Biley
no flags Details | Diff
x11/sx: Add new port (5.94 KB, patch)
2024-10-31 18:50 UTC, Vlad Biley
no flags Details | Diff
pkg-plist appearance (18.65 KB, image/png)
2024-10-31 18:51 UTC, Vlad Biley
no flags Details
x11/sx: Add new port (6.01 KB, patch)
2024-11-03 17:25 UTC, Vlad Biley
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vlad Biley 2024-10-26 04:41:03 UTC
Created attachment 254519 [details]
x11/sx: Start an X.Org Server

sx is a simple alternative to both xinit(1) and startx(1) for starting an Xorg
server. It started life as a proof of concept while attempting to learn how both
xinit and startx worked while taking up the offer presented in startx: "Site
administrators are STRONGLY urged to write nicer versions". It is not a direct
replacement however as it provides a different, more limited, interface:

* The server's command-line is hard coded and not exposed to the user.
* The server doesn't listen on anything except unix domain sockets.
* The server starts on the first available tty.
* $DISPLAY is coupled to the tty user logged in on.
* xauth entries are overwritten if the displayname is identical.
* Corresponding xauth entries are unconditionally removed when the server exits.
* The server uses the -noreset flag.
* While $XAUTHORITY is still honoured, $XDG_DATA_HOME/sx/xauthority is used by
  default instead of $HOME/.Xauthority.
* Very little proxy error checking is used preferring instead to let each tool
  speak for itself.
* None of the typical /usr/local/etc/X11/xinit infrastructure is directly used.
* Neither $XINITRC is honoured nor .xinitrc used.
* The $XDG_CONFIG_HOME/sx/sxrc file is used instead of .xinitrc and is required
  to be executable.

Author's design choice of coupling the tty number to Xorg's vt argument and
$DISPLAY is patched in this FreeBSD port. See Earnestly/sx#7 for more details.
Comment 1 Vlad Biley 2024-10-30 13:14:26 UTC
Created attachment 254641 [details]
x11/sx: Add new port

Fixed patch:

* correct pkg-descr and commit message
* remove commit message word-wrap
* add "Signed-off-by" trailer
Comment 2 Alastair Hogge 2024-10-31 06:24:09 UTC
Very cool.

I understand that ${DISTVERSION} is perferred over ${PORTVERSION}:
https://docs.freebsd.org/en/books/porters-handbook/book/#makefile-versions

You can use ${PLIST_FILES} directly in the Port's Makefile over creating pkg-plist, because the Port only installs "just a handful of files":
https://docs.freebsd.org/en/books/porters-handbook/book/#porting-pkg-plist

sx will need to be added to the parent directory Makefile:
> SUBDIR += swaysettings
> SUBDIR += sx
> SUBDIR += sxhkd
Comment 3 Vlad Biley 2024-10-31 18:50:29 UTC
Created attachment 254826 [details]
x11/sx: Add new port

(In reply to Alastair Hogge from comment #2)

Thanks a lot. Here is the corrected patch.

Let me ask a few questions:

1. When I created this, I noticed that I was not present in the CC List automatically, so I did it manually. Should I do this, or will I get emails about my reports anyway?

2. Why does pkg-plist in the previous attachments look like a modified file when it is actually a new file just like the others? I will upload a screenshot in the next attachment.
Comment 4 Vlad Biley 2024-10-31 18:51:26 UTC
Created attachment 254827 [details]
pkg-plist appearance
Comment 5 Alastair Hogge 2024-11-01 07:02:56 UTC
(In reply to Vlad Biley from comment #3)

> 1. When I created this, I noticed that I was not present in the CC List automatically, so I did it manually. Should I do this, or will I get emails about my reports anyway?

Good question, I have no idea; I think you have to add yourself, like you have concluded; it is a UX design pattern I do not understand.

> 2. Why does pkg-plist in the previous attachments look like a modified file when it is actually a new file just like the others? I will upload a screenshot in the next attachment.

Directly above the line:
> 0-                             1 The small NOTES section of sx(1) is a must-read.

is the word "Added" (diff segment header), this is meant to indicate that the following is new, if you look at other bug reports, the modified header would be something like:
> (-)b/port-category/fu-port/Makefile (-15 / +53 lines)
> Lines 1-39 
> minus this
> add that

Did you run your Port thru the various Port tools, portlint(1), portfmt(1), portclippy(1), and poudriere-testport(8)?

I believe reviews.freebsd.org. is the preferred place for new Ports too.
Comment 6 Alastair Hogge 2024-11-01 07:05:31 UTC
The sx Makefile is also missing ${WWW} (https://docs.freebsd.org/en/books/porters-handbook/book/#porting-order-maintainer).
Comment 7 Vlad Biley 2024-11-03 17:25:33 UTC
Created attachment 254912 [details]
x11/sx: Add new port

Fixed patch:

* added WWW (see below)
* added NO_ARCH (reported by poudriere-testport)
* moved NO_BUILD (reported by portclippy)
* formatted Makefile (used portfmt)

(In reply to Alastair Hogge from comment #5)

>the word "Added" (diff segment header), this is meant to indicate that the following is new

Yes, but you may also see the two-pane (+/-) view with a blue background, rather than a single-pane (+) view with a green background like the others.

>Did you run your Port thru the various Port tools, portlint(1), portfmt(1), portclippy(1), and poudriere-testport(8)?

Only portlint. Now I have used all of this, thank you for the references. I have not yet had a time to study the full Porter's Handbook, where I see these tools are recommended.

By the way, in my opinion, that whitespace alignment of Makefiles is debatable. But of course if there are rules, I will follow them.

>I believe reviews.freebsd.org. is the preferred place for new Ports too.

The Handbook recommends submitting ports here: https://docs.freebsd.org/en/books/porters-handbook/quick-porting/#porting-submitting

Is that information out of date?

(In reply to Alastair Hogge from comment #6)

>The sx Makefile is also missing ${WWW}.

I thought that with ports using GitHub the WWW is not required, as I discovered that in this case the framework automatically constructs WWW from GH_ACCOUNT/PORTNAME. There are also such ports in the tree, but I have just found that most of the ports specify WWW regardless of USE_GITHUB, so now I decided to add it too. Although this still seems a bit redundant to me.
Comment 8 Vlad Biley 2024-11-24 23:26:58 UTC
Bump?