From 4dc38b1466117c266ab4cff7d54d7c18dc30996d Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Wed, 29 Mar 2023 07:09:59 -0300 Subject: [PATCH] Updating ci-build, removing unused scripts. --- .github/workflows/publish.yml | 2 +- win/ci-build.sh | 26 +++++++------------------- win/configure.sh | 70 ---------------------------------------------------------------------- win/install-cross.sh | 77 ----------------------------------------------------------------------------- 4 files changed, 8 insertions(+), 167 deletions(-) delete mode 100755 win/configure.sh delete mode 100755 win/install-cross.sh diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 57a9f37..e84ba74 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -27,7 +27,7 @@ jobs: with: repository: "PerryWerneck/lib3270" latest: true - fileName: "mingw-lib3270.tar.xz" + fileName: "mingw-lib3270.x86_64.tar.xz" - name: CI-Build run: | ./win/ci-build.sh diff --git a/win/ci-build.sh b/win/ci-build.sh index fd37f0c..99b7bfd 100755 --- a/win/ci-build.sh +++ b/win/ci-build.sh @@ -7,6 +7,8 @@ # echo "Running ${0}" +TARGET_ARCH="x86_64" + LOGFILE=build.log rm -f ${LOGFILE} @@ -23,27 +25,13 @@ cd ${myDIR} rm -fr ${myDIR}/.build # -# Build LIB3270 +# Unpack lib3270 # -if [ -e mingw-lib3270.tar.xz ]; then - - echo "Unpacking lib3270" - tar -C / -Jxvf mingw-lib3270.tar.xz - -else - echo "Building lib3270" - git clone https://github.com/PerryWerneck/lib3270.git ./.build/lib3270 || die "clone lib3270 failure" - cd ./.build/lib3270 - ./autogen.sh || die "Lib3270 autogen failure" - ./configure || die "Lib3270 Configure failure" - make clean || die "Lib3270 Make clean failure" - make all || die "Lib3270 Make failure" - make install || die "Lib3270 Install failure" - cd ../.. -fi +echo "Unpacking lib3270" +tar -C / -Jxf mingw-lib3270.${TARGET_ARCH}.tar.xz > $LOGFILE 2>&1 || die "lib3270 unpack failure" # -# Build PW3270 +# Build libv3270 # echo "Building libv3270" cd ${myDIR} @@ -53,7 +41,7 @@ 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-libv3270.tar.xz --directory=.bin/package --verbose . || die "Tar failure" +tar --create --xz --file=mingw-libv3270.${TARGET_ARCH}.tar.xz --directory=.bin/package --verbose . || die "Tar failure" echo "Build complete" diff --git a/win/configure.sh b/win/configure.sh deleted file mode 100755 index 90f580f..0000000 --- a/win/configure.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/bash -cd $(dirname $(dirname $(readlink -f ${0}))) - -aclocal -if test $? != 0 ; then - echo "aclocal failed." - exit -1 -fi - -autoconf -if test $? != 0 ; then - echo "autoconf failed." - exit -1 -fi - -mkdir -p scripts -automake --add-missing 2> /dev/null | true - -export HOST_CC=/usr/bin/gcc - -until [ -z "${1}" ] -do - if [ ${1:0:2} = '--' ]; then - tmp=${1:2} - parameter=${tmp%%=*} - parameter=$(echo $parameter | tr "[:lower:]" "[:upper:]") - - case $parameter in - - 32) - rm -f win32.cache - ./configure \ - --cache-file=win32.cache \ - --host=i686-w64-mingw32 \ - --prefix=/usr/i686-w64-mingw32/sys-root/mingw \ - --libdir=/usr/i686-w64-mingw32/sys-root/mingw/lib - - exit $? - ;; - - 64) - rm -f win64.cache - ./configure \ - --cache-file=win64.cache \ - --host=x86_64-w64-mingw32 \ - --prefix=/usr/x86_64-w64-mingw32/sys-root/mingw \ - --libdir=/usr/x86_64-w64-mingw32/sys-root/mingw/lib - exit $? - ;; - - ALL) - ;; - - - *) - value=${tmp##*=} - eval $parameter=$value - esac - - fi - - shift -done - -echo "Execute:" -echo " ${0} --32 for 32 bits windows." -echo " ${0} --64 for 64 bits windows." - -exit -1 - diff --git a/win/install-cross.sh b/win/install-cross.sh deleted file mode 100755 index cb5b9e8..0000000 --- a/win/install-cross.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/bin/bash -myDIR=$(dirname $(readlink -f ${0})) - -install_packages() { - - TEMPFILE=$(mktemp) - - for spec in $(find ${myDIR} -name "${1}*.spec") - do - echo "Parsing ${spec}" - grep -i "^Requires:" "${spec}" | grep -v "%" | cut -d: -f2- | tr -d '[:blank:]' | cut -d'>' -f1 >> ${TEMPFILE} - grep -i "^BuildRequires:" "${spec}" | grep -v "%" | cut -d: -f2- | tr -d '[:blank:]' | cut -d'>' -f1 >> ${TEMPFILE} - done - - cat ${TEMPFILE} \ - | sort --unique \ - | xargs sudo zypper --non-interactive --verbose in - - rm -f ${TEMPFILE} - -} - -if [ -z ${1} ]; then - echo "${0} [options]" - echo "" - echo "Options:" - echo "" - - echo " --ar Install required OBS repositories for zypper" - echo " --32 Install cross compiler for 32 bits windows using zypper" - echo " --64 Install cross compiler for 64 bits windows using zypper" - echo " --all Install cross compiler for 32 and 64 bits windows using zypper" - exit -1 -fi - - -until [ -z "${1}" ] -do - if [ ${1:0:2} = '--' ]; then - tmp=${1:2} - parameter=${tmp%%=*} - parameter=$(echo $parameter | tr "[:lower:]" "[:upper:]") - - case $parameter in - - AR) - echo "Adding required repositories" - sudo zypper ar obs://windows:mingw:win32 windows_mingw_win32 - sudo zypper ar obs://windows:mingw:win64 windows_mingw_win64 - sudo zypper ar obs://home:PerryWerneck:pw3270 home_PerryWerneck_pw3270 - ;; - - 32) - install_packages mingw32 - ;; - - 64) - install_packages mingw64 - ;; - - ALL) - install_packages mingw32 - install_packages mingw64 - ;; - - - *) - value=${tmp##*=} - eval $parameter=$value - esac - - fi - - shift -done - - -- libgit2 0.21.2