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 "Copying in customized plugins: spectrogram.js and hpcp.js" ; \
|
---|
25 | /bin/cp ../wavesurfer-plugins/*.js src/plugin/. ; )
|
---|
26 | # echo "Running the *configure* stage with NodeJS source code equates to running 'npm install' to downloading required packages" ; \
|
---|
27 | # echo "npm install" ; \
|
---|
28 | # npm install )
|
---|
29 | if [ $? != 0 ] ; then
|
---|
30 | echo " Error encountered running *configure* stage of $progname"
|
---|
31 | exit 1
|
---|
32 | fi
|
---|
33 | echo "[popd]"
|
---|
34 | else
|
---|
35 | # Is the following check meaningful for npm???
|
---|
36 | if [ $auto_config = "1" ] ; then
|
---|
37 | echo "Found top-level for ${progname%.*} => no need to run ./configure"
|
---|
38 | fi
|
---|
39 | fi
|
---|
40 |
|
---|
41 |
|
---|
42 | # opt_run_make $compile $package $version
|
---|
43 | if [ $compile = "1" ] ; then
|
---|
44 | ( cd $package$version ; \
|
---|
45 | echo "npm run build $@" ; \
|
---|
46 | npm run build $@ )
|
---|
47 | if [ $? != 0 ] ; then
|
---|
48 | echo " Error encountered running *make $target* stage of $progname"
|
---|
49 | exit 1
|
---|
50 | fi
|
---|
51 | fi
|
---|
52 |
|
---|
53 | # opt_run_make $install $package $version "install"
|
---|
54 | if [ $install = "1" ] ; then
|
---|
55 | if [ ! -d ../../../web/ext ] ; then
|
---|
56 | echo " Making directory: ../../../web/ext"
|
---|
57 | mkdir ../../../web/ext
|
---|
58 | fi
|
---|
59 |
|
---|
60 | if [ ! -d ../../../web/ext/audio ] ; then
|
---|
61 | echo " Making directory: ../../../web/ext/audio"
|
---|
62 | mkdir ../../../web/ext/audio
|
---|
63 | fi
|
---|
64 |
|
---|
65 | if [ ! -d ../../../web/ext/audio/ws ] ; then
|
---|
66 | echo " Making directory: ../../../web/ext/audio/ws"
|
---|
67 | mkdir ../../../web/ext/audio/ws
|
---|
68 | fi
|
---|
69 |
|
---|
70 | echo " Installing 'wavesurfer' into ../../../web/ext/audio"
|
---|
71 |
|
---|
72 | echo "Copying $package$version/dist/* to ../../../web/ext/audio/ws/."
|
---|
73 | /bin/cp -r "$package$version"/dist/* "../../../web/ext/audio/ws/."
|
---|
74 |
|
---|
75 | # Turns out the JSON used by the Spectrogram plugin for WaveSurferJS wants
|
---|
76 | # the data directly (e.g. inline). Can be set up with a URL call
|
---|
77 | # WaveSurfer.util.fetchFile() ...
|
---|
78 | # but more effort, so have opted to embed JSON directly into wavesurfer-player.js
|
---|
79 | # echo "Copying colormap/hot-colormap.json to ../../../web/ext/audio/ws/."
|
---|
80 | # /bin/cp -r colormap/hot-colormap.json ../../../web/ext/audio/ws/.
|
---|
81 |
|
---|
82 | echo "Copying wavesurfer-player to ../../../web/ext/audio"
|
---|
83 | /bin/cp -r wavesurfer-player/css wavesurfer-player/wavesurfer-player.js ../../../web/ext/audio/.
|
---|
84 |
|
---|
85 |
|
---|
86 | fi
|
---|
87 |
|
---|
88 | # opt_run_make $clean $package $version "clean"
|
---|
89 | if [ $clean = "1" ] ; then
|
---|
90 | echo "****"
|
---|
91 | echo "* No 'clean' target currently implemented for 'npm' based src package"
|
---|
92 | echo "****"
|
---|
93 | fi
|
---|
94 |
|
---|
95 | #opt_run_make $distclean $package $version "distclean"
|
---|
96 | if [ $distclean = "1" ] ; then
|
---|
97 | echo "****"
|
---|
98 | echo "* No 'clean' target currently implemented for 'npm' based src package"
|
---|
99 | echo "****"
|
---|
100 | fi
|
---|
101 |
|
---|
102 | opt_run_tarclean $tarclean $package $version
|
---|
103 |
|
---|
104 |
|
---|
105 |
|
---|