Skip to content

Instantly share code, notes, and snippets.

@e0en
Last active August 31, 2018 13:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save e0en/77c1ea51353bd2c1ee9d5fc8c591c571 to your computer and use it in GitHub Desktop.
Save e0en/77c1ea51353bd2c1ee9d5fc8c591c571 to your computer and use it in GitHub Desktop.
A simple bash script for build & installing facebook/proxygen on MacOS 10.14 Mojave
#!/bin/bash
set -x
# homebrew dependencies
brew install cmake pkgconfig automake openssl md5sha1sum
brew install autoconf-archive libtool wget boost libsodium folly
OPENSSL_DIR="$(brew --prefix openssl)"
# googletest
curl -L https://github.com/google/googletest/archive/release-1.8.0.tar.gz | tar zxvf -
pushd googletest-release-1.8.0
cmake -DCMAKE_BUILD_TYPE=Release .
make -j 8 && make install
if [[ "$?" != 0 ]]; then echo "googletest build failed"; popd; exit 1; fi
popd
rm -rf googletest-release-1.8.0
# fizz
git clone https://github.com/facebookincubator/fizz.git
pushd fizz/fizz
cmake -DCMAKE_BUILD_TYPE=Release -DOPENSSL_ROOT_DIR=$OPENSSL_DIR .
make -j 8 && make install
if [[ "$?" != 0 ]]; then echo "fizz build failed"; popd; exit 1; fi
popd
rm -rf fizz
# wangle
git clone https://github.com/facebook/wangle.git
pushd ./wangle/wangle/
cmake -DCMAKE_BUILD_TYPE=Release -DOPENSSL_ROOT_DIR=$OPENSSL_DIR .
make -j 8 && make install
if [[ "$?" != 0 ]]; then echo "wangle build failed"; popd; exit 1; fi
popd
rm -rf wangle
# proxygen
curl -L https://github.com/facebook/proxygen/archive/v2018.08.27.00.tar.gz | tar xvzf -
pushd proxygen-2018.08.27.00/proxygen
patch -p0 <<'EOF'
--- configure.ac
+++ configure.ac
@@ -208,7 +208,7 @@
fi
LIBS="$LIBS $BOOST_LDFLAGS -lpthread -pthread -lfolly -lglog"
-LIBS="$LIBS -ldouble-conversion -lboost_system -lboost_thread"
+LIBS="$LIBS -ldouble-conversion -lboost_system -lboost_thread-mt"
AM_CONDITIONAL([HAVE_STD_THREAD], [test "$ac_cv_header_features" = "yes"])
AM_CONDITIONAL([HAVE_X86_64], [test "$build_cpu" = "x86_64"])
EOF
autoreconf -ivf
LDFLAGS="-L/usr/local/lib -L$OPENSSL_DIR/lib" CPPFLAGS="-I/usr/local/include -I$OPENSSL_DIR/include" ./configure
make -j 8 && make install
if [[ "$?" != 0 ]]; then echo "proxygen build failed"; popd; exit 1; fi
popd
rm -rf proxygen-2018.08.27.00
@e0en
Copy link
Author

e0en commented Aug 31, 2018

for credit:
most of its contents are taken from https://gist.github.com/andrewstucki/b3242e6a5a4520cabfa1a15ff857ca3f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment