Commit 5e5746fe52bee1a7761dcdeeb0ce9f6bb9515e6e
1 parent
ad4ec5b9
Exists in
develop
Splitting bundle scripts.
Showing
4 changed files
with
158 additions
and
145 deletions
Show diff stats
win/bundle.common
| @@ -18,13 +18,6 @@ | @@ -18,13 +18,6 @@ | ||
| 18 | # along with this program. If not, see <https://www.gnu.org/licenses/>. | 18 | # along with this program. If not, see <https://www.gnu.org/licenses/>. |
| 19 | # | 19 | # |
| 20 | 20 | ||
| 21 | -# | ||
| 22 | -# References: | ||
| 23 | -# | ||
| 24 | -# https://www.gtk.org/docs/installations/windows/ | ||
| 25 | -# http://drup.org/gtk-warning-error-loading-icon-couldnt-recognize-image-file-format | ||
| 26 | -# | ||
| 27 | - | ||
| 28 | # Check command-line arguments | 21 | # Check command-line arguments |
| 29 | argument() { | 22 | argument() { |
| 30 | 23 | ||
| @@ -52,7 +45,10 @@ if [ "$?" == "0" ]; then | @@ -52,7 +45,10 @@ if [ "$?" == "0" ]; then | ||
| 52 | echo "" | 45 | echo "" |
| 53 | echo " --help Help options (this screen)" | 46 | echo " --help Help options (this screen)" |
| 54 | echo " --zip Build zipfile" | 47 | echo " --zip Build zipfile" |
| 55 | - echo " --nsi Build nsi installer" | 48 | + |
| 49 | + if [ -e "${srcdir}/win/${PACKAGE_NAME}.nsi" ]; then | ||
| 50 | + echo " --nsi Build nsi installer" | ||
| 51 | + fi | ||
| 56 | echo " --upload Upload bundle to github" | 52 | echo " --upload Upload bundle to github" |
| 57 | fi | 53 | fi |
| 58 | 54 | ||
| @@ -90,11 +86,6 @@ if [ -z ${PACKAGE_VERSION} ]; then | @@ -90,11 +86,6 @@ if [ -z ${PACKAGE_VERSION} ]; then | ||
| 90 | exit -1 | 86 | exit -1 |
| 91 | fi | 87 | fi |
| 92 | 88 | ||
| 93 | -GTK_PREFIX=$(${PKG_CONFIG} --variable=prefix gtk+-3.0) | ||
| 94 | -GTK_BINARY_VERSION=$(${PKG_CONFIG} --variable=gtk_binary_version gtk+-3.0) | ||
| 95 | -GTK_LIBDIR=$(echo $(${PKG_CONFIG} --variable=libdir gtk+-3.0) | sed "s@^C:/@/c/@g") | ||
| 96 | -GDK_LOADERS=$(echo $(${PKG_CONFIG} --variable=gdk_pixbuf_binarydir gdk-pixbuf-2.0) | sed -e "s@${GTK_PREFIX}@@g") | ||
| 97 | - | ||
| 98 | mkdir -p .bin/bundle | 89 | mkdir -p .bin/bundle |
| 99 | if [ "$?" != "0" ]; then | 90 | if [ "$?" != "0" ]; then |
| 100 | echo "Cant mkdir base buildroot" | 91 | echo "Cant mkdir base buildroot" |
| @@ -304,98 +295,6 @@ install_locale() { | @@ -304,98 +295,6 @@ install_locale() { | ||
| 304 | rm -f ${FILENAMES} | 295 | rm -f ${FILENAMES} |
| 305 | } | 296 | } |
| 306 | 297 | ||
| 307 | -install_schemas() { | ||
| 308 | - | ||
| 309 | - mkdir -p ${buildroot}${MINGW_PREFIX}/share/glib-2.0/schemas | ||
| 310 | - | ||
| 311 | - schemas=" | ||
| 312 | - org.gtk.Settings.FileChooser.gschema.xml | ||
| 313 | - gschema.dtd | ||
| 314 | - " | ||
| 315 | - | ||
| 316 | - for schema in ${schemas} | ||
| 317 | - do | ||
| 318 | - cp -v "${MINGW_PREFIX}/share/glib-2.0/schemas/${schema}" "${buildroot}${MINGW_PREFIX}/share/glib-2.0/schemas" | ||
| 319 | - if [ "$?" != "0" ]; then | ||
| 320 | - exit -1 | ||
| 321 | - fi | ||
| 322 | - done | ||
| 323 | - | ||
| 324 | - glib-compile-schemas \ | ||
| 325 | - --targetdir="${buildroot}${MINGW_PREFIX}/share/glib-2.0/schemas" \ | ||
| 326 | - "${buildroot}${MINGW_PREFIX}/share/glib-2.0/schemas" | ||
| 327 | - | ||
| 328 | - if [ "$?" != "0" ]; then | ||
| 329 | - exit -1 | ||
| 330 | - fi | ||
| 331 | -} | ||
| 332 | - | ||
| 333 | -install_theme() { | ||
| 334 | - | ||
| 335 | - mkdir -p "${buildroot}${MINGW_PREFIX}/etc" | ||
| 336 | - cp -rv "${MINGW_PREFIX}/etc/gtk-3.0" "${buildroot}${MINGW_PREFIX}/etc" | ||
| 337 | - if [ "$?" != "0" ]; then | ||
| 338 | - exit -1 | ||
| 339 | - fi | ||
| 340 | - | ||
| 341 | - # https://stackoverflow.com/questions/37035936/how-to-get-native-windows-decorations-on-gtk3-on-windows-7-and-msys2 | ||
| 342 | - mkdir -p ${buildroot}${MINGW_PREFIX}/etc/gtk-3.0 | ||
| 343 | - rm -f ${buildroot}${MINGW_PREFIX}/etc/gtk-3.0/settings.ini | ||
| 344 | - rm -f ${buildroot}${MINGW_PREFIX}/etc/gtk-3.0/gtkrc | ||
| 345 | - | ||
| 346 | - echo "[Settings]" > ${buildroot}${MINGW_PREFIX}/etc/gtk-3.0/settings.ini | ||
| 347 | - echo "gtk-theme-name=${1}" >> ${buildroot}${MINGW_PREFIX}/etc/gtk-3.0/settings.ini | ||
| 348 | - | ||
| 349 | - if [ -e "${srcdir}/win/gtk.css" ]; then | ||
| 350 | - mkdir -p "${buildroot}${MINGW_PREFIX}/share/themes/Default/gtk-3.0" | ||
| 351 | - cp "${srcdir}/win/gtk.css" "${buildroot}${MINGW_PREFIX}/share/themes/Default/gtk-3.0/gtk.css" | ||
| 352 | - fi | ||
| 353 | - | ||
| 354 | -} | ||
| 355 | - | ||
| 356 | -install_icons() { | ||
| 357 | - | ||
| 358 | - mkdir -p "${buildroot}${MINGW_PREFIX}/share/icons" | ||
| 359 | - | ||
| 360 | - if [ -d "${MINGW_PREFIX}/share/icons/${1}" ]; then | ||
| 361 | - | ||
| 362 | - cp -rv "${MINGW_PREFIX}/share/icons/${1}" "${buildroot}${MINGW_PREFIX}/share/icons" | ||
| 363 | - if [ "$?" != 0 ]; then | ||
| 364 | - echo "Can´t copy ${1} icons" | ||
| 365 | - exit -1 | ||
| 366 | - fi | ||
| 367 | - | ||
| 368 | - elif [ -d "/usr/share/icons/${1}" ]; then | ||
| 369 | - | ||
| 370 | - cp -rv "/usr/share/icons/${1}" "${buildroot}${MINGW_PREFIX}/share/icons" | ||
| 371 | - if [ "$?" != 0 ]; then | ||
| 372 | - echo "Can´t copy ${1} icons" | ||
| 373 | - exit -1 | ||
| 374 | - fi | ||
| 375 | - | ||
| 376 | - else | ||
| 377 | - | ||
| 378 | - echo "Can´t find ${1} icons" | ||
| 379 | - exit -1 | ||
| 380 | - | ||
| 381 | - fi | ||
| 382 | - | ||
| 383 | -} | ||
| 384 | - | ||
| 385 | -install_loaders() { | ||
| 386 | - | ||
| 387 | - if [ -d "${MINGW_PREFIX}${GDK_LOADERS}" ]; then | ||
| 388 | - mkdir -p "${buildroot}/${MINGW_PREFIX}${GDK_LOADERS}" | ||
| 389 | - cp -rv ${MINGW_PREFIX}${GDK_LOADERS}/* "${buildroot}/${MINGW_PREFIX}${GDK_LOADERS}" | ||
| 390 | - if [ "$?" != "0" ]; then | ||
| 391 | - exit -1 | ||
| 392 | - fi | ||
| 393 | - | ||
| 394 | - find ${buildroot}/${MINGW_PREFIX}${GDK_LOADERS} -iname "*.a" -exec rm -f {} \; | ||
| 395 | - | ||
| 396 | - fi | ||
| 397 | - | ||
| 398 | -} | ||
| 399 | 298 | ||
| 400 | make_zip() { | 299 | make_zip() { |
| 401 | 300 | ||
| @@ -456,21 +355,24 @@ make_nsis() { | @@ -456,21 +355,24 @@ make_nsis() { | ||
| 456 | fi | 355 | fi |
| 457 | } | 356 | } |
| 458 | 357 | ||
| 459 | -install_runtime() { | 358 | +install_license() { |
| 359 | + mkdir -p "${buildroot}${MINGW_PREFIX}/usr/share/${PACKAGE_NAME}" | ||
| 360 | + cp "${srcdir}/LICENSE" "${buildroot}${MINGW_PREFIX}/share/${PACKAGE_NAME}" | ||
| 361 | + if [ "$?" != "0" ]; then | ||
| 362 | + echo "Cant copy LICENSE" | ||
| 363 | + exit -1 | ||
| 364 | + fi | ||
| 365 | +} | ||
| 460 | 366 | ||
| 461 | - install_loaders | 367 | +install_runtime() { |
| 462 | install_bin | 368 | install_bin |
| 463 | install_locale | 369 | install_locale |
| 464 | - install_schemas | ||
| 465 | - install_theme "Adwaita" | ||
| 466 | - install_icons "Adwaita" | ||
| 467 | - | ||
| 468 | } | 370 | } |
| 469 | 371 | ||
| 470 | make_packages() { | 372 | make_packages() { |
| 471 | 373 | ||
| 472 | mkdir -p "${buildroot}${MINGW_PREFIX}/nsi" | 374 | mkdir -p "${buildroot}${MINGW_PREFIX}/nsi" |
| 473 | - cp "${srcdir}/win/pw3270.nsi" "${buildroot}${MINGW_PREFIX}/${PACKAGE_NAME}.nsi" | 375 | + cp "${srcdir}/win/${PACKAGE_NAME}.nsi" "${buildroot}${MINGW_PREFIX}/${PACKAGE_NAME}.nsi" |
| 474 | if [ "$?" != "0" ]; then | 376 | if [ "$?" != "0" ]; then |
| 475 | echo "Cant copy nsis script" | 377 | echo "Cant copy nsis script" |
| 476 | fi | 378 | fi |
win/bundle.cross
| @@ -18,20 +18,13 @@ | @@ -18,20 +18,13 @@ | ||
| 18 | # along with this program. If not, see <https://www.gnu.org/licenses/>. | 18 | # along with this program. If not, see <https://www.gnu.org/licenses/>. |
| 19 | # | 19 | # |
| 20 | 20 | ||
| 21 | -# | ||
| 22 | -# References: | ||
| 23 | -# | ||
| 24 | -# https://www.gtk.org/docs/installations/windows/ | ||
| 25 | -# http://drup.org/gtk-warning-error-loading-icon-couldnt-recognize-image-file-format | ||
| 26 | -# | ||
| 27 | - | ||
| 28 | MINGW_PREFIX="/usr/x86_64-w64-mingw32/sys-root/mingw" | 21 | MINGW_PREFIX="/usr/x86_64-w64-mingw32/sys-root/mingw" |
| 29 | PKG_CONFIG="/usr/bin/x86_64-w64-mingw32-pkg-config" | 22 | PKG_CONFIG="/usr/bin/x86_64-w64-mingw32-pkg-config" |
| 30 | MINGW_PACKAGE_PREFIX="mingw64" | 23 | MINGW_PACKAGE_PREFIX="mingw64" |
| 31 | REPOSITORY_NAME="pw3270" | 24 | REPOSITORY_NAME="pw3270" |
| 32 | 25 | ||
| 33 | # Load bundle functions | 26 | # Load bundle functions |
| 34 | -. "$(dirname $(readlink -f "${0}"))/bundle.common" | 27 | +. "$(dirname $(readlink -f "${0}"))/bundle.gtk3" |
| 35 | 28 | ||
| 36 | argument "help" > /dev/null | 29 | argument "help" > /dev/null |
| 37 | if [ "$?" == "0" ]; then | 30 | if [ "$?" == "0" ]; then |
| @@ -193,18 +186,9 @@ unpack_rpm() { | @@ -193,18 +186,9 @@ unpack_rpm() { | ||
| 193 | 186 | ||
| 194 | } | 187 | } |
| 195 | 188 | ||
| 196 | -install_license() { | ||
| 197 | - mkdir -p "${buildroot}${MINGW_PREFIX}/usr/share/${PACKAGE_NAME}" | ||
| 198 | - cp "${srcdir}/LICENSE" "${buildroot}${MINGW_PREFIX}/share/${PACKAGE_NAME}" | ||
| 199 | - if [ "$?" != "0" ]; then | ||
| 200 | - echo "Cant copy LICENSE" | ||
| 201 | - exit -1 | ||
| 202 | - fi | ||
| 203 | -} | ||
| 204 | - | ||
| 205 | unpack_rpm | 189 | unpack_rpm |
| 206 | 190 | ||
| 207 | -install_runtime | 191 | +install_gtk3_runtime |
| 208 | install_license | 192 | install_license |
| 209 | 193 | ||
| 210 | make_packages | 194 | make_packages |
| @@ -0,0 +1,139 @@ | @@ -0,0 +1,139 @@ | ||
| 1 | +#!/bin/bash | ||
| 2 | +# | ||
| 3 | +# SPDX-License-Identifier: LGPL-3.0-or-later | ||
| 4 | +# | ||
| 5 | +# Copyright (C) 2023 Perry Werneck <perry.werneck@gmail.com> | ||
| 6 | +# | ||
| 7 | +# This program is free software: you can redistribute it and/or modify | ||
| 8 | +# it under the terms of the GNU Lesser General Public License as published | ||
| 9 | +# by the Free Software Foundation, either version 3 of the License, or | ||
| 10 | +# (at your option) any later version. | ||
| 11 | +# | ||
| 12 | +# This program is distributed in the hope that it will be useful, | ||
| 13 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | +# GNU General Public License for more details. | ||
| 16 | +# | ||
| 17 | +# You should have received a copy of the GNU Lesser General Public License | ||
| 18 | +# along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
| 19 | +# | ||
| 20 | + | ||
| 21 | +# | ||
| 22 | +# References: | ||
| 23 | +# | ||
| 24 | +# https://www.gtk.org/docs/installations/windows/ | ||
| 25 | +# http://drup.org/gtk-warning-error-loading-icon-couldnt-recognize-image-file-format | ||
| 26 | +# | ||
| 27 | + | ||
| 28 | +# Load bundle functions | ||
| 29 | +. "$(dirname $(readlink -f "${0}"))/bundle.common" | ||
| 30 | + | ||
| 31 | +GTK_PREFIX=$(${PKG_CONFIG} --variable=prefix gtk+-3.0) | ||
| 32 | +GTK_BINARY_VERSION=$(${PKG_CONFIG} --variable=gtk_binary_version gtk+-3.0) | ||
| 33 | +GTK_LIBDIR=$(echo $(${PKG_CONFIG} --variable=libdir gtk+-3.0) | sed "s@^C:/@/c/@g") | ||
| 34 | +GDK_LOADERS=$(echo $(${PKG_CONFIG} --variable=gdk_pixbuf_binarydir gdk-pixbuf-2.0) | sed -e "s@${GTK_PREFIX}@@g") | ||
| 35 | + | ||
| 36 | +install_schemas() { | ||
| 37 | + | ||
| 38 | + mkdir -p ${buildroot}${MINGW_PREFIX}/share/glib-2.0/schemas | ||
| 39 | + | ||
| 40 | + schemas=" | ||
| 41 | + org.gtk.Settings.FileChooser.gschema.xml | ||
| 42 | + gschema.dtd | ||
| 43 | + " | ||
| 44 | + | ||
| 45 | + for schema in ${schemas} | ||
| 46 | + do | ||
| 47 | + cp -v "${MINGW_PREFIX}/share/glib-2.0/schemas/${schema}" "${buildroot}${MINGW_PREFIX}/share/glib-2.0/schemas" | ||
| 48 | + if [ "$?" != "0" ]; then | ||
| 49 | + exit -1 | ||
| 50 | + fi | ||
| 51 | + done | ||
| 52 | + | ||
| 53 | + glib-compile-schemas \ | ||
| 54 | + --targetdir="${buildroot}${MINGW_PREFIX}/share/glib-2.0/schemas" \ | ||
| 55 | + "${buildroot}${MINGW_PREFIX}/share/glib-2.0/schemas" | ||
| 56 | + | ||
| 57 | + if [ "$?" != "0" ]; then | ||
| 58 | + exit -1 | ||
| 59 | + fi | ||
| 60 | +} | ||
| 61 | + | ||
| 62 | +install_theme() { | ||
| 63 | + | ||
| 64 | + mkdir -p "${buildroot}${MINGW_PREFIX}/etc" | ||
| 65 | + cp -rv "${MINGW_PREFIX}/etc/gtk-3.0" "${buildroot}${MINGW_PREFIX}/etc" | ||
| 66 | + if [ "$?" != "0" ]; then | ||
| 67 | + exit -1 | ||
| 68 | + fi | ||
| 69 | + | ||
| 70 | + # https://stackoverflow.com/questions/37035936/how-to-get-native-windows-decorations-on-gtk3-on-windows-7-and-msys2 | ||
| 71 | + mkdir -p ${buildroot}${MINGW_PREFIX}/etc/gtk-3.0 | ||
| 72 | + rm -f ${buildroot}${MINGW_PREFIX}/etc/gtk-3.0/settings.ini | ||
| 73 | + rm -f ${buildroot}${MINGW_PREFIX}/etc/gtk-3.0/gtkrc | ||
| 74 | + | ||
| 75 | + echo "[Settings]" > ${buildroot}${MINGW_PREFIX}/etc/gtk-3.0/settings.ini | ||
| 76 | + echo "gtk-theme-name=${1}" >> ${buildroot}${MINGW_PREFIX}/etc/gtk-3.0/settings.ini | ||
| 77 | + | ||
| 78 | + if [ -e "${srcdir}/win/gtk.css" ]; then | ||
| 79 | + mkdir -p "${buildroot}${MINGW_PREFIX}/share/themes/Default/gtk-3.0" | ||
| 80 | + cp "${srcdir}/win/gtk.css" "${buildroot}${MINGW_PREFIX}/share/themes/Default/gtk-3.0/gtk.css" | ||
| 81 | + fi | ||
| 82 | + | ||
| 83 | +} | ||
| 84 | + | ||
| 85 | +install_icons() { | ||
| 86 | + | ||
| 87 | + mkdir -p "${buildroot}${MINGW_PREFIX}/share/icons" | ||
| 88 | + | ||
| 89 | + if [ -d "${MINGW_PREFIX}/share/icons/${1}" ]; then | ||
| 90 | + | ||
| 91 | + cp -rv "${MINGW_PREFIX}/share/icons/${1}" "${buildroot}${MINGW_PREFIX}/share/icons" | ||
| 92 | + if [ "$?" != 0 ]; then | ||
| 93 | + echo "Can´t copy ${1} icons" | ||
| 94 | + exit -1 | ||
| 95 | + fi | ||
| 96 | + | ||
| 97 | + elif [ -d "/usr/share/icons/${1}" ]; then | ||
| 98 | + | ||
| 99 | + cp -rv "/usr/share/icons/${1}" "${buildroot}${MINGW_PREFIX}/share/icons" | ||
| 100 | + if [ "$?" != 0 ]; then | ||
| 101 | + echo "Can´t copy ${1} icons" | ||
| 102 | + exit -1 | ||
| 103 | + fi | ||
| 104 | + | ||
| 105 | + else | ||
| 106 | + | ||
| 107 | + echo "Can´t find ${1} icons" | ||
| 108 | + exit -1 | ||
| 109 | + | ||
| 110 | + fi | ||
| 111 | + | ||
| 112 | +} | ||
| 113 | + | ||
| 114 | +install_loaders() { | ||
| 115 | + | ||
| 116 | + if [ -d "${MINGW_PREFIX}${GDK_LOADERS}" ]; then | ||
| 117 | + mkdir -p "${buildroot}/${MINGW_PREFIX}${GDK_LOADERS}" | ||
| 118 | + cp -rv ${MINGW_PREFIX}${GDK_LOADERS}/* "${buildroot}/${MINGW_PREFIX}${GDK_LOADERS}" | ||
| 119 | + if [ "$?" != "0" ]; then | ||
| 120 | + exit -1 | ||
| 121 | + fi | ||
| 122 | + | ||
| 123 | + find ${buildroot}/${MINGW_PREFIX}${GDK_LOADERS} -iname "*.a" -exec rm -f {} \; | ||
| 124 | + | ||
| 125 | + fi | ||
| 126 | + | ||
| 127 | +} | ||
| 128 | + | ||
| 129 | +install_gtk3_runtime() { | ||
| 130 | + | ||
| 131 | + install_loaders | ||
| 132 | + install_bin | ||
| 133 | + install_locale | ||
| 134 | + install_schemas | ||
| 135 | + install_theme "Adwaita" | ||
| 136 | + install_icons "Adwaita" | ||
| 137 | + | ||
| 138 | +} | ||
| 139 | + |
win/bundle.msys
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | # | 2 | # |
| 3 | # SPDX-License-Identifier: LGPL-3.0-or-later | 3 | # SPDX-License-Identifier: LGPL-3.0-or-later |
| 4 | # | 4 | # |
| 5 | -# Copyright (C) 2021 Perry Werneck <perry.werneck@gmail.com> | 5 | +# Copyright (C) 2023 Perry Werneck <perry.werneck@gmail.com> |
| 6 | # | 6 | # |
| 7 | # This program is free software: you can redistribute it and/or modify | 7 | # This program is free software: you can redistribute it and/or modify |
| 8 | # it under the terms of the GNU Lesser General Public License as published | 8 | # it under the terms of the GNU Lesser General Public License as published |
| @@ -18,15 +18,8 @@ | @@ -18,15 +18,8 @@ | ||
| 18 | # along with this program. If not, see <https://www.gnu.org/licenses/>. | 18 | # along with this program. If not, see <https://www.gnu.org/licenses/>. |
| 19 | # | 19 | # |
| 20 | 20 | ||
| 21 | -# | ||
| 22 | -# References: | ||
| 23 | -# | ||
| 24 | -# https://www.gtk.org/docs/installations/windows/ | ||
| 25 | -# http://drup.org/gtk-warning-error-loading-icon-couldnt-recognize-image-file-format | ||
| 26 | -# | ||
| 27 | - | ||
| 28 | # Load bundle functions | 21 | # Load bundle functions |
| 29 | -. "$(dirname $(readlink -f "${0}"))/bundle.common" | 22 | +. "$(dirname $(readlink -f "${0}"))/bundle.gtk3" |
| 30 | 23 | ||
| 31 | prepare | 24 | prepare |
| 32 | 25 | ||
| @@ -40,11 +33,6 @@ do | @@ -40,11 +33,6 @@ do | ||
| 40 | fi | 33 | fi |
| 41 | done | 34 | done |
| 42 | 35 | ||
| 43 | -install_loaders | ||
| 44 | -install_bin | ||
| 45 | -install_locale | ||
| 46 | -install_schemas | ||
| 47 | -install_theme "Adwaita" | ||
| 48 | -install_icons "Adwaita" | 36 | +install_gtk3_runtime |
| 49 | 37 | ||
| 50 | 38 |