Bug 277355

Summary: multimedia/handbrake: update to 1.9.0
Product: Ports & Packages Reporter: Yuichiro NAITO <naito.yuichiro>
Component: Individual Port(s)Assignee: Vladimir Druzenko <vvd>
Status: Closed FIXED    
Severity: Affects Some People CC: grahamperrin, hrs, luzpaz, vvd
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
handbrake-1.7.3.patch
none
handbrake-1.8.0.patch
none
handbrake-1.8.1.patch
none
handbrake-1.8.2.patch
none
handbrake-1.9.0.patch
naito.yuichiro: maintainer-approval+
handbrake-1.9.0-rev2.patch
none
handbrake-1.9.0-rev3.patch none

Description Yuichiro NAITO 2024-02-27 14:28:54 UTC
Created attachment 248794 [details]
handbrake-1.7.3.patch

HandBrake 1.7.3 has been released and the release note is shown at the following URL.

https://github.com/HandBrake/HandBrake/releases/tag/1.7.3

The attached 'handbrake-1.7.3.patch' updates the port.
Please apply to the Ports tree.
Comment 1 kunda 2024-03-11 16:09:15 UTC
soft bump
Comment 2 Yuichiro NAITO 2024-05-28 02:49:30 UTC
Created attachment 251031 [details]
handbrake-1.8.0.patch
Comment 3 Yuichiro NAITO 2024-05-28 02:52:00 UTC
HandBrake 1.8.0 has been released and I updated my patch to upgrade multimedia/handbrake port to 1.8.0.

See the following URL for the release note.

https://github.com/HandBrake/HandBrake/releases/tag/1.8.0

Please apply `handbrake-1.8.0.patch` to the Ports tree.
Comment 4 Yuichiro NAITO 2024-06-28 03:46:37 UTC
Created attachment 251734 [details]
handbrake-1.8.1.patch
Comment 5 Yuichiro NAITO 2024-06-28 03:49:36 UTC
HandBrake 1.8.1 has been released.
I updated my patch to upgrade multimedia/handbrake port.

Take a look at the release note in the following URL.

https://github.com/HandBrake/HandBrake/releases/tag/1.8.1

Please apply `handbrake-1.8.1.patch` to the Ports tree.
Thank you!
Comment 6 Yuichiro NAITO 2024-10-02 06:17:05 UTC
Created attachment 253953 [details]
handbrake-1.8.2.patch
Comment 7 Yuichiro NAITO 2024-10-02 06:27:05 UTC
HandBrake 1.8.2 has been released.
The attached 'handbrake-1.8.2' upgrades multimedia/handbrake to 1.8.2.
See the release note for details.

https://github.com/HandBrake/HandBrake/releases/tag/1.8.2

Please be careful that my patch includes Japanese UTF-8 characters.
Because I fixed a Japanese message catalog bug that crashes HandBrake 
with the "When done" select box is not "Do nothing".
Comment 8 kunda 2024-11-20 15:19:43 UTC
any chance someone can merge patch ?
Comment 9 Yuichiro NAITO 2024-12-25 10:16:55 UTC
Created attachment 256128 [details]
handbrake-1.9.0.patch
Comment 10 Yuichiro NAITO 2024-12-25 10:38:21 UTC
HandBrake-1.9.0 has been released. I updated the attached file and obsoleted
the old one. The Japanese message catalog has been fixed by the upstream.
I deleted the patch containing Japanese characters in UTF-8.

HandBrake depends on the libvpx library for QSV encoding.
The library is included in the HandBrake tarball but FreeBSD uses it from
Ports. Because we need patches to build. The Ports libvpx is older than
in the HandBrake taball. I disabled the latest features. If libvpx project
(successor of oneVPL) is ported to Ports, we will have a chance to use
the full features. (You know DRM module supports are also required)
I don't have the latest Intel CPUs, testing is a hard job for me.
Comment 11 Yuichiro NAITO 2025-01-08 05:12:39 UTC
Can anybody please help me to progress this PR?
I asked hrs@ to commit my patch, but he has been so busy and I heard
it was a difficult time for him. While I'm talking with him, he says
it's OK to commit if anybody can.

