Compare commits

...

1 Commits

Author SHA1 Message Date
Cappy Ishihara be7d78b254 Rebase HandBrake spec to negativo17's HandBrake spec 2025-01-17 04:39:48 +07:00
9 changed files with 202 additions and 221 deletions
+68
View File
@@ -0,0 +1,68 @@
diff --git a/gtk/meson.build b/gtk/meson.build
index 83233cea2..96ba52384 100644
--- a/gtk/meson.build
+++ b/gtk/meson.build
@@ -63,6 +63,8 @@ endif
if get_option('qsv').enabled()
ghb_deps += dependency('vpl')
+ ghb_deps += dependency('libva')
+ ghb_deps += dependency('libva-drm')
endif
if get_option('x265').enabled()
diff --git a/libhb/rpu.c b/libhb/rpu.c
index 28083184a..87304abc2 100644
--- a/libhb/rpu.c
+++ b/libhb/rpu.c
@@ -11,7 +11,7 @@
#include "handbrake/rpu.h"
#if HB_PROJECT_FEATURE_LIBDOVI
-#include "libdovi/rpu_parser.h"
+#include <libdovi/rpu_parser.h>
#endif
struct hb_filter_private_s
diff --git a/make/configure.py b/make/configure.py
index a383cb363..84a66307b 100644
--- a/make/configure.py
+++ b/make/configure.py
@@ -1684,8 +1684,8 @@ try:
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] )
- ninja = ToolProbe( 'NINJA.exe', 'ninja', 'ninja-build', 'ninja', abort=True )
+ nasm = ToolProbe( 'NASM.exe', 'asm', 'nasm', abort=False, minversion=[2,13,0] )
+ ninja = ToolProbe( 'NINJA.exe', 'ninja', 'ninja-build', 'ninja', abort=False )
cargo = ToolProbe( 'CARGO.exe', 'cargo', 'cargo', abort=False )
cargoc = ToolProbe( 'CARGO-C.exe', 'cargo-cbuild', 'cargo-cbuild', abort=False )
@@ -1786,7 +1786,7 @@ try:
## Additional library and tool checks
#####################################
# Requires oneVPL which requires CMake 3.16.3 or later
- Tools.cmake = ToolProbe('CMAKE.exe', 'cmake', 'cmake', abort=True, minversion=[3,16,3])
+ Tools.cmake = ToolProbe('CMAKE.exe', 'cmake', 'cmake', abort=False, minversion=[3,16,3])
Tools.cmake.__init__( Tools.cmake.var, Tools.cmake.option, Tools.cmake.name, **Tools.cmake.kwargs )
Tools.cmake.run()
for action in Action.actions:
diff --git a/test/module.defs b/test/module.defs
index 9f803c457..3316431ce 100644
--- a/test/module.defs
+++ b/test/module.defs
@@ -21,6 +21,13 @@ TEST.pkgconfig_libs = libass libavformat libavfilter libavcodec libavutil libswr
jansson libturbojpeg SvtAv1Enc
TEST.pkgconfig_libs += $(foreach m,$(MODULES.NAMES),$($m.OSL.libs))
+ifeq (1,$(FEATURE.qsv))
+ TEST.pkgconfig_libs += libva libva-drm vpl
+endif
+
+ifeq (1,$(FEATURE.x265))
+ TEST.pkgconfig_libs += x265
+endif
ifeq (1,$(FEATURE.flatpak))
TEST.pkgconfig_libs += glib-2.0
@@ -1,14 +0,0 @@
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
-if test "x$use_fdk_aac" = "xyes" ; then
- HB_LIBS="$HB_LIBS -lfdk-aac"
-fi
-
if test "x$use_x265" = "xyes" ; then
HB_LIBS="$HB_LIBS -lx265"
fi
@@ -1,13 +0,0 @@
diff -up HandBrake-1.2.0/test/module.defs.va HandBrake-1.2.0/test/module.defs
--- HandBrake-1.2.0/test/module.defs.va 2018-12-16 18:16:51.000000000 +0100
+++ HandBrake-1.2.0/test/module.defs 2019-01-21 00:40:28.279840862 +0100
@@ -25,9 +25,6 @@ endif
ifeq (1,$(FEATURE.qsv))
TEST.GCC.D += USE_QSV HAVE_THREADS=1
-ifeq ($(BUILD.system),linux)
- TEST.GCC.l += va va-drm
-endif
endif
ifeq (1,$(FEATURE.vce))
@@ -1,12 +0,0 @@
diff -up HandBrake-1.6.0/make/configure.py.orig HandBrake-1.6.0/make/configure.py
--- HandBrake-1.6.0/make/configure.py.orig 2022-12-28 09:43:46.000000000 +0100
+++ HandBrake-1.6.0/make/configure.py 2023-01-06 23:39:40.041593595 +0100
@@ -1665,7 +1665,7 @@ try:
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,47,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 )
xcodebuild = ToolProbe( 'XCODEBUILD.exe', 'xcodebuild', 'xcodebuild', abort=(True if (not xcode_opts['disabled'] and (build_tuple.match('*-*-darwin*') and cross is None)) else False), versionopt='-version', minversion=[10,3,0] )
@@ -1,10 +0,0 @@
--- a/gtk/module.rules
+++ b/gtk/module.rules
@@ -21,6 +21,7 @@ $(GTK.CONFIGURE.stamp): $(GTK.src/)configure.ac $(GTK.src/)src/Makefile.am
CXX="$(GCC.gxx)" \
CFLAGS="$(call fn.ARGS,GTK.GCC,.g .O *D *W ?extra)" \
LDFLAGS="$(call fn.ARGS,GTK.GCC,?strip .g .O ?extra.exe)" \
+ STRIP="$(STRIP.exe)" \
PYTHON="$(PYTHON.exe)" \
--prefix=$(PREFIX) \
--with-hb=$(call fn.ABSOLUTE,$(BUILD/))
@@ -1,13 +0,0 @@
--- a/test/module.defs 2020-06-13 15:05:35.000000000 +0100
+++ a/test/module.defs 2020-07-03 11:15:53.951205608 +0100
@@ -30,6 +30,10 @@
endif
endif
+ifeq (1,$(FEATURE.x265))
+ TEST.GCC.l += x265
+endif
+
ifeq (1,$(FEATURE.flatpak))
TEST.GCC.l += glib-2.0
endif
+4
View File
@@ -2,4 +2,8 @@ project pkg {
rpm { rpm {
spec = "terra-HandBrake.spec" spec = "terra-HandBrake.spec"
} }
labels {
subrepo = "extras"
}
} }
+130 -159
View File
@@ -1,234 +1,205 @@
# https://pkgs.rpmfusion.org/cgit/free/HandBrake.git/tree/HandBrake.spec %global commit0 2e91369bae27841e0ffdcbe2e0fac2aaa7e779cf
%global commit0 04413a27e6d616cddd98c2c6468aca2bf91b87b5 %global date 20231008
%global commit_date %(date '+%Y%m%d')
%global shortcommit0 %(c=%{commit0}; echo ${c:0:7}) %global shortcommit0 %(c=%{commit0}; echo ${c:0:7})
%global tag %{version} %global tag %{version}
%global pkg HandBrake
# Build with "--without ffmpeg" or enable this to use bundled libAV
# instead of system FFMpeg libraries.
#global _without_ffmpeg 1
%ifarch i686 x86_64
%global _with_asm 1
%global _with_vpl 1
%endif
%global desktop_id fr.handbrake.ghb %global desktop_id fr.handbrake.ghb
Name: terra-HandBrake Name: HandBrake
Version: 1.6.1 Version: 1.9.0
Release: 1%?dist Release: 2%{?dist}
# RPMFusion's Handbrake builds link against an older version of x265, so we
# want to force upgrades to this package.
Epoch: 1
Summary: An open-source multiplatform video transcoder Summary: An open-source multiplatform video transcoder
License: GPL-2.0-or-later License: GPLv2+
URL: https://handbrake.fr/ URL: http://handbrake.fr/
%if 0%{?tag:1} %if 0%{?tag:1}
%dnl Source0: https://github.com/%pkg/%pkg/releases/download/%version/%pkg-%version-source.tar.bz2 Source0: https://github.com/%{name}/%{name}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1: https://github.com/%pkg/%pkg/releases/download/%version/%pkg-%version-source.tar.bz2.sig
# import from https://handbrake.fr/openpgp.php or https://github.com/HandBrake/HandBrake/wiki/OpenPGP
# gpg2 --export --export-options export-minimal 1629C061B3DDE7EB4AE34B81021DB8B44E4A8645 > gpg-keyring-1629C061B3DDE7EB4AE34B81021DB8B44E4A8645.gpg
Source2: gpg-keyring-1629C061B3DDE7EB4AE34B81021DB8B44E4A8645.gpg
%else %else
%dnl Source0: https://github.com/%pkg/%pkg/archive/%commit0.tar.gz#/%{name}-%{shortcommit0}.tar.gz Source0: https://github.com/%{name}/%{name}/archive/%{commit0}.tar.gz#/%{name}-%{shortcommit0}.tar.gz
%endif %endif
%{?_without_ffmpeg:Source10: https://libav.org/releases/libav-12.tar.gz} # Adjust dependencies when using system libraries:
Patch0: %{name}-deps.patch
# Pass strip tool override to gtk/configure BuildRequires: AMF-devel
Patch0: %pkg-nostrip.patch BuildRequires: appstream
# Don't link with libva unnecessarily BuildRequires: bzip2-devel
Patch1: %pkg-no-libva.patch
# Don't link with fdk_aac unnecessarily
Patch2: %pkg-no-fdk_aac.patch
# Fix build on non-x86 (without nasm)
Patch3: %pkg-no-nasm.patch
# Patch from Gentoo
Patch4: %pkg-x265-link.patch
BuildRequires: a52dec-devel >= 0.7.4
BuildRequires: cmake
BuildRequires: dbus-glib-devel
BuildRequires: desktop-file-utils BuildRequires: desktop-file-utils
%if 0%{?tag:1} BuildRequires: fontconfig-devel
BuildRequires: gnupg2
%endif
BuildRequires: libappstream-glib
%{!?_without_ffmpeg:BuildRequires: ffmpeg-free-devel >= 3.5}
# Should be >= 2.6:
BuildRequires: freetype-devel >= 2.4.11 BuildRequires: freetype-devel >= 2.4.11
# Should be >= 0.19.7:
BuildRequires: fribidi-devel >= 0.19.4 BuildRequires: fribidi-devel >= 0.19.4
BuildRequires: gcc-c++ BuildRequires: gcc-c++
BuildRequires: gstreamer1-plugins-base-devel BuildRequires: harfbuzz-devel >= 1.3.2
BuildRequires: intltool BuildRequires: jansson-devel >= 2.10
BuildRequires: jansson-devel BuildRequires: libappstream-glib
BuildRequires: turbojpeg-devel BuildRequires: libass-devel >= 0.13.4
BuildRequires: lame-devel >= 3.98 BuildRequires: libdav1d-devel >= 0.3.0
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: libdrm-devel
BuildRequires: libdvdnav-devel >= 5.0.1
BuildRequires: libdvdread-devel >= 5.0.0
BuildRequires: libgudev-devel
%if 0%{?_with_vpl:1}
BuildRequires: intel-mediasdk-devel
BuildRequires: oneVPL-devel
BuildRequires: libva-devel BuildRequires: libva-devel
%endif BuildRequires: libsamplerate-devel >= 0.1.8
BuildRequires: libmpeg2-devel >= 0.5.1
BuildRequires: libnotify-devel
BuildRequires: librsvg2-devel
BuildRequires: libsamplerate-devel
BuildRequires: libtheora-devel
BuildRequires: libtool BuildRequires: libtool
BuildRequires: libvorbis-devel BuildRequires: libva-devel
# Should be >= 1.5: BuildRequires: m4
BuildRequires: libvpx-devel >= 1.3
BuildRequires: make BuildRequires: make
BuildRequires: meson BuildRequires: meson
%if 0%{?_with_asm:1} BuildRequires: nv-codec-headers >= 11
BuildRequires: nasm BuildRequires: patch
%endif BuildRequires: pkgconfig(dovi)
BuildRequires: numactl-devel BuildRequires: pkgconfig(dvdnav)
BuildRequires: nv-codec-headers BuildRequires: pkgconfig(dvdread)
BuildRequires: opus-devel BuildRequires: pkgconfig(fdk-aac)
BuildRequires: pkgconfig(gio-2.0) >= 2.68
BuildRequires: pkgconfig(glib-2.0) >= 2.68
BuildRequires: pkgconfig(gmodule-2.0) >= 2.68
BuildRequires: pkgconfig(gthread-2.0) >= 2.68
BuildRequires: pkgconfig(gtk4) >= 4.4
BuildRequires: pkgconfig(jansson)
BuildRequires: pkgconfig(libass)
BuildRequires: pkgconfig(libavcodec)
BuildRequires: pkgconfig(libavfilter)
BuildRequires: pkgconfig(libavformat)
BuildRequires: pkgconfig(libavutil)
BuildRequires: pkgconfig(libbluray)
BuildRequires: pkgconfig(libswresample)
BuildRequires: pkgconfig(libswscale)
BuildRequires: pkgconfig(libturbojpeg)
BuildRequires: pkgconfig(libxml-2.0)
BuildRequires: pkgconfig(numa)
BuildRequires: pkgconfig(ogg)
BuildRequires: pkgconfig(SvtAv1Enc)
BuildRequires: pkgconfig(theoradec)
BuildRequires: pkgconfig(theoraenc)
BuildRequires: pkgconfig(vorbis)
BuildRequires: pkgconfig(vorbisenc)
BuildRequires: pkgconfig(x264)
BuildRequires: pkgconfig(x265)
BuildRequires: python3 BuildRequires: python3
BuildRequires: speex-devel BuildRequires: tar
BuildRequires: svt-av1-devel BuildRequires: wget
BuildRequires: x264-devel >= 0.148 BuildRequires: zlib-devel
BuildRequires: x265-devel >= 1.9 BuildRequires: zimg-devel >= 3.0.1
BuildRequires: xz-devel
BuildRequires: zimg-devel
BuildRequires: git
BuildRequires: vulkan-loader
Requires: hicolor-icon-theme %ifarch x86_64
# needed for reading encrypted DVDs BuildRequires: libvpl-devel
%{?fedora:Recommends: libdvdcss%_isa} %endif
Obsoletes: HandBrake-cli < %version-%release
Provides: HandBrake-cli = %version-%release
Provides: handbrake = %version-%release
%description %description
%pkg is a general-purpose, free, open-source, cross-platform, multithreaded %{name} is a general-purpose, free, open-source, cross-platform, multithreaded
video transcoder software application. It can process most common multimedia video transcoder software application. It can process most common multimedia
files and any DVD or Bluray sources that do not contain any kind of copy files and any DVD or Bluray sources that do not contain any kind of copy
protection. protection.
This package contains the command line version of the program.
%package gui %package gui
Summary: An open-source multiplatform video transcoder (GUI) Summary: An open-source multiplatform video transcoder (GUI)
Provides: handbrake-gui = %version-%release Provides: handbrake-gui = %{?epoch:%{epoch}:}%{version}-%{release}
Provides: handbrake = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: gstreamer1-plugins-good%{_isa}
Requires: hicolor-icon-theme Requires: hicolor-icon-theme
# needed for reading encrypted DVDs Requires: libdvdcss%{_isa}
%{?fedora:Recommends: libdvdcss%_isa}
# needed for live preview
%{?fedora:Recommends: gstreamer1-plugins-good%_isa}
%description gui %description gui
%pkg is a general-purpose, free, open-source, cross-platform, multithreaded %{name} is a general-purpose, free, open-source, cross-platform, multithreaded
video transcoder software application. It can process most common multimedia video transcoder software application. It can process most common multimedia
files and any DVD or Bluray sources that do not contain any kind of copy files and any DVD or Bluray sources that do not contain any kind of copy
protection. protection.
This package contains the main program with a graphical interface. This package contains the main program with a graphical interface.
%package cli
Summary: An open-source multiplatform video transcoder (CLI)
Provides: handbrake-cli = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: libdvdcss%{_isa}
%description cli
%{name} is a general-purpose, free, open-source, cross-platform, multithreaded
video transcoder software application. It can process most common multimedia
files and any DVD or Bluray sources that do not contain any kind of copy
protection.
This package contains the command line version of the program.
%prep %prep
%if 0%{?tag:1} %if 0%{?tag:1}
%autosetup -p1
%else
%autosetup -p1 -n %{name}-%{commit0}
%endif %endif
git clone https://github.com/%pkg/%pkg mkdir -p download build/contrib/include
cd %pkg
git checkout %{!?tag:%commit0}%{?tag:%version}
%patch -P0 -p1
%if 0%!?_with_vpl
%patch -P1 -p1
%endif
%patch -P2 -p1
%patch -P3 -p1
%patch -P4 -p1
# Use system libraries in place of bundled ones # 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 fdk-aac ffmpeg libdav1d libdovi libdvdnav libdvdread libbluray libvpl nvenc svt-av1 x265 zimg; do
sed -i -e "/MODULES += contrib\/$module/d" make/include/main.defs sed -i -e "/MODULES += contrib\/$module/d" make/include/main.defs
done done
# Fix desktop file
sed -i -e 's/%desktop_id.svg/%desktop_id/g' gtk/src/%desktop_id.desktop
%build %build
cd %pkg echo "HASH=%{commit0}" > version.txt
echo "HASH=%commit0" > version.txt echo "SHORTHASH=%{shortcommit0}" >> version.txt
echo "SHORTHASH=%shortcommit0" >> version.txt echo "DATE=$(date "+%Y-%m-%d %T")" >> version.txt
echo "DATE=$(date "+%Y-%m-%d %T" -d %date)" >> version.txt
%if 0%{?tag:1} %if 0%{?tag:1}
echo "TAG=%version" >> version.txt echo "TAG=%{tag}" >> version.txt
echo "TAG_HASH=%commit0" >> version.txt echo "TAG_HASH=%{commit0}" >> version.txt
%endif %endif
# By default the project is built with optimizations for speed and no debug. # By default the project is built with optimizations for speed and no debug.
# Override configure settings by passing RPM_OPT_FLAGS and disabling preset # Override configure settings by passing RPM_OPT_FLAGS and disabling preset
# debug options. # debug options.
echo "GCC.args.O.speed = %optflags -I%_includedir/vpl -I%_includedir/ffmpeg -ldl -lx265 %{?_with_vpl:-lvpl}" > custom.defs # These plus "--no-harden" at configure time set proper compiler flags:
echo "GCC.args.g.none = " >> custom.defs cat > custom.defs << EOF
GCC.args.c_std =
GCC.args.cxx_std =
GCC.args.O.speed = %build_cflags -I%{_includedir}/vpl
GCC.args.g.none =
GCC.args.strip =
EOF
# Not an autotools configure script. # Not an autotools configure script:
./configure \ ./configure \
--build build \ --build %{_build} \
--prefix=%_prefix \
--debug=std \
--strip=%_bindir/echo \
--verbose \
--disable-df-fetch \ --disable-df-fetch \
--disable-df-verify \ --disable-df-verify \
--disable-gtk-update-checks \ --disable-update-checks \
%{?_with_asm:--enable-asm} \ --enable-asm \
--enable-x265 \
--disable-numa \
--enable-fdk-aac \ --enable-fdk-aac \
%{?_with_vpl:--enable-qsv} --enable-ffmpeg-aac \
--enable-gst \
--enable-libdovi \
--enable-numa \
--enable-nvdec \
--enable-nvenc \
%ifarch x86_64
--enable-qsv \
%endif
--enable-vce \
--enable-x265 \
--force \
--no-harden \
--prefix=%{_prefix}
%make_build -C build V=1 %make_build -C %{_build}
%install %install
cd %pkg %make_install -C %{_build}
%make_install -C build
cp *.markdown COPYING ..
# 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 -Dpm644 gtk/src/%desktop_id.desktop \
%buildroot%_datadir/applications/%desktop_id.desktop
install -Dpm644 gtk/src/%desktop_id.svg \
%buildroot%_datadir/icons/hicolor/scalable/apps/%desktop_id.svg
%find_lang ghb %find_lang ghb
%check %check
desktop-file-validate %buildroot%_datadir/applications/%desktop_id.desktop desktop-file-validate %{buildroot}/%{_datadir}/applications/%{desktop_id}.desktop
appstream-util validate-relax --nonet %buildroot%_metainfodir/%desktop_id.metainfo.xml appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/%{desktop_id}.metainfo.xml
%files gui %files -f ghb.lang gui
%license COPYING %license COPYING
%doc AUTHORS.markdown NEWS.markdown README.markdown THANKS.markdown %doc AUTHORS.markdown NEWS.markdown README.markdown THANKS.markdown
%_bindir/ghb %{_bindir}/ghb
%_metainfodir/%desktop_id.metainfo.xml %{_metainfodir}/%{desktop_id}.metainfo.xml
%_datadir/applications/%desktop_id.desktop %{_datadir}/applications/%{desktop_id}.desktop
%_datadir/icons/hicolor/scalable/apps/%desktop_id.svg %{_datadir}/icons/hicolor/scalable/apps/%{desktop_id}.svg
%_datadir/locale/*/LC_MESSAGES/ghb.mo
%files cli
%files
%license COPYING %license COPYING
%doc AUTHORS.markdown NEWS.markdown README.markdown THANKS.markdown %doc AUTHORS.markdown NEWS.markdown README.markdown THANKS.markdown
%_bindir/HandBrakeCLI %{_bindir}/HandBrakeCLI
%changelog
%autochangelog %autochangelog