bundle.cross
2.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#!/bin/bash
#
# SPDX-License-Identifier: LGPL-3.0-or-later
#
# Copyright (C) 2023 Perry Werneck <perry.werneck@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
#
# References:
#
# https://www.gtk.org/docs/installations/windows/
# http://drup.org/gtk-warning-error-loading-icon-couldnt-recognize-image-file-format
#
MINGW_PREFIX="/usr/x86_64-w64-mingw32/sys-root/mingw"
PKG_CONFIG="/usr/bin/x86_64-w64-mingw32-pkg-config"
MINGW_PACKAGE_PREFIX="mingw64"
REPOSITORY_NAME="pw3270"
# Load bundle functions
. "$(dirname $(readlink -f "${0}"))/bundle.common"
prepare
# List of pre-req packages
# gdk-pixbuf-loader-rsvg
# List of pre-built packages
packages="lib3270 libv3270 libipc3270 libhllapi pw3270-plugin-ipc"
argument "install-requires" > /dev/null
if [ "$?" == "0" ]; then
echo "Installing: ${packages}"
REPONUMBER=$(zypper lr | grep "${REPOSITORY_NAME}" | cut -d\| -f1)
if [ -z "${REPONUMBER}" ]; then
echo "Cant locate repository ${REPOSITORY_NAME}"
exit -1
fi
sudo zypper ref ${REPONUMBER}
if [ "$?" != "0" ]; then
echo "Cant refresh repository ${REPOSITORY_NAME}"
exit -1
fi
for package in ${packages}
do
sudo zypper in --repo ${REPONUMBER} "${MINGW_PACKAGE_PREFIX}-${package}"
if [ "$?" != "0" ]; then
echo "Cant install ${MINGW_PACKAGE_PREFIX}-${package} from ${REPOSITORY_NAME}"
exit -1
fi
done
fi
argument "build" > /dev/null
if [ "$?" == "0" ]; then
# Build
make -C "${srcdir}" all
if [ "$?" != "0" ]; then
echo "Build failed"
exit -1
fi
make -C "${srcdir}" "DESTDIR=${buildroot}" install
if [ "$?" != "0" ]; then
echo "Install failed"
exit -1
fi
else
packages="${packages} pw3270"
fi
unpack_rpm() {
local package
local PACKAGE_NAME
echo "Packages: ${packages}"
for package in ${packages}
do
PACKAGE_NAME=$(rpm -qa | grep "${MINGW_PACKAGE_PREFIX}-${package}" | grep -v devel | head --lines=1)
echo "Copy ${PACKAGE_NAME}"
for FILE in $(rpm -ql "${PACKAGE_NAME}")
do
if [ ! -d ${FILE} ]; then
FILEPATH="${buildroot}${FILE}"
mkdir -p "$(dirname ${FILEPATH})"
if [ "$?" != "0" ]; then
exit -1
fi
cp "${FILE}" "${FILEPATH}"
if [ "$?" != "0" ]; then
echo "Cant copy '${FILE}' from '${PACKAGE_NAME}'"
exit -1
fi
fi
done
done
}
unpack_rpm
install_runtime
make_packages
echo "Bundle build complete"