From 4eaa954e59651695281c2fd3645c91705ef18412 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Wed, 5 Apr 2023 10:00:17 -0300 Subject: [PATCH] Using mingw packages instead of .tar.xz --- .github/workflows/publish.yml | 9 ++++++--- PKGBUILD.mingw | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ win/PKGBUILD | 40 ---------------------------------------- win/ci-build.sh | 47 +++++++++++++++++++++++++++-------------------- 4 files changed, 95 insertions(+), 63 deletions(-) create mode 100644 PKGBUILD.mingw delete mode 100644 win/PKGBUILD diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a982635..6bf36f0 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -4,6 +4,9 @@ on: branches: - master - develop + push: + branches: + - develop jobs: msys2-mingw: name: Publish Windows 64 @@ -22,19 +25,19 @@ jobs: 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 + 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 - uses: robinraju/release-downloader@v1.7 with: repository: "PerryWerneck/lib3270" latest: true - fileName: "mingw-w64-x86_64-lib3270.tar.xz" + fileName: "mingw-w64-x86_64-lib3270-5.4-0-x86_64.pkg.tar.zst" - name: CI-Build run: | ./win/ci-build.sh - uses: ncipollo/release-action@v1 with: tag: ${{ steps.gettag.outputs.tag }} - artifacts: "*-libv3270.tar.xz" + artifacts: "*-libv3270-*.pkg.tar.zst" allowUpdates: true draft: false makeLatest: true diff --git a/PKGBUILD.mingw b/PKGBUILD.mingw new file mode 100644 index 0000000..ef95c3d --- /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}-gtk+3 ${MINGW_PACKAGE_PREFIX}-lib3270) +makedepends=(autoconf automake make libtool gzip dos2unix ${MINGW_PACKAGE_PREFIX}-lib3270 ${MINGW_PACKAGE_PREFIX}-gtk+3) +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/PKGBUILD b/win/PKGBUILD deleted file mode 100644 index 6d9f3c2..0000000 --- a/win/PKGBUILD +++ /dev/null @@ -1,40 +0,0 @@ -# Maintainer: Perry Werneck - -pkgname=${MINGW_PACKAGE_PREFIX}-libv3270 - -pkgver=5.2 -pkgrel=1 -pkgdesc="3270 Virtual Terminal for GTK" -url="https://portal.softwarepublico.gov.br/social/pw3270/" -arch=(i686 x86_64) -license=(GPL) -depends=(${MINGW_PACKAGE_PREFIX}-lib3270 ${MINGW_PACKAGE_PREFIX}-gtk3) -makedepends=(autoconf automake make openssl ${MINGW_PACKAGE_PREFIX}-lib3270 ${MINGW_PACKAGE_PREFIX}-gtk3) -checkdepends=() - -#groups=(gnome) - -source=(libv3270-$pkgver.tar.xz) -sha256sums=('SKIP') - -provides=($pkgname) -conflicts=($pkgname) - -prepare() { - cd libv3270-$pkgver - NOCONFIGURE=1 ./autogen.sh - ./configure --prefix=$MINGW_PREFIX -} - -build() { - cd libv3270-$pkgver - make all -} - -package() { - cd libv3270-$pkgver - DESTDIR="$pkgdir" make install-dev - install .bin/Release/libv3270.dll $MINGW_PREFIX/bin - dlltool --dllname libv3270.dll --input-def .bin/Release/libv3270.def --output-lib $MINGW_PREFIX/lib/libv3270.a -} - diff --git a/win/ci-build.sh b/win/ci-build.sh index bf8bc9a..2d066fe 100755 --- 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,31 +34,20 @@ die ( ) { exit -1 } -myDIR=$(dirname $(dirname $(readlink -f ${0}))) -echo "myDIR=${myDIR}" - -cd ${myDIR} -rm -fr ${myDIR}/.build +cd $(dirname $(dirname $(readlink -f ${0}))) # -# Unpack lib3270 +# Install pre-reqs # -echo "Unpacking lib3270" -tar -C / -Jxf ${MINGW_PACKAGE_PREFIX}-lib3270.tar.xz > $LOGFILE 2>&1 || die "lib3270 unpack failure" +echo "Installing pre-reqs..." +pacman -U --noconfirm *.pkg.tar.zst || die "pacman failure" # -# Build libv3270 +# Build # -echo "Building libv3270" -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 || die "Install failure" -tar --create --xz --file=${MINGW_PACKAGE_PREFIX}-libv3270.tar.xz --directory=.bin/package --verbose . || die "Tar failure" - +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