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
|
SRC="src/tk${TCLVERS}.tar.gz"
SRCURL="http://prdownloads.sourceforge.net/tcl/tk${TCLVERS}-src.tar.gz"
BUILDDIR="$(pwd)/build/tk${TCLVERS}"
PATCHDIR="$(pwd)/patches"
OUTDIR="$(pwd)/out"
INSTDIR="$(pwd)/inst"
export SRC SRCURL BUILDDIR PATCHDIR OUTDIR INSTDIR
rm -rf 'build' 'out' 'inst'
mkdir 'build' 'out' 'inst' || exit 1
# Determine Tcl version
TCL_VERSION="unknown"
if [ -f "${TCLCONFIGDIR}/tclConfig.sh" ]; then
source "${TCLCONFIGDIR}/tclConfig.sh"
fi
export TCL_VERSION
if [ ! -f "${SRC}" ]; then
mkdir 'src' >/dev/null 2>/dev/null
if echo "${TCLVERS}" | grep '^cvs_' >/dev/null; then
CVSTAG=$(echo "${TCLVERS}" | sed 's/^cvs_//g')
export CVSTAG
(
cd src || exit 1
cvs -z3 -d:pserver:anonymous@tcl.cvs.sourceforge.net:/cvsroot/tktoolkit co -r "${CVSTAG}" -P tk
mv tk "tk${TCLVERS}"
tar -cf - "tk${TCLVERS}" | gzip -c > "../${SRC}"
)
else
rm -f "${SRC}.tmp"
wget -O "${SRC}.tmp" "${SRCURL}" || exit 1
mv "${SRC}.tmp" "${SRC}"
fi
fi
|
>
|
>
>
>
>
>
|
>
>
>
>
>
|
|
|
>
>
>
|
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
|
SRC="src/tk${TCLVERS}.tar.gz"
SRCURL="http://prdownloads.sourceforge.net/tcl/tk${TCLVERS}-src.tar.gz"
BUILDDIR="$(pwd)/build/tk${TCLVERS}"
PATCHDIR="$(pwd)/patches"
OUTDIR="$(pwd)/out"
INSTDIR="$(pwd)/inst"
PATCHSCRIPTDIR="$(pwd)/patchscripts"
export SRC SRCURL BUILDDIR PATCHDIR OUTDIR INSTDIR PATCHSCRIPTDIR
rm -rf 'build' 'out' 'inst'
mkdir 'build' 'out' 'inst' || exit 1
# Determine Tcl version
TCL_VERSION="unknown"
if [ -f "${TCLCONFIGDIR}/tclConfig.sh" ]; then
source "${TCLCONFIGDIR}/tclConfig.sh"
fi
export TCL_VERSION
if [ ! -f "${SRC}" ]; then
mkdir 'src' >/dev/null 2>/dev/null
if echo "${TCLVERS}" | grep '^cvs_' >/dev/null; then
CVSTAG=$(echo "${TCLVERS}" | sed 's/^cvs_//g')
if [ "${CVSTAG}" = "HEAD" ]; then
CVSTAG="trunk"
fi
export CVSTAG
(
cd src || exit 1
workdir="tmp-$$${RANDOM}${RANDOM}${RANDOM}"
rm -rf "${workdir}"
mkdir "${workdir}" || exit 1
cd "${workdir}" || exit 1
wget -O "tmp-tk.tar.gz" "http://core.tcl.tk/tk/tarball/tk-${CVSTAG}.tar.gz?uuid=${CVSTAG}" || rm -f 'tmp-tk.tar.gz'
gzip -dc "tmp-tk.tar.gz" | tar -xf -
mv "tk-${CVSTAG}" "tk${TCLVERS}"
tar -cf - "tk${TCLVERS}" | gzip -c > "../../${SRC}"
cd ..
rm -rf "${workdir}"
)
else
rm -f "${SRC}.tmp"
wget -O "${SRC}.tmp" "${SRCURL}" || exit 1
mv "${SRC}.tmp" "${SRC}"
fi
fi
|
82
83
84
85
86
87
88
89
90
91
92
93
94
95
|
continue
fi
echo "Applying: ${patch}"
${PATCH:-patch} -p1 < "${patch}"
done
)
for dir in unix win macosx win64 __fail__; do
if [ "${dir}" = "__fail__" ]; then
exit 1
fi
# Windows/amd64 workarounds
|
>
>
>
>
>
>
>
>
>
>
>
|
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
|
continue
fi
echo "Applying: ${patch}"
${PATCH:-patch} -p1 < "${patch}"
done
)
# Apply patch scripts if needed
for patchscript in "${PATCHSCRIPTDIR}"/*.sh; do
if [ -f "${patchscript}" ]; then
echo "Running patch script: ${patchscript}"
(
. "${patchscript}"
)
fi
done
for dir in unix win macosx win64 __fail__; do
if [ "${dir}" = "__fail__" ]; then
exit 1
fi
# Windows/amd64 workarounds
|
139
140
141
142
143
144
145
146
147
148
149
150
151
152
|
) || continue
echo "Running: ${MAKE:-make} install"
${MAKE:-make} install || continue
# Update to include resources, if found
if [ "${dir}" = "win" ]; then
echo ' *** Creating tkbase.res.o to support Windows build'
echo "\"${RC:-windres}\" -o tkbase.res.o --define STATIC_BUILD --include \"./../generic\" --include \"${TCLCONFIGDIR}/../generic\" --include \"${TCLCONFIGDIR}\" --include \"./rc\" \"./rc/tk_base.rc\""
"${RC:-windres}" -o tkbase.res.o --define STATIC_BUILD --include "./../generic" --include "${TCLCONFIGDIR}/../generic" --include "${TCLCONFIGDIR}" --include "./rc" "./rc/tk_base.rc"
if [ -f "tkbase.res.o" ]; then
cp "tkbase.res.o" "${INSTDIR}/lib/"
fi
|
>
>
>
>
>
>
|
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
|
) || continue
echo "Running: ${MAKE:-make} install"
${MAKE:-make} install || continue
# Update to include resources, if found
if [ "${dir}" = "win" ]; then
echo ' *** Importing user-specified icon'
cp "${KITCREATOR_ICON}" rc/tk.ico
echo ' *** Importing user-specified resources'
cat "${KITCREATOR_RC}" | grep -v '^ *tclsh *ICON' >> "./rc/tk_base.rc"
echo ' *** Creating tkbase.res.o to support Windows build'
echo "\"${RC:-windres}\" -o tkbase.res.o --define STATIC_BUILD --include \"./../generic\" --include \"${TCLCONFIGDIR}/../generic\" --include \"${TCLCONFIGDIR}\" --include \"./rc\" \"./rc/tk_base.rc\""
"${RC:-windres}" -o tkbase.res.o --define STATIC_BUILD --include "./../generic" --include "${TCLCONFIGDIR}/../generic" --include "${TCLCONFIGDIR}" --include "./rc" "./rc/tk_base.rc"
if [ -f "tkbase.res.o" ]; then
cp "tkbase.res.o" "${INSTDIR}/lib/"
fi
|