build_mingw32.sh: build tarball for mingw64
authorPaul Brossier <piem@piem.org>
Mon, 13 Feb 2017 17:44:16 +0000 (18:44 +0100)
committerPaul Brossier <piem@piem.org>
Mon, 13 Feb 2017 17:44:16 +0000 (18:44 +0100)
build_mingw64.sh [new file with mode: 0755]
scripts/get_deps_mingw64.sh [new file with mode: 0755]

diff --git a/build_mingw64.sh b/build_mingw64.sh
new file mode 100755 (executable)
index 0000000..6c1b721
--- /dev/null
@@ -0,0 +1,52 @@
+#! /bin/sh
+
+# cross compile vamp-aubio-plugins using mingw32 toolchain
+
+. $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="x86_64-w64-mingw32-gcc"
+export CXX="x86_64-w64-mingw32-g++"
+export STRIP="x86_64-w64-mingw32-strip"
+export WAFOPTS="--with-target-platform=win64 --disable-sndfile --disable-samplerate --disable-jack --disable-avcodec --notests"
+
+# get waf
+./scripts/get_waf.sh
+
+# fetch Vamp SDK
+./scripts/get_deps_mingw64.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-win64
+  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
diff --git a/scripts/get_deps_mingw64.sh b/scripts/get_deps_mingw64.sh
new file mode 100755 (executable)
index 0000000..ff189a1
--- /dev/null
@@ -0,0 +1,20 @@
+#! /bin/bash
+
+
+source scripts/resources
+
+#rm -rf contrib/
+mkdir -p contrib/
+
+pushd contrib
+
+for p in $VAMP_PLUGIN_SDK #$VAMP_PLUGIN_SDK_MINGW
+do
+  fetch $p
+done
+
+pushd vamp-plugin-sdk-2.6
+make -f build/Makefile.mingw64
+popd
+
+popd