Files
MINGW-packages/mingw-w64-libxml2/libxml2-i686.install

35 lines
749 B
Plaintext

PYTHON_SITELIB=/mingw32/lib/python2.7/site-packages
PYTHON_LIB=/mingw32/lib/python2.7
python_optimize() {
local pyd
for pyd in "${@:-${PYTHON_SITELIB}}"
do
if [ ! -d ${D}${pyd} ]
then
echo "Error: directory ${pyd} does not exist"
fi
echo "Compiling ${pyd}..."
mingw32/bin/python2 ${PYTHON_LIB}/compileall.py -f -q -d ${pyd} ${D}${pyd}
mingw32/bin/python2 -OO ${PYTHON_LIB}/compileall.py -f -q -d ${pyd} ${D}${pyd}
done
}
post_install() {
if test ! -f mingw32/etc/xml/catalog; then
bin/mkdir -p mingw32/etc/xml
mingw32/bin/xmlcatalog --noout --create mingw32/etc/xml/catalog
fi
if test -f mingw32/bin/python2.exe; then
python_optimize
rm -f ${PYTHON_SITELIB}/*.a
fi
}
post_upgrade() {
post_install
}