Bug 199126 - multimedia/handbrake 0.10.1. fails to compile
Summary: multimedia/handbrake 0.10.1. fails to compile
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: Kurt Jaeger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-02 21:08 UTC by Walter Schwarzenfeld
Modified: 2015-04-20 19:06 UTC (History)
6 users (show)

See Also:


Attachments
patch to remove BROKEN and enable building with poudriere (1.90 KB, patch)
2015-04-11 14:14 UTC, Keith White
no flags Details | Diff
remove the handbrake contrib distribution version of lame (2.92 KB, patch)
2015-04-11 16:55 UTC, Keith White
no flags Details | Diff
fix building without X11 (2.92 KB, patch)
2015-04-12 20:38 UTC, Keith White
no flags Details | Diff
fresh patch to remove libvpx dependency with noX11 option (3.71 KB, patch)
2015-04-12 20:53 UTC, Keith White
no flags Details | Diff
Successful poudriere testport on FreeBSD 10.1 amd64 using patch from attachment 155525 (71.79 KB, application/x-gzip)
2015-04-13 13:28 UTC, Ben Woods
no flags Details
an installed version of x265 may conflict with handbrake's own version (457 bytes, patch)
2015-04-20 18:38 UTC, Keith White
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Walter Schwarzenfeld freebsd_triage 2015-04-02 21:08:39 UTC
hanbrake-0.10.1. fails to compile:

../contrib/ffmpeg/module.rules:2: recipe for target 'contrib/ffmpeg/.stamp.configure' failed
gmake[1]: *** [contrib/ffmpeg/.stamp.configure] Error 1
gmake[1]: Leaving directory '/wrkdirs/usr/ports/multimedia/handbrake/work/HandBrake-0.10.1/build'
*** Error code 1

I have commented out this two lines in the Makefile:

#  ${TOUCH} ${BUILD_WRKSRC}/contrib/libvpx/.stamp.extract
#  ${TOUCH} ${BUILD_WRKSRC}/contrib/x264/.stamp.extract

After this handbrake compiles fine and started. (I have not tested if it works correct).
Comment 1 Walter Schwarzenfeld freebsd_triage 2015-04-02 21:49:37 UTC
Seems this maybe the definite cause

I put in the Makefile under LIB_DEPENDS=
libvpx.so:${PORTSDIR}/multimedia/libvpx \
libx264.so:${PORTSDIR}/multimedia/libx264  

seems they are missed

and uncommented the two lines I commented out before

seems to work.
Comment 2 Walter Schwarzenfeld 2015-04-04 16:31:34 UTC
Did not know what changed. But know it seems it compiles in the port, but fails in poudriere with the same above posted error message.
Comment 3 commit-hook freebsd_committer freebsd_triage 2015-04-05 17:10:57 UTC
A commit references this bug:

Author: netchild
Date: Sun Apr  5 17:10:28 UTC 2015
New revision: 383305
URL: https://svnweb.freebsd.org/changeset/ports/383305

Log:
  Add libvpx and x264 dependency:
   - the bundled ffmpeg seems to want to use it despite libvpx being disabled
     in the handbrake patches
   - x264 comes bundled, but there are reports it's needed as a dependency so
     that the port builds, so better safe than sorry

  This allows to build the port by hand (make install in the port directory).

  The BROKEN line stays in, seems those changes don't make poudriere happy.

  PR:		199126
  Submitted by:	w.schwarzenfeld@utanet.at
  Discussed with:	olgeni

Changes:
  head/multimedia/handbrake/Makefile
Comment 4 Alexander Leidinger freebsd_committer freebsd_triage 2015-04-05 17:12:01 UTC
Committed.
This fixes the "by hand" builds, poudriere builds still needs a fix.
Comment 5 Keith White 2015-04-11 14:14:08 UTC
Created attachment 155475 [details]
patch to remove BROKEN and enable building with poudriere
Comment 6 Keith White 2015-04-11 14:20:38 UTC
Comment on attachment 155475 [details]
patch to remove BROKEN and enable building with poudriere

To enable package building with poudriere, cmake is now required to build, lame for runtime, and iconv for linking.  The handbrake library name has change from "hb" to "handbrake"
Comment 7 Walter Schwarzenfeld 2015-04-11 15:24:28 UTC
Sorry, but poudriere failed with

lib-depends - libmp3lame.so not found.

tried to change under DISTFILES=

the line
lame-3.98.tar.gz:contrib
to
lame-3.99.tar.gz:contrib
or
lame-3.99.5.tag.gz:contrib


