packages: use Python helper functions

This commit is contained in:
MilhouseVH 2019-10-24 22:51:28 +01:00
parent fcfee6ff42
commit 1b58564ead
9 changed files with 16 additions and 11 deletions

View File

@ -128,8 +128,7 @@ post_makeinstall_target() {
rm -rf $INSTALL/usr/bin/python*-config
rm -rf $INSTALL/usr/bin/smtpd.py $INSTALL/usr/bin/smtpd.py.*
$TOOLCHAIN/bin/python3 -Wi -t -B $TOOLCHAIN/lib/$PKG_PYTHON_VERSION/compileall.py -d ${PKG_INSTALL_PATH_LIB#${INSTALL}} -b -f $PKG_INSTALL_PATH_LIB
find $PKG_INSTALL_PATH_LIB -name "*.py" -exec rm -f {} \; &>/dev/null
python_compile $PKG_INSTALL_PATH_LIB
# strip
chmod u+w $INSTALL/usr/lib/libpython*.so.*

View File

@ -25,11 +25,9 @@ post_makeinstall_target() {
ADDON_INSTALL_DIR=$INSTALL/usr/share/kodi/addons/service.libreelec.settings
$TOOLCHAIN/bin/python -Wi -t -B $TOOLCHAIN/lib/$PKG_PYTHON_VERSION/compileall.py $ADDON_INSTALL_DIR/resources/lib/ -f
rm -rf $(find $ADDON_INSTALL_DIR/resources/lib/ -name "*.py")
python_compile $ADDON_INSTALL_DIR/resources/lib/
$TOOLCHAIN/bin/python -Wi -t -B $TOOLCHAIN/lib/$PKG_PYTHON_VERSION/compileall.py $ADDON_INSTALL_DIR/oe.py -f
rm -rf $ADDON_INSTALL_DIR/oe.py
python_compile $ADDON_INSTALL_DIR/oe.py
}
post_install() {

View File

@ -352,6 +352,9 @@ post_makeinstall_target() {
cp $PKG_DIR/fonts/*.ttf $INSTALL/usr/share/kodi/media/Fonts
fi
# Compile kodi Python site-packages to .pyc bytecode, and remove .py source code
python_compile $INSTALL/usr/lib/$PKG_PYTHON_VERSION/site-packages/kodi
debug_strip $INSTALL/usr/lib/kodi/kodi.bin
}

View File

@ -19,7 +19,7 @@ pre_configure_target() {
}
post_makeinstall_target() {
find $INSTALL/usr/lib -name "*.py" -exec rm -rf "{}" ";"
python_remove_source
rm -rf $INSTALL/usr/bin
rm -rf $INSTALL/usr/share/pygobject

View File

@ -26,7 +26,7 @@ makeinstall_target() {
}
post_makeinstall_target() {
find $INSTALL/usr/lib -name "*.py" -exec rm -rf "{}" ";"
python_remove_source
rm -rf $INSTALL/usr/bin
}

View File

@ -35,5 +35,5 @@ makeinstall_target() {
}
post_makeinstall_target() {
find $INSTALL/usr/lib -name "*.py" -exec rm -rf "{}" ";"
python_remove_source
}

View File

@ -19,5 +19,5 @@ pre_configure_target() {
}
post_makeinstall_target() {
find $INSTALL/usr/lib -name "*.py" -exec rm -rf "{}" ";"
python_remove_source
}

View File

@ -25,6 +25,7 @@ makeinstall_target() {
}
post_makeinstall_target() {
find $INSTALL/usr/lib -name "*.py" -exec rm -rf "{}" ";"
python_remove_source
rm -rf $INSTALL/usr/lib/python*/site-packages/*/tests
}

View File

@ -10,3 +10,7 @@ PKG_SITE="http://www.X.org"
PKG_URL="http://xcb.freedesktop.org/dist/$PKG_NAME-$PKG_VERSION.tar.bz2"
PKG_DEPENDS_TARGET="toolchain util-macros Python3:host"
PKG_LONGDESC="X C-language Bindings protocol headers."
post_makeinstall_target() {
python_remove_source
}