1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-22 22:38:08 +00:00
trezor-firmware/build_pb.sh

17 lines
460 B
Bash
Raw Normal View History

2013-11-22 16:33:33 +00:00
#!/bin/bash
2013-12-16 15:26:40 +00: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
# hack to make output python 3 compatible
sed -i 's/^import types_pb2/from . import types_pb2/g' $CURDIR/trezorlib/messages_pb2.py
# 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