@@ -30,11 +30,11 @@ def run_as_root(command, force=False):
30
30
if os .geteuid () != 0 :
31
31
command .insert (0 , 'sudo' )
32
32
if force :
33
- command += "-y"
33
+ command . append ( '-y' )
34
34
return subprocess .call (command )
35
35
36
36
37
- def install_linux_deps (context , pkgs_ubuntu , pkgs_fedora , force ):
37
+ def install_linux_deps (context , pkgs_ubuntu , pkgs_fedora , pkgs_void , force ):
38
38
install = False
39
39
pkgs = []
40
40
if context .distro in ['Ubuntu' , 'Debian GNU/Linux' ]:
@@ -50,20 +50,27 @@ def install_linux_deps(context, pkgs_ubuntu, pkgs_fedora, force):
50
50
if "|{}" .format (p ) not in installed_pkgs :
51
51
install = True
52
52
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
53
61
54
62
if install :
55
- if force :
56
- command .append ('-y' )
57
63
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
61
67
62
68
63
69
def install_salt_dependencies (context , force ):
64
70
pkgs_apt = ['build-essential' , 'libssl-dev' , 'libffi-dev' , 'python-dev' ]
65
71
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 ):
67
74
print ("Dependencies are already installed" )
68
75
69
76
@@ -103,8 +110,17 @@ def linux(context, force=False):
103
110
'clang' , 'clang-libs' , 'autoconf213' , 'python3-devel' ,
104
111
'gstreamer1-devel' , 'gstreamer1-plugins-base-devel' ,
105
112
'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 )
108
124
109
125
if not check_gstreamer_lib ():
110
126
installed_something |= gstreamer (context , force )
@@ -360,6 +376,7 @@ def get_linux_distribution():
360
376
'centos linux' ,
361
377
'debian gnu/linux' ,
362
378
'fedora' ,
379
+ 'void' ,
363
380
]:
364
381
raise Exception ('mach bootstrap does not support %s, please file a bug' % distrib )
365
382
0 commit comments