1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-20 06:28:09 +00:00
trezor-firmware/tools/build_pb.sh
slush0 0ea856589f Added non-micropython compatibility.
Optional generation of wiretype index file.
2016-12-04 19:12:01 +01:00

22 lines
559 B
Bash
Executable File

#!/bin/bash
CURDIR=$(pwd)
mkdir -p $CURDIR/pb2/
echo > $CURDIR/pb2/__init__.py
INDEX=../src/trezor/messages/wire_types.py
rm -f $INDEX
for i in types messages storage ; do
# 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
done
for i in types messages storage ; do
# Convert google protobuf library to trezor's internal format
cd $CURDIR
./pb2py -m -i $INDEX $i ../src/trezor/messages/
done
rm -rf $CURDIR/pb2/