but it could not fetch it.
Comment 8 Walter Schwarzenfeld 2015-04-11 15:29:41 UTC
forgot:
but
locate libmp3lame.so
/usr/local/lib/libmp3lame.so
/usr/local/lib/libmp3lame.so.0
/usr/local/lib/libmp3lame.so.0.0.0
Comment 9 Keith White 2015-04-11 16:47:49 UTC
What is your environment?

I verified with this ports tree (with patched Makefile):

Path: /usr/ports
Working Copy Root Path: /usr/ports
URL: svn://svn.freebsd.org/ports/head
Relative URL: ^/head
Repository Root: svn://svn.freebsd.org/ports
Repository UUID: 35697150-7ecd-e111-bb59-0022644237b5
Revision: 383683
Node Kind: directory
Schedule: normal
Last Changed Author: adamw
Last Changed Rev: 383683
Last Changed Date: 2015-04-09 18:17:26 -0400 (Thu, 09 Apr 2015)

In these jails:

101amd64  10.1-RELEASE-p9      amd64 ftp                2015-04-08 21:39:19 /usr/local/poudriere/jails/101amd64
101i386   10.1-RELEASE-p9      i386  ftp                2015-04-08 21:37:06 /usr/local/poudriere/jails/101i386
head      11.0-CURRENT r281300 amd64 svn                2015-04-10 23:20:44 /usr/local/poudriere/jails/head
Comment 10 Keith White 2015-04-11 16:55:12 UTC
Created attachment 155481 [details]
remove the handbrake contrib distribution version of lame

Since audio/lame is now needed to build, and handbrake doesn't build it's own copy of lame, remove it from makefile.
Comment 11 Keith White 2015-04-11 17:32:45 UTC
Comment on attachment 155481 [details]
remove the handbrake contrib distribution version of lame

