File: build.sh

package info (click to toggle)
firefox 134.0.2-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,345,684 kB
  • sloc: cpp: 7,244,582; javascript: 6,236,669; ansic: 3,654,775; python: 1,359,774; xml: 618,542; asm: 426,944; java: 183,315; sh: 66,206; makefile: 19,398; perl: 13,009; objc: 12,453; yacc: 4,583; cs: 3,846; pascal: 2,989; lex: 1,720; ruby: 1,194; exp: 762; php: 436; lisp: 258; awk: 247; sql: 66; sed: 54; csh: 10
file content (42 lines) | stat: -rwxr-xr-x 1,245 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# !/bin/bash
set -xe

# grabbing and patching transformers.js for gecko
rm -rf tmp
mkdir tmp
pushd tmp
# pin to a specific commit on the v3 branch
git clone --branch v3 https://github.com/xenova/transformers.js
cd transformers.js
git checkout 682c7d0588e1ea65090adb5be50877b8d8bc0968
git apply ../../gecko.patch
npm install
npm install typescript@latest
npm install @types/node@latest
npm run build
cp dist/transformers.js ../../transformers-dev.js
cp dist/transformers.min.js ../../transformers.js
popd
rm -rf tmp

# grabbing and patching onnxruntime-web for gecko.

# fetch the tarball URL from npm
TARBALL_URL=$(npm view onnxruntime-web@1.20.0-dev.20240827-1d059b8702 dist.tarball)
wget "${TARBALL_URL}" -O dist.tgz

# grab the two files we need
tar -xzf dist.tgz
rm dist.tgz
cp package/dist/ort.mjs ort-dev.mjs
cp package/dist/ort.min.mjs ort.mjs
cp package/dist/ort.webgpu.mjs ort.webgpu-dev.mjs
cp package/dist/ort.webgpu.min.mjs ort.webgpu.mjs
cp package/dist/ort-wasm-simd-threaded.jsep.mjs ort-wasm-simd-threaded.jsep.mjs
cp package/dist/ort-wasm-simd-threaded.mjs ort-wasm-simd-threaded.mjs

rm -rf package

# remove the last line of ort-dev.js and ort.webgpu-dev.mjs (map)
sed -i '' '$d' ort-dev.mjs
sed -i '' '$d' ort.webgpu-dev.mjs