From 64e8f328b4369e3d6e97fe043dbe3e2dc2e92578 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Tue, 3 Sep 2019 14:39:37 -0300 Subject: [PATCH] Working on windows package. --- win/pack.sh | 13 ++++++++++--- win/pw3270.nsi.in | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 68 insertions(+), 5 deletions(-) diff --git a/win/pack.sh b/win/pack.sh index 2277bf5..20a93f8 100755 --- a/win/pack.sh +++ b/win/pack.sh @@ -4,7 +4,7 @@ PRODUCT_NAME="pw3270" LIBRARY_NAME="lib3270" CORE_LIBRARIES="lib3270 libv3270" PACKAGE_PLUGINS="ipc" -PACKAGE_LANGUAGE_BINDINGS="hllapi" +PACKAGE_LANGUAGE_BINDINGS="hllapi mono" TARGET_ARCHS="x86_64" GIT_URL="https://github.com/PerryWerneck" @@ -133,8 +133,15 @@ buildLibrary() esac + # Required for lib3270 build tools export HOST_CC=/usr/bin/gcc + # Required for .NET bindings + export GACROOT=${WORKDIR}/build/${ARCH}/mono/gacroot + export GAPIROOT=${WORKDIR}/build/${ARCH}/mono/gapi-2.0 + export MONOLIBPATH=${WORKDIR}/build/${ARCH}/mono/lib + + # Create install dirs mkdir -p ${WORKDIR}/build/${ARCH} mkdir -p ${WORKDIR}/cache/${ARCH} mkdir -p ${WORKDIR}/build/${ARCH}/locale @@ -363,11 +370,11 @@ makeInstaller() { NSIS_ARGS="-DWITHGTK" - if [ ! -z ${PACKAGE_PLUGINS} ]; then + if [ ! -z "${PACKAGE_PLUGINS}" ]; then NSIS_ARGS="${NSIS_ARGS} -DWITHPLUGINS" fi - if [ ! -z ${PACKAGE_LANGUAGE_BINDINGS} ]; then + if [ ! -z "${PACKAGE_LANGUAGE_BINDINGS}" ]; then NSIS_ARGS="${NSIS_ARGS} -DWITHLANGUAGE" fi diff --git a/win/pw3270.nsi.in b/win/pw3270.nsi.in index b221476..ad8cba2 100644 --- a/win/pw3270.nsi.in +++ b/win/pw3270.nsi.in @@ -162,11 +162,27 @@ SubSection "@PACKAGE@" SecMain setOutPath $INSTDIR ${DisableX64FSRedirection} + file "/oname=$SYSDIR\hllapi.dll" "libhllapi.dll" + + # Install with "lib" prefix for compatibility. file "/oname=$SYSDIR\libhllapi.dll" "libhllapi.dll" sectionEnd !endif +!ifdef WITHMONO + Section /o ".NET" DOTNET + + ${DisableX64FSRedirection} + CreateDirectory "$INSTDIR\dotnet" + + file "/oname=$INSTDIR\dotnet\tn3270-sharp.dll" "mono/lib/tn3270-sharp-5.2/tn3270-sharp.dll" + file "/oname=$INSTDIR\dotnet\pw3270-sharp.xml" "mono/gapi-2.0/tn3270-sharp/tn3270-sharp.xml" + file "/oname=$SYSDIR\lib3270-mono.dll" "lib3270-mono.dll" + + sectionEnd +!endif + SubSectionEnd !endif @@ -234,7 +250,14 @@ Section "Uninstall" DeleteRegKey HKLM "Software\@PACKAGE@" # Delete System libraries +!ifdef WITHHLLAPI delete $SYSDIR\libhllapi.dll + delete $SYSDIR\hllapi.dll +!endif + +!ifdef WITHMONO + delete $SYSDIR\lib3270-mono.dll +!endif RMDir /r "$INSTDIR" @@ -242,6 +265,38 @@ SectionEnd Function .onInit + #---[ Check DOTNET Command line option ]0------------------------------------------------------------- + +!ifdef WITHMONO + Push $0 + + ${GetParameters} $R0 + ClearErrors + ${GetOptions} $R0 /DOTNET= $0 + + ${if} $0 == "NO" + + SectionGetFlags ${DOTNET} $0 + IntOp $0 $0 & ${SECTION_OFF} + SectionSetFlags ${DOTNET} $0 + + ${else} + + SectionGetFlags ${DOTNET} $0 + IntOp $0 $0 | ${SF_SELECTED} + SectionSetFlags ${DOTNET} $0 + +!ifdef WITHIPC + SectionGetFlags ${IPCPlugin} $0 + IntOp $0 $0 | ${SF_SELECTED} + SectionSetFlags ${IPCPlugin} $0 +!endif + + ${EndIf} + + Pop $0 +!endif + #---[ Check HLLAPI Command line option ]------------------------------------------------------------- !ifdef WITHHLLAPI @@ -276,9 +331,10 @@ Function .onInit !endif -!ifdef WITHGTK - #---[ Verifica se precisa instalar GTK ]------------------------------------------------------------- + #---[ Check for GTK runtime ]------------------------------------------------------------------------ + +!ifdef WITHGTK SetRegView @WINARCH@ -- libgit2 0.21.2