2016-04-26 16:32:57 -07:00
|
|
|
#!/bin/bash
|
|
|
|
CURDIR=$(pwd)
|
2016-10-03 09:16:15 -07:00
|
|
|
mkdir -p $CURDIR/pb2/
|
|
|
|
echo > $CURDIR/pb2/__init__.py
|
2016-04-26 16:32:57 -07:00
|
|
|
|
2016-09-21 05:12:46 -07:00
|
|
|
INDEX=../src/trezor/messages/wire_types.py
|
|
|
|
rm -f $INDEX
|
|
|
|
|
2016-04-27 13:44:37 -07:00
|
|
|
for i in types messages storage ; do
|
2016-04-26 16:32:57 -07:00
|
|
|
# Compile .proto files to python2 modules using google protobuf library
|
|
|
|
cd $CURDIR/../../trezor-common/protob
|
|
|
|
protoc --python_out=$CURDIR/pb2/ -I/usr/include -I. $i.proto
|
2016-10-03 09:16:15 -07:00
|
|
|
done
|
2016-04-26 16:32:57 -07:00
|
|
|
|
2016-10-03 09:16:15 -07:00
|
|
|
for i in types messages storage ; do
|
2016-04-26 16:32:57 -07:00
|
|
|
# Convert google protobuf library to trezor's internal format
|
|
|
|
cd $CURDIR
|
2016-12-04 10:24:48 -08:00
|
|
|
../../trezor-common/tools/pb2py -m -p $CURDIR -i $INDEX $i ../src/trezor/messages/
|
2016-04-26 16:32:57 -07:00
|
|
|
done
|
2016-10-03 09:16:15 -07:00
|
|
|
|
|
|
|
rm -rf $CURDIR/pb2/
|