From c60dcadd73b8884cf72288cb24431b3f3794b653 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Wed, 11 Jan 2023 00:00:53 -0300 Subject: [PATCH] Fixing mingw workflow. --- .github/workflows/msys2.yml | 23 +++++++++++++++++++++++ win/ci-build.sh | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+), 0 deletions(-) create mode 100644 .github/workflows/msys2.yml create mode 100644 win/ci-build.sh diff --git a/.github/workflows/msys2.yml b/.github/workflows/msys2.yml new file mode 100644 index 0000000..7eb7f6b --- /dev/null +++ b/.github/workflows/msys2.yml @@ -0,0 +1,23 @@ +name: MSYS2 +on: + pull_request: + branches: + - master + +jobs: + msys2-mingw: + runs-on: windows-latest + defaults: + run: + shell: msys2 {0} + steps: + - uses: actions/checkout@v3 + - uses: msys2/setup-msys2@v2 + with: + msystem: mingw64 + update: true + install: xz mingw-w64-x86_64-gcc automake autoconf make git pkgconf mingw-w64-x86_64-gettext gettext-devel mingw-w64-x86_64-openssl libtool mingw-w64-x86_64-gtk3 mingw-w64-x86_64-imagemagick mingw-w64-x86_64-optipng mingw-w64-x86_64-inkscape + - name: CI-Build + run: | + ./win/ci-build.sh + diff --git a/win/ci-build.sh b/win/ci-build.sh new file mode 100644 index 0000000..729cb0c --- /dev/null +++ b/win/ci-build.sh @@ -0,0 +1,65 @@ +#!/bin/bash +# +# References: +# +# * https://www.msys2.org/docs/ci/ +# +# +echo "Running ${0}" + +LOGFILE=build.log +rm -f ${LOGFILE} + +die ( ) { + [ -s $LOGFILE ] && tail $LOGFILE + [ "$1" ] && echo "$*" + exit -1 +} + +cd $(dirname $(dirname $(readlink -f ${0}))) + +rm -fr .build + +# +# Build LIB3270 +# +echo "Building lib3270" +mkdir -p .build/lib3270 +git clone https://github.com/PerryWerneck/lib3270.git ./.build/lib3270 > $LOGFILE 2>&1 || die "clone lib3270 failure" +pushd ./.build/lib3270 +./autogen.sh > $LOGFILE 2>&1 || die "Autogen failure" +./configure > $LOGFILE 2>&1 || die "Configure failure" +make clean > $LOGFILE 2>&1 || die "Make clean failure" +make all > $LOGFILE 2>&1 || die "Make failure" +popd + +export LIB3270_CFLAGS="-I./.build/lib3270/src/include" +export LIB3270_LIBS="-L./.build/lib3270/.bin/Release -l3270.delayed" + +# +# Build LIBV3270 +# +echo "Building libv3270" +mkdir -p .build/libv3270 +git clone https://github.com/PerryWerneck/libv3270.git ./.build/libv3270 > $LOGFILE 2>&1 || die "clone libv3270 failure" +pushd ./.build/libv3270 +./autogen.sh > $LOGFILE 2>&1 || die "Autogen failure" +./configure > $LOGFILE 2>&1 || die "Configure failure" +make clean > $LOGFILE 2>&1 || die "Make clean failure" +make all > $LOGFILE 2>&1 || die "Make failure" +popd + +export LIBV3270_CFLAGS="-I./.build/libv3270/src/include ${LIB3270_CFLAGS}" +export LIBV3270_LIBS="-L./.build/libv3270/.bin/Release -lv3270 ${LIB3270_LIBS}" + +# +# Build PW3270 +# +echo "Building PW3270" +./autogen.sh > $LOGFILE 2>&1 || die "Autogen failure" +./configure > $LOGFILE 2>&1 || die "Configure failure" +make clean > $LOGFILE 2>&1 || die "Make clean failure" +make all > $LOGFILE 2>&1 || die "Make failure" + +echo "Build complete" + -- libgit2 0.21.2