2013-11-22 08:33:33 -08:00
|
|
|
#!/bin/bash
|
2013-12-16 07:26:40 -08:00
|
|
|
CURDIR=$(pwd)
|
|
|
|
|
|
|
|
cd $CURDIR/../trezor-common/protob
|
|
|
|
|
|
|
|
for i in messages types ; do
|
|
|
|
protoc --python_out=$CURDIR/trezorlib/ -I/usr/include -I. $i.proto
|
|
|
|
done
|
2016-07-03 06:12:00 -07:00
|
|
|
|
|
|
|
# hack to make output python 3 compatible
|
|
|
|
sed -i 's/^import types_pb2/from . import types_pb2/g' $CURDIR/trezorlib/messages_pb2.py
|
2017-06-21 04:44:26 -07:00
|
|
|
|
|
|
|
# add version
|
|
|
|
PROTOC_VER=$(protoc --version)
|
|
|
|
PROTOB_REV=$(git rev-parse HEAD)
|
|
|
|
sed -i "3i# $PROTOC_VER\n# trezor-common $PROTOB_REV" $CURDIR/trezorlib/*_pb2.py
|