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/.
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()
24 "py%d%d-sqlite3" % sys
.version_info
[0:2],
29 self
.browser_packages
= [
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"]
45 command
= ["pkg", "install"]
46 if self
.no_interactive
:
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()
59 if sys
.platform
.startswith("netbsd"):
60 packages
.extend(["brotli", "gtk3+", "libv4l", "cbindgen"])
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")