Last active
January 19, 2018 22:48
-
-
Save aimeemikaelac/28c72ac2bde7ce05e1d6a16b7f2f3b87 to your computer and use it in GitHub Desktop.
installs a nuclide server with correct version of node.js and correct libfolly commit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
SCRIPT=$(realpath $0) | |
SCRIPTPATH=$(dirname $SCRIPT) | |
CURRENT=$(pwd) | |
if [ -z "$1" ]; | |
then | |
cd "$CURRENT" | |
else | |
if [ -d "$1" ]; | |
then | |
cd "$1" | |
else | |
echo "Directory $1 does not exist" | |
exit 1 | |
fi | |
fi | |
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - | |
sudo apt -y nodejs | |
sudo apt install -y \ | |
python2.7 \ | |
python-dev \ | |
autoconf \ | |
automake \ | |
libtool \ | |
python-setuptools \ | |
g++ \ | |
autoconf-archive \ | |
libboost-all-dev \ | |
libevent-dev \ | |
libdouble-conversion-dev \ | |
libgoogle-glog-dev \ | |
libgflags-dev \ | |
liblz4-dev \ | |
liblzma-dev \ | |
libsnappy-dev \ | |
make \ | |
zlib1g-dev \ | |
binutils-dev \ | |
libjemalloc-dev \ | |
libssl-dev \ | |
pkg-config \ | |
libunwind8-dev \ | |
libelf-dev \ | |
libdwarf-dev \ | |
libiberty-dev | |
if [ ! -z "folly/" ]; then | |
sudo rm -rf folly/ | |
fi | |
git clone https://github.com/facebook/folly.git | |
cd folly/ | |
git checkout a901072c1d581e510555276e2f53cecf0c931c5b | |
(cd folly/test && \ | |
rm -rf gtest && \ | |
wget https://github.com/google/googletest/archive/release-1.8.0.tar.gz && \ | |
tar zxf release-1.8.0.tar.gz && \ | |
rm -f release-1.8.0.tar.gz && \ | |
mv googletest-release-1.8.0 gtest) | |
cd "$CURRENT/folly/folly" | |
autoreconf -ivf | |
./configure | |
make clean | |
make -j32 | |
make check -j32 | |
sudo make install | |
cd "$CURRENT" | |
if [ ! -z "watchman/" ]; then | |
sudo rm -rf watchman/ | |
fi | |
git clone https://github.com/facebook/watchman.git | |
cd watchman | |
git checkout v4.9.0 | |
./autogen.sh | |
./configure | |
make clean | |
make -j32 | |
sudo make install | |
sudo npm install -g relay-compiler | |
sudo npm install -g nuclide | |
# hack to get remote terminal working | |
# untested in script. taken from: https://github.com/facebook/nuclide/issues/1431#issuecomment-357350945 | |
# may be version/platform dependent | |
cd $CURRENT | |
git clone https://github.com/chjj/pty.js | |
cd pty.js | |
sudo npm install -g | |
sudo mkdir -p /usr/local/lib/node_modules/nuclide/node_modules/nuclide-prebuilt-libs/pty/build/pty-v0.1.2-node-v57-linux-x64 | |
sudo cp build/Release/pty.node /usr/local/lib/node_modules/nuclide/node_modules/nuclide-prebuilt-libs/pty/build/pty-v0.1.2-node-v57-linux-x64 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment