Bug 272836 - x11-wm/fvwm3 cannot be run from lightdm
Summary: x11-wm/fvwm3 cannot be run from lightdm
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Felix Palmen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-07-31 08:02 UTC by Bartek Jasicki
Modified: 2023-08-04 06:33 UTC (History)
0 users

See Also:
zirias: maintainer-feedback+


Attachments
fvwm3-missing-file.patch (1.62 KB, patch)
2023-07-31 08:02 UTC, Bartek Jasicki
no flags Details | Diff
fvwm3-missing-file2.patch (1.59 KB, patch)
2023-07-31 11:18 UTC, Bartek Jasicki
no flags Details | Diff
0001-x11-wm-fvwm3-Add-.desktop-entry-for-XSession (2.52 KB, patch)
2023-07-31 12:22 UTC, Felix Palmen
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bartek Jasicki 2023-07-31 08:02:20 UTC
Created attachment 243726 [details]
fvwm3-missing-file.patch

After installing fvmw3, it is impossible to run it from lightdm, and probably from other desktop managers like sddm too. The reason: The package doesn't provide a file with the desktop's session's description. It is known issue in ffvm3: https://github.com/fvwmorg/fvwm3/issues/12

Here is the patch containing the missing file, fvwm.desktop.
Comment 1 Felix Palmen freebsd_committer freebsd_triage 2023-07-31 09:17:46 UTC
Well, thanks for submitting a patch! Unfortunately, I can immediately spot two issues with it:
- The binary is called fvwm3, not fvwm
- The path is hardcoded, but it must honor ${PREFIX} instead. So, you'd have to add some .in file containing %%PREFIX%% instead and add it to SUB_FILES.

That said, I'd also prefer such a file being maintained upstream. In the issue you linked, Thomas wrote he'll happily accept a PR, so maybe you want to try it?

Finally, of course it's possible to launch fvwm3 from a display manager, doing that for a long time myself, you just have to write your own ~/.xsession and select the "custom/user session".
Comment 2 Felix Palmen freebsd_committer freebsd_triage 2023-07-31 10:39:32 UTC
(In reply to Felix Palmen from comment #1)
> That said, I'd also prefer such a file being maintained upstream. In the issue
> you linked, Thomas wrote he'll happily accept a PR, so maybe you want to try it?
Thinking about that again, I don't mean it should not be added to the port. Certainly possible to do both. I just think upstream should know best what should be in this file, so it makes sense trying to push it upstream (and, if accepted, remove it again from the port).
Comment 3 Bartek Jasicki 2023-07-31 11:18:17 UTC
Created attachment 243732 [details]
fvwm3-missing-file2.patch

Thank you for checking, my mistake with the executable name, now should be ok. I also removed the hard-coded path in the way how, for example, i3 handle it.

> That said, I'd also prefer such a file being maintained upstream. In the issue you linked, Thomas wrote he'll happily accept a PR, so maybe you want to try it?

I have no possibility and time to test do the patch will work on other platforms, that's why I propose it here. Furthermore, I don't mind that you send it as your patch. :)

> Finally, of course it's possible to launch fvwm3 from a display manager, doing that for a long time myself, you just have to write your own ~/.xsession and select the "custom/user session".

Good to know, thank you. Some users (me) get used to have that things added by default, that's why I was thinking that it is impossible to run it via a desktop manager. It is bigger chance to meet WM which has that file included than missing. ;)
Comment 4 Felix Palmen freebsd_committer freebsd_triage 2023-07-31 11:45:23 UTC
(In reply to Bartek Jasicki from comment #3)
> I also removed the hard-coded path in the way how, for example, i3 handle it.
I'm personally not fine with relying on $PATH at runtime either, IMHO it should really be handled via SUB_FILES. If you don't mind, I'll just create my own patch and of course mention you as co-author?

> I have no possibility and time to test do the patch will work on other
> platforms, that's why I propose it here.
If that's what's holding you back from suggesting something upstream, don't worry, these .desktop files are standardized by freedesktop.org, if they're correct, they will work on any platform!

Cheers, Felix
Comment 5 Felix Palmen freebsd_committer freebsd_triage 2023-07-31 12:22:06 UTC
Created attachment 243734 [details]
0001-x11-wm-fvwm3-Add-.desktop-entry-for-XSession

Here's what I'd like to commit for now. Based on your patch, with the following changes:

- Use absolute paths, but base them on ${PREFIX} using SUB_FILES
- Name it the same (fvwm3.desktop) in the port as in STAGEDIR
- Remove unnecessary Encoding= property

Could you please test whether this works for you as expected?

Thanks, Felix
Comment 6 Bartek Jasicki 2023-07-31 16:02:45 UTC
Comment on attachment 243732 [details]
fvwm3-missing-file2.patch

I will start from the end. ;)

