diff options
Diffstat (limited to 'dist/msys2-mingw/run.sh')
-rw-r--r-- | dist/msys2-mingw/run.sh | 106 |
1 files changed, 31 insertions, 75 deletions
diff --git a/dist/msys2-mingw/run.sh b/dist/msys2-mingw/run.sh index 32f971322..55aff45c4 100644 --- a/dist/msys2-mingw/run.sh +++ b/dist/msys2-mingw/run.sh @@ -1,5 +1,7 @@ #!/bin/sh +cd $(dirname $0) + # Stop in case of error set -e @@ -36,6 +38,12 @@ gstart () { gend () { : } +gblock () { + gstart "$1" + shift + $@ + gend +} [ -n "$CI" ] && { echo "INFO: set 'gstart' and 'gend' for CI" @@ -54,84 +62,32 @@ gend () { #--- -do_build () { - gstart 'Install common build dependencies' - pacman -S --noconfirm base-devel - gend - - if [ -z "$TARGET" ]; then - printf "${ANSI_RED}Undefined TARGET!$ANSI_NOCOLOR" - exit 1 - fi - cd "$TARGET" - - gstart "Fetch --unshallow" - # The command 'git describe' (used for version) needs the history. Get it. - # But the following command fails if the repository is complete. - git fetch --unshallow || true - gend - - MINGW_INSTALLS="$(echo "$MINGW_INSTALLS" | tr '[:upper:]' '[:lower:]')" +if [ -z "$TARGET" ]; then + printf "${ANSI_RED}Undefined TARGET!$ANSI_NOCOLOR" + exit 1 +fi +cd "$TARGET" - case "$MINGW_INSTALLS" in - mingw32) - TARBALL_ARCH="i686" - ;; - mingw64) - TARBALL_ARCH="x86_64" +# The command 'git describe' (used for version) needs the history. Get it. +# But the following command fails if the repository is complete. +gblock "Fetch --unshallow" git fetch --unshallow || true - # FIXME: specific versions of these packages should be installed automatically by makepkg-mingw. - # E.g.: mingw-w64-x86_64-llvm-8.0.1-3 mingw-w64-x86_64-clang-8.0.1-3 mingw-w64-x86_64-z3-4.8.5-1 - # However, specifying the version produces 'error: target not found:' - gstart "Install build dependencies" - pacman -S --noconfirm mingw-w64-x86_64-llvm mingw-w64-x86_64-clang mingw-w64-x86_64-z3 - gend - ;; - *) - printf "${ANSI_RED}Unknown MING_INSTALLS=${MINGW_INSTALLS}!$ANSI_NOCOLOR" - exit 1 - esac - gstart 'Install toolchain' - pacman -S --noconfirm mingw-w64-${TARBALL_ARCH}-toolchain - gend - - gstart 'Build package' - makepkg-mingw --noconfirm --noprogressbar -sCLf --noarchive - gend - - gstart 'Archive package' - makepkg-mingw --noconfirm --noprogressbar -R - gend - - gstart 'List artifacts' - ls -la - gend +MINGW_INSTALLS="$(echo "$MINGW_INSTALLS" | tr '[:upper:]' '[:lower:]')" - gstart 'Install package' - pacman --noconfirm -U "mingw-w64-${TARBALL_ARCH}-ghdl-${TARGET}-ci"-*-any.pkg.tar.zst - gend -} - -#--- - -do_test () { - gstart 'Environment' - env | grep MSYSTEM - env | grep MINGW - gend - - GHDL=ghdl ../../testsuite/testsuite.sh -} - -#--- - -cd $(dirname $0) - -case "$1" in - -t) - do_test +case "$MINGW_INSTALLS" in + mingw32) + TARBALL_ARCH="i686" ;; - *) - do_build + mingw64) + TARBALL_ARCH="x86_64" ;; + *) + printf "${ANSI_RED}Unknown MINGW_INSTALLS=${MINGW_INSTALLS}!$ANSI_NOCOLOR" + exit 1 esac + +gblock 'Install toolchain' pacman -S --noconfirm base-devel mingw-w64-${TARBALL_ARCH}-toolchain +gblock 'Build package' makepkg-mingw --noconfirm --noprogressbar -sCLf --noarchive +gblock 'Archive package' makepkg-mingw --noconfirm --noprogressbar -R +gblock 'List artifacts' ls -la +gblock 'Install package' pacman --noconfirm -U "mingw-w64-${TARBALL_ARCH}-ghdl-${TARGET}-ci"-*-any.pkg.tar.zst |