diff --git a/.github/workflows/msys2.yml b/.github/workflows/msys2.yml index 5c8d8f1..8db2bfb 100644 --- a/.github/workflows/msys2.yml +++ b/.github/workflows/msys2.yml @@ -6,7 +6,6 @@ on: push: branches: - develop - jobs: msys2-mingw: name: Publish Windows 64 @@ -19,25 +18,24 @@ jobs: - uses: oprypin/find-latest-tag@v1 id: gettag with: - repository: PerryWerneck/libv3270 + repository: PerryWerneck/pw3270 releases-only: true - 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 + install: dos2unix 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 - uses: robinraju/release-downloader@v1.7 with: repository: "PerryWerneck/lib3270" latest: true - fileName: "mingw-lib3270.x86_64.tar.xz" + fileName: "mingw-w64-x86_64-lib3270-5.4-0-x86_64.pkg.tar.zst" - uses: robinraju/release-downloader@v1.7 with: repository: "PerryWerneck/libv3270" latest: true - fileName: "mingw-libv3270.x86_64.tar.xz" + fileName: "mingw-w64-x86_64-lib3270-5.4-0-x86_64.pkg.tar.zst" - name: CI-Build - run: | - ./win/ci-build.sh + run: ./win/ci-build.sh diff --git a/PKGBUILD.mingw b/PKGBUILD.mingw new file mode 100644 index 0000000..ec3ff71 --- /dev/null +++ b/PKGBUILD.mingw @@ -0,0 +1,62 @@ +# Maintainer: Perry Werneck +# References: https://www.msys2.org/wiki/Creating-Packages/ + +# SPDX-License-Identifier: LGPL-3.0-or-later +# +# Copyright (C) 2008 Banco do Brasil S.A. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program. If not, see . + +_realname=$(grep AC_INIT "${startdir}/configure.ac" | cut -d[ -f2 | cut -d] -f1) + +pkgname=${MINGW_PACKAGE_PREFIX}-${_realname} +source=() + +pkgver=$(grep AC_INIT "${startdir}/configure.ac" | cut -d[ -f3 | cut -d] -f1) +pkgrel=0 +pkgdesc="TN3270 Access library" +url="https://github.com/PerryWerneck/${_realname}" +arch=(i686 x86_64) +license=(LGPL-3.0-or-later) +depends=(${MINGW_PACKAGE_PREFIX}-gtk3 ${MINGW_PACKAGE_PREFIX}-lib3270 ${MINGW_PACKAGE_PREFIX}-libv3270) +makedepends=(autoconf automake make libtool gzip dos2unix optipng gzip ${MINGW_PACKAGE_PREFIX}-gtk3 ${MINGW_PACKAGE_PREFIX}-lib3270 ${MINGW_PACKAGE_PREFIX}-libv3270) +checkdepends=() + +provides=($pkgname) +conflicts=($pkgname) + +prepare() { + rm -fr "$srcdir/$pkgname" + ln -snf "$startdir" "$srcdir/$pkgname" +} + +build() { + cd $pkgname + ./autogen.sh \ + --prefix=${MINGW_PREFIX} \ + --build=${MINGW_CHOST} \ + --host=${MINGW_CHOST} \ + --target=${MINGW_CHOST} + + make all +} + +package() { + cd $pkgname + make DESTDIR="${pkgdir}" install + install \ + -Dm644 \ + "LICENSE" \ + "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE" +} diff --git a/win/ci-build.sh b/win/ci-build.sh index 39d6704..2d066fe 100644 --- a/win/ci-build.sh +++ b/win/ci-build.sh @@ -1,10 +1,28 @@ #!/bin/bash # +# SPDX-License-Identifier: LGPL-3.0-or-later +# +# Copyright (C) 2008 Banco do Brasil S.A. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program. If not, see . + +# # References: # # * https://www.msys2.org/docs/ci/ # -# + echo "Running ${0}" LOGFILE=build.log @@ -16,36 +34,20 @@ die ( ) { exit -1 } -myDIR=$(dirname $(dirname $(readlink -f ${0}))) -echo "myDIR=${myDIR}" - -cd ${myDIR} -rm -fr ${myDIR}/.build - -# -# Unpack LIB3270 -# -echo "Unpacking lib3270" -tar -C / -Jxf mingw-lib3270.${MSYSTEM_CARCH}.tar.xz > $LOGFILE 2>&1 || die "Unpack lib3270 failure" +cd $(dirname $(dirname $(readlink -f ${0}))) # -# Build LIBV3270 +# Install pre-reqs # -echo "Unpacking libv3270" -tar -C / -Jxf mingw-libv3270.tar.xz > $LOGFILE 2>&1 || die "Unpack libv3270 failure" +echo "Installing pre-reqs..." +pacman -U --noconfirm *.pkg.tar.zst || die "pacman failure" # -# Build PW3270 +# Build # -echo "Building PW3270" -cd ${myDIR} -./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" - -make DESTDIR=.bin/package install -tar --create --xz --file=mingw-pw3270.${MSYSTEM_CARCH}.tar.xz --directory=.bin/package --verbose . +echo "Building package..." +dos2unix PKGBUILD.mingw || die "dos2unix failure" +makepkg BUILDDIR=/tmp/pkg -p PKGBUILD.mingw || die "makepkg failure" echo "Build complete" -- libgit2 0.21.2