1#!/usr/bin/env bash
2
3version="2.13.0"
4
5bucket="https://storage.googleapis.com/tensorflow"
6
7# List of binary wheels for Tensorflow. The most recent versions can be found
8# on the following page:
9# https://www.tensorflow.org/install/pip?lang=python3#package-location
10url_and_key_list=(
11"linux_py_38_cpu $bucket/linux/cpu/tensorflow_cpu-${version}-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl"
12"linux_py_39_cpu $bucket/linux/cpu/tensorflow_cpu-${version}-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl"
13"linux_py_310_cpu $bucket/linux/cpu/tensorflow_cpu-${version}-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl"
14"linux_py_311_cpu $bucket/linux/cpu/tensorflow_cpu-${version}-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl"
15"linux_py_38_gpu $bucket/linux/gpu/tensorflow-${version}-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl"
16"linux_py_39_gpu $bucket/linux/gpu/tensorflow-${version}-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl"
17"linux_py_310_gpu $bucket/linux/gpu/tensorflow-${version}-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl"
18"linux_py_311_gpu $bucket/linux/gpu/tensorflow-${version}-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl"
19"mac_py_38_cpu $bucket/mac/cpu/tensorflow-${version}-cp38-cp38-macosx_10_15_x86_64.whl"
20"mac_py_39_cpu $bucket/mac/cpu/tensorflow-${version}-cp39-cp39-macosx_10_15_x86_64.whl"
21"mac_py_310_cpu $bucket/mac/cpu/tensorflow-${version}-cp310-cp310-macosx_10_15_x86_64.whl"
22"mac_py_311_cpu $bucket/mac/cpu/tensorflow-${version}-cp311-cp311-macosx_10_15_x86_64.whl"
23)
24
25hashfile=binary-hashes.nix
26rm -f $hashfile
27echo "{" >> $hashfile
28echo "version = \"$version\";" >> $hashfile
29
30for url_and_key in "${url_and_key_list[@]}"; do
31 key=$(echo "$url_and_key" | cut -d' ' -f1)
32 url=$(echo "$url_and_key" | cut -d' ' -f2)
33
34 echo "prefetching ${url}..."
35 hash=$(nix-prefetch-url $url)
36
37 echo "$key = {" >> $hashfile
38 echo " url = \"$url\";" >> $hashfile
39 echo " sha256 = \"$hash\";" >> $hashfile
40 echo "};" >> $hashfile
41
42 echo
43done
44
45echo "}" >> $hashfile
46echo "done."