mirror of
https://github.com/librespot-org/librespot.git
synced 2024-12-28 17:21:52 +00:00
c6327af2f3
A build script is used to ensure the source files haven’t been modified.
29 lines
544 B
Bash
29 lines
544 B
Bash
set -eu
|
|
|
|
SRC="authentication keyexchange mercury
|
|
metadata pubsub spirc"
|
|
|
|
cat > src/lib.rs <<EOF
|
|
// Autogenerated by build.sh
|
|
|
|
extern crate protobuf;
|
|
EOF
|
|
|
|
cat > files.rs <<EOF
|
|
// Autogenerated by build.sh
|
|
|
|
pub const FILES : &'static [(&'static str, u32)] = &[
|
|
EOF
|
|
|
|
for name in $SRC; do
|
|
src=proto/$name.proto
|
|
out=src/$name.rs
|
|
checksum=$(cksum $src | cut -f 1 -d' ')
|
|
|
|
protoc --rust_out src/ -I proto/ proto/$name.proto
|
|
|
|
echo "pub mod $name;" >> src/lib.rs
|
|
echo " (\"$src\", $checksum)," >> files.rs
|
|
done
|
|
|
|
echo "];" >> files.rs
|