Commit b03c8a3f95a7899bb771e37ce32fb52cad75fcac
1 parent
371f6465
Exists in
develop
msys based bundler is now bundle.msys, common calls splitted to bundle.common
Showing
5 changed files
with
359 additions
and
333 deletions
Show diff stats
.github/workflows/winpkg.yml
| @@ -67,9 +67,9 @@ jobs: | @@ -67,9 +67,9 @@ jobs: | ||
| 67 | latest: true | 67 | latest: true |
| 68 | fileName: mingw-w64-x86_64-pw3270-plugin-ipc-5.5-0-x86_64.pkg.tar.zst | 68 | fileName: mingw-w64-x86_64-pw3270-plugin-ipc-5.5-0-x86_64.pkg.tar.zst |
| 69 | - name: Make bundle | 69 | - name: Make bundle |
| 70 | - run: /bin/bash ./win/bundle | 70 | + run: ./win/bundle.msys |
| 71 | - name: Make Package | 71 | - name: Make Package |
| 72 | - run: tar -C ./.build -Jcf mingw-w64-x86_64-pw3270-bundle-x86_64.tar.xz . | 72 | + run: tar -C ./.bin/bundle -Jcf mingw-w64-x86_64-pw3270-bundle-x86_64.tar.xz . |
| 73 | - uses: ncipollo/release-action@v1 | 73 | - uses: ncipollo/release-action@v1 |
| 74 | with: | 74 | with: |
| 75 | tag: ${{ steps.gettag.outputs.tag }} | 75 | tag: ${{ steps.gettag.outputs.tag }} |
.gitignore
win/bundle
| @@ -1,326 +0,0 @@ | @@ -1,326 +0,0 @@ | ||
| 1 | -#!/bin/bash | ||
| 2 | -# | ||
| 3 | -# SPDX-License-Identifier: LGPL-3.0-or-later | ||
| 4 | -# | ||
| 5 | -# Copyright (C) 2021 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 | -# Referencias: | ||
| 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 | -# Setup default paths | ||
| 29 | -srcdir="$(dirname $(dirname $(readlink -f "${0}")))" | ||
| 30 | - | ||
| 31 | -if [ -z ${MINGW_PREFIX} ]; then | ||
| 32 | - if [ -d "/usr/x86_64-w64-mingw32/sys-root/mingw" ]; then | ||
| 33 | - MINGW_PREFIX="/usr/x86_64-w64-mingw32/sys-root/mingw" | ||
| 34 | - PKG_CONFIG="/usr/bin/x86_64-w64-mingw32-pkg-config" | ||
| 35 | - else | ||
| 36 | - echo "Cant determine mingw prefix" | ||
| 37 | - exit -1 | ||
| 38 | - fi | ||
| 39 | -else | ||
| 40 | - PKG_CONFIG=${MINGW_PREFX}/bin/pkg-config | ||
| 41 | -fi | ||
| 42 | - | ||
| 43 | -GTK_PREFIX=$(${PKG_CONFIG} --variable=prefix gtk+-3.0) | ||
| 44 | -GTK_BINARY_VERSION=$(${PKG_CONFIG} --variable=gtk_binary_version gtk+-3.0) | ||
| 45 | -GTK_LIBDIR=$(echo $(${PKG_CONFIG} --variable=libdir gtk+-3.0) | sed "s@^C:/@/c/@g") | ||
| 46 | -GDK_LOADERS=$(echo $(${PKG_CONFIG} --variable=gdk_pixbuf_binarydir gdk-pixbuf-2.0) | sed -e "s@${GTK_PREFIX}@@g") | ||
| 47 | - | ||
| 48 | -buildroot=.build | ||
| 49 | -bindir="${buildroot}${MINGW_PREFIX}/bin" | ||
| 50 | - | ||
| 51 | -if [ -z "${WIN_ROOT}" ]; then | ||
| 52 | - WIN_ROOT="/c/Windows" | ||
| 53 | -fi | ||
| 54 | - | ||
| 55 | -export LANG=C | ||
| 56 | - | ||
| 57 | -install_bin() { | ||
| 58 | - | ||
| 59 | - mkdir -p "${bindir}" | ||
| 60 | - | ||
| 61 | - AGAIN=1 | ||
| 62 | - until [ $AGAIN = 0 ]; do | ||
| 63 | - | ||
| 64 | - SOURCES=$(mktemp) | ||
| 65 | - REQUIRES=$(mktemp) | ||
| 66 | - | ||
| 67 | - find "${buildroot}" -iname "*.dll" > ${SOURCES} | ||
| 68 | - find "${buildroot}" -iname "*.exe" >> ${SOURCES} | ||
| 69 | - | ||
| 70 | - while read FILENAME | ||
| 71 | - do | ||
| 72 | - objdump -p ${FILENAME} | grep "DLL Name:" | cut -d: -f2 | tr "[:upper:]" "[:lower:]" >> ${REQUIRES} | ||
| 73 | - done < ${SOURCES} | ||
| 74 | - | ||
| 75 | - libs_to_exclude=" | ||
| 76 | - advapi32 | ||
| 77 | - cfgmgr32 | ||
| 78 | - comctl32 | ||
| 79 | - comdlg32 | ||
| 80 | - crypt32 | ||
| 81 | - d3d8 | ||
| 82 | - d3d9 | ||
| 83 | - ddraw | ||
| 84 | - dnsapi | ||
| 85 | - dsound | ||
| 86 | - dwmapi | ||
| 87 | - gdi32 | ||
| 88 | - gdiplus | ||
| 89 | - glu32 | ||
| 90 | - glut32 | ||
| 91 | - imm32 | ||
| 92 | - iphlpapi | ||
| 93 | - kernel32 | ||
| 94 | - ksuser | ||
| 95 | - mpr | ||
| 96 | - mscms | ||
| 97 | - mscoree | ||
| 98 | - msimg32 | ||
| 99 | - msvcr71 | ||
| 100 | - msvcr80 | ||
| 101 | - msvcr90 | ||
| 102 | - msvcrt | ||
| 103 | - mswsock | ||
| 104 | - netapi32 | ||
| 105 | - odbc32 | ||
| 106 | - ole32 | ||
| 107 | - oleacc | ||
| 108 | - oleaut32 | ||
| 109 | - opengl32 | ||
| 110 | - psapi | ||
| 111 | - rpcrt4 | ||
| 112 | - secur32 | ||
| 113 | - setupapi | ||
| 114 | - shell32 | ||
| 115 | - shlwapi | ||
| 116 | - user32 | ||
| 117 | - usp10 | ||
| 118 | - version | ||
| 119 | - wininet | ||
| 120 | - winmm | ||
| 121 | - wldap32 | ||
| 122 | - ws2_32 | ||
| 123 | - wsock32 | ||
| 124 | - winspool.drv | ||
| 125 | - ntdll | ||
| 126 | - winhttp | ||
| 127 | - hid | ||
| 128 | - " | ||
| 129 | - | ||
| 130 | - # Remove system DLLs from list | ||
| 131 | - for i in $libs_to_exclude; do | ||
| 132 | - sed -i -e "/${i}/d" ${REQUIRES} | ||
| 133 | - done | ||
| 134 | - | ||
| 135 | - AGAIN=0 | ||
| 136 | - while read FILENAME | ||
| 137 | - do | ||
| 138 | - | ||
| 139 | - if [ ! -e "${bindir}/${FILENAME}" ]; then | ||
| 140 | - | ||
| 141 | - if [ -e ${MINGW_PREFIX}/bin/${FILENAME} ]; then | ||
| 142 | - | ||
| 143 | - AGAIN=1 | ||
| 144 | - cp -v "${MINGW_PREFIX}/bin/${FILENAME}" "${bindir}/${FILENAME}" | ||
| 145 | - if [ "$?" != "0" ]; then | ||
| 146 | - exit -1 | ||
| 147 | - fi | ||
| 148 | - | ||
| 149 | - elif [ -e ${MINGW_PREFIX}/lib/${FILENAME} ]; then | ||
| 150 | - | ||
| 151 | - AGAIN=1 | ||
| 152 | - cp -v "${MINGW_PREFIX}/lib/${FILENAME}" "${bindir}/${FILENAME}" | ||
| 153 | - if [ "$?" != "0" ]; then | ||
| 154 | - exit -1 | ||
| 155 | - fi | ||
| 156 | - | ||
| 157 | - elif [ -e "${WIN_ROOT}/System32/${FILENAME}" ]; then | ||
| 158 | - | ||
| 159 | - echo "Ignoring ${WIN_ROOT}/System32/${FILENAME}" | ||
| 160 | - | ||
| 161 | - else | ||
| 162 | - | ||
| 163 | - echo "Can't find ${MINGW_PREFIX}/bin/${FILENAME} or ${WIN_ROOT}/System32/${FILENAME}" | ||
| 164 | - find "${MINGW_PREFIX}" -iname "${FILENAME}" | ||
| 165 | - exit -1 | ||
| 166 | - | ||
| 167 | - fi | ||
| 168 | - | ||
| 169 | - fi | ||
| 170 | - | ||
| 171 | - done < ${REQUIRES} | ||
| 172 | - | ||
| 173 | - rm -f ${SOURCES} | ||
| 174 | - rm -f ${REQUIRES} | ||
| 175 | - | ||
| 176 | - done | ||
| 177 | - | ||
| 178 | -} | ||
| 179 | - | ||
| 180 | -install_locale() { | ||
| 181 | - | ||
| 182 | - mkdir -p ${buildroot}${MINGW_PREFIX}/share/locale/pt_BR/LC_MESSAGES | ||
| 183 | - | ||
| 184 | - locales=" | ||
| 185 | - gettext-runtime.mo | ||
| 186 | - gettext-tools.mo | ||
| 187 | - glib20.mo | ||
| 188 | - gtk30.mo | ||
| 189 | - gtk30-properties.mo | ||
| 190 | - " | ||
| 191 | - | ||
| 192 | - FILENAMES=$(mktemp) | ||
| 193 | - for i in ${locales} | ||
| 194 | - do | ||
| 195 | - find "${MINGW_PREFIX}/share/locale" -name ${i} >> ${FILENAMES} | ||
| 196 | - done | ||
| 197 | - | ||
| 198 | - while read FILENAME | ||
| 199 | - do | ||
| 200 | - mkdir -p $(dirname "${buildroot}${FILENAME}") | ||
| 201 | - cp -v "${FILENAME}" "${buildroot}${FILENAME}" | ||
| 202 | - if [ "$?" != "0" ]; then | ||
| 203 | - exit -1 | ||
| 204 | - fi | ||
| 205 | - done < ${FILENAMES} | ||
| 206 | - rm -f ${FILENAMES} | ||
| 207 | -} | ||
| 208 | - | ||
| 209 | -install_schemas() { | ||
| 210 | - | ||
| 211 | - mkdir -p ${buildroot}${MINGW_PREFIX}/share/glib-2.0/schemas | ||
| 212 | - | ||
| 213 | - schemas=" | ||
| 214 | - org.gtk.Settings.FileChooser.gschema.xml | ||
| 215 | - gschema.dtd | ||
| 216 | - " | ||
| 217 | - | ||
| 218 | - for schema in ${schemas} | ||
| 219 | - do | ||
| 220 | - cp -v "${MINGW_PREFIX}/share/glib-2.0/schemas/${schema}" "${buildroot}${MINGW_PREFIX}/share/glib-2.0/schemas" | ||
| 221 | - if [ "$?" != "0" ]; then | ||
| 222 | - exit -1 | ||
| 223 | - fi | ||
| 224 | - done | ||
| 225 | - | ||
| 226 | - glib-compile-schemas \ | ||
| 227 | - --targetdir="${buildroot}${MINGW_PREFIX}/share/glib-2.0/schemas" \ | ||
| 228 | - "${buildroot}${MINGW_PREFIX}/share/glib-2.0/schemas" | ||
| 229 | - | ||
| 230 | - if [ "$?" != "0" ]; then | ||
| 231 | - exit -1 | ||
| 232 | - fi | ||
| 233 | -} | ||
| 234 | - | ||
| 235 | -install_theme() { | ||
| 236 | - | ||
| 237 | - mkdir -p "${buildroot}${MINGW_PREFIX}/etc" | ||
| 238 | - cp -rv "${MINGW_PREFIX}/etc/gtk-3.0" "${buildroot}${MINGW_PREFIX}/etc" | ||
| 239 | - if [ "$?" != "0" ]; then | ||
| 240 | - exit -1 | ||
| 241 | - fi | ||
| 242 | - | ||
| 243 | - # https://stackoverflow.com/questions/37035936/how-to-get-native-windows-decorations-on-gtk3-on-windows-7-and-msys2 | ||
| 244 | - mkdir -p ${buildroot}${MINGW_PREFIX}/etc/gtk-3.0 | ||
| 245 | - rm -f ${buildroot}${MINGW_PREFIX}/etc/gtk-3.0/settings.ini | ||
| 246 | - rm -f ${buildroot}${MINGW_PREFIX}/etc/gtk-3.0/gtkrc | ||
| 247 | - | ||
| 248 | - echo "[Settings]" > ${buildroot}${MINGW_PREFIX}/etc/gtk-3.0/settings.ini | ||
| 249 | - echo "gtk-theme-name=${1}" >> ${buildroot}${MINGW_PREFIX}/etc/gtk-3.0/settings.ini | ||
| 250 | - | ||
| 251 | - if [ -e "${srcdir}/win/gtk.css" ]; then | ||
| 252 | - mkdir -p "${buildroot}${MINGW_PREFIX}/share/themes/Default/gtk-3.0" | ||
| 253 | - cp "${srcdir}/win/gtk.css" "${buildroot}${MINGW_PREFIX}/share/themes/Default/gtk-3.0/gtk.css" | ||
| 254 | - fi | ||
| 255 | - | ||
| 256 | -} | ||
| 257 | - | ||
| 258 | -install_icons() { | ||
| 259 | - | ||
| 260 | - mkdir -p "${buildroot}${MINGW_PREFIX}/share/icons" | ||
| 261 | - | ||
| 262 | - if [ -d "${MINGW_PREFIX}/share/icons/${1}" ]; then | ||
| 263 | - | ||
| 264 | - cp -rv "${MINGW_PREFIX}/share/icons/${1}" "${buildroot}${MINGW_PREFIX}/share/icons" | ||
| 265 | - if [ "$?" != 0 ]; then | ||
| 266 | - echo "Can´t copy ${1} icons" | ||
| 267 | - exit -1 | ||
| 268 | - fi | ||
| 269 | - | ||
| 270 | - elif [ -d "/usr/share/icons/${1}" ]; then | ||
| 271 | - | ||
| 272 | - cp -rv "/usr/share/icons/${1}" "${buildroot}${MINGW_PREFIX}/share/icons" | ||
| 273 | - if [ "$?" != 0 ]; then | ||
| 274 | - echo "Can´t copy ${1} icons" | ||
| 275 | - exit -1 | ||
| 276 | - fi | ||
| 277 | - | ||
| 278 | - else | ||
| 279 | - | ||
| 280 | - echo "Can´t find ${1} icons" | ||
| 281 | - exit -1 | ||
| 282 | - | ||
| 283 | - fi | ||
| 284 | - | ||
| 285 | -} | ||
| 286 | - | ||
| 287 | -install_loaders() { | ||
| 288 | - | ||
| 289 | - if [ -d "${MINGW_PREFIX}${GDK_LOADERS}" ]; then | ||
| 290 | - mkdir -p "${buildroot}/${MINGW_PREFIX}${GDK_LOADERS}" | ||
| 291 | - cp -rv ${MINGW_PREFIX}${GDK_LOADERS}/* "${buildroot}/${MINGW_PREFIX}${GDK_LOADERS}" | ||
| 292 | - if [ "$?" != "0" ]; then | ||
| 293 | - exit -1 | ||
| 294 | - fi | ||
| 295 | - | ||
| 296 | - find ${buildroot}/${MINGW_PREFIX}${GDK_LOADERS} -iname "*.a" -exec rm -f {} \; | ||
| 297 | - | ||
| 298 | - fi | ||
| 299 | - | ||
| 300 | -} | ||
| 301 | - | ||
| 302 | -unpack() { | ||
| 303 | - | ||
| 304 | - for package in ${srcdir}/*.pkg.tar.zst | ||
| 305 | - do | ||
| 306 | - echo ${package} | ||
| 307 | - tar -C ${buildroot} --zstd -xf ${package} | ||
| 308 | - if [ "$?" != "0" ]; then | ||
| 309 | - echo "Error unpacking ${package}" | ||
| 310 | - exit -1 | ||
| 311 | - fi | ||
| 312 | - done | ||
| 313 | - | ||
| 314 | -} | ||
| 315 | - | ||
| 316 | -mkdir -p ${buildroot} | ||
| 317 | -unpack | ||
| 318 | - | ||
| 319 | -install_loaders | ||
| 320 | -install_bin | ||
| 321 | -install_locale | ||
| 322 | -install_schemas | ||
| 323 | -install_theme "Adwaita" | ||
| 324 | -install_icons "Adwaita" | ||
| 325 | - | ||
| 326 | - |
| @@ -0,0 +1,306 @@ | @@ -0,0 +1,306 @@ | ||
| 1 | +#!/bin/bash | ||
| 2 | +# | ||
| 3 | +# SPDX-License-Identifier: LGPL-3.0-or-later | ||
| 4 | +# | ||
| 5 | +# Copyright (C) 2021 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 | +# Setup default paths | ||
| 29 | +srcdir="$(dirname $(dirname $(readlink -f "${0}")))" | ||
| 30 | + | ||
| 31 | +if [ -z ${MINGW_PREFIX} ]; then | ||
| 32 | + if [ -d "/usr/x86_64-w64-mingw32/sys-root/mingw" ]; then | ||
| 33 | + MINGW_PREFIX="/usr/x86_64-w64-mingw32/sys-root/mingw" | ||
| 34 | + PKG_CONFIG="/usr/bin/x86_64-w64-mingw32-pkg-config" | ||
| 35 | + else | ||
| 36 | + echo "Cant determine mingw prefix" | ||
| 37 | + exit -1 | ||
| 38 | + fi | ||
| 39 | +else | ||
| 40 | + PKG_CONFIG=${MINGW_PREFX}/bin/pkg-config | ||
| 41 | +fi | ||
| 42 | + | ||
| 43 | +GTK_PREFIX=$(${PKG_CONFIG} --variable=prefix gtk+-3.0) | ||
| 44 | +GTK_BINARY_VERSION=$(${PKG_CONFIG} --variable=gtk_binary_version gtk+-3.0) | ||
| 45 | +GTK_LIBDIR=$(echo $(${PKG_CONFIG} --variable=libdir gtk+-3.0) | sed "s@^C:/@/c/@g") | ||
| 46 | +GDK_LOADERS=$(echo $(${PKG_CONFIG} --variable=gdk_pixbuf_binarydir gdk-pixbuf-2.0) | sed -e "s@${GTK_PREFIX}@@g") | ||
| 47 | + | ||
| 48 | +buildroot=.bin/bundle | ||
| 49 | +bindir="${buildroot}${MINGW_PREFIX}/bin" | ||
| 50 | + | ||
| 51 | +if [ -z "${WIN_ROOT}" ]; then | ||
| 52 | + WIN_ROOT="/c/Windows" | ||
| 53 | +fi | ||
| 54 | + | ||
| 55 | +export LANG=C | ||
| 56 | + | ||
| 57 | +prepare() { | ||
| 58 | + rm -fr "${buildroot}" | ||
| 59 | + mkdir -p "${buildroot}" | ||
| 60 | +} | ||
| 61 | + | ||
| 62 | +install_bin() { | ||
| 63 | + | ||
| 64 | + mkdir -p "${bindir}" | ||
| 65 | + | ||
| 66 | + AGAIN=1 | ||
| 67 | + until [ $AGAIN = 0 ]; do | ||
| 68 | + | ||
| 69 | + SOURCES=$(mktemp) | ||
| 70 | + REQUIRES=$(mktemp) | ||
| 71 | + | ||
| 72 | + find "${buildroot}" -iname "*.dll" > ${SOURCES} | ||
| 73 | + find "${buildroot}" -iname "*.exe" >> ${SOURCES} | ||
| 74 | + | ||
| 75 | + while read FILENAME | ||
| 76 | + do | ||
| 77 | + objdump -p ${FILENAME} | grep "DLL Name:" | cut -d: -f2 | tr "[:upper:]" "[:lower:]" >> ${REQUIRES} | ||
| 78 | + done < ${SOURCES} | ||
| 79 | + | ||
| 80 | + libs_to_exclude=" | ||
| 81 | + advapi32 | ||
| 82 | + cfgmgr32 | ||
| 83 | + comctl32 | ||
| 84 | + comdlg32 | ||
| 85 | + crypt32 | ||
| 86 | + d3d8 | ||
| 87 | + d3d9 | ||
| 88 | + ddraw | ||
| 89 | + dnsapi | ||
| 90 | + dsound | ||
| 91 | + dwmapi | ||
| 92 | + gdi32 | ||
| 93 | + gdiplus | ||
| 94 | + glu32 | ||
| 95 | + glut32 | ||
| 96 | + imm32 | ||
| 97 | + iphlpapi | ||
| 98 | + kernel32 | ||
| 99 | + ksuser | ||
| 100 | + mpr | ||
| 101 | + mscms | ||
| 102 | + mscoree | ||
| 103 | + msimg32 | ||
| 104 | + msvcr71 | ||
| 105 | + msvcr80 | ||
| 106 | + msvcr90 | ||
| 107 | + msvcrt | ||
| 108 | + mswsock | ||
| 109 | + netapi32 | ||
| 110 | + odbc32 | ||
| 111 | + ole32 | ||
| 112 | + oleacc | ||
| 113 | + oleaut32 | ||
| 114 | + opengl32 | ||
| 115 | + psapi | ||
| 116 | + rpcrt4 | ||
| 117 | + secur32 | ||
| 118 | + setupapi | ||
| 119 | + shell32 | ||
| 120 | + shlwapi | ||
| 121 | + user32 | ||
| 122 | + usp10 | ||
| 123 | + version | ||
| 124 | + wininet | ||
| 125 | + winmm | ||
| 126 | + wldap32 | ||
| 127 | + ws2_32 | ||
| 128 | + wsock32 | ||
| 129 | + winspool.drv | ||
| 130 | + ntdll | ||
| 131 | + winhttp | ||
| 132 | + hid | ||
| 133 | + " | ||
| 134 | + | ||
| 135 | + # Remove system DLLs from list | ||
| 136 | + for i in $libs_to_exclude; do | ||
| 137 | + sed -i -e "/${i}/d" ${REQUIRES} | ||
| 138 | + done | ||
| 139 | + | ||
| 140 | + AGAIN=0 | ||
| 141 | + while read FILENAME | ||
| 142 | + do | ||
| 143 | + | ||
| 144 | + if [ ! -e "${bindir}/${FILENAME}" ]; then | ||
| 145 | + | ||
| 146 | + if [ -e ${MINGW_PREFIX}/bin/${FILENAME} ]; then | ||
| 147 | + | ||
| 148 | + AGAIN=1 | ||
| 149 | + cp -v "${MINGW_PREFIX}/bin/${FILENAME}" "${bindir}/${FILENAME}" | ||
| 150 | + if [ "$?" != "0" ]; then | ||
| 151 | + exit -1 | ||
| 152 | + fi | ||
| 153 | + | ||
| 154 | + elif [ -e ${MINGW_PREFIX}/lib/${FILENAME} ]; then | ||
| 155 | + | ||
| 156 | + AGAIN=1 | ||
| 157 | + cp -v "${MINGW_PREFIX}/lib/${FILENAME}" "${bindir}/${FILENAME}" | ||
| 158 | + if [ "$?" != "0" ]; then | ||
| 159 | + exit -1 | ||
| 160 | + fi | ||
| 161 | + | ||
| 162 | + elif [ -e "${WIN_ROOT}/System32/${FILENAME}" ]; then | ||
| 163 | + | ||
| 164 | + echo "Ignoring ${WIN_ROOT}/System32/${FILENAME}" | ||
| 165 | + | ||
| 166 | + else | ||
| 167 | + | ||
| 168 | + echo "Can't find ${MINGW_PREFIX}/bin/${FILENAME} or ${WIN_ROOT}/System32/${FILENAME}" | ||
| 169 | + find "${MINGW_PREFIX}" -iname "${FILENAME}" | ||
| 170 | + exit -1 | ||
| 171 | + | ||
| 172 | + fi | ||
| 173 | + | ||
| 174 | + fi | ||
| 175 | + | ||
| 176 | + done < ${REQUIRES} | ||
| 177 | + | ||
| 178 | + rm -f ${SOURCES} | ||
| 179 | + rm -f ${REQUIRES} | ||
| 180 | + | ||
| 181 | + done | ||
| 182 | + | ||
| 183 | +} | ||
| 184 | + | ||
| 185 | +install_locale() { | ||
| 186 | + | ||
| 187 | + mkdir -p ${buildroot}${MINGW_PREFIX}/share/locale/pt_BR/LC_MESSAGES | ||
| 188 | + | ||
| 189 | + locales=" | ||
| 190 | + gettext-runtime.mo | ||
| 191 | + gettext-tools.mo | ||
| 192 | + glib20.mo | ||
| 193 | + gtk30.mo | ||
| 194 | + gtk30-properties.mo | ||
| 195 | + " | ||
| 196 | + | ||
| 197 | + FILENAMES=$(mktemp) | ||
| 198 | + for i in ${locales} | ||
| 199 | + do | ||
| 200 | + find "${MINGW_PREFIX}/share/locale" -name ${i} >> ${FILENAMES} | ||
| 201 | + done | ||
| 202 | + | ||
| 203 | + while read FILENAME | ||
| 204 | + do | ||
| 205 | + mkdir -p $(dirname "${buildroot}${FILENAME}") | ||
| 206 | + cp -v "${FILENAME}" "${buildroot}${FILENAME}" | ||
| 207 | + if [ "$?" != "0" ]; then | ||
| 208 | + exit -1 | ||
| 209 | + fi | ||
| 210 | + done < ${FILENAMES} | ||
| 211 | + rm -f ${FILENAMES} | ||
| 212 | +} | ||
| 213 | + | ||
| 214 | +install_schemas() { | ||
| 215 | + | ||
| 216 | + mkdir -p ${buildroot}${MINGW_PREFIX}/share/glib-2.0/schemas | ||
| 217 | + | ||
| 218 | + schemas=" | ||
| 219 | + org.gtk.Settings.FileChooser.gschema.xml | ||
| 220 | + gschema.dtd | ||
| 221 | + " | ||
| 222 | + | ||
| 223 | + for schema in ${schemas} | ||
| 224 | + do | ||
| 225 | + cp -v "${MINGW_PREFIX}/share/glib-2.0/schemas/${schema}" "${buildroot}${MINGW_PREFIX}/share/glib-2.0/schemas" | ||
| 226 | + if [ "$?" != "0" ]; then | ||
| 227 | + exit -1 | ||
| 228 | + fi | ||
| 229 | + done | ||
| 230 | + | ||
| 231 | + glib-compile-schemas \ | ||
| 232 | + --targetdir="${buildroot}${MINGW_PREFIX}/share/glib-2.0/schemas" \ | ||
| 233 | + "${buildroot}${MINGW_PREFIX}/share/glib-2.0/schemas" | ||
| 234 | + | ||
| 235 | + if [ "$?" != "0" ]; then | ||
| 236 | + exit -1 | ||
| 237 | + fi | ||
| 238 | +} | ||
| 239 | + | ||
| 240 | +install_theme() { | ||
| 241 | + | ||
| 242 | + mkdir -p "${buildroot}${MINGW_PREFIX}/etc" | ||
| 243 | + cp -rv "${MINGW_PREFIX}/etc/gtk-3.0" "${buildroot}${MINGW_PREFIX}/etc" | ||
| 244 | + if [ "$?" != "0" ]; then | ||
| 245 | + exit -1 | ||
| 246 | + fi | ||
| 247 | + | ||
| 248 | + # https://stackoverflow.com/questions/37035936/how-to-get-native-windows-decorations-on-gtk3-on-windows-7-and-msys2 | ||
| 249 | + mkdir -p ${buildroot}${MINGW_PREFIX}/etc/gtk-3.0 | ||
| 250 | + rm -f ${buildroot}${MINGW_PREFIX}/etc/gtk-3.0/settings.ini | ||
| 251 | + rm -f ${buildroot}${MINGW_PREFIX}/etc/gtk-3.0/gtkrc | ||
| 252 | + | ||
| 253 | + echo "[Settings]" > ${buildroot}${MINGW_PREFIX}/etc/gtk-3.0/settings.ini | ||
| 254 | + echo "gtk-theme-name=${1}" >> ${buildroot}${MINGW_PREFIX}/etc/gtk-3.0/settings.ini | ||
| 255 | + | ||
| 256 | + if [ -e "${srcdir}/win/gtk.css" ]; then | ||
| 257 | + mkdir -p "${buildroot}${MINGW_PREFIX}/share/themes/Default/gtk-3.0" | ||
| 258 | + cp "${srcdir}/win/gtk.css" "${buildroot}${MINGW_PREFIX}/share/themes/Default/gtk-3.0/gtk.css" | ||
| 259 | + fi | ||
| 260 | + | ||
| 261 | +} | ||
| 262 | + | ||
| 263 | +install_icons() { | ||
| 264 | + | ||
| 265 | + mkdir -p "${buildroot}${MINGW_PREFIX}/share/icons" | ||
| 266 | + | ||
| 267 | + if [ -d "${MINGW_PREFIX}/share/icons/${1}" ]; then | ||
| 268 | + | ||
| 269 | + cp -rv "${MINGW_PREFIX}/share/icons/${1}" "${buildroot}${MINGW_PREFIX}/share/icons" | ||
| 270 | + if [ "$?" != 0 ]; then | ||
| 271 | + echo "Can´t copy ${1} icons" | ||
| 272 | + exit -1 | ||
| 273 | + fi | ||
| 274 | + | ||
| 275 | + elif [ -d "/usr/share/icons/${1}" ]; then | ||
| 276 | + | ||
| 277 | + cp -rv "/usr/share/icons/${1}" "${buildroot}${MINGW_PREFIX}/share/icons" | ||
| 278 | + if [ "$?" != 0 ]; then | ||
| 279 | + echo "Can´t copy ${1} icons" | ||
| 280 | + exit -1 | ||
| 281 | + fi | ||
| 282 | + | ||
| 283 | + else | ||
| 284 | + | ||
| 285 | + echo "Can´t find ${1} icons" | ||
| 286 | + exit -1 | ||
| 287 | + | ||
| 288 | + fi | ||
| 289 | + | ||
| 290 | +} | ||
| 291 | + | ||
| 292 | +install_loaders() { | ||
| 293 | + | ||
| 294 | + if [ -d "${MINGW_PREFIX}${GDK_LOADERS}" ]; then | ||
| 295 | + mkdir -p "${buildroot}/${MINGW_PREFIX}${GDK_LOADERS}" | ||
| 296 | + cp -rv ${MINGW_PREFIX}${GDK_LOADERS}/* "${buildroot}/${MINGW_PREFIX}${GDK_LOADERS}" | ||
| 297 | + if [ "$?" != "0" ]; then | ||
| 298 | + exit -1 | ||
| 299 | + fi | ||
| 300 | + | ||
| 301 | + find ${buildroot}/${MINGW_PREFIX}${GDK_LOADERS} -iname "*.a" -exec rm -f {} \; | ||
| 302 | + | ||
| 303 | + fi | ||
| 304 | + | ||
| 305 | +} | ||
| 306 | + |
| @@ -0,0 +1,50 @@ | @@ -0,0 +1,50 @@ | ||
| 1 | +#!/bin/bash | ||
| 2 | +# | ||
| 3 | +# SPDX-License-Identifier: LGPL-3.0-or-later | ||
| 4 | +# | ||
| 5 | +# Copyright (C) 2021 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 | +prepare | ||
| 32 | + | ||
| 33 | +for package in ${srcdir}/*.pkg.tar.zst | ||
| 34 | +do | ||
| 35 | + echo ${package} | ||
| 36 | + tar -C ${buildroot} --zstd -xf ${package} | ||
| 37 | + if [ "$?" != "0" ]; then | ||
| 38 | + echo "Error unpacking ${package}" | ||
| 39 | + exit -1 | ||
| 40 | + fi | ||
| 41 | +done | ||
| 42 | + | ||
| 43 | +install_loaders | ||
| 44 | +install_bin | ||
| 45 | +install_locale | ||
| 46 | +install_schemas | ||
| 47 | +install_theme "Adwaita" | ||
| 48 | +install_icons "Adwaita" | ||
| 49 | + | ||
| 50 | + |