Skip to content

Commit b962ed6

Browse files
committed
docs: automate installation of asciidcotor ruby dependency with ./build
1 parent 45f2d63 commit b962ed6

File tree

3 files changed

+25
-6
lines changed

3 files changed

+25
-6
lines changed

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ DEPENDENCIES
1010
asciidoctor (= 2.0.10)
1111

1212
BUNDLED WITH
13-
2.0.1
13+
2.0.2

README.adoc

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15228,13 +15228,18 @@ but note that this does not include script specific options.
1522815228

1522915229
=== Build the documentation
1523015230

15231-
You don't need to depend on GitHub:
15231+
You don't need to depend on GitHub. To build the first time use:
1523215232

1523315233
....
15234-
sudo apt-get install rubygems
15235-
sudo gem install asciidoctor -v 2.0.10
15236-
./build-doc
15237-
xdg-open out/README.html
15234+
./build --download-dependencies docs
15235+
....
15236+
15237+
which also downloads build dependencies.
15238+
15239+
Then the following times just to the faster:
15240+
15241+
....
15242+
./build-docs
1523815243
....
1523915244

1524015245
Source: link:build-doc[]

build

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class _Component:
3535
submodules_shallow=None,
3636
python2_pkgs=None,
3737
python3_pkgs=None,
38+
ruby_pkgs=None,
3839
):
3940
self.build_callback = build_callback
4041
self.supported_archs = supported_archs
@@ -45,6 +46,7 @@ class _Component:
4546
self.submodules_shallow = submodules_shallow or set()
4647
self.python2_pkgs = python2_pkgs or set()
4748
self.python3_pkgs = python3_pkgs or set()
49+
self.ruby_pkgs = ruby_pkgs or set()
4850

4951
def build(self, arch):
5052
if (
@@ -233,6 +235,9 @@ so looping over all of them would waste time.
233235
),
234236
'doc': _Component(
235237
self._build_file('build-doc'),
238+
ruby_pkgs={
239+
'asciidoctor',
240+
},
236241
),
237242
'gem5': _Component(
238243
self._build_file('build-gem5'),
@@ -457,13 +462,18 @@ Which components to build. Default: qemu-buildroot
457462
python3_pkgs = {
458463
'pexpect==4.6.0',
459464
}
465+
ruby_pkgs = set()
460466
for component in selected_components:
461467
apt_get_pkgs.update(component.apt_get_pkgs)
462468
apt_build_deps.update(component.apt_build_deps)
463469
submodules.update(component.submodules)
464470
submodules_shallow.update(component.submodules_shallow)
465471
python2_pkgs.update(component.python2_pkgs)
466472
python3_pkgs.update(component.python3_pkgs)
473+
python3_pkgs.update(component.python3_pkgs)
474+
ruby_pkgs.update(component.ruby_pkgs)
475+
if ruby_pkgs:
476+
apt_get_pkgs.add('ruby')
467477
if apt_get_pkgs or apt_build_deps:
468478
if self.env['travis']:
469479
interacive_pkgs = {
@@ -514,6 +524,10 @@ Which components to build. Default: qemu-buildroot
514524
['python3', '-m', 'pip', 'install', '--user', LF] +
515525
self.sh.add_newlines(sorted(python3_pkgs))
516526
)
527+
if ruby_pkgs:
528+
# TODO fails without sudo and with --local on Ubuntu 18.04.
529+
self.sh.run_cmd(['sudo', 'gem', 'install', 'bundler', LF])
530+
self.sh.run_cmd(['bundle', 'install', LF])
517531
git_cmd_common = [
518532
'git', LF,
519533
'submodule', LF,

0 commit comments

Comments
 (0)