Your patch works as expected, the file is created with the proper path and ligthdm see the session. So, I mark my patch as obsolete now.

>If that's what's holding you back from suggesting something upstream, don't 
>worry, these .desktop files are standardized by freedesktop.org, if they're
>correct, they will work on any platform!

I'm more worry about the location of sessions directory. In various Linux distributions, it wanders like ducks on spring. ;) The problem will be with proper detection where to put that file. On FreeBSD, you have `/usr/local/share`, on Linux the previous plus `/usr/share` plus probably a couple of other locations.

> I'm personally not fine with relying on $PATH at runtime either, IMHO it
> should really be handled via SUB_FILES. If you don't mind, I'll just create my 
> own patch and of course mention you as co-author?

Do whatever you think is the best, you are the boss here. ;) I don't mind.
Comment 7 Felix Palmen freebsd_committer freebsd_triage 2023-07-31 16:34:13 UTC
(In reply to Bartek Jasicki from comment #6)

> Your patch works as expected,
Thanks for testing, will commit it!

> On FreeBSD, you have `/usr/local/share`, on Linux the previous plus
> `/usr/share` plus probably a couple of other locations.
This looks like it differs only in ${PREFIX}. In any sane build system, ${PREFIX} is configurable anyways. As long as the location is consistently ${PREFIX}/share/xsessions, there won't be any problem ;)

> Do whatever you think is the best, you are the boss here. ;) I don't mind.
I'm certainly not the "boss", just the guy volunteering to keep this port in good shape ;) You'll be credited as my patch used yours as a starting point!
Comment 8 commit-hook freebsd_committer freebsd_triage 2023-07-31 16:38:11 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=d5f33570094ca4777eb4a906214f2465961a712b

commit d5f33570094ca4777eb4a906214f2465961a712b
Author:     Felix Palmen <zirias@FreeBSD.org>
AuthorDate: 2023-07-31 12:13:22 +0000
Commit:     Felix Palmen <zirias@FreeBSD.org>
CommitDate: 2023-07-31 16:37:21 +0000

    x11-wm/fvwm3: Add .desktop entry for XSession

    Add a .desktop file of type XSession, so fvwm3 is discoverable for
    display managers following freedesktop.org standards.

    PR:             272836
    Co-authored-by: Bartek Jasicki <thindil@laeran.pl.eu.org>

 x11-wm/fvwm3/Makefile                     | 8 +++++++-
 x11-wm/fvwm3/files/fvwm3.desktop.in (new) | 6 ++++++
 x11-wm/fvwm3/pkg-plist                    | 1 +
 3 files changed, 14 insertions(+), 1 deletion(-)
Comment 9 Felix Palmen freebsd_committer freebsd_triage 2023-07-31 17:36:23 UTC
Reworked patch is committed, thanks for your contribution!

Still, if you see a chance to push this upstream, please do so. Otherwise, I guess I'll be the one who has to dig into some GNU autotools based build system :o

Cheers, Felix
Comment 10 Bartek Jasicki 2023-08-01 06:01:45 UTC
(In reply to Felix Palmen from comment #9)

First, thank you very much for patching.

Unfortunately, I don't have time to play with upstream. :( As I wrote before, the hardest part will be to detect the path where to install the file. Unless we do the same trick as i3 and rely on $PATH. ;) After all, it should be a problem. The desktop file is executed always by the desktop manager's user, so it always uses a system-wide $PATH and not a user's one. Thus, it should always point on the proper executable.
Comment 11 Felix Palmen freebsd_committer freebsd_triage 2023-08-02 09:53:00 UTC
Upstream PR created: https://github.com/fvwmorg/fvwm3/pull/876
Comment 12 commit-hook freebsd_committer freebsd_triage 2023-08-04 06:33:51 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=b9aa3ea1679e67e4f30fda91cade7f448aa3f1e3

commit b9aa3ea1679e67e4f30fda91cade7f448aa3f1e3
Author:     Felix Palmen <zirias@FreeBSD.org>
AuthorDate: 2023-08-04 06:29:04 +0000
Commit:     Felix Palmen <zirias@FreeBSD.org>
CommitDate: 2023-08-04 06:32:36 +0000

    x11-wm/fvwm3: Use upstream .desktop file

    After upstream accepted a simple .desktop file with a few changes, use
    this one until the next upstream version is released.

    The main difference is that it uses Type=Application instead of
    Type=XSession. According to freedesktop.org specs, Type=XSession does
    not exist. Both work fine with sddm, but it's still better to use the
    one that conforms to the spec.

    PR:             272836

 x11-wm/fvwm3/Makefile               | 2 +-
 x11-wm/fvwm3/files/fvwm3.desktop.in | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)