3 # Run this script in the top nanopb directory to create a binary package
9 VERSION=`git describe --always`
15 # Export the files from newest commit
16 git archive HEAD | tar x -C $DEST
18 # Rebuild the Python .proto files
19 make -BC $DEST/generator/proto
21 # Package the Python libraries
22 ( cd $DEST/generator; bbfreeze nanopb_generator.py )
23 mv $DEST/generator/dist $DEST/generator-bin
25 # Package the protoc compiler
26 cp `which protoc` $DEST/generator-bin/protoc.bin
27 cat > $DEST/generator-bin/protoc << EOF
29 SCRIPTDIR=\$(dirname \$(readlink -f \$0))
30 export LD_LIBRARY_PATH=\$SCRIPTDIR
31 export PATH=\$SCRIPTDIR:\$PATH
32 exec \$SCRIPTDIR/protoc.bin "\$@"
34 chmod +x $DEST/generator-bin/protoc
36 # Make the nanopb generator available as a protoc plugin
37 ln -s nanopb-generator $DEST/generator-bin/protoc-gen-nanopb