Skip to content

Commit a484293

Browse files
mamins1376skrzyp1
authored andcommitted
Add void packages to mach bootstrap
1 parent fe30c0f commit a484293

File tree

1 file changed

+27
-10
lines changed

1 file changed

+27
-10
lines changed

python/servo/bootstrap.py

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ def run_as_root(command, force=False):
3030
if os.geteuid() != 0:
3131
command.insert(0, 'sudo')
3232
if force:
33-
command += "-y"
33+
command.append('-y')
3434
return subprocess.call(command)
3535

3636

37-
def install_linux_deps(context, pkgs_ubuntu, pkgs_fedora, force):
37+
def install_linux_deps(context, pkgs_ubuntu, pkgs_fedora, pkgs_void, force):
3838
install = False
3939
pkgs = []
4040
if context.distro in ['Ubuntu', 'Debian GNU/Linux']:
@@ -50,20 +50,27 @@ def install_linux_deps(context, pkgs_ubuntu, pkgs_fedora, force):
5050
if "|{}".format(p) not in installed_pkgs:
5151
install = True
5252
break
53+
elif context.distro == 'void':
54+
installed_pkgs = str(subprocess.check_output(['xbps-query', '-l']))
55+
pkgs = pkgs_void
56+
for p in pkgs:
57+
command = ['xbps-install', '-A']
58+
if "ii {}-".format(p) not in installed_pkgs:
59+
install = force = True
60+
break
5361

5462
if install:
55-
if force:
56-
command.append('-y')
5763
print("Installing missing dependencies...")
58-
run_as_root(command + pkgs)
59-
return True
60-
return False
64+
run_as_root(command + pkgs, force)
65+
66+
return install
6167

6268

6369
def install_salt_dependencies(context, force):
6470
pkgs_apt = ['build-essential', 'libssl-dev', 'libffi-dev', 'python-dev']
6571
pkgs_dnf = ['gcc', 'libffi-devel', 'python-devel', 'openssl-devel']
66-
if not install_linux_deps(context, pkgs_apt, pkgs_dnf, force):
72+
pkgs_xbps = ['gcc', 'libffi-devel', 'python-devel']
73+
if not install_linux_deps(context, pkgs_apt, pkgs_dnf, pkgs_xbps, force):
6774
print("Dependencies are already installed")
6875

6976

@@ -103,8 +110,17 @@ def linux(context, force=False):
103110
'clang', 'clang-libs', 'autoconf213', 'python3-devel',
104111
'gstreamer1-devel', 'gstreamer1-plugins-base-devel',
105112
'gstreamer1-plugins-bad-free-devel']
106-
107-
installed_something = install_linux_deps(context, pkgs_apt, pkgs_dnf, force)
113+
pkgs_xbps = ['libtool', 'gcc', 'libXi-devel', 'freetype-devel',
114+
'libunwind-devel', 'MesaLib-devel', 'glib-devel', 'pkg-config',
115+
'libX11-devel', 'libXrandr-devel', 'gperf', 'bzip2-devel',
116+
'fontconfig-devel', 'cabextract', 'expat-devel', 'cmake',
117+
'cmake', 'libXcursor-devel', 'libXmu-devel', 'dbus-devel',
118+
'ncurses-devel', 'harfbuzz-devel', 'ccache', 'glu-devel',
119+
'clang', 'gstreamer1-devel', 'autoconf213',
120+
'gst-plugins-base1-devel', 'gst-plugins-bad1-devel']
121+
122+
installed_something = install_linux_deps(context, pkgs_apt, pkgs_dnf,
123+
pkgs_xbps, force)
108124

109125
if not check_gstreamer_lib():
110126
installed_something |= gstreamer(context, force)
@@ -360,6 +376,7 @@ def get_linux_distribution():
360376
'centos linux',
361377
'debian gnu/linux',
362378
'fedora',
379+
'void',
363380
]:
364381
raise Exception('mach bootstrap does not support %s, please file a bug' % distrib)
365382

0 commit comments

Comments
 (0)