Bug 251044 - multimedia/handbrake: Fails to build: dav1d not found
Summary: multimedia/handbrake: Fails to build: dav1d not found
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-11-11 10:58 UTC by Mike Cui
Modified: 2021-01-19 06:37 UTC (History)
2 users (show)

See Also:
naito.yuichiro: maintainer-feedback+


Attachments
Updated file/patch-contrib_ffmpeg_module.defs (664 bytes, patch)
2020-11-11 10:58 UTC, Mike Cui
no flags Details | Diff
handbrake-1.3.3_3.patch (1.24 KB, patch)
2020-11-13 02:51 UTC, Yuichiro NAITO
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Cui 2020-11-11 10:58:13 UTC
Created attachment 219548 [details]
Updated file/patch-contrib_ffmpeg_module.defs

Similar to bug #244432, this time it's a different error.

When ffmpeg/configure script tests for dav1d, it gets a linker error due to libpthread not being linked in. Upon further inspection, it seems that dav1d.pc generated has -pthread in Libs.private. pkg-config assume you are linking dynamically, so private dependencies are not included by default. But they are required for static linking.

Fix is to pass in --pkg-config-flags=--static to ffmpeg's configure script.

I've attached the fix. It's an updated file/patch-contrib_ffmpeg_module.defs
(It's not a patch of a patch).
Comment 1 Yuichiro NAITO 2020-11-12 02:13:28 UTC
I could see the build failure unless multimedia/dav1d is installed from ports.
Let me take a couple of days to consider your patch.
Comment 2 Yuichiro NAITO 2020-11-13 02:51:04 UTC
Created attachment 219620 [details]
handbrake-1.3.3_3.patch
Comment 3 Yuichiro NAITO 2020-11-13 02:52:57 UTC
`dav1d.pc` is generated by meson and meson 0.56.0 has changed to put `-pthread`
in `Libs.private`. The previous meson version 0.55.3 doesn't do this way.

ffmpeg libraries are statically linked to HandBrake binary.
So as Mike says, it is good solution that adding `--pkg-config-flags=--static`
to ffmpeg configure option.

I generated a patch file from Mike's code.
Please apply `handbrake-1.3.3_3.patch` to Ports tree.

To clarify how to reproduce this problem:

1. uninstall multimedia/dav1d
   # pkg delete -f dav1d

2. make sure meson version is 0.56.0
   # meson --version
   0.56.0

3. build multimedia/handbrake
Comment 4 Mike Cui 2020-12-01 05:45:05 UTC
Updates? Can your patch be merged?
Comment 5 Yuichiro NAITO 2020-12-01 06:09:30 UTC
(In reply to Mike Cui from comment #4)
I'm looking for a committer.
I talked about this PR with hrs@.
Maybe He will help us.
Comment 6 Mike Cui 2020-12-20 04:46:10 UTC
Bump
Comment 7 commit-hook freebsd_committer freebsd_triage 2021-01-19 06:32:13 UTC
A commit references this bug:

Author: hrs
Date: Tue Jan 19 06:31:43 UTC 2021
New revision: 562028
URL: https://svnweb.freebsd.org/changeset/ports/562028

Log:
  - Fix build when multimedia/dav1d is not installed.  This can happen
    when multimedia/ffmpeg is compiled with no DAV1D option.

  - Split mkdir ${WRKSRC}/download from copying files into it.

  Submitted by:	Mike Cui
  Approved by:	Yuichiro NAITO (maintainer)
  PR:		251044

Changes:
  head/multimedia/handbrake/Makefile
  head/multimedia/handbrake/files/patch-contrib_ffmpeg_module.defs
Comment 8 Hiroki Sato freebsd_committer freebsd_triage 2021-01-19 06:37:54 UTC
Fixed in r562028.  Please reopen this PR if this problem persists.  Thank you for your report and apologies for the long delay.