10 months have passed since I created this issue. Some people are
waiting for my patch. It's ready for launch. Please apply my patch
to the Ports tree.
Comment 12 Vladimir Druzenko freebsd_committer freebsd_triage 2025-01-08 23:21:16 UTC
Hiroki Sato, I hope you don't mind if I take on this PR.
Comment 13 Vladimir Druzenko freebsd_committer freebsd_triage 2025-01-09 00:06:31 UTC
Error: /usr/local/bin/HandBrakeCLI is linked to /usr/local/lib/libdrm.so.2 from graphics/libdrm but it is not declared as a dependency
Warning: you need LIB_DEPENDS+=libdrm.so:graphics/libdrm
Comment 14 Vladimir Druzenko freebsd_committer freebsd_triage 2025-01-09 00:27:25 UTC
Build with all options OFF:
Error: /usr/local/bin/HandBrakeCLI is linked to /usr/local/lib/libX11.so.6 from x11/libX11 but it is not declared as a dependency
Warning: you need USE_XORG+=x11
Comment 15 Yuichiro NAITO 2025-01-10 15:37:06 UTC
Created attachment 256601 [details]
handbrake-1.9.0-rev2.patch
Comment 16 Yuichiro NAITO 2025-01-10 15:42:42 UTC
(In reply to Vladimir Druzenko from comment #12)
Thank you so much for taking this PR.
I'm sorry I missed seeing the stage-qa error messages in my poudriere logs.

I updated my patch to `handbrake-1.9.0-rev2.patch` which fixes the two errors you reported.

To fix the libdrm issue, I added libdrm.so to the LIB_DEPENDS variable as stage-qa reports.

HandBrakeCLI is a command-line tool, so users don't want to install Xorg libraries. HandBrakeCLI should not depend on libX11. The libX11 library is pulled from libavutil of the internal ffmpeg in the contrib. So I added '--disable-xlib' for the internal ffmpeg configure option. The internal ffmpeg is used as an encoder, and won't need the libX11.

Please check and see my latest patch.
Comment 17 Vladimir Druzenko freebsd_committer freebsd_triage 2025-01-11 12:22:38 UTC
(In reply to Yuichiro NAITO from comment #16)

Are you sure all this is needed in LIB_DEPENDS?

Without options:
Warning: you might not need LIB_DEPENDS on libdbus-1.so
Warning: you might not need LIB_DEPENDS on libgudev-1.0.so
Warning: you might not need LIB_DEPENDS on libharfbuzz.so
Warning: you might not need LIB_DEPENDS on libfontconfig.so
Warning: you might not need LIB_DEPENDS on libfreetype.so
Warning: you might not need LIB_DEPENDS on libfribidi.so
Warning: you might not need LIB_DEPENDS on libxml2.so

With default options:
Warning: you might not need LIB_DEPENDS on libdbus-1.so
Warning: you might not need LIB_DEPENDS on libgudev-1.0.so
Warning: you might not need LIB_DEPENDS on libharfbuzz.so
Warning: you might not need LIB_DEPENDS on libfontconfig.so
Warning: you might not need LIB_DEPENDS on libfreetype.so
Warning: you might not need LIB_DEPENDS on libfribidi.so
Warning: you might not need LIB_DEPENDS on libmfx.so
Warning: you might not need LIB_DEPENDS on libnotify.so
Warning: you might not need LIB_DEPENDS on libatk-1.0.so
Warning: you might not need LIB_DEPENDS on libcairo.so
Warning: you might not need LIB_DEPENDS on libharfbuzz.so
Warning: you might not need LIB_DEPENDS on libgstreamer-1.0.so
Comment 18 Vladimir Druzenko freebsd_committer freebsd_triage 2025-01-11 13:15:07 UTC
Also warnings from portclippy multimedia/handbrake/Makefile:
# PORTNAME block
PORTNAME
DISTVERSION
CATEGORIES
MASTER_SITES
DISTNAME
DISTFILES
DIST_SUBDIR

# Maintainer block
MAINTAINER
COMMENT
WWW

# License block
LICENSE
+LICENSE_NAME_FDK_AAC
+LICENSE_FILE_FDK_AAC
LICENSE_FILE
+LICENSE_PERMS_FDK_AAC

# BROKEN/IGNORE/DEPRECATED messages
ONLY_FOR_ARCHS

# Dependencies
BUILD_DEPENDS
LIB_DEPENDS

# USES block
USES
USE_GNOME

# Configure block
GNU_CONFIGURE

-MAKE_ENV

-BINARY_ALIAS

CONFIGURE_ARGS
CONFIGURE_TARGET

-BUILD_WRKSRC
-INSTALL_WRKSRC

# Make block
MAKEFILE
+MAKE_ENV
ALL_TARGET
INSTALL_TARGET

# CFLAGS/CXXFLAGS/LDFLAGS block
+LDFLAGS

# Standard bsd.port.mk variables
+BINARY_ALIAS
NOPRECIOUSMAKEVARS

-LDFLAGS
# WRKSRC block
+BUILD_WRKSRC
+INSTALL_WRKSRC

# Options definitions
OPTIONS_DEFINE
OPTIONS_DEFAULT
OPTIONS_EXCLUDE_powerpc
OPTIONS_EXCLUDE_powerpc64
OPTIONS_EXCLUDE_powerpc64le
OPTIONS_SUB

# Options descriptions
FDK_AAC_DESC
VPL_DESC
X11_DESC

# Options helpers
FDK_AAC_CONFIGURE_ENABLE
FDK_AAC_VARS

-LICENSE_NAME_FDK_AAC
-LICENSE_FILE_FDK_AAC
-LICENSE_PERMS_FDK_AAC

VPL_LIB_DEPENDS
VPL_CONFIGURE_ON
-X11_CONFIGURE_ENV
-X11_MAKE_ENV
-X11_CONFIGURE_OFF
X11_LIB_DEPENDS
X11_USES
X11_USE
+X11_CONFIGURE_OFF
+X11_CONFIGURE_ENV
+X11_MAKE_ENV
Comment 19 Yuichiro NAITO 2025-01-13 13:59:39 UTC
(In reply to Vladimir Druzenko from comment #17)
> Are you sure all this is needed in LIB_DEPENDS?

I re-checked the library dependencies. I will comment one by one.
I will remove the dependencies which I commented: "removed".

Warning: you might not need LIB_DEPENDS on libdbus-1.so
  --> Apparently power management feature requires.
Warning: you might not need LIB_DEPENDS on libgudev-1.0.so
  --> removed by the upstream.
Warning: you might not need LIB_DEPENDS on libdvdcss.so
  --> required and auto-loaded.
Warning: you might not need LIB_DEPENDS on libharfbuzz.so
  --> required by libass, can be removed
Warning: you might not need LIB_DEPENDS on libfontconfig.so
  --> required by libass, can be removed
Warning: you might not need LIB_DEPENDS on libfreetype.so
  --> required by libass, can be removed
Warning: you might not need LIB_DEPENDS on libfribidi.so
  --> required by libass, can be removed
Warning: you might not need LIB_DEPENDS on libmfx.so
  --> auto-loaded for QSV.
Warning: you might not need LIB_DEPENDS on libnotify.so
  --> Apparently not used, can be removed
Warning: you might not need LIB_DEPENDS on libatk-1.0.so
Warning: you might not need LIB_DEPENDS on libcairo.so
Warning: you might not need LIB_DEPENDS on libharfbuzz.so
  --> dependencies added by gnome, no idea how to suppress these 3 warnings.
Warning: you might not need LIB_DEPENDS on libgstreamer-1.0.so
  --> required for live preview.
Warning: you might not need LIB_DEPENDS on libxml2.so
  --> only required for GUI. fixed to require with X11 option.
Comment 20 Yuichiro NAITO 2025-01-13 14:01:06 UTC
Created attachment 256665 [details]
handbrake-1.9.0-rev3.patch
Comment 21 Yuichiro NAITO 2025-01-13 14:02:28 UTC
(In reply to Vladimir Druzenko from comment #18)
I re-ordered Makefile variables following the portclippy reports.
See my latest patch `handbrake-1.9.0-rev3.patch`.
Comment 22 commit-hook freebsd_committer freebsd_triage 2025-01-13 17:25:48 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=17614c8f9266ab35ecad4fca289495d05f253287

commit 17614c8f9266ab35ecad4fca289495d05f253287
Author:     Yuichiro NAITO <naito.yuichiro@gmail.com>
AuthorDate: 2025-01-13 17:15:35 +0000
Commit:     Vladimir Druzenko <vvd@FreeBSD.org>
CommitDate: 2025-01-13 17:24:31 +0000

    multimedia/handbrake: Update 1.7.2 → 1.9.0

    Changelogs:
    https://github.com/HandBrake/HandBrake/releases/tag/1.7.3
    https://github.com/HandBrake/HandBrake/releases/tag/1.8.0
    https://github.com/HandBrake/HandBrake/releases/tag/1.8.1
    https://github.com/HandBrake/HandBrake/releases/tag/1.8.2
    https://github.com/HandBrake/HandBrake/releases/tag/1.9.0

    Improve port:
    * add required dependencies;
    * remove unnecessary dependencies;
    * fix link command-line tool HandBrakeCLI with libX11;
    * fix warnings from portclippy.

    PR:     277355

 multimedia/handbrake/Makefile                      |  60 +++++------
 multimedia/handbrake/distinfo                      |  26 ++---
 .../files/patch-contrib_ffmpeg_module.defs         |  10 +-
 .../handbrake/files/patch-libhb_enc__qsv.c (new)   |  67 ++++++++++++
 .../patch-libhb_handbrake_qsv__common.h (new)      |  12 +++
 .../files/patch-libhb_qsv__common.c (new)          | 120 +++++++++++++++++++++
 6 files changed, 245 insertions(+), 50 deletions(-)
Comment 23 Vladimir Druzenko freebsd_committer freebsd_triage 2025-01-13 17:26:57 UTC
Thanks.