2007-07-20 23:26:08 +04:00
#!/bin/sh
set -e
set -v
rm -rf build
2012-02-01 18:46:53 +04:00
2021-01-08 21:04:45 +03:00
meson --prefix= "`pwd`/build/vroot" build/native
2012-02-01 18:46:53 +04:00
2021-01-08 21:04:45 +03:00
ninja -C build/native dist
2015-01-12 14:27:56 +03:00
2007-07-20 23:26:08 +04:00
if [ -f /usr/bin/rpmbuild ] ; then
2021-01-08 21:04:45 +03:00
rpmbuild --nodeps \
--define "_sourcedir `pwd`/build/native/meson-dist" \
-ba --clean build/native/virt-viewer.spec
2008-11-28 15:24:56 +03:00
fi
2021-01-08 21:04:45 +03:00
# Test mingw32 cross-compile
if test -x /usr/bin/i686-w64-mingw32-gcc ; then
meson --prefix= "`pwd`/build/vroot" \
--cross-file= /usr/share/mingw/toolchain-mingw32.meson build/win32
2008-11-28 15:24:56 +03:00
2021-01-08 21:04:45 +03:00
ninja -C build/win32
2012-09-14 20:34:53 +04:00
fi
2021-01-08 21:04:45 +03:00
# Test mingw64 cross-compile
if test -x /usr/bin/x86_64-w64-mingw32-gcc ; then
meson --prefix= "`pwd`/build/vroot" \
--cross-file= /usr/share/mingw/toolchain-mingw64.meson build/win64
2012-09-14 20:34:53 +04:00
2021-01-08 21:04:45 +03:00
ninja -C build/win64
2012-09-14 20:34:53 +04:00
fi
2008-11-28 15:24:56 +03:00
2012-09-14 20:34:53 +04:00
if test -x /usr/bin/i686-w64-mingw32-gcc && test -x /usr/bin/x86_64-w64-mingw32-gcc ; then
2021-01-08 21:04:45 +03:00
if test -f /usr/bin/rpmbuild ; then
rpmbuild --nodeps \
--define "_sourcedir `pwd`/build/native/meson-dist" \
-ba --clean build/native/mingw-virt-viewer.spec
2008-11-28 15:24:56 +03:00
fi
2007-07-20 23:26:08 +04:00
fi