Circular dependency, because x264 links ffmpeg

Kevin Oberman rkoberman at gmail.com
Wed Mar 5 03:02:28 UTC 2014


On Tue, Mar 4, 2014 at 1:22 PM, Jan Henrik Sylvester <me at janh.de> wrote:

> # pkg info -r ffmpeg
> ffmpeg-2.1.1_1,1:
>         libxine-1.2.4_5
>         vlc-2.1.2_2,4
>         libstreamanalyzer-0.7.8_3
>         x264-0.136.2358_3
> # pkg info -r x264
> x264-0.136.2358_3:
>         ffmpeg-2.1.1_1,1
>         ffmpeg0-0.7.16_1,1
>         opal-3.10.10_2
>         vlc-2.1.2_2,4
>
> Not good. Since multimedia/ffmpeg depends on multimedia/x264 by default
> (the option X264 is enabled by default), my x264 installation must be
> broken.
>
> After forcibly deleting x264 and rebuilding the port, it still depends
> on ffmpeg:
>
> # pkg which /usr/local/bin/x264
> /usr/local/bin/x264 was installed by package x264-0.136.2358_3
> # readelf -d /usr/local/bin/x264 | grep libav
>  0x0000000000000001 (NEEDED)             Shared library: [libavutil.so.52]
> # pkg which /usr/local/lib/libavutil.so.52
> /usr/local/lib/libavutil.so.52 was installed by package ffmpeg-2.1.1_1,1
>
> The x264 port is doing something wrong (in the presence of ffmpeg).
>
> This will probably only happening building ports in an unclean
> environment, but I would have expected pkg to detect this and warn while
> registering the pkg, while creating a package from it, or while this
> package is installed on another machine. I never saw a warning.
>

I'm confused. When I look at the Makefile for  x264, I can't see ny reason
that it would depend on ffmpeg. It has no direct dependency.  As far as
indirect ones, I see libX11, gcc-4.6, gpac-libgpac-0.5.0,1.

When configuring, I see:
===>   x264-0.136.2358_3 depends on package: yasm>=0.6.0 - found
===>   x264-0.136.2358_3 depends on file: /usr/local/bin/bash - found
===>   x264-0.136.2358_3 depends on executable: gmake - found
===>   x264-0.136.2358_3 depends on executable: gcc46 - found
===>   x264-0.136.2358_3 depends on file: /usr/local/bin/as - found
===>   x264-0.136.2358_3 depends on file:
/usr/local/libdata/pkgconfig/x11.pc - found
===>   x264-0.136.2358_3 depends on shared library: libgpac.so - found

But I see that it links to libavformat, libavcodec, and libavutil, all part
of ffmpeg.

Oddly, my 9.2 system has no dependency on ffmpeg:
> pkg_info -r x264-\* (y|n|e)?yes
Information for x264-0.136.2358_3:

Depends on:
Dependency: openssl-1.0.1_9
Dependency: png-1.5.18
Dependency: jpeg-8_4
Dependency: gpac-libgpac-0.5.0,1

Looking through the build log I can only see the final link of the x264
does pull in all of those libs. Note that lib264 has no dependency on
ffmpeg. It is the x264 executable that uses it.

I think the only fix would be to split the port into building the library
in one port (libx264) and the utility in another (x264).

-- 
R. Kevin Oberman, Network Engineer, Retired
E-mail: rkoberman at gmail.com


More information about the freebsd-ports mailing list