From 0b84208a0b54d96ebd784b345f07509c0e020977 Mon Sep 17 00:00:00 2001 From: Mohammad Amin Sameti Date: Sun, 5 Apr 2020 17:58:58 +0430 Subject: Add void packages to mach bootstrap --- python/servo/bootstrap.py | 37 +++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) (limited to 'python/servo/bootstrap.py') diff --git a/python/servo/bootstrap.py b/python/servo/bootstrap.py index 182c8fcc587..0e9dbeb7981 100644 --- a/python/servo/bootstrap.py +++ b/python/servo/bootstrap.py @@ -30,11 +30,11 @@ def run_as_root(command, force=False): if os.geteuid() != 0: command.insert(0, 'sudo') if force: - command += "-y" + command.append('-y') return subprocess.call(command) -def install_linux_deps(context, pkgs_ubuntu, pkgs_fedora, force): +def install_linux_deps(context, pkgs_ubuntu, pkgs_fedora, pkgs_void, force): install = False pkgs = [] if context.distro in ['Ubuntu', 'Debian GNU/Linux']: @@ -50,20 +50,27 @@ def install_linux_deps(context, pkgs_ubuntu, pkgs_fedora, force): if "|{}".format(p) not in installed_pkgs: install = True break + elif context.distro == 'void': + installed_pkgs = str(subprocess.check_output(['xbps-query', '-l'])) + pkgs = pkgs_void + for p in pkgs: + command = ['xbps-install', '-A'] + if "ii {}-".format(p) not in installed_pkgs: + install = force = True + break if install: - if force: - command.append('-y') print("Installing missing dependencies...") - run_as_root(command + pkgs) - return True - return False + run_as_root(command + pkgs, force) + + return install def install_salt_dependencies(context, force): pkgs_apt = ['build-essential', 'libssl-dev', 'libffi-dev', 'python-dev'] pkgs_dnf = ['gcc', 'libffi-devel', 'python-devel', 'openssl-devel'] - if not install_linux_deps(context, pkgs_apt, pkgs_dnf, force): + pkgs_xbps = ['gcc', 'libffi-devel', 'python-devel'] + if not install_linux_deps(context, pkgs_apt, pkgs_dnf, pkgs_xbps, force): print("Dependencies are already installed") @@ -103,8 +110,17 @@ def linux(context, force=False): 'clang', 'clang-libs', 'autoconf213', 'python3-devel', 'gstreamer1-devel', 'gstreamer1-plugins-base-devel', 'gstreamer1-plugins-bad-free-devel'] - - installed_something = install_linux_deps(context, pkgs_apt, pkgs_dnf, force) + pkgs_xbps = ['libtool', 'gcc', 'libXi-devel', 'freetype-devel', + 'libunwind-devel', 'MesaLib-devel', 'glib-devel', 'pkg-config', + 'libX11-devel', 'libXrandr-devel', 'gperf', 'bzip2-devel', + 'fontconfig-devel', 'cabextract', 'expat-devel', 'cmake', + 'cmake', 'libXcursor-devel', 'libXmu-devel', 'dbus-devel', + 'ncurses-devel', 'harfbuzz-devel', 'ccache', 'glu-devel', + 'clang', 'gstreamer1-devel', 'autoconf213', + 'gst-plugins-base1-devel', 'gst-plugins-bad1-devel'] + + installed_something = install_linux_deps(context, pkgs_apt, pkgs_dnf, + pkgs_xbps, force) if not check_gstreamer_lib(): installed_something |= gstreamer(context, force) @@ -360,6 +376,7 @@ def get_linux_distribution(): 'centos linux', 'debian gnu/linux', 'fedora', + 'void', ]: raise Exception('mach bootstrap does not support %s, please file a bug' % distrib) -- cgit v1.2.3