FS#77211 - [mpv] pkgconfig not usable because ffnvcodec-headers is only a make dependency

Attached to Project: Community Packages
Opened by secret (dec05eba) - Saturday, 21 January 2023, 21:09 GMT
Last edited by Toolybird (Toolybird) - Thursday, 20 April 2023, 04:21 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Christian Hesse (eworm)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
If you want to use libmpv by using pkgconfig (/usr/lib/pkgconfig/mpv.pc, which is included in this package) then it will return an error unless ffnvcodec-headers is installed. ffnvcodec-headers is only listed as a make dependency but it should be a regular dependency to fix this.

Additional info:
mpv version: 1:0.35.0-5

Steps to reproduce:
1. Install mpv and choose to remove the ffnvcodec-headers make dependency after the install has finished.
2. run: "pkg-config --cflags mpv", that will return this error:

Package ffnvcodec was not found in the pkg-config search path.
Perhaps you should add the directory containing `ffnvcodec.pc'
to the PKG_CONFIG_PATH environment variable
Package 'ffnvcodec', required by 'mpv', not found

expected no error, and output similar to this:
-I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/sysprof-4 -I/usr/include/fribidi -I/usr/include/libxml2 -pthread -I/usr/include/luajit-2.1 -I/usr/include/uchardet -I/usr/include/pipewire-0.3 -I/usr/include/spa-0.2 -D_REENTRANT -I/usr/include/libdrm
This task depends upon

Closed by  Toolybird (Toolybird)
Thursday, 20 April 2023, 04:21 GMT
Reason for closing:  Fixed
Additional comments about closing:  mpv 1:0.35.1-1
Comment by secret (dec05eba) - Sunday, 22 January 2023, 14:32 GMT
It seems like none of the public mpv headers use ffnvcodec-headers files so it shouldn't really be needed, but the pkgconfig file cant be used anyways because it checks if ffnvcodec is installed (even if that package only contains header files)
Comment by loqs (loqs) - Sunday, 22 January 2023, 15:26 GMT
If meson knows in advance that it is generating a shared library it will not add in the Requires.private in mpv.pc. See test.patch.
Edit:
Simpler solution delete the two lines after the file has been generated. See PKGBUILD.diff
Requires.private appears to have been introduced by the build system switch to meson.
Libs.private was previously present but not relevant to shared linking.
Comment by Toolybird (Toolybird) - Monday, 23 January 2023, 07:01 GMT
Thanks @loqs, Do you know if this is new meson behavior? Just trying to work out where the actual bug is. i.e. which pkg needs to be fixed, mpv or meson? The sed workaround looks fine as a fix...but we should try to avoid dirty hacks if possible.
Comment by loqs (loqs) - Monday, 23 January 2023, 13:05 GMT
@Toolybird I do not know if this is new meson behavior. Previously mpv used waf which did not generate Requires.private.
Comment by Christian Hesse (eworm) - Saturday, 28 January 2023, 20:30 GMT
Added the workaround in mpv 1:0.35.1-1...

Anybody wants to open an upstream issue for this?

Loading...