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
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
|
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../../general.ent">
%general-entities;
<!ENTITY chromium-download-http "https://commondatastorage.googleapis.com/chromium-browser-official/chromium-&chromium-version;.tar.xz">
<!ENTITY chromium-download-ftp " ">
<!ENTITY chromium-md5sum "0c361a429c5dcea568cbc7b001a82d92">
<!ENTITY chromium-size "460 MB">
<!ENTITY chromium-buildsize "6.0 GB">
<!ENTITY chromium-time "120 SBU (with parallelism=4)">
<!-- Ninja defaults to parallel build unless supplying -jx, SBU measured on
dual core, hyperthreaded CPU (4 threads).
I measured with -j4. - Bruce
-->
]>
<sect1 id="chromium" xreflabel="Chromium-&chromium-version;">
<?dbhtml filename="chromium.html"?>
<sect1info>
<date>$Date$</date>
</sect1info>
<title>Chromium-&chromium-version;</title>
<indexterm zone="chromium">
<primary sortas="a-Chromium">Chromium</primary>
</indexterm>
<sect2 role="package">
<title>Introduction to Chromium</title>
<para><application>Chromium</application> is an open-source browser project
that aims to build a safer, faster, and more stable way for all users to
experience the web.</para>
&lfs82_checked;
<bridgehead renderas="sect3">Package Information</bridgehead>
<itemizedlist spacing="compact">
<listitem>
<para>Download (HTTP): <ulink url="&chromium-download-http;"/></para>
</listitem>
<listitem>
<para>Download (FTP): <ulink url="&chromium-download-ftp;"/></para>
</listitem>
<listitem>
<para>Download MD5 sum: &chromium-md5sum;</para>
</listitem>
<listitem>
<para>Download size: &chromium-size;</para>
</listitem>
<listitem>
<para>Estimated disk space required: &chromium-buildsize;</para>
</listitem>
<listitem>
<para>Estimated build time: &chromium-time;</para>
</listitem>
</itemizedlist>
<bridgehead renderas="sect3">Additional Downloads</bridgehead>
<bridgehead renderas="sect4">Required patch:</bridgehead>
<itemizedlist spacing="compact">
<listitem>
<para>
<ulink url="&patch-root;/chromium-&chromium-version;-constexpr-1.patch"/>
</para>
</listitem>
<!-- <listitem>
<para>
<ulink url="&patch-root;/chromium-&chromium-version;-glibc-2.26-1.patch"/>
</para>
</listitem>
<listitem>
<para>
<ulink url="&patch-root;/chromium-&chromium-version;-gn_bootstrap-1.patch"/>
</para>
</listitem> -->
</itemizedlist>
<bridgehead renderas="sect4">Optional Chrome binaries to extract the
<application>WideVine</application> plug-in (Netflix) support:</bridgehead>
<itemizedlist spacing="compact">
<listitem>
<para>Download (HTTP):
<ulink url="http://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_&chromium-version;-1_amd64.deb"/>
</para>
</listitem>
<listitem>
<para>Download MD5 sum: 1caee436e3dc8fda6560a421e60717e4</para>
</listitem>
<listitem>
<para>Download size: 49.1 MB</para>
</listitem>
</itemizedlist>
<itemizedlist spacing="compact">
<listitem>
<para>Download (HTTP):
<ulink url="http://mirror.retrosnub.co.uk/apt/google/pool/main/g/google-chrome-stable/google-chrome-stable_48.0.2564.116-1_i386.deb"/>
</para>
</listitem>
<listitem>
<para>Download MD5 sum: 895e877b9bfe5da05a061369c2078626</para>
</listitem>
<listitem>
<para>Download size: 45.3 MB</para>
</listitem>
</itemizedlist>
<bridgehead renderas="sect3">Chromium Dependencies</bridgehead>
<bridgehead renderas="sect4">Required</bridgehead>
<para role="required">
<xref linkend="alsa-lib"/>,
<xref linkend="cups"/>,
<xref linkend="desktop-file-utils"/>,
<xref linkend="dbus"/>,
<xref linkend="perl-file-basedir"/>,
<xref linkend="gtk3"/>,
<xref linkend="hicolor-icon-theme"/>,
<xref linkend="mitkrb"/>,
<xref linkend="mesa"/>,
<xref linkend="nodejs"/>,
<xref linkend="nss"/>,
<xref linkend="python2"/>,
<xref linkend="usbutils"/>, and
<xref linkend="x-window-system"/>
</para>
<bridgehead renderas="sect4">Recommended</bridgehead>
<para role="recommended">
<xref linkend="make-ca"/> (runtime),
<!-- <xref linkend="ffmpeg"/>, -->
<xref linkend="flac"/>,
<xref linkend="git"/>,
<!-- <xref linkend="icu"/>, -->
<!-- <xref linkend="libevent"/>, -->
<xref linkend="liberation-fonts"/>
<xref linkend="libexif"/>,
<xref linkend="libjpeg"/>,
<!-- <xref linkend="libpng"/>, -->
<xref linkend="libsecret"/>,
<!-- <xref linkend="libvpx"/>, -->
<xref linkend="libwebp"/>,
<xref linkend="pciutils"/>,
<xref linkend="pulseaudio"/>,
<xref linkend="xdg-utils"/>, and
<xref linkend="yasm"/>
</para>
<bridgehead renderas="sect4">Optional</bridgehead>
<para role="optional">
<xref linkend="ffmpeg"/> (currently broken),<!-- https://crbug.com/731766 -->
<xref linkend="GConf"/>,
<xref linkend="icu"/> (currently broken),<!-- Review comments at https://chromium.googlesource.com/chromium/src/+/e58fa0ba66272c5f28828b15d06c7e42a9882b3b to verify fitness for BLFS's ICU build -->
<xref linkend="gnome-keyring"/>,
<xref linkend="libevent"/>,
<xref linkend="libpng"/> (currently broken),<!-- https://crbug.com/75240 -->
<xref linkend="libvpx"/> (currently broken),<!-- https://bugs.gentoo.org/611394 -->
<xref linkend="libxml2"/> (currently broken),<!-- https://crbug.com/736026 -->
<xref linkend="upower"/> (runtime),
<ulink url="https://devel.freebsoft.org/speechd">speech-dispatcher</ulink>
(for the screen reader), and
<ulink url="https://google.github.io/snappy">snappy</ulink>
</para>
<para condition="html" role="usernotes">User Notes:
<ulink url="&blfs-wiki;/chromium"/></para>
</sect2>
<sect2 role="installation">
<title>Installation of Chromium</title>
<para>Enable the use of the
<ulink url="http://www.widevine.com/">WideVine</ulink> plugin, needed for
Netflix support (see the WideVine section below). Define an
available product name ("Pinkie Pie" in this case) with the following
command:</para>
<screen><userinput>line='#define WIDEVINE_CDM_VERSION_STRING "Pinkie Pie"'
sed "/WIDEVINE_CDM_AVAILABLE/a$line" \
-i third_party/widevine/cdm/stub/widevine_cdm_version.h</userinput></screen>
<para>Optionally silence several (2000+) invalid warnings:</para>
<screen><userinput>sed '/static_assert/s:^://:' \
-i third_party/WebKit/Source/platform/wtf/text/TextCodec.h</userinput></screen>
<para>Fix a build issue with recent versions of GCC:</para>
<screen><userinput>patch -Np1 -i ../chromium-&chromium-version;-constexpr-1.patch</userinput></screen>
<para>Remove third-party build files that interfere with system versions:</para>
<note>
<para>
Chromium uses many external projects, the selections below are not set
in stone, however they have been tested thoroughly. With Chromium
&chromium-version;, system versions of libvpx, libxml2,
and zlib are known to break the build at this time.
<!-- icu: Now at 59 internally - seems to work now -->
<!-- icu: Now at 60 - is broken -->
<!-- libevent: needs internal headers - seems to work now -->
<!-- libvpx: breaks build in gfx -->
<!-- libxml2: breaks build with ui - seems to work now -->
<!-- zlib requires libminizip -->
</para>
</note>
<!-- Again, thanks to Arch, this is much better than listing all the needed
shipped libs required to use the remove_bundled_files.py script -->
<screen><userinput>for LIB in <!--ffmpeg -->flac freetype harfbuzz-ng<!-- icu libevent--> libjpeg \
libjpeg_turbo<!-- libpng--> libwebp <!-- libxml libvpx-->libxslt yasm; do
find -type f -path "*third_party/$LIB/*" \
\! -path "*third_party/$LIB/chromium/*" \
\! -path "*third_party/$LIB/google/*" \
\! -path "*base/third_party/icu/*" \
\! -path './third_party/yasm/run_yasm.py' \
\! -regex '.*\.\(gn\|gni\|isolate\|py\)' \
\! -path './third_party/freetype/src/src/psnames/pstables.h' \
-delete
done &&
python build/linux/unbundle/replace_gn_files.py \
--system-libraries<!-- ffmpeg--> flac <!-- harfbuzz-ng -->libjpeg libxml libevent \
<!--libpng -->libwebp libxslt opus yasm <!-- freetype libxml libvpx--> &&
python third_party/libaddressinput/chromium/tools/update-strings.py</userinput></screen>
<para><application>Chromium</application> uses an internal tool, <ulink
url="https://chromium.googlesource.com/chromium/src/tools/gn">gn</ulink>,
to generate the <application>Ninja</application> build files. Complete
configuration of the build using the following commands:</para>
<note>
<para>
<!-- Taken from Arch Linux - an immensely helpful link - Thanks -->
The Google API Key and OAuth tokens below are specific to LFS. If using
these instructions for another distro, or if you intend to distribute
binary copies of the software using these instructions, please obtain
your own keys following the instructions located at
<ulink url="http://www.chromium.org/developers/how-tos/api-keys"/>.
<!-- BLFS Devs, register an account at Google with your
@linuxfromscratch.org email address, and I'll make you an administrator
for the 'Google APIs for LFS' project (where the API and OAuth keys
were created for use in the book).-->
</para>
</note>
<screen><userinput>GN_CONFIG=('google_api_key="AIzaSyDxKL42zsPjbke5O8_rPVpVrLrJ8aeE9rQ"'
'google_default_client_id="595013732528-llk8trb03f0ldpqq6nprjp1s79596646.apps.googleusercontent.com"'
'google_default_client_secret="5ntt6GbbkjnTVXx-MSxbmx5e"'
'clang_use_chrome_plugins=false'
'enable_hangout_services_extension=true'
'enable_nacl=false'
'enable_nacl_nonsfi=false'
'enable_swiftshader=false'
'enable_widevine=true'
'fatal_linker_warnings=false'
'ffmpeg_branding="Chrome"'
'fieldtrial_testing_like_official_build=true'
'is_debug=false'
'is_clang=false'
'link_pulseaudio=true'
'linux_use_bundled_binutils=false'
'proprietary_codecs=true'
'remove_webcore_debug_symbols=true'
'symbol_level=0'
'treat_warnings_as_errors=false'
'use_allocator="none"'
'use_cups=true'
'use_gconf=false'
'use_gnome_keyring=false'
'use_gold=false'
'use_gtk3=true'
'use_kerberos=true'
'use_pulseaudio=true'
'use_sysroot=false'
'use_system_freetype=true'
'use_system_harfbuzz=true')</userinput></screen>
<para>Build <application>gn</application> and use it to prepare the
<application>Ninja</application> build files:</para>
<screen><userinput>python tools/gn/bootstrap/bootstrap.py --gn-gen-args "${GN_CONFIG[*]}" &&
out/Release/gn gen out/Release --args="${GN_CONFIG[*]}"</userinput></screen>
<warning>
<para>Ninja, by default, sets the number of jobs to the number of
available threads. If your machine is memory constrained, with regard to
number of threads, you should reduce the number of jobs by passing the
<parameter>-j#</parameter> switch to the <command>ninja</command> command
below. Plan for roughly 1.25GB per thread while linking
<application>WebKit</application> to avoid out of memory errors.</para>
</warning>
<para>Build <application>Chromium</application> using the following
commands:</para>
<screen><userinput>mkdir -p third_party/node/linux/node-linux-x64/bin &&
ln -s /usr/bin/node third_party/node/linux/node-linux-x64/bin/ &&
ninja -C out/Release chrome chrome_sandbox chromedriver widevinecdmadapter</userinput></screen>
<para>This package was already tested as part of the build.</para>
<para>Now, as the <systemitem class="username">root</systemitem> user,
install the package:</para>
<screen role="root"><userinput>install -vDm755 out/Release/chrome \
/usr/lib/chromium/chromium &&
install -vDm4755 out/Release/chrome_sandbox \
/usr/lib/chromium/chrome-sandbox &&
install -vDm755 out/Release/chromedriver \
/usr/lib/chromium/chromedriver &&
ln -svf /usr/lib/chromium/chromium /usr/bin &&
ln -svf /usr/lib/chromium/chromedriver /usr/bin &&
install -vDm644 out/Release/gen/content/content_resources.pak \
/usr/lib/chromium/ &&
<!-- This is needed if using internal icu -->
install -vDm644 out/Release/icudtl.dat \
/usr/lib/chromium/icudtl.dat &&
install -vDm644 out/Release/{*.pak,*.bin} \
/usr/lib/chromium/ &&
sed -i \
-e "s/@@MENUNAME@@/Chromium/g" \
-e "s/@@PACKAGE@@/chromium/g" \
-e "s/@@USR_BIN_SYMLINK_NAME@@/chromium/g" \
chrome/installer/linux/common/desktop.template \
chrome/app/resources/manpage.1.in &&
install -vDm644 chrome/installer/linux/common/desktop.template \
/usr/share/applications/chromium.desktop &&
install -vDm644 chrome/app/resources/manpage.1.in \
/usr/share/man/man1/chromium.1 &&
cp -av out/Release/locales /usr/lib/chromium/ &&
chown -Rv root:root /usr/lib/chromium/locales &&
for size in 16 32; do
install -vDm644 \
"chrome/app/theme/default_100_percent/chromium/product_logo_$size.png" \
"/usr/share/icons/hicolor/${size}x${size}/apps/chromium.png"
done &&
for size in 22 24 48 64 128 256; do
install -vDm644 "chrome/app/theme/chromium/product_logo_$size.png" \
"/usr/share/icons/hicolor/${size}x${size}/apps/chromium.png"
done</userinput></screen>
<note>
<para>If upgrading from a previous build of chromium using gtk+-2.x, you
may need to remove the <filename
class="directory">~/.config/chromium</filename> directory.</para>
</note>
<bridgehead renderas="sect3">Extracting the WideVine plugin from Chrome</bridgehead>
<para>Extract the downloaded deb file with the following commands:</para>
<screen><userinput>mkdir temp &&
cd temp &&
case $(uname -m) in
x86_64) ar -x ../../google-chrome-stable_&chromium-version;-1_amd64.deb
;;
i?86) ar -x ../../google-chrome-stable_48.0.2564.116-1_i386.deb
;;
esac</userinput></screen>
<para>As the <systemitem class="username">root</systemitem> user, enable
the WideVine plugin with the following commands:</para>
<!-- Note that libwidevinecdmadapter.so is not in the tarball. It is
created only if enable_widevine=true i sset in GN_CONFIG -->
<screen role="root"><userinput>tar -xf data.tar.xz &&
install -vm755 ../out/Release/libwidevinecdmadapter.so /usr/lib/chromium/ &&
install -vm755 opt/google/chrome/libwidevinecdm.so /usr/lib/chromium/</userinput></screen>
</sect2>
<sect2 role="commands">
<title>Command Explanations</title>
<para><command>GN_CONFIG=(...)</command>: this array contains
all of the defines used in the build.</para>
<para><command>python tools/gn/bootstrap/bootstrap.py --gn-gen-args "${GN_CONFIG[*]}"</command>:
this command replaces defines in the gn files with the values contained in
<envar>${GN_CONFIG[@]}</envar>.</para>
<para><command>out/Release/gn gen out/Release --args="${GN_CONFIG[*]}"</command>:
this command runs a Google provided configuration script
<application>gn</application> on the source tree to produce
a <application>Ninja</application> configuration suitable for the build
machine.</para>
<para><command>mkdir...ln -s /usr/bin/node
third_party/node/linux/node-linux-x64/bin/</command>: these commands
replaced the local <application>Node.js</application> (no longer available)
with the system installed <application>Node.js</application>.</para>
<para><command>ar -x ../../google-chrome-stable*.deb</command>:
the <command>ar</command> utility is used to extract Debian archives.</para>
</sect2>
<sect2 role="content">
<title>Contents</title>
<segmentedlist>
<segtitle>Installed Programs</segtitle>
<segtitle>Installed Libraries</segtitle>
<segtitle>Installed Directories</segtitle>
<seglistitem>
<seg>/usr/lib/chromium/chromium,
/usr/lib/chromium/chromedriver, and
/usr/lib/chromium/chrome-sandbox</seg>
<seg>none</seg>
<seg>/usr/lib/chromium</seg>
</seglistitem>
</segmentedlist>
<variablelist>
<bridgehead renderas="sect3">Short Descriptions</bridgehead>
<?dbfo list-presentation="list"?>
<?dbhtml list-presentation="table"?>
<varlistentry id="chromium-lib">
<term><command>/usr/lib/chromium/chromium</command></term>
<listitem>
<para> is the main chromium executable.</para>
<indexterm zone="chromium chromium-lib">
<primary sortas="b-chromiumlib">chromium</primary>
</indexterm>
</listitem>
</varlistentry>
<varlistentry id="chromedriver">
<term><command>/usr/lib/chromium/chromedriver</command></term>
<listitem>
<para> is a
<ulink url="http://www.seleniumhq.org/projects/webdriver/">
WebDriver</ulink> for Chromium.</para>
<indexterm zone="chromium chromedriver">
<primary sortas="b-chromedriver">chromedriver</primary>
</indexterm>
</listitem>
</varlistentry>
<varlistentry id="chrome-sandbox">
<term><command>/usr/lib/chromium/chrome-sandbox</command></term>
<listitem>
<para> creates a sandboxed environment for running untrusted
code (plugins).</para>
<indexterm zone="chromium chrome-sandbox">
<primary sortas="b-chrome-sandbox">chrome-sandbox</primary>
</indexterm>
</listitem>
</varlistentry>
</variablelist>
</sect2>
</sect1>
|