Skip to content

Commit

Permalink
Merge pull request #14 from vagetablechicken/issue-11
Browse files Browse the repository at this point in the history
fix: update gtest & small fixes
  • Loading branch information
jingchen2222 authored Jul 22, 2021
2 parents d0097d6 + 3e71b6c commit 93a8a11
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -279,13 +279,13 @@ jobs:
run: |
cp ../pack_all.sh .
./pack_all.sh
for var in artifact/thirdparty*.tar.gz; do mv "$var" "${var%.tar.gz}-mac.tar.gz"; done
for var in artifact/thirdparty*.tar.gz; do mv "$var" "${var%.tar.gz}-darwin.tar.gz"; done
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
linux/artifact/third*.tar.gz
mac/artifact/thirdparty*-mac.tar.gz
mac/artifact/thirdparty*-darwin.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion fetch_resource.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pushd "$DOWNLOAD_DIR"
echo -e "${GREEN}downloading resources into $DOWNLOAD_DIR${NC}"

# google test
fetch https://github.com/google/googletest/archive/refs/tags/release-1.10.0.tar.gz googletest-release-1.10.0.tar.gz
fetch https://github.com/google/googletest/archive/refs/tags/release-1.11.0.tar.gz googletest-release-1.11.0.tar.gz

# zlib
fetch https://github.com/madler/zlib/archive/v1.2.11.tar.gz zlib-1.2.11.tar.gz
Expand Down
4 changes: 4 additions & 0 deletions pack_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ unpack_and_install boost
unpack_and_install llvm
unpack_and_install libother

# needs a soft link lib64->lib for Mac OS
pushd "$INSTALL_DIR"
ln -s lib lib64
popd
tar czf "$INSTALL_DIR.tar.gz" "$INSTALL_DIR"

mkdir -p "$SRC_DIR"
Expand Down
5 changes: 3 additions & 2 deletions pack_boost.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ popd
tar xzf common-1.0.0.tar.gz
pushd common-1.0.0
if [[ "${ARCH}" == "Mac" ]]; then
sed -i '' 's/^#include <syscall.h>/#include <sys\/syscall.h>/' src/logging.cc
sed -i '' 's/syscall(__NR_gettid)/syscall(SYS_gettid)/' src/logging.cc
# 'syscall' is deprecated: first deprecated in OS X 10.12
sed -i '' 's/^#include <syscall.h>/#include <pthread.h>/' src/logging.cc
sed -i '' 's/thread_id = syscall(__NR_gettid)/pthread_threadid_np(0, \&thread_id)/' src/logging.cc
fi
make -j"$(nproc)" INCLUDE_PATH="-Iinclude -I$DEPS_PREFIX/include" PREFIX="$DEPS_PREFIX" install

Expand Down
20 changes: 10 additions & 10 deletions pack_other.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ pushd "$DEPS_SOURCE"

if [ ! -f gtest_succ ]; then
echo "installing gtest ...."
tar xzf googletest-release-1.10.0.tar.gz
tar xzf googletest-release-1.11.0.tar.gz

pushd googletest-release-1.10.0
pushd googletest-release-1.11.0
cmake -H. -Bbuild -DCMAKE_INSTALL_PREFIX="$DEPS_PREFIX" -DCMAKE_CXX_FLAGS=-fPIC
cmake --build build -- -j"$(nproc)"
cmake --build build --target install
Expand Down Expand Up @@ -153,16 +153,16 @@ else
touch unwind_succ
fi

if [ -f "gperf_tool" ]; then
echo "gperf_tool exist"
if [ -f "gperf_succ" ]; then
echo "gperf_succ exist"
else
tar zxf gperftools-2.5.tar.gz
pushd gperftools-2.5
./configure --enable-cpu-profiler --enable-heap-checker --enable-heap-profiler --enable-static --prefix="$DEPS_PREFIX"
./configure --enable-cpu-profiler --enable-heap-checker --enable-heap-profiler --prefix="$DEPS_PREFIX" --enable-shared=no
make "-j$(nproc)"
make install
popd
touch gperf_tool
touch gperf_succ
fi

if [ -f "leveldb_succ" ]; then
Expand All @@ -183,11 +183,11 @@ if [ -f "openssl_succ" ]; then
else
unzip OpenSSL_1_1_0.zip
pushd openssl-OpenSSL_1_1_0
# On MACOS, sed must use `-i extension` for saving backups with the specified extension.
# On Mac OS, sed must use `-i extension` for saving backups with the specified extension.
# But we can give a zero-length extension, no backup will be saved.
sed -i'' -e 's#qw/glob#qw/:glob#' Configure
sed -i'' -e 's#qw/glob#qw/:glob#' test/build.info
./config --prefix="$DEPS_PREFIX" --openssldir="$DEPS_PREFIX"
./config --prefix="$DEPS_PREFIX" --openssldir="$DEPS_PREFIX" no-shared
make "-j$(nproc)"
make install
rm -rf "$DEPS_PREFIX"/lib/libssl.so*
Expand Down Expand Up @@ -290,11 +290,11 @@ fi
tar -zxf apache-zookeeper-3.4.14.tar.gz
pushd zookeeper-3.4.14/zookeeper-client/zookeeper-client-c
if [[ "$ARCH" == "Mac" ]]; then
CC="clang" CFLAGS="$CFLAGS" ./configure --prefix="$DEPS_PREFIX"
CC="clang" CFLAGS="$CFLAGS" ./configure --prefix="$DEPS_PREFIX" --enable-shared=no
else
autoreconf -if
# see https://issues.apache.org/jira/browse/ZOOKEEPER-3293
CFLAGS="$CFLAGS -Wno-error=format-overflow=" ./configure --prefix="$DEPS_PREFIX"
CFLAGS="$CFLAGS -Wno-error=format-overflow=" ./configure --prefix="$DEPS_PREFIX" --enable-shared=no
fi

make -j"$(nproc)"
Expand Down

0 comments on commit 93a8a11

Please sign in to comment.