build_mingw{32,64}.sh: vamp cross-compilation is broken, refuse to run scripts (see #2)
[vamp-aubio-plugins.git] / build_mingw32.sh
old mode 100644 (file)
new mode 100755 (executable)
index 4235350..9a46b6f
@@ -2,28 +2,55 @@
 
 # cross compile vamp-aubio-plugins using mingw32 toolchain
 
-pushd ..
-
-# get Vamp SDK
-curl -O https://code.soundsoftware.ac.uk/attachments/download/690/vamp-plugin-sdk-2.5.tar.gz
-tar xf vamp-plugin-sdk-2.5.tar.gz
-
-# get Vamp windows binaries
-curl -O https://code.soundsoftware.ac.uk/attachments/download/694/vamp-plugin-sdk-2.5-binaries-win32-mingw.zip
-unzip -ox vamp-plugin-sdk-2.5-binaries-win32-mingw.zip
-
-# build aubio
-git clone git://git.aubio.org/git/aubio/ aubio-mingw32
-pushd aubio-mingw32
-git co develop
-git pull
-CFLAGS="-Os" CC=i586-mingw32msvc-gcc ./waf distclean configure build install \
-  --destdir=../aubio-dist-mingw32 --testcmd="echo %s" \
-  --with-target-platform=win32 --disable-avcodec --disable-samplerate \
-  --disable-jack --disable-sndfile
-popd
-
-popd
-
-# now build vamp-aubio-plugins
-make -f Makefile.mingw32 clean all
+echo "ERROR: This script does not produce a binary loadable by sonic visualiser."
+echo "Comment the following line to run it anyway."
+exit 1
+
+. $PWD/VERSION
+VAMP_AUBIO_VERSION=$VAMP_AUBIO_MAJOR_VERSION.$VAMP_AUBIO_MINOR_VERSION.$VAMP_AUBIO_PATCH_VERSION$VAMP_AUBIO_VERSION_STATUS
+
+set -e
+set -x
+
+if [ "$1" = 'dist' ]
+then
+  rm -rf contrib/
+fi
+
+export CFLAGS="-Os"
+#export CC="i586-mingw32msvc-gcc"
+#export CXX="i586-mingw32msvc-g++"
+export CC="i686-w64-mingw32-gcc"
+export CXX="i686-w64-mingw32-g++"
+export STRIP="i686-w64-mingw32-strip"
+export WAFOPTS="--with-target-platform=win32 --disable-sndfile --disable-samplerate --disable-jack --disable-avcodec --notests"
+
+# get waf
+./scripts/get_waf.sh
+
+# fetch Vamp SDK
+./scripts/get_deps_mingw32.sh
+
+# fetch and build aubio
+./scripts/get_aubio.sh
+
+# configure and build plugin
+./waf configure
+
+./waf build -v
+
+# system-wide installation
+#./waf install --destdir=dist-win
+
+if [ "$1" = 'dist' ]
+then
+  DESTDIR=vamp-aubio-plugins-$VAMP_AUBIO_VERSION-win32
+  rm -rf $DESTDIR $DESTDIR.zip
+  mkdir $DESTDIR
+  cp -prv contrib/aubio*/README.md $DESTDIR/README.aubio.md
+  cp -prv README.md $DESTDIR
+  cp -prv build/vamp-aubio.dll $DESTDIR
+  $STRIP $DESTDIR/vamp-aubio.dll
+  cp -prv vamp-aubio.cat vamp-aubio.n3 $DESTDIR
+  zip -r $DESTDIR.zip $DESTDIR
+fi