240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
|
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
|
-
+
+
-
+
+
+
+
+
+
|
# If we are building statically, don't create a
# pkgIndex.tcl
rm -f "${INSTDIR}"/lib/tk*/pkgIndex.tcl
else
# Update pkgIndex to load libtk from the local directory rather
# than the parent directory
for pkgIndex in "${INSTDIR}"/lib/tk*/pkgIndex.tcl; do
sed 's@ \.\. @ @g' "${pkgIndex}" > "${pkgIndex}.new"
sed 's@ \.\. bin @ @g;s@ \.\. @ @;s@ lib\(tk.*\.dll\)@ \1@' "${pkgIndex}" > "${pkgIndex}.new"
mv "${pkgIndex}.new" "${pkgIndex}"
done
fi
mkdir "${OUTDIR}/lib" || exit 1
cp -r "${INSTDIR}/lib"/tk* "${OUTDIR}/lib/"
cp -r "${INSTDIR}/bin"/tk*.dll "${OUTDIR}/lib/"/tk*/
cp -r "${INSTDIR}/lib"/libtk* "${OUTDIR}/lib"/tk*/
rm -rf "${OUTDIR}/lib"/tk*/demos
"${STRIP:-strip}" -g "${OUTDIR}"/lib/tk*/*.so >/dev/null 2>/dev/null
"${STRIP:-strip}" -g "${OUTDIR}"/lib/tk*/*.{so,dll,dylib,shlib} >/dev/null 2>/dev/null
find "${OUTDIR}" -type f -name '*.a' | xargs rm -f >/dev/null 2>/dev/null
# If we have a shared object, delete static libraries
if find "${INSTDIR}" -type f '(' -name '*.dll' -o -name '*.so' -o -name '*.dylib' -o -name '*.shlib' ')' 2>/dev/null | grep '^' >/dev/null; then
find "${INSTDIR}" -type f -name '*.a' | grep -v 'stub' | xargs rm -f
fi
break
done
exit 0
) || exit 1
|