File handbrake.spec of Package handbrake
200
1
#
2
# spec file for package HandBrake
3
#
4
# Copyright (c) 2012 Pascal Bleser <pascal.bleser@opensuse.org>
5
# Copyright (c) 2014 B1 Systems GmbH, Vobhurg, Germany
6
# Copyright (c) 2019-2022 LISA GmbH, Bingen, Germany
7
# Copyright (c) 2025 SUSE LLC
8
#
9
# All modifications and additions to the file contributed by third parties
10
# remain the property of their copyright owners, unless otherwise agreed
11
# upon. The license for this file, and modifications and additions to the
12
# file, is the same license as for the pristine package itself (unless the
13
# license for the pristine package is not an Open Source License, in which
14
# case the license is the MIT License). An "Open Source License" is a
15
# license that conforms to the Open Source Definition (Version 1.9)
16
# published by the Open Source Initiative.
17
18
# Please submit bugfixes or comments via http://bugs.opensuse.org/
19
#
20
21
%ifarch x86_64
22
%bcond_without qsv
23
%endif
24
25
%define srcname HandBrake
26
27
Name: handbrake
28
Summary: Multithreaded Video Transcoder
29
Version: 1.9.2
30
Release: 0
31
Url: http://handbrake.fr/
32
Source0: https://github.com/HandBrake/HandBrake/archive/refs/tags/%{version}.tar.gz
33
Source1: download.tar.bz2
34
Source2: pre_checkin.sh
35
Source3: version.txt
36
License: GPL-2.0+
37
Group: Productivity/Multimedia/Video/Editors and Convertors
38
BuildRequires: autoconf
39
BuildRequires: automake
40
BuildRequires: cmake
41
BuildRequires: curl
42
BuildRequires: fdupes
43
BuildRequires: gcc
44
BuildRequires: gcc-c++
45
BuildRequires: intltool
46
BuildRequires: libtool
47
BuildRequires: make
48
BuildRequires: meson
49
BuildRequires: nasm
50
BuildRequires: python3
51
BuildRequires: subversion
52
BuildRequires: update-desktop-files
53
BuildRequires: wget
54
BuildRequires: glibc-devel
55
BuildRequires: libmp3lame-devel
56
BuildRequires: pkgconfig(bzip2)
57
BuildRequires: pkgconfig(dbus-glib-1)
58
BuildRequires: pkgconfig(dvdnav)
59
BuildRequires: pkgconfig(dvdread)
60
BuildRequires: pkgconfig(ffnvcodec)
61
BuildRequires: pkgconfig(gstreamer-1.0)
62
BuildRequires: pkgconfig(gstreamer-plugins-base-1.0)
63
BuildRequires: pkgconfig(gtk4)
64
BuildRequires: pkgconfig(gudev-1.0)
65
BuildRequires: pkgconfig(jansson)
66
BuildRequires: pkgconfig(libass)
67
BuildRequires: pkgconfig(libbluray) >= 1.0.2
68
BuildRequires: pkgconfig(libdrm)
69
BuildRequires: pkgconfig(libjpeg)
70
BuildRequires: pkgconfig(liblzma)
71
BuildRequires: pkgconfig(libnotify)
72
BuildRequires: pkgconfig(librsvg-2.0)
73
BuildRequires: pkgconfig(libxml-2.0)
74
BuildRequires: pkgconfig(ogg)
75
BuildRequires: pkgconfig(opus)
76
BuildRequires: pkgconfig(samplerate)
77
BuildRequires: pkgconfig(speex)
78
BuildRequires: pkgconfig(theora)
79
BuildRequires: pkgconfig(vorbis)
80
BuildRequires: pkgconfig(vpx) >= 1.4
81
BuildRequires: pkgconfig(x264)
82
%if %{with qsv}
83
BuildRequires: pkgconfig(libva)
84
BuildRequires: pkgconfig(vpl)
85
%endif
86
%ifnarch %{arm}
87
BuildRequires: libnuma-devel
88
%else
89
BuildRequires: Mesa-libEGL1
90
BuildRequires: Mesa-libEGL-devel
91
%endif
92
93
%description
94
HandBrake is an open-source, GPL-licensed, multiplatform, multithreaded video
95
transcoder.
96
97
%package cli
98
Summary: Multithreaded Video Transcoder
99
Group: Productivity/Multimedia/Video/Editors and Convertors
100
Provides: handbrake-cli = %{version}
101
Obsoletes: handbrake-cli < %{version}
102
103
%description cli
104
HandBrake is an open-source, GPL-licensed, multiplatform, multithreaded video
105
transcoder.
106
107
This package contains a command-line interface for Handbrake.
108
109
%package gtk
110
Summary: Multithreaded Video Transcoder
111
Group: Productivity/Multimedia/Video/Editors and Convertors
112
Recommends: %{name}-gtk-lang = %{version}-%{release}
113
Provides: handbrake-gtk = %{version}
114
Obsoletes: handbrake-gtk < %{version}
115
116
%description gtk
117
HandBrake is an open-source, GPL-licensed, multiplatform, multithreaded video
118
transcoder.
119
120
This package contains a GTK+ graphical user interface for Handbrake.
121
122
%lang_package -n %{name}-gtk
123
124
%prep
125
%autosetup -p1 -n %{srcname}-%{version} -a 1
126
cp -vp %{SOURCE3} .
127
128
# disable contrib parts, that we provide externally
129
# beware: avoid omitting libs, if ghb uses patched versions (ffmpeg)
130
# or does build them in specific ways (x265)
131
for lib in libbluray libdvdnav libdvdread
132
do
133
sed -i "/MODULES.*$lib/d" make/include/main.defs
134
rm -rf contrib/$lib
135
done
136
# remove stray build folder
137
rm -rf build
138
139
%build
140
# the contrib libraries doesn't like LTO bindings
141
%define _lto_cflags %{nil}
142
export CFLAGS="%{optflags} -fno-strict-aliasing -Wno-unused"
143
export CXXFLAGS="$CFLAGS -Wno-reorder"
144
export PATH="%{_builddir}/%{name}-%{version}/build/contrib/bin:$PATH"
145
146
./configure \
147
--prefix=%{_prefix} \
148
--optimize=speed \
149
--enable-fdk-aac \
150
--enable-x265 \
151
--enable-nvenc \
152
%if %{with qsv}
153
--enable-qsv \
154
%endif
155
%ifarch %{arm}
156
--enable-numa \
157
%endif
158
--debug=max \
159
--launch-jobs=$(nproc)
160
161
# don't redefine _FORTIFY_SOURCE; we define _FORTIFY_SOURCE=3 via CFLAGS already
162
sed -i 's: -D_FORTIFY_SOURCE=2::g' make/include/gcc.defs
163
pushd build
164
make -j$(nproc)
165
popd
166
167
%install
168
%makeinstall -C build
169
170
ln -sfvb ghb %{buildroot}%{_bindir}/HandBrakeGUI
171
172
%suse_update_desktop_file -r fr.handbrake.ghb AudioVideo AudioVideoEditing
173
174
# -f because it might not be there if built without gtk...
175
rm -vf "%{buildroot}%{_datadir}/icons"/*/*.cache
176
177
%find_lang ghb
178
179
%fdupes %{buildroot}
180
181
%files cli
182
%defattr(-,root,root)
183
%license COPYING
184
%doc *.markdown *.md
185
%{_bindir}/HandBrakeCLI
186
187
%files gtk
188
%defattr(-,root,root)
189
%license COPYING
190
%doc *.markdown *.md
191
%{_bindir}/HandBrakeGUI
192
%{_bindir}/ghb
193
%{_datadir}/applications/fr.handbrake.ghb.desktop
194
%{_datadir}/icons/hicolor/scalable/apps/fr.handbrake.ghb.svg
195
%{_datadir}/metainfo/fr.handbrake.ghb.metainfo.xml
196
197
%files -n %{name}-gtk-lang -f ghb.lang
198
199
%changelog
200