diff options
author | Fabiano Fidêncio <fidencio@redhat.com> | 2019-09-05 11:52:10 +0200 |
---|---|---|
committer | Fabiano Fidêncio <fidencio@redhat.com> | 2019-09-25 13:26:34 +0200 |
commit | 37e117f6cb76c8a344ab9e4831694dc37df9e3e3 (patch) | |
tree | d3bfad102b3ad07a05ed30d52b17c4a72ae85868 /prepare-release.sh | |
parent | aedb45b1ad047ac6651290b3bdea82b45cfe41a2 (diff) | |
download | libosinfo-37e117f6cb76c8a344ab9e4831694dc37df9e3e3.tar.gz |
prepare-release: Adapt to use meson
Let's adapt the prepare-release script to use meson build system instead
of autotools.
This change has been tested and is working fine on Fedora 30+.
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to 'prepare-release.sh')
-rwxr-xr-x | prepare-release.sh | 120 |
1 files changed, 56 insertions, 64 deletions
diff --git a/prepare-release.sh b/prepare-release.sh index f1fe696..79bbb70 100755 --- a/prepare-release.sh +++ b/prepare-release.sh @@ -7,90 +7,82 @@ test -n "$1" && RESULTS=$1 || RESULTS=results.log INSTALL_ROOT=$HOME/builder # Make things clean. -test -f Makefile && make -k distclean || : - rm -rf build -mkdir build -cd build - -../autogen.sh --prefix=$INSTALL_ROOT \ - --enable-werror --enable-gtk-doc - -# If the MAKEFLAGS envvar does not yet include a -j option, -# add -jN where N depends on the number of processors. -case $MAKEFLAGS in - *-j*) ;; - *) n=$(getconf _NPROCESSORS_ONLN 2> /dev/null) - test "$n" -gt 0 || n=1 - n=$(expr $n + 1) - MAKEFLAGS="$MAKEFLAGS -j$n" - export MAKEFLAGS - ;; -esac - -make -make install + +meson build/native \ + --werror \ + -Denable-gtk-doc=true \ + -Denable-tests=true \ + -Denable-introspection=enabled \ + -Denable-vala=enabled \ + --prefix=$INSTALL_ROOT \ + +ninja -C build/native +ninja -C build/native install # set -o pipefail is a bashism; this use of exec is the POSIX alternative exec 3>&1 st=$( exec 4>&1 >&3 - { make check syntax-check 2>&1 3>&- 4>&-; echo $? >&4; } | tee "$RESULTS" + { ninja -C build/native test 2>&1 3>&- 4>&-; echo $? >&4; } | tee "$RESULTS" ) exec 3>&- test "$st" = 0 -rm -f *.tar.gz -make dist +ninja -C build/native dist -if [ -f /usr/bin/rpmbuild ]; then +if test -f /usr/bin/rpmbuild; then rpmbuild --nodeps \ - --define "_sourcedir `pwd`" \ - -ba --clean libosinfo.spec + --define "_sourcedir `pwd`/build/native/meson-dist/" \ + -ba --clean build/native/libosinfo.spec fi # Test mingw32 cross-compile -if test -x /usr/bin/i686-w64-mingw32-gcc ; then - make distclean - - PKG_CONFIG_PATH="$INSTALL_ROOT/i686-w64-mingw32/sys-root/mingw/lib/pkgconfig" \ - CC="i686-w64-mingw32-gcc" \ - ../configure \ - --build=$(uname -m)-pc-linux \ - --host=i686-w64-mingw32 \ - --prefix="$INSTALL_ROOT/i686-w64-mingw32/sys-root/mingw" \ - --enable-werror \ - --enable-introspection=no \ - --enable-tests=no - - make - make install +if test -x /usr/bin/i686-w64-mingw32-gcc && \ + test -r /usr/share/mingw/toolchain-mingw32.meson ; then + + rm -rf build/win32 || : + + meson build/win32 \ + --werror \ + -Denable-gtk-doc=false \ + -Denable-tests=false \ + -Denable-introspection=disabled \ + -Denable-vala=disabled \ + --prefix="$INSTALL_ROOT/i686-w64-mingw32/sys-root/mingw" \ + --cross-file="/usr/share/mingw/toolchain-mingw32.meson" + + ninja -C build/win32 + ninja -C build/win32 install fi # Test mingw64 cross-compile -if test -x /usr/bin/x86_64-w64-mingw32-gcc ; then - make distclean - - PKG_CONFIG_PATH="$INSTALL_ROOT/x86_64-w64-mingw32/sys-root/mingw/lib/pkgconfig" \ - CC="x86_64-w64-mingw32-gcc" \ - ../configure \ - --build=$(uname -m)-pc-linux \ - --host=x86_64-w64-mingw32 \ - --prefix="$INSTALL_ROOT/i686-w64-mingw32/sys-root/mingw" \ - --enable-werror \ - --enable-introspection=no \ - --enable-tests=no - - make - make install +if test -x /usr/bin/x86_64-w64-mingw32-gcc && \ + test -r /usr/share/mingw/toolchain-mingw64.meson ; then + + rm -rf build/win64 || : + + meson build/win64 \ + --werror \ + -Denable-gtk-doc=false \ + -Denable-tests=false \ + -Denable-introspection=disabled \ + -Denable-vala=disabled \ + --prefix="$INSTALL_ROOT/x86_64-w64-mingw32/sys-root/mingw" \ + --cross-file="/usr/share/mingw/toolchain-mingw64.meson" + + ninja -C build/win64 + ninja -C build/win64 install fi -if test -x /usr/bin/i686-w64-mingw32-gcc && test -x /usr/bin/x86_64-w64-mingw32-gcc ; then - if test -f /usr/bin/rpmbuild ; then - rpmbuild --nodeps \ - --define "_sourcedir `pwd`" \ - -ba --clean mingw-libosinfo.spec - fi +if test -x /usr/bin/i686-w64-mingw32-gcc && \ + test -r /usr/share/mingw/toolchain-mingw32.meson && \ + test -x /usr/bin/x86_64-w64-mingw32-gcc && \ + test -r /usr/share/mingw/toolchain-mingw64.meson && \ + test -f /usr/bin/rpmbuild; then + rpmbuild --nodeps \ + --define "_sourcedir `pwd`/build/native/meson-dist/" \ + -ba --clean build/native/libosinfo.spec fi |