Bug 244432

Summary: multimedia/handbrake: Fails to build: ERROR: dav1d >= 0.2.1 not found using pkg-config
Product: Ports & Packages Reporter: Steve Peurifoy <ssw01>
Component: Individual Port(s)Assignee: Tobias C. Berner <tcberner>
Status: Closed FIXED    
Severity: Affects Some People CC: naito.yuichiro, scf, tcberner
Priority: --- Keywords: needs-qa
Version: LatestFlags: naito.yuichiro: maintainer-feedback+
tcberner: merge-quarterly-
Hardware: amd64   
OS: Any   
Attachments:
Description Flags
poudriere build log for handbrake
none
Fix for pkgconfig paths during build
none
Fix meson path naito.yuichiro: maintainer-approval+

Description Steve Peurifoy 2020-02-26 15:08:19 UTC
Created attachment 211953 [details]
poudriere build log for handbrake

System: 12.1-RELEASE-p1 FreeBSD 12.1-RELEASE-p1 GENERIC  amd64
Ports tree rev: 526573

A poudriere build of handbrake failed with the error

ERROR: dav1d >= 0.2.1 not found using pkg-config

apparently during the build of its private version of ffmpeg? This is odd
because the log (attached) shows an apparently successful build of dav1d 0.5.1.

Steps to reproduce:
poudriere bulk -f <port list including multimedia/handbrake> -j <12.1 jail>

Expected result: successful build

Actual result: error noted above
Comment 1 Yuichiro NAITO 2020-02-27 04:53:49 UTC
(In reply to Steve Peurifoy from comment #0)
It seems strange.

> apparently during the build of its private version of ffmpeg? This is odd
> because the log (attached) shows an apparently successful build of dav1d 0.5.1.

Yes, dav1d is provided from HandBrake master site and should be found
according to the successful build log.

My poudriere build with r527229 (my latest) finished successfully.
I'm going to retry with r526573.
Comment 2 Sean Farley freebsd_committer freebsd_triage 2020-02-27 05:52:26 UTC
Created attachment 211983 [details]
Fix for pkgconfig paths during build

This is a patch I made to fix it, at least, for myself.  The issue is where the build places pkgconfig files.  It has two directories.  There is probably a better solution.

In essence, dav1d places files in libdata/pkgconfig while HandBrake is looking in lib/pkgconfig.  I just linked the two together during the post-extract stage.
Comment 3 Yuichiro NAITO 2020-02-27 09:37:13 UTC
Created attachment 211986 [details]
Fix meson path
Comment 4 Yuichiro NAITO 2020-02-27 09:38:49 UTC
(In reply to Sean Farley from comment #2)
Thank you very much for the pkgconfig path patch.

The default pkgconfig path of meson is libdata/pkgconfig on FreeBSD.
It's correct but in the HandBrake build it should be as same as Linux environment.
So, I patched `meson.build` file to fix as same as HandBrake lib/pkgconfig path.

In my poudriere environment, there are two dav1d.
One is HandBrake contib, the other is FreeBSD ports.

HandBrake requires gstreamer1-libav port for HandBrake preview feature, 
It requires ffmpeg port and ffmpeg default option includes DAV1D.

So, my dav1d.pc is solved by /usr/local/libdata/pkgconfig/dav1.pc
in my poudriere environment.

`Fix meson path` patch file should fix this problem.
Please check and see it.
Comment 5 Steve Peurifoy 2020-02-27 21:37:08 UTC
After applying Naito-san's patch, handbrake built fine.

Thank you!
Comment 6 Yuichiro NAITO 2020-02-28 00:54:14 UTC
(In reply to Steve Peurifoy from comment #5)
Thanks for the confirmation.

Please apply 'Fix meson path' patch to Ports tree.
Thank you.
Comment 7 Kubilay Kocak freebsd_committer freebsd_triage 2020-02-28 03:31:54 UTC
Is quarterly affected?

@Maintainer, Please set maintainer-approval attachment flag on patches for ports you maintain to signify maintainer approval
Comment 8 Yuichiro NAITO 2020-02-28 04:12:16 UTC
(In reply to Kubilay Kocak from comment #7)
> Is quarterly affected?

Yes. Quarterly has previous version of HandBrake and it has same problem.
My patch can be applied to both head and 2020Q1.

I set maintainer approval flag to my patch.
Comment 9 Sean Farley freebsd_committer freebsd_triage 2020-02-29 02:29:05 UTC
It built for me under poudriere as well.
Comment 10 Yuichiro NAITO 2020-03-02 02:54:20 UTC
For more information,
Meson pkgconfig path has been changed since 0.53.0 by this commit.

https://github.com/mesonbuild/meson/commit/aba8792b6657e3aa380586764a8b3ec567895a28

This problem didn't happen before meson 0.53.0.
Comment 11 Tobias C. Berner freebsd_committer freebsd_triage 2020-03-08 15:24:26 UTC
Moin moin 

as meson in quarterly is still < 0.53, there is no need to MFH this then.


mfg Tobias
Comment 12 Tobias C. Berner freebsd_committer freebsd_triage 2020-03-08 15:33:07 UTC
Hm, is this actually still required? The port builds fine for me as is.

mfg Tobias
Comment 13 Yuichiro NAITO 2020-03-09 01:57:21 UTC
(In reply to Tobias C. Berner from comment #12)
> Hm, is this actually still required? The port builds fine for me as is

Yes, It's still required.
Please check following sequence how to reproduce.

How to reproduce:

  1. Make sure that devel/meson version >= 0.50
  2. Unset DAV1D option of devel/ffmpeg
  3. Make sure that dav1d is not installed
  4. Build multimedia/handbrake

I see that devel/meson version is 0.52.1 in ports/branches/2020Q1/devel/meson.
Quarterly branch has same problem, too.
Comment 14 Tobias C. Berner freebsd_committer freebsd_triage 2020-03-12 19:25:16 UTC
Committed. Thanks
Comment 15 commit-hook freebsd_committer freebsd_triage 2020-03-12 19:25:39 UTC
A commit references this bug:

Author: tcberner
Date: Thu Mar 12 19:25:04 UTC 2020
New revision: 528315
URL: https://svnweb.freebsd.org/changeset/ports/528315

Log:
  multimedia/handbrake: Fails to build against ffmpeg with DAV1D=off

  PR:		244432
  Submitted by:	Yuichiro NAITO <naito.yuichiro@gmail.com> (maintainer)
  Reported by:	Steve Peurifoy <ssw01@mathistry.net>

Changes:
  head/multimedia/handbrake/Makefile
  head/multimedia/handbrake/files/A01-src-meson-build.patch