Bug 218384 - multimedia/handbrake: update 0.10.5_5 -> 1.0.3
Summary: multimedia/handbrake: update 0.10.5_5 -> 1.0.3
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Kurt Jaeger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-05 00:27 UTC by Vladimir Omelchuk
Modified: 2017-04-14 01:04 UTC (History)
6 users (show)

See Also:


Attachments
info_handbrake.diff (1.53 KB, patch)
2017-04-08 19:38 UTC, Walter Schwarzenfeld
no flags Details | Diff
svn-diff-handbrake (1.20 KB, patch)
2017-04-09 02:04 UTC, Walter Schwarzenfeld
no flags Details | Diff
patch for handbrake/files/patch-contrib_libbluray_A02-expose-clip__id.patch (601 bytes, patch)
2017-04-09 07:40 UTC, Yuichiro NAITO
no flags Details | Diff
svn diff to Makefile and patch-contrib_libbluray_A02-expose-clip__id.patch (1.98 KB, patch)
2017-04-09 17:04 UTC, rkoberman
no flags Details | Diff
patch-Makefile_CCACHE_option (848 bytes, patch)
2017-04-09 21:46 UTC, Walter Schwarzenfeld
no flags Details | Diff
svn-diff-handbrake-1.0.7 (2.03 KB, patch)
2017-04-10 12:04 UTC, Walter Schwarzenfeld
no flags Details | Diff
svn-diff-handbrake-1.0.7 (2.34 KB, patch)
2017-04-10 12:12 UTC, Walter Schwarzenfeld
no flags Details | Diff
patch_handbrake-1.0.7_svn_r438214.diff (2.10 KB, patch)
2017-04-11 01:36 UTC, Vladimir Omelchuk
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Omelchuk 2017-04-05 00:27:51 UTC
Part of log:
[…]
patching file src/libbluray/bluray.c
patching file src/libbluray/bluray.h
can't find file to patch at input line 40
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|-- 
|2.5.5
|
|--- Makefile.in.orig	2017-03-25 19:30:14 UTC
|+++ Makefile.in	2017-03-25 19:30:36 UTC
--------------------------
No file to patch.  Skipping patch.
1 out of 1 hunk ignored
gmake[2]: *** [../contrib/libbluray/module.rules:2: contrib/libbluray/.stamp.patch] Error 1
gmake[2]: Leaving directory '/usr/ports/multimedia/handbrake/work/HandBrake-1.0.3/build'
*** Error code 1

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

Stop.
make: stopped in /usr/ports/multimedia/handbrake
** Command failed [exit code 1]: /usr/bin/script -qa /tmp/portupgrade20170405-69808-k1rjte env UPGRADE_TOOL=portupgrade UPGRADE_PORT=handbrake-0.10.5_5 UPGRADE_PORT_VER=0.10.5_5 make DISABLE_VULNERABILITIES=yes
** Fix the problem and try again.
** Listing the failed packages (-:ignored / *:skipped / !:failed)
	! multimedia/handbrake (handbrake-0.10.5_5)	(unknown build error)

<uname>
FreeBSD 10.3-RELEASE-p17 amd64

<make.conf>
CPUTYPE?=core2
OPTIONS_SET=CUPS
WITHOUT_LPR=YES
DEFAULT_VERSIONS+=apache=2.4
QT4_OPTIONS=CUPS NAS QGTKSTYLE
LOCALIZED_LANG=ru
MAKE_JOBS_UNSAFE=yes
DEFAULT_VERSIONS+=mysql=5.7
.if ${.CURDIR:M*/ports/devel/ccache}
NO_CCACHE=yes
.endif
DEFAULT_VERSIONS+=ssl=openssl
CC=clang40
CXX=clang++40
CPP=clang-cpp40
.if ${.CURDIR:M*/emulators/linux-c6}
OPTIONS_SET=NVIDIA_GL
.endif
.if ${.CURDIR:M*/graphics/linux-c6-glx-utils}
OPTIONS_SET=NVIDIA_GL
.endif
.if ${.CURDIR:M*/x11-toolkits/linux-c6-qt47-x11}
OPTIONS_SET=NVIDIA_GL
.endif
DEFAULT_VERSIONS+=samba=4.3
Comment 1 rkoberman 2017-04-07 20:10:50 UTC
Please update this to "Affects some people". 

