Bug 266969 - devel/sdl20: enable libdecor support after 2.0.16 update
Summary: devel/sdl20: enable libdecor support after 2.0.16 update
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: Dmitry Marakasov
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2022-10-11 14:17 UTC by Jan Beich
Modified: 2022-12-06 13:32 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (amdmi3)


Attachments
v1 (apply via "git am") (1.96 KB, patch)
2022-10-11 14:17 UTC, Jan Beich
no flags Details | Diff
v1.1 (apply via "git am") (2.00 KB, patch)
2022-10-26 13:31 UTC, Jan Beich
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beich freebsd_committer freebsd_triage 2022-10-11 14:17:34 UTC
Created attachment 237215 [details]
v1 (apply via "git am")

libdecor is only used under Wayland for client-side decorations where it's already pulled as a dependency via xwayland-devel. sdl2 uses dlopen() for --enable-<any>-shared (default), so no extra bloat for the binary package.

Originally reported in bug 252371 comment 23.

$ poudriere testport -j 131i386 devel/sdl20
[...]
===========================================================================
====> Running Q/A tests (stage-qa)
====> Checking for pkg-plist issues (check-plist)
===> Parsing plist
===> Checking for items in STAGEDIR missing from pkg-plist
===> Checking for items in pkg-plist which are not in STAGEDIR
===> No pkg-plist issues found (check-plist)
=>> Checking for staging violations... done
=======================<phase: package        >============================
===== env: DEVELOPER_MODE=yes STRICT_DEPENDS=yes
===>  Building package for sdl2-2.24.0_2
===========================================================================
=>> Recording filesystem state for preinst... done
=======================<phase: install        >============================
===== env: DEVELOPER_MODE=yes STRICT_DEPENDS=yes
===>  Installing for sdl2-2.24.0_2
===>  Checking if sdl2 is already installed
===>   Registering installation for sdl2-2.24.0_2
[131i386-default] Installing sdl2-2.24.0_2...
===========================================================================
=>> Checking shared library dependencies
 0x00000001 NEEDED               Shared library: [libc.so.7]
 0x00000001 NEEDED               Shared library: [libinotify.so.0]
 0x00000001 NEEDED               Shared library: [libm.so.5]
 0x00000001 NEEDED               Shared library: [librt.so.1]
 0x00000001 NEEDED               Shared library: [libthr.so.3]
 0x00000001 NEEDED               Shared library: [libusbhid.so.4]
Comment 1 Dmitry Marakasov freebsd_committer freebsd_triage 2022-10-25 19:18:18 UTC
Will commit it soon along with 2.24.1 update
Comment 2 Dmitry Marakasov freebsd_committer freebsd_triage 2022-10-25 19:55:27 UTC
> libdecor is only used under Wayland for client-side decorations where it's already pulled as a dependency via xwayland-devel.

Wait, shouldn't it be enabled only along with WAYLAND then?
Comment 3 Jan Beich freebsd_committer freebsd_triage 2022-10-26 13:31:47 UTC
Created attachment 237652 [details]
v1.1 (apply via "git am")

(In reply to Dmitry Marakasov from comment #2)
Added _IMPLIES and adjusted _DESC. Beware, OPTIONS_* poorly support nesting:

$ echo OPTIONS_UNSET+=WAYLAND >>/etc/make.conf
$ make -V PORT_OPTIONS:M\*WAYLAND\*
WAYLAND
$ echo OPTIONS_UNSET+=CSD >>/etc/make.conf
$ make -V PORT_OPTIONS:M\*WAYLAND\*

$
Comment 4 Dmitry Marakasov freebsd_committer freebsd_triage 2022-10-31 17:27:01 UTC
Should it really be BUILD_DEPEND? Regardless of sdl20 broken way of dynamic linking it looks like a normal library dependency.
Comment 5 Jan Beich freebsd_committer freebsd_triage 2022-10-31 17:37:44 UTC
libdecor depends on pango and dbus. Do you really want sdl2 package indirectly pull those?

$ pkg install -qy sdl2
$ pkg install -n libdecor
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 29 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        brotli: 1.0.9,1
        cairo: 1.17.4_2,3
        dbus: 1.14.4,1
        dejavu: 2.37_1
        encodings: 1.0.5,1
        font-bh-ttf: 1.0.3_4
        font-misc-ethiopic: 1.0.4
        font-misc-meltho: 1.0.3_4
        fontconfig: 2.14.0,1
        freetype2: 2.12.1_2
        fribidi: 1.0.12
        gettext-runtime: 0.21
        glib: 2.74.1,2
        graphite2: 1.3.14
        harfbuzz: 5.3.1
        libICE: 1.0.10,1
        libSM: 1.2.3,1
        libXft: 2.3.6
        libdecor: 0.1.0_1
        libfontenc: 1.1.4
        libiconv: 1.17
        mkfontscale: 1.2.1
        mpdecimal: 2.5.1
        pango: 1.50.9
        pcre2: 10.40
        pixman: 0.40.0_1
        png: 1.6.38
        python39: 3.9.15
        xorg-fonts-truetype: 7.7_1

Number of packages to be installed: 29

The process will require 240 MiB more space.
105 KiB to be downloaded.
Comment 6 Dmitry Marakasov freebsd_committer freebsd_triage 2022-11-01 13:16:52 UTC
> libdecor depends on pango and dbus. Do you really want sdl2 package indirectly pull those?

If SDL uses libdecor it has to pull all its depends. If the option is disabled it doesn't. You don't fix anything by hiding the runtime dependency.
Comment 7 Dmitry Marakasov freebsd_committer freebsd_triage 2022-11-25 16:31:25 UTC
Ping.
Comment 8 Jan Beich freebsd_committer freebsd_triage 2022-11-25 21:46:12 UTC
I just don't agree with you. dlopen() approach fixes dependency bloat, allowing to enable all port options for "batteries included".

Only GNOME/Wayland (not supported on FreeBSD yet) needs libdecor kludge. Elsewhere CSD are optional, like a custom skin/theme.
Comment 9 Dmitry Marakasov freebsd_committer freebsd_triage 2022-11-29 17:33:39 UTC
> dlopen() approach fixes dependency bloat

It does not. There are no magic dependencies which exist and don't exist at the same time. You're trying to introduce a broken, hidden dependency - such dependency, for instance, won't prevent libdecor from being autoremoved right after installing SDL with explicitly requested libdecor support, essentially breaking the requested functionality. Same for updating the dependency to ABI-incompatible version, not mentioning debuging problems with broken shared lib graph. Also I hope to kill this dlopen ugliness in the future, probably when I switch the port to cmake, and switch to proper shared linking.

> Only GNOME/Wayland (not supported on FreeBSD yet) needs libdecor kludge. Elsewhere CSD are optional, like a custom skin/theme.

So I take as there's no point in enabling it by default. Will commit it disabled then.
Comment 10 commit-hook freebsd_committer freebsd_triage 2022-12-05 19:28:54 UTC
A commit in branch main references this bug:

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

commit 490c5ee6b0cd71d73169652f3f28a93cdbc00e5d
Author:     Dmitry Marakasov <amdmi3@FreeBSD.org>
AuthorDate: 2022-12-05 18:56:10 +0000
Commit:     Dmitry Marakasov <amdmi3@FreeBSD.org>
CommitDate: 2022-12-05 19:28:13 +0000

    devel/sdl20: update dependencies

    - Properly register dependency on vulkan
    - Add optional client-side decorations support

    PR:             266969, 268122
    Submitted by:   jbeich

 devel/sdl20/Makefile | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)