Commit 0ad6fb48e3cd7c675594bbcb628afe00669e9f62

Authored by Perry Werneck
1 parent 32e67f93

Refactoring windows package.

Showing 2 changed files with 90 additions and 35 deletions   Show diff stats
win/pack.sh
... ... @@ -65,7 +65,7 @@ getSource()
65 65 fi
66 66  
67 67 if [ "${GET_PREREQS}" != "0" ]; then
68   - for ARCH in ${ARCHS}
  68 + for ARCH in ${TARGET_ARCHS}
69 69 do
70 70  
71 71 if [ -d ${WORKDIR}/sources/${1}/win/${ARCH} ]; then
... ... @@ -97,7 +97,9 @@ getSource()
97 97 #
98 98 buildLibrary()
99 99 {
100   - for ARCH in ${ARCHS}
  100 + echo "Building library ${1}"
  101 +
  102 + for ARCH in ${TARGET_ARCHS}
101 103 do
102 104  
103 105 echo -e "\e]2;Building ${1} for ${ARCH}\a"
... ... @@ -129,12 +131,8 @@ buildLibrary()
129 131  
130 132 mkdir -p ${WORKDIR}/build/${ARCH}
131 133 mkdir -p ${WORKDIR}/cache/${ARCH}
132   - mkdir -p ${WORKDIR}/build/${ARCH}/bin
133   - mkdir -p ${WORKDIR}/build/${ARCH}/lib
134 134 mkdir -p ${WORKDIR}/build/${ARCH}/locale
135 135 mkdir -p ${WORKDIR}/build/${ARCH}/include
136   - mkdir -p ${WORKDIR}/build/${ARCH}/sysconfig
137   - mkdir -p ${WORKDIR}/build/${ARCH}/data
138 136  
139 137 export PKG_CONFIG_PATH=${WORKDIR}/build/${ARCH}/lib/pkgconfig
140 138 export cache=${WORKDIR}/cache/${ARCH}/${1}.cache
... ... @@ -143,17 +141,16 @@ buildLibrary()
143 141  
144 142 ./configure \
145 143 CFLAGS="-I${WORKDIR}/build/${ARCH}/include" \
146   - LDFLAGS="-L${WORKDIR}/build/${ARCH}/lib" \
  144 + LDFLAGS="-L${WORKDIR}/build/${ARCH}" \
147 145 --host=${host} \
148 146 --prefix=${prefix} \
149   - --bindir=${WORKDIR}/build/${ARCH}/bin \
150   - --libdir=${WORKDIR}/build/${ARCH}/bin \
  147 + --bindir=${WORKDIR}/build/${ARCH} \
  148 + --libdir=${WORKDIR}/build/${ARCH} \
151 149 --localedir=${WORKDIR}/build/${ARCH}/locale \
152 150 --includedir=${WORKDIR}/build/${ARCH}/include \
153   - --sysconfdir=${WORKDIR}/build/${ARCH}/sysconfig \
154   - --datadir=${WORKDIR}/build/${ARCH}/data \
155   - --datarootdir=${WORKDIR}/build/${ARCH}/data
156   -
  151 + --sysconfdir=${WORKDIR}/build/${ARCH} \
  152 + --datadir=${WORKDIR}/build/${ARCH} \
  153 + --datarootdir=${WORKDIR}/build/${ARCH}
157 154  
158 155 if [ "$?" != "0" ]; then
159 156 failed "Can't configure ${1}"
... ... @@ -178,7 +175,7 @@ buildLibrary()
178 175 #
179 176 buildApplication()
180 177 {
181   - for ARCH in ${ARCHS}
  178 + for ARCH in ${TARGET_ARCHS}
182 179 do
183 180  
184 181 echo -e "\e]2;Building ${1} for ${ARCH}\a"
... ... @@ -210,11 +207,8 @@ buildApplication()
210 207  
211 208 mkdir -p ${WORKDIR}/build/${ARCH}
212 209 mkdir -p ${WORKDIR}/cache/${ARCH}
213   - mkdir -p ${WORKDIR}/build/${ARCH}/bin
214 210 mkdir -p ${WORKDIR}/build/${ARCH}/locale
215 211 mkdir -p ${WORKDIR}/build/${ARCH}/include
216   - mkdir -p ${WORKDIR}/build/${ARCH}/sysconfig
217   - mkdir -p ${WORKDIR}/build/${ARCH}/data
218 212  
219 213 export PKG_CONFIG_PATH=${WORKDIR}/build/${ARCH}/lib/pkgconfig
220 214 export cache=${WORKDIR}/cache/${ARCH}/${1}.cache
... ... @@ -223,16 +217,16 @@ buildApplication()
223 217  
224 218 ./configure \
225 219 CFLAGS="-I${WORKDIR}/build/${ARCH}/include" \
226   - LDFLAGS="-L${WORKDIR}/build/${ARCH}/lib" \
  220 + LDFLAGS="-L${WORKDIR}/build/${ARCH}" \
227 221 --host=${host} \
228 222 --prefix=${prefix} \
229   - --bindir=${WORKDIR}/build/${ARCH}/bin \
230   - --libdir=${WORKDIR}/build/${ARCH}/bin \
  223 + --bindir=${WORKDIR}/build/${ARCH} \
  224 + --libdir=${WORKDIR}/build/${ARCH} \
231 225 --localedir=${WORKDIR}/build/${ARCH}/locale \
232 226 --includedir=${WORKDIR}/build/${ARCH}/include \
233   - --sysconfdir=${WORKDIR}/build/${ARCH}/sysconfig \
234   - --datadir=${WORKDIR}/build/${ARCH}/data \
235   - --datarootdir=${WORKDIR}/build/${ARCH}/data
  227 + --sysconfdir=${WORKDIR}/build/${ARCH} \
  228 + --datadir=${WORKDIR}/build/${ARCH} \
  229 + --datarootdir=${WORKDIR}/build/${ARCH}
236 230  
237 231 if [ "$?" != "0" ]; then
238 232 failed "Can't configure ${1}"
... ... @@ -262,6 +256,29 @@ buildApplication()
262 256 fi
263 257 fi
264 258  
  259 + if [ -e branding/${1}.svg ]; then
  260 + convert -density 384 -background transparent branding/${1}.svg -define icon:auto-resize -colors 256 ${WORKDIR}/build/${ARCH}/${1}.ico
  261 + if [ "$?" != "0" ]; then
  262 + cleanup
  263 + exit -1
  264 + fi
  265 + fi
  266 +
  267 + for doc in LICENSE LICENCA README.md AUTHORS
  268 + do
  269 +
  270 + if [ -e ${doc} ]; then
  271 + cp ${doc} ${WORKDIR}/build/${ARCH}
  272 +
  273 + if [ "$?" != "0" ]; then
  274 + cleanup
  275 + exit -1
  276 + fi
  277 +
  278 + fi
  279 +
  280 + done
  281 +
265 282 done
266 283  
267 284 }
... ... @@ -269,9 +286,10 @@ buildApplication()
269 286 #
270 287 # Make runtime
271 288 #
272   -makeRuntime() {
  289 +makeRuntime()
  290 +{
273 291  
274   - for ARCH in ${ARCHS}
  292 + for ARCH in ${TARGET_ARCHS}
275 293 do
276 294  
277 295 echo -e "\e]2;Building runtime for ${ARCH}\a"
... ... @@ -285,7 +303,7 @@ makeRuntime() {
285 303 chmod +x ${SCRIPT}
286 304  
287 305 cd ${WORKDIR}/build/${ARCH}
288   - ${SCRIPT} --path="${WORKDIR}/build/${ARCH}/runtime" --bindir="${WORKDIR}/build/${ARCH}/bin"
  306 + ${SCRIPT} --output-dir="${WORKDIR}/build/${ARCH}/runtime" --bindir="${WORKDIR}/build/${ARCH}"
289 307 if [ "$?" != "0" ]; then
290 308 failed "Error on ${SCRIPT}"
291 309 fi
... ... @@ -296,6 +314,26 @@ makeRuntime() {
296 314 }
297 315  
298 316 #
  317 +# Make packages
  318 +#
  319 +makeInstaller()
  320 +{
  321 +
  322 + for ARCH in ${TARGET_ARCHS}
  323 + do
  324 +
  325 + echo -e "\e]2;Creating installer for ${ARCH}\a"
  326 + echo "Creating installer for ${ARCH}"
  327 +
  328 + cd ${WORKDIR}/build/${ARCH}
  329 + /bin/bash
  330 +
  331 +
  332 + done
  333 +
  334 +}
  335 +
  336 +#
299 337 # Check command line parameters
300 338 #
301 339 until [ -z "$1" ]
... ... @@ -393,6 +431,7 @@ done
393 431 # Create runtime
394 432 #
395 433 makeRuntime
  434 +makeInstaller
396 435  
397 436 cleanup
398 437  
... ...
win/pw3270.nsi.in
... ... @@ -71,10 +71,11 @@ SubSection "@PACKAGE@" SecMain
71 71 createShortCut "$DESKTOP\@PACKAGE@.lnk" "$INSTDIR\@PACKAGE@.exe"
72 72  
73 73 # Binary files
74   - file "/oname=$INSTDIR\@PACKAGE@.exe" "bin\@PACKAGE@.exe"
  74 + file "/oname=$INSTDIR\@PACKAGE@.exe" "@PACKAGE@.exe"
75 75 file "/oname=$INSTDIR\@PACKAGE@.ico" "@PACKAGE@.ico"
76   - file "/oname=$INSTDIR\lib3270.dll" "bin\lib3270.dll"
77   - file "/oname=$INSTDIR\@PACKAGE@.dll" "bin\@PACKAGE@.dll"
  76 + file "/oname=$INSTDIR\lib3270.dll" "lib3270.dll"
  77 + file "/oname=$INSTDIR\libv3270.dll" "libv3270.dll"
  78 + file "/oname=$INSTDIR\@PACKAGE@.dll" "@PACKAGE@.dll"
78 79  
79 80 # Configuration files
80 81 file "/oname=$INSTDIR\@PACKAGE@-logo.png" "@PACKAGE@-logo.png"
... ... @@ -95,7 +96,7 @@ SubSection "@PACKAGE@" SecMain
95 96  
96 97 # Charset definition files
97 98 CreateDirectory "$INSTDIR\charsets"
98   - file "/oname=$INSTDIR\charsets\bracket.xml" "bracket.xml"
  99 + file "/oname=$INSTDIR\charsets\bracket.xml" "charsets\bracket.xml"
99 100  
100 101 # Locale files
101 102 CreateDirectory "$INSTDIR\locale\pt_BR\LC_MESSAGES"
... ... @@ -134,18 +135,29 @@ SubSection "@PACKAGE@" SecMain
134 135  
135 136 SubSection "Plugins" SecPLugin
136 137  
137   - Section /o "HLLAPI" HLLAPIPlugin
  138 + Section /o "Remote control" IPCPlugin
138 139  
139 140 setOutPath $INSTDIR
140 141  
141 142 ${DisableX64FSRedirection}
142 143 CreateDirectory "$INSTDIR\plugins"
143 144  
144   - file "/oname=$INSTDIR\plugins\ipc3270c.dll" "bin\ipc3270c.dll"
145   - file "/oname=$SYSDIR\libhllapi.dll" "bin\libhllapi.dll"
  145 + file "/oname=$INSTDIR\plugins\ipc3270c.dll" "pw3270-plugins\ipcserver.dll"
146 146  
147 147 sectionEnd
148 148  
  149 + SubSectionEnd
  150 +
  151 + SubSection "Language bindins" Languages
  152 +
  153 + Section /o "HLLAPI" HLLAPIPlugin
  154 +
  155 + setOutPath $INSTDIR
  156 +
  157 + ${DisableX64FSRedirection}
  158 + file "/oname=$SYSDIR\libhllapi.dll" "libhllapi.dll"
  159 +
  160 + sectionEnd
149 161  
150 162 SubSectionEnd
151 163  
... ... @@ -175,7 +187,7 @@ SubSectionEnd
175 187 Section /o "GTK+ Runtime" SecGTK
176 188  
177 189 setOutPath $INSTDIR
178   - file /r "bin\runtime\*.*"
  190 + file /r "runtime\*.*"
179 191  
180 192 SectionEnd
181 193 !endif
... ... @@ -221,7 +233,7 @@ SectionEnd
221 233  
222 234 Function .onInit
223 235  
224   - #---[ Verifica opção de instalação HLLAPI ]----------------------------------------------------------
  236 + #---[ Check HLLAPI Command line option ]-------------------------------------------------------------
225 237  
226 238 Push $0
227 239  
... ... @@ -241,6 +253,10 @@ Function .onInit
241 253 IntOp $0 $0 | ${SF_SELECTED}
242 254 SectionSetFlags ${HLLAPIPlugin} $0
243 255  
  256 + SectionGetFlags ${IPCPlugin} $0
  257 + IntOp $0 $0 | ${SF_SELECTED}
  258 + SectionSetFlags ${IPCPlugin} $0
  259 +
244 260 ${EndIf}
245 261  
246 262 Pop $0
... ...