status-mobile/nix/mobile/android/watchman.nix

19 lines
651 B
Nix
Raw Normal View History

2019-09-10 09:50:09 +00:00
{ stdenv, runCommand, makeWrapper,
watchman }:
let
patchedWatchmanFactory = watchmanSockPath:
assert (builtins.stringLength watchmanSockPath) > 0 -> stdenv.isDarwin;
if stdenv.isDarwin then
assert (builtins.stringLength watchmanSockPath) > 0;
# Create a wrapper to watchman that includes the --sockname flag
runCommand "patched-watchman" { nativeBuildInputs = [ makeWrapper ]; } ''
mkdir -p $out/bin
makeWrapper ${watchman}/bin/watchman \
$out/bin/watchman \
--add-flags "--sockname=${watchmanSockPath}"
'' else watchman;
in patchedWatchmanFactory