I see the same issue with the build of libbluray. I will also suggest using "MAKE_JOBS_UNSAFE=yes" or the error will be found many, many lines before the failure is noted after it reaches a job barrier.
Comment 2 Vladimir Omelchuk 2017-04-07 20:43:10 UTC
(In reply to rkoberman from comment #1)

Done.
Comment 3 Walter Schwarzenfeld 2017-04-08 01:47:32 UTC
Change in files/patch-contrib_libbluray_A02-expose-clip__id.patch  to
--- ../libbluray-0.9.3/Makefile.in.orig 2017-04-07 23:29:29 UTC
+++ ../libbluray-0.9.3/Makefile.in

-----
Anywhere is to set 
#define HAVE_SYS_TIME_H 1

and

#ifndef __XSI_VISIBLE
#define __XSI_VISIBLE 700 /* for gettimeofday() */
#endif

but I found not where, yet.
Comment 4 Thomas Zander freebsd_committer freebsd_triage 2017-04-08 11:12:15 UTC
Is this only a problem with portupgrade? What happens if the port is build in the conventional way?
Comment 5 Walter Schwarzenfeld 2017-04-08 11:18:16 UTC
Same error in the port.
gettimeofday seems a special problem. I am nearly make src/utils/time.c empy and got still
implicit declaration of function 'gettimeofday' is invalid in C99. (This try there was no gettimeofday in it!).
Comment 6 Vladimir Omelchuk 2017-04-08 14:42:16 UTC
(In reply to Thomas Zander from comment #4)

http://www.freshports.org/
Sat, 8 Apr 2017
[ 13:57 riggs ] Original commit   Revision:438044
handbrake 1.0.3_1 multimedia
    Remove superfluous bits from testing from Makefile

# pkg version -v | grep handbrake
handbrake-0.10.5_5                 <   needs updating (index has 1.0.3_1)

Same error in the port:
[...]
Install the project...
-- Install configuration: "Release"
-- Installing: /usr/ports/multimedia/handbrake/work/HandBrake-1.0.3/build/contrib/lib/libx265.a
-- Installing: /usr/ports/multimedia/handbrake/work/HandBrake-1.0.3/build/contrib/include/x265.h
-- Installing: /usr/ports/multimedia/handbrake/work/HandBrake-1.0.3/build/contrib/include/x265_config.h
-- Installing: /usr/ports/multimedia/handbrake/work/HandBrake-1.0.3/build/contrib/lib/pkgconfig/x265.pc
gmake[3]: Leaving directory '/usr/ports/multimedia/handbrake/work/HandBrake-1.0.3/build/contrib/x265/x265_2.1'
touch contrib/x265/.stamp.install
/bin/mkdir -p contrib/libbluray/
sha256 (../download/libbluray-0.9.3.tar.bz2) = a6366614ec45484b51fe94fcd1975b3b8716f90f038a33b24d59978de3863ce0 (pass)
/bin/rm -fr ./contrib/libbluray/libbluray-0.9.3/
/usr/local/bin/gtar xfC ../download/libbluray-0.9.3.tar.bz2 ./contrib/libbluray/
touch contrib/libbluray/.stamp.extract
/usr/local/bin/gpatch -t -N -p1 -d ./contrib/libbluray/libbluray-0.9.3/ < ../contrib/libbluray/A02-expose-clip_id.patch
patching file src/libbluray/bluray.c
patching file src/libbluray/bluray.h
can't find file to patch at input line 40
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|-- 
|2.5.5
|
|--- Makefile.in.orig	2017-03-25 19:30:14 UTC
|+++ Makefile.in	2017-03-25 19:30:36 UTC
--------------------------
No file to patch.  Skipping patch.
1 out of 1 hunk ignored
gmake[2]: *** [../contrib/libbluray/module.rules:2: contrib/libbluray/.stamp.patch] Error 1
gmake[2]: Leaving directory '/usr/ports/multimedia/handbrake/work/HandBrake-1.0.3/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 7 Walter Schwarzenfeld 2017-04-08 15:43:31 UTC
Same problem after r438044.
It is any path problem.

But it compiles with poudriere without problems.
Comment 8 Walter Schwarzenfeld 2017-04-08 17:13:16 UTC
Seems the build directory does not exist in the moment as make patch runs. (I don't know how poudriere
this handled).
Comment 9 Walter Schwarzenfeld 2017-04-08 19:38:04 UTC
Created attachment 181607 [details]
info_handbrake.diff
Comment 10 Walter Schwarzenfeld 2017-04-08 19:39:10 UTC
I don't really believe this changes will accepted, but for info I posted this attachment.
Got handbrake compile in the port with this changes.
Comment 11 Vladimir Omelchuk 2017-04-08 19:54:45 UTC
(In reply to w.schwarzenfeld from comment #10)

Patch is fine and handbrake-1.0.3_1 build without any erorrs!
Thanks!

# pkg version -v | grep handbrake
handbrake-1.0.3_1                  =   up-to-date with index
Comment 12 rkoberman 2017-04-08 23:03:31 UTC
Still no joy for me. I am getting the same error that  contrib/libbluray/Makefile.in.

/usr/local/bin/gpatch -t -N -p1 -d ./contrib/libbluray/libbluray-0.9.3/ < ../contrib/libbluray/A02-expose-clip_id.patch
patching file src/libbluray/bluray.c
patching file src/libbluray/bluray.h
can't find file to patch at input line 40
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|-- 
|2.5.5
|
|--- Makefile.in.orig	2017-03-25 19:30:14 UTC
|+++ Makefile.in	2017-03-25 19:30:36 UTC
--------------------------
No file to patch.  Skipping patch.
1 out of 1 hunk ignored
gmake[2]: *** [../contrib/libbluray/module.rules:2: contrib/libbluray/.stamp.patch] Error 1

I do find Makefile.in in the libbluray-0.9.3 directory, so it looks like it should have worked, but no luck. Tried with MAKE_JOBS_UNSAFE with no improvement. Why it finds the two other files but not the Makefile.in, I don't understand.
# ls Makefile.in src/libbluray/bluray.c src/libbluray/bluray.h
Makefile.in		src/libbluray/bluray.c	src/libbluray/bluray.h
# pwd
/usr/ports/multimedia/handbrake/work/libbluray-0.9.3
Comment 13 Walter Schwarzenfeld 2017-04-08 23:42:01 UTC
The version 1.3.0_1 ?
Comment 14 Walter Schwarzenfeld 2017-04-09 02:04:32 UTC
Created attachment 181612 [details]
svn-diff-handbrake
Comment 15 Walter Schwarzenfeld 2017-04-09 02:06:22 UTC
Had problems with poudriere and CCACHE. Added NO_CCACHE=yes. So I had
less changes in the Makefiles and it compiles in the port and with poudriere.
Comment 16 Yuichiro NAITO 2017-04-09 02:27:21 UTC
Thanks for more information.

Finally I could reproduce this error,
after I install gnu patch (pkg install patch).

Will you try the following patch?

```
Index: files/patch-contrib_libbluray_A02-expose-clip__id.patch
===================================================================
--- files/patch-contrib_libbluray_A02-expose-clip__id.patch	(revision 438075)
+++ files/patch-contrib_libbluray_A02-expose-clip__id.patch	(working copy)
@@ -4,8 +4,8 @@
  --
  2.5.5

-+--- Makefile.in.orig	2017-03-25 19:30:14 UTC
-++++ Makefile.in	2017-03-25 19:30:36 UTC
++--- a/Makefile.in	2017-03-25 19:30:14 UTC
+++++ b/Makefile.in	2017-03-25 19:30:36 UTC
 +@@ -772,7 +772,7 @@
 + MOSTLYCLEANFILES = $(DX_CLEANFILES)
 + @ENABLE_UDF_FALSE@POSIX_C_SOURCE = 200112L
```

`contrib/libbluray/A02-expose-clip_id.patch` is a patch file
to libbluray which is written in git style diff.

I need to write `patch-contrib_libbluray_A02-expose-clip__id.patch`
in the same style that gnu patch understand.

Bsd patch can understand different styles in the same patch.
Comment 17 rkoberman 2017-04-09 03:38:25 UTC
Is that the complete patch? I tried using it to patch the patch file in handbrake/files and to replace it. Neither worked.

It looks a bit truncated to me, but, when I replaced the patch file in files, it did not generate the file not found error I had been seeing. Is that all you were looking for?This is the error I got:
src/util/time.c: In function '_bd_get_scr_impl':
src/util/time.c:58:5: error: implicit declaration of function 'gettimeofday' [-Werror=implicit-function-declaration]
     gettimeofday(&tv, 0);
     ^
cc1: some warnings being treated as errors
gmake[4]: *** [Makefile:1503: src/util/time.lo] Error 1
gmake[4]: Leaving directory '/usr/ports/multimedia/handbrake/work/HandBrake-1.0.3/build/contrib/libbluray/libbluray-0.9.3'
gmake[3]: *** [Makefile:919: all] Error 2
gmake[3]: Leaving directory '/usr/ports/multimedia/handbrake/work/HandBrake-1.0.3/build/contrib/libbluray/libbluray-0.9.3'
gmake[2]: *** [../contrib/libbluray/module.rules:3: contrib/libbluray/.stamp.build] Error 2
Comment 18 Yuichiro NAITO 2017-04-09 05:21:31 UTC
(In reply to rkoberman from comment #17)
> Is that the complete patch?

No, it isn't.
Please apply my patch in multimedia/handbrake.

```
$ cd /usr/ports/multimedia/handbrake
$ patch < my_handbrake.patch
```

HandBrake build process is complicated.

HandBrake has a patch file of libbluray except for source files.
Makefile of this port provides the source archive before `make build`.
That is `libbluray-0.9.3.tar.bz2`.

To compile libbluray and avoid 'gettimeofday' error (you mentioned above),
I needed to add `-D_XOPEN_SOURCE=700` in `Makefile.in` of libbluray.

But how do I make a patch for it?
HandBrake has no source files of libbluray.
So I made a patch for the libbluray patch.

But I made a mistake of the patch format that GNU patch doesn't understand.
Comment 19 rkoberman 2017-04-09 06:20:57 UTC
Here is what I get when attempting to appy the patch:
Patching file patch-contrib_libbluray_A02-expose-clip__id.patch using Plan A...
Hunk #1 failed at 4.
1 out of 1 hunks failed--saving rejects to patch-contrib_libbluray_A02-expose-clip__id.patch.rej
done

So no joy at all.

I understand the problem. Seems like there needs to be a standard format for patch files. Diffs can come in any format, but one needs to get the One True patch format. This one is really, really a pain to deal with. I am somewhat familiar with the way that this gets built from my sad attempts to build a port for this.

I'll happily keep testing as much as I can and provide whatever help I can, but it's beyond my capabilities, I fear, to contribute much more.
Comment 21 Yuichiro NAITO 2017-04-09 07:40:46 UTC
Created attachment 181615 [details]
patch for handbrake/files/patch-contrib_libbluray_A02-expose-clip__id.patch
Comment 22 Yuichiro NAITO 2017-04-09 07:44:21 UTC
I'm sorry that I was absent minded about how to send my patch.
I was thinking only fixing my code.
I attached my patch as
'patch for handbrake/files/patch-contrib_libbluray_A02-expose-clip__id.patch'.
Will you download this file?
Comment 23 Yuichiro NAITO 2017-04-09 08:03:21 UTC
(In reply to Kurt Jaeger from comment #20)
How about handbrake-1.0.3_1 ?
Comment 24 Walter Schwarzenfeld 2017-04-09 08:36:33 UTC
(In reply to naito.yuichiro from comment #21)
Are you sure you send the right file? -D_XOPEN_SOURCE=700 is missing in your patch.
But it is already in the original patch.

What needed  is: NO_CCACHE=yes (if you use CCACHE) and the change of the path
to Makefile.in.
 (--build=${WRKSRC}/build could be removed from my patch. It is not needed.
I needed it before I added NO_CCACHE=yes - But you can keep it, with no problems).
Comment 25 Kurt Jaeger freebsd_committer freebsd_triage 2017-04-09 08:47:57 UTC
Folks, I'm confused. Please provide me with a consolidated patch from
the current version in the port to the new version you all yearn for 8-}
Comment 26 rkoberman 2017-04-09 17:04:00 UTC
Created attachment 181619 [details]
svn diff to Makefile and patch-contrib_libbluray_A02-expose-clip__id.patch

svn diff patch to make handbrake build. It fixes the patch to A02-expose-clip__id.patch, adds "desktop-file-utils" to USES for X11. and adds "NO_CCACHE=yes" to the MAKE_ENV.
Comment 27 Thomas Zander freebsd_committer freebsd_triage 2017-04-09 17:10:31 UTC
(In reply to rkoberman from comment #26)

It really shouldn't be necessary to define NO_CCACHE=yes globally. It works for many, especially the poudriere builders.
Comment 28 Kurt Jaeger freebsd_committer freebsd_triage 2017-04-09 17:12:34 UTC
testbuilds@work
Comment 29 rkoberman 2017-04-09 17:16:20 UTC
(In reply to Thomas Zander from comment #27)

This was based on Walter's statement (several times) that it would not build with ccache. Since I don't use ccache, I can't confirm or deny its affect.
Comment 30 commit-hook freebsd_committer freebsd_triage 2017-04-09 18:13:50 UTC
A commit references this bug:

Author: pi
Date: Sun Apr  9 18:13:04 UTC 2017
New revision: 438110
URL: https://svnweb.freebsd.org/changeset/ports/438110

Log:
  multimedia/handbrake: fix build after update to 1.0.3

  PR:		218384
  Submitted by:	Walter Schwarzenfeld <w.schwarzenfeld@utanet.at>
  Reported by:	Vladimir Omelchuk <admin@vladiom.com.ua>
  Reviewed by:	naito.yuichiro@gmail.com, rkoberman@gmail.com

Changes:
  head/multimedia/handbrake/Makefile
  head/multimedia/handbrake/files/patch-contrib_libbluray_A02-expose-clip__id.patch
Comment 31 Kurt Jaeger freebsd_committer freebsd_triage 2017-04-09 18:22:41 UTC
The version committed does not have the MAKE_ENV change for NO_CCACHE.

If there's anything left to do, please speak up, otherwise I'll close this ticket in 24 hours.
Comment 32 Walter Schwarzenfeld 2017-04-09 18:41:59 UTC
Does not work with CCACHE. MAKE_ENV=NO_CCACHE=yes also not working (I did not
find it in an other port)..
NO_CCACHE=yes globally is working.
Comment 33 Walter Schwarzenfeld 2017-04-09 18:44:02 UTC
Error Message:
/usr/local/bin/ld: /ram/usr/ports/multimedia/handbrake/work/HandBrake-1.0.3/build/contrib/lib/libavresample.a(audio_convert.o): undefined reference to symbol 'lrintf@@FBSD_1.0'
//lib/libm.so.5: error adding symbols: DSO missing from command line
clang: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[5]: *** [Makefile:544: ghb] Error 1
gmake[5]: Leaving directory '/ram/usr/ports/multimedia/handbrake/work/HandBrake-1.0.3/build/gtk/src'
.......
Comment 34 Vladimir Omelchuk 2017-04-09 18:45:40 UTC
(In reply to Kurt Jaeger from comment #31)

# pkg version -v | grep handbrake
handbrake-1.0.3_1                  <   needs updating (index has 1.0.3_2)

I use ccache and I did not have problems with upgrading to 1.0.3_2.

# pkg version -v | grep handbrake
handbrake-1.0.3_2                  =   up-to-date with index

# uname -srm
FreeBSD 10.3-RELEASE-p17 amd64

Thanks to all!
Comment 35 Kurt Jaeger freebsd_committer freebsd_triage 2017-04-09 18:49:34 UTC
(In reply to w.schwarzenfeld from comment #32)
I have no way to test with CCACHE, who would be the expert to talk to 8-} ?
Comment 36 Walter Schwarzenfeld 2017-04-09 21:46:41 UTC
Created attachment 181621 [details]
patch-Makefile_CCACHE_option
Comment 37 Walter Schwarzenfeld 2017-04-09 21:47:21 UTC
The simpelst way to solve the problem is a CCACHE option.
Comment 38 Walter Schwarzenfeld 2017-04-10 12:04:58 UTC
Created attachment 181649 [details]
svn-diff-handbrake-1.0.7
Comment 39 Walter Schwarzenfeld 2017-04-10 12:11:24 UTC
In the meantime an update to 1.0.7 exists.

ChangeLog:
### All platforms

#### Video

- Fixed decoding of raw video in Matroska/MKV
- Fixed time stamp handling for containerless raw video
- Fixed memory leaks in OpenCL
- Fixed x265 2-pass encoding where video frame rate is altered by filters
- Improved handling of very small amounts of sync jitter (~1 tick)
- Improved handling of AVI files with broken indices

#### Audio

- Further refined fix for Libav crash encoding AAC at very high bitrates

#### Subtitles

- Removed fontconfig dependency on Mac and Windows; libass now uses CoreText/DirectWrite
- Improved subtitle font selection when burning in SRT/SSA subtitles

#### Command line interface

- Fixed preset subtitle burn defaults override

#### Build system

- Updated MinGW-w64 build script for improved compatibility with hardened GCC
------------------
Comment 40 Walter Schwarzenfeld 2017-04-10 12:12:08 UTC
Created attachment 181650 [details]
svn-diff-handbrake-1.0.7
Comment 41 Walter Schwarzenfeld 2017-04-10 12:13:15 UTC
Had to correct the patch cause of portlint.
Test builds with poudriere 10.3amd64/i386 ok.
Comment 42 Vladimir Omelchuk 2017-04-11 01:36:40 UTC
Created attachment 181672 [details]
patch_handbrake-1.0.7_svn_r438214.diff

Patch for update handbrake-1.0.3_2 (svn revision 438214) to 1.0.7 without CCACHE option in the Makefile.

I use ccache and I did not have problems with upgrading to 1.0.7!

# pkg version -v | grep -e handbrake -e ccache
ccache-3.3.4_3                     =   up-to-date with index
handbrake-1.0.7                    >   succeeds index (index has 1.0.3_2)

# env | grep ^PATH
PATH=/usr/local/libexec/ccache:/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/root/bin

# uname -srm
FreeBSD 10.3-RELEASE-p17 amd64
Comment 43 Yuichiro NAITO 2017-04-11 05:11:25 UTC
(In reply to w.schwarzenfeld from comment #40)
What is your major problem, disabling CCACHE or upgrading to 1.0.7 ?

With 'svn-diff-handbrake-1.0.7 patch',
I've got this message.

```
% ./HandBrakeCLI --version
[12:36:58] hb_init: starting libhb thread
[12:36:58] thread 806c2ba00 started ("libhb")
HandBrake 1.0.3
``

I think both of them have no relation to this topic.
Please open new problem reports and describe your problem.
Comment 44 Vladimir Omelchuk 2017-04-11 05:28:31 UTC
(In reply to naito.yuichiro from comment #43)

I agree, I will open a new PR for update handbrake to 1.0.7

P.S.
After my patch (patch_handbrake-1.0.7_svn_r438214.diff):

# HandBrakeCLI --version
[08:27:09] hb_init: starting libhb thread
[08:27:09] thread 807019000 started ("libhb")
HandBrake 1.0.7
Comment 45 Vladimir Omelchuk 2017-04-11 05:38:37 UTC
(In reply to naito.yuichiro from comment #43)

Done.

See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=218558
Comment 46 Vladimir Omelchuk 2017-04-11 06:37:06 UTC
PR can be closed.
Thanks to all!