1version=1.9.0 2hashfile=tf${version}-hashes.nix 3rm -f $hashfile 4echo "{" >> $hashfile 5for sys in "linux" "mac"; do 6 for tfpref in "cpu/tensorflow" "gpu/tensorflow_gpu"; do 7 for pykind in "py2-none-any" "py3-none-any" "cp27-none-linux_x86_64" "cp35-cp35m-linux_x86_64" "cp36-cp36m-linux_x86_64"; do 8 if [ $sys == "mac" ]; then 9 [[ $pykind =~ py.* ]] && [[ $tfpref =~ cpu.* ]] 10 result=$? 11 pyver=${pykind:2:1} 12 flavour=cpu 13 else 14 [[ $pykind =~ .*linux.* ]] 15 result=$? 16 pyver=${pykind:2:2} 17 flavour=${tfpref:0:3} 18 fi 19 if [ $result == 0 ]; then 20 url=https://storage.googleapis.com/tensorflow/$sys/$tfpref-$version-$pykind.whl 21 hash=$(nix-prefetch-url $url) 22 echo "${sys}_py_${pyver}_${flavour} = {" >> $hashfile 23 echo " url = \"$url\";" >> $hashfile 24 echo " sha256 = \"$hash\";" >> $hashfile 25 echo "};" >> $hashfile 26 fi 27 done 28 done 29done 30echo "}" >> $hashfile