bazel-watcher: init at 0.5.0

This commit is contained in:
Wael M. Nasreddine
2018-09-29 13:33:00 -07:00
parent 90b7b4a509
commit 86a5535b2f
4 changed files with 113 additions and 7 deletions
@@ -39,19 +39,24 @@ in stdenv.mkDerivation (fBuildAttrs // {
installPhase = fFetchAttrs.installPhase or ''
runHook preInstall
# Remove all built in external workspaces, Bazel will recreate them when building
rm -rf $bazelOut/external/{bazel_tools,\@bazel_tools.marker}
rm -rf $bazelOut/external/{embedded_jdk,\@embedded_jdk.marker}
rm -rf $bazelOut/external/{local_*,\@local_*}
# Patching markers to make them deterministic
for i in $bazelOut/external/\@*.marker; do
sed -i 's, -\?[0-9][0-9]*$, 1,' "$i"
done
# Patching symlinks to remove build directory reference
find $bazelOut/external -type l | while read symlink; do
ln -sf $(readlink "$symlink" | sed "s,$NIX_BUILD_TOP,NIX_BUILD_TOP,") "$symlink"
done
sed -i 's, -\?[0-9][0-9]*$, 1,' $bazelOut/external/\@*.marker
# Remove all vcs files
rm -rf $(find $bazelOut/external -type d -name .git)
rm -rf $(find $bazelOut/external -type d -name .svn)
rm -rf $(find $bazelOut/external -type d -name .hg)
# Patching symlinks to remove build directory reference
find $bazelOut/external -type l | while read symlink; do
ln -sf $(readlink "$symlink" | sed "s,$NIX_BUILD_TOP,NIX_BUILD_TOP,") "$symlink"
done
cp -r $bazelOut/external $out
runHook postInstall