Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 730034 - media-video/handbrake-1.3.3 USE=-x265 - src_compile(): ld: cannot find -lx265
Summary: media-video/handbrake-1.3.3 USE=-x265 - src_compile(): ld: cannot find -lx265
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Ian Whyman (thev00d00) (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-28 14:05 UTC by Davyd McColl
Modified: 2020-08-19 18:33 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Handbrake build log & environment (handbrake-1.3.3-diagnostics.zip,35.54 KB, application/zip)
2020-06-28 14:05 UTC, Davyd McColl
Details
Make x265 link conditional (handbrake-1.3.3-x265-link.patch,276 bytes, patch)
2020-07-03 10:23 UTC, LB
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Davyd McColl 2020-06-28 14:05:06 UTC
Created attachment 646988 [details]
Handbrake build log & environment

Handbrake 1.3.3 is failing to build on my machine. Tracing back through the logs, it looks like the problem stems from the last of these lines:

autoreconf-2.69: running: libtoolize --copy --force
libtoolize: putting auxiliary files in '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: putting macros in 'm4'.
libtoolize: copying file 'm4/libtool.m4'
libtoolize: copying file 'm4/ltoptions.m4'
libtoolize: copying file 'm4/ltsugar.m4'
libtoolize: copying file 'm4/ltversion.m4'
libtoolize: copying file 'm4/lt~obsolete.m4'
libtoolize: Consider adding 'AC_CONFIG_MACRO_DIRS([m4])' to configure.ac,
libtoolize: and rerunning libtoolize and aclocal.
/usr/lib/ccache/bin/g++ -pipe -Wl,-S -Wl,-O1 -Wl,--as-needed -fmessage-length=0 -Wall -Wno-format-truncation -g0 -O3 -march=native -
O2 -mfpmath=sse -msse2 -I./libhb/ -Iinclude -I/usr/include/libxml2 -o HandBrakeCLI -Wl,--start-group test/test.o test/parsecsv.o ./l
ibhb/libhandbrake.a -Llib -lass -lavformat -lavfilter -lavcodec -lavutil -lswresample -lpostproc -lmp3lame -ldvdnav -ldvdread -lfrib
idi -lswscale -lvpx -ltheoraenc -ltheoradec -lvorbis -lvorbisenc -logg -lx264 -lx265 -lbluray -lfreetype -lxml2 -lbz2 -lz -ljansson 
-lharfbuzz -lopus -lspeex -llzma -ldav1d -lfontconfig -lpthread -ldl -lm -Wl,--end-group
autoreconf-2.69: running: /usr/bin/autoconf-2.69 --force
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lx265
collect2: error: ld returned 1 exit status

It looks, to me like Handbrake is testing if it can link against x265, however I have that USE flag off (and it's off by default, if I can read correctly):

❯ equery u handbrake
[ Legend : U - final flag setting for installation]
[        : I - package is installed with flag     ]
[ Colors : set, unset                             ]
 * Found these USE flags for media-video/handbrake-1.3.3:
 U I
 + - fdk       : Support for encoding AAC using media-libs/fdk-aac.
 - - gstreamer : Support for the streaming media framework from media-libs/gstreamer.
 + + gtk       : Install the GTK UI, ghb.
 - - libav-aac : Support for encoding AAC using media-video/libav's internal encoder.
 - - numa      : Adds support for x265's NUMA capabilities.
 - - nvenc     : Adds support for NVIDIA Encoder (NVENC) API for hardware accelerated encoding on NVIDIA cards.
 - - x265      : Support for encoding h265 using media-libs/x265.

If I temporarily USE x265 (and add ACCEPT_KEYWORDS=~amd64 for media-libs/x265):

USE=x265 ACCEPT_KEYWORDS=~amd64 emerge -1 handbrake

Then handbrake merges in flawlessly. I don't use x265 and it takes a while to build, so if there's a USE flag to turn it off, I'd really appreciate it if it was observed (:
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2020-06-28 14:13:38 UTC
Comment on attachment 646988 [details]
Handbrake build log & environment

Please attach separate files next time.
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2020-06-28 14:19:19 UTC
It's doing weird cmake(?) things in src_configure(), then does the equivalent of an eautoreconf in src_compile() which triggers another round of ./configure without any flags. So that's probably it.
Comment 3 Gordon Bos 2020-07-02 07:47:30 UTC
Appears to be caused by patch handbrake-1.3.2-x265-link.patch. If you revert that patch right after the prepare phase handbrake builds without issues.
Comment 4 LB 2020-07-03 10:23:34 UTC
Created attachment 647478 [details, diff]
Make x265 link conditional

It looks like x265 link patch introduced an unconditional link dependency on x265. Attached patch is an attempt to make it link only when x265 is enabled.
Comment 5 Pavel Goran 2020-07-10 17:45:34 UTC
I encountered this problem, too. Replacing the existing handbrake-1.3.2-x265.patch patch with the attached one (handbrake-1.3.3-x265-link.patch) fixed it for me.
Comment 6 Larry the Git Cow gentoo-dev 2020-08-19 18:33:50 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dc51888cc64e6ce07980564274c180ddd0ffd9f6

commit dc51888cc64e6ce07980564274c180ddd0ffd9f6
Author:     Ben Kohler <bkohler@gentoo.org>
AuthorDate: 2020-08-19 18:33:06 +0000
Commit:     Ben Kohler <bkohler@gentoo.org>
CommitDate: 2020-08-19 18:33:40 +0000

    media-video/handbrake: add new x265 link patch & tweak DEPEND
    
    Closes: https://bugs.gentoo.org/730034
    Closes: https://bugs.gentoo.org/730544
    Package-Manager: Portage-3.0.4, Repoman-3.0.1
    Signed-off-by: Ben Kohler <bkohler@gentoo.org>

 .../files/handbrake-1.3.3-x265-link.patch          |  13 ++
 media-video/handbrake/handbrake-1.3.3-r1.ebuild    | 168 +++++++++++++++++++++
 2 files changed, 181 insertions(+)