Skip to content

Commit

Permalink
Merge pull request #304 from librespot-org/protoc-rust
Browse files Browse the repository at this point in the history
Switch to `protobuf-codegen-pure` to remove `protoc` dependency
  • Loading branch information
sashahilton00 authored Mar 13, 2019
2 parents 806a8f2 + 06c6969 commit 0fcfe4f
Show file tree
Hide file tree
Showing 10 changed files with 580 additions and 660 deletions.
492 changes: 221 additions & 271 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion protocol/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ build = "build.rs"
protobuf = "2.0.5"

[build-dependencies]
protoc-rust = "2.0.5"
protobuf-codegen-pure = "2.0.5"
7 changes: 3 additions & 4 deletions protocol/build.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
extern crate protoc_rust;
use protoc_rust::Customize;
extern crate protobuf_codegen_pure;
use protobuf_codegen_pure::Customize;
use std::fs::File;
use std::io::prelude::*;

Expand All @@ -14,7 +14,7 @@ fn main() {
for &(path, expected_checksum) in files::FILES {
let actual = cksum_file(path).unwrap();
if expected_checksum != actual {
protoc_rust::run(protoc_rust::Args {
protobuf_codegen_pure::run(protobuf_codegen_pure::Args {
out_dir: "src",
input: &[path],
includes: &["proto"],
Expand All @@ -28,7 +28,6 @@ fn main() {
if changed {
// Write new checksums to file
let mut file = File::create("files.rs").unwrap();
println!("f_str: {:?}",f_str);
file.write_all(f_str.as_bytes()).unwrap();
}
}
Expand Down
29 changes: 0 additions & 29 deletions protocol/build.sh

This file was deleted.

155 changes: 77 additions & 78 deletions protocol/src/authentication.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4965,84 +4965,83 @@ impl ::protobuf::reflect::ProtobufValue for AccountType {
}

static file_descriptor_proto_data: &'static [u8] = b"\
\n\x14authentication.proto\"\xec\x03\n\x17ClientResponseEncrypted\x12>\n\
\x11login_credentials\x18\n\x20\x02(\x0b2\x11.LoginCredentialsR\x10login\
Credentials\x12;\n\x10account_creation\x18\x14\x20\x01(\x0e2\x10.Account\
CreationR\x0faccountCreation\x12L\n\x14fingerprint_response\x18\x1e\x20\
\x01(\x0b2\x19.FingerprintResponseUnionR\x13fingerprintResponse\x121\n\
\x0bpeer_ticket\x18(\x20\x01(\x0b2\x10.PeerTicketUnionR\npeerTicket\x12,\
\n\x0bsystem_info\x182\x20\x02(\x0b2\x0b.SystemInfoR\nsystemInfo\x12%\n\
\x0eplatform_model\x18<\x20\x01(\tR\rplatformModel\x12%\n\x0eversion_str\
ing\x18F\x20\x01(\tR\rversionString\x12)\n\x06appkey\x18P\x20\x01(\x0b2\
\x11.LibspotifyAppKeyR\x06appkey\x12,\n\x0bclient_info\x18Z\x20\x01(\x0b\
2\x0b.ClientInfoR\nclientInfo\"r\n\x10LoginCredentials\x12\x1a\n\x08user\
name\x18\n\x20\x01(\tR\x08username\x12%\n\x03typ\x18\x14\x20\x02(\x0e2\
\x13.AuthenticationTypeR\x03typ\x12\x1b\n\tauth_data\x18\x1e\x20\x01(\
\x0cR\x08authData\"\x8c\x01\n\x18FingerprintResponseUnion\x12/\n\x05grai\
n\x18\n\x20\x01(\x0b2\x19.FingerprintGrainResponseR\x05grain\x12?\n\x0bh\
mac_ripemd\x18\x14\x20\x01(\x0b2\x1e.FingerprintHmacRipemdResponseR\nhma\
cRipemd\"?\n\x18FingerprintGrainResponse\x12#\n\rencrypted_key\x18\n\x20\
\x02(\x0cR\x0cencryptedKey\"3\n\x1dFingerprintHmacRipemdResponse\x12\x12\
\n\x04hmac\x18\n\x20\x02(\x0cR\x04hmac\"u\n\x0fPeerTicketUnion\x123\n\np\
ublic_key\x18\n\x20\x01(\x0b2\x14.PeerTicketPublicKeyR\tpublicKey\x12-\n\
\nold_ticket\x18\x14\x20\x01(\x0b2\x0e.PeerTicketOldR\toldTicket\"4\n\
\x13PeerTicketPublicKey\x12\x1d\n\npublic_key\x18\n\x20\x02(\x0cR\tpubli\
cKey\"d\n\rPeerTicketOld\x12\x1f\n\x0bpeer_ticket\x18\n\x20\x02(\x0cR\np\
eerTicket\x122\n\x15peer_ticket_signature\x18\x14\x20\x02(\x0cR\x13peerT\
icketSignature\"\xd4\x02\n\nSystemInfo\x12)\n\ncpu_family\x18\n\x20\x02(\
\x0e2\n.CpuFamilyR\tcpuFamily\x12\x1f\n\x0bcpu_subtype\x18\x14\x20\x01(\
\rR\ncpuSubtype\x12\x17\n\x07cpu_ext\x18\x1e\x20\x01(\rR\x06cpuExt\x12\
\x1c\n\x05brand\x18(\x20\x01(\x0e2\x06.BrandR\x05brand\x12\x1f\n\x0bbran\
d_flags\x182\x20\x01(\rR\nbrandFlags\x12\x13\n\x02os\x18<\x20\x02(\x0e2\
\x03.OsR\x02os\x12\x1d\n\nos_version\x18F\x20\x01(\rR\tosVersion\x12\x15\
\n\x06os_ext\x18P\x20\x01(\rR\x05osExt\x12:\n\x19system_information_stri\
ng\x18Z\x20\x01(\tR\x17systemInformationString\x12\x1b\n\tdevice_id\x18d\
\x20\x01(\tR\x08deviceId\"\xa5\x01\n\x10LibspotifyAppKey\x12\x18\n\x07ve\
rsion\x18\x01\x20\x02(\rR\x07version\x12\x16\n\x06devkey\x18\x02\x20\x02\
(\x0cR\x06devkey\x12\x1c\n\tsignature\x18\x03\x20\x02(\x0cR\tsignature\
\x12\x1c\n\tuseragent\x18\x04\x20\x02(\tR\tuseragent\x12#\n\rcallback_ha\
sh\x18\x05\x20\x02(\x0cR\x0ccallbackHash\"g\n\nClientInfo\x12\x18\n\x07l\
imited\x18\x01\x20\x01(\x08R\x07limited\x12#\n\x02fb\x18\x02\x20\x01(\
\x0b2\x13.ClientInfoFacebookR\x02fb\x12\x1a\n\x08language\x18\x03\x20\
\x01(\tR\x08language\"3\n\x12ClientInfoFacebook\x12\x1d\n\nmachine_id\
\x18\x01\x20\x01(\tR\tmachineId\"\xd4\x03\n\tAPWelcome\x12-\n\x12canonic\
al_username\x18\n\x20\x02(\tR\x11canonicalUsername\x12A\n\x16account_typ\
e_logged_in\x18\x14\x20\x02(\x0e2\x0c.AccountTypeR\x13accountTypeLoggedI\
n\x12I\n\x1acredentials_type_logged_in\x18\x19\x20\x02(\x0e2\x0c.Account\
TypeR\x17credentialsTypeLoggedIn\x12X\n\x1ereusable_auth_credentials_typ\
e\x18\x1e\x20\x02(\x0e2\x13.AuthenticationTypeR\x1breusableAuthCredentia\
lsType\x12:\n\x19reusable_auth_credentials\x18(\x20\x02(\x0cR\x17reusabl\
eAuthCredentials\x12\x1d\n\nlfs_secret\x182\x20\x01(\x0cR\tlfsSecret\x12\
/\n\x0caccount_info\x18<\x20\x01(\x0b2\x0c.AccountInfoR\x0baccountInfo\
\x12$\n\x02fb\x18F\x20\x01(\x0b2\x14.AccountInfoFacebookR\x02fb\"n\n\x0b\
AccountInfo\x12-\n\x07spotify\x18\x01\x20\x01(\x0b2\x13.AccountInfoSpoti\
fyR\x07spotify\x120\n\x08facebook\x18\x02\x20\x01(\x0b2\x14.AccountInfoF\
acebookR\x08facebook\"\x14\n\x12AccountInfoSpotify\"W\n\x13AccountInfoFa\
cebook\x12!\n\x0caccess_token\x18\x01\x20\x01(\tR\x0baccessToken\x12\x1d\
\n\nmachine_id\x18\x02\x20\x01(\tR\tmachineId*\xd6\x01\n\x12Authenticati\
onType\x12\x1c\n\x18AUTHENTICATION_USER_PASS\x10\0\x12-\n)AUTHENTICATION\
_STORED_SPOTIFY_CREDENTIALS\x10\x01\x12.\n*AUTHENTICATION_STORED_FACEBOO\
K_CREDENTIALS\x10\x02\x12\x20\n\x1cAUTHENTICATION_SPOTIFY_TOKEN\x10\x03\
\x12!\n\x1dAUTHENTICATION_FACEBOOK_TOKEN\x10\x04*Y\n\x0fAccountCreation\
\x12\"\n\x1eACCOUNT_CREATION_ALWAYS_PROMPT\x10\x01\x12\"\n\x1eACCOUNT_CR\
EATION_ALWAYS_CREATE\x10\x03*\x9d\x01\n\tCpuFamily\x12\x0f\n\x0bCPU_UNKN\
OWN\x10\0\x12\x0b\n\x07CPU_X86\x10\x01\x12\x0e\n\nCPU_X86_64\x10\x02\x12\
\x0b\n\x07CPU_PPC\x10\x03\x12\x0e\n\nCPU_PPC_64\x10\x04\x12\x0b\n\x07CPU\
_ARM\x10\x05\x12\x0c\n\x08CPU_IA64\x10\x06\x12\n\n\x06CPU_SH\x10\x07\x12\
\x0c\n\x08CPU_MIPS\x10\x08\x12\x10\n\x0cCPU_BLACKFIN\x10\t*K\n\x05Brand\
\x12\x13\n\x0fBRAND_UNBRANDED\x10\0\x12\r\n\tBRAND_INQ\x10\x01\x12\r\n\t\
BRAND_HTC\x10\x02\x12\x0f\n\x0bBRAND_NOKIA\x10\x03*\xd1\x02\n\x02Os\x12\
\x0e\n\nOS_UNKNOWN\x10\0\x12\x0e\n\nOS_WINDOWS\x10\x01\x12\n\n\x06OS_OSX\
\x10\x02\x12\r\n\tOS_IPHONE\x10\x03\x12\n\n\x06OS_S60\x10\x04\x12\x0c\n\
\x08OS_LINUX\x10\x05\x12\x11\n\rOS_WINDOWS_CE\x10\x06\x12\x0e\n\nOS_ANDR\
OID\x10\x07\x12\x0b\n\x07OS_PALM\x10\x08\x12\x0e\n\nOS_FREEBSD\x10\t\x12\
\x11\n\rOS_BLACKBERRY\x10\n\x12\x0c\n\x08OS_SONOS\x10\x0b\x12\x0f\n\x0bO\
S_LOGITECH\x10\x0c\x12\n\n\x06OS_WP7\x10\r\x12\x0c\n\x08OS_ONKYO\x10\x0e\
\x12\x0e\n\nOS_PHILIPS\x10\x0f\x12\t\n\x05OS_WD\x10\x10\x12\x0c\n\x08OS_\
VOLVO\x10\x11\x12\x0b\n\x07OS_TIVO\x10\x12\x12\x0b\n\x07OS_AWOX\x10\x13\
\x12\x0c\n\x08OS_MEEGO\x10\x14\x12\r\n\tOS_QNXNTO\x10\x15\x12\n\n\x06OS_\
BCO\x10\x16*(\n\x0bAccountType\x12\x0b\n\x07Spotify\x10\0\x12\x0c\n\x08F\
acebook\x10\x01\
\n\x14authentication.proto\x12\0\"\x8e\x03\n\x17ClientResponseEncrypted\
\x120\n\x11login_credentials\x18\n\x20\x02(\x0b2\x11.LoginCredentialsB\
\x02\x18\0\x12.\n\x10account_creation\x18\x14\x20\x01(\x0e2\x10.AccountC\
reationB\x02\x18\0\x12;\n\x14fingerprint_response\x18\x1e\x20\x01(\x0b2\
\x19.FingerprintResponseUnionB\x02\x18\0\x12)\n\x0bpeer_ticket\x18(\x20\
\x01(\x0b2\x10.PeerTicketUnionB\x02\x18\0\x12$\n\x0bsystem_info\x182\x20\
\x02(\x0b2\x0b.SystemInfoB\x02\x18\0\x12\x1a\n\x0eplatform_model\x18<\
\x20\x01(\tB\x02\x18\0\x12\x1a\n\x0eversion_string\x18F\x20\x01(\tB\x02\
\x18\0\x12%\n\x06appkey\x18P\x20\x01(\x0b2\x11.LibspotifyAppKeyB\x02\x18\
\0\x12$\n\x0bclient_info\x18Z\x20\x01(\x0b2\x0b.ClientInfoB\x02\x18\0\"e\
\n\x10LoginCredentials\x12\x14\n\x08username\x18\n\x20\x01(\tB\x02\x18\0\
\x12$\n\x03typ\x18\x14\x20\x02(\x0e2\x13.AuthenticationTypeB\x02\x18\0\
\x12\x15\n\tauth_data\x18\x1e\x20\x01(\x0cB\x02\x18\0\"\x81\x01\n\x18Fin\
gerprintResponseUnion\x12,\n\x05grain\x18\n\x20\x01(\x0b2\x19.Fingerprin\
tGrainResponseB\x02\x18\0\x127\n\x0bhmac_ripemd\x18\x14\x20\x01(\x0b2\
\x1e.FingerprintHmacRipemdResponseB\x02\x18\0\"5\n\x18FingerprintGrainRe\
sponse\x12\x19\n\rencrypted_key\x18\n\x20\x02(\x0cB\x02\x18\0\"1\n\x1dFi\
ngerprintHmacRipemdResponse\x12\x10\n\x04hmac\x18\n\x20\x02(\x0cB\x02\
\x18\0\"g\n\x0fPeerTicketUnion\x12,\n\npublic_key\x18\n\x20\x01(\x0b2\
\x14.PeerTicketPublicKeyB\x02\x18\0\x12&\n\nold_ticket\x18\x14\x20\x01(\
\x0b2\x0e.PeerTicketOldB\x02\x18\0\"-\n\x13PeerTicketPublicKey\x12\x16\n\
\npublic_key\x18\n\x20\x02(\x0cB\x02\x18\0\"K\n\rPeerTicketOld\x12\x17\n\
\x0bpeer_ticket\x18\n\x20\x02(\x0cB\x02\x18\0\x12!\n\x15peer_ticket_sign\
ature\x18\x14\x20\x02(\x0cB\x02\x18\0\"\x91\x02\n\nSystemInfo\x12\"\n\nc\
pu_family\x18\n\x20\x02(\x0e2\n.CpuFamilyB\x02\x18\0\x12\x17\n\x0bcpu_su\
btype\x18\x14\x20\x01(\rB\x02\x18\0\x12\x13\n\x07cpu_ext\x18\x1e\x20\x01\
(\rB\x02\x18\0\x12\x19\n\x05brand\x18(\x20\x01(\x0e2\x06.BrandB\x02\x18\
\0\x12\x17\n\x0bbrand_flags\x182\x20\x01(\rB\x02\x18\0\x12\x13\n\x02os\
\x18<\x20\x02(\x0e2\x03.OsB\x02\x18\0\x12\x16\n\nos_version\x18F\x20\x01\
(\rB\x02\x18\0\x12\x12\n\x06os_ext\x18P\x20\x01(\rB\x02\x18\0\x12%\n\x19\
system_information_string\x18Z\x20\x01(\tB\x02\x18\0\x12\x15\n\tdevice_i\
d\x18d\x20\x01(\tB\x02\x18\0\"\x84\x01\n\x10LibspotifyAppKey\x12\x13\n\
\x07version\x18\x01\x20\x02(\rB\x02\x18\0\x12\x12\n\x06devkey\x18\x02\
\x20\x02(\x0cB\x02\x18\0\x12\x15\n\tsignature\x18\x03\x20\x02(\x0cB\x02\
\x18\0\x12\x15\n\tuseragent\x18\x04\x20\x02(\tB\x02\x18\0\x12\x19\n\rcal\
lback_hash\x18\x05\x20\x02(\x0cB\x02\x18\0\"\\\n\nClientInfo\x12\x13\n\
\x07limited\x18\x01\x20\x01(\x08B\x02\x18\0\x12#\n\x02fb\x18\x02\x20\x01\
(\x0b2\x13.ClientInfoFacebookB\x02\x18\0\x12\x14\n\x08language\x18\x03\
\x20\x01(\tB\x02\x18\0\",\n\x12ClientInfoFacebook\x12\x16\n\nmachine_id\
\x18\x01\x20\x01(\tB\x02\x18\0\"\xe1\x02\n\tAPWelcome\x12\x1e\n\x12canon\
ical_username\x18\n\x20\x02(\tB\x02\x18\0\x120\n\x16account_type_logged_\
in\x18\x14\x20\x02(\x0e2\x0c.AccountTypeB\x02\x18\0\x124\n\x1acredential\
s_type_logged_in\x18\x19\x20\x02(\x0e2\x0c.AccountTypeB\x02\x18\0\x12?\n\
\x1ereusable_auth_credentials_type\x18\x1e\x20\x02(\x0e2\x13.Authenticat\
ionTypeB\x02\x18\0\x12%\n\x19reusable_auth_credentials\x18(\x20\x02(\x0c\
B\x02\x18\0\x12\x16\n\nlfs_secret\x182\x20\x01(\x0cB\x02\x18\0\x12&\n\
\x0caccount_info\x18<\x20\x01(\x0b2\x0c.AccountInfoB\x02\x18\0\x12$\n\
\x02fb\x18F\x20\x01(\x0b2\x14.AccountInfoFacebookB\x02\x18\0\"c\n\x0bAcc\
ountInfo\x12(\n\x07spotify\x18\x01\x20\x01(\x0b2\x13.AccountInfoSpotifyB\
\x02\x18\0\x12*\n\x08facebook\x18\x02\x20\x01(\x0b2\x14.AccountInfoFaceb\
ookB\x02\x18\0\"\x14\n\x12AccountInfoSpotify\"G\n\x13AccountInfoFacebook\
\x12\x18\n\x0caccess_token\x18\x01\x20\x01(\tB\x02\x18\0\x12\x16\n\nmach\
ine_id\x18\x02\x20\x01(\tB\x02\x18\0*\xda\x01\n\x12AuthenticationType\
\x12\x1c\n\x18AUTHENTICATION_USER_PASS\x10\0\x12-\n)AUTHENTICATION_STORE\
D_SPOTIFY_CREDENTIALS\x10\x01\x12.\n*AUTHENTICATION_STORED_FACEBOOK_CRED\
ENTIALS\x10\x02\x12\x20\n\x1cAUTHENTICATION_SPOTIFY_TOKEN\x10\x03\x12!\n\
\x1dAUTHENTICATION_FACEBOOK_TOKEN\x10\x04\x1a\x02\x10\0*]\n\x0fAccountCr\
eation\x12\"\n\x1eACCOUNT_CREATION_ALWAYS_PROMPT\x10\x01\x12\"\n\x1eACCO\
UNT_CREATION_ALWAYS_CREATE\x10\x03\x1a\x02\x10\0*\xa1\x01\n\tCpuFamily\
\x12\x0f\n\x0bCPU_UNKNOWN\x10\0\x12\x0b\n\x07CPU_X86\x10\x01\x12\x0e\n\n\
CPU_X86_64\x10\x02\x12\x0b\n\x07CPU_PPC\x10\x03\x12\x0e\n\nCPU_PPC_64\
\x10\x04\x12\x0b\n\x07CPU_ARM\x10\x05\x12\x0c\n\x08CPU_IA64\x10\x06\x12\
\n\n\x06CPU_SH\x10\x07\x12\x0c\n\x08CPU_MIPS\x10\x08\x12\x10\n\x0cCPU_BL\
ACKFIN\x10\t\x1a\x02\x10\0*O\n\x05Brand\x12\x13\n\x0fBRAND_UNBRANDED\x10\
\0\x12\r\n\tBRAND_INQ\x10\x01\x12\r\n\tBRAND_HTC\x10\x02\x12\x0f\n\x0bBR\
AND_NOKIA\x10\x03\x1a\x02\x10\0*\xd5\x02\n\x02Os\x12\x0e\n\nOS_UNKNOWN\
\x10\0\x12\x0e\n\nOS_WINDOWS\x10\x01\x12\n\n\x06OS_OSX\x10\x02\x12\r\n\t\
OS_IPHONE\x10\x03\x12\n\n\x06OS_S60\x10\x04\x12\x0c\n\x08OS_LINUX\x10\
\x05\x12\x11\n\rOS_WINDOWS_CE\x10\x06\x12\x0e\n\nOS_ANDROID\x10\x07\x12\
\x0b\n\x07OS_PALM\x10\x08\x12\x0e\n\nOS_FREEBSD\x10\t\x12\x11\n\rOS_BLAC\
KBERRY\x10\n\x12\x0c\n\x08OS_SONOS\x10\x0b\x12\x0f\n\x0bOS_LOGITECH\x10\
\x0c\x12\n\n\x06OS_WP7\x10\r\x12\x0c\n\x08OS_ONKYO\x10\x0e\x12\x0e\n\nOS\
_PHILIPS\x10\x0f\x12\t\n\x05OS_WD\x10\x10\x12\x0c\n\x08OS_VOLVO\x10\x11\
\x12\x0b\n\x07OS_TIVO\x10\x12\x12\x0b\n\x07OS_AWOX\x10\x13\x12\x0c\n\x08\
OS_MEEGO\x10\x14\x12\r\n\tOS_QNXNTO\x10\x15\x12\n\n\x06OS_BCO\x10\x16\
\x1a\x02\x10\0*,\n\x0bAccountType\x12\x0b\n\x07Spotify\x10\0\x12\x0c\n\
\x08Facebook\x10\x01\x1a\x02\x10\0B\0b\x06proto2\
";

static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy {
Expand Down
Loading

0 comments on commit 0fcfe4f

Please sign in to comment.