| 
									
										
										
										
											2018-12-11 22:50:42 -08:00
										 |  |  | #!/usr/bin/env bash
 | 
					
						
							|  |  |  | # | 
					
						
							|  |  |  | # |cargo install| of the top-level crate will not install binaries for | 
					
						
							| 
									
										
										
										
											2018-12-19 10:30:24 -08:00
										 |  |  | # other workspace crates or native program crates. | 
					
						
							| 
									
										
										
										
											2018-12-11 22:50:42 -08:00
										 |  |  | set -e | 
					
						
							| 
									
										
										
										
											2018-12-19 10:30:24 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  | if [[ -z $1 ]]; then | 
					
						
							|  |  |  |   echo Install directory not specified | 
					
						
							|  |  |  |   exit 1 | 
					
						
							|  |  |  | fi | 
					
						
							|  |  |  | installDir="$(mkdir -p "$1"; cd "$1"; pwd)" | 
					
						
							|  |  |  | cargoFeatures="$2" | 
					
						
							|  |  |  | echo "Install location: $installDir" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | cd "$(dirname "$0")"/.. | 
					
						
							| 
									
										
										
										
											2018-12-11 22:50:42 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-13 21:11:09 -08:00
										 |  |  | SECONDS=0 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-19 10:30:24 -08:00
										 |  |  | ( | 
					
						
							|  |  |  |   set -x | 
					
						
							|  |  |  |   cargo build --all --release --features="$cargoFeatures" | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | BIN_CRATES=( | 
					
						
							| 
									
										
										
										
											2018-12-13 21:11:09 -08:00
										 |  |  |   bench-streamer | 
					
						
							|  |  |  |   bench-tps | 
					
						
							| 
									
										
										
										
											2019-03-05 13:14:07 -08:00
										 |  |  |   drone | 
					
						
							|  |  |  |   fullnode | 
					
						
							| 
									
										
										
										
											2018-12-13 21:11:09 -08:00
										 |  |  |   genesis | 
					
						
							| 
									
										
										
										
											2019-03-05 13:14:07 -08:00
										 |  |  |   keygen | 
					
						
							| 
									
										
										
										
											2018-12-13 21:11:09 -08:00
										 |  |  |   ledger-tool | 
					
						
							|  |  |  |   wallet | 
					
						
							|  |  |  | ) | 
					
						
							| 
									
										
										
										
											2018-12-19 10:30:24 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  | for crate in "${BIN_CRATES[@]}"; do | 
					
						
							| 
									
										
										
										
											2018-12-13 21:11:09 -08:00
										 |  |  |   ( | 
					
						
							|  |  |  |     set -x | 
					
						
							| 
									
										
										
										
											2018-12-19 10:30:24 -08:00
										 |  |  |     cargo install --force --path "$crate" --root "$installDir" --features="$cargoFeatures" | 
					
						
							| 
									
										
										
										
											2018-12-13 21:11:09 -08:00
										 |  |  |   ) | 
					
						
							|  |  |  | done | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-03-05 13:14:07 -08:00
										 |  |  | for dir in programs/*; do | 
					
						
							| 
									
										
										
										
											2018-12-19 10:30:24 -08:00
										 |  |  |   for program in echo target/release/deps/lib{,solana_}"$(basename "$dir")"{,_program}.{so,dylib,dll}; do | 
					
						
							|  |  |  |     if [[ -f $program ]]; then | 
					
						
							|  |  |  |       mkdir -p "$installDir/bin/deps" | 
					
						
							|  |  |  |       rm -f "$installDir/bin/deps/$(basename "$program")" | 
					
						
							|  |  |  |       cp -v "$program" "$installDir"/bin/deps | 
					
						
							|  |  |  |     fi | 
					
						
							|  |  |  |   done | 
					
						
							|  |  |  | done | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | du -a "$installDir" | 
					
						
							| 
									
										
										
										
											2018-12-13 21:11:09 -08:00
										 |  |  | echo "Done after $SECONDS seconds" |