Bug 1890689 Don't pretend to pre-buffer with DynamicResampler r=pehrsons
[gecko.git] / python / mozboot / mozboot / freebsd.py
blob281af60c04e4ed61fe3c3844b912568e6f31eb28
1 # This Source Code Form is subject to the terms of the Mozilla Public
2 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
3 # You can obtain one at http://mozilla.org/MPL/2.0/.
5 import sys
7 from mozfile import which
9 from mozboot.base import BaseBootstrapper
12 class FreeBSDBootstrapper(BaseBootstrapper):
13 def __init__(self, version, flavor, **kwargs):
14 BaseBootstrapper.__init__(self, **kwargs)
15 self.version = int(version.split(".")[0])
16 self.flavor = flavor.lower()
18 self.packages = [
19 "gmake",
20 "gtar",
21 "m4",
22 "npm",
23 "pkgconf",
24 "py%d%d-sqlite3" % sys.version_info[0:2],
25 "rust",
26 "watchman",
29 self.browser_packages = [
30 "libXt",
31 "nasm",
32 "pulseaudio",
35 if not which("as"):
36 self.packages.append("binutils")
38 if not which("unzip"):
39 self.packages.append("unzip")
41 def pkg_install(self, *packages):
42 if sys.platform.startswith("netbsd"):
43 command = ["pkgin", "install"]
44 else:
45 command = ["pkg", "install"]
46 if self.no_interactive:
47 command.append("-y")
49 command.extend(packages)
50 self.run_as_root(command)
52 def install_system_packages(self):
53 self.pkg_install(*self.packages)
55 def install_browser_packages(self, mozconfig_builder, artifact_mode=False):
56 # TODO: Figure out what not to install for artifact mode
57 packages = self.browser_packages.copy()
58 if not artifact_mode:
59 if sys.platform.startswith("netbsd"):
60 packages.extend(["brotli", "gtk3+", "libv4l", "cbindgen"])
61 else:
62 packages.extend(["gtk3", "mesa-dri", "v4l_compat", "rust-cbindgen"])
63 self.pkg_install(*packages)
65 def install_browser_artifact_mode_packages(self, mozconfig_builder):
66 self.install_browser_packages(mozconfig_builder, artifact_mode=True)
68 def upgrade_mercurial(self, current):
69 self.pkg_install("mercurial")