tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

fetch-onnxruntime-deps.sh (2348B)


      1 #!/bin/sh
      2 
      3 # This Source Code Form is subject to the terms of the Mozilla Public
      4 # License, v. 2.0. If a copy of the MPL was not distributed with this
      5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
      6 
      7 # This script downloads onnxruntime dependencies and bundles them in a single archive.
      8 # It avoids downloading them at build time. Not all dependencies are actually
      9 # used during build, they are selected at configuration time.
     10 
     11 set -e
     12 set -x
     13 
     14 # script parameters
     15 onnx_git=$1
     16 onnx_rev=$2
     17 tardir=onnxruntime-deps
     18 
     19 # script dependencies
     20 git=`which git`
     21 curl=`which curl`
     22 
     23 # parse onnxruntime dependencies from original depo
     24 currdir=`pwd`
     25 workdir=`mktemp -d`
     26 cd $workdir
     27 curl -LO "$onnx_git/archive/$onnx_rev.tar.gz"
     28 tar xf "$onnx_rev.tar.gz"
     29 cd onnxruntime-$onnx_rev
     30 
     31 # Update source for eigen3, see https://github.com/microsoft/onnxruntime/pull/24884
     32 patch -p1 << EOF
     33 diff --git a/cmake/deps.txt b/cmake/deps.txt
     34 index 728241840f723..6e045f6dcdc9d 100644
     35 --- a/cmake/deps.txt
     36 +++ b/cmake/deps.txt
     37 @@ -22,7 +22,9 @@ dlpack;https://github.com/dmlc/dlpack/archive/5c210da409e7f1e51ddf445134a4376fdb
     38 # it contains changes on top of 3.4.0 which are required to fix build issues.
     39 # Until the 3.4.1 release this is the best option we have.
     40 # Issue link: https://gitlab.com/libeigen/eigen/-/issues/2744
     41 -eigen;https://gitlab.com/libeigen/eigen/-/archive/1d8b82b0740839c0de7f1242a3585e3390ff5f33/eigen-1d8b82b0740839c0de7f1242a3585e3390ff5f33.zip;5ea4d05e62d7f954a46b3213f9b2535bdd866803
     42 +# Moved to github mirror to avoid gitlab issues.
     43 +# Issue link: https://github.com/bazelbuild/bazel-central-registry/issues/4355
     44 +eigen;https://github.com/eigen-mirror/eigen/archive/1d8b82b0740839c0de7f1242a3585e3390ff5f33/eigen-1d8b82b0740839c0de7f1242a3585e3390ff5f33.zip;05b19b49e6fbb91246be711d801160528c135e34
     45 flatbuffers;https://github.com/google/flatbuffers/archive/refs/tags/v23.5.26.zip;59422c3b5e573dd192fead2834d25951f1c1670c
     46 fp16;https://github.com/Maratyszcza/FP16/archive/0a92994d729ff76a58f692d3028ca1b64b145d91.zip;b985f6985a05a1c03ff1bb71190f66d8f98a1494
     47 EOF
     48 
     49 mkdir $tardir
     50 cd $tardir
     51 
     52 # actual download
     53 grep -v '^#' ../cmake/deps.txt | cut -d ';' -f2 | while read url ; do $curl -LO $url ; done
     54 
     55 # packit
     56 cd ..
     57 tar caf $tardir.tar.zst $tardir
     58 mkdir -p $UPLOAD_DIR
     59 mv $tardir.tar.zst $UPLOAD_DIR
     60 
     61 # cleanup
     62 cd  $currdir
     63 rm -rf $workdir