54
55
56
57
58
59
60
61
62
63
64
65
66
|
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
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
function download_src () {
if [ ! -f "${SRC}" -a -n "${SRC}" -a -n "${SRCURL}" ]; then
mkdir -p "$(dirname "${SRC}")" >/dev/null 2>/dev/null
download "${SRC}" "${SRCURL}" || exit 1
fi
}
function extract_src () {
rm -rf build
mkdir build
(
cd build/ || exit 1
gzip -dc "../${SRC}" | tar -xf -
cd "${BUILDDIR}" || exit 1
) || exit 1
}
function apply_patches () {
local patchroot patchdir patchfiles patchfile idx
patchroot="$(pwd)/patches"
for patchdir in "${patchroot}/all" "${patchroot}/${VERS}"; do
unset patchfiles
if [ -f "${patchdir}/series" ]; then
idx=0
for patchfile in $(cat "${patchdir}/series"); do
patchfiles[${idx}]="${patchdir}/${patchfile}"
idx=$[${idx} + 1]
done
else
patchfiles=("${patchdir}"/*.diff)
fi
for patchfile in "${patchfiles[@]}"; do
if [ ! -f "${patchfile}" ]; then
continue
fi
(
cd "build/${BUILDDIR}" || exit 1
echo "* Applying patch \"${patchfile}\""
"${PATCH:-patch}" -p1 < "${patchfile}"
)
done
done
}
WORKDIR="${TMPDIR:-/tmp}/tcl-buildpkgs-$$${RANDOM}${RANDOM}${RANDOM}"
PLATDIR="$(pwd)/out/${PLATFORM}"
export WORKDIR PLATDIR
setup_tcl84
|