commit ad2a0377ae315c09d41d08adaab3da4c2560b910
Author: Dominik 'Rathann' Mierzejewski <dominik(a)greysector.net>
Date: Thu May 16 00:37:08 2024 +0200
Update to version 1.7.3.
Drop obsolete patches
Fix build with system FFmpeg/x265
Drop unused dependencies
Fix libxml2 cflags parsing
HandBrake-fix-cflags-parsing.patch | 18 +++++++
HandBrake-modern-c.patch | 38 --------------
HandBrake-no-contribs.patch | 65 +++++++++++++++++++++++
HandBrake-no-fdk_aac.patch | 55 +++++++++++++++-----
HandBrake-no-libtool-nasm.patch | 17 ++++++
HandBrake-no-nasm.patch | 12 -----
HandBrake-nostrip.patch | 10 ----
HandBrake-remove-ambient-viewing-support.patch | 72 ++++++++++++++++++++++++++
HandBrake.spec | 50 ++++++++----------
sources | 4 +-
10 files changed, 240 insertions(+), 101 deletions(-)
---
diff --git a/HandBrake-fix-cflags-parsing.patch b/HandBrake-fix-cflags-parsing.patch
new file mode 100644
index 0000000..7a3acb3
--- /dev/null
+++ b/HandBrake-fix-cflags-parsing.patch
@@ -0,0 +1,18 @@
+diff -up HandBrake-1.7.3/libhb/module.defs.orig HandBrake-1.7.3/libhb/module.defs
+--- HandBrake-1.7.3/libhb/module.defs.orig 2024-05-15 23:50:54.273783155 +0200
++++ HandBrake-1.7.3/libhb/module.defs 2024-05-16 00:07:33.709692520 +0200
+@@ -71,8 +71,12 @@ else
+ LIBHB.libxml2 := $(shell $(PKGCONFIG.exe) --silence-errors --cflags libxml-2.0)
+ endif
+ ifneq (,$(LIBHB.libxml2))
+- LIBHB.libxml2 := $(patsubst -I%,%,$(LIBHB.libxml2))
+- LIBHB.GCC.I += $(LIBHB.libxml2)
++ LIBHB.libxml2.I := $(filter -I%,$(LIBHB.libxml2))
++ LIBHB.libxml2.I := $(patsubst -I%,%,$(LIBHB.libxml2.I))
++ LIBHB.GCC.I += $(LIBHB.libxml2.I)
++ LIBHB.libxml2.D := $(filter -D%,$(LIBHB.libxml2))
++ LIBHB.libxml2.D := $(patsubst -D%,%,$(LIBHB.libxml2.D))
++ LIBHB.GCC.D += $(LIBHB.libxml2.D)
+ else
+ LIBHB.GCC.I += /usr/include/libxml2
+ endif
diff --git a/HandBrake-no-contribs.patch b/HandBrake-no-contribs.patch
new file mode 100644
index 0000000..83487ef
--- /dev/null
+++ b/HandBrake-no-contribs.patch
@@ -0,0 +1,65 @@
+From: Sebastian Ramacher <sramacher(a)debian.org>
+Date: Fri, 1 Dec 2023 23:22:16 +0100
+Subject: Do not use contribs
+
+---
+ gtk/meson.build | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/gtk/meson.build b/gtk/meson.build
+index 6f41201..c072f50 100644
+--- a/gtk/meson.build
++++ b/gtk/meson.build
+@@ -22,8 +22,8 @@ if hb_dir == ''
+ hb_dir = meson.current_build_dir() / '..'
+ endif
+
+-hb_libdirs = [hb_dir / 'libhb', hb_dir / 'contrib/lib'] +
get_option('extra-libdirs')
+-hb_incdirs = include_directories(hb_dir / 'libhb', hb_dir /
'contrib/include')
++hb_libdirs = [hb_dir / 'libhb'] + get_option('extra-libdirs')
++hb_incdirs = include_directories(hb_dir / 'libhb')
+
+ # External dependencies (required)
+ ghb_deps = [
+@@ -33,7 +33,6 @@ ghb_deps = [
+ cc.find_library('mp3lame', dirs: hb_libdirs),
+ dependency('dvdnav'),
+ dependency('dvdread'),
+- dependency('dav1d'),
+ dependency('SvtAv1Enc'),
+ dependency('fribidi'),
+ dependency('glib-2.0', version: glib_min),
+@@ -63,7 +62,6 @@ ghb_deps = [
+ dependency('vorbisenc'),
+ dependency('vpx'),
+ dependency('x264'),
+- dependency('zimg'),
+ dependency('zlib'),
+ ]
+
+diff -up HandBrake-1.7.3/libhb/module.defs.orig HandBrake-1.7.3/libhb/module.defs
+--- HandBrake-1.7.3/libhb/module.defs.orig 2024-02-10 23:22:33.000000000 +0100
++++ HandBrake-1.7.3/libhb/module.defs 2024-05-15 23:46:57.265752588 +0200
+@@ -1,7 +1,7 @@
+ __deps__ := A52DEC BZIP2 LIBVPX SVT-AV1 FFMPEG FREETYPE LAME LIBASS LIBDCA \
+ LIBDVDREAD LIBDVDNAV LIBICONV LIBSAMPLERATE LIBTHEORA LIBVORBIS LIBOGG \
+ LIBXML2 X264 X265 ZLIB LIBBLURAY FDKAAC LIBVPL LIBGNURX JANSSON \
+- HARFBUZZ LIBOPUS LIBSPEEX LIBDAV1D LIBJPEGTURBO LIBDOVI
++ HARFBUZZ LIBOPUS LIBSPEEX LIBJPEGTURBO LIBDOVI
+
+ ifeq (,$(filter $(HOST.system),darwin cygwin mingw))
+ __deps__ += FONTCONFIG
+diff -up HandBrake-1.7.3/test/module.defs.orig HandBrake-1.7.3/test/module.defs
+--- HandBrake-1.7.3/test/module.defs.orig 2024-05-15 23:05:14.263979341 +0200
++++ HandBrake-1.7.3/test/module.defs 2024-05-15 23:47:36.829590760 +0200
+@@ -16,8 +16,8 @@ TEST.libs = $(LIBHB.a)
+ TEST.GCC.l = \
+ ass avformat avfilter avcodec avutil swresample postproc mp3lame dvdnav \
+ dvdread fribidi swscale vpx theoraenc theoradec vorbis vorbisenc ogg \
+- x264 bluray freetype xml2 bz2 z jansson harfbuzz opus speex lzma dav1d \
+- turbojpeg zimg SvtAv1Enc
++ x264 bluray freetype xml2 bz2 z jansson harfbuzz opus speex lzma \
++ turbojpeg SvtAv1Enc
+
+ ifeq (,$(filter $(HOST.system),darwin cygwin mingw))
+ TEST.GCC.l += fontconfig
diff --git a/HandBrake-no-fdk_aac.patch b/HandBrake-no-fdk_aac.patch
index b984bba..934f236 100644
--- a/HandBrake-no-fdk_aac.patch
+++ b/HandBrake-no-fdk_aac.patch
@@ -1,14 +1,45 @@
-diff -up HandBrake-1.6.0/gtk/configure.ac.fdk HandBrake-1.6.0/gtk/configure.ac
---- HandBrake-1.6.0/gtk/configure.ac.fdk 2022-12-28 09:43:46.000000000 +0100
-+++ HandBrake-1.6.0/gtk/configure.ac 2023-01-23 20:50:40.075455676 +0100
-@@ -215,10 +215,6 @@ else
- HB_LIBS="$HB_LIBS -lx264"
- fi
+diff -up HandBrake-1.7.3/gtk/meson.build.orig HandBrake-1.7.3/gtk/meson.build
+--- HandBrake-1.7.3/gtk/meson.build.orig 2024-02-10 23:22:33.000000000 +0100
++++ HandBrake-1.7.3/gtk/meson.build 2024-05-15 22:54:38.645589239 +0200
+@@ -90,10 +90,6 @@ if get_option('libdovi').enabled()
+ ghb_deps += dependency('dovi')
+ endif
--if test "x$use_fdk_aac" = "xyes" ; then
-- HB_LIBS="$HB_LIBS -lfdk-aac"
--fi
+-if get_option('fdk-aac').enabled()
+- ghb_deps += dependency('fdk-aac')
+-endif
-
- if test "x$use_x265" = "xyes" ; then
- HB_LIBS="$HB_LIBS -lx265"
- fi
+ if get_option('qsv').enabled()
+ if host_machine.system() == 'windows'
+ ghb_deps += cc.find_library('vpl', dirs: hb_libdirs)
+diff -up HandBrake-1.7.3/gtk/meson_options.txt.orig
HandBrake-1.7.3/gtk/meson_options.txt
+--- HandBrake-1.7.3/gtk/meson_options.txt.orig 2024-02-10 23:22:33.000000000 +0100
++++ HandBrake-1.7.3/gtk/meson_options.txt 2024-05-15 22:54:45.430561239 +0200
+@@ -3,11 +3,6 @@ option('extra-libdirs',
+ value: [],
+ description: 'Extra directories to search for libraries')
+
+-option('fdk-aac',
+- type: 'feature',
+- value: 'disabled',
+- description: 'Enable FDK AAC encoder')
+-
+ option('flatpak',
+ type: 'boolean',
+ value: false,
+diff -up HandBrake-1.7.3/gtk/module.defs.orig HandBrake-1.7.3/gtk/module.defs
+--- HandBrake-1.7.3/gtk/module.defs.orig 2024-02-10 23:22:33.000000000 +0100
++++ HandBrake-1.7.3/gtk/module.defs 2024-05-15 22:54:53.795526719 +0200
+@@ -53,12 +53,6 @@ else
+ GTK.CONFIGURE.extra += -Dgstreamer=disabled
+ endif
+
+-ifeq (1,$(FEATURE.fdk_aac))
+- GTK.CONFIGURE.extra += -Dfdk-aac=enabled
+-else
+- GTK.CONFIGURE.extra += -Dfdk-aac=disabled
+-endif
+-
+ ifeq (1,$(FEATURE.x265))
+ GTK.CONFIGURE.extra += -Dx265=enabled
+ else
diff --git a/HandBrake-no-libtool-nasm.patch b/HandBrake-no-libtool-nasm.patch
new file mode 100644
index 0000000..09efe93
--- /dev/null
+++ b/HandBrake-no-libtool-nasm.patch
@@ -0,0 +1,17 @@
+diff -up HandBrake-1.7.3/make/configure.py.orig HandBrake-1.7.3/make/configure.py
+--- HandBrake-1.7.3/make/configure.py.orig 2024-02-10 23:22:33.000000000 +0100
++++ HandBrake-1.7.3/make/configure.py 2024-05-15 22:56:32.656118746 +0200
+@@ -1685,11 +1685,11 @@ try:
+
+ autoconf = ToolProbe( 'AUTOCONF.exe', 'autoconf',
'autoconf', abort=True, minversion=([2,71,0] if
build_tuple.match('*-*-darwin*') else [2,69,0]) )
+ automake = ToolProbe( 'AUTOMAKE.exe', 'automake',
'automake', abort=True, minversion=[1,13,0] )
+- libtool = ToolProbe( 'LIBTOOL.exe', 'libtool',
'libtool', abort=True )
++ libtool = ToolProbe( 'LIBTOOL.exe', 'libtool',
'libtool', abort=False )
+ lipo = ToolProbe( 'LIPO.exe', 'lipo',
'lipo', abort=False )
+ pkgconfig = ToolProbe( 'PKGCONFIG.exe', 'pkgconfig',
'pkg-config', abort=True, minversion=[0,27,0] )
+ meson = ToolProbe( 'MESON.exe', 'meson',
'meson', abort=True, minversion=[0,51,0] )
+- nasm = ToolProbe( 'NASM.exe', 'asm',
'nasm', abort=True, minversion=[2,13,0] )
++ nasm = ToolProbe( 'NASM.exe', 'asm',
'nasm', abort=False, minversion=[2,13,0] )
+ ninja = ToolProbe( 'NINJA.exe', 'ninja',
'ninja-build', 'ninja', abort=True )
+ cargo = ToolProbe( 'CARGO.exe', 'cargo',
'cargo', abort=False )
+ cargoc = ToolProbe( 'CARGO-C.exe', 'cargo-cbuild',
'cargo-cbuild', abort=False )
diff --git a/HandBrake-remove-ambient-viewing-support.patch
b/HandBrake-remove-ambient-viewing-support.patch
new file mode 100644
index 0000000..0b97d23
--- /dev/null
+++ b/HandBrake-remove-ambient-viewing-support.patch
@@ -0,0 +1,72 @@
+From: Sebastian Ramacher <sramacher(a)debian.org>
+Date: Fri, 1 Dec 2023 23:02:49 +0100
+Subject: Remove ambient viewing support
+
+Support in ffmpeg and x265 is added via contrib patches.
+---
+ libhb/encx265.c | 8 --------
+ libhb/muxavformat.c | 14 --------------
+ libhb/stream.c | 6 ------
+ 3 files changed, 28 deletions(-)
+
+diff --git a/libhb/encx265.c b/libhb/encx265.c
+index 89f996d..b5356de 100644
+--- a/libhb/encx265.c
++++ b/libhb/encx265.c
+@@ -308,14 +308,6 @@ int encx265Init(hb_work_object_t *w, hb_job_t *job)
+ param->bHighTier = 0;
+ }
+
+- if (job->ambient.ambient_illuminance.num &&
job->ambient.ambient_illuminance.den)
+- {
+- param->ambientIlluminance = rescale(job->ambient.ambient_illuminance,
10000);
+- param->ambientLightX = rescale(job->ambient.ambient_light_x, 50000);
+- param->ambientLightY = rescale(job->ambient.ambient_light_y, 50000);
+- param->bEmitAmbientViewingEnvironment = 1;
+- }
+-
+ if (job->chroma_location != AVCHROMA_LOC_UNSPECIFIED)
+ {
+ char chromaLocation[256];
+diff --git a/libhb/muxavformat.c b/libhb/muxavformat.c
+index 20ecda0..b79f6ae 100644
+--- a/libhb/muxavformat.c
++++ b/libhb/muxavformat.c
+@@ -586,20 +586,6 @@ static int avformatInit( hb_mux_object_t * m )
+ }
+ }
+
+- if (job->ambient.ambient_illuminance.num &&
job->ambient.ambient_illuminance.den)
+- {
+- AVAmbientViewingEnvironment ambient = hb_ambient_hb_to_ff(job->ambient);
+-
+- uint8_t *ambient_data = av_malloc(sizeof(AVAmbientViewingEnvironment));
+- memcpy(ambient_data, &ambient, sizeof(AVAmbientViewingEnvironment));
+-
+- av_packet_side_data_add(&track->st->codecpar->coded_side_data,
+- &track->st->codecpar->nb_coded_side_data,
+- AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT,
+- ambient_data,
+- sizeof(AVAmbientViewingEnvironment), 0);
+- }
+-
+ if (job->passthru_dynamic_hdr_metadata & DOVI)
+ {
+ if (job->dovi.dv_profile == 5 && job->mux == HB_MUX_AV_MP4)
+diff --git a/libhb/stream.c b/libhb/stream.c
+index 2359547..46ddbfd 100644
+--- a/libhb/stream.c
++++ b/libhb/stream.c
+@@ -5894,12 +5894,6 @@ static hb_title_t *ffmpeg_title_scan( hb_stream_t *stream,
hb_title_t *title )
+ title->coll.max_fall = coll->MaxFALL;
+ break;
+ }
+- case AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT:
+- {
+- AVAmbientViewingEnvironment *ambient =
(AVAmbientViewingEnvironment *)sd.data;
+- title->ambient = hb_ambient_ff_to_hb(*ambient);
+- break;
+- }
+ case AV_PKT_DATA_DOVI_CONF:
+ {
+ AVDOVIDecoderConfigurationRecord *dovi =
(AVDOVIDecoderConfigurationRecord *)sd.data;
diff --git a/HandBrake.spec b/HandBrake.spec
index 600b1c0..ce3f454 100644
--- a/HandBrake.spec
+++ b/HandBrake.spec
@@ -1,5 +1,5 @@
-%global commit0 04413a27e6d616cddd98c2c6468aca2bf91b87b5
-%global date 20230122
+%global commit0 86156a66c0d5ccc306487c1ff961a7b2328961b3
+%global date 20240210
%global shortcommit0 %(c=%{commit0}; echo ${c:0:7})
%global tag %{version}
@@ -15,8 +15,8 @@
%global desktop_id fr.handbrake.ghb
Name: HandBrake
-Version: 1.6.1
-Release: 6%{!?tag:.%{date}git%{shortcommit0}}%{?dist}
+Version: 1.7.3
+Release: 1%{!?tag:.%{date}git%{shortcommit}}%{?dist}
Summary: An open-source multiplatform video transcoder
License: GPLv2+
URL:
https://handbrake.fr/
@@ -33,18 +33,21 @@ Source0:
https://github.com/%{name}/%{name}/archive/%{commit0}.tar.gz#/%{
%{?_without_ffmpeg:Source10:
https://libav.org/releases/libav-12.tar.gz}
-# Pass strip tool override to gtk/configure
-Patch0: %{name}-nostrip.patch
+# Fix parsing of -DFOO from pkg-config --cflags libxml-2.0
+Patch0: %{name}-fix-cflags-parsing.patch
# Don't link with libva unnecessarily
Patch1: %{name}-no-libva.patch
# Don't link with fdk_aac unnecessarily
Patch2: %{name}-no-fdk_aac.patch
-# Fix build on non-x86 (without nasm)
-Patch3: %{name}-no-nasm.patch
+# Fix build on non-x86 (without nasm) and drop libtool requirement
+Patch3: %{name}-no-libtool-nasm.patch
# Patch from Gentoo
Patch4: %{name}-x265-link.patch
-# Fix build with GCC14
-Patch5: %{name}-modern-c.patch
+# Patches from Debian
+#
https://salsa.debian.org/multimedia-team/handbrake/-/raw/master/debian/pa...
+Patch5: %{name}-no-contribs.patch
+#
https://salsa.debian.org/multimedia-team/handbrake/-/raw/master/debian/pa...
+Patch6: %{name}-remove-ambient-viewing-support.patch
BuildRequires: a52dec-devel >= 0.7.4
BuildRequires: cmake
@@ -69,7 +72,6 @@ BuildRequires: libappindicator-gtk3-devel
# Should be >= 0.13.2:
BuildRequires: libass-devel >= 0.13.1
BuildRequires: libbluray-devel >= 0.9.3
-BuildRequires: libdav1d-devel
BuildRequires: libdrm-devel
BuildRequires: libdvdnav-devel >= 5.0.1
BuildRequires: libdvdread-devel >= 5.0.0
@@ -84,7 +86,6 @@ BuildRequires: libnotify-devel
BuildRequires: librsvg2-devel
BuildRequires: libsamplerate-devel
BuildRequires: libtheora-devel
-BuildRequires: libtool
BuildRequires: libvorbis-devel
# Should be >= 1.5:
BuildRequires: libvpx-devel >= 1.3
@@ -102,7 +103,6 @@ BuildRequires: svt-av1-devel
BuildRequires: x264-devel >= 0.148
BuildRequires: x265-devel >= 1.9
BuildRequires: xz-devel
-BuildRequires: zimg-devel
Requires: hicolor-icon-theme
# needed for reading encrypted DVDs
@@ -149,15 +149,13 @@ gpgv2 --keyring %{S:2} %{S:1} %{S:0}
%patch -P3 -p1
%patch -P4 -p1
%patch -P5 -p1
+%patch -P6 -p1
# Use system libraries in place of bundled ones
-for module in a52dec fdk-aac %{!?_without_ffmpeg:ffmpeg} libdav1d libdvdnav libdvdread
libbluray %{?_with_vpl:libmfx libvpl} nvenc libvpx svt-av1 x265; do
+for module in a52dec fdk-aac %{!?_without_ffmpeg:ffmpeg} libdvdnav libdvdread libbluray
%{?_with_vpl:libmfx libvpl} nvenc libvpx svt-av1 x265; do
sed -i -e "/MODULES += contrib\/$module/d" make/include/main.defs
done
-# Fix desktop file
-sed -i -e 's/%{desktop_id}.svg/%{desktop_id}/g' gtk/src/%{desktop_id}.desktop
-
%build
echo "HASH=%{commit0}" > version.txt
echo "SHORTHASH=%{shortcommit0}" >> version.txt
@@ -166,6 +164,7 @@ echo "DATE=$(date "+%Y-%m-%d %T" -d %{date})"
>> version.txt
echo "TAG=%{tag}" >> version.txt
echo "TAG_HASH=%{commit0}" >> version.txt
%endif
+sed -i -e 's/^\(GIT_TAG\)=\(.*\)/\1=%{version}/' gtk/data/version.sh
# This makes build stop if any download is attempted
export http_proxy=http://127.0.0.1
@@ -185,7 +184,6 @@ echo "GCC.args.g.none = " >> custom.defs
--verbose \
--disable-df-fetch \
--disable-df-verify \
- --disable-gtk-update-checks \
%{?_with_asm:--enable-asm} \
--enable-x265 \
--disable-numa \
@@ -197,15 +195,6 @@ echo "GCC.args.g.none = " >> custom.defs
%install
%make_install -C build
-# Desktop file, icons and AppStream metadata from FlatPak build (more complete)
-rm -f %{buildroot}%{_datadir}/applications/ghb.desktop \
- %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/hb-icon.svg
-
-install -D -p -m 644 gtk/src/%{desktop_id}.desktop \
- %{buildroot}%{_datadir}/applications/%{desktop_id}.desktop
-install -D -p -m 644 gtk/src/%{desktop_id}.svg \
- %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/%{desktop_id}.svg
-
%find_lang ghb
%check
@@ -226,6 +215,13 @@ appstream-util validate-relax --nonet
%{buildroot}%{_metainfodir}/%{desktop_id}.
%{_bindir}/HandBrakeCLI
%changelog
+* Wed May 15 2024 Dominik 'Rathann' Mierzejewski <dominik(a)greysector.net> -
1.7.3-1
+- Update to version 1.7.3.
+- Drop obsolete patches
+- Fix build with system FFmpeg/x265
+- Drop unused dependencies
+- Fix libxml2 cflags parsing
+
* Sat Apr 06 2024 Leigh Scott <leigh123linux(a)gmail.com> - 1.6.1-6
- Rebuild for new x265 version
diff --git a/sources b/sources
index 3bcdc47..64c0173 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
-SHA512 (HandBrake-1.6.1-source.tar.bz2) =
e5cc0fee5bf063c4cdb8f64a772dac6800a7214bfdc65042c121e0e81878599fe615b499ebf6466bb78740314374ad8b8fa364fb24ff86852183e7dbbf565617
-SHA512 (HandBrake-1.6.1-source.tar.bz2.sig) =
040def2c1e23bf16d4a83e7a2cea4a37b74bf3e03cfb22d245d51c8476510ba33d1a0e967a5dba56c5222ed293f134e3fad99cc0c37d3fdbdb925aa709802986
+SHA512 (HandBrake-1.7.3-source.tar.bz2) =
2a934ef3fef5c9d3a23976c6138a35cc1a098dc20b482259788ea58c5c3a581d772fc73c3e00bb1c6b605a050cbeef44ec8df181f6e3e9503aef458df629a927
+SHA512 (HandBrake-1.7.3-source.tar.bz2.sig) =
2b2307ae83b43ea3fed806d19b0f4a53d650ea8b50cdd5c2fa918d29f756f6b955dc9f5388de2cde31c63241da1115168657d855a5dbac6f400b0b7e3896b14b