>Index: multimedia/handbrake/Makefile
>===================================================================
>--- multimedia/handbrake/Makefile	(revision 383800)
>+++ multimedia/handbrake/Makefile	(working copy)
>@@ -14,7 +14,6 @@
> 		faad2-2.7.tar.gz:contrib \
> 		fdk-aac-v0.1.1-6-gbae4553.tar.bz2:contrib \
> 		libav-v10.1.tar.bz2:contrib \
>-		lame-3.98.tar.gz:contrib \
> 		libbluray-0.5.0.tar.bz2:contrib \
> 		libdca-r81-strapped.tar.gz:contrib \
> 		libdvdnav-5.0.1-0-gaa3659d.tar.gz:contrib \
>@@ -29,9 +28,8 @@
> 
> LICENSE=	GPLv2
> 
>-BROKEN=		Fails to build
>-
>-BUILD_DEPENDS=	yasm:${PORTSDIR}/devel/yasm
>+BUILD_DEPENDS=	yasm:${PORTSDIR}/devel/yasm \
>+		cmake:${PORTSDIR}/devel/cmake
> LIB_DEPENDS=	libfontconfig.so:${PORTSDIR}/x11-fonts/fontconfig \
> 		libfreetype.so:${PORTSDIR}/print/freetype2 \
> 		libfribidi.so:${PORTSDIR}/converters/fribidi \
>@@ -44,7 +42,8 @@
> 		libtheoraenc.so:${PORTSDIR}/multimedia/libtheora \
> 		libsamplerate.so:${PORTSDIR}/audio/libsamplerate \
> 		libvpx.so:${PORTSDIR}/multimedia/libvpx \
>-		libx264.so:${PORTSDIR}/multimedia/libx264
>+		libx264.so:${PORTSDIR}/multimedia/libx264 \
>+		libmp3lame.so:${PORTSDIR}/audio/lame
> .if !defined(PACKAGE_BUILDING)
> # DVDCSS version hardcoded in contrib/libdvdread/libdvdread/src/dvd_input.c (dlopen'ed)
> LIB_DEPENDS+=	libdvdcss.so.2:${PORTSDIR}/multimedia/libdvdcss
>@@ -106,7 +105,7 @@
> # considered good in FreeBSD.  Instead, we will prepare everything manually.
> post-extract: .SILENT
> # Unversioned directories can be copied in a loop
>-.for d in a52dec lame libdca x264
>+.for d in a52dec libdca x264
> 	${MKDIR} ${BUILD_WRKSRC}/contrib/${d}
> 	${MV} ${WRKDIR}/${d} ${BUILD_WRKSRC}/contrib/${d}
> .endfor
>@@ -130,7 +129,6 @@
> 	${TOUCH} ${BUILD_WRKSRC}/contrib/faad2/.stamp.extract
> 	${TOUCH} ${BUILD_WRKSRC}/contrib/fdkaac/.stamp.extract
> 	${TOUCH} ${BUILD_WRKSRC}/contrib/ffmpeg/.stamp.extract
>-	${TOUCH} ${BUILD_WRKSRC}/contrib/lame/.stamp.extract
> 	${TOUCH} ${BUILD_WRKSRC}/contrib/libbluray/.stamp.extract
> 	${TOUCH} ${BUILD_WRKSRC}/contrib/libdca/.stamp.extract
> 	${TOUCH} ${BUILD_WRKSRC}/contrib/libdvdnav/.stamp.extract
>@@ -151,6 +149,7 @@
> 	@${REINPLACE_CMD} \
> 		-e '/GHB_PACKAGES=/s/gthread-2.0/& gmodule-2.0/' \
> 		-e 's/-lhb/& ${ICONV_LIB}/' \
>+		-e 's/-lhandbrake/& ${ICONV_LIB}/' \
> 		-e 's:-lxml2:& ../../contrib/lib/libx265.a ../../contrib/lib/libfdk-aac.a:g' \
> 		${WRKSRC}/gtk/configure.ac
> 	@${REINPLACE_CMD} -e 's|<malloc|<stdlib|' ${WRKSRC}/libhb/fifo.c
>@@ -159,6 +158,7 @@
> 	@${REINPLACE_CMD} -e "s|ToolProbe( 'GCC.gcc',   'gcc',|ToolProbe( 'GCC.gcc',   '${CC}',|" \
> 		${WRKSRC}/make/configure.py
> 	@${REINPLACE_CMD} -e 's|avcodec avformat avutil avresample|avformat avcodec avresample avutil|' \
>+		-e 's|TEST.libs = $$(LIBHB.a)|& ${ICONV_LIB}|' \
> 		${WRKSRC}/libhb/module.defs ${WRKSRC}/test/module.defs
> 	@${TR} -d '\r' < ${WRKSRC}/contrib/ffmpeg/A06-frame-threading-state.patch > ${WRKDIR}/A06-frame-threading-state.patch
> 	@${MV} ${WRKDIR}/A06-frame-threading-state.patch ${WRKSRC}/contrib/ffmpeg/
Comment 12 Walter Schwarzenfeld 2015-04-11 17:43:41 UTC
removed line lame:contrib
and now:
mv: rename /wrkdirs/usr/ports/multimedia/handbrake/work/libdca to /wrkdirs/usr/ports/multimedia/handbrake/work/HandBrake-0.10.1/build/contrib/libdca/libdca: No such file or directory
Comment 13 Walter Schwarzenfeld 2015-04-11 17:51:50 UTC
I removed the jail and the default-port-tree, changed nothing.

101amd64 10.1-RELEASE-p9 amd64 ftp    2015-04-11 18:24:55 /usr/local/poudriere/jails/101amd64
Comment 14 Keith White 2015-04-11 18:01:00 UTC
(In reply to Walter Schwarzenfeld from comment #13)

You haven't said what ports tree you're using.  The svn info would be most helpful, i.e.

  svnlite info /usr/ports

Your current diff from the svn version would be helpful too.

  svnlite diff /usr/ports/multimedia/handbrake/Makefile

Failing that, cut-and-paste your current /usr/ports/multimedia/handbrake/Makefile
Comment 15 Walter Schwarzenfeld 2015-04-11 18:11:30 UTC
It's okay, worked now. Overlooked

-	${TOUCH} ${BUILD_WRKSRC}/contrib/lame/.stamp.extract
Comment 16 Keith White 2015-04-11 18:22:37 UTC
Good news!  I lost a few more hairs trying to work out what was wrong...

Perhaps netchild@ would consider committing the change.
Comment 17 Walter Schwarzenfeld 2015-04-11 18:25:47 UTC
Forgot to say thank you ;-))
Comment 18 Keith White 2015-04-12 20:38:22 UTC
Created attachment 155524 [details]
fix building without X11

Builds with noX11 fail with a dependency on libvpx.  So, to also fix the noX11 case, remove libvpx from configure files and makefile macro definitions.
Comment 19 Keith White 2015-04-12 20:53:34 UTC
Created attachment 155525 [details]
fresh patch to remove libvpx dependency with noX11 option

Sorry for all the noise!  firefox took the patch from cache instead of the hot-off-the-press version...

Sigh.
Comment 20 Ben Woods freebsd_committer freebsd_triage 2015-04-13 13:28:59 UTC
Created attachment 155541 [details]
Successful poudriere testport on FreeBSD 10.1 amd64 using patch from attachment 155525 [details]

I can confirm this latest patch allows handbrake to build correctly on FreeBSD 10.1 amd64 (see attached poudriere testport which has been gzipped to reduce to <1Mb).

I recommend re-opening this bug until this patch is commit (this bug is currently marked as closed -> fixed).
Comment 21 Kurt Jaeger freebsd_committer freebsd_triage 2015-04-13 14:30:57 UTC
reopened.
Comment 22 Kurt Jaeger freebsd_committer freebsd_triage 2015-04-13 15:50:29 UTC
poudriere builds fine on 10.1a, 9.3a, 8.4i, see

http://people.freebsd.org/~pi/logs/multimedia__handbrake-*

I'll commit the fix.
Comment 23 commit-hook freebsd_committer freebsd_triage 2015-04-13 16:01:36 UTC
A commit references this bug:

Author: pi
Date: Mon Apr 13 16:00:49 UTC 2015
New revision: 383927
URL: https://svnweb.freebsd.org/changeset/ports/383927

Log:
  multimedia/handbrake: fix build on 10.1a, 9.3a (and probably others)

  PR:		199126
  Submitted by:	kwhite@site.uottawa.ca

Changes:
  head/multimedia/handbrake/Makefile
Comment 24 Kurt Jaeger freebsd_committer freebsd_triage 2015-04-13 16:02:57 UTC
Thanks for the second patch! Committed!
Comment 25 Walter Schwarzenfeld 2015-04-19 22:41:41 UTC
update to handbrake-0.10.1_2

