1 | #!/bin/bash
|
---|
2 |
|
---|
3 | package=wavesurfer.js
|
---|
4 | version=-4.0.1
|
---|
5 |
|
---|
6 | progname=$0
|
---|
7 |
|
---|
8 | source ../cascade-make/lib/cascade-lib.bash GEXT_MARS ../.. $*
|
---|
9 |
|
---|
10 | prefix=$GEXT_MARS_INSTALLED
|
---|
11 |
|
---|
12 | #export CFLAGS="$CFLAGS -I$GEXT_MARS_INSTALLED/include"
|
---|
13 | #export CPPFLAGS="$CPPFLAGS -I$GEXT_MARS_INSTALLED/include"
|
---|
14 | #export CXXFLAGS="$CXXFLAGS -I$GEXT_MARS_INSTALLED/include"
|
---|
15 | #export LDFLAGS="$LDFLAGS -L$GEXT_MARS_INSTALLED/lib"
|
---|
16 | #export LD_LIBRARY_PATH="$GEXT_MARS_INSTALLED/lib"
|
---|
17 |
|
---|
18 | opt_run_untar $force_untar $auto_untar $package $version
|
---|
19 |
|
---|
20 | #opt_run_configure $force_config $auto_config $package $version $prefix
|
---|
21 | if [ $force_config = "1" ] ; then
|
---|
22 | echo "[pushd $package$version]"
|
---|
23 | ( cd $package$version ; \
|
---|
24 | echo "Running the *configure* stage with NodeJS source code equates to running 'npm install' to downloading required packages" ; \
|
---|
25 | echo "npm install" ; \
|
---|
26 | npm install )
|
---|
27 | if [ $? != 0 ] ; then
|
---|
28 | echo " Error encountered running *configure* stage of $progname"
|
---|
29 | exit 1
|
---|
30 | fi
|
---|
31 | echo "[popd]"
|
---|
32 | else
|
---|
33 | # Is the following check meaningful for npm???
|
---|
34 | if [ $auto_config = "1" ] ; then
|
---|
35 | echo "Found top-level for ${progname%.*} => no need to run ./configure"
|
---|
36 | fi
|
---|
37 | fi
|
---|
38 |
|
---|
39 |
|
---|
40 | # opt_run_make $compile $package $version
|
---|
41 | if [ $compile = "1" ] ; then
|
---|
42 | ( cd $package$version ; \
|
---|
43 | echo "npm run build $@" ; \
|
---|
44 | npm run build $@ )
|
---|
45 | if [ $? != 0 ] ; then
|
---|
46 | echo " Error encountered running *make $target* stage of $progname"
|
---|
47 | exit 1
|
---|
48 | fi
|
---|
49 | fi
|
---|
50 |
|
---|
51 | # opt_run_make $install $package $version "install"
|
---|
52 | if [ $install = "1" ] ; then
|
---|
53 | # echo "****"
|
---|
54 | # echo "* Generate files: $package$version/dist"
|
---|
55 | # echo "****"
|
---|
56 |
|
---|
57 | if [ ! -d ../../../web/ext ] ; then
|
---|
58 | echo " Making directory: ../../../web/ext"
|
---|
59 | mkdir ../../../web/ext
|
---|
60 | fi
|
---|
61 |
|
---|
62 | if [ ! -d ../../../web/ext/audio ] ; then
|
---|
63 | echo " Making directory: ../../../web/ext/audio"
|
---|
64 | mkdir ../../../web/ext/audio
|
---|
65 | fi
|
---|
66 |
|
---|
67 | echo " Installing 'wavesurfer' into ../../../web/ext/audio"
|
---|
68 |
|
---|
69 | echo "Copying $package$version/dist to ../../../web/ext/audio/ws"
|
---|
70 | /bin/cp -r "$package$version/dist" "../../../web/ext/audio/ws"
|
---|
71 |
|
---|
72 | # Turns out the JSON used by the Spectrogram plugin for WaveSurferJS wants
|
---|
73 | # the data directly (e.g. inline). Can be set up with a URL call
|
---|
74 | # WaveSurfer.util.fetchFile() ...
|
---|
75 | # but more effort, so have opted to embed JSON directly into wavesurfer-player.js
|
---|
76 | # echo "Copying colormap/hot-colormap.json to ../../../web/ext/audio/ws/."
|
---|
77 | # /bin/cp -r colormap/hot-colormap.json ../../../web/ext/audio/ws/.
|
---|
78 |
|
---|
79 | echo "Copying wavesurfer-player to ../../../web/ext/audio"
|
---|
80 | /bin/cp -r wavesurfer-player/css wavesurfer-player/wavesurfer-player.js ../../../web/ext/audio/.
|
---|
81 |
|
---|
82 |
|
---|
83 | fi
|
---|
84 |
|
---|
85 | # opt_run_make $clean $package $version "clean"
|
---|
86 | if [ $clean = "1" ] ; then
|
---|
87 | echo "****"
|
---|
88 | echo "* No 'clean' target currently implemented for 'npm' based src package"
|
---|
89 | echo "****"
|
---|
90 | fi
|
---|
91 |
|
---|
92 | #opt_run_make $distclean $package $version "distclean"
|
---|
93 | if [ $distclean = "1" ] ; then
|
---|
94 | echo "****"
|
---|
95 | echo "* No 'clean' target currently implemented for 'npm' based src package"
|
---|
96 | echo "****"
|
---|
97 | fi
|
---|
98 |
|
---|
99 | opt_run_tarclean $tarclean $package $version
|
---|
100 |
|
---|
101 |
|
---|
102 |
|
---|