Commit d14c1d91 authored by Chad Austin's avatar Chad Austin Committed by Facebook GitHub Bot

fix Watchman build on FreeBSD

Summary:
Watchman advertises support for FreeBSD but it's regressed a couple
ways. Ensure it builds on FreeBSD again with a Vagrantfile.

Reviewed By: ahornby

Differential Revision: D33989289

fbshipit-source-id: ff906bc219974bafbc349740ce6bddfe5bd2908f
parent e3cad933
......@@ -173,19 +173,28 @@ class MakeBuilder(BuilderBase):
self.install_args = install_args or []
self.test_args = test_args
@property
def _make_binary(self):
return self.manifest.get("build", "make_binary", "make", ctx=self.ctx)
def _get_prefix(self):
return ["PREFIX=" + self.inst_dir, "prefix=" + self.inst_dir]
def _build(self, install_dirs, reconfigure):
env = self._compute_env(install_dirs)
# Need to ensure that PREFIX is set prior to install because
# libbpf uses it when generating its pkg-config file.
# The lowercase prefix is used by some projects.
cmd = ["make", "-j%s" % self.num_jobs] + self.build_args + self._get_prefix()
cmd = (
[self._make_binary, "-j%s" % self.num_jobs]
+ self.build_args
+ self._get_prefix()
)
self._run_cmd(cmd, env=env)
install_cmd = ["make"] + self.install_args + self._get_prefix()
install_cmd = [self._make_binary] + self.install_args + self._get_prefix()
self._run_cmd(install_cmd, env=env)
def run_tests(
......@@ -196,7 +205,7 @@ class MakeBuilder(BuilderBase):
env = self._compute_env(install_dirs)
cmd = ["make"] + self.test_args + self._get_prefix()
cmd = [self._make_binary] + self.test_args + self._get_prefix()
self._run_cmd(cmd, env=env)
......@@ -230,6 +239,10 @@ class AutoconfBuilder(BuilderBase):
self.args = args or []
self.conf_env_args = conf_env_args or {}
@property
def _make_binary(self):
return self.manifest.get("build", "make_binary", "make", ctx=self.ctx)
def _build(self, install_dirs, reconfigure):
configure_path = os.path.join(self.src_dir, "configure")
autogen_path = os.path.join(self.src_dir, "autogen.sh")
......@@ -264,8 +277,8 @@ class AutoconfBuilder(BuilderBase):
self._run_cmd(["autoreconf", "-ivf"], cwd=self.src_dir, env=env)
configure_cmd = [configure_path, "--prefix=" + self.inst_dir] + self.args
self._run_cmd(configure_cmd, env=env)
self._run_cmd(["make", "-j%s" % self.num_jobs], env=env)
self._run_cmd(["make", "install"], env=env)
self._run_cmd([self._make_binary, "-j%s" % self.num_jobs], env=env)
self._run_cmd([self._make_binary, "install"], env=env)
class Iproute2Builder(BuilderBase):
......
......@@ -63,6 +63,7 @@ SCHEMA = {
"fields": {
"builder": REQUIRED,
"subdir": OPTIONAL,
"make_binary": OPTIONAL,
"build_in_src_dir": OPTIONAL,
"job_weight_mib": OPTIONAL,
},
......
......@@ -22,6 +22,10 @@ sha256 = 3dc27a16c21b717bcc5de8590b564d4392a0b8577170c058729d067d95ded825
builder = autoconf
subdir = flex-2.6.4
[build.os=freebsd]
builder = autoconf
make_binary = gmake
[build.os=windows]
builder = nop
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment