Skip to content

Commit

Permalink
Fixes similar bugs in debian scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
vsreekanti committed Sep 10, 2018
1 parent 4705e61 commit 574b42c
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 13 deletions.
2 changes: 2 additions & 0 deletions scripts/install-dependencies-osx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ if [ -z "$(command -v cmake)" ]; then
fi

if [ -z "$(command -v lcov)" ]; then
echo "Installing lcov..."
echo "You might be asked for your password to install lcov..."
wget http://downloads.sourceforge.net/ltp/lcov-${LCOV_VERSION}.tar.gz
tar xvzf lcov-${LCOV_VERSION}.tar.gz > /dev/null 2>&1
rm -rf lcov-${LCOV_VERSION}.tar.gz
Expand Down
50 changes: 37 additions & 13 deletions scripts/install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,41 +14,65 @@
# See the License for the specific language governing permissions and
# limitations under the License.

if [ -z "command -v clang++" ]; then
PROTO_V=3.5.1
LCOV_VERSION=1.13

if [ -z "$(command -v clang++)" ]; then
echo "Installing clang..."

sudo apt-add-repository "deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-5.0 main" > /dev/null
sudo apt-get update > /dev/null
sudo apt-get install -y clang-5.0 lldb-5.0 clang-format-5.0
sudo apt-get install -y --force-yes clang-5.0 lldb-5.0 clang-format-5.0
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-5.0 1
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-5.0 1
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-5.0 1
fi

echo -e "Installing the following packages via apt-get:\n\t* autoconf\n\t* automake\n\t* libtool\n\t* build-essential \n\t* unzip \n\t* pkg-config\n\t* wget\n\t* make\n\t* libc++-dev\n\t* libc++abi-dev"

brew install build-essential autoconf automake libtool make unzip pkg-config wget make libc++-dev libc++abi-dev > /dev/null
sudo apt-get install -y build-essential autoconf automake libtool make unzip pkg-config wget make libc++-dev libc++abi-dev > /dev/null

if [ -z "command -v cmake" ]; then
if [ -z "$(command -v cmake)" ]; then
echo "Installing cmake..."
echo "You might be prompted for your password to add CMake to /usr/bin."
wget https://cmake.org/files/v3.11/cmake-3.11.4-Linux-x86_64.tar.gz
tar xvzf cmake-3.11.4-Linux-x86_64.tar.gz
sudo mv cmake-3.11.4-Linux-x86_64 /usr/bin/cmake
export PATH=$PATH:/usr/bin/cmake/bin

sudo mkdir /usr/bin/cmake
sudo mv cmake-3.11.4-Linux-x86_64/* /usr/bin/cmake/
echo "export PATH=$PATH:/usr/bin/cmake/bin" >> ~/.bashrc
rm cmake-3.11.4-Linux-x86_64.tar.gz
source ~/.bashrc

rm -rf cmake-3.11.4-Linux-x86_64*
fi

if [ -z "command -v protoc" ]; then
if [ -z "$(command -v lcov)" ]; then
echo "Installing lcov..."
echo "You might be asked for your password to install lcov..."

wget http://downloads.sourceforge.net/ltp/lcov-${LCOV_VERSION}.tar.gz
tar xvzf lcov-${LCOV_VERSION}.tar.gz > /dev/null 2>&1
rm -rf lcov-${LCOV_VERSION}.tar.gz

LCOV_DIR="lcov-${LCOV_VERSION}"

cd $LCOV_DIR && sudo make install
which lcov
lcov -v
cd .. && rm -rf $LCOV_DIR
fi

if [ -z "$(command -v protoc)" ]; then
echo "Installing protobuf..."
echo "You might be prompted for your password to install the protobuf headers and set ldconfig."
PROTO_V=3.5.1

wget https://github.com/google/protobuf/releases/download/v${PROTO_V}/protobuf-all-${PROTO_V}.zip > /dev/null
unzip protobuf-all-${PROTO_V} > /dev/null
cd protobuf-${PROTO_V} && ./autogen.sh && ./configure CXX=clang++ CXXFLAGS='-std=c++11 -stdlib=libc++ -O3 -g'
cd protobuf-${PROTO_V}
./autogen.sh && ./configure CXX=clang++ CXXFLAGS='-std=c++11 -stdlib=libc++ -O3 -g'

cd protobuf-${PROTO_V} && make -j4 && sudo make install && sudo ldconfig
rm -rf protobuf-3.5.1
make -j4 && sudo make install && sudo ldconfig
cd .. && rm -rf protobuf-3.5.1*
fi

echo "All dependencies installed!
echo "All dependencies installed!"

0 comments on commit 574b42c

Please sign in to comment.