source: gs3-extensions/mars-src/trunk/src/CASCADE-MAKE/WAVESURFER.sh@ 34661

Last change on this file since 34661 was 34661, checked in by davidb, 3 years ago

More careful running of node build run commands, and when the modified files need to be copied in

  • Property svn:executable set to *
File size: 3.4 KB
Line 
1#!/bin/bash
2
3package=wavesurfer.js
4version=-4.0.1
5
6progname=$0
7
8source ../cascade-make/lib/cascade-lib.bash GEXT_MARS ../.. $*
9
10prefix=$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
18opt_run_untar $force_untar $auto_untar $package $version
19
20#opt_run_configure $force_config $auto_config $package $version $prefix
21if [ $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]"
32else
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
37fi
38
39
40# opt_run_make $compile $package $version
41if [ $compile = "1" ] ; then
42 ( cd $package$version ; \
43 echo "Copying in customized renderer: drawer.spectrummulticanvas.js" ; \
44 /bin/cp ../wavesurfer-plugins/*.js src/. ; \
45 echo "Copying in customized plugins: spectrogram.js and hpcp.js" ; \
46 /bin/cp ../wavesurfer-plugins/*.js src/plugin/. ; \
47 echo "npm run build" ; \
48 npm run build )
49 if [ $? != 0 ] ; then
50 echo " Error encountered running *make $target* stage of $progname"
51 exit 1
52 fi
53fi
54
55# opt_run_make $install $package $version "install"
56if [ $install = "1" ] ; then
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 if [ ! -d ../../../web/ext/audio/ws ] ; then
68 echo " Making directory: ../../../web/ext/audio/ws"
69 mkdir ../../../web/ext/audio/ws
70 fi
71
72 echo " Installing 'wavesurfer' into ../../../web/ext/audio"
73
74 echo "Copying $package$version/dist/* to ../../../web/ext/audio/ws/."
75 /bin/cp -r "$package$version"/dist/* "../../../web/ext/audio/ws/."
76
77# Turns out the JSON used by the Spectrogram plugin for WaveSurferJS wants
78# the data directly (e.g. inline). Can be set up with a URL call
79# WaveSurfer.util.fetchFile() ...
80# but more effort, so have opted to embed JSON directly into wavesurfer-player.js
81# echo "Copying colormap/hot-colormap.json to ../../../web/ext/audio/ws/."
82# /bin/cp -r colormap/hot-colormap.json ../../../web/ext/audio/ws/.
83
84 echo "Copying wavesurfer-player to ../../../web/ext/audio"
85 /bin/cp -r wavesurfer-player/css wavesurfer-player/wavesurfer-player.js ../../../web/ext/audio/.
86
87
88fi
89
90# opt_run_make $clean $package $version "clean"
91if [ $clean = "1" ] ; then
92 echo "****"
93 echo "* No 'clean' target currently implemented for 'npm' based src package"
94 echo "****"
95fi
96
97#opt_run_make $distclean $package $version "distclean"
98if [ $distclean = "1" ] ; then
99 echo "****"
100 echo "* No 'clean' target currently implemented for 'npm' based src package"
101 echo "****"
102fi
103
104opt_run_tarclean $tarclean $package $version
105
106
107
Note: See TracBrowser for help on using the repository browser.