summaryrefslogtreecommitdiff
path: root/graphics/asymptote/build-scripts/build-asygl
blob: 46e0cfd082b11a43e5fbc0bf0b54eeb1b0e72425 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh
if [ ! $# = 0 ]; then echo Usage: "$0"; exit 1; fi
GL_MATRIX_VERSION=2.4.0
GL_MATRIX_DIR=gl-matrix-$GL_MATRIX_VERSION
GL_MATRIX_DIR_PRUNED=$GL_MATRIX_DIR-pruned
if test ! -r $GL_MATRIX_DIR_PRUNED; then \
    TEMPDIR=`mktemp -d`
    TARFILE=$TEMPDIR/$GL_MATRIX_DIR.tar.gz
    wget https://github.com/toji/gl-matrix/archive/v$GL_MATRIX_VERSION.tar.gz --output-document=$TARFILE
tar -zxf $TARFILE
mv $GL_MATRIX_DIR $GL_MATRIX_DIR_PRUNED
rm -r $TEMPDIR
cd $GL_MATRIX_DIR_PRUNED
patch -p1 < ../patches/$GL_MATRIX_DIR_PRUNED.patch
npm install
npm run build-all
echo "/*@license for gl-matrix mat3 and mat4 functions:" > LICENSE.js
echo "*/"| cat LICENSE.md - >> LICENSE.js
cd ..
fi
cat $GL_MATRIX_DIR_PRUNED/dist/gl-matrix.js webgl/gl.js $GL_MATRIX_DIR_PRUNED/LICENSE.js | uglifyjs -m -c -o base/webgl/asygl.js --comments