Skip to content

Commit 19f0e86

Browse files
committed
install protoc
taken from PR SpinResearch#74
1 parent 0d64ef4 commit 19f0e86

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,8 @@ script:
4848
- cargo build --verbose --all-features
4949
- cargo test --verbose --all-features
5050
- cargo doc --verbose --all-features
51+
52+
before_install:
53+
- export PATH=$PATH:$HOME/protobuf/bin
54+
- export PROTOC_VERSION=$(cat PROTOC_VERSION)
55+
- bash install_protobuf.sh

PROTOC_VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.11.3

install_protobuf.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
set -x
4+
5+
PROTOC_VERSION=$(cat PROTOC_VERSION)
6+
7+
check_protoc_version () {
8+
this_version=`protoc --version`
9+
return `[ "libprotoc $PROTOC_VERSION" = "$this_version" ]`
10+
}
11+
12+
if check_protoc_version; then
13+
echo $PROTOC_VERSION detected.
14+
exit
15+
fi
16+
17+
wget https://github.com/google/protobuf/archive/v$PROTOC_VERSION.tar.gz
18+
tar -xzf v$PROTOC_VERSION.tar.gz
19+
cd protobuf-$PROTOC_VERSION
20+
./autogen.sh >/dev/null 2>&1
21+
./configure --prefix=$HOME/protobuf >/dev/null 2>&1
22+
make >/dev/null 2>&1
23+
make install >/dev/null 2>&1

0 commit comments

Comments
 (0)