gmake[5]: Entering directory '/usr/ports/multimedia/handbrake/work/HandBrake-0.10.1/build/contrib/x265/x265-9329-0d30d2641875-1.5'
[  1%] Building CXX object encoder/CMakeFiles/encoder.dir/analysis.cpp.o
/usr/ports/multimedia/handbrake/work/HandBrake-0.10.1/build/contrib/x265/x265-9329-0d30d2641875-1.5/source/encoder/analysis.cpp:1070:28: error: 
      no member named 'bEnableCbfFastMode' in 'x265_param'
                (!m_param->bEnableCbfFastMode || md.bestMode->cu.getQtRo...
                  ~~~~~~~  ^
/usr/ports/multimedia/handbrake/work/HandBrake-0.10.1/build/contrib/x265/x265-9329-0d30d2641875-1.5/source/encoder/analysis.cpp:1124:31: error: 
      no member named 'bEnableCbfFastMode' in 'x265_param'
                if (!m_param->bEnableCbfFastMode || md.bestMode->cu.getQ...
                     ~~~~~~~  ^
/usr/ports/multimedia/handbrake/work/HandBrake-0.10.1/build/contrib/x265/x265-9329-0d30d2641875-1.5/source/encoder/analysis.cpp:1130:31: error: 
      no member named 'bEnableCbfFastMode' in 'x265_param'
                if (!m_param->bEnableCbfFastMode || md.bestMode->cu.getQ...
                     ~~~~~~~  ^
/usr/ports/multimedia/handbrake/work/HandBrake-0.10.1/build/contrib/x265/x265-9329-0d30d2641875-1.5/source/encoder/analysis.cpp:1156:35: error: 
      no member named 'bEnableCbfFastMode' in 'x265_param'
                    if (!m_param->bEnableCbfFastMode || md.bestMode->cu....
                         ~~~~~~~  ^
/usr/ports/multimedia/handbrake/work/HandBrake-0.10.1/build/contrib/x265/x265-9329-0d30d2641875-1.5/source/encoder/analysis.cpp:1162:35: error: 
      no member named 'bEnableCbfFastMode' in 'x265_param'
                    if (!m_param->bEnableCbfFastMode || md.bestMode->cu....
                         ~~~~~~~  ^
/usr/ports/multimedia/handbrake/work/HandBrake-0.10.1/build/contrib/x265/x265-9329-0d30d2641875-1.5/source/encoder/analysis.cpp:1171:35: error: 
      no member named 'bEnableCbfFastMode' in 'x265_param'
                    if (!m_param->bEnableCbfFastMode || md.bestMode->cu....
                         ~~~~~~~  ^
/usr/ports/multimedia/handbrake/work/HandBrake-0.10.1/build/contrib/x265/x265-9329-0d30d2641875-1.5/source/encoder/analysis.cpp:1177:35: error: 
      no member named 'bEnableCbfFastMode' in 'x265_param'
                    if (!m_param->bEnableCbfFastMode || md.bestMode->cu....
                         ~~~~~~~  ^
/usr/ports/multimedia/handbrake/work/HandBrake-0.10.1/build/contrib/x265/x265-9329-0d30d2641875-1.5/source/encoder/analysis.cpp:1187:28: error: 
      no member named 'bEnableCbfFastMode' in 'x265_param'
                (!m_param->bEnableCbfFastMode || md.bestMode->cu.getQtRo...
                  ~~~~~~~  ^
8 errors generated.
encoder/CMakeFiles/encoder.dir/build.make:54: recipe for target 'encoder/CMakeFiles/encoder.dir/analysis.cpp.o' failed
gmake[5]: *** [encoder/CMakeFiles/encoder.dir/analysis.cpp.o] Error 1
gmake[5]: Leaving directory '/usr/ports/multimedia/handbrake/work/HandBrake-0.10.1/build/contrib/x265/x265-9329-0d30d2641875-1.5'
CMakeFiles/Makefile2:173: recipe for target 'encoder/CMakeFiles/encoder.dir/all' failed
gmake[4]: *** [encoder/CMakeFiles/encoder.dir/all] Error 2
gmake[4]: Leaving directory '/usr/ports/multimedia/handbrake/work/HandBrake-0.10.1/build/contrib/x265/x265-9329-0d30d2641875-1.5'
Makefile:117: recipe for target 'all' failed
gmake[3]: *** [all] Error 2
gmake[3]: Leaving directory '/usr/ports/multimedia/handbrake/work/HandBrake-0.10.1/build/contrib/x265/x265-9329-0d30d2641875-1.5'
../contrib/x265/module.rules:2: recipe for target 'contrib/x265/.stamp.build' failed
gmake[2]: *** [contrib/x265/.stamp.build] Error 2
gmake[2]: Leaving directory '/usr/ports/multimedia/handbrake/work/HandBrake-0.10.1/build'
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/multimedia/handbrake
*** Error code 1

Stop.
make: stopped in /usr/ports/multimedia/handbrake
Comment 26 Walter Schwarzenfeld 2015-04-20 01:48:36 UTC
the errors in /usr/ports/multimedia/handbrake/work/HandBrake-0.10.1/build/contrib/x265/x265-9329-0d30d2641875-1.5/source/encoder/analysis.cpp can fixed 

like described here:
https://mailman.videolan.org/pipermail/x265-commits/2015-February/000509.html

but after this, there are errors in 
/usr/ports/multimedia/handbrake/work/HandBrake-0.10.1/build/contrib/x265/x265-9329-0d30d2641875-1.5/source/encoder/encoder.cpp 

for this I know no fix.
Comment 27 Walter Schwarzenfeld 2015-04-20 02:20:26 UTC
Forgot to say, I don't use the whole patch from pipermail, I edited the analysis.cpp per hand.
Comment 28 Walter Schwarzenfeld 2015-04-20 10:24:48 UTC
I noticed it compiles with poudriere.
Comment 29 Walter Schwarzenfeld 2015-04-20 11:45:34 UTC
It seems have something to do with the update of multimedia/x265 to 1.6.
If I downgrade handbrake and try to compile it in the port it does not work. If I downgrade handbrake and x265 it works.
Comment 30 Keith White 2015-04-20 18:38:58 UTC
Created attachment 155778 [details]
an installed version of x265 may conflict with handbrake's own version

handbrake likes to use its own libraries and may not behave if a conflicting library has been installed.  You need to deinstall multimedia/x265 before building.  The attached patch will make this explicit.
Comment 31 commit-hook freebsd_committer freebsd_triage 2015-04-20 19:06:45 UTC
A commit references this bug:

Author: pi
Date: Mon Apr 20 19:05:52 UTC 2015
New revision: 384379
URL: https://svnweb.freebsd.org/changeset/ports/384379

Log:
  multimedia/handbrake: register CONFLICTS_BUILD with x265

  handbrake does not build if multimedia/x265 is installed

  PR:		199126
  Submitted by:	Walter Schwarzenfeld <w.schwarzenfeld@aon.at>

Changes:
  head/multimedia/handbrake/Makefile