-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathopera-stable-libffmpeg.spec
294 lines (259 loc) · 8.64 KB
/
opera-stable-libffmpeg.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
%global build_for_x86_64 1
%global build_for_i386 0
%define chromium_system_libs 0
%define chromium_ver 44.0.2403.155
%define opera_major_ver 31
%define opera_chan opera-stable
%if 0%{?fedora} >= 21
%define clang 1
%else
%define clang 0
%endif
Summary: Additional FFmpeg library for Opera Web browser providing H264 and MP3 support
Name: %{opera_chan}-libffmpeg
Version: %{opera_major_ver}.0.1889.174
Release: 1%{?dist}
Epoch: 5
Group: Applications/Internet
License: BSD, LGPL
URL: https://gist.github.com/lukaszzek/ec04d5c953226c062dac
Source0: https://commondatastorage.googleapis.com/chromium-browser-official/chromium-%{chromium_ver}.tar.xz
Source1: depot_tools.tar.xz
Source2: gn-binaries.tar.xz
Source3: check_chromium_version.sh
Patch0: 00-ffmpeg_gyp.patch
%ifarch x86_64
Provides: libffmpeg.so.%{opera_major_ver}()(64bit)
%else
Provides: libffmpeg.so.%{opera_major_ver}
%endif
%if 0%{?build_for_x86_64}
%if !0%{?build_for_i386}
ExclusiveArch: x86_64
%else
ExclusiveArch: x86_64 i686
%endif
%else
%if 0%{?build_for_i386}
ExclusiveArch: i686
%endif
%endif
BuildRequires: SDL-devel
BuildRequires: alsa-lib-devel
BuildRequires: bison
BuildRequires: bzip2-devel
BuildRequires: cups-devel
BuildRequires: desktop-file-utils
BuildRequires: dirac-devel >= 1.0.0
BuildRequires: elfutils-libelf-devel
BuildRequires: elfutils-devel
BuildRequires: expat-devel
BuildRequires: fdupes
BuildRequires: flac-devel
BuildRequires: flex
BuildRequires: freetype-devel
BuildRequires: gperf
BuildRequires: gsm
BuildRequires: gsm-devel
BuildRequires: gstreamer1-devel
BuildRequires: gstreamer1-plugins-base-devel
BuildRequires: gyp
BuildRequires: hicolor-icon-theme
BuildRequires: hunspell-devel
BuildRequires: imlib2-devel
BuildRequires: jack-audio-connection-kit-devel
BuildRequires: krb5-devel
BuildRequires: libcap-devel
BuildRequires: libdc1394
BuildRequires: libdc1394-devel
BuildRequires: libdrm-devel
BuildRequires: libdrm-devel
BuildRequires: libgcrypt-devel
BuildRequires: libgnome-keyring-devel
BuildRequires: libogg-devel
BuildRequires: liboil-devel >= 0.3.15
BuildRequires: libtheora-devel >= 1.1
BuildRequires: libusbx-devel
BuildRequires: libvdpau-devel
BuildRequires: libvorbis-devel
BuildRequires: libvpx-devel
BuildRequires: ncurses-devel
BuildRequires: ninja-build
BuildRequires: pam-devel
BuildRequires: pciutils-devel
BuildRequires: perl(Switch)
BuildRequires: pkgconfig
BuildRequires: pkgconfig(cairo) >= 1.6
BuildRequires: pkgconfig(dbus-1)
BuildRequires: pkgconfig(gconf-2.0)
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(gtk+-2.0)
BuildRequires: pkgconfig(libcrypto)
BuildRequires: pkgconfig(libexif)
BuildRequires: pkgconfig(libexif)
BuildRequires: pkgconfig(libudev)
BuildRequires: pkgconfig(nspr) >= 4.9.5
BuildRequires: pkgconfig(nss) >= 3.14
BuildRequires: pkgconfig(x11)
BuildRequires: pkgconfig(xcomposite)
BuildRequires: pkgconfig(xcursor)
BuildRequires: pkgconfig(xdamage)
BuildRequires: pkgconfig(xext)
BuildRequires: pkgconfig(xfixes)
BuildRequires: pkgconfig(xi)
BuildRequires: pkgconfig(xrandr)
BuildRequires: pkgconfig(xrender)
BuildRequires: pkgconfig(xscrnsaver)
BuildRequires: pkgconfig(xt)
BuildRequires: pkgconfig(xtst)
BuildRequires: pulseaudio-libs-devel
BuildRequires: python
BuildRequires: python-devel
BuildRequires: schroedinger-devel
BuildRequires: slang-devel
BuildRequires: speech-dispatcher-devel
BuildRequires: sqlite-devel
BuildRequires: texinfo
BuildRequires: util-linux
BuildRequires: valgrind-devel
%if 0%{?chromium_system_libs}
BuildRequires: libicu-devel >= 4.0
BuildRequires: libjpeg-turbo-devel
BuildRequires: perl-JSON
BuildRequires: usbutils
BuildRequires: yasm
BuildRequires: pkgconfig(libevent)
BuildRequires: pkgconfig(libmtp)
BuildRequires: pkgconfig(libpng)
BuildRequires: pkgconfig(libusb-1.0)
BuildRequires: pkgconfig(libxslt)
BuildRequires: pkgconfig(libxml-2.0)
BuildRequires: pkgconfig(opus)
BuildRequires: pkgconfig(protobuf)
BuildRequires: pkgconfig(speex)
%endif
%if ! %{defined rhel}
%if 0%{?fedora} < 22
BuildRequires: faac-devel >= 1.28
%endif
BuildRequires: lame-devel
BuildRequires: opencore-amr-devel
BuildRequires: wdiff
BuildRequires: x264-devel
BuildRequires: xvidcore-devel
%endif
%if 0%{?clang}
BuildRequires: clang
%endif
Requires: %{opera_chan} = 5:%{version}
%description
Due to changes in Chromium, Opera is no longer able to use the system FFmpeg
library for H264 video playback on Linux, so H264-encoded videos fail to play by
default (but HTML5 video encoded using different formats, like webm, work). For
legal reasons, Opera may not be distributed with H264 compatible FFmpeg library
included into package.
It's possible to build the extra version of Chromium modified FFmpeg providing
H264 and MP3 support. Opera-libffmpeg package includes this library.
%prep
%setup -q -c
# Create symlink for compatibility with %patch0
pushd %{_builddir}/%{name}-%{version}
ln -s chromium-%{chromium_ver} chromium
popd
%patch0 -p1
cd %{_builddir}/%{name}-%{version}/chromium-%{chromium_ver}
xz -d %{SOURCE1}
xz -d %{SOURCE2}
%build
buildconfig+="-Dwerror=
-Dcomponent=shared_library
-Dffmpeg_branding=Chrome
-Dffmpeg_soname_version=%{opera_major_ver}"
%if 0%{?clang}
buildconfig+=" -Dclang=1
-Dclang_use_chrome_plugins=0"
%else
buildconfig+=" -Dclang=0"
%endif
%if 0%{?chromium_system_libs}
buildconfig+=" -Duse_system_icu=1
-Duse_system_flac=1
-Duse_system_speex=1
-Duse_system_libexif=1
-Duse_system_libevent=1
-Duse_system_libmtp=1
-Duse_system_opus=1
-Duse_system_bzip2=1
-Duse_system_harfbuzz=1
-Duse_system_libjpeg=1
-Duse_system_libpng=1
-Duse_system_libxslt=1
-Duse_system_libxml=1
-Duse_system_libyuv=1
-Duse_system_nspr=1
-Duse_system_protobuf=1
-Duse_system_yasm=1"
%else
buildconfig+=" -Duse_system_icu=0
-Duse_system_flac=0
-Duse_system_speex=0
-Duse_system_libexif=0
-Duse_system_libevent=0
-Duse_system_libmtp=0
-Duse_system_opus=0
-Duse_system_bzip2=0
-Duse_system_harfbuzz=0
-Duse_system_libjpeg=0
-Duse_system_libpng=0
-Duse_system_libxslt=0
-Duse_system_libxml=0
-Duse_system_libyuv=0
-Duse_system_nspr=0
-Duse_system_protobuf=0
-Duse_system_yasm=0"
%endif
%ifarch x86_64
buildconfig+=" -Dsystem_libdir=lib64
-Dtarget_arch=x64"
%endif
buildconfig+=" -Duse_pulseaudio=1
-Dlinux_link_libpci=1
-Dlinux_link_gnome_keyring=1
-Dlinux_link_gsettings=1
-Dlinux_link_libgps=1
-Dlinux_link_libspeechd=1
-Djavascript_engine=v8
-Dlinux_use_gold_binary=0
-Dlinux_use_gold_flags=0
-Dgoogle_api_key=AIzaSyD1hTe85_a14kr1Ks8T3Ce75rvbR1_Dx7Q
-Dgoogle_default_client_id=4139804441.apps.googleusercontent.com
-Dgoogle_default_client_secret=KDTRKEZk2jwT_7CDpcmMA--P"
%if 0%{?fedora} >= 20
buildconfig+=" -Dlibspeechd_h_prefix=speech-dispatcher/"
%endif
%if 0%{?clang}
export CC=/usr/bin/clang
export CXX=/usr/bin/clang++
# Modern Clang produces a *lot* of warnings
export CXXFLAGS="${CXXFLAGS} -Wno-unknown-warning-option -Wno-unused-local-typedef -Wunknown-attributes -Wno-tautological-undefined-compare"
export GYP_DEFINES="clang=1 enable_hidpi=1 enable_touch_ui=1 enable_hotwording=0"
%else
export GYP_DEFINES="enable_hidpi=1 enable_touch_ui=1 enable_hotwording=0"
%endif
cd %{_builddir}/%{name}-%{version}/chromium-%{chromium_ver}
./build/linux/unbundle/replace_gyp_files.py $buildconfig
export GYP_GENERATORS='ninja'
./build/gyp_chromium build/all.gyp --depth=. $buildconfig
mkdir -p %{_builddir}/%{name}-%{version}/chromium-%{chromium_ver}/out/Release
ninja-build -C %{_builddir}/%{name}-%{version}/chromium-%{chromium_ver}/out/Release ffmpeg
%install
mkdir -p %{buildroot}%{_libdir}/%{opera_chan}/lib_extra
install -m 644 %{_builddir}/%{name}-%{version}/chromium-%{chromium_ver}/out/Release/lib/libffmpeg.so.%{opera_major_ver} %{buildroot}%{_libdir}/%{opera_chan}/lib_extra/
%files
%{_libdir}/%{opera_chan}/lib_extra/libffmpeg.so.*
%changelog
* Thu Aug 20 2015 carasin berlogue <carasin DOT berlogue AT mail DOT ru> 31.0.1889.174-1.R
- Update to 31.0.1889.174
- Add check_chromium_version.sh
* Wed Aug 12 2015 carasin berlogue <carasin DOT berlogue AT mail DOT ru> 31.0.1889.99-1.R
- Initial build