File handbrake.spec of Package handbrake (Revision 84cd9d6f0e711b5281a5c7e9a08c56ea)

Currently displaying revision 84cd9d6f0e711b5281a5c7e9a08c56ea , Show latest

201
 
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.1
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(webkit2gtk-4.0)
82
BuildRequires:  pkgconfig(x264)
83
%if %{with qsv}
84
BuildRequires:  pkgconfig(libva)
85
BuildRequires:  pkgconfig(vpl)
86
%endif
87
%ifnarch %{arm}
88
BuildRequires:  libnuma-devel
89
%else
90
BuildRequires:  Mesa-libEGL1
91
BuildRequires:  Mesa-libEGL-devel
92
%endif
93
94
%description
95
HandBrake is an open-source, GPL-licensed, multiplatform, multithreaded video
96
transcoder.
97
98
%package cli
99
Summary:        Multithreaded Video Transcoder
100
Group:          Productivity/Multimedia/Video/Editors and Convertors
101
Provides:       handbrake-cli = %{version}
102
Obsoletes:      handbrake-cli < %{version}
103
104
%description cli
105
HandBrake is an open-source, GPL-licensed, multiplatform, multithreaded video
106
transcoder.
107
108
This package contains a command-line interface for Handbrake.
109
110
%package gtk
111
Summary:        Multithreaded Video Transcoder
112
Group:          Productivity/Multimedia/Video/Editors and Convertors
113
Recommends:     %{name}-gtk-lang = %{version}-%{release}
114
Provides:       handbrake-gtk = %{version}
115
Obsoletes:      handbrake-gtk < %{version}
116
117
%description gtk
118
HandBrake is an open-source, GPL-licensed, multiplatform, multithreaded video
119
transcoder.
120
121
This package contains a GTK+ graphical user interface for Handbrake.
122
123
%lang_package -n %{name}-gtk
124
125
%prep
126
%autosetup -p1 -n %{srcname}-%{version} -a 1
127
cp -vp %{SOURCE3} .
128
129
# disable contrib parts, that we provide externally
130
# beware: avoid omitting libs, if ghb uses patched versions (ffmpeg)
131
# or does build them in specific ways (x265)
132
for lib in libbluray libdvdnav libdvdread
133
do
134
    sed -i "/MODULES.*$lib/d" make/include/main.defs
135
    rm -rf contrib/$lib
136
done
137
# remove stray build folder
138
rm -rf build
139
140
%build
141
# the contrib libraries doesn't like LTO bindings
142
%define _lto_cflags %{nil}
143
export CFLAGS="%{optflags} -fno-strict-aliasing -Wno-unused"
144
export CXXFLAGS="$CFLAGS -Wno-reorder"
145
export PATH="%{_builddir}/%{name}-%{version}/build/contrib/bin:$PATH"
146
147
./configure \
148
    --prefix=%{_prefix} \
149
    --optimize=speed \
150
    --enable-fdk-aac \
151
    --enable-x265 \
152
    --enable-nvenc \
153
%if %{with qsv}
154
    --enable-qsv \
155
%endif
156
%ifarch %{arm}
157
    --enable-numa \
158
%endif
159
    --debug=max \
160
    --launch-jobs=$(nproc)
161
162
# don't redefine _FORTIFY_SOURCE; we define _FORTIFY_SOURCE=3 via CFLAGS already
163
sed -i 's: -D_FORTIFY_SOURCE=2::g' make/include/gcc.defs
164
pushd build
165
make -j$(nproc)
166
popd
167
168
%install
169
%makeinstall -C build
170
171
ln -sfvb ghb %{buildroot}%{_bindir}/HandBrakeGUI
172
173
%suse_update_desktop_file -r fr.handbrake.ghb AudioVideo AudioVideoEditing
174
175
# -f because it might not be there if built without gtk...
176
rm -vf "%{buildroot}%{_datadir}/icons"/*/*.cache
177
178
%find_lang ghb
179
180
%fdupes %{buildroot}
181
182
%files cli
183
%defattr(-,root,root)
184
%license COPYING
185
%doc *.markdown *.md
186
%{_bindir}/HandBrakeCLI
187
188
%files gtk
189
%defattr(-,root,root)
190
%license COPYING
191
%doc *.markdown *.md
192
%{_bindir}/HandBrakeGUI
193
%{_bindir}/ghb
194
%{_datadir}/applications/fr.handbrake.ghb.desktop
195
%{_datadir}/icons/hicolor/scalable/apps/fr.handbrake.ghb.svg
196
%{_datadir}/metainfo/fr.handbrake.ghb.metainfo.xml
197
198
%files -n %{name}-gtk-lang -f ghb.lang
199
200
%changelog
201