Bug 274419 - multimedia/pipewire: Unbreak build with DEFAULT_VERSIONS=ssl=openssl30
Summary: multimedia/pipewire: Unbreak build with DEFAULT_VERSIONS=ssl=openssl30
Status: Closed DUPLICATE of bug 273961
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Gleb Popov
URL:
Keywords:
Depends on: 273961
Blocks:
  Show dependency treegraph
 
Reported: 2023-10-12 00:32 UTC by Craig Leres
Modified: 2023-10-22 03:22 UTC (History)
4 users (show)

See Also:
arrowd: maintainer-feedback+


Attachments
patch (497 bytes, patch)
2023-10-12 00:32 UTC, Craig Leres
no flags Details | Diff
revised patch (508 bytes, patch)
2023-10-12 20:00 UTC, Craig Leres
arrowd: maintainer-approval+
Details | Diff
Help Meson detect security/openssl3* (924 bytes, patch)
2023-10-13 10:08 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 Craig Leres freebsd_committer freebsd_triage 2023-10-12 00:32:07 UTC
I've found that pipewire does not build when using the openssl30 port, e.g:

    ld: error: undefined symbol: OSSL_PARAM_construct_BN

Support for openssl3 will need to be added upstream but for now defining OPENSSL_API_COMPAT solves it. This is a similar problem and fix as bug 273909.
Comment 1 Craig Leres freebsd_committer freebsd_triage 2023-10-12 00:32:50 UTC
Created attachment 245573 [details]
patch
Comment 2 Gleb Popov freebsd_committer freebsd_triage 2023-10-12 07:27:51 UTC
security/openssl30 is going to be removed from ports shortly.
Comment 3 Craig Leres freebsd_committer freebsd_triage 2023-10-12 20:00:19 UTC
Created attachment 245588 [details]
revised patch

I didn't realize OPENSSL_API_COMPAT worked with openssl > 3.0; given the impending  demise of openssl30, adjust patch to work with openssl3X (I've tested it openssl31).
Comment 4 commit-hook freebsd_committer freebsd_triage 2023-10-12 20:15:10 UTC
A commit in branch main references this bug:

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

commit 75ff86d0e516e6291be7e25cc30bb14fbda10bf1
Author:     Craig Leres <leres@FreeBSD.org>
AuthorDate: 2023-10-12 20:14:10 +0000
Commit:     Craig Leres <leres@FreeBSD.org>
CommitDate: 2023-10-12 20:14:10 +0000

    multimedia/pipewire: Unbreak build with DEFAULT_VERSIONS=ssl=openssl3X

    Use OPENSSL_API_COMPAT to fix build on FreeBSD 13.2 with
    DEFAULT_VERSIONS=ssl=openssl3[012]

    PR:             274419
    Approved by:    arrowd (maintainer)

 multimedia/pipewire/Makefile | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
Comment 5 Jan Beich freebsd_committer freebsd_triage 2023-10-13 09:40:40 UTC
Why port OpenSSL 3.0 (in FreeBSD 13.2) needs OpenSSL 1.1 API compat but base OpenSSL 3.0 (in FreeBSD 14.0) does not? Looks like a workaround for an ABI mismatch: /usr/local/include/openssl vs. /usr/lib/libcrypto.so. This mainly affects libpipewire-module-raop-sink.so, so runtime may be tricky to test.

$ pkg install openssl30
$ pkg-config --modversion openssl
1.1.1t

diff --git a/multimedia/pipewire/Makefile b/multimedia/pipewire/Makefile
index d5d154acd4e5..b3b9866e0514 100644
--- a/multimedia/pipewire/Makefile
+++ b/multimedia/pipewire/Makefile
@@ -111,8 +111,9 @@ post-install-MEDIASESSION-on:
 
 .include <bsd.port.pre.mk>
 
-.if ${SSL_DEFAULT:C,3[0-9],3,} == openssl3
-CFLAGS+=	-DOPENSSL_API_COMPAT=0x10100000L
+.if ${SSL_DEFAULT} != base
+# XXX Move into USES=ssl to fix for USES=meson and other USES=pkgconfig consumers
+CONFIGURE_ENV+=	PKG_CONFIG_PATH=${LOCALBASE}/libdata/pkgconfig
 .endif
 
 .include <bsd.port.post.mk>
Comment 6 Jan Beich freebsd_committer freebsd_triage 2023-10-13 10:08:41 UTC
Created attachment 245601 [details]
Help Meson detect security/openssl3*

Oops, my patch in comment 5 had a bug breaking plist: Error: Missing: bin/pw-top
Comment 7 Gleb Popov freebsd_committer freebsd_triage 2023-10-13 10:20:02 UTC
> Why port OpenSSL 3.0 (in FreeBSD 13.2) needs OpenSSL 1.1 API compat but base
OpenSSL 3.0 (in FreeBSD 14.0) does not?

It might be related to the problem with OpenSSL 3 import that I described here: https://lists.freebsd.org/archives/freebsd-current/2023-August/004261.html

and here https://reviews.freebsd.org/D41506
Comment 8 Gleb Popov freebsd_committer freebsd_triage 2023-10-14 07:34:37 UTC
Jan, Craig, feel free to push any pipewire patches you think are sensible. I'm a nominal maintainer for this port and don't use it myself. I ported it as a dependency for xdg-desktop-portal (which I also don't use ATM). It might even make sense to give the maintainership to someone else.
Comment 9 Naram Qashat 2023-10-19 07:01:01 UTC
I'd like to point out that I ran into this failure on building multimedia/pipewire in poudriere with a git pull from October 16, after Craig's commit. My poudriere make.conf for the build has ssl=openssl in the DEFAULT_VERSIONS. That makes it use security/openssl, which is currently OpenSSL 3.0.11 as of this message, and thus would've been affected by this as the committed change only checks for a value matching openssl3 for ssl in DEFAULT_VERSIONS and not openssl.

As the builder is still going, I am unable to currently test any changes, but I imagine that the patch submitted by Jan may work, while the patch submitted by Craig will not.
Comment 10 Jan Beich freebsd_committer freebsd_triage 2023-10-19 08:43:39 UTC
There's a generic fix available, so my patch is obsolete and ports 75ff86d0e516 (aka comment 4) should be reverted.

*** This bug has been marked as a duplicate of bug 273961 ***