From 262c531cd39412ee3ea1e019f102b9cbfc698da0 Mon Sep 17 00:00:00 2001 From: umarcor Date: Mon, 28 Dec 2020 21:53:53 +0100 Subject: ci: MSYS2 job cleanup --- .github/workflows/push.yml | 32 ++++++++++----- dist/msys2-llvm/PKGBUILD | 24 +++++++++++ dist/msys2-mcode/PKGBUILD | 22 ++++++++++ dist/msys2-mingw/llvm/PKGBUILD | 24 ----------- dist/msys2-mingw/mcode/PKGBUILD | 22 ---------- dist/msys2-mingw/run.sh | 91 ----------------------------------------- 6 files changed, 67 insertions(+), 148 deletions(-) create mode 100644 dist/msys2-llvm/PKGBUILD create mode 100644 dist/msys2-mcode/PKGBUILD delete mode 100644 dist/msys2-mingw/llvm/PKGBUILD delete mode 100644 dist/msys2-mingw/mcode/PKGBUILD delete mode 100644 dist/msys2-mingw/run.sh diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 179b833e0..46346ae1e 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -115,15 +115,14 @@ jobs: max-parallel: 2 matrix: include: [ - {installs: "MINGW32", pkg: "mcode"}, - #{installs: "MINGW32", pkg: "llvm"}, ! Not yet functional - #{installs: "MINGW64", pkg: "mcode"}, ! mcode is not yet supported on win64 - {installs: "MINGW64", pkg: "llvm"}, + {installs: "MINGW32", arch: i686, pkg: "mcode"}, + #{installs: "MINGW32", arch: i686, pkg: "llvm"}, ! Not yet functional + #{installs: "MINGW64", arch: x86_64, pkg: "mcode"}, ! mcode is not yet supported on win64 + {installs: "MINGW64", arch: x86_64, pkg: "llvm"}, ] name: '🟪 MSYS2 · ${{ matrix.installs }} · ${{ matrix.pkg }}' env: MINGW_INSTALLS: ${{ matrix.installs }} - TARGET: ${{ matrix.pkg }} defaults: run: shell: msys2 {0} @@ -134,29 +133,40 @@ jobs: with: msystem: MSYS update: true - install: base-devel git + install: > + base-devel + git + mingw-w64-${{ matrix.arch }}-toolchain - run: git config --global core.autocrlf input shell: bash - name: '🧰 Checkout' uses: actions/checkout@v2 + with: + # The command 'git describe' (used for version) needs the history. + fetch-depth: 0 + + - name: Build package + run: | + cd dist/msys2-${{ matrix.pkg }} + makepkg-mingw --noconfirm --noprogressbar -sCLf - - name: Build and (hopefully) install package - run: ./dist/msys2-mingw/run.sh -b + - name: Install package + run: pacman --noconfirm -U dist/msys2-${{ matrix.pkg }}/mingw-w64-*-any.pkg.tar.zst - name: '📤 Upload artifact: builddir' uses: actions/upload-artifact@v2 with: name: ${{ matrix.installs }}-${{ matrix.pkg }}-builddir path: | - ./dist/msys2-mingw/${{ matrix.pkg }}/src/ - ./dist/msys2-mingw/${{ matrix.pkg }}/pkg/ + ./dist/msys2-${{ matrix.pkg }}/src/ + ./dist/msys2-${{ matrix.pkg }}/pkg/ - name: '📤 Upload artifact: package' uses: actions/upload-artifact@v2 with: - path: ./dist/msys2-mingw/${{ matrix.pkg }}/mingw-*ghdl*.pkg.tar.zst + path: ./dist/msys2-${{ matrix.pkg }}/mingw-*ghdl*.pkg.tar.zst - name: Test package run: | diff --git a/dist/msys2-llvm/PKGBUILD b/dist/msys2-llvm/PKGBUILD new file mode 100644 index 000000000..6de6916dc --- /dev/null +++ b/dist/msys2-llvm/PKGBUILD @@ -0,0 +1,24 @@ +_realname=ghdl-llvm +pkgbase=mingw-w64-${_realname} +pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}") +pkgver=ci +pkgrel=1 +pkgdesc="GHDL: the open-source analyzer, compiler, simulator and (experimental) synthesizer for VHDL (LLVM backend) (mingw-w64)" +arch=('any') +depends=('zlib-devel' "${MINGW_PACKAGE_PREFIX}-clang") +makedepends=("${MINGW_PACKAGE_PREFIX}-gcc-ada") + +build() { + mkdir "${srcdir}/builddir" + cd "${srcdir}/builddir" + export CC=clang + export CXX=clang++ + ../../../../configure --prefix=${MINGW_PREFIX} --with-llvm-config="llvm-config --link-static" LDFLAGS="-static" --enable-libghdl --enable-synth + make GNATMAKE="gnatmake -j$(nproc)" +} + +package() { + cd "${srcdir}/builddir" + mkdir -p "${pkgdir}${MINGW_PREFIX}/lib" + make DESTDIR="${pkgdir}" install +} diff --git a/dist/msys2-mcode/PKGBUILD b/dist/msys2-mcode/PKGBUILD new file mode 100644 index 000000000..70423d64d --- /dev/null +++ b/dist/msys2-mcode/PKGBUILD @@ -0,0 +1,22 @@ +_realname=ghdl-mcode +pkgbase=mingw-w64-${_realname} +pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}") +pkgver=ci +pkgrel=1 +pkgdesc="GHDL: the open-source analyzer, compiler, simulator and (experimental) synthesizer for VHDL (mcode backend) (mingw-w64)" +arch=('any') +depends=('zlib-devel') +makedepends=("${MINGW_PACKAGE_PREFIX}-gcc" "${MINGW_PACKAGE_PREFIX}-gcc-ada") + +build() { + mkdir "${srcdir}/builddir" + cd "${srcdir}/builddir" + ../../../../configure --prefix=${MINGW_PREFIX} LDFLAGS=-static --enable-libghdl --enable-synth + make GNATMAKE="gnatmake -j$(nproc)" +} + +package() { + cd "${srcdir}/builddir" + mkdir -p "${pkgdir}${MINGW_PREFIX}/lib" + make DESTDIR="${pkgdir}" install +} diff --git a/dist/msys2-mingw/llvm/PKGBUILD b/dist/msys2-mingw/llvm/PKGBUILD deleted file mode 100644 index 9fe2c28bd..000000000 --- a/dist/msys2-mingw/llvm/PKGBUILD +++ /dev/null @@ -1,24 +0,0 @@ -_realname=ghdl-llvm -pkgbase=mingw-w64-${_realname} -pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}") -pkgver=ci -pkgrel=1 -pkgdesc="GHDL: the open-source analyzer, compiler, simulator and (experimental) synthesizer for VHDL (LLVM backend) (mingw-w64)" -arch=('any') -depends=('zlib-devel' "${MINGW_PACKAGE_PREFIX}-clang") -makedepends=("${MINGW_PACKAGE_PREFIX}-gcc-ada") - -build() { - mkdir "${srcdir}/builddir" - cd "${srcdir}/builddir" - export CC=clang - export CXX=clang++ - ../../../../../configure --prefix=${MINGW_PREFIX} --with-llvm-config="llvm-config --link-static" LDFLAGS="-static" --enable-libghdl --enable-synth - make GNATMAKE="gnatmake -j$(nproc)" -} - -package() { - cd "${srcdir}/builddir" - mkdir -p "${pkgdir}${MINGW_PREFIX}/lib" - make DESTDIR="${pkgdir}" install -} diff --git a/dist/msys2-mingw/mcode/PKGBUILD b/dist/msys2-mingw/mcode/PKGBUILD deleted file mode 100644 index 75205b025..000000000 --- a/dist/msys2-mingw/mcode/PKGBUILD +++ /dev/null @@ -1,22 +0,0 @@ -_realname=ghdl-mcode -pkgbase=mingw-w64-${_realname} -pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}") -pkgver=ci -pkgrel=1 -pkgdesc="GHDL: the open-source analyzer, compiler, simulator and (experimental) synthesizer for VHDL (mcode backend) (mingw-w64)" -arch=('any') -depends=('zlib-devel') -makedepends=("${MINGW_PACKAGE_PREFIX}-gcc" "${MINGW_PACKAGE_PREFIX}-gcc-ada") - -build() { - mkdir "${srcdir}/builddir" - cd "${srcdir}/builddir" - ../../../../../configure --prefix=${MINGW_PREFIX} LDFLAGS=-static --enable-libghdl --enable-synth - make GNATMAKE="gnatmake -j$(nproc)" -} - -package() { - cd "${srcdir}/builddir" - mkdir -p "${pkgdir}${MINGW_PREFIX}/lib" - make DESTDIR="${pkgdir}" install -} diff --git a/dist/msys2-mingw/run.sh b/dist/msys2-mingw/run.sh deleted file mode 100644 index 186520b05..000000000 --- a/dist/msys2-mingw/run.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/bin/sh - -cd $(dirname $0) - -# Stop in case of error -set -e - -enable_color() { - ENABLECOLOR='-c ' - ANSI_RED="\033[31m" - ANSI_GREEN="\033[32m" - ANSI_YELLOW="\033[33m" - ANSI_BLUE="\033[34m" - ANSI_MAGENTA="\033[35m" - ANSI_GRAY="\033[90m" - ANSI_CYAN="\033[36;1m" - ANSI_DARKCYAN="\033[36m" - ANSI_NOCOLOR="\033[0m" -} - -disable_color() { unset ENABLECOLOR ANSI_RED ANSI_GREEN ANSI_YELLOW ANSI_BLUE ANSI_MAGENTA ANSI_CYAN ANSI_DARKCYAN ANSI_NOCOLOR; } -enable_color - -print_start() { - if [ "x$2" != "x" ]; then - COL="$2" - elif [ "x$BASE_COL" != "x" ]; then - COL="$BASE_COL" - else - COL="$ANSI_YELLOW" - fi - printf "${COL}${1}$ANSI_NOCOLOR\n" -} - -gstart () { - print_start "$@" -} -gend () { - : -} -gblock () { - gstart "$1" - shift - $@ - gend -} - -[ -n "$CI" ] && { - echo "INFO: set 'gstart' and 'gend' for CI" - gstart () { - printf '::group::' - print_start "$@" - SECONDS=0 - } - - gend () { - duration=$SECONDS - echo '::endgroup::' - printf "${ANSI_GRAY}took $(($duration / 60)) min $(($duration % 60)) sec.${ANSI_NOCOLOR}\n" - } -} || echo "INFO: not in CI" - -#--- - -if [ -z "$TARGET" ]; then - printf "${ANSI_RED}Undefined TARGET!$ANSI_NOCOLOR" - exit 1 -fi -cd "$TARGET" - -# 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 - -case "$MINGW_INSTALLS" in - *32) - TARBALL_ARCH="i686" - ;; - *64) - TARBALL_ARCH="x86_64" - ;; - *) - printf "${ANSI_RED}Unknown MINGW_INSTALLS=${MINGW_INSTALLS}!$ANSI_NOCOLOR" - exit 1 -esac - -gblock 'Install toolchain' pacman -S --noconfirm --needed 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 -- cgit v1.2.3