Commit 64e8f328b4369e3d6e97fe043dbe3e2dc2e92578

Authored by Perry Werneck
1 parent 9e65069e

Working on windows package.

Showing 2 changed files with 68 additions and 5 deletions   Show diff stats
win/pack.sh
... ... @@ -4,7 +4,7 @@ PRODUCT_NAME="pw3270"
4 4 LIBRARY_NAME="lib3270"
5 5 CORE_LIBRARIES="lib3270 libv3270"
6 6 PACKAGE_PLUGINS="ipc"
7   -PACKAGE_LANGUAGE_BINDINGS="hllapi"
  7 +PACKAGE_LANGUAGE_BINDINGS="hllapi mono"
8 8 TARGET_ARCHS="x86_64"
9 9 GIT_URL="https://github.com/PerryWerneck"
10 10  
... ... @@ -133,8 +133,15 @@ buildLibrary()
133 133  
134 134 esac
135 135  
  136 + # Required for lib3270 build tools
136 137 export HOST_CC=/usr/bin/gcc
137 138  
  139 + # Required for .NET bindings
  140 + export GACROOT=${WORKDIR}/build/${ARCH}/mono/gacroot
  141 + export GAPIROOT=${WORKDIR}/build/${ARCH}/mono/gapi-2.0
  142 + export MONOLIBPATH=${WORKDIR}/build/${ARCH}/mono/lib
  143 +
  144 + # Create install dirs
138 145 mkdir -p ${WORKDIR}/build/${ARCH}
139 146 mkdir -p ${WORKDIR}/cache/${ARCH}
140 147 mkdir -p ${WORKDIR}/build/${ARCH}/locale
... ... @@ -363,11 +370,11 @@ makeInstaller()
363 370 {
364 371 NSIS_ARGS="-DWITHGTK"
365 372  
366   - if [ ! -z ${PACKAGE_PLUGINS} ]; then
  373 + if [ ! -z "${PACKAGE_PLUGINS}" ]; then
367 374 NSIS_ARGS="${NSIS_ARGS} -DWITHPLUGINS"
368 375 fi
369 376  
370   - if [ ! -z ${PACKAGE_LANGUAGE_BINDINGS} ]; then
  377 + if [ ! -z "${PACKAGE_LANGUAGE_BINDINGS}" ]; then
371 378 NSIS_ARGS="${NSIS_ARGS} -DWITHLANGUAGE"
372 379 fi
373 380  
... ...
win/pw3270.nsi.in
... ... @@ -162,11 +162,27 @@ SubSection "@PACKAGE@" SecMain
162 162 setOutPath $INSTDIR
163 163  
164 164 ${DisableX64FSRedirection}
  165 + file "/oname=$SYSDIR\hllapi.dll" "libhllapi.dll"
  166 +
  167 + # Install with "lib" prefix for compatibility.
165 168 file "/oname=$SYSDIR\libhllapi.dll" "libhllapi.dll"
166 169  
167 170 sectionEnd
168 171 !endif
169 172  
  173 +!ifdef WITHMONO
  174 + Section /o ".NET" DOTNET
  175 +
  176 + ${DisableX64FSRedirection}
  177 + CreateDirectory "$INSTDIR\dotnet"
  178 +
  179 + file "/oname=$INSTDIR\dotnet\tn3270-sharp.dll" "mono/lib/tn3270-sharp-5.2/tn3270-sharp.dll"
  180 + file "/oname=$INSTDIR\dotnet\pw3270-sharp.xml" "mono/gapi-2.0/tn3270-sharp/tn3270-sharp.xml"
  181 + file "/oname=$SYSDIR\lib3270-mono.dll" "lib3270-mono.dll"
  182 +
  183 + sectionEnd
  184 +!endif
  185 +
170 186 SubSectionEnd
171 187 !endif
172 188  
... ... @@ -234,7 +250,14 @@ Section "Uninstall"
234 250 DeleteRegKey HKLM "Software\@PACKAGE@"
235 251  
236 252 # Delete System libraries
  253 +!ifdef WITHHLLAPI
237 254 delete $SYSDIR\libhllapi.dll
  255 + delete $SYSDIR\hllapi.dll
  256 +!endif
  257 +
  258 +!ifdef WITHMONO
  259 + delete $SYSDIR\lib3270-mono.dll
  260 +!endif
238 261  
239 262 RMDir /r "$INSTDIR"
240 263  
... ... @@ -242,6 +265,38 @@ SectionEnd
242 265  
243 266 Function .onInit
244 267  
  268 + #---[ Check DOTNET Command line option ]0-------------------------------------------------------------
  269 +
  270 +!ifdef WITHMONO
  271 + Push $0
  272 +
  273 + ${GetParameters} $R0
  274 + ClearErrors
  275 + ${GetOptions} $R0 /DOTNET= $0
  276 +
  277 + ${if} $0 == "NO"
  278 +
  279 + SectionGetFlags ${DOTNET} $0
  280 + IntOp $0 $0 & ${SECTION_OFF}
  281 + SectionSetFlags ${DOTNET} $0
  282 +
  283 + ${else}
  284 +
  285 + SectionGetFlags ${DOTNET} $0
  286 + IntOp $0 $0 | ${SF_SELECTED}
  287 + SectionSetFlags ${DOTNET} $0
  288 +
  289 +!ifdef WITHIPC
  290 + SectionGetFlags ${IPCPlugin} $0
  291 + IntOp $0 $0 | ${SF_SELECTED}
  292 + SectionSetFlags ${IPCPlugin} $0
  293 +!endif
  294 +
  295 + ${EndIf}
  296 +
  297 + Pop $0
  298 +!endif
  299 +
245 300 #---[ Check HLLAPI Command line option ]-------------------------------------------------------------
246 301  
247 302 !ifdef WITHHLLAPI
... ... @@ -276,9 +331,10 @@ Function .onInit
276 331  
277 332 !endif
278 333  
279   -!ifdef WITHGTK
280 334  
281   - #---[ Verifica se precisa instalar GTK ]-------------------------------------------------------------
  335 + #---[ Check for GTK runtime ]------------------------------------------------------------------------
  336 +
  337 +!ifdef WITHGTK
282 338  
283 339 SetRegView @WINARCH@
284 340  
... ...