Files
Arch-R/packages/lang/Python3/package.mk

138 lines
5.7 KiB
Makefile
Raw Normal View History

# SPDX-License-Identifier: GPL-2.0
2018-07-16 20:45:36 +02:00
# Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv)
2017-10-08 23:50:38 +01:00
PKG_NAME="Python3"
# When changing PKG_VERSION remember to sync PKG_PYTHON_VERSION!
PKG_VERSION="3.12.10"
PKG_SHA256="07ab697474595e06f06647417d3c7fa97ded07afc1a7e4454c5639919b46eaea"
2017-10-08 23:50:38 +01:00
PKG_LICENSE="OSS"
PKG_SITE="https://www.python.org/"
PKG_URL="https://www.python.org/ftp/python/${PKG_VERSION}/${PKG_NAME::-1}-${PKG_VERSION}.tar.xz"
PKG_DEPENDS_HOST="zlib:host bzip2:host libffi:host util-linux:host autoconf-archive:host openssl:host"
PKG_DEPENDS_TARGET="autotools:host gcc:host Python3:host sqlite expat zlib bzip2 xz openssl libffi readline ncurses util-linux"
2018-10-22 15:06:12 +02:00
PKG_LONGDESC="Python3 is an interpreted object-oriented programming language."
PKG_BUILD_FLAGS="-cfg-libs -cfg-libs:host"
2017-10-24 23:23:02 +02:00
PKG_TOOLCHAIN="autotools"
2017-10-08 23:50:38 +01:00
2024-08-21 22:21:57 +02:00
PKG_PYTHON_VERSION="python3.12"
2017-10-08 23:50:38 +01:00
PKG_CONFIGURE_OPTS_HOST="ac_cv_prog_HAS_HG=/bin/false
ac_cv_prog_SVNVERSION=/bin/false
2024-08-21 22:21:57 +02:00
py_cv_module_unicodedata=yes
py_cv_module__bz2=n/a
2024-08-21 22:21:57 +02:00
py_cv_module__codecs_cn=n/a
py_cv_module__codecs_hk=n/a
py_cv_module__codecs_iso2022=n/a
py_cv_module__codecs_jp=n/a
py_cv_module__codecs_kr=n/a
py_cv_module__codecs_tw=n/a
py_cv_module__decimal=n/a
py_cv_module__lzma=n/a
2024-08-21 22:21:57 +02:00
py_cv_module_nis=n/a
py_cv_module_ossaudiodev=n/a
py_cv_module__dbm=n/a
py_cv_module__gdbm=n/a
2017-10-08 23:50:38 +01:00
--disable-pyc-build
--disable-sqlite3
--without-readline
2017-10-08 23:50:38 +01:00
--disable-tk
--disable-curses
--disable-pydoc
--disable-test-modules
2022-11-10 09:27:22 +00:00
--disable-lib2to3
2017-10-08 23:50:38 +01:00
--disable-idle3
--with-expat=builtin
--with-doc-strings
--without-pymalloc
--with-ensurepip=no
--enable-shared
2017-10-08 23:50:38 +01:00
"
PKG_CONFIGURE_OPTS_TARGET="ac_cv_prog_HAS_HG=/bin/false
ac_cv_prog_SVNVERSION=/bin/false
ac_cv_file__dev_ptmx=no
ac_cv_file__dev_ptc=no
ac_cv_have_long_long_format=yes
ac_cv_working_tzset=yes
ac_cv_func_lchflags_works=no
ac_cv_func_chflags_works=no
ac_cv_func_printf_zd=yes
ac_cv_buggy_getaddrinfo=no
ac_cv_header_bluetooth_bluetooth_h=no
ac_cv_header_bluetooth_h=no
2024-08-21 22:21:57 +02:00
py_cv_module_unicodedata=yes
py_cv_module__codecs_cn=n/a
py_cv_module__codecs_hk=n/a
py_cv_module__codecs_iso2022=n/a
py_cv_module__codecs_jp=n/a
py_cv_module__codecs_kr=n/a
py_cv_module__codecs_tw=n/a
py_cv_module__decimal=n/a
2024-08-21 22:21:57 +02:00
py_cv_module_nis=n/a
py_cv_module_ossaudiodev=n/a
py_cv_module__dbm=n/a
2017-10-08 23:50:38 +01:00
--disable-pyc-build
--enable-sqlite3
--with-readline
2017-10-08 23:50:38 +01:00
--disable-tk
--enable-curses
--disable-pydoc
--disable-test-modules
2022-11-10 09:27:22 +00:00
--disable-lib2to3
2017-10-08 23:50:38 +01:00
--disable-idle3
--with-expat=system
--with-doc-strings
--without-pymalloc
--without-ensurepip
--enable-ipv6
--with-build-python=${TOOLCHAIN}/bin/python
--enable-shared
2017-10-08 23:50:38 +01:00
"
pre_configure_host() {
# control patch Python3-0300-generate-legacy-pyc-bytecode
# this needs to be set when building host based py file
# do not set this for py compiles being done for target use
export DONT_BUILD_LEGACY_PYC=1
}
post_make_host() {
# python distutils per default adds -L${LIBDIR} when linking binary extensions
sed -e "s|^ 'LIBDIR':.*| 'LIBDIR': '/usr/lib',|g" -i $(find ${PKG_BUILD}/.${HOST_NAME} -not -path '*/__pycache__/*' -name '_sysconfigdata__*.py')
2017-10-08 23:50:38 +01:00
}
post_makeinstall_host() {
ln -sf ${PKG_PYTHON_VERSION} ${TOOLCHAIN}/bin/python
rm -fr ${PKG_BUILD}/.${HOST_NAME}/build/temp.*
}
post_make_target() {
# fix sysconfig paths for cross compiling
PKG_SYSCONFIG_FILE=$(find ${PKG_BUILD}/.${TARGET_NAME} -not -path '*/__pycache__/*' -name '_sysconfigdata__*.py')
sed -e "s,\([\'|\ ]\)/usr/include,\1${SYSROOT_PREFIX}/usr/include,g" -i ${PKG_SYSCONFIG_FILE}
sed -e "s,\([\'|\ ]\)/usr/lib,\1${SYSROOT_PREFIX}/usr/lib,g" -i ${PKG_SYSCONFIG_FILE}
}
2017-10-08 23:50:38 +01:00
post_makeinstall_target() {
ln -sf ${PKG_PYTHON_VERSION} ${INSTALL}/usr/bin/python
rm -fr ${PKG_BUILD}/.${TARGET_NAME}/build/temp.*
PKG_INSTALL_PATH_LIB=${INSTALL}/usr/lib/${PKG_PYTHON_VERSION}
2017-10-08 23:50:38 +01:00
2020-01-26 06:05:32 +00:00
for dir in config compiler sysconfigdata lib-dynload/sysconfigdata lib2to3/tests test; do
rm -rf ${PKG_INSTALL_PATH_LIB}/${dir}
2017-10-08 23:50:38 +01:00
done
2024-08-21 22:21:57 +02:00
safe_remove ${INSTALL}/usr/bin/python*-config
2017-10-08 23:50:38 +01:00
find ${INSTALL} -name '*.o' -delete
python_compile ${PKG_INSTALL_PATH_LIB}
2017-10-08 23:50:38 +01:00
# strip
chmod u+w ${INSTALL}/usr/lib/libpython*.so.*
debug_strip ${INSTALL}/usr
2017-10-08 23:50:38 +01:00
}