Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scripts for vendoring deps #54

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions contrib/get-cryptopp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
set -e
cd third_party
git clone --depth 1 -b CRYPTOPP_8_2_0 https://github.com/weidai11/cryptopp.git
cd cryptopp
make libcryptopp.a -j $(nproc)
make install -j $(nproc) PREFIX=../install
5 changes: 5 additions & 0 deletions contrib/get-hiredis.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
cd third_party
git clone --depth 1 -b v1.0.0 https://github.com/redis/hiredis.git
cd hiredis
git apply ../../contrib/hiredis-not-shared.patch

7 changes: 7 additions & 0 deletions contrib/get-openssl.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
set -e
cd third_party
git clone --depth 1 -b OpenSSL_1_1_1g https://github.com/openssl/openssl.git
cd openssl
./config --prefix=$(pwd)/../install
make -j $(nproc)
make install -j $(nproc)
15 changes: 15 additions & 0 deletions contrib/get-protobuf.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
set -xe
cd third_party
version=3.12.0
if [[ -a protobuf-${version} ]]; then
echo "Protobuf already there"
else
wget https://github.com/protocolbuffers/protobuf/releases/download/v${version}/protobuf-cpp-${version}.tar.gz
tar xvf protobuf-cpp-${version}.tar.gz
rm protobuf-cpp-${version}.tar.gz
cd protobuf-${version}
./autogen.sh
./configure --prefix=$(pwd)/../install
make -j$(nproc)
make install
fi
13 changes: 13 additions & 0 deletions contrib/hiredis-not-shared.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1beccc6..e073075 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -40,7 +40,7 @@ IF(WIN32)
ADD_COMPILE_DEFINITIONS(_CRT_SECURE_NO_WARNINGS WIN32_LEAN_AND_MEAN)
ENDIF()

-ADD_LIBRARY(hiredis SHARED ${hiredis_sources})
+ADD_LIBRARY(hiredis ${hiredis_sources})

SET_TARGET_PROPERTIES(hiredis
PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE
5 changes: 5 additions & 0 deletions fetch-deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh -ex
[[ -a third_party/openssl ]] || ./contrib/get-openssl.sh
[[ -a third_party/cryptopp ]] || ./contrib/get-cryptopp.sh
[[ -a third_party/hiredis ]] || ./contrib/get-hiredis.sh
[[ -a third_party/protobuf-3.12.0 ]] || ./contrib/get-protobuf.sh
5 changes: 5 additions & 0 deletions third_party/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
install
protobuf*
openssl*
cryptopp*
hiredis*