diff --git a/.github/actions/build.sh b/.github/actions/build.sh index 709d6cb5623..cad54658fb3 100755 --- a/.github/actions/build.sh +++ b/.github/actions/build.sh @@ -61,7 +61,7 @@ if [ -n "$API_KEY" ] && [ "$PUBLISH" == "true" ]; then fi # Build -PACKAGES_TO_KEEP="synocli-videodriver ffmpeg5 ffmpeg7 python310 python311" +PACKAGES_TO_KEEP="synocli-videodriver ffmpeg5 ffmpeg7 python310 python311 python312 python313" for package in ${build_packages} do echo "::group:: ---- build ${package}" diff --git a/.github/actions/prepare.sh b/.github/actions/prepare.sh index 8e940a041f8..696e3c63fe0 100755 --- a/.github/actions/prepare.sh +++ b/.github/actions/prepare.sh @@ -5,9 +5,10 @@ # Evaluate packages to build and referenced source files to download. # # Functions: -# - Evaluate all packages to build depending on files defined in ${GH_FILES}. +# - Build all packages defined by ${USER_SPK_TO_BUILD} and ${GH_SPK_PACKAGES} +# - Evaluate additional packages to build depending on changed folders defined in ${GH_DEPENDENT_PACKAGES}. # - synocli-videodriver is moved to head of packages to build first if triggered by its ffmpeg5-7 -# - python310-311 and ffmpeg5-7 are moved to head of remaining packages to build when triggered by its own or a dependent. +# - python310-313 and ffmpeg5-7 are moved to head of remaining packages to build when triggered by its own or a dependent. # - Referenced native and cross packages of the packages to build are added to the download list. set -o pipefail @@ -18,12 +19,8 @@ echo "::group:: ---- find dependent packages" make setup-synocommunity DEFAULT_TC=$(grep DEFAULT_TC local.mk | cut -f2 -d= | xargs) -# filter for changes made in the spk directories and take unique package name (without spk folder) -SPK_TO_BUILD+=" " -SPK_TO_BUILD+=$(echo "${GH_FILES}" | tr ' ' '\n' | grep -oP "^spk/\K[^\/]*" | sort -u | tr '\n' ' ') - -# filter for changes made in the cross and native directories and take unique package name (including cross or native folder) -DEPENDENT_PACKAGES=$(echo "${GH_FILES}" | tr ' ' '\n' | grep -oP "(cross|native)/[^\/]*" | sort -u | tr '\n' ' ') +# all packages to build from changes or manual definition +SPK_TO_BUILD="${USER_SPK_TO_BUILD} ${GH_SPK_PACKAGES} " # get dependency list # dependencies in this list include the cross or native folder (i.e. native/python cross/glib) @@ -37,20 +34,20 @@ do done # search for dependent spk packages -for package in ${DEPENDENT_PACKAGES} +for package in ${GH_DEPENDENCY_FOLDERS} do echo "===> Searching for dependent package: ${package}" packages=$(echo "${DEPENDENCY_LIST}" | grep " ${package} " | grep -o ".*:" | tr ':' ' ' | sort -u | tr '\n' ' ') echo "===> Found: ${packages}" - SPK_TO_BUILD+=${packages} + SPK_TO_BUILD+=" ${packages}" done # fix for packages with different names -if [ "$(echo ${SPK_TO_BUILD} | grep -ow nzbdrone)" != "" ]; then - SPK_TO_BUILD=$(echo "${SPK_TO_BUILD}" | tr ' ' '\n' | grep -vw "nzbdrone" | tr '\n' ' ')" sonarr3" +if [ "$(echo ${SPK_TO_BUILD} | grep -o ' nzbdrone ')" != "" ]; then + SPK_TO_BUILD=$(echo "${SPK_TO_BUILD}" | tr ' ' '\n' | grep -v "^nzbdrone$" | tr '\n' ' ')" sonarr3" fi -if [ "$(echo ${SPK_TO_BUILD} | grep -ow python)" != "" ]; then - SPK_TO_BUILD=$(echo "${SPK_TO_BUILD}" | tr ' ' '\n' | grep -vw "python" | tr '\n' ' ')" python2" +if [ "$(echo ${SPK_TO_BUILD} | grep -o ' python ')" != "" ]; then + SPK_TO_BUILD=$(echo "${SPK_TO_BUILD}" | tr ' ' '\n' | grep -v "^python$" | tr '\n' ' ')" python2" fi # remove duplicate packages @@ -65,7 +62,7 @@ for i in {5..7}; do for package in ${packages} do if [ "$(echo ffmpeg${i} ${ffmpeg_dependent_packages} | grep -ow ${package})" != "" ]; then - packages_without_ffmpeg=$(echo "${packages}" | tr ' ' '\n' | grep -v "ffmpeg${i}" | tr '\n' ' ') + packages_without_ffmpeg=$(echo "${packages}" | tr ' ' '\n' | grep -v "^ffmpeg${i}\$" | tr '\n' ' ') packages="ffmpeg${i} ${packages_without_ffmpeg}" break fi @@ -80,14 +77,14 @@ videodrv_dependent_packages=$(find spk/ -maxdepth 2 -mindepth 2 -name "Makefile" for package in ${packages} do if [ "$(echo synocli-videodriver ${videodrv_dependent_packages} | grep -ow ${package})" != "" ]; then - packages_without_videodrv=$(echo "${packages}" | tr ' ' '\n' | grep -v "synocli-videodriver" | tr '\n' ' ') + packages_without_videodrv=$(echo "${packages}" | tr ' ' '\n' | grep -v "^synocli-videodriver\$" | tr '\n' ' ') packages="synocli-videodriver ${packages_without_videodrv}" break fi done -# for python (310, 311) find all packages that depend on them -for py in python310 python311; do +# for python (310, 311, 312, 313) find all packages that depend on them +for py in python310 python311 python312 python313; do python_dependent_packages=$(find spk/ -maxdepth 2 -mindepth 2 -name "Makefile" -exec grep -Ho "PYTHON_PACKAGE = ${py}" {} \; | grep -Po ".*spk/\K[^/]*" | sort | tr '\n' ' ') # If packages contain a package that depends on python (or is python), then ensure @@ -95,7 +92,7 @@ for py in python310 python311; do for package in ${packages} do if [ "$(echo ${py} ${python_dependent_packages} | grep -ow ${package})" != "" ]; then - packages_without_python=$(echo "${packages}" | tr ' ' '\n' | grep -v "${py}" | tr '\n' ' ') + packages_without_python=$(echo "${packages}" | tr ' ' '\n' | grep -v "^${py}\$" | tr '\n' ' ') packages="${py} ${packages_without_python}" break fi diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6f393f7ff44..1fd45e5224d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -97,26 +97,31 @@ jobs: fetch-depth: 0 persist-credentials: false - - name: Get changed files for pull request + - name: Get changed spk_packages and dependency_folders for pull request if: github.event_name == 'pull_request' - id: getfile_pr + id: getchanges_pr run: | - git diff --no-commit-id --name-only -r origin/master...${{github.event.pull_request.head.sha}} | xargs - echo "files=$(git diff --no-commit-id --name-only -r origin/master...${{github.event.pull_request.head.sha}} | xargs)" >> $GITHUB_OUTPUT + git diff --no-commit-id --name-only -r origin/master...${{github.event.pull_request.head.sha}} | grep -oP "^spk/\K[^\/]*" | sort -u | xargs + echo "spk_packages=$(git diff --no-commit-id --name-only -r origin/master...${{github.event.pull_request.head.sha}} | grep -oP "^spk/\K[^\/]*" | sort -u | xargs)" >> $GITHUB_OUTPUT + git diff --no-commit-id --name-only -r origin/master...${{github.event.pull_request.head.sha}} | grep -oP "(cross|native)/[^\/]*" | sort -u | xargs + echo "dependency_folders=$(git diff --no-commit-id --name-only -r origin/master...${{github.event.pull_request.head.sha}} | grep -oP "(cross|native)/[^\/]*" | sort -u | xargs)" >> $GITHUB_OUTPUT - - name: Get changed files for push + - name: Get changed spk_packages and dependency_folders of last commit for push if: github.event_name == 'push' - id: getfile + id: getchanges_push run: | - git diff-tree --no-commit-id --name-only -r ${{ github.sha }} | xargs - echo "files=$(git diff-tree --no-commit-id --name-only -r ${{ github.sha }} | xargs)" >> $GITHUB_OUTPUT + git diff-tree --no-commit-id --name-only -r ${{ github.sha }} | grep -oP "^spk/\K[^\/]*" | sort -u | xargs + echo "spk_packages=$(git diff-tree --no-commit-id --name-only -r ${{ github.sha }} | grep -oP "^spk/\K[^\/]*" | sort -u | xargs)" >> $GITHUB_OUTPUT + git diff-tree --no-commit-id --name-only -r ${{ github.sha }} | grep -oP "(cross|native)/[^\/]*" | sort -u | xargs + echo "dependency_folders=$(git diff-tree --no-commit-id --name-only -r ${{ github.sha }} | grep -oP "(cross|native)/[^\/]*" | sort -u | xargs)" >> $GITHUB_OUTPUT - name: Evaluate dependencies id: dependencies run: ./.github/actions/prepare.sh env: - GH_FILES: ${{ steps.getfile.outputs.files }} ${{ steps.getfile_pr.outputs.files }} - SPK_TO_BUILD: ${{ github.event.inputs.package }} + GH_SPK_PACKAGES: ${{ steps.getchanges_push.outputs.spk_packages }} ${{ steps.getchanges_pr.outputs.spk_packages }} + GH_DEPENDENCY_FOLDERS: ${{ steps.getchanges_push.outputs.dependency_folders }} ${{ steps.getchanges_pr.outputs.dependency_folders }} + USER_SPK_TO_BUILD: ${{ github.event.inputs.package }} # Set default values for all builds (manual or automated) - name: Set default values for generate matrix diff --git a/cross/boost_1.82/Makefile b/cross/boost_1.82/Makefile index 75115ab7d30..f6d6d7677af 100644 --- a/cross/boost_1.82/Makefile +++ b/cross/boost_1.82/Makefile @@ -24,7 +24,7 @@ WITH_PYTHON_LIBRARY = ifneq ($(findstring python,$(BOOST_LIBRARIES)),) WITH_PYTHON_LIBRARY = 1 # The packages depending on boost with python, must build python before. -include $(WORK_DIR)/python-cc.mk +include $(WORK_DIR)/crossenv/build/python-cc.mk PYTHON_NAME = $(basename $(notdir $(PYTHON_INTERPRETER))) else ifneq ($(findstring $(BOOST_LIBRARIES), all),) # exclude python library if "all" selected @@ -43,7 +43,7 @@ ADDITIONAL_CXXFLAGS = -Wno-deprecated-declarations ifneq ($(strip $(WITH_PYTHON_LIBRARY)),) CONFIGURE_ARGS += --with-python=$(WORK_DIR)/../../../native/$(PYTHON_NAME)/work-native/install/usr/local/bin/$(PYTHON_NAME) -ADDITIONAL_CXXFLAGS += -I$(STAGING_INSTALL_PREFIX)/$(PYTHON_INC_DIR) -fpermissive +ADDITIONAL_CXXFLAGS += -I$(or $(PYTHON_STAGING_INSTALL_PREFIX),$(STAGING_INSTALL_PREFIX))/$(PYTHON_INC_DIR) -fpermissive endif include ../../mk/spksrc.common.mk @@ -75,7 +75,7 @@ boost_pre_compile: @rm -rf $(WORK_DIR)/$(PKG_DIR)/user-config.jam @echo "using gcc : ${TC_GCC} : ${CXX} : \"$(ADDRESS_MODEL)\" \"$(CFLAGS)\" \"$(CXXFLAGS) $(ADDITIONAL_CXXFLAGS)\" \"$(LDFLAGS)\" \"shared\" ; " > $(WORK_DIR)/$(PKG_DIR)/user-config.jam ifneq ($(strip $(WITH_PYTHON_LIBRARY)),) - @echo "using python : $(PYTHON_VERSION) : : $(STAGING_INSTALL_PREFIX)/$(PYTHON_INC_DIR) ;" >> $(WORK_DIR)/$(PKG_DIR)/user-config.jam + @echo "using python : $(PYTHON_VERSION) : : $(or $(PYTHON_STAGING_INSTALL_PREFIX),$(STAGING_INSTALL_PREFIX))/$(PYTHON_INC_DIR) ;" >> $(WORK_DIR)/$(PKG_DIR)/user-config.jam endif @echo "project : requirements $(OFLAGS) ;" >> $(WORK_DIR)/$(PKG_DIR)/user-config.jam diff --git a/cross/cryptography/Makefile b/cross/cryptography/Makefile index f87252594f6..66a6979501f 100644 --- a/cross/cryptography/Makefile +++ b/cross/cryptography/Makefile @@ -2,20 +2,13 @@ PKG_NAME = cryptography PKG_VERS = 41.0.3 PKG_EXT = tar.gz PKG_DIST_NAME = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT) -PKG_DIST_SITE = https://files.pythonhosted.org/packages/source/c/$(PKG_NAME) +PKG_DIST_SITE = https://files.pythonhosted.org/packages/source/c/cryptography PKG_DIR = $(PKG_NAME)-$(PKG_VERS) -DEPENDS = cross/openssl3 cross/cffi +DEPENDS = cross/openssl3 cross/libffi HOMEPAGE = https://github.com/pyca/cryptography COMMENT = Provide cryptographic recipes and primitives to Python developers LICENSE = BSD/ASL2 -### -### This cross/cryptography is needed to generate python-limited abi3 wheels -### Ref: https://github.com/pyca/cryptography/issues/7671 -### - -WHEELS_BUILD_ARGS = --py-limited-api=$(PYTHON_LIMITED_API) - include ../../mk/spksrc.python-wheel.mk diff --git a/cross/dtlssocket/Makefile b/cross/dtlssocket/Makefile index af1a7a2b2ee..5f55879614f 100644 --- a/cross/dtlssocket/Makefile +++ b/cross/dtlssocket/Makefile @@ -1,18 +1,22 @@ -PKG_NAME = DTLSSocket -PKG_VERS = 0.1.16 +PKG_NAME = dtlssocket +PKG_VERS = 0.2.2 PKG_EXT = tar.gz PKG_DIST_NAME = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT) -PKG_DIST_SITE = https://files.pythonhosted.org/packages/58/42/0a0442118096eb9fbc9dc70b45aee2957f7546b80545e2a05bd839380519 +PKG_DIST_SITE = https://files.pythonhosted.org/packages/97/b6/702c4197c37c7036d0b7d67a2963c83a4b7098525959566dc6e2284c9f89 PKG_DIR = $(PKG_NAME)-$(PKG_VERS) -BUILD_DEPENDS = cross/cython - HOMEPAGE = https://git.fslab.de/jkonra2m/tinydtls-cython COMMENT = DTLSSocket is a Cython wrapper for tinydtls with a Socket like interface. LICENSE = Eclipse Public License 1.0 PRE_CONFIGURE_TARGET = dtlssocket_pre_configure +include ../../mk/spksrc.common.mk + +ifeq ($(call version_le, $(TC_GCC), 5),1) +ADDITIONAL_CFLAGS = -std=c99 +endif + include ../../mk/spksrc.python-wheel.mk .PHONY: dtlssocket_pre_configure diff --git a/cross/dtlssocket/digests b/cross/dtlssocket/digests index 6f1c3b7f1a7..66b25a5b5b8 100644 --- a/cross/dtlssocket/digests +++ b/cross/dtlssocket/digests @@ -1,3 +1,3 @@ -DTLSSocket-0.1.16.tar.gz SHA1 9b4eaa3e9a949f202844a27ba54b2f05d73aa410 -DTLSSocket-0.1.16.tar.gz SHA256 30b108ae45fce1c033e3ef6c2ddd7e7418062ae374228e3a7fa969b254366a39 -DTLSSocket-0.1.16.tar.gz MD5 15dfeca9678e381c7bb6e11e4c864fd5 +dtlssocket-0.2.2.tar.gz SHA1 0be2a954ca56fe7cca3a9fbc5a9e65194f0ab5a5 +dtlssocket-0.2.2.tar.gz SHA256 4e76d715726e0c46dc09e35da9b6717b063c2389b06c1723decc3ba38b7387f4 +dtlssocket-0.2.2.tar.gz MD5 d1f686febd12e67ec7a2efe81bf1eaee diff --git a/cross/mariadb-connector-c/Makefile b/cross/mariadb-connector-c/Makefile index b238ff086b6..511f2b538d3 100644 --- a/cross/mariadb-connector-c/Makefile +++ b/cross/mariadb-connector-c/Makefile @@ -1,5 +1,7 @@ PKG_NAME = mariadb-connector-c -PKG_VERS = 3.3.5 +# Version 3.3.11 is the last known version to work with aarch64-6.2.4 +# Assembly error: Error: CFI instruction used without previous .cfi_startproc +PKG_VERS = 3.3.11 PKG_EXT = tar.gz PKG_DIST_NAME = v$(PKG_VERS).$(PKG_EXT) PKG_DIST_FILE = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT) @@ -10,14 +12,23 @@ HOMEPAGE = https://mariadb.com/kb/en/mariadb-connector-c/ COMMENT = MariaDB C Connector LICENSE = LGPL -#USE_NATIVE_CMAKE_LEGACY = 1 -#CMAKE_USE_TOOLCHAIN_FILE = OFF CMAKE_DISABLE_EXE_LINKER_FLAGS = 1 include ../../mk/spksrc.cross-cmake.mk -ifeq ($(call version_lt, $(TC_GCC), 5.0),1) +ifeq ($(call version_gt, $(TC_GCC), 4.9),1) +ADDITIONAL_CFLAGS += -Wno-error=maybe-uninitialized +# fails on evansport-6.2.4 +ADDITIONAL_CFLAGS += -Wno-error=strict-aliasing +endif + +ifeq ($(call version_lt, $(TC_GCC), 4.9),1) ADDITIONAL_CFLAGS += -std=gnu99 +# fails on 88f6281-6.2.4 +ADDITIONAL_CFLAGS += -Wno-error=missing-field-initializers +ADDITIONAL_CFLAGS += -Wno-error=uninitialized +# fails on hi3535-6.2.4 +ADDITIONAL_CFLAGS += -Wno-error=array-bounds endif # MySQL specific: @@ -25,8 +36,23 @@ CMAKE_ARGS += -DWITH_UNIT_TESTS=OFF CMAKE_ARGS += -DDEFAULT_CHARSET=utf8 CMAKE_ARGS += -DINSTALL_LIBDIR=lib +# Creates the following two synlinks: +# - libmysqlclient.so -> libmariadb.so.3 +# - libmysqlclient_r.so -> libmariadb.so.3 +# Which in turns conflict with mysql-connector-c +#CMAKE_ARGS += -DWITH_MYSQLCOMPAT=ON + +# Does not handle pkgconfig well and fails to +# find openssl3 include and libraries using +# spksrc.python.mk thus using OPENSSL_STAGING_PREFIX DEPENDS += cross/openssl3 CMAKE_ARGS += -DWITH_SSL=ON +ifneq ($(wildcard $(OPENSSL_STAGING_PREFIX)),) +CMAKE_ARGS += -DOPENSSL_CRYPTO_LIBRARY:FILEPATH=$(OPENSSL_STAGING_PREFIX)/lib/libcrypto.so +CMAKE_ARGS += -DOPENSSL_SSL_LIBRARY:FILEPATH=$(OPENSSL_STAGING_PREFIX)/lib/libssl.so +CMAKE_ARGS += -DOPENSSL_INCLUDE_DIR:PATH=$(OPENSSL_STAGING_PREFIX)/include +endif + DEPENDS += cross/zlib CMAKE_ARGS += -DWITH_EXTERNAL_ZLIB=ON DEPENDS += cross/libiconv diff --git a/cross/mariadb-connector-c/digests b/cross/mariadb-connector-c/digests index b1dfa14f61b..9df33d5aa3b 100644 --- a/cross/mariadb-connector-c/digests +++ b/cross/mariadb-connector-c/digests @@ -1,3 +1,3 @@ -mariadb-connector-c-3.3.5.tar.gz SHA1 29ad65e81a87e41a93e8984f2c3d1662dcec7c1c -mariadb-connector-c-3.3.5.tar.gz SHA256 c0fda1fa6e52dc85de27156cd847088a72d40d9de6514f7efa57c8d93134a54c -mariadb-connector-c-3.3.5.tar.gz MD5 b8967cf63d4fc5660f230762c0e39ee2 +mariadb-connector-c-3.3.11.tar.gz SHA1 2fa1fe042bcc65297d6d22196685701faf3e96d1 +mariadb-connector-c-3.3.11.tar.gz SHA256 6ecada1f3fc32ad95efcd2c982b319191f5e6479f3f521bc4b714e6158f5e415 +mariadb-connector-c-3.3.11.tar.gz MD5 700afe8ebff69bdf66b3c37747d1d527 diff --git a/cross/python310/Makefile b/cross/python310/Makefile index ed197df55b5..b90588b4e36 100644 --- a/cross/python310/Makefile +++ b/cross/python310/Makefile @@ -1,12 +1,12 @@ PKG_NAME = python310 -PKG_VERS = 3.10.15 +PKG_VERS = 3.10.16 PKG_VERS_MAJOR_MINOR = $(word 1,$(subst ., ,$(PKG_VERS))).$(word 2,$(subst ., ,$(PKG_VERS))) PKG_EXT = tar.xz PKG_DIST_NAME = Python-$(PKG_VERS).$(PKG_EXT) PKG_DIST_SITE = https://www.python.org/ftp/python/$(PKG_VERS) PKG_DIR = Python-$(PKG_VERS) -BUILD_DEPENDS = native/$(PKG_NAME) +BUILD_DEPENDS = native/python310 DEPENDS = cross/zlib cross/sqlite cross/readline cross/ncursesw cross/bzip2 cross/xz # required for Sleepycat^WOracle Berkeley DB interface @@ -26,25 +26,22 @@ CONFIGURE_ARGS += --enable-ipv6 # installed pip is not on PATH CONFIGURE_ARGS += --without-ensurepip CONFIGURE_ARGS += --enable-loadable-sqlite-extensions -CONFIGURE_ARGS += --with-computed-gotos=yes CONFIGURE_ARGS += --with-build-python +CONFIGURE_ARGS += --with-computed-gotos=yes +CONFIGURE_ARGS += --disable-test-modules include ../../mk/spksrc.archs.mk # optionally generate optimized code ifeq ($(strip $(PYTHON_OPTIMIZE)),1) -CONFIGURE_ARGS += --enable-optimizations -# old compilers fail with unrecognized command line options: -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -ifneq ($(findstring $(ARCH),$(OLD_PPC_ARCHS)),$(ARCH)) -# Some tests (like test_base64) must find libpython shared library at runtime. -# python: error while loading shared libraries: libpython3.10.so.1.0: cannot open shared object file: No such file or directory -ENV += LD_LIBRARY_PATH=$(WORK_DIR)/$(PKG_DIR) +# # Enable Link-Time Optimization CONFIGURE_ARGS += --with-lto -endif -else -# test modules are required for optimization only -CONFIGURE_ARGS += --disable-test-modules +# +# pgo optimization can only be run native platform and now +# exit on errors which had no impact (and effects) previously. +# https://github.com/python/cpython/pull/111950 +#CONFIGURE_ARGS += --enable-optimizations endif # older gcc does not know -Wno-unused-result @@ -70,41 +67,19 @@ CONFIGURE_ARGS += --with-system-expat DEPENDS += cross/libffi CONFIGURE_ARGS += --with-system-ffi -# Mandatory PYO3_* variables for rust cross-compiling -ENV += PYO3_CROSS_LIB_DIR=$(STAGING_INSTALL_PREFIX)/lib/ -ENV += PYO3_CROSS_INCLUDE_DIR=$(STAGING_INSTALL_PREFIX)/include/ -# Mandatory of using OPENSSL_*_DIR starting with -# cryptography version >= 40 -# https://docs.rs/openssl/latest/openssl/#automatic -ENV += OPENSSL_LIB_DIR=$(STAGING_INSTALL_PREFIX)/lib/ -ENV += OPENSSL_INCLUDE_DIR=$(STAGING_INSTALL_PREFIX)/include/ - - ADDITIONAL_CFLAGS = -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -L $(STAGING_INSTALL_PREFIX)/lib -I $(STAGING_INSTALL_PREFIX)/include POST_PATCH_TARGET = python310_post_patch PRE_CONFIGURE_TARGET = python310_pre_configure COMPILE_TARGET = python310_compile INSTALL_TARGET = python310_install -POST_INSTALL_TARGET = python310_post_install include ../../mk/spksrc.cross-cc.mk -HOST_ARCH = $(shell uname -m) -BUILD_ARCH = $(shell expr "$(TC_TARGET)" : '\([^-]*\)' ) -PYTHON_NATIVE = $(WORK_DIR)/../../../native/$(PKG_NAME)/work-native/install/usr/local/bin/python3 -PIP_NATIVE = $(WORK_DIR)/../../../native/$(PKG_NAME)/work-native/install/usr/local/bin/pip +PYTHON_NATIVE = $(abspath $(WORK_DIR)/../../../native/$(PKG_NAME)/work-native/install/usr/local/bin/python$(PKG_VERS_MAJOR_MINOR)) HOSTPYTHON = $(WORK_DIR)/$(PKG_DIR)/hostpython -HOSTPYTHON_LIB_NATIVE = $(WORK_DIR)/../../../native/$(PKG_NAME)/work-native/$(PKG_DIR)/build/lib.linux-$(HOST_ARCH)-$(PKG_VERS_MAJOR_MINOR) -PYTHON_LIB_NATIVE = $(WORK_DIR)/$(PKG_DIR)/build/lib.linux-$(HOST_ARCH)-$(PKG_VERS_MAJOR_MINOR) -PYTHON_SITE_PACKAGES_NATIVE = $(WORK_DIR)/../../../native/$(PKG_NAME)/work-native/install/usr/local/lib/python$(PKG_VERS_MAJOR_MINOR)/site-packages -PYTHON_LIB_CROSS = $(WORK_DIR)/$(PKG_DIR)/build/lib.linux-$(BUILD_ARCH)-$(PKG_VERS_MAJOR_MINOR) -PYTHON_LIB_DIR = lib/python$(PKG_VERS_MAJOR_MINOR) -PYTHON_INC_DIR = include/python$(PKG_VERS_MAJOR_MINOR) - -# Required so that the python3 binaries and libraries generated by native compilation -# take precedence over current environment python3 when generating -# target architecture resources + +# Required to find build-python and to generate-posix-vars PATH := $(WORK_DIR)/../../../native/$(PKG_NAME)/work-native/install/usr/local/bin:$(PATH) LD_LIBRARY_PATH := $(WORK_DIR)/../../../native/$(PKG_NAME)/work-native/install/usr/local/lib:$(LD_LIBRARY_PATH) export PATH LD_LIBRARY_PATH @@ -134,60 +109,3 @@ python310_install: @install -m 755 -d $(STAGING_INSTALL_PREFIX)/etc @install -m 644 src/mime.types $(STAGING_INSTALL_PREFIX)/etc/ $(RUN) _PYTHON_HOST_PLATFORM=$(TC_TARGET) $(MAKE) install prefix=$(STAGING_INSTALL_PREFIX) - -# default wheels to install in crossenv -CROSSENV_WHEELS = cffi==1.17.0 -# -# Cython version >= 3.x breaks PyYAML wheel -# https://github.com/yaml/pyyaml/issues/601 -# -# It also breaks numpy at crossenv creation time using github-action -# https://numpy.org/devdocs/reference/distutils_status_migration.html -# Python 3.12 considerations: scikit-build-core, meson-python -#CROSSENV_WHEELS += Cython==3.0.2 -CROSSENV_WHEELS += Cython==0.29.37 -CROSSENV_WHEELS += flit==3.9.0 -CROSSENV_WHEELS += scikit-build==0.18.1 -CROSSENV_WHEELS += setuptools-rust==1.10.2 -CROSSENV_WHEELS += setuptools-scm==8.1.0 -# For future use when building numpy >= 1.26 -#CROSSENV_WHEELS += meson-python==1.5.2 -#CROSSENV_WHEELS += scikit-build-core==0.10.7 -ifneq ($(findstring $(ARCH),$(OLD_PPC_ARCHS)),$(ARCH)) -CROSSENV_WHEELS += cryptography==43.0.1 -CROSSENV_WHEELS += maturin==1.7.4 -CROSSENV_WHEELS += poetry==1.8.3 -endif - -# Create the crossenv in preparation for -# cross-compiling all the necessary wheels -.PHONY: python310_post_install -python310_post_install: $(WORK_DIR)/python-cc.mk - mkdir -p $(PYTHON_LIB_CROSS) - cp -R $(HOSTPYTHON_LIB_NATIVE) $(PYTHON_LIB_CROSS)/../ - @$(RUN) $(PYTHON_NATIVE) -m crossenv $(STAGING_INSTALL_PREFIX)/bin/python$(PKG_VERS_MAJOR_MINOR) --cc $(TC_PATH)$(TC_PREFIX)gcc --cxx $(TC_PATH)$(TC_PREFIX)c++ --ar $(TC_PATH)$(TC_PREFIX)ar --sysroot $(TC_SYSROOT) --env LIBRARY_PATH= --manylinux manylinux2014 $(WORK_DIR)/crossenv/ - . $(WORK_DIR)/crossenv/bin/activate && $(RUN) wget --no-verbose https://bootstrap.pypa.io/get-pip.py - . $(WORK_DIR)/crossenv/bin/activate && $(RUN) build-python get-pip.py "pip==24.2" --no-setuptools --no-wheel --disable-pip-version-check - . $(WORK_DIR)/crossenv/bin/activate && $(RUN) python get-pip.py "pip==24.2" --no-setuptools --no-wheel --disable-pip-version-check - . $(WORK_DIR)/crossenv/bin/activate && $(RUN) build-pip --disable-pip-version-check install "setuptools==68.1.2" "wheel==0.44.0" "pip-tools==7.4.1" - . $(WORK_DIR)/crossenv/bin/activate && $(RUN) pip --disable-pip-version-check install "setuptools==68.1.2" "wheel==0.44.0" "pip-tools==7.4.1" - . $(WORK_DIR)/crossenv/bin/activate && $(RUN) build-pip --disable-pip-version-check install $(CROSSENV_WHEELS) - . $(WORK_DIR)/crossenv/bin/activate && $(RUN) pip --disable-pip-version-check install $(CROSSENV_WHEELS) -ifneq ($(PYTHON_LIB_NATIVE),$(PYTHON_LIB_CROSS)) - cp $(PYTHON_LIB_CROSS)/_sysconfigdata_*.py $(PYTHON_LIB_NATIVE)/_sysconfigdata.py -endif - -$(WORK_DIR)/python-cc.mk: - @echo HOSTPYTHON=$(HOSTPYTHON) > $@ - @echo CROSSENV=$(WORK_DIR)/crossenv/bin/activate >> $@ - @echo HOSTPYTHON_LIB_NATIVE=$(HOSTPYTHON_LIB_NATIVE) >> $@ - @echo PYTHON_LIB_NATIVE=$(PYTHON_LIB_NATIVE) >> $@ - @echo PYTHON_SITE_PACKAGES_NATIVE=$(PYTHON_SITE_PACKAGES_NATIVE) >> $@ - @echo PYTHON_INTERPRETER=$(INSTALL_PREFIX)/bin/python$(PKG_VERS_MAJOR_MINOR) >> $@ - @echo PYTHON_VERSION=$(PKG_VERS_MAJOR_MINOR) >> $@ - @echo PYTHON_LIB_CROSS=$(PYTHON_LIB_CROSS) >> $@ - @echo PYTHON_LIB_DIR=$(PYTHON_LIB_DIR) >> $@ - @echo PYTHON_INC_DIR=$(PYTHON_INC_DIR) >> $@ - @echo PIP=$(PIP_NATIVE) >> $@ - @echo CROSS_COMPILE_WHEELS=1 >> $@ - @echo ADDITIONAL_WHEEL_BUILD_ARGS=--no-build-isolation >> $@ diff --git a/cross/python310/digests b/cross/python310/digests index 97d74f52750..c916efe4b23 100644 --- a/cross/python310/digests +++ b/cross/python310/digests @@ -1,3 +1,3 @@ -Python-3.10.15.tar.xz SHA1 f498fd8921e3c37e6aded9acb11ed23c8daa0bbe -Python-3.10.15.tar.xz SHA256 aab0950817735172601879872d937c1e4928a57c409ae02369ec3d91dccebe79 -Python-3.10.15.tar.xz MD5 8b1faa1b193e4e90c0f17eb2decd89b5 +Python-3.10.16.tar.xz SHA1 401e6a504a956c8f0aab76c4f3ad9df601a83eb1 +Python-3.10.16.tar.xz SHA256 bfb249609990220491a1b92850a07135ed0831e41738cf681d63cf01b2a8fbd1 +Python-3.10.16.tar.xz MD5 97b3ee1740f32a92905dd0a99dcb04d5 diff --git a/cross/python311/Makefile b/cross/python311/Makefile index 540bae4a5b2..da74f711687 100644 --- a/cross/python311/Makefile +++ b/cross/python311/Makefile @@ -1,5 +1,5 @@ PKG_NAME = python311 -PKG_VERS = 3.11.10 +PKG_VERS = 3.11.11 PKG_VERS_MAJOR_MINOR = $(word 1,$(subst ., ,$(PKG_VERS))).$(word 2,$(subst ., ,$(PKG_VERS))) PKG_EXT = tar.xz PKG_DIST_NAME = Python-$(PKG_VERS).$(PKG_EXT) @@ -11,7 +11,7 @@ PKG_DIR = Python-$(PKG_VERS) # And compiler must support std=c++11 (OlD_PPC_ARCHS fail, but ARMv5_ARCHS have no issue). UNSUPPORTED_ARCHS = $(OLD_PPC_ARCHS) -BUILD_DEPENDS = native/$(PKG_NAME) +BUILD_DEPENDS = native/python311 DEPENDS = cross/zlib cross/sqlite cross/readline cross/ncursesw cross/bzip2 cross/xz # required for Sleepycat^WOracle Berkeley DB interface @@ -32,21 +32,21 @@ CONFIGURE_ARGS += --enable-ipv6 CONFIGURE_ARGS += --without-ensurepip CONFIGURE_ARGS += --enable-loadable-sqlite-extensions CONFIGURE_ARGS += --with-computed-gotos=yes -CONFIGURE_ARGS += --with-build-python +CONFIGURE_ARGS += --with-build-python=$(PYTHON_NATIVE) +CONFIGURE_ARGS += --disable-test-modules include ../../mk/spksrc.archs.mk # optionally generate optimized code ifeq ($(strip $(PYTHON_OPTIMIZE)),1) -CONFIGURE_ARGS += --enable-optimizations -# Some tests (like test_base64) must find libpython shared library at runtime. -# python: error while loading shared libraries: libpython3.11.so.1.0: cannot open shared object file: No such file or directory -ENV += LD_LIBRARY_PATH=$(WORK_DIR)/$(PKG_DIR) +# # Enable Link-Time Optimization CONFIGURE_ARGS += --with-lto -else -# test modules are required for optimization only -CONFIGURE_ARGS += --disable-test-modules +# +# pgo optimization can only be run native platform and now +# exit on errors which had no impact (and effects) previously. +# https://github.com/python/cpython/pull/111950 +#CONFIGURE_ARGS += --enable-optimizations endif CONFIGURE_ARGS += ac_cv_buggy_getaddrinfo=no @@ -67,44 +67,17 @@ CONFIGURE_ARGS += --with-system-expat DEPENDS += cross/libffi CONFIGURE_ARGS += --with-system-ffi -# Mandatory PYO3_* variables for rust cross-compiling -ENV += PYO3_CROSS_LIB_DIR=$(STAGING_INSTALL_PREFIX)/lib/ -ENV += PYO3_CROSS_INCLUDE_DIR=$(STAGING_INSTALL_PREFIX)/include/ -# Mandatory of using OPENSSL_*_DIR starting with -# cryptography version >= 40 -# https://docs.rs/openssl/latest/openssl/#automatic -ENV += OPENSSL_LIB_DIR=$(STAGING_INSTALL_PREFIX)/lib/ -ENV += OPENSSL_INCLUDE_DIR=$(STAGING_INSTALL_PREFIX)/include/ - - ADDITIONAL_CFLAGS = -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -L $(STAGING_INSTALL_PREFIX)/lib -I $(STAGING_INSTALL_PREFIX)/include POST_PATCH_TARGET = python311_post_patch PRE_CONFIGURE_TARGET = python311_pre_configure COMPILE_TARGET = python311_compile INSTALL_TARGET = python311_install -POST_INSTALL_TARGET = python311_post_install include ../../mk/spksrc.cross-cc.mk -HOST_ARCH = $(shell uname -m) -BUILD_ARCH = $(shell expr "$(TC_TARGET)" : '\([^-]*\)' ) -PYTHON_NATIVE = $(WORK_DIR)/../../../native/$(PKG_NAME)/work-native/install/usr/local/bin/python3 -PIP_NATIVE = $(WORK_DIR)/../../../native/$(PKG_NAME)/work-native/install/usr/local/bin/pip +PYTHON_NATIVE = $(abspath $(WORK_DIR)/../../../native/$(PKG_NAME)/work-native/install/usr/local/bin/python$(PKG_VERS_MAJOR_MINOR)) HOSTPYTHON = $(WORK_DIR)/$(PKG_DIR)/hostpython -HOSTPYTHON_LIB_NATIVE = $(WORK_DIR)/../../../native/$(PKG_NAME)/work-native/$(PKG_DIR)/build/lib.linux-$(HOST_ARCH)-$(PKG_VERS_MAJOR_MINOR) -PYTHON_LIB_NATIVE = $(WORK_DIR)/$(PKG_DIR)/build/lib.linux-$(HOST_ARCH)-$(PKG_VERS_MAJOR_MINOR) -PYTHON_SITE_PACKAGES_NATIVE = $(WORK_DIR)/../../../native/$(PKG_NAME)/work-native/install/usr/local/lib/python$(PKG_VERS_MAJOR_MINOR)/site-packages -PYTHON_LIB_CROSS = $(WORK_DIR)/$(PKG_DIR)/build/lib.linux-$(BUILD_ARCH)-$(PKG_VERS_MAJOR_MINOR) -PYTHON_LIB_DIR = lib/python$(PKG_VERS_MAJOR_MINOR) -PYTHON_INC_DIR = include/python$(PKG_VERS_MAJOR_MINOR) - -# Required so that the python3 binaries and libraries generated by native compilation -# take precedence over current environment python3 when generating -# target architecture resources -PATH := $(WORK_DIR)/../../../native/$(PKG_NAME)/work-native/install/usr/local/bin:$(PATH) -LD_LIBRARY_PATH := $(WORK_DIR)/../../../native/$(PKG_NAME)/work-native/install/usr/local/lib:$(LD_LIBRARY_PATH) -export PATH LD_LIBRARY_PATH .PHONY: python311_post_patch python311_post_patch: @@ -131,61 +104,3 @@ python311_install: @install -m 755 -d $(STAGING_INSTALL_PREFIX)/etc @install -m 644 src/mime.types $(STAGING_INSTALL_PREFIX)/etc/ $(RUN) _PYTHON_HOST_PLATFORM=$(TC_TARGET) $(MAKE) install prefix=$(STAGING_INSTALL_PREFIX) - -# default wheels to install in crossenv -CROSSENV_WHEELS = cffi==1.17.1 -CROSSENV_WHEELS += cryptography==43.0.1 -# -# Cython version >= 3.x breaks PyYAML wheel -# https://github.com/yaml/pyyaml/issues/601 -# -# It also breaks numpy at crossenv creation time using github-action -# https://numpy.org/devdocs/reference/distutils_status_migration.html -# Python 3.12 considerations: scikit-build-core, meson-python -#CROSSENV_WHEELS += Cython==3.0.2 -CROSSENV_WHEELS += Cython==0.29.37 -CROSSENV_WHEELS += flit==3.9.0 -CROSSENV_WHEELS += maturin==1.7.4 -CROSSENV_WHEELS += poetry==1.8.3 -CROSSENV_WHEELS += scikit-build==0.18.1 -CROSSENV_WHEELS += setuptools-rust==1.10.2 -CROSSENV_WHEELS += setuptools-scm==8.1.0 -# For future use when building numpy >= 1.26 -#CROSSENV_WHEELS += meson-python==1.5.2 -#CROSSENV_WHEELS += scikit-build-core==0.10.7 -# For pydantic_core==2.23.0: (typing-extensions >=4.6.0,!=4.7.0) -CROSSENV_WHEELS += typing_extensions==4.12.2 - - -# Create the crossenv in preparation for -# cross-compiling all the necessary wheels -.PHONY: python311_post_install -python311_post_install: $(WORK_DIR)/python-cc.mk - mkdir -p $(PYTHON_LIB_CROSS) - cp -R $(HOSTPYTHON_LIB_NATIVE) $(PYTHON_LIB_CROSS)/../ - @$(RUN) $(PYTHON_NATIVE) -m crossenv $(STAGING_INSTALL_PREFIX)/bin/python$(PKG_VERS_MAJOR_MINOR) --cc $(TC_PATH)$(TC_PREFIX)gcc --cxx $(TC_PATH)$(TC_PREFIX)c++ --ar $(TC_PATH)$(TC_PREFIX)ar --sysroot $(TC_SYSROOT) --env LIBRARY_PATH= --manylinux manylinux2014 $(WORK_DIR)/crossenv/ - . $(WORK_DIR)/crossenv/bin/activate && $(RUN) wget --no-verbose https://bootstrap.pypa.io/get-pip.py - . $(WORK_DIR)/crossenv/bin/activate && $(RUN) build-python get-pip.py "pip==24.2" --no-setuptools --no-wheel --disable-pip-version-check - . $(WORK_DIR)/crossenv/bin/activate && $(RUN) python get-pip.py "pip==24.2" --no-setuptools --no-wheel --disable-pip-version-check - . $(WORK_DIR)/crossenv/bin/activate && $(RUN) build-pip --disable-pip-version-check install "setuptools==68.1.2" "wheel==0.44.0" "pip-tools==7.4.1" - . $(WORK_DIR)/crossenv/bin/activate && $(RUN) pip --disable-pip-version-check install "setuptools==68.1.2" "wheel==0.44.0" "pip-tools==7.4.1" - . $(WORK_DIR)/crossenv/bin/activate && $(RUN) build-pip --disable-pip-version-check install $(CROSSENV_WHEELS) - . $(WORK_DIR)/crossenv/bin/activate && $(RUN) pip --disable-pip-version-check install $(CROSSENV_WHEELS) -ifneq ($(PYTHON_LIB_NATIVE),$(PYTHON_LIB_CROSS)) - cp $(PYTHON_LIB_CROSS)/_sysconfigdata_*.py $(PYTHON_LIB_NATIVE)/_sysconfigdata.py -endif - -$(WORK_DIR)/python-cc.mk: - @echo HOSTPYTHON=$(HOSTPYTHON) > $@ - @echo CROSSENV=$(WORK_DIR)/crossenv/bin/activate >> $@ - @echo HOSTPYTHON_LIB_NATIVE=$(HOSTPYTHON_LIB_NATIVE) >> $@ - @echo PYTHON_LIB_NATIVE=$(PYTHON_LIB_NATIVE) >> $@ - @echo PYTHON_SITE_PACKAGES_NATIVE=$(PYTHON_SITE_PACKAGES_NATIVE) >> $@ - @echo PYTHON_INTERPRETER=$(INSTALL_PREFIX)/bin/python$(PKG_VERS_MAJOR_MINOR) >> $@ - @echo PYTHON_VERSION=$(PKG_VERS_MAJOR_MINOR) >> $@ - @echo PYTHON_LIB_CROSS=$(PYTHON_LIB_CROSS) >> $@ - @echo PYTHON_LIB_DIR=$(PYTHON_LIB_DIR) >> $@ - @echo PYTHON_INC_DIR=$(PYTHON_INC_DIR) >> $@ - @echo PIP=$(PIP_NATIVE) >> $@ - @echo CROSS_COMPILE_WHEELS=1 >> $@ - @echo ADDITIONAL_WHEEL_BUILD_ARGS=--no-build-isolation >> $@ diff --git a/cross/python311/digests b/cross/python311/digests index 80952233979..4e023eb4c28 100644 --- a/cross/python311/digests +++ b/cross/python311/digests @@ -1,3 +1,3 @@ -Python-3.11.10.tar.xz SHA1 eb0ee5c84407445809a556592008cfc1867a39bc -Python-3.11.10.tar.xz SHA256 07a4356e912900e61a15cb0949a06c4a05012e213ecd6b4e84d0f67aabbee372 -Python-3.11.10.tar.xz MD5 af59e243df4c7019f941ae51891c10bc +Python-3.11.11.tar.xz SHA1 acf539109b024d3c5f1fc63d6e7f08cd294ba56d +Python-3.11.11.tar.xz SHA256 2a9920c7a0cd236de33644ed980a13cbbc21058bfdc528febb6081575ed73be3 +Python-3.11.11.tar.xz MD5 3e497037b170fe4be5f462c4964596f2 diff --git a/cross/python312/Makefile b/cross/python312/Makefile new file mode 100644 index 00000000000..0a9193237f8 --- /dev/null +++ b/cross/python312/Makefile @@ -0,0 +1,109 @@ +PKG_NAME = python312 +PKG_VERS = 3.12.8 +PKG_VERS_MAJOR_MINOR = $(word 1,$(subst ., ,$(PKG_VERS))).$(word 2,$(subst ., ,$(PKG_VERS))) +PKG_EXT = tar.xz +PKG_DIST_NAME = Python-$(PKG_VERS).$(PKG_EXT) +PKG_DIST_SITE = https://www.python.org/ftp/python/$(PKG_VERS) +PKG_DIR = Python-$(PKG_VERS) + +# Compiler must support std=c++11 +UNSUPPORTED_ARCHS = $(OLD_PPC_ARCHS) $(ARMv5_ARCHS) + +BUILD_DEPENDS = native/python312 + +DEPENDS = cross/zlib cross/sqlite cross/readline cross/ncursesw cross/bzip2 cross/xz +# required for Sleepycat^WOracle Berkeley DB interface +DEPENDS += cross/berkeleydb +# required for uuid module +DEPENDS += cross/libuuid + +HOMEPAGE = https://www.python.org/ +COMMENT = Python Programming Language +LICENSE = PSF + +GNU_CONFIGURE = 1 + +CONFIGURE_ARGS = --enable-shared +CONFIGURE_ARGS += --without-static-libpython +CONFIGURE_ARGS += --enable-ipv6 +# installed pip is not on PATH +CONFIGURE_ARGS += --without-ensurepip +CONFIGURE_ARGS += --enable-loadable-sqlite-extensions +CONFIGURE_ARGS += --with-computed-gotos=yes +CONFIGURE_ARGS += --with-build-python=$(PYTHON_NATIVE) +CONFIGURE_ARGS += --with-readline=readline +CONFIGURE_ARGS += --disable-test-modules + +include ../../mk/spksrc.archs.mk + +# optionally generate optimized code +ifeq ($(strip $(PYTHON_OPTIMIZE)),1) +# +# Enable Link-Time Optimization +CONFIGURE_ARGS += --with-lto +# +# pgo optimization can only be run native platform and now +# exit on errors which had no impact (and effects) previously. +# https://github.com/python/cpython/pull/111950 +#CONFIGURE_ARGS += --enable-optimizations +endif + +ifeq ($(findstring $(ARCH),$(PPC_ARCHS)),$(ARCH)) +# for qoriq +ADDITIONAL_LDFLAGS = -latomic +endif + +CONFIGURE_ARGS += ac_cv_buggy_getaddrinfo=no +CONFIGURE_ARGS += ac_cv_file__dev_ptmx=no +CONFIGURE_ARGS += ac_cv_file__dev_ptc=no +CONFIGURE_ARGS += ac_cv_have_long_long_format=yes + +DEPENDS += cross/openssl3 +CONFIGURE_ARGS += --with-ssl-default-suites=openssl + +DEPENDS += cross/gdbm +CONFIGURE_ARGS += --with-dbmliborder=gdbm:ndbm:bdb + +DEPENDS += cross/libexpat +CONFIGURE_ARGS += --with-system-expat + +# libffi is no longer bundled with python +DEPENDS += cross/libffi + +ADDITIONAL_CFLAGS = -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -L $(STAGING_INSTALL_PREFIX)/lib -I $(STAGING_INSTALL_PREFIX)/include + +POST_PATCH_TARGET = python312_post_patch +PRE_CONFIGURE_TARGET = python312_pre_configure +COMPILE_TARGET = python312_compile +INSTALL_TARGET = python312_install + +include ../../mk/spksrc.cross-cc.mk + +PYTHON_NATIVE = $(abspath $(WORK_DIR)/../../../native/$(PKG_NAME)/work-native/install/usr/local/bin/python$(PKG_VERS_MAJOR_MINOR)) +HOSTPYTHON = $(WORK_DIR)/$(PKG_DIR)/hostpython + +.PHONY: python312_post_patch +python312_post_patch: + $(RUN) sed -e 's#@INSTALL_PREFIX@#$(INSTALL_PREFIX)#' -i Lib/mimetypes.py + +.PHONY: python312_pre_configure +python312_pre_configure: + cp $(PYTHON_NATIVE) $(HOSTPYTHON) + $(RUN) autoreconf -ivf -Werror + # create phantom header and library to succeed add_dir_to_list in setup.py + # so that future-promised libsqlite3.so and sqlite3.h will be used. Yep, + # it's a bit hokey, but avoids editing upstream pristine source + mkdir -p $(STAGING_INSTALL_PREFIX)/lib $(STAGING_INSTALL_PREFIX)/include + mkdir -p $(WORK_DIR)/Python-$(PKG_VERS)/Include $(WORK_DIR)/Python-$(PKG_VERS)/lib + test -h $(WORK_DIR)/Python-$(PKG_VERS)/Include/sqlite3.h || ln -fs $(STAGING_INSTALL_PREFIX)/include/sqlite3.h $(WORK_DIR)/Python-$(PKG_VERS)/Include/sqlite3.h + test -h $(WORK_DIR)/Python-$(PKG_VERS)/lib/libsqlite3.so || ln -fs $(STAGING_INSTALL_PREFIX)/lib/libsqlite3.so $(WORK_DIR)/Python-$(PKG_VERS)/lib/ + +.PHONY: python312_compile +python312_compile: + $(RUN) _PYTHON_HOST_PLATFORM=$(TC_TARGET) $(MAKE) -j $(NCPUS) + +.PHONY: python312_install +python312_install: + @install -m 755 -d $(STAGING_INSTALL_PREFIX)/etc + @install -m 644 src/mime.types $(STAGING_INSTALL_PREFIX)/etc/ + $(RUN) _PYTHON_HOST_PLATFORM=$(TC_TARGET) $(MAKE) install prefix=$(STAGING_INSTALL_PREFIX) diff --git a/cross/python312/PLIST b/cross/python312/PLIST new file mode 100644 index 00000000000..f1dd2f95731 --- /dev/null +++ b/cross/python312/PLIST @@ -0,0 +1,14 @@ +lnk:bin/2to3 +rsc:bin/2to3-3.12 +lnk:bin/idle3 +rsc:bin/idle3.12 +lnk:bin/pydoc3 +rsc:bin/pydoc3.12 +lnk:bin/python3 +bin:bin/python3.12 +rsc:etc/mime.types +rsc:include/python3.12/pyconfig.h +lnk:lib/libpython3.12.so +lib:lib/libpython3.12.so.1.0 +lib:lib/libpython3.so +rsc:lib/python3.12 diff --git a/cross/python312/digests b/cross/python312/digests new file mode 100644 index 00000000000..bbc77569f89 --- /dev/null +++ b/cross/python312/digests @@ -0,0 +1,3 @@ +Python-3.12.8.tar.xz SHA1 8872c7a124c6970833e0bde4f25d6d7d61c6af6e +Python-3.12.8.tar.xz SHA256 c909157bb25ec114e5869124cc2a9c4a4d4c1e957ca4ff553f1edc692101154e +Python-3.12.8.tar.xz MD5 d46e5bf9f2e596a3ba45fc0b3c053dd2 diff --git a/cross/python312/patches/001-mimetypes.patch b/cross/python312/patches/001-mimetypes.patch new file mode 100644 index 00000000000..804b3e1f0b1 --- /dev/null +++ b/cross/python312/patches/001-mimetypes.patch @@ -0,0 +1,26 @@ + +DSM does not have the default mime-type files available, +need to bring our own for the module to work. + +Equivalent of cross/python/patches/004-mimetypes.patch +Added by Diaoul 2013-03-24_23:25:49+0100 + +--- Lib/mimetypes.py.orig 2011-10-16 21:07:51.000000000 +0200 ++++ Lib/mimetypes.py 2011-10-16 21:07:58.000000000 +0200 +@@ -40,15 +40,7 @@ + ] + + knownfiles = [ +- "/etc/mime.types", +- "/etc/httpd/mime.types", # Mac OS X +- "/etc/httpd/conf/mime.types", # Apache +- "/etc/apache/mime.types", # Apache 1 +- "/etc/apache2/mime.types", # Apache 2 +- "/usr/local/etc/httpd/conf/mime.types", +- "/usr/local/lib/netscape/mime.types", +- "/usr/local/etc/httpd/conf/mime.types", # Apache 1.2 +- "/usr/local/etc/mime.types", # Apache 1.3 ++ "@INSTALL_PREFIX@/etc/mime.types", + ] + + inited = False diff --git a/cross/python312/src/mime.types b/cross/python312/src/mime.types new file mode 100644 index 00000000000..893622137dd --- /dev/null +++ b/cross/python312/src/mime.types @@ -0,0 +1,788 @@ +############################################################################### +# +# MIME-TYPES and the extensions that represent them +# +# This file is part of the "mime-support" package. Please send email (not a +# bug report) to mime-support@packages.debian.org if you would like new types +# and/or extensions to be added. +# +# The reason that all types are managed by the mime-support package instead +# allowing individual packages to install types in much the same way as they +# add entries in to the mailcap file is so these types can be referenced by +# other programs (such as a web server) even if the specific support package +# for that type is not installed. +# +# Users can add their own types if they wish by creating a ".mime.types" +# file in their home directory. Definitions included there will take +# precedence over those listed here. +# +# Note: Compression schemes like "gzip", "bzip", and "compress" are not +# actually "mime-types". They are "encodings" and hence must _not_ have +# entries in this file to map their extensions. The "mime-type" of an +# encoded file refers to the type of data that has been encoded, not the +# type of encoding. +# +############################################################################### + + +application/activemessage +application/andrew-inset ez +application/annodex anx +application/applefile +application/atom+xml atom +application/atomcat+xml atomcat +application/atomserv+xml atomsrv +application/atomicmail +application/batch-SMTP +application/beep+xml +application/bbolin lin +application/cals-1840 +application/cap cap pcap +application/commonground +application/cu-seeme cu +application/cybercash +application/davmount+xml davmount +application/dca-rft +application/dec-dx +application/docbook+xml +application/dsptype tsp +application/dvcs +application/ecmascript es +application/edi-consent +application/edi-x12 +application/edifact +application/eshop +application/font-tdpfr +application/futuresplash spl +application/ghostview +application/hta hta +application/http +application/hyperstudio +application/iges +application/index +application/index.cmd +application/index.obj +application/index.response +application/index.vnd +application/iotp +application/ipp +application/isup +application/java-archive jar +application/java-serialized-object ser +application/java-vm class +application/javascript js +application/m3g m3g +application/mac-binhex40 hqx +application/mac-compactpro cpt +application/macwriteii +application/marc +application/mathematica nb nbp +application/ms-tnef +application/msaccess mdb +application/msword doc dot +application/mxf mxf +application/news-message-id +application/news-transmission +application/ocsp-request +application/ocsp-response +application/octet-stream bin +application/oda oda +application/ogg ogx +application/parityfec +application/pdf pdf +application/pgp-encrypted +application/pgp-keys key +application/pgp-signature pgp +application/pics-rules prf +application/pkcs10 +application/pkcs7-mime +application/pkcs7-signature +application/pkix-cert +application/pkix-crl +application/pkixcmp +application/postscript ps ai eps epsi epsf eps2 eps3 +application/prs.alvestrand.titrax-sheet +application/prs.cww +application/prs.nprend +application/qsig +application/rar rar +application/rdf+xml rdf +application/remote-printing +application/riscos +application/rss+xml rss +application/rtf rtf +application/sdp +application/set-payment +application/set-payment-initiation +application/set-registration +application/set-registration-initiation +application/sgml +application/sgml-open-catalog +application/sieve +application/slate +application/smil smi smil +application/timestamp-query +application/timestamp-reply +application/vemmi +application/whoispp-query +application/whoispp-response +application/wita +application/x400-bp +application/xhtml+xml xhtml xht +application/xml xml xsl xsd +application/xml-dtd +application/xml-external-parsed-entity +application/xspf+xml xspf +application/zip zip +application/vnd.3M.Post-it-Notes +application/vnd.accpac.simply.aso +application/vnd.accpac.simply.imp +application/vnd.acucobol +application/vnd.aether.imp +application/vnd.android.package-archive apk +application/vnd.anser-web-certificate-issue-initiation +application/vnd.anser-web-funds-transfer-initiation +application/vnd.audiograph +application/vnd.bmi +application/vnd.businessobjects +application/vnd.canon-cpdl +application/vnd.canon-lips +application/vnd.cinderella cdy +application/vnd.claymore +application/vnd.commerce-battelle +application/vnd.commonspace +application/vnd.comsocaller +application/vnd.contact.cmsg +application/vnd.cosmocaller +application/vnd.ctc-posml +application/vnd.cups-postscript +application/vnd.cups-raster +application/vnd.cups-raw +application/vnd.cybank +application/vnd.dna +application/vnd.dpgraph +application/vnd.dxr +application/vnd.ecdis-update +application/vnd.ecowin.chart +application/vnd.ecowin.filerequest +application/vnd.ecowin.fileupdate +application/vnd.ecowin.series +application/vnd.ecowin.seriesrequest +application/vnd.ecowin.seriesupdate +application/vnd.enliven +application/vnd.epson.esf +application/vnd.epson.msf +application/vnd.epson.quickanime +application/vnd.epson.salt +application/vnd.epson.ssf +application/vnd.ericsson.quickcall +application/vnd.eudora.data +application/vnd.fdf +application/vnd.ffsns +application/vnd.flographit +application/vnd.framemaker +application/vnd.fsc.weblaunch +application/vnd.fujitsu.oasys +application/vnd.fujitsu.oasys2 +application/vnd.fujitsu.oasys3 +application/vnd.fujitsu.oasysgp +application/vnd.fujitsu.oasysprs +application/vnd.fujixerox.ddd +application/vnd.fujixerox.docuworks +application/vnd.fujixerox.docuworks.binder +application/vnd.fut-misnet +application/vnd.google-earth.kml+xml kml +application/vnd.google-earth.kmz kmz +application/vnd.grafeq +application/vnd.groove-account +application/vnd.groove-identity-message +application/vnd.groove-injector +application/vnd.groove-tool-message +application/vnd.groove-tool-template +application/vnd.groove-vcard +application/vnd.hhe.lesson-player +application/vnd.hp-HPGL +application/vnd.hp-PCL +application/vnd.hp-PCLXL +application/vnd.hp-hpid +application/vnd.hp-hps +application/vnd.httphone +application/vnd.hzn-3d-crossword +application/vnd.ibm.MiniPay +application/vnd.ibm.afplinedata +application/vnd.ibm.modcap +application/vnd.informix-visionary +application/vnd.intercon.formnet +application/vnd.intertrust.digibox +application/vnd.intertrust.nncp +application/vnd.intu.qbo +application/vnd.intu.qfx +application/vnd.irepository.package+xml +application/vnd.is-xpr +application/vnd.japannet-directory-service +application/vnd.japannet-jpnstore-wakeup +application/vnd.japannet-payment-wakeup +application/vnd.japannet-registration +application/vnd.japannet-registration-wakeup +application/vnd.japannet-setstore-wakeup +application/vnd.japannet-verification +application/vnd.japannet-verification-wakeup +application/vnd.koan +application/vnd.lotus-1-2-3 +application/vnd.lotus-approach +application/vnd.lotus-freelance +application/vnd.lotus-notes +application/vnd.lotus-organizer +application/vnd.lotus-screencam +application/vnd.lotus-wordpro +application/vnd.mcd +application/vnd.mediastation.cdkey +application/vnd.meridian-slingshot +application/vnd.mif +application/vnd.minisoft-hp3000-save +application/vnd.mitsubishi.misty-guard.trustweb +application/vnd.mobius.daf +application/vnd.mobius.dis +application/vnd.mobius.msl +application/vnd.mobius.plc +application/vnd.mobius.txf +application/vnd.motorola.flexsuite +application/vnd.motorola.flexsuite.adsi +application/vnd.motorola.flexsuite.fis +application/vnd.motorola.flexsuite.gotap +application/vnd.motorola.flexsuite.kmr +application/vnd.motorola.flexsuite.ttc +application/vnd.motorola.flexsuite.wem +application/vnd.mozilla.xul+xml xul +application/vnd.ms-artgalry +application/vnd.ms-asf +application/vnd.ms-excel xls xlb xlt +application/vnd.ms-lrm +application/vnd.ms-pki.seccat cat +application/vnd.ms-pki.stl stl +application/vnd.ms-powerpoint ppt pps +application/vnd.ms-project +application/vnd.ms-tnef +application/vnd.ms-works +application/vnd.mseq +application/vnd.msign +application/vnd.music-niff +application/vnd.musician +application/vnd.netfpx +application/vnd.noblenet-directory +application/vnd.noblenet-sealer +application/vnd.noblenet-web +application/vnd.novadigm.EDM +application/vnd.novadigm.EDX +application/vnd.novadigm.EXT +application/vnd.oasis.opendocument.chart odc +application/vnd.oasis.opendocument.database odb +application/vnd.oasis.opendocument.formula odf +application/vnd.oasis.opendocument.graphics odg +application/vnd.oasis.opendocument.graphics-template otg +application/vnd.oasis.opendocument.image odi +application/vnd.oasis.opendocument.presentation odp +application/vnd.oasis.opendocument.presentation-template otp +application/vnd.oasis.opendocument.spreadsheet ods +application/vnd.oasis.opendocument.spreadsheet-template ots +application/vnd.oasis.opendocument.text odt +application/vnd.oasis.opendocument.text-master odm +application/vnd.oasis.opendocument.text-template ott +application/vnd.oasis.opendocument.text-web oth +application/vnd.osa.netdeploy +application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx +application/vnd.openxmlformats-officedocument.spreadsheetml.template xltx +application/vnd.openxmlformats-officedocument.presentationml.presentation pptx +application/vnd.openxmlformats-officedocument.presentationml.slideshow ppsx +application/vnd.openxmlformats-officedocument.presentationml.template potx +application/vnd.openxmlformats-officedocument.wordprocessingml.document docx +application/vnd.openxmlformats-officedocument.wordprocessingml.template dotx +application/vnd.palm +application/vnd.pg.format +application/vnd.pg.osasli +application/vnd.powerbuilder6 +application/vnd.powerbuilder6-s +application/vnd.powerbuilder7 +application/vnd.powerbuilder7-s +application/vnd.powerbuilder75 +application/vnd.powerbuilder75-s +application/vnd.previewsystems.box +application/vnd.publishare-delta-tree +application/vnd.pvi.ptid1 +application/vnd.pwg-xhtml-print+xml +application/vnd.rapid +application/vnd.rim.cod cod +application/vnd.s3sms +application/vnd.seemail +application/vnd.shana.informed.formdata +application/vnd.shana.informed.formtemplate +application/vnd.shana.informed.interchange +application/vnd.shana.informed.package +application/vnd.smaf mmf +application/vnd.sss-cod +application/vnd.sss-dtf +application/vnd.sss-ntf +application/vnd.stardivision.calc sdc +application/vnd.stardivision.chart sds +application/vnd.stardivision.draw sda +application/vnd.stardivision.impress sdd +application/vnd.stardivision.math sdf +application/vnd.stardivision.writer sdw +application/vnd.stardivision.writer-global sgl +application/vnd.street-stream +application/vnd.sun.xml.calc sxc +application/vnd.sun.xml.calc.template stc +application/vnd.sun.xml.draw sxd +application/vnd.sun.xml.draw.template std +application/vnd.sun.xml.impress sxi +application/vnd.sun.xml.impress.template sti +application/vnd.sun.xml.math sxm +application/vnd.sun.xml.writer sxw +application/vnd.sun.xml.writer.global sxg +application/vnd.sun.xml.writer.template stw +application/vnd.svd +application/vnd.swiftview-ics +application/vnd.symbian.install sis +application/vnd.triscape.mxs +application/vnd.trueapp +application/vnd.truedoc +application/vnd.tve-trigger +application/vnd.ufdl +application/vnd.uplanet.alert +application/vnd.uplanet.alert-wbxml +application/vnd.uplanet.bearer-choice +application/vnd.uplanet.bearer-choice-wbxml +application/vnd.uplanet.cacheop +application/vnd.uplanet.cacheop-wbxml +application/vnd.uplanet.channel +application/vnd.uplanet.channel-wbxml +application/vnd.uplanet.list +application/vnd.uplanet.list-wbxml +application/vnd.uplanet.listcmd +application/vnd.uplanet.listcmd-wbxml +application/vnd.uplanet.signal +application/vnd.vcx +application/vnd.vectorworks +application/vnd.vidsoft.vidconference +application/vnd.visio vsd +application/vnd.vividence.scriptfile +application/vnd.wap.sic +application/vnd.wap.slc +application/vnd.wap.wbxml wbxml +application/vnd.wap.wmlc wmlc +application/vnd.wap.wmlscriptc wmlsc +application/vnd.webturbo +application/vnd.wordperfect wpd +application/vnd.wordperfect5.1 wp5 +application/vnd.wrq-hp3000-labelled +application/vnd.wt.stf +application/vnd.xara +application/vnd.xfdl +application/vnd.yellowriver-custom-menu +application/x-123 wk +application/x-7z-compressed 7z +application/x-abiword abw +application/x-apple-diskimage dmg +application/x-bcpio bcpio +application/x-bittorrent torrent +application/x-cab cab +application/x-cbr cbr +application/x-cbz cbz +application/x-cdf cdf cda +application/x-cdlink vcd +application/x-chess-pgn pgn +application/x-core +application/x-cpio cpio +application/x-csh csh +application/x-debian-package deb udeb +application/x-director dcr dir dxr +application/x-dms dms +application/x-doom wad +application/x-dvi dvi +application/x-httpd-eruby rhtml +application/x-executable +application/x-font pfa pfb gsf pcf pcf.Z +application/x-freemind mm +application/x-futuresplash spl +application/x-gnumeric gnumeric +application/x-go-sgf sgf +application/x-graphing-calculator gcf +application/x-gtar gtar tgz taz +application/x-hdf hdf +application/x-httpd-php phtml pht php +application/x-httpd-php-source phps +application/x-httpd-php3 php3 +application/x-httpd-php3-preprocessed php3p +application/x-httpd-php4 php4 +application/x-httpd-php5 php5 +application/x-ica ica +application/x-info info +application/x-internet-signup ins isp +application/x-iphone iii +application/x-iso9660-image iso +application/x-jam jam +application/x-java-applet +application/x-java-bean +application/x-java-jnlp-file jnlp +application/x-jmol jmz +application/x-kchart chrt +application/x-kdelnk +application/x-killustrator kil +application/x-koan skp skd skt skm +application/x-kpresenter kpr kpt +application/x-kspread ksp +application/x-kword kwd kwt +application/x-latex latex +application/x-lha lha +application/x-lyx lyx +application/x-lzh lzh +application/x-lzx lzx +application/x-maker frm maker frame fm fb book fbdoc +application/x-mif mif +application/x-ms-wmd wmd +application/x-ms-wmz wmz +application/x-msdos-program com exe bat dll +application/x-msi msi +application/x-netcdf nc +application/x-ns-proxy-autoconfig pac dat +application/x-nwc nwc +application/x-object o +application/x-oz-application oza +application/x-pkcs7-certreqresp p7r +application/x-pkcs7-crl crl +application/x-python-code pyc pyo +application/x-qgis qgs shp shx +application/x-quicktimeplayer qtl +application/x-redhat-package-manager rpm +application/x-ruby rb +application/x-rx +application/x-sh sh +application/x-shar shar +application/x-shellscript +application/x-shockwave-flash swf swfl +application/x-silverlight scr +application/x-stuffit sit sitx +application/x-sv4cpio sv4cpio +application/x-sv4crc sv4crc +application/x-tar tar +application/x-tcl tcl +application/x-tex-gf gf +application/x-tex-pk pk +application/x-texinfo texinfo texi +application/x-trash ~ % bak old sik +application/x-troff t tr roff +application/x-troff-man man +application/x-troff-me me +application/x-troff-ms ms +application/x-ustar ustar +application/x-videolan +application/x-wais-source src +application/x-wingz wz +application/x-x509-ca-cert crt +application/x-xcf xcf +application/x-xfig fig +application/x-xpinstall xpi + +audio/32kadpcm +audio/3gpp +audio/amr amr +audio/amr-wb awb +audio/amr amr +audio/amr-wb awb +audio/annodex axa +audio/basic au snd +audio/flac flac +audio/g.722.1 +audio/l16 +audio/midi mid midi kar +audio/mp4a-latm +audio/mpa-robust +audio/mpeg mpga mpega mp2 mp3 m4a +audio/mpegurl m3u +audio/ogg oga ogg spx +audio/parityfec +audio/prs.sid sid +audio/telephone-event +audio/tone +audio/vnd.cisco.nse +audio/vnd.cns.anp1 +audio/vnd.cns.inf1 +audio/vnd.digital-winds +audio/vnd.everad.plj +audio/vnd.lucent.voice +audio/vnd.nortel.vbk +audio/vnd.nuera.ecelp4800 +audio/vnd.nuera.ecelp7470 +audio/vnd.nuera.ecelp9600 +audio/vnd.octel.sbc +audio/vnd.qcelp +audio/vnd.rhetorex.32kadpcm +audio/vnd.vmx.cvsd +audio/x-aiff aif aiff aifc +audio/x-gsm gsm +audio/x-mpegurl m3u +audio/x-ms-wma wma +audio/x-ms-wax wax +audio/x-pn-realaudio-plugin +audio/x-pn-realaudio ra rm ram +audio/x-realaudio ra +audio/x-scpls pls +audio/x-sd2 sd2 +audio/x-wav wav + +chemical/x-alchemy alc +chemical/x-cache cac cache +chemical/x-cache-csf csf +chemical/x-cactvs-binary cbin cascii ctab +chemical/x-cdx cdx +chemical/x-cerius cer +chemical/x-chem3d c3d +chemical/x-chemdraw chm +chemical/x-cif cif +chemical/x-cmdf cmdf +chemical/x-cml cml +chemical/x-compass cpa +chemical/x-crossfire bsd +chemical/x-csml csml csm +chemical/x-ctx ctx +chemical/x-cxf cxf cef +#chemical/x-daylight-smiles smi +chemical/x-embl-dl-nucleotide emb embl +chemical/x-galactic-spc spc +chemical/x-gamess-input inp gam gamin +chemical/x-gaussian-checkpoint fch fchk +chemical/x-gaussian-cube cub +chemical/x-gaussian-input gau gjc gjf +chemical/x-gaussian-log gal +chemical/x-gcg8-sequence gcg +chemical/x-genbank gen +chemical/x-hin hin +chemical/x-isostar istr ist +chemical/x-jcamp-dx jdx dx +chemical/x-kinemage kin +chemical/x-macmolecule mcm +chemical/x-macromodel-input mmd mmod +chemical/x-mdl-molfile mol +chemical/x-mdl-rdfile rd +chemical/x-mdl-rxnfile rxn +chemical/x-mdl-sdfile sd sdf +chemical/x-mdl-tgf tgf +#chemical/x-mif mif +chemical/x-mmcif mcif +chemical/x-mol2 mol2 +chemical/x-molconn-Z b +chemical/x-mopac-graph gpt +chemical/x-mopac-input mop mopcrt mpc zmt +chemical/x-mopac-out moo +chemical/x-mopac-vib mvb +chemical/x-ncbi-asn1 asn +chemical/x-ncbi-asn1-ascii prt ent +chemical/x-ncbi-asn1-binary val aso +chemical/x-ncbi-asn1-spec asn +chemical/x-pdb pdb ent +chemical/x-rosdal ros +chemical/x-swissprot sw +chemical/x-vamas-iso14976 vms +chemical/x-vmd vmd +chemical/x-xtel xtel +chemical/x-xyz xyz + +image/cgm +image/g3fax +image/gif gif +image/ief ief +image/jpeg jpeg jpg jpe +image/naplps +image/pcx pcx +image/png png +image/prs.btif +image/prs.pti +image/svg+xml svg svgz +image/tiff tiff tif +image/vnd.cns.inf2 +image/vnd.djvu djvu djv +image/vnd.dwg +image/vnd.dxf +image/vnd.fastbidsheet +image/vnd.fpx +image/vnd.fst +image/vnd.fujixerox.edmics-mmr +image/vnd.fujixerox.edmics-rlc +image/vnd.mix +image/vnd.net-fpx +image/vnd.svf +image/vnd.wap.wbmp wbmp +image/vnd.xiff +image/x-canon-cr2 cr2 +image/x-canon-crw crw +image/x-cmu-raster ras +image/x-coreldraw cdr +image/x-coreldrawpattern pat +image/x-coreldrawtemplate cdt +image/x-corelphotopaint cpt +image/x-epson-erf erf +image/x-icon ico +image/x-jg art +image/x-jng jng +image/x-ms-bmp bmp +image/x-nikon-nef nef +image/x-olympus-orf orf +image/x-photoshop psd +image/x-portable-anymap pnm +image/x-portable-bitmap pbm +image/x-portable-graymap pgm +image/x-portable-pixmap ppm +image/x-rgb rgb +image/x-xbitmap xbm +image/x-xpixmap xpm +image/x-xwindowdump xwd + +inode/chardevice +inode/blockdevice +inode/directory-locked +inode/directory +inode/fifo +inode/socket + +message/delivery-status +message/disposition-notification +message/external-body +message/http +message/s-http +message/news +message/partial +message/rfc822 eml + +model/iges igs iges +model/mesh msh mesh silo +model/vnd.dwf +model/vnd.flatland.3dml +model/vnd.gdl +model/vnd.gs-gdl +model/vnd.gtw +model/vnd.mts +model/vnd.vtu +model/vrml wrl vrml +model/x3d+vrml x3dv +model/x3d+xml x3d +model/x3d+binary x3db + +multipart/alternative +multipart/appledouble +multipart/byteranges +multipart/digest +multipart/encrypted +multipart/form-data +multipart/header-set +multipart/mixed +multipart/parallel +multipart/related +multipart/report +multipart/signed +multipart/voice-message + +text/cache-manifest manifest +text/calendar ics icz +text/css css +text/csv csv +text/directory +text/english +text/enriched +text/h323 323 +text/html html htm shtml +text/iuls uls +text/mathml mml +text/parityfec +text/plain asc txt text pot brf +text/prs.lines.tag +text/rfc822-headers +text/richtext rtx +text/rtf +text/scriptlet sct wsc +text/t140 +text/texmacs tm ts +text/tab-separated-values tsv +text/uri-list +text/vnd.abc +text/vnd.curl +text/vnd.DMClientScript +text/vnd.flatland.3dml +text/vnd.fly +text/vnd.fmi.flexstor +text/vnd.in3d.3dml +text/vnd.in3d.spot +text/vnd.IPTC.NewsML +text/vnd.IPTC.NITF +text/vnd.latex-z +text/vnd.motorola.reflex +text/vnd.ms-mediapackage +text/vnd.sun.j2me.app-descriptor jad +text/vnd.wap.si +text/vnd.wap.sl +text/vnd.wap.wml wml +text/vnd.wap.wmlscript wmls +text/x-bibtex bib +text/x-boo boo +text/x-c++hdr h++ hpp hxx hh +text/x-c++src c++ cpp cxx cc +text/x-chdr h +text/x-component htc +text/x-crontab +text/x-csh csh +text/x-csrc c +text/x-dsrc d +text/x-diff diff patch +text/x-haskell hs +text/x-java java +text/x-literate-haskell lhs +text/x-makefile +text/x-moc moc +text/x-pascal p pas +text/x-pcs-gcd gcd +text/x-perl pl pm +text/x-python py +text/x-scala scala +text/x-server-parsed-html +text/x-setext etx +text/x-sh sh +text/x-tcl tcl tk +text/x-tex tex ltx sty cls +text/x-vcalendar vcs +text/x-vcard vcf + +video/3gpp 3gp +video/annodex axv +video/dl dl +video/dv dif dv +video/fli fli +video/gl gl +video/mpeg mpeg mpg mpe +video/mp4 mp4 +video/quicktime qt mov +video/mp4v-es +video/ogg ogv +video/parityfec +video/pointer +video/vnd.fvt +video/vnd.motorola.video +video/vnd.motorola.videop +video/vnd.mpegurl mxu +video/vnd.mts +video/vnd.nokia.interleaved-multimedia +video/vnd.vivo +video/x-flv flv +video/x-la-asf lsf lsx +video/x-mng mng +video/x-ms-asf asf asx +video/x-ms-wm wm +video/x-ms-wmv wmv +video/x-ms-wmx wmx +video/x-ms-wvx wvx +video/x-msvideo avi +video/x-sgi-movie movie +video/x-matroska mpv mkv + +x-conference/x-cooltalk ice + +x-epoc/x-sisx-app sisx +x-world/x-vrml vrm vrml wrl diff --git a/cross/python313/Makefile b/cross/python313/Makefile new file mode 100644 index 00000000000..6076b1a2ef7 --- /dev/null +++ b/cross/python313/Makefile @@ -0,0 +1,109 @@ +PKG_NAME = python313 +PKG_VERS = 3.13.1 +PKG_VERS_MAJOR_MINOR = $(word 1,$(subst ., ,$(PKG_VERS))).$(word 2,$(subst ., ,$(PKG_VERS))) +PKG_EXT = tar.xz +PKG_DIST_NAME = Python-$(PKG_VERS).$(PKG_EXT) +PKG_DIST_SITE = https://www.python.org/ftp/python/$(PKG_VERS) +PKG_DIR = Python-$(PKG_VERS) + +# Compiler must support std=c++11 +UNSUPPORTED_ARCHS = $(OLD_PPC_ARCHS) $(ARMv5_ARCHS) + +BUILD_DEPENDS = native/python313 + +DEPENDS = cross/zlib cross/sqlite cross/readline cross/ncursesw cross/bzip2 cross/xz +# required for Sleepycat^WOracle Berkeley DB interface +DEPENDS += cross/berkeleydb +# required for uuid module +DEPENDS += cross/libuuid + +HOMEPAGE = https://www.python.org/ +COMMENT = Python Programming Language +LICENSE = PSF + +GNU_CONFIGURE = 1 + +CONFIGURE_ARGS = --enable-shared +CONFIGURE_ARGS += --without-static-libpython +CONFIGURE_ARGS += --enable-ipv6 +# installed pip is not on PATH +CONFIGURE_ARGS += --without-ensurepip +CONFIGURE_ARGS += --enable-loadable-sqlite-extensions +CONFIGURE_ARGS += --with-computed-gotos=yes +CONFIGURE_ARGS += --with-build-python=$(PYTHON_NATIVE) +CONFIGURE_ARGS += --with-readline=readline +CONFIGURE_ARGS += --disable-test-modules + +include ../../mk/spksrc.archs.mk + +# optionally generate optimized code +ifeq ($(strip $(PYTHON_OPTIMIZE)),1) +# +# Enable Link-Time Optimization +CONFIGURE_ARGS += --with-lto +# +# pgo optimization can only be run native platform and now +# exit on errors which had no impact (and effects) previously. +# https://github.com/python/cpython/pull/111950 +#CONFIGURE_ARGS += --enable-optimizations +endif + +ifeq ($(findstring $(ARCH),$(PPC_ARCHS)),$(ARCH)) +# for qoriq +ADDITIONAL_LDFLAGS = -latomic +endif + +CONFIGURE_ARGS += ac_cv_buggy_getaddrinfo=no +CONFIGURE_ARGS += ac_cv_file__dev_ptmx=no +CONFIGURE_ARGS += ac_cv_file__dev_ptc=no +CONFIGURE_ARGS += ac_cv_have_long_long_format=yes + +DEPENDS += cross/openssl3 +CONFIGURE_ARGS += --with-ssl-default-suites=openssl + +DEPENDS += cross/gdbm +CONFIGURE_ARGS += --with-dbmliborder=gdbm:ndbm:bdb + +DEPENDS += cross/libexpat +CONFIGURE_ARGS += --with-system-expat + +# libffi is no longer bundled with python +DEPENDS += cross/libffi + +ADDITIONAL_CFLAGS = -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -L $(STAGING_INSTALL_PREFIX)/lib -I $(STAGING_INSTALL_PREFIX)/include + +POST_PATCH_TARGET = python313_post_patch +PRE_CONFIGURE_TARGET = python313_pre_configure +COMPILE_TARGET = python313_compile +INSTALL_TARGET = python313_install + +include ../../mk/spksrc.cross-cc.mk + +PYTHON_NATIVE = $(abspath $(WORK_DIR)/../../../native/$(PKG_NAME)/work-native/install/usr/local/bin/python$(PKG_VERS_MAJOR_MINOR)) +HOSTPYTHON = $(WORK_DIR)/$(PKG_DIR)/hostpython + +.PHONY: python313_post_patch +python313_post_patch: + $(RUN) sed -e 's#@INSTALL_PREFIX@#$(INSTALL_PREFIX)#' -i Lib/mimetypes.py + +.PHONY: python313_pre_configure +python313_pre_configure: + cp $(PYTHON_NATIVE) $(HOSTPYTHON) + $(RUN) autoreconf -ivf -Werror + # create phantom header and library to succeed add_dir_to_list in setup.py + # so that future-promised libsqlite3.so and sqlite3.h will be used. Yep, + # it's a bit hokey, but avoids editing upstream pristine source + mkdir -p $(STAGING_INSTALL_PREFIX)/lib $(STAGING_INSTALL_PREFIX)/include + mkdir -p $(WORK_DIR)/Python-$(PKG_VERS)/Include $(WORK_DIR)/Python-$(PKG_VERS)/lib + test -h $(WORK_DIR)/Python-$(PKG_VERS)/Include/sqlite3.h || ln -fs $(STAGING_INSTALL_PREFIX)/include/sqlite3.h $(WORK_DIR)/Python-$(PKG_VERS)/Include/sqlite3.h + test -h $(WORK_DIR)/Python-$(PKG_VERS)/lib/libsqlite3.so || ln -fs $(STAGING_INSTALL_PREFIX)/lib/libsqlite3.so $(WORK_DIR)/Python-$(PKG_VERS)/lib/ + +.PHONY: python313_compile +python313_compile: + $(RUN) _PYTHON_HOST_PLATFORM=$(TC_TARGET) $(MAKE) -j $(NCPUS) + +.PHONY: python313_install +python313_install: + @install -m 755 -d $(STAGING_INSTALL_PREFIX)/etc + @install -m 644 src/mime.types $(STAGING_INSTALL_PREFIX)/etc/ + $(RUN) _PYTHON_HOST_PLATFORM=$(TC_TARGET) $(MAKE) install prefix=$(STAGING_INSTALL_PREFIX) diff --git a/cross/python313/PLIST b/cross/python313/PLIST new file mode 100644 index 00000000000..4f0da5b775f --- /dev/null +++ b/cross/python313/PLIST @@ -0,0 +1,12 @@ +lnk:bin/idle3 +rsc:bin/idle3.13 +lnk:bin/pydoc3 +rsc:bin/pydoc3.13 +lnk:bin/python3 +bin:bin/python3.13 +rsc:etc/mime.types +rsc:include/python3.13/pyconfig.h +lnk:lib/libpython3.13.so +lib:lib/libpython3.13.so.1.0 +lib:lib/libpython3.so +rsc:lib/python3.13 diff --git a/cross/python313/digests b/cross/python313/digests new file mode 100644 index 00000000000..35979854910 --- /dev/null +++ b/cross/python313/digests @@ -0,0 +1,3 @@ +Python-3.13.1.tar.xz SHA1 4b0c2a49a848c3c5d611416099636262a0b9090f +Python-3.13.1.tar.xz SHA256 9cf9427bee9e2242e3877dd0f6b641c1853ca461f39d6503ce260a59c80bf0d9 +Python-3.13.1.tar.xz MD5 80c16badb94ffe235280d4d9a099b8bc diff --git a/cross/python313/patches/001-mimetypes.patch b/cross/python313/patches/001-mimetypes.patch new file mode 100644 index 00000000000..804b3e1f0b1 --- /dev/null +++ b/cross/python313/patches/001-mimetypes.patch @@ -0,0 +1,26 @@ + +DSM does not have the default mime-type files available, +need to bring our own for the module to work. + +Equivalent of cross/python/patches/004-mimetypes.patch +Added by Diaoul 2013-03-24_23:25:49+0100 + +--- Lib/mimetypes.py.orig 2011-10-16 21:07:51.000000000 +0200 ++++ Lib/mimetypes.py 2011-10-16 21:07:58.000000000 +0200 +@@ -40,15 +40,7 @@ + ] + + knownfiles = [ +- "/etc/mime.types", +- "/etc/httpd/mime.types", # Mac OS X +- "/etc/httpd/conf/mime.types", # Apache +- "/etc/apache/mime.types", # Apache 1 +- "/etc/apache2/mime.types", # Apache 2 +- "/usr/local/etc/httpd/conf/mime.types", +- "/usr/local/lib/netscape/mime.types", +- "/usr/local/etc/httpd/conf/mime.types", # Apache 1.2 +- "/usr/local/etc/mime.types", # Apache 1.3 ++ "@INSTALL_PREFIX@/etc/mime.types", + ] + + inited = False diff --git a/cross/python313/src/mime.types b/cross/python313/src/mime.types new file mode 100644 index 00000000000..893622137dd --- /dev/null +++ b/cross/python313/src/mime.types @@ -0,0 +1,788 @@ +############################################################################### +# +# MIME-TYPES and the extensions that represent them +# +# This file is part of the "mime-support" package. Please send email (not a +# bug report) to mime-support@packages.debian.org if you would like new types +# and/or extensions to be added. +# +# The reason that all types are managed by the mime-support package instead +# allowing individual packages to install types in much the same way as they +# add entries in to the mailcap file is so these types can be referenced by +# other programs (such as a web server) even if the specific support package +# for that type is not installed. +# +# Users can add their own types if they wish by creating a ".mime.types" +# file in their home directory. Definitions included there will take +# precedence over those listed here. +# +# Note: Compression schemes like "gzip", "bzip", and "compress" are not +# actually "mime-types". They are "encodings" and hence must _not_ have +# entries in this file to map their extensions. The "mime-type" of an +# encoded file refers to the type of data that has been encoded, not the +# type of encoding. +# +############################################################################### + + +application/activemessage +application/andrew-inset ez +application/annodex anx +application/applefile +application/atom+xml atom +application/atomcat+xml atomcat +application/atomserv+xml atomsrv +application/atomicmail +application/batch-SMTP +application/beep+xml +application/bbolin lin +application/cals-1840 +application/cap cap pcap +application/commonground +application/cu-seeme cu +application/cybercash +application/davmount+xml davmount +application/dca-rft +application/dec-dx +application/docbook+xml +application/dsptype tsp +application/dvcs +application/ecmascript es +application/edi-consent +application/edi-x12 +application/edifact +application/eshop +application/font-tdpfr +application/futuresplash spl +application/ghostview +application/hta hta +application/http +application/hyperstudio +application/iges +application/index +application/index.cmd +application/index.obj +application/index.response +application/index.vnd +application/iotp +application/ipp +application/isup +application/java-archive jar +application/java-serialized-object ser +application/java-vm class +application/javascript js +application/m3g m3g +application/mac-binhex40 hqx +application/mac-compactpro cpt +application/macwriteii +application/marc +application/mathematica nb nbp +application/ms-tnef +application/msaccess mdb +application/msword doc dot +application/mxf mxf +application/news-message-id +application/news-transmission +application/ocsp-request +application/ocsp-response +application/octet-stream bin +application/oda oda +application/ogg ogx +application/parityfec +application/pdf pdf +application/pgp-encrypted +application/pgp-keys key +application/pgp-signature pgp +application/pics-rules prf +application/pkcs10 +application/pkcs7-mime +application/pkcs7-signature +application/pkix-cert +application/pkix-crl +application/pkixcmp +application/postscript ps ai eps epsi epsf eps2 eps3 +application/prs.alvestrand.titrax-sheet +application/prs.cww +application/prs.nprend +application/qsig +application/rar rar +application/rdf+xml rdf +application/remote-printing +application/riscos +application/rss+xml rss +application/rtf rtf +application/sdp +application/set-payment +application/set-payment-initiation +application/set-registration +application/set-registration-initiation +application/sgml +application/sgml-open-catalog +application/sieve +application/slate +application/smil smi smil +application/timestamp-query +application/timestamp-reply +application/vemmi +application/whoispp-query +application/whoispp-response +application/wita +application/x400-bp +application/xhtml+xml xhtml xht +application/xml xml xsl xsd +application/xml-dtd +application/xml-external-parsed-entity +application/xspf+xml xspf +application/zip zip +application/vnd.3M.Post-it-Notes +application/vnd.accpac.simply.aso +application/vnd.accpac.simply.imp +application/vnd.acucobol +application/vnd.aether.imp +application/vnd.android.package-archive apk +application/vnd.anser-web-certificate-issue-initiation +application/vnd.anser-web-funds-transfer-initiation +application/vnd.audiograph +application/vnd.bmi +application/vnd.businessobjects +application/vnd.canon-cpdl +application/vnd.canon-lips +application/vnd.cinderella cdy +application/vnd.claymore +application/vnd.commerce-battelle +application/vnd.commonspace +application/vnd.comsocaller +application/vnd.contact.cmsg +application/vnd.cosmocaller +application/vnd.ctc-posml +application/vnd.cups-postscript +application/vnd.cups-raster +application/vnd.cups-raw +application/vnd.cybank +application/vnd.dna +application/vnd.dpgraph +application/vnd.dxr +application/vnd.ecdis-update +application/vnd.ecowin.chart +application/vnd.ecowin.filerequest +application/vnd.ecowin.fileupdate +application/vnd.ecowin.series +application/vnd.ecowin.seriesrequest +application/vnd.ecowin.seriesupdate +application/vnd.enliven +application/vnd.epson.esf +application/vnd.epson.msf +application/vnd.epson.quickanime +application/vnd.epson.salt +application/vnd.epson.ssf +application/vnd.ericsson.quickcall +application/vnd.eudora.data +application/vnd.fdf +application/vnd.ffsns +application/vnd.flographit +application/vnd.framemaker +application/vnd.fsc.weblaunch +application/vnd.fujitsu.oasys +application/vnd.fujitsu.oasys2 +application/vnd.fujitsu.oasys3 +application/vnd.fujitsu.oasysgp +application/vnd.fujitsu.oasysprs +application/vnd.fujixerox.ddd +application/vnd.fujixerox.docuworks +application/vnd.fujixerox.docuworks.binder +application/vnd.fut-misnet +application/vnd.google-earth.kml+xml kml +application/vnd.google-earth.kmz kmz +application/vnd.grafeq +application/vnd.groove-account +application/vnd.groove-identity-message +application/vnd.groove-injector +application/vnd.groove-tool-message +application/vnd.groove-tool-template +application/vnd.groove-vcard +application/vnd.hhe.lesson-player +application/vnd.hp-HPGL +application/vnd.hp-PCL +application/vnd.hp-PCLXL +application/vnd.hp-hpid +application/vnd.hp-hps +application/vnd.httphone +application/vnd.hzn-3d-crossword +application/vnd.ibm.MiniPay +application/vnd.ibm.afplinedata +application/vnd.ibm.modcap +application/vnd.informix-visionary +application/vnd.intercon.formnet +application/vnd.intertrust.digibox +application/vnd.intertrust.nncp +application/vnd.intu.qbo +application/vnd.intu.qfx +application/vnd.irepository.package+xml +application/vnd.is-xpr +application/vnd.japannet-directory-service +application/vnd.japannet-jpnstore-wakeup +application/vnd.japannet-payment-wakeup +application/vnd.japannet-registration +application/vnd.japannet-registration-wakeup +application/vnd.japannet-setstore-wakeup +application/vnd.japannet-verification +application/vnd.japannet-verification-wakeup +application/vnd.koan +application/vnd.lotus-1-2-3 +application/vnd.lotus-approach +application/vnd.lotus-freelance +application/vnd.lotus-notes +application/vnd.lotus-organizer +application/vnd.lotus-screencam +application/vnd.lotus-wordpro +application/vnd.mcd +application/vnd.mediastation.cdkey +application/vnd.meridian-slingshot +application/vnd.mif +application/vnd.minisoft-hp3000-save +application/vnd.mitsubishi.misty-guard.trustweb +application/vnd.mobius.daf +application/vnd.mobius.dis +application/vnd.mobius.msl +application/vnd.mobius.plc +application/vnd.mobius.txf +application/vnd.motorola.flexsuite +application/vnd.motorola.flexsuite.adsi +application/vnd.motorola.flexsuite.fis +application/vnd.motorola.flexsuite.gotap +application/vnd.motorola.flexsuite.kmr +application/vnd.motorola.flexsuite.ttc +application/vnd.motorola.flexsuite.wem +application/vnd.mozilla.xul+xml xul +application/vnd.ms-artgalry +application/vnd.ms-asf +application/vnd.ms-excel xls xlb xlt +application/vnd.ms-lrm +application/vnd.ms-pki.seccat cat +application/vnd.ms-pki.stl stl +application/vnd.ms-powerpoint ppt pps +application/vnd.ms-project +application/vnd.ms-tnef +application/vnd.ms-works +application/vnd.mseq +application/vnd.msign +application/vnd.music-niff +application/vnd.musician +application/vnd.netfpx +application/vnd.noblenet-directory +application/vnd.noblenet-sealer +application/vnd.noblenet-web +application/vnd.novadigm.EDM +application/vnd.novadigm.EDX +application/vnd.novadigm.EXT +application/vnd.oasis.opendocument.chart odc +application/vnd.oasis.opendocument.database odb +application/vnd.oasis.opendocument.formula odf +application/vnd.oasis.opendocument.graphics odg +application/vnd.oasis.opendocument.graphics-template otg +application/vnd.oasis.opendocument.image odi +application/vnd.oasis.opendocument.presentation odp +application/vnd.oasis.opendocument.presentation-template otp +application/vnd.oasis.opendocument.spreadsheet ods +application/vnd.oasis.opendocument.spreadsheet-template ots +application/vnd.oasis.opendocument.text odt +application/vnd.oasis.opendocument.text-master odm +application/vnd.oasis.opendocument.text-template ott +application/vnd.oasis.opendocument.text-web oth +application/vnd.osa.netdeploy +application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx +application/vnd.openxmlformats-officedocument.spreadsheetml.template xltx +application/vnd.openxmlformats-officedocument.presentationml.presentation pptx +application/vnd.openxmlformats-officedocument.presentationml.slideshow ppsx +application/vnd.openxmlformats-officedocument.presentationml.template potx +application/vnd.openxmlformats-officedocument.wordprocessingml.document docx +application/vnd.openxmlformats-officedocument.wordprocessingml.template dotx +application/vnd.palm +application/vnd.pg.format +application/vnd.pg.osasli +application/vnd.powerbuilder6 +application/vnd.powerbuilder6-s +application/vnd.powerbuilder7 +application/vnd.powerbuilder7-s +application/vnd.powerbuilder75 +application/vnd.powerbuilder75-s +application/vnd.previewsystems.box +application/vnd.publishare-delta-tree +application/vnd.pvi.ptid1 +application/vnd.pwg-xhtml-print+xml +application/vnd.rapid +application/vnd.rim.cod cod +application/vnd.s3sms +application/vnd.seemail +application/vnd.shana.informed.formdata +application/vnd.shana.informed.formtemplate +application/vnd.shana.informed.interchange +application/vnd.shana.informed.package +application/vnd.smaf mmf +application/vnd.sss-cod +application/vnd.sss-dtf +application/vnd.sss-ntf +application/vnd.stardivision.calc sdc +application/vnd.stardivision.chart sds +application/vnd.stardivision.draw sda +application/vnd.stardivision.impress sdd +application/vnd.stardivision.math sdf +application/vnd.stardivision.writer sdw +application/vnd.stardivision.writer-global sgl +application/vnd.street-stream +application/vnd.sun.xml.calc sxc +application/vnd.sun.xml.calc.template stc +application/vnd.sun.xml.draw sxd +application/vnd.sun.xml.draw.template std +application/vnd.sun.xml.impress sxi +application/vnd.sun.xml.impress.template sti +application/vnd.sun.xml.math sxm +application/vnd.sun.xml.writer sxw +application/vnd.sun.xml.writer.global sxg +application/vnd.sun.xml.writer.template stw +application/vnd.svd +application/vnd.swiftview-ics +application/vnd.symbian.install sis +application/vnd.triscape.mxs +application/vnd.trueapp +application/vnd.truedoc +application/vnd.tve-trigger +application/vnd.ufdl +application/vnd.uplanet.alert +application/vnd.uplanet.alert-wbxml +application/vnd.uplanet.bearer-choice +application/vnd.uplanet.bearer-choice-wbxml +application/vnd.uplanet.cacheop +application/vnd.uplanet.cacheop-wbxml +application/vnd.uplanet.channel +application/vnd.uplanet.channel-wbxml +application/vnd.uplanet.list +application/vnd.uplanet.list-wbxml +application/vnd.uplanet.listcmd +application/vnd.uplanet.listcmd-wbxml +application/vnd.uplanet.signal +application/vnd.vcx +application/vnd.vectorworks +application/vnd.vidsoft.vidconference +application/vnd.visio vsd +application/vnd.vividence.scriptfile +application/vnd.wap.sic +application/vnd.wap.slc +application/vnd.wap.wbxml wbxml +application/vnd.wap.wmlc wmlc +application/vnd.wap.wmlscriptc wmlsc +application/vnd.webturbo +application/vnd.wordperfect wpd +application/vnd.wordperfect5.1 wp5 +application/vnd.wrq-hp3000-labelled +application/vnd.wt.stf +application/vnd.xara +application/vnd.xfdl +application/vnd.yellowriver-custom-menu +application/x-123 wk +application/x-7z-compressed 7z +application/x-abiword abw +application/x-apple-diskimage dmg +application/x-bcpio bcpio +application/x-bittorrent torrent +application/x-cab cab +application/x-cbr cbr +application/x-cbz cbz +application/x-cdf cdf cda +application/x-cdlink vcd +application/x-chess-pgn pgn +application/x-core +application/x-cpio cpio +application/x-csh csh +application/x-debian-package deb udeb +application/x-director dcr dir dxr +application/x-dms dms +application/x-doom wad +application/x-dvi dvi +application/x-httpd-eruby rhtml +application/x-executable +application/x-font pfa pfb gsf pcf pcf.Z +application/x-freemind mm +application/x-futuresplash spl +application/x-gnumeric gnumeric +application/x-go-sgf sgf +application/x-graphing-calculator gcf +application/x-gtar gtar tgz taz +application/x-hdf hdf +application/x-httpd-php phtml pht php +application/x-httpd-php-source phps +application/x-httpd-php3 php3 +application/x-httpd-php3-preprocessed php3p +application/x-httpd-php4 php4 +application/x-httpd-php5 php5 +application/x-ica ica +application/x-info info +application/x-internet-signup ins isp +application/x-iphone iii +application/x-iso9660-image iso +application/x-jam jam +application/x-java-applet +application/x-java-bean +application/x-java-jnlp-file jnlp +application/x-jmol jmz +application/x-kchart chrt +application/x-kdelnk +application/x-killustrator kil +application/x-koan skp skd skt skm +application/x-kpresenter kpr kpt +application/x-kspread ksp +application/x-kword kwd kwt +application/x-latex latex +application/x-lha lha +application/x-lyx lyx +application/x-lzh lzh +application/x-lzx lzx +application/x-maker frm maker frame fm fb book fbdoc +application/x-mif mif +application/x-ms-wmd wmd +application/x-ms-wmz wmz +application/x-msdos-program com exe bat dll +application/x-msi msi +application/x-netcdf nc +application/x-ns-proxy-autoconfig pac dat +application/x-nwc nwc +application/x-object o +application/x-oz-application oza +application/x-pkcs7-certreqresp p7r +application/x-pkcs7-crl crl +application/x-python-code pyc pyo +application/x-qgis qgs shp shx +application/x-quicktimeplayer qtl +application/x-redhat-package-manager rpm +application/x-ruby rb +application/x-rx +application/x-sh sh +application/x-shar shar +application/x-shellscript +application/x-shockwave-flash swf swfl +application/x-silverlight scr +application/x-stuffit sit sitx +application/x-sv4cpio sv4cpio +application/x-sv4crc sv4crc +application/x-tar tar +application/x-tcl tcl +application/x-tex-gf gf +application/x-tex-pk pk +application/x-texinfo texinfo texi +application/x-trash ~ % bak old sik +application/x-troff t tr roff +application/x-troff-man man +application/x-troff-me me +application/x-troff-ms ms +application/x-ustar ustar +application/x-videolan +application/x-wais-source src +application/x-wingz wz +application/x-x509-ca-cert crt +application/x-xcf xcf +application/x-xfig fig +application/x-xpinstall xpi + +audio/32kadpcm +audio/3gpp +audio/amr amr +audio/amr-wb awb +audio/amr amr +audio/amr-wb awb +audio/annodex axa +audio/basic au snd +audio/flac flac +audio/g.722.1 +audio/l16 +audio/midi mid midi kar +audio/mp4a-latm +audio/mpa-robust +audio/mpeg mpga mpega mp2 mp3 m4a +audio/mpegurl m3u +audio/ogg oga ogg spx +audio/parityfec +audio/prs.sid sid +audio/telephone-event +audio/tone +audio/vnd.cisco.nse +audio/vnd.cns.anp1 +audio/vnd.cns.inf1 +audio/vnd.digital-winds +audio/vnd.everad.plj +audio/vnd.lucent.voice +audio/vnd.nortel.vbk +audio/vnd.nuera.ecelp4800 +audio/vnd.nuera.ecelp7470 +audio/vnd.nuera.ecelp9600 +audio/vnd.octel.sbc +audio/vnd.qcelp +audio/vnd.rhetorex.32kadpcm +audio/vnd.vmx.cvsd +audio/x-aiff aif aiff aifc +audio/x-gsm gsm +audio/x-mpegurl m3u +audio/x-ms-wma wma +audio/x-ms-wax wax +audio/x-pn-realaudio-plugin +audio/x-pn-realaudio ra rm ram +audio/x-realaudio ra +audio/x-scpls pls +audio/x-sd2 sd2 +audio/x-wav wav + +chemical/x-alchemy alc +chemical/x-cache cac cache +chemical/x-cache-csf csf +chemical/x-cactvs-binary cbin cascii ctab +chemical/x-cdx cdx +chemical/x-cerius cer +chemical/x-chem3d c3d +chemical/x-chemdraw chm +chemical/x-cif cif +chemical/x-cmdf cmdf +chemical/x-cml cml +chemical/x-compass cpa +chemical/x-crossfire bsd +chemical/x-csml csml csm +chemical/x-ctx ctx +chemical/x-cxf cxf cef +#chemical/x-daylight-smiles smi +chemical/x-embl-dl-nucleotide emb embl +chemical/x-galactic-spc spc +chemical/x-gamess-input inp gam gamin +chemical/x-gaussian-checkpoint fch fchk +chemical/x-gaussian-cube cub +chemical/x-gaussian-input gau gjc gjf +chemical/x-gaussian-log gal +chemical/x-gcg8-sequence gcg +chemical/x-genbank gen +chemical/x-hin hin +chemical/x-isostar istr ist +chemical/x-jcamp-dx jdx dx +chemical/x-kinemage kin +chemical/x-macmolecule mcm +chemical/x-macromodel-input mmd mmod +chemical/x-mdl-molfile mol +chemical/x-mdl-rdfile rd +chemical/x-mdl-rxnfile rxn +chemical/x-mdl-sdfile sd sdf +chemical/x-mdl-tgf tgf +#chemical/x-mif mif +chemical/x-mmcif mcif +chemical/x-mol2 mol2 +chemical/x-molconn-Z b +chemical/x-mopac-graph gpt +chemical/x-mopac-input mop mopcrt mpc zmt +chemical/x-mopac-out moo +chemical/x-mopac-vib mvb +chemical/x-ncbi-asn1 asn +chemical/x-ncbi-asn1-ascii prt ent +chemical/x-ncbi-asn1-binary val aso +chemical/x-ncbi-asn1-spec asn +chemical/x-pdb pdb ent +chemical/x-rosdal ros +chemical/x-swissprot sw +chemical/x-vamas-iso14976 vms +chemical/x-vmd vmd +chemical/x-xtel xtel +chemical/x-xyz xyz + +image/cgm +image/g3fax +image/gif gif +image/ief ief +image/jpeg jpeg jpg jpe +image/naplps +image/pcx pcx +image/png png +image/prs.btif +image/prs.pti +image/svg+xml svg svgz +image/tiff tiff tif +image/vnd.cns.inf2 +image/vnd.djvu djvu djv +image/vnd.dwg +image/vnd.dxf +image/vnd.fastbidsheet +image/vnd.fpx +image/vnd.fst +image/vnd.fujixerox.edmics-mmr +image/vnd.fujixerox.edmics-rlc +image/vnd.mix +image/vnd.net-fpx +image/vnd.svf +image/vnd.wap.wbmp wbmp +image/vnd.xiff +image/x-canon-cr2 cr2 +image/x-canon-crw crw +image/x-cmu-raster ras +image/x-coreldraw cdr +image/x-coreldrawpattern pat +image/x-coreldrawtemplate cdt +image/x-corelphotopaint cpt +image/x-epson-erf erf +image/x-icon ico +image/x-jg art +image/x-jng jng +image/x-ms-bmp bmp +image/x-nikon-nef nef +image/x-olympus-orf orf +image/x-photoshop psd +image/x-portable-anymap pnm +image/x-portable-bitmap pbm +image/x-portable-graymap pgm +image/x-portable-pixmap ppm +image/x-rgb rgb +image/x-xbitmap xbm +image/x-xpixmap xpm +image/x-xwindowdump xwd + +inode/chardevice +inode/blockdevice +inode/directory-locked +inode/directory +inode/fifo +inode/socket + +message/delivery-status +message/disposition-notification +message/external-body +message/http +message/s-http +message/news +message/partial +message/rfc822 eml + +model/iges igs iges +model/mesh msh mesh silo +model/vnd.dwf +model/vnd.flatland.3dml +model/vnd.gdl +model/vnd.gs-gdl +model/vnd.gtw +model/vnd.mts +model/vnd.vtu +model/vrml wrl vrml +model/x3d+vrml x3dv +model/x3d+xml x3d +model/x3d+binary x3db + +multipart/alternative +multipart/appledouble +multipart/byteranges +multipart/digest +multipart/encrypted +multipart/form-data +multipart/header-set +multipart/mixed +multipart/parallel +multipart/related +multipart/report +multipart/signed +multipart/voice-message + +text/cache-manifest manifest +text/calendar ics icz +text/css css +text/csv csv +text/directory +text/english +text/enriched +text/h323 323 +text/html html htm shtml +text/iuls uls +text/mathml mml +text/parityfec +text/plain asc txt text pot brf +text/prs.lines.tag +text/rfc822-headers +text/richtext rtx +text/rtf +text/scriptlet sct wsc +text/t140 +text/texmacs tm ts +text/tab-separated-values tsv +text/uri-list +text/vnd.abc +text/vnd.curl +text/vnd.DMClientScript +text/vnd.flatland.3dml +text/vnd.fly +text/vnd.fmi.flexstor +text/vnd.in3d.3dml +text/vnd.in3d.spot +text/vnd.IPTC.NewsML +text/vnd.IPTC.NITF +text/vnd.latex-z +text/vnd.motorola.reflex +text/vnd.ms-mediapackage +text/vnd.sun.j2me.app-descriptor jad +text/vnd.wap.si +text/vnd.wap.sl +text/vnd.wap.wml wml +text/vnd.wap.wmlscript wmls +text/x-bibtex bib +text/x-boo boo +text/x-c++hdr h++ hpp hxx hh +text/x-c++src c++ cpp cxx cc +text/x-chdr h +text/x-component htc +text/x-crontab +text/x-csh csh +text/x-csrc c +text/x-dsrc d +text/x-diff diff patch +text/x-haskell hs +text/x-java java +text/x-literate-haskell lhs +text/x-makefile +text/x-moc moc +text/x-pascal p pas +text/x-pcs-gcd gcd +text/x-perl pl pm +text/x-python py +text/x-scala scala +text/x-server-parsed-html +text/x-setext etx +text/x-sh sh +text/x-tcl tcl tk +text/x-tex tex ltx sty cls +text/x-vcalendar vcs +text/x-vcard vcf + +video/3gpp 3gp +video/annodex axv +video/dl dl +video/dv dif dv +video/fli fli +video/gl gl +video/mpeg mpeg mpg mpe +video/mp4 mp4 +video/quicktime qt mov +video/mp4v-es +video/ogg ogv +video/parityfec +video/pointer +video/vnd.fvt +video/vnd.motorola.video +video/vnd.motorola.videop +video/vnd.mpegurl mxu +video/vnd.mts +video/vnd.nokia.interleaved-multimedia +video/vnd.vivo +video/x-flv flv +video/x-la-asf lsf lsx +video/x-mng mng +video/x-ms-asf asf asx +video/x-ms-wm wm +video/x-ms-wmv wmv +video/x-ms-wmx wmx +video/x-ms-wvx wvx +video/x-msvideo avi +video/x-sgi-movie movie +video/x-matroska mpv mkv + +x-conference/x-cooltalk ice + +x-epoc/x-sisx-app sisx +x-world/x-vrml vrm vrml wrl diff --git a/mk/spksrc.crossenv.mk b/mk/spksrc.crossenv.mk new file mode 100644 index 00000000000..14a25cf3feb --- /dev/null +++ b/mk/spksrc.crossenv.mk @@ -0,0 +1,263 @@ +### crossenv rules +# Creates a crossenv for cross-compiling wheels. +# Uses "default" as fallback and create a symlink +# between $(WORK_DIR)/crossenv -> crossenv-default. +# Otherwise uses wheel -, then +# fallback to wheel only. +# It also generates a crossenv specific python-cc.mk +# located under $(WORK_DIR)/crossenv-/build. + +# Targets are executed in the following order: +# crossenv_msg_target +# pre_crossenv_target (override with PRE_CROSSENV_TARGET) +# build_crossenv_target (override with CROSSENV_TARGET) +# post_crossenv_target (override with POST_CROSSENV_TARGET) +# Variables: +# WHEELS List of wheels to go through + +# Defined using PYTHON_PACKAGE_WORK_DIR from spksrc.python.mk or use local work directory +PYTHON_WORK_DIR = $(or $(wildcard $(PYTHON_PACKAGE_WORK_DIR)),$(wildcard $(WORK_DIR))) + +# Other Python spk/python* related variables +PYTHON_PKG_VERS = $(or $(lastword $(subst -, ,$(notdir $(patsubst %/,%,$(wildcard $(PYTHON_WORK_DIR)/Python-[0-9]*))))),$(SPK_VERS)) +PYTHON_PKG_VERS_MAJOR_MINOR = $(or $(word 1,$(subst ., ,$(PYTHON_PKG_VERS))).$(word 2,$(subst ., ,$(PYTHON_PKG_VERS))),$(SPK_VERS_MAJOR_MINOR)) +PYTHON_PKG_NAME = python$(subst .,,$(PYTHON_PKG_VERS_MAJOR_MINOR)) +PYTHON_PKG_DIR = Python-$(PYTHON_PKG_VERS) +# +HOSTPYTHON_LIB_NATIVE = $(abspath $(WORK_DIR)/../../../native/$(PYTHON_PKG_NAME)/work-native/$(PYTHON_PKG_DIR)/build/lib.linux-$(shell uname -m)-$(PYTHON_PKG_VERS_MAJOR_MINOR)) +PYTHON_NATIVE = $(abspath $(WORK_DIR)/../../../native/$(PYTHON_PKG_NAME)/work-native/install/usr/local/bin/python3) +PYTHON_LIB_NATIVE = $(abspath $(PYTHON_WORK_DIR)/$(PYTHON_PKG_DIR)/build/lib.linux-$(shell uname -m)-$(PYTHON_PKG_VERS_MAJOR_MINOR)) +PYTHON_LIB_CROSS = $(abspath $(PYTHON_WORK_DIR)/$(PYTHON_PKG_DIR)/build/lib.linux-$(shell expr "$(TC_TARGET)" : '\([^-]*\)' )-$(PYTHON_PKG_VERS_MAJOR_MINOR)) + +# wheel crossenv definitions +CROSSENV_CONFIG_PATH = $(abspath $(PYTHON_WORK_DIR)/../crossenv) +CROSSENV_CONFIG_DEFAULT = $(CROSSENV_CONFIG_PATH)/requirements-default.txt +CROSSENV_PATH = $(abspath $(WORK_DIR)/crossenv-$(CROSSENV_BUILD_WHEEL)/) + +### + +ifeq ($(strip $(PRE_CROSSENV_TARGET)),) +PRE_CROSSENV_TARGET = pre_crossenv_target +else +$(PRE_CROSSENV_TARGET): crossenv_msg_target +endif +ifeq ($(strip $(CROSSENV_TARGET)),) +CROSSENV_TARGET = build_crossenv_target +else +$(CROSSENC_TARGET): $(CROSSENV_WHEEL_TARGET) +endif +ifeq ($(strip $(POST_CROSSENV_TARGET)),) +POST_CROSSENV_TARGET = post_crossenv_target +else +$(POST_CROSSENV_TARGET): $(CROSSENV_TARGET) +endif + +### + +# Check for wheel==x.y, then fallback to wheel, then default +ifneq ($(wildcard $(CROSSENV_CONFIG_PATH)/requirements-$(WHEEL).txt),) +CROSSENV_BUILD_WHEEL = $(WHEEL) +CROSSENV_BUILD_REQUIREMENTS = $(CROSSENV_CONFIG_PATH)/requirements-$(CROSSENV_BUILD_WHEEL).txt +else ifneq ($(wildcard $(CROSSENV_CONFIG_PATH)/requirements-$(firstword $(subst -, ,$(WHEEL))).txt),) +CROSSENV_BUILD_WHEEL = $(firstword $(subst -, ,$(WHEEL))) +CROSSENV_BUILD_REQUIREMENTS = $(CROSSENV_CONFIG_PATH)/requirements-$(CROSSENV_BUILD_WHEEL).txt +else +CROSSENV_BUILD_WHEEL = default +CROSSENV_BUILD_REQUIREMENTS = $(CROSSENV_CONFIG_DEFAULT) +endif + +# Completion status file +CROSSENV_COOKIE = $(WORK_DIR)/.crossenv-$(CROSSENV_BUILD_WHEEL)_done + +### + +# default wheel packages to install in crossenv +ifneq ($(wildcard $(CROSSENV_CONFIG_PATH)/requirements-$(WHEEL).txt $(CROSSENV_CONFIG_DEFAULT)),) +CROSSENV_DEFAULT_PIP_VERSION = $(shell grep -h -E "^pip[<>=]=" $(wildcard $(CROSSENV_CONFIG_PATH)/requirements-$(WHEEL).txt $(CROSSENV_CONFIG_DEFAULT)) | head -1 | sed -E 's/.*[<>=]=//') +CROSSENV_DEFAULT_SETUPTOOLS_VERSION = $(shell grep -h -E "^setuptools[<>=]=" $(wildcard $(CROSSENV_CONFIG_PATH)/requirements-$(WHEEL).txt $(CROSSENV_CONFIG_DEFAULT)) | head -1 | sed -E 's/.*[<>=]=//') +CROSSENV_DEFAULT_WHEEL_VERSION = $(shell grep -h -E "^wheel[<>=]=" $(wildcard $(CROSSENV_CONFIG_PATH)/requirements-$(WHEEL).txt $(CROSSENV_CONFIG_DEFAULT)) | head -1 | sed -E 's/.*[<>=]=//') +endif + +ifneq ($(CROSSENV_DEFAULT_PIP_VERSION),) +CROSSENV_DEFAULT_PIP = pip==$(CROSSENV_DEFAULT_PIP_VERSION) +else +CROSSENV_DEFAULT_PIP = pip +endif + +ifneq ($(CROSSENV_DEFAULT_SETUPTOOLS_VERSION),) +CROSSENV_DEFAULT_SETUPTOOLS = setuptools==$(CROSSENV_DEFAULT_SETUPTOOLS_VERSION) +else +CROSSENV_DEFAULT_SETUPTOOLS = setuptools +endif + +ifneq ($(CROSSENV_DEFAULT_WHEEL_VERSION),) +CROSSENV_DEFAULT_WHEEL = wheel==$(CROSSENV_DEFAULT_WHEEL_VERSION) +else +CROSSENV_DEFAULT_WHEEL = wheel +endif + +### + +crossenv_msg_target: + @$(MSG) "Preparing crossenv for $(NAME)" + +# Create per-arch caching directory: +# PIP_CACHE_DIR defaults to $(WORK_DIR)/pip +pre_crossenv_target: crossenv_msg_target + @if [ -n "$(PIP_CACHE_OPT)" ] ; then \ + mkdir -p $(PIP_CACHE_DIR) ; \ + fi; \ + +post_crossenv_target: $(CROSSENV_TARGET) + +### + +crossenv-%: +ifneq ($(filter error-%, $(CROSSENV_BUILD_WHEEL)),) + @$(MSG) $(MAKE) $(CROSSENV_BUILD_WHEEL) + @$(MAKE) $(CROSSENV_BUILD_WHEEL) +else + @$(MSG) $(MAKE) ARCH=$(firstword $(subst -, ,$*)) TCVERSION=$(lastword $(subst -, ,$*)) WHEEL=$(CROSSENV_BUILD_WHEEL) crossenv + -@MAKEFLAGS= $(MAKE) ARCH=$(firstword $(subst -, ,$*)) TCVERSION=$(lastword $(subst -, ,$*)) WHEEL=$(CROSSENV_BUILD_WHEEL) crossenv +endif + +#### + +# Defined using current install prefix by replacing package name using +# PYTHON_PACKAGE from spksrc.python.mk, else use local install prefix +ifneq ($(PYTHON_PACKAGE),) +PYTHON_INSTALL_PREFIX = $(subst $(SPK_NAME),$(PYTHON_PACKAGE),$(INSTALL_PREFIX)) +else +PYTHON_INSTALL_PREFIX = $(INSTALL_PREFIX) +endif + +# Equivalent to STAGING_INSTALL_PREFIX relative to found python install +ifeq ($(PYTHON_STAGING_INSTALL_PREFIX),) +PYTHON_STAGING_INSTALL_PREFIX = $(abspath $(PYTHON_WORK_DIR)/install/$(PYTHON_INSTALL_PREFIX)) +endif + +# set OPENSSL_*_PREFIX if unset +ifeq ($(strip $(OPENSSL_STAGING_PREFIX)),) +OPENSSL_STAGING_PREFIX = $(PYTHON_STAGING_INSTALL_PREFIX) +OPENSSL_PREFIX = $(PYTHON_INSTALL_PREFIX) +endif + +# Mandatory for rustc wheel building at crossenv preparation time +# --> Using python-cc.mk defined variable when cross-compiling wheels at subsequent steps! +export PYO3_CROSS_LIB_DIR = $(PYTHON_STAGING_INSTALL_PREFIX)/lib/ +export PYO3_CROSS_INCLUDE_DIR = $(PYTHON_STAGING_INSTALL_PREFIX)/include/ +# Mandatory of using OPENSSL_*_DIR starting with cryptography version >= 40 +# https://docs.rs/openssl/latest/openssl/#automatic +export OPENSSL_LIB_DIR = $(OPENSSL_STAGING_PREFIX)/lib/ +export OPENSSL_INCLUDE_DIR = $(OPENSSL_STAGING_PREFIX)/include/ + +# set PYTHONPATH for spksrc.python-module.mk +export PYTHONPATH = $(PYTHON_LIB_NATIVE):$(PYTHON_STAGING_INSTALL_PREFIX)/lib/python$(PYTHON_PKG_VERS_MAJOR_MINOR)/site-packages/ + +### + +# Create the crossenv in preparation for +# cross-compiling all the necessary wheels +# +# To validate crossenv parameters: +# $ work--/crossenv/cross/bin/python +# >>> import sys +# >>> sys.path +# +build_crossenv_target: SHELL:=/bin/bash +build_crossenv_target: $(CROSSENV_PATH)/build/python-cc.mk + @$(MSG) $$(date +%Y%m%d-%H%M%S) MAKELEVEL: $(MAKELEVEL), PARALLEL_MAKE: $(PARALLEL_MAKE), ARCH: $(ARCH)-$(TCVERSION), CROSSENV: $(WHEEL) >> $(PSTAT_LOG) + @$(MSG) Python sources: $(wildcard $(PYTHON_WORK_DIR)/Python-[0-9]*) + @$(MSG) crossenv wheel packages: $(CROSSENV_DEFAULT_PIP), $(CROSSENV_DEFAULT_SETUPTOOLS), $(CROSSENV_DEFAULT_WHEEL) + @$(MSG) crossenv requirement definition: $(CROSSENV_BUILD_REQUIREMENTS) + mkdir -p $(PYTHON_LIB_CROSS) + cp -RL $(HOSTPYTHON_LIB_NATIVE) $(abspath $(PYTHON_LIB_CROSS)/../) + @echo $(PYTHON_NATIVE) -m crossenv $(abspath $(PYTHON_WORK_DIR)/install/$(PYTHON_INSTALL_PREFIX)/bin/python$(PYTHON_PKG_VERS_MAJOR_MINOR)) \ + --cc $(TC_PATH)$(TC_PREFIX)gcc \ + --cxx $(TC_PATH)$(TC_PREFIX)c++ \ + --ar $(TC_PATH)$(TC_PREFIX)ar \ + --sysroot $(TC_SYSROOT) \ + --env LIBRARY_PATH= \ + --manylinux manylinux2014 \ + "$(CROSSENV_PATH)" + @$(RUN) $(PYTHON_NATIVE) -m crossenv $(abspath $(PYTHON_WORK_DIR)/install/$(PYTHON_INSTALL_PREFIX)/bin/python$(PYTHON_PKG_VERS_MAJOR_MINOR)) \ + --cc $(TC_PATH)$(TC_PREFIX)gcc \ + --cxx $(TC_PATH)$(TC_PREFIX)c++ \ + --ar $(TC_PATH)$(TC_PREFIX)ar \ + --sysroot $(TC_SYSROOT) \ + --env LIBRARY_PATH= \ + --manylinux manylinux2014 \ + "$(CROSSENV_PATH)" +ifeq ($(CROSSENV_BUILD_WHEEL),default) + @$(MSG) Setting default crossenv $(CROSSENV_PATH) + @$(MSG) ln -sf crossenv-default $(WORK_DIR)/crossenv + @$(RUN) ln -sf crossenv-default $(WORK_DIR)/crossenv +endif + @$(RUN) wget --no-verbose https://bootstrap.pypa.io/get-pip.py --directory-prefix=$(CROSSENV_PATH)/build ; \ + $(RUN) chmod 755 $(CROSSENV_PATH)/build/get-pip.py + @. $(CROSSENV_PATH)/bin/activate ; \ + $(MSG) build-python install $(CROSSENV_DEFAULT_PIP) ; \ + $(RUN) $$(which build-python) $(CROSSENV_PATH)/build/get-pip.py $(CROSSENV_DEFAULT_PIP) --no-setuptools --no-wheel --disable-pip-version-check ; \ + $(MSG) cross-python Install $(CROSSENV_DEFAULT_PIP) ; \ + $(RUN) $$(which cross-python) $(CROSSENV_PATH)/build/get-pip.py $(CROSSENV_DEFAULT_PIP) --no-setuptools --no-wheel --disable-pip-version-check + @. $(CROSSENV_PATH)/bin/activate ; \ + $(MSG) build-pip Install $(CROSSENV_DEFAULT_SETUPTOOLS) $(CROSSENV_DEFAULT_WHEEL) ; \ + $(RUN) $$(which build-pip) --cache-dir $(PIP_CACHE_DIR) --disable-pip-version-check install $(CROSSENV_DEFAULT_SETUPTOOLS) $(CROSSENV_DEFAULT_WHEEL) ; \ + $(MSG) cross-pip Install $(CROSSENV_DEFAULT_SETUPTOOLS) $(CROSSENV_DEFAULT_WHEEL) ; \ + $(RUN) $$(which cross-pip) --cache-dir $(PIP_CACHE_DIR) --disable-pip-version-check install $(CROSSENV_DEFAULT_SETUPTOOLS) $(CROSSENV_DEFAULT_WHEEL) + @$(MSG) [$(CROSSENV_PATH)] Processing $(CROSSENV_BUILD_REQUIREMENTS) + @. $(CROSSENV_PATH)/bin/activate ; \ + $(MSG) build-pip install -r $(CROSSENV_BUILD_REQUIREMENTS) ; \ + $(RUN) \ + PATH="$(abspath $(WORK_DIR)/../../../native/$(PYTHON_PKG_NAME)/work-native/install/usr/local/bin):$(PATH)" \ + LD_LIBRARY_PATH="$(abspath $(WORK_DIR)/../../../native/$(PYTHON_PKG_NAME)/work-native/install/usr/local/lib):$(LD_LIBRARY_PATH)" \ + $$(which build-pip) --cache-dir $(PIP_CACHE_DIR) --disable-pip-version-check install -r $(CROSSENV_BUILD_REQUIREMENTS) ; \ + $(MSG) cross-pip Install -r $(CROSSENV_BUILD_REQUIREMENTS) ; \ + $(RUN) \ + PATH="$(abspath $(WORK_DIR)/../../../native/$(PYTHON_PKG_NAME)/work-native/install/usr/local/bin):$(PATH)" \ + LD_LIBRARY_PATH="$(abspath $(WORK_DIR)/../../../native/$(PYTHON_PKG_NAME)/work-native/install/usr/local/lib):$(LD_LIBRARY_PATH)" \ + $$(which cross-pip) --cache-dir $(PIP_CACHE_DIR) --disable-pip-version-check install -r $(CROSSENV_BUILD_REQUIREMENTS) + @. $(CROSSENV_PATH)/bin/activate ; \ + $(MSG) "Package list for $(CROSSENV_PATH):" ; \ + $(RUN) $$(which cross-pip) list + +## +## python-cc.mk +## +$(CROSSENV_PATH)/build/python-cc.mk: + @$(MSG) "crossenv environment definition: $@" + @mkdir -p $(CROSSENV_PATH)/build + @echo BUILD_ARCH=$(shell expr "$(TC_TARGET)" : '\([^-]*\)' ) > $@ + @echo HOST_ARCH=$(shell uname -m) >> $@ + @echo CROSSENV_PATH=$(CROSSENV_PATH) >> $@ + @echo CROSSENV=$(CROSSENV_PATH)/bin/activate >> $@ + @echo HOSTPYTHON=$(abspath $(PYTHON_WORK_DIR)/$(PYTHON_PKG_DIR)/hostpython) >> $@ + @echo HOSTPYTHON_LIB_NATIVE=$(HOSTPYTHON_LIB_NATIVE) >> $@ + @echo PYTHON_LIB_NATIVE=$(PYTHON_LIB_NATIVE) >> $@ + @echo PYTHON_LIB_CROSS=$(PYTHON_LIB_CROSS) >> $@ + @echo PYTHON_SITE_PACKAGES_NATIVE=$(abspath $(WORK_DIR)/../../../native/$(PYTHON_PKG_NAME)/work-native/install/usr/local/lib/python$(PYTHON_PKG_VERS_MAJOR_MINOR)/site-packages) >> $@ + @echo PYTHON_INTERPRETER=$(PYTHON_INSTALL_PREFIX)/bin/python$(PYTHON_PKG_VERS_MAJOR_MINOR) >> $@ + @echo PYTHON_VERSION=$(PYTHON_PKG_VERS_MAJOR_MINOR) >> $@ + @echo PYTHON_LIB_DIR=lib/python$(PYTHON_PKG_VERS_MAJOR_MINOR) >> $@ + @echo PYTHON_INC_DIR=include/python$(PYTHON_PKG_VERS_MAJOR_MINOR) >> $@ + @echo PYO3_CROSS_LIB_DIR=$(abspath $(PYTHON_STAGING_INSTALL_PREFIX)/lib) >> $@ + @echo PYO3_CROSS_INCLUDE_DIR=$(abspath $(PYTHON_STAGING_INSTALL_PREFIX)/include) >> $@ + @echo OPENSSL_LIB_DIR=$(abspath $(PYTHON_STAGING_INSTALL_PREFIX)/lib) >> $@ + @echo OPENSSL_INCLUDE_DIR=$(abspath $(PYTHON_STAGING_INSTALL_PREFIX)/include) >> $@ + @echo PIP=$(abspath $(WORK_DIR)/../../../native/$(PYTHON_PKG_NAME)/work-native/install/usr/local/bin/pip) >> $@ + @echo CROSS_COMPILE_WHEELS=1 >> $@ + @echo ADDITIONAL_WHEEL_BUILD_ARGS=--no-build-isolation >> $@ + @echo CROSSENV_BUILD_REQUIREMENTS=$(CROSSENV_BUILD_REQUIREMENTS) >> $@ + @echo CROSSENV_DEFAULT_PIP=$(CROSSENV_DEFAULT_PIP_VERSION) >> $@ + @echo CROSSENV_DEFAULT_SETUPTOOLS=$(CROSSENV_DEFAULT_SETUPTOOLS_VERSION) >> $@ + @echo CROSSENV_DEFAULT_WHEEL=$(CROSSENV_DEFAULT_WHEEL_VERSION) >> $@ + +ifeq ($(wildcard $(CROSSENV_COOKIE)),) +crossenv: $(CROSSENV_COOKIE) + +$(CROSSENV_COOKIE): $(POST_CROSSENV_TARGET) + $(create_target_dir) + @touch -f $@ +else +crossenv: ; +endif diff --git a/mk/spksrc.python-module.mk b/mk/spksrc.python-module.mk index 5881f02113d..3f1467f5a88 100644 --- a/mk/spksrc.python-module.mk +++ b/mk/spksrc.python-module.mk @@ -1,5 +1,5 @@ ### Python module rules -# Invoke make to (cross-) compile a python module. +# Invoke make to (cross-) compile a python extension module. # You can do some customization through python-cc.mk # Python module targets @@ -16,32 +16,29 @@ endif # Resume with standard spksrc.cross-cc.mk include ../../mk/spksrc.cross-cc.mk -# Fetch python variables --include $(WORK_DIR)/python-cc.mk +# Define where is located the crossenv +CROSSENV_MODULE_PATH = $(firstword $(wildcard $(WORK_DIR)/crossenv-$(PKG_NAME)-$(PKG_VERS) $(WORK_DIR)/crossenv-$(PKG_NAME) $(WORK_DIR)/crossenv-default)) -# Python module variables -ifneq ($(wildcard $(PYTHONPATH)),) -PYTHONPATH = $(PYTHON_SITE_PACKAGES_NATIVE):$(PYTHON_LIB_NATIVE):$(INSTALL_DIR)$(INSTALL_PREFIX)/$(PYTHON_LIB_DIR)/site-packages/ -endif +### Prepare crossenv +build_crossenv_module: + @$(MSG) WHEEL="$(PKG_NAME)-$(PKG_VERS)" $(MAKE) crossenv-$(ARCH)-$(TCVERSION) + -@MAKEFLAGS= WHEEL="$(PKG_NAME)-$(PKG_VERS)" $(MAKE) crossenv-$(ARCH)-$(TCVERSION) -### Python module rules -compile_python_module: -ifeq ($(strip $(CROSSENV)),) -# Python 2 way - @$(RUN) PYTHONPATH=$(PYTHONPATH) $(HOSTPYTHON) setup.py build_ext -I $(STAGING_INSTALL_PREFIX)/include -L $(STAGING_INSTALL_PREFIX)/lib $(BUILD_ARGS) -else -# Python 3 case: using crossenv helper - @. $(CROSSENV) && $(RUN) PYTHONPATH=$(PYTHONPATH) python setup.py build_ext -I $(STAGING_INSTALL_PREFIX)/include -L $(STAGING_INSTALL_PREFIX)/lib $(BUILD_ARGS) -endif +### Python extension module rules +compile_python_module: build_crossenv_module + $(foreach e,$(shell cat $(CROSSENV_MODULE_PATH)/build/python-cc.mk),$(eval $(e))) + $(eval PYTHONPATH = $(PYTHON_SITE_PACKAGES_NATIVE):$(PYTHON_LIB_NATIVE):$(INSTALL_DIR)$(INSTALL_PREFIX)/$(PYTHON_LIB_DIR)/site-packages/) + @$(MSG) "PYTHON MODULE: activate crossenv found: $(CROSSENV)" + @. $(CROSSENV) ; \ + $(RUN) PYTHONPATH=$(PYTHONPATH) python setup.py build_ext \ + -I $(STAGING_INSTALL_PREFIX)/include \ + -L $(STAGING_INSTALL_PREFIX)/lib $(BUILD_ARGS) install_python_module: -ifeq ($(strip $(CROSSENV)),) -# Python 2 way - @$(RUN) PYTHONPATH=$(PYTHONPATH) $(HOSTPYTHON) setup.py install --root $(INSTALL_DIR) --prefix $(INSTALL_PREFIX) $(INSTALL_ARGS) -else -# Python 3 case: using crossenv helper - @. $(CROSSENV) && $(RUN) PYTHONPATH=$(PYTHONPATH) python setup.py install --root $(INSTALL_DIR) --prefix $(INSTALL_PREFIX) $(INSTALL_ARGS) -endif + @. $(CROSSENV) ; \ + $(RUN) PYTHONPATH=$(PYTHONPATH) python setup.py install \ + --root $(INSTALL_DIR) \ + --prefix $(INSTALL_PREFIX) $(INSTALL_ARGS) fix_shebang_python_module: @cat PLIST | sed 's/:/ /' | while read type file ; do \ @@ -55,3 +52,7 @@ fix_shebang_python_module: all: install fix_shebang_python_module +### + +# Allow generating per-wheel crossenv +include ../../mk/spksrc.crossenv.mk diff --git a/mk/spksrc.python-wheel.mk b/mk/spksrc.python-wheel.mk index 82cd3e683cc..27d29315a70 100644 --- a/mk/spksrc.python-wheel.mk +++ b/mk/spksrc.python-wheel.mk @@ -19,35 +19,37 @@ endif # Resume with standard spksrc.cross-cc.mk include ../../mk/spksrc.cross-cc.mk -# Fetch python variables --include $(WORK_DIR)/python-cc.mk +# Define where is located the crossenv +CROSSENV_MODULE_PATH = $(firstword $(wildcard $(WORK_DIR)/crossenv-$(PKG_NAME)-$(PKG_VERS) $(WORK_DIR)/crossenv-$(PKG_NAME) $(WORK_DIR)/crossenv-default)) -# If using spk.python.mk with PYTHON_STAGING_PREFIX defined +# If using spksrc.python.mk with PYTHON_STAGING_PREFIX defined # then redirect STAGING_INSTALL_PREFIX so rust # wheels can find openssl and other libraries ifneq ($(wildcard $(PYTHON_STAGING_PREFIX)),) STAGING_INSTALL_PREFIX := $(PYTHON_STAGING_PREFIX) endif -# Python module variables -ifeq ($(strip $(PYTHONPATH)),) -PYTHONPATH = $(PYTHON_LIB_NATIVE):$(INSTALL_DIR)$(INSTALL_PREFIX)/$(PYTHON_LIB_DIR)/site-packages/ -endif - ## python wheel specific configurations include ../../mk/spksrc.wheel-env.mk +### Prepare crossenv +build_crossenv_module: + @$(MSG) WHEEL="$(PKG_NAME)-$(PKG_VERS)" $(MAKE) crossenv-$(ARCH)-$(TCVERSION) + @WHEEL="$(PKG_NAME)-$(PKG_VERS)" $(MAKE) crossenv-$(ARCH)-$(TCVERSION) + ### Python wheel rules -build_python_wheel_target: -ifeq ($(strip $(CROSSENV)),) -# Python 2 way - @$(RUN) PYTHONPATH=$(PYTHONPATH) $(HOSTPYTHON) -c "import setuptools;__file__='setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" $(BUILD_ARGS) bdist_wheel $(WHEELS_BUILD_ARGS) -d $(WHEELHOUSE) -else -# Python 3 case: using crossenv helper - @. $(CROSSENV) && $(RUN) _PYTHON_HOST_PLATFORM=$(TC_TARGET) python3 setup.py $(BUILD_ARGS) bdist_wheel $(WHEELS_BUILD_ARGS) -d $(WHEELHOUSE) -endif +build_python_wheel_target: build_crossenv_module + $(foreach e,$(shell cat $(CROSSENV_MODULE_PATH)/build/python-cc.mk),$(eval $(e))) + @. $(CROSSENV) ; \ + $(MSG) _PYTHON_HOST_PLATFORM=$(TC_TARGET) cross-python3 -m build $(BUILD_ARGS) --wheel $(WHEELS_BUILD_ARGS) --outdir $(WHEELHOUSE) ; \ + $(RUN) _PYTHON_HOST_PLATFORM=$(TC_TARGET) cross-python3 -m build $(BUILD_ARGS) --wheel $(WHEELS_BUILD_ARGS) --outdir $(WHEELHOUSE) @$(RUN) echo "$(PKG_NAME)==$(PKG_VERS)" >> $(WHEELHOUSE)/$(WHEELS_CROSS_COMPILE) post_install_python_wheel_target: $(WHEEL_TARGET) install_python_wheel all: install + +### + +# Use crossenv +include ../../mk/spksrc.crossenv.mk diff --git a/mk/spksrc.python.mk b/mk/spksrc.python.mk index 07b98ef7dda..e26ca07ec4a 100644 --- a/mk/spksrc.python.mk +++ b/mk/spksrc.python.mk @@ -5,58 +5,53 @@ # PYTHON_PACKAGE Must be set to the python spk folder (python310, python311, ...) # set default spk/python* path to use -PYTHON_PACKAGE_ROOT = $(realpath $(CURDIR)/../../spk/$(PYTHON_PACKAGE)/work-$(ARCH)-$(TCVERSION)) +PYTHON_PACKAGE_WORK_DIR = $(realpath $(CURDIR)/../../spk/$(PYTHON_PACKAGE)/work-$(ARCH)-$(TCVERSION)) include ../../mk/spksrc.archs.mk -ifneq ($(wildcard $(PYTHON_PACKAGE_ROOT)),) +ifneq ($(wildcard $(PYTHON_PACKAGE_WORK_DIR)),) -# Export the python package variable so it is usable in cross/* +# Export variables so to be usable in crossenv and cross/* export PYTHON_PACKAGE +export PYTHON_PACKAGE_WORK_DIR +export SPK_NAME # Set Python installtion prefix directory variables -ifeq ($(strip $(PYTHON_STAGING_PREFIX)),) +ifeq ($(strip $(PYTHON_STAGING_INSTALL_PREFIX)),) export PYTHON_PREFIX = /var/packages/$(PYTHON_PACKAGE)/target -export PYTHON_STAGING_PREFIX = $(realpath $(PYTHON_PACKAGE_ROOT)/install/$(PYTHON_PREFIX)) +export PYTHON_STAGING_INSTALL_PREFIX = $(realpath $(PYTHON_PACKAGE_WORK_DIR)/install/$(PYTHON_PREFIX)) endif # Set OpenSSL installtion prefix directory variables ifeq ($(strip $(OPENSSL_STAGING_PREFIX)),) export OPENSSL_PREFIX = $(PYTHON_PREFIX) -export OPENSSL_STAGING_PREFIX = $(PYTHON_STAGING_PREFIX) +export OPENSSL_STAGING_PREFIX = $(PYTHON_STAGING_INSTALL_PREFIX) endif # set build flags including ld to rewrite for the library path # used to access python package provide libraries at destination -export ADDITIONAL_CFLAGS += -I$(PYTHON_STAGING_PREFIX)/include -export ADDITIONAL_CPPFLAGS += -I$(PYTHON_STAGING_PREFIX)/include -export ADDITIONAL_CXXFLAGS += -I$(PYTHON_STAGING_PREFIX)/include -export ADDITIONAL_LDFLAGS += -L$(PYTHON_STAGING_PREFIX)/lib -export ADDITIONAL_LDFLAGS += -Wl,--rpath-link,$(PYTHON_STAGING_PREFIX)/lib -Wl,--rpath,$(PYTHON_PREFIX)/lib +export ADDITIONAL_CFLAGS += -I$(PYTHON_STAGING_INSTALL_PREFIX)/include +export ADDITIONAL_CPPFLAGS += -I$(PYTHON_STAGING_INSTALL_PREFIX)/include +export ADDITIONAL_CXXFLAGS += -I$(PYTHON_STAGING_INSTALL_PREFIX)/include +export ADDITIONAL_LDFLAGS += -L$(PYTHON_STAGING_INSTALL_PREFIX)/lib +export ADDITIONAL_LDFLAGS += -Wl,--rpath-link,$(PYTHON_STAGING_INSTALL_PREFIX)/lib -Wl,--rpath,$(PYTHON_PREFIX)/lib # similarly, ld to rewrite OpenSSL library path if differs -ifneq ($(OPENSSL_STAGING_PREFIX),$(PYTHON_STAGING_PREFIX)) +ifneq ($(OPENSSL_STAGING_PREFIX),$(PYTHON_STAGING_INSTALL_PREFIX)) export ADDITIONAL_LDFLAGS += -L$(OPENSSL_STAGING_PREFIX)/lib export ADDITIONAL_LDFLAGS += -Wl,--rpath-link,$(OPENSSL_STAGING_PREFIX)/lib -Wl,--rpath,$(OPENSSL_PREFIX)/lib endif -# get PYTHON_VERSION and other variables --include $(PYTHON_PACKAGE_ROOT)/python-cc.mk +# Re-use all default python mandatory libraries (with exception of xz, zlib) +PYTHON_LIBS_EXCLUDE = %lzma.pc %zlib.pc +PYTHON_LIBS := $(filter-out $(PYTHON_LIBS_EXCLUDE),$(wildcard $(PYTHON_STAGING_INSTALL_PREFIX)/lib/pkgconfig/*.pc)) -# set PYTHONPATH for spksrc.python-module.mk -PYTHONPATH = $(PYTHON_SITE_PACKAGES_NATIVE):$(PYTHON_LIB_NATIVE):$(PYTHON_STAGING_PREFIX)/lib/python$(PYTHON_VERSION)/site-packages/ - -# Re-use all default python mandatory libraries -PYTHON_LIBS := $(wildcard $(PYTHON_STAGING_PREFIX)/lib/pkgconfig/*.pc) - -# Re-use all python dependencies and mark as already done -PYTHON_DEPENDS := $(foreach cross,$(foreach pkg_name,$(shell $(MAKE) dependency-list -C $(realpath $(PYTHON_PACKAGE_ROOT)/../) 2>/dev/null | grep ^$(PYTHON_PACKAGE) | cut -f2 -d:),$(shell sed -n 's/^PKG_NAME = \(.*\)/\1/p' $(realpath $(CURDIR)/../../$(pkg_name)/Makefile))),$(wildcard $(PYTHON_PACKAGE_ROOT)/.$(cross)-*_done)) +# Re-use all python dependencies and mark as already done (with exceltion of xz, zlib) +PYTHON_DEPENDS_EXCLUDE = xz zlib +PYTHON_DEPENDS := $(foreach cross,$(filter-out $(PYTHON_DEPENDS_EXCLUDE),$(foreach pkg_name,$(shell $(MAKE) dependency-list -C $(realpath $(PYTHON_PACKAGE_WORK_DIR)/../) 2>/dev/null | grep ^$(PYTHON_PACKAGE) | cut -f2 -d:),$(shell sed -n 's/^PKG_NAME = \(.*\)/\1/p' $(realpath $(CURDIR)/../../$(pkg_name)/Makefile)))),$(wildcard $(PYTHON_PACKAGE_WORK_DIR)/.$(cross)-*_done)) # call-up pre-depend to prepare the shared python build environment PRE_DEPEND_TARGET = python_pre_depend -ifneq ($(strip $(ADDITIONAL_CROSSENV_WHEELS)),) -POST_DEPEND_TARGET = python_post_depend -endif else ifneq ($(findstring $(ARCH),$(ARMv5_ARCHS) $(OLD_PPC_ARCHS)),$(ARCH)) @@ -70,29 +65,18 @@ include ../../mk/spksrc.spk.mk python_pre_depend: @$(MSG) "*****************************************************" @$(MSG) "*** Use existing shared objects from python $(PYTHON_VERSION)" - @$(MSG) "*** PATH: $(PYTHON_PACKAGE_ROOT)" + @$(MSG) "*** PATH: $(PYTHON_PACKAGE_WORK_DIR)" @$(MSG) "*****************************************************" @mkdir -p $(STAGING_INSTALL_PREFIX)/lib/pkgconfig/ @$(foreach lib,$(PYTHON_LIBS),ln -sf $(lib) $(STAGING_INSTALL_PREFIX)/lib/pkgconfig/ ;) - @ln -sf $(PYTHON_PACKAGE_ROOT)/crossenv $(WORK_DIR)/crossenv - @ln -sf $(PYTHON_PACKAGE_ROOT)/python-cc.mk $(WORK_DIR)/python-cc.mk @$(foreach _done,$(PYTHON_DEPENDS), ln -sf $(_done) $(WORK_DIR) ;) - @# EXCEPTION: Ensure zlib is always built locally - @rm -f $(STAGING_INSTALL_PREFIX)/lib/pkgconfig/zlib.pc $(WORK_DIR)/.zlib* @# EXCEPTION: Do not symlink cross/* wheel builds @make --no-print-directory dependency-flat | sort -u | grep cross/ | while read depend ; do \ makefile="../../$${depend}/Makefile" ; \ if grep -q spksrc.python-wheel.mk $${makefile} ; then \ pkgstr=$$(grep ^PKG_NAME $${makefile}) ; \ pkgname=$$(echo $${pkgstr#*=} | xargs) ; \ - echo "rm -fr work-*/$${pkgname}* work-*/.$${pkgname}-*" ; \ - rm -fr work-*/$${pkgname}* work-*/.$${pkgname}-* ; \ + echo "rm -fr work-$(ARCH)-$(TCVERSION)/$${pkgname}* work-$(ARCH)-$(TCVERSION)/.$${pkgname}-*" ; \ + rm -fr work-$(ARCH)-$(TCVERSION)/$${pkgname}* work-$(ARCH)-$(TCVERSION)/.$${pkgname}-* ; \ fi ; \ done - -.PHONY: python_post_depend -python_post_depend: - @$(MSG) "Install to crossenv: $(ADDITIONAL_CROSSENV_WHEELS)" - @. $(WORK_DIR)/crossenv/bin/activate ; \ - $(RUN) build-pip --disable-pip-version-check install $(ADDITIONAL_CROSSENV_WHEELS) ; \ - $(RUN) pip --disable-pip-version-check install $(ADDITIONAL_CROSSENV_WHEELS) diff --git a/mk/spksrc.spk.mk b/mk/spksrc.spk.mk index d827325fc0a..17582ddffaf 100644 --- a/mk/spksrc.spk.mk +++ b/mk/spksrc.spk.mk @@ -159,6 +159,7 @@ get_github_maintainer_url = "https://github.com/SynoCommunity" get_github_maintainer_name = $(MAINTAINER) endif +$(WORK_DIR)/INFO: SHELL:=/bin/sh $(WORK_DIR)/INFO: $(create_target_dir) @$(MSG) "Creating INFO file for $(SPK_NAME)" @@ -166,11 +167,11 @@ $(WORK_DIR)/INFO: if [ "$(ARCH)" = "noarch" ]; then \ echo "ERROR: 'noarch' package without TCVERSION is not supported" ; \ exit 1; \ - else \ + else \ echo "ERROR: Arch '$(ARCH)' is not a supported architecture" ; \ echo " - There is no remaining arch in '$(TC_ARCH)' for unsupported archs '$(UNSUPPORTED_ARCHS)'"; \ exit 1; \ - fi; \ + fi; \ fi @echo package=\"$(SPK_NAME)\" > $@ @echo version=\"$(SPK_VERS)-$(SPK_REV)\" >> $@ @@ -178,10 +179,10 @@ $(WORK_DIR)/INFO: @/bin/echo -n "${DESCRIPTION}" | sed -e 's/\\//g' -e 's/"/\\"/g' >> $@ @echo "\"" >> $@ @echo $(foreach LANGUAGE, $(LANGUAGES), \ - $(shell [ ! -z "$(DESCRIPTION_$(shell echo $(LANGUAGE) | tr [:lower:] [:upper:]))" ] && \ - /bin/echo -n "description_$(LANGUAGE)=\\\"" && \ - /bin/echo -n "$(DESCRIPTION_$(shell echo $(LANGUAGE) | tr [:lower:] [:upper:]))" | sed -e 's/"/\\\\\\"/g' && \ - /bin/echo -n "\\\"\\\n")) | sed -e 's/ description_/description_/g' >> $@ + $(shell [ ! -z "$(DESCRIPTION_$(shell echo $(LANGUAGE) | tr [:lower:] [:upper:]))" ] && \ + /bin/echo -n "description_$(LANGUAGE)=\\\"" && \ + /bin/echo -n "$(DESCRIPTION_$(shell echo $(LANGUAGE) | tr [:lower:] [:upper:]))" | sed -e 's/"/\\\\\\"/g' && \ + /bin/echo -n "\\\"\\\n")) | sed -e 's/ description_/description_/g' >> $@ @echo arch=\"$(SPK_ARCH)\" >> $@ @echo maintainer=\"$(call get_github_maintainer_name,$(MAINTAINER))\" >> $@ ifeq ($(strip $(MAINTAINER_URL)),) @@ -411,7 +412,7 @@ ifneq ($(strip $(WIZARDS_TEMPLATES_DIR)),) $(eval IS_DSM_7_OR_GREATER = $(if $(filter 1,$(call version_ge, $(TCVERSION), 7.0)),true,false)) $(eval IS_DSM_7 = $(IS_DSM_7_OR_GREATER)) $(eval IS_DSM_6 = $(if $(filter true,$(IS_DSM_6_OR_GREATER)),$(if $(filter true,$(IS_DSM_7)),false,true),false)) - @for template in `find $(WIZARDS_TEMPLATES_DIR) -maxdepth 1 -type f -and \( $(WIZARD_FILE_NAMES) \) -print`; do \ + @for template in $(shell find $(WIZARDS_TEMPLATES_DIR) -maxdepth 1 -type f -and \( $(WIZARD_FILE_NAMES) \) -print); do \ template_filename="$$(basename $${template})"; \ template_name="$${template_filename%.*}"; \ if [ "$${template_name}" = "$${template_filename}" ]; then \ @@ -453,12 +454,12 @@ ifneq ($(strip $(WIZARDS_DIR)),) rm "$(DSM_WIZARDS_DIR)/uninstall_uifile"; \ fi @if [ -d "$(WIZARDS_DIR)$(TCVERSION)" ]; then \ - $(MSG) "Create DSM Version specific Wizards: $(WIZARDS_DIR)$(TCVERSION)"; \ - find $${SPKSRC_WIZARDS_DIR}$(TCVERSION) -maxdepth 1 -type f -and \( $(WIZARD_FILE_NAMES) \) -print -exec cp -f {} $(DSM_WIZARDS_DIR) \; ;\ + $(MSG) "Create DSM Version specific Wizards: $(WIZARDS_DIR)$(TCVERSION)"; \ + find $${SPKSRC_WIZARDS_DIR}$(TCVERSION) -maxdepth 1 -type f -and \( $(WIZARD_FILE_NAMES) \) -print -exec cp -f {} $(DSM_WIZARDS_DIR) \; ;\ fi @if [ -d "$(DSM_WIZARDS_DIR)" ]; then \ - find $(DSM_WIZARDS_DIR) -maxdepth 1 -type f -not -name "*.sh" -print -exec chmod 0644 {} \; ;\ - find $(DSM_WIZARDS_DIR) -maxdepth 1 -type f -name "*.sh" -print -exec chmod 0755 {} \; ;\ + find $(DSM_WIZARDS_DIR) -maxdepth 1 -type f -not -name "*.sh" -print -exec chmod 0644 {} \; ;\ + find $(DSM_WIZARDS_DIR) -maxdepth 1 -type f -name "*.sh" -print -exec chmod 0755 {} \; ;\ fi endif @@ -552,6 +553,12 @@ wheelcleancache: wheelclean wheelcleanall: wheelcleancache rm -fr ../../distrib/pip +crossenvclean: wheelclean + rm -fr work-*/crossenv* + rm -fr work-*/.crossenv-*_done + +crossenvcleanall: wheelcleanall crossenvclean + pythonclean: wheelcleanall rm -fr work-*/.[Pp]ython*-install_done \ rm -fr work-*/crossenv diff --git a/mk/spksrc.tc.mk b/mk/spksrc.tc.mk index b380edb7413..fc887f10957 100644 --- a/mk/spksrc.tc.mk +++ b/mk/spksrc.tc.mk @@ -129,19 +129,37 @@ endif echo "set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY $(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY))" ; \ echo "set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE $(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE))" + + .PHONY: meson_vars meson_vars: + @echo "[host_machine]" ; \ + echo "system = 'linux'" ; \ + echo "cpu_family = '$(MESON_HOST_CPU_FAMILY)'" ; \ + echo "cpu = '$(MESON_HOST_CPU)'" ; \ + echo "endian = '$(MESON_HOST_ENDIAN)'" + @echo + @echo "[binaries]" ; \ + for tool in $(TOOLS) ; \ + do \ + target=$$(echo $${tool} | sed 's/\(.*\):\(.*\)/\1/' ) ; \ + source=$$(echo $${tool} | sed 's/\(.*\):\(.*\)/\2/' ) ; \ + if [ "$${target}" = "cpp" ]; then \ + echo "#$${target} = '$(WORK_DIR)/$(TC_TARGET)/bin/$(TC_PREFIX)cpp'" ; \ + else \ + echo "$${target} = '$(WORK_DIR)/$(TC_TARGET)/bin/$(TC_PREFIX)$${source}'" ; \ + fi ; \ + done + @echo + @echo "[properties]" ; \ + echo "sys_root = '$(WORK_DIR)/$(TC_TARGET)/$(TC_SYSROOT)'" + @echo @echo "[built-in]" ; \ echo "c_args = ['$(MESON_BUILTIN_C_ARGS)']" ; \ echo "c_link_args = ['$(MESON_BUILTIN_C_LINK_ARGS)']" ; \ echo "cpp_args = ['$(MESON_BUILTIN_CPP_ARGS)']" ; \ echo "cpp_link_args = ['$(MESON_BUILTIN_CPP_LINK_ARGS)']" @echo - @echo "[host_machine]" ; \ - echo "system = 'linux'" ; \ - echo "cpu_family = '$(MESON_HOST_CPU_FAMILY)'" ; \ - echo "cpu = '$(MESON_HOST_CPU)'" ; \ - echo "endian = '$(MESON_HOST_ENDIAN)'" .PHONY: tc_vars tc_vars: flag diff --git a/mk/spksrc.wheel-env.mk b/mk/spksrc.wheel-env.mk index c1dff9b7bf6..fbf9d01f199 100644 --- a/mk/spksrc.wheel-env.mk +++ b/mk/spksrc.wheel-env.mk @@ -6,8 +6,8 @@ include ../../mk/spksrc.cross-rust-env.mk # set PYTHON_*_PREFIX if unset -ifeq ($(strip $(PYTHON_STAGING_PREFIX)),) -PYTHON_STAGING_PREFIX = $(STAGING_INSTALL_PREFIX) +ifeq ($(strip $(PYTHON_STAGING_INSTALL_PREFIX)),) +PYTHON_STAGING_INSTALL_PREFIX = $(STAGING_INSTALL_PREFIX) PYTHON_PREFIX = $(INSTALL_PREFIX) endif @@ -17,16 +17,6 @@ OPENSSL_STAGING_PREFIX = $(STAGING_INSTALL_PREFIX) OPENSSL_PREFIX = $(INSTALL_PREFIX) endif -# Mandatory for rustc wheel building -ENV += PYO3_CROSS_LIB_DIR=$(PYTHON_STAGING_PREFIX)/lib/ -ENV += PYO3_CROSS_INCLUDE_DIR=$(PYTHON_STAGING_PREFIX)/include/ - -# Mandatory of using OPENSSL_*_DIR starting with -# cryptography version >= 40 -# https://docs.rs/openssl/latest/openssl/#automatic -ENV += OPENSSL_LIB_DIR=$(OPENSSL_STAGING_PREFIX)/lib/ -ENV += OPENSSL_INCLUDE_DIR=$(OPENSSL_STAGING_PREFIX)/include/ - # Enable pure-python packaging ifeq ($(strip $(WHEELS_PURE_PYTHON_PACKAGING_ENABLE)),) WHEELS_PURE_PYTHON_PACKAGING_ENABLE = FALSE @@ -67,9 +57,9 @@ WHEELS_DEFAULT_REQUIREMENT = $(WHEELS_CROSSENV_COMPILE) endif # For generating abi3 wheels with limited -# python API (e.g cp36 = Python 3.6) +# python API (e.g cp37 = Python 3.7) ifeq ($(strip $(PYTHON_LIMITED_API)),) -PYTHON_LIMITED_API = cp36 +PYTHON_LIMITED_API = cp37 endif # diff --git a/mk/spksrc.wheel.mk b/mk/spksrc.wheel.mk index ab8a7e36633..933c89c3823 100644 --- a/mk/spksrc.wheel.mk +++ b/mk/spksrc.wheel.mk @@ -17,6 +17,15 @@ WHEEL_COOKIE = $(WORK_DIR)/.$(COOKIE_PREFIX)wheel_done ## python wheel specific configurations include ../../mk/spksrc.wheel-env.mk +## python wheel specific configurations +include ../../mk/spksrc.crossenv.mk + +## meson specific configurations +include ../../mk/spksrc.cross-cmake-env.mk + +## meson specific configurations +include ../../mk/spksrc.cross-meson-env.mk + ## ifeq ($(strip $(PRE_WHEEL_TARGET)),) @@ -35,9 +44,23 @@ else $(POST_WHEEL_TARGET): $(WHEEL_TARGET) endif +wheel_msg_target: + @$(MSG) "Processing wheels of $(NAME)" + wheeldownload: SHELL:=/bin/bash wheeldownload: +ifeq ($(wildcard $(PIP_DISTRIB_DIR)),) + @$(MSG) Creating pip download directory: $(PIP_DISTRIB_DIR) @mkdir -p $(PIP_DISTRIB_DIR) +else + @$(MSG) Using existing pip download directory: $(PIP_DISTRIB_DIR) +endif +ifeq ($(wildcard $(PIP_CACHE_DIR)),) + @$(MSG) Creating pip caching directory: $(PIP_CACHE_DIR) + @mkdir -p $(PIP_CACHE_DIR) +else + @$(MSG) Using existing pip cache directory: $(PIP_CACHE_DIR) +endif @if [ -n "$(WHEELS)" ] ; then \ for wheel in $(WHEELS_2_DOWNLOAD) ; do \ $(MSG) "Downloading wheels from $$wheel ..." ; \ @@ -91,9 +114,6 @@ wheeldownload: $(MSG) "No wheels to download for [$(SPK_NAME)]" ; \ fi -wheel_msg_target: - @$(MSG) "Processing wheels of $(NAME)" - # # PIP_CACHE_OPT defaults to "--cache-dir $(PIP_CACHE_DIR)" # PIP_CACHE_DIR defaults to $(WORK_DIR)/pip @@ -107,96 +127,104 @@ wheel_msg_target: # it actually used a cache built from x64-7.1 # pre_wheel_target: wheel_msg_target wheeldownload -ifneq ($(strip $(WHEELS)),) - @if [ -n "$(PIP_CACHE_OPT)" ] ; then \ - mkdir -p $(PIP_CACHE_DIR) ; \ - fi; \ - mkdir -p $(WHEELHOUSE) ; \ - for wheel in $(WHEELS) ; do \ - if [ -f $$wheel ] ; then \ - if [ $$(basename $$wheel) = $(WHEELS_PURE_PYTHON) ]; then \ - $(MSG) "Adding existing $$wheel file as pure-python (discarding any cross-compiled)" ; \ - sed -e '/^cross:\|^#\|^$$/d' -e /^pure:/s/^pure://g $$wheel >> $(WHEELHOUSE)/$(WHEELS_PURE_PYTHON) ; \ - elif [ $$(basename $$wheel) = $(WHEELS_CROSSENV_COMPILE) ]; then \ - $(MSG) "Adding existing $$wheel file as cross-compiled (discarding any pure-python)" ; \ - sed -e '/^pure:\|^#\|^$$/d' -e /^cross:/s/^cross://g $$wheel >> $(WHEELHOUSE)/$(WHEELS_CROSSENV_COMPILE) ; \ - elif [ $$(basename $$wheel) = $(WHEELS_LIMITED_API) ]; then \ - $(MSG) "Adding existing $$wheel file as ABI-limited" ; \ - sed -e '/^#\|^$$/d' $$wheel >> $(WHEELHOUSE)/$(WHEELS_LIMITED_API) ; \ - else \ - $(MSG) "Adapting existing $$wheel file" ; \ - sed -rn /^pure:/s/^pure://gp $$wheel >> $(WHEELHOUSE)/$(WHEELS_PURE_PYTHON) ; \ - sed -rn /^cross:/s/^cross://gp $$wheel >> $(WHEELHOUSE)/$(WHEELS_CROSSENV_COMPILE) ; \ - sed -e '/^pure:\|^cross:\|^#\|^$$/d' $$wheel >> $(WHEELHOUSE)/$(WHEELS_DEFAULT_REQUIREMENT) ; \ - fi ;\ +ifneq ($(wildcard $(abspath $(addprefix $(WORK_DIR)/../,$(WHEELS)))),) +ifeq ($(wildcard $(WHEELHOUSE)),) + @$(MSG) Creating wheelhouse directory: $(WHEELHOUSE) + @mkdir -p $(WHEELHOUSE) +else + @$(MSG) Using existing wheelhouse directory: $(WHEELHOUSE) +endif + @$(MSG) Processing requirement files: + @for wheel in $(WHEELS) ; do \ + if [ $$(basename $$wheel) = $(WHEELS_PURE_PYTHON) ]; then \ + echo "===> Adding $$wheel as pure-python (wheelhouse/$(WHEELS_PURE_PYTHON))" ; \ + sed -e '/^[[:blank:]]*$$\|^#/d' $$wheel >> $(WHEELHOUSE)/$(WHEELS_PURE_PYTHON) ; \ + elif [ $$(basename $$wheel) = $(WHEELS_CROSSENV_COMPILE) ]; then \ + echo "===> Adding $$wheel as cross-compiled (wheelhouse/$(WHEELS_CROSSENV_COMPILE))" ; \ + sed -e '/^[[:blank:]]*$$\|^#/d' $$wheel >> $(WHEELHOUSE)/$(WHEELS_CROSSENV_COMPILE) ; \ + elif [ $$(basename $$wheel) = $(WHEELS_LIMITED_API) ]; then \ + echo "===> Adding $$wheel as ABI-limited (wheelhouse/$(WHEELS_LIMITED_API))" ; \ + sed -e '/^[[:blank:]]*$$\|^#/d' $$wheel >> $(WHEELHOUSE)/$(WHEELS_LIMITED_API) ; \ else \ - $(MSG) "ERROR: File $$wheel does not exist" ; \ - fi ; \ + echo "===> Adding $$wheel to default (wheelhouse/$(WHEELS_DEFAULT_REQUIREMENT))" ; \ + sed -e '/^[[:blank:]]*$$\|^#/d' $$wheel >> $(WHEELHOUSE)/$(WHEELS_DEFAULT_REQUIREMENT) ; \ + fi ;\ + done + @for file in $$(ls -1 $(WHEELHOUSE)/requirements-*.txt) ; do \ + sort -u -o $${file}{,} ; \ done endif # Build cross compiled wheels first, to fail fast. -# There might be an issue with some pure python wheels when built after that. build_wheel_target: SHELL:=/bin/bash build_wheel_target: $(PRE_WHEEL_TARGET) -ifneq ($(strip $(WHEELS)),) - $(foreach e,$(shell cat $(WORK_DIR)/python-cc.mk),$(eval $(e))) - @if [ -s $(WHEELHOUSE)/$(WHEELS_CROSSENV_COMPILE) -o -s $(WHEELHOUSE)/$(WHEELS_LIMITED_API) ]; then \ - $(MSG) "Cross-compiling wheels" ; \ +ifneq ($(wildcard $(abspath $(addprefix $(WORK_DIR)/../,$(patsubst %-pure.txt,,$(WHEELS))))),) + @while IFS= read -r requirement ; do \ + wheel=$${requirement#*:} ; \ + file=$$(basename $${requirement%%:*}) ; \ + [ "$$(grep -s egg <<< $${wheel})" ] && name=$$(echo $${wheel#*egg=} | cut -f1 -d=) || name=$${wheel%%[<>=]=*} ; \ + version=$$(echo $${requirement#*[<>=]=} | cut -f1 -d' ') ; \ + $(MSG) "WHEEL=\"$${name}-$${version}\" $(MAKE) crossenv-$(ARCH)-$(TCVERSION)" ; \ + MAKEFLAGS= WHEEL="$${name}-$${version}" $(MAKE) crossenv-$(ARCH)-$(TCVERSION) ; \ + for crossenv in $(WORK_DIR)/crossenv-$${name}-$${version} $(WORK_DIR)/crossenv-$${name} $(WORK_DIR)/crossenv ; do \ + [ -d $${crossenv} ] && . $${crossenv}/build/python-cc.mk && break ; \ + done ; \ crossenvPIP=$(PIP) ; \ - if [ -s "$(CROSSENV)" ] ; then \ - crossenvPIP=$$(. $(CROSSENV) && which pip) ; \ - $(MSG) "Python crossenv found: [$(CROSSENV)]" ; \ + $(MSG) "WHEEL: activate crossenv found: $${CROSSENV}" ; \ + if [ -s "$${CROSSENV}" ] ; then \ + crossenvPIP=$$(. $${CROSSENV} && which pip) ; \ + $(MSG) "Python crossenv found: [$${CROSSENV}]" ; \ $(MSG) "pip crossenv found: [$${crossenvPIP}]" ; \ - elif [ "$(PYTHON_VERSION)" != "2.7" ] ; then \ + elif [ "$${PYTHON_VERSION}" != "2.7" ] ; then \ $(MSG) "WARNING: Python crossenv NOT found!" ; \ $(MSG) "WARNING: pip crossenv NOT found!" ; \ else \ - $(MSG) "Python $(PYTHON_VERSION) uses pip: $${crossenvPIP}" ; \ + $(MSG) "Python $${PYTHON_VERSION} uses pip: $${crossenvPIP}" ; \ fi ; \ - while IFS= read -r requirement ; do \ - wheel=$${requirement#*:} ; \ - file=$$(basename $${requirement%%:*}) ; \ - [ "$${file}" = "$(WHEELS_LIMITED_API)" ] && abi3="--build-option=--py-limited-api=$(PYTHON_LIMITED_API)" || abi3="" ; \ - [ "$$(grep -s egg <<< $${wheel})" ] && name=$$(echo $${wheel#*egg=} | cut -f1 -d=) || name=$${wheel%%[<>=]=*} ; \ - global_options=$$(echo $(WHEELS_BUILD_ARGS) | sed -e 's/ \[/\n\[/g' | grep -i $${name} | cut -f2 -d] | xargs) ; \ - localCFLAGS=($$(echo $(WHEELS_CFLAGS) | sed -e 's/ \[/\n\[/g' | grep -i $${name} | cut -f2 -d] | xargs)) ; \ - localLDFLAGS=($$(echo $(WHEELS_LDFLAGS) | sed -e 's/ \[/\n\[/g' | grep -i $${name} | cut -f2 -d] | xargs)) ; \ - localCPPFLAGS=($$(echo $(WHEELS_CPPFLAGS) | sed -e 's/ \[/\n\[/g' | grep -i $${name} | cut -f2 -d] | xargs)) ; \ - localCXXFLAGS=($$(echo $(WHEELS_CXXFLAGS) | sed -e 's/ \[/\n\[/g' | grep -i $${name} | cut -f2 -d] | xargs)) ; \ - $(MSG) [$${name}] \ - $$([ "$$(echo $${localCFLAGS[@]})" ] && echo "CFLAGS=\"$${localCFLAGS[@]}\" ") \ - $$([ "$$(echo $${localCPPFLAGS[@]})" ] && echo "CPPFLAGS=\"$${localCPPFLAGS[@]}\" ") \ - $$([ "$$(echo $${localCXXFLAGS[@]})" ] && echo "CXXFLAGS=\"$${localCXXFLAGS[@]}\" ") \ - $$([ "$$(echo $${localLDFLAGS[@]})" ] && echo "LDFLAGS=\"$${localLDFLAGS[@]}\" ") \ - $$([ "$$(echo $${abi3})" ] && echo "$${abi3} ")" \ - $${global_options}" ; \ - PIP_CROSSENV=$${crossenvPIP} \ - REQUIREMENT=$${wheel} \ - ADDITIONAL_CFLAGS="-I$(STAGING_INSTALL_PREFIX)/$(PYTHON_INC_DIR) $${localCFLAGS[@]}" \ - ADDITIONAL_CPPFLAGS="-I$(STAGING_INSTALL_PREFIX)/$(PYTHON_INC_DIR) $${localCPPFLAGS[@]}" \ - ADDITIONAL_CXXFLAGS="-I$(STAGING_INSTALL_PREFIX)/$(PYTHON_INC_DIR) $${localCXXFLAGS[@]}" \ - ADDITIONAL_LDFLAGS="$${localLDFLAGS[@]}" \ - ABI3="$${abi3}" \ - PIP_GLOBAL_OPTION="$${global_options}" \ - $(MAKE) \ - cross-compile-wheel-$${name} || exit 1 ; \ - done < <(grep -svH -e "^\#" -e "^\$$" $(WHEELHOUSE)/$(WHEELS_CROSSENV_COMPILE) $(WHEELHOUSE)/$(WHEELS_LIMITED_API)) ; \ - else \ - $(MSG) "[SKIP] Cross-compiling wheels" ; \ - fi + $(MSG) "Cross-compiling [$${wheel%% *}] wheel using $${CROSSENV_PATH}" ; \ + [ "$${file}" = "$(WHEELS_LIMITED_API)" ] && abi3="--build-option=--py-limited-api=$(PYTHON_LIMITED_API)" || abi3="" ; \ + global_options=$$(echo $(WHEELS_BUILD_ARGS) | sed -e 's/ \[/\n\[/g' | grep -i $${name} | cut -f2 -d] | xargs) ; \ + localCFLAGS=($$(echo $(WHEELS_CFLAGS) | sed -e 's/ \[/\n\[/g' | grep -i $${name} | cut -f2 -d] | xargs)) ; \ + localLDFLAGS=($$(echo $(WHEELS_LDFLAGS) | sed -e 's/ \[/\n\[/g' | grep -i $${name} | cut -f2 -d] | xargs)) ; \ + localCPPFLAGS=($$(echo $(WHEELS_CPPFLAGS) | sed -e 's/ \[/\n\[/g' | grep -i $${name} | cut -f2 -d] | xargs)) ; \ + localCXXFLAGS=($$(echo $(WHEELS_CXXFLAGS) | sed -e 's/ \[/\n\[/g' | grep -i $${name} | cut -f2 -d] | xargs)) ; \ + $(MSG) [$${name}] \ + $$([ "$$(echo $${localCFLAGS[@]})" ] && echo "CFLAGS=\"$${localCFLAGS[@]}\" ") \ + $$([ "$$(echo $${localCPPFLAGS[@]})" ] && echo "CPPFLAGS=\"$${localCPPFLAGS[@]}\" ") \ + $$([ "$$(echo $${localCXXFLAGS[@]})" ] && echo "CXXFLAGS=\"$${localCXXFLAGS[@]}\" ") \ + $$([ "$$(echo $${localLDFLAGS[@]})" ] && echo "LDFLAGS=\"$${localLDFLAGS[@]}\" ") \ + $$([ "$$(echo $${abi3})" ] && echo "$${abi3} ")" \ + $${global_options}" ; \ + PIP_CROSSENV=$${crossenvPIP} \ + REQUIREMENT=$$(echo $${wheel%% *}) \ + ADDITIONAL_CFLAGS="-I$(STAGING_INSTALL_PREFIX)/$(PYTHON_INC_DIR) $${localCFLAGS[@]}" \ + ADDITIONAL_CPPFLAGS="-I$(STAGING_INSTALL_PREFIX)/$(PYTHON_INC_DIR) $${localCPPFLAGS[@]}" \ + ADDITIONAL_CXXFLAGS="-I$(STAGING_INSTALL_PREFIX)/$(PYTHON_INC_DIR) $${localCXXFLAGS[@]}" \ + ADDITIONAL_LDFLAGS="$${localLDFLAGS[@]}" \ + ABI3="$${abi3}" \ + PIP_GLOBAL_OPTION="$${global_options}" \ + $(MAKE) \ + cross-compile-wheel-$${name} || exit 1 ; \ + done < <(grep -svH -e "^\#" -e "^\$$" $(wildcard $(abspath $(addprefix $(WORK_DIR)/../,$(patsubst %-pure.txt,,$(WHEELS)))))) +else + @$(MSG) "[SKIP] Cross-compiling wheels" +endif ifneq ($(filter 1 ON TRUE,$(WHEELS_PURE_PYTHON_PACKAGING_ENABLE)),) @if [ -s "$(WHEELHOUSE)/$(WHEELS_PURE_PYTHON)" ]; then \ $(MSG) "Building pure-python" ; \ export LD= LDSHARED= CPP= NM= CC= AS= RANLIB= CXX= AR= STRIP= OBJDUMP= OBJCOPY= READELF= CFLAGS= CPPFLAGS= CXXFLAGS= LDFLAGS= && \ - $(RUN) $(PIP) $(PIP_WHEEL_ARGS) --requirement $(WHEELHOUSE)/$(WHEELS_PURE_PYTHON) ; \ + $(RUN) \ + PATH="$(abspath $(WORK_DIR)/../../../native/$(PYTHON_PKG_NAME)/work-native/install/usr/local/bin):$(PATH)" \ + LD_LIBRARY_PATH="$(abspath $(WORK_DIR)/../../../native/$(PYTHON_PKG_NAME)/work-native/install/usr/local/lib):$(LD_LIBRARY_PATH)" \ + $(PIP) $(PIP_WHEEL_ARGS) --requirement $(WHEELHOUSE)/$(WHEELS_PURE_PYTHON) ; \ fi else @$(MSG) "[SKIP] Building pure-python" endif -endif - +# PATH modified to access native/python* linked to crossenv-/build/bin +# this also provides access to maturin and its dependencies needed for building wheels +# LD_LIBRARY_PATH modified to access native/python libraries so related binary works cross-compile-wheel-%: SHELL:=/bin/bash cross-compile-wheel-%: @if [ "$(PIP_GLOBAL_OPTION)" ]; then \ @@ -205,6 +233,9 @@ cross-compile-wheel-%: fi ; \ $(MSG) \ _PYTHON_HOST_PLATFORM="$(TC_TARGET)" \ + PATH="$(CROSSENV_PATH)/build/bin:$(PATH)" \ + LD_LIBRARY_PATH="$(abspath $(WORK_DIR)/../../../native/$(PYTHON_PKG_NAME)/work-native/install/usr/local/lib):$(LD_LIBRARY_PATH)" \ + MESON_CROSS_FILE="$(MESON_TOOLCHAIN_WRK)" \ $(PIP_CROSSENV) \ $(PIP_WHEEL_ARGS_CROSSENV) \ $${pip_global_option} \ @@ -213,6 +244,9 @@ cross-compile-wheel-%: $(REQUIREMENT) ; \ $(RUN) \ _PYTHON_HOST_PLATFORM="$(TC_TARGET)" \ + PATH="$(CROSSENV_PATH)/build/bin:$(PATH)" \ + LD_LIBRARY_PATH="$(abspath $(WORK_DIR)/../../../native/$(PYTHON_PKG_NAME)/work-native/install/usr/local/lib):$(LD_LIBRARY_PATH)" \ + MESON_CROSS_FILE="$(MESON_TOOLCHAIN_WRK)" \ $(PIP_CROSSENV) \ $(PIP_WHEEL_ARGS_CROSSENV) \ $${pip_global_option} \ diff --git a/native/python310/Makefile b/native/python310/Makefile index 81f2ac89707..ee3fc05f7b2 100644 --- a/native/python310/Makefile +++ b/native/python310/Makefile @@ -1,5 +1,5 @@ PKG_NAME = python310 -PKG_VERS = 3.10.15 +PKG_VERS = 3.10.16 PKG_EXT = tar.xz PKG_DIST_NAME = Python-$(PKG_VERS).$(PKG_EXT) PKG_DIST_SITE = https://www.python.org/ftp/python/$(PKG_VERS) @@ -31,13 +31,21 @@ PYTHON = $(WORK_DIR)/install/usr/local/bin/python3 PIP = $(WORK_DIR)/install/usr/local/bin/pip PIP_NATIVE = $(WORK_DIR)/../../../native/$(PKG_NAME)/work-native/install/usr/local/bin/pip +PIP_VERSION = "24.3.1" +PIP_WHEELS = setuptools==75.6.0 +PIP_WHEELS += setuptools-rust==1.10.2 +PIP_WHEELS += maturin==1.7.7 +PIP_WHEELS += wheel==0.45.1 +PIP_WHEELS += cffi==1.17.1 +PIP_WHEELS += crossenv==1.5.0 + .PHONY: python310_native_post_install python310_native_post_install: $(WORK_DIR)/python-native.mk @$(MSG) Installing pip @$(RUN) wget https://bootstrap.pypa.io/get-pip.py - @$(RUN) $(PYTHON) get-pip.py "pip==24.2" --no-setuptools --no-wheel --disable-pip-version-check - @$(MSG) Installing setuptools, wheel, cffi and cross env - @$(PIP) --disable-pip-version-check install "setuptools==75.1.0" "setuptools-rust==1.10.2" "maturin==1.7.4" "wheel==0.44.0" "cffi==1.17.1" "crossenv==1.5.0" + @$(RUN) $(PYTHON) get-pip.py "pip==$(PIP_VERSION)" --no-setuptools --no-wheel --disable-pip-version-check + @$(MSG) Installing setuptools, wheel, cffi and crossenv + @$(PIP) --disable-pip-version-check install $(PIP_WHEELS) $(WORK_DIR)/python-native.mk: @echo PIP=$(PIP_NATIVE) >> $@ diff --git a/native/python310/digests b/native/python310/digests index 97d74f52750..c916efe4b23 100644 --- a/native/python310/digests +++ b/native/python310/digests @@ -1,3 +1,3 @@ -Python-3.10.15.tar.xz SHA1 f498fd8921e3c37e6aded9acb11ed23c8daa0bbe -Python-3.10.15.tar.xz SHA256 aab0950817735172601879872d937c1e4928a57c409ae02369ec3d91dccebe79 -Python-3.10.15.tar.xz MD5 8b1faa1b193e4e90c0f17eb2decd89b5 +Python-3.10.16.tar.xz SHA1 401e6a504a956c8f0aab76c4f3ad9df601a83eb1 +Python-3.10.16.tar.xz SHA256 bfb249609990220491a1b92850a07135ed0831e41738cf681d63cf01b2a8fbd1 +Python-3.10.16.tar.xz MD5 97b3ee1740f32a92905dd0a99dcb04d5 diff --git a/native/python311/Makefile b/native/python311/Makefile index 224df7c2a7d..2dd1b11872d 100644 --- a/native/python311/Makefile +++ b/native/python311/Makefile @@ -1,5 +1,5 @@ PKG_NAME = python311 -PKG_VERS = 3.11.10 +PKG_VERS = 3.11.11 PKG_EXT = tar.xz PKG_DIST_NAME = Python-$(PKG_VERS).$(PKG_EXT) PKG_DIST_SITE = https://www.python.org/ftp/python/$(PKG_VERS) @@ -16,8 +16,6 @@ CONFIGURE_ARGS += --without-static-libpython CONFIGURE_ARGS += --with-ensurepip=no # test modules are required for optimization only CONFIGURE_ARGS += --disable-test-modules -# Uses system default libffi-dev -CONFIGURE_ARGS += --with-system-ffi # Uses system default libssl-dev CONFIGURE_ARGS += --with-ssl-default-suites=openssl @@ -31,13 +29,21 @@ PYTHON = $(WORK_DIR)/install/usr/local/bin/python3 PIP = $(WORK_DIR)/install/usr/local/bin/pip PIP_NATIVE = $(WORK_DIR)/../../../native/$(PKG_NAME)/work-native/install/usr/local/bin/pip +PIP_VERSION = "24.3.1" +PIP_WHEELS = setuptools==75.6.0 +PIP_WHEELS += setuptools-rust==1.10.2 +PIP_WHEELS += maturin==1.7.7 +PIP_WHEELS += wheel==0.45.1 +PIP_WHEELS += cffi==1.17.1 +PIP_WHEELS += crossenv==1.5.0 + .PHONY: python311_native_post_install python311_native_post_install: $(WORK_DIR)/python-native.mk @$(MSG) Installing pip @$(RUN) wget https://bootstrap.pypa.io/get-pip.py - @$(RUN) $(PYTHON) get-pip.py "pip==24.2" --no-setuptools --no-wheel --disable-pip-version-check - @$(MSG) Installing setuptools, wheel, cffi and cross env - @$(PIP) --disable-pip-version-check install "setuptools==75.1.0" "setuptools-rust==1.10.2" "maturin==1.7.4" "wheel==0.44.0" "cffi==1.17.1" "crossenv==1.5.0" + @$(RUN) $(PYTHON) get-pip.py "pip==$(PIP_VERSION)" --no-setuptools --no-wheel --disable-pip-version-check + @$(MSG) Installing setuptools, wheel, cffi and crossenv + @$(PIP) --disable-pip-version-check install $(PIP_WHEELS) $(WORK_DIR)/python-native.mk: @echo PIP=$(PIP_NATIVE) >> $@ diff --git a/native/python311/digests b/native/python311/digests index 80952233979..4e023eb4c28 100644 --- a/native/python311/digests +++ b/native/python311/digests @@ -1,3 +1,3 @@ -Python-3.11.10.tar.xz SHA1 eb0ee5c84407445809a556592008cfc1867a39bc -Python-3.11.10.tar.xz SHA256 07a4356e912900e61a15cb0949a06c4a05012e213ecd6b4e84d0f67aabbee372 -Python-3.11.10.tar.xz MD5 af59e243df4c7019f941ae51891c10bc +Python-3.11.11.tar.xz SHA1 acf539109b024d3c5f1fc63d6e7f08cd294ba56d +Python-3.11.11.tar.xz SHA256 2a9920c7a0cd236de33644ed980a13cbbc21058bfdc528febb6081575ed73be3 +Python-3.11.11.tar.xz MD5 3e497037b170fe4be5f462c4964596f2 diff --git a/native/python312/Makefile b/native/python312/Makefile new file mode 100644 index 00000000000..7c25b3dccac --- /dev/null +++ b/native/python312/Makefile @@ -0,0 +1,49 @@ +PKG_NAME = python312 +PKG_VERS = 3.12.8 +PKG_EXT = tar.xz +PKG_DIST_NAME = Python-$(PKG_VERS).$(PKG_EXT) +PKG_DIST_SITE = https://www.python.org/ftp/python/$(PKG_VERS) +PKG_DIR = Python-$(PKG_VERS) + +HOMEPAGE = https://www.python.org/ +COMMENT = Python Programming Language +LICENSE = PSF + +GNU_CONFIGURE = 1 +CONFIGURE_ARGS = --enable-ipv6 +CONFIGURE_ARGS += --without-static-libpython +# installed pip is not on PATH +CONFIGURE_ARGS += --with-ensurepip=no +# test modules are required for optimization only +CONFIGURE_ARGS += --disable-test-modules +# Uses system default libssl-dev +CONFIGURE_ARGS += --with-ssl-default-suites=openssl + +COMPILE_MAKE_OPTIONS += all + +POST_INSTALL_TARGET = python312_native_post_install + +include ../../mk/spksrc.native-cc.mk + +PYTHON = $(WORK_DIR)/install/usr/local/bin/python3 +PIP = $(WORK_DIR)/install/usr/local/bin/pip +PIP_NATIVE = $(WORK_DIR)/../../../native/$(PKG_NAME)/work-native/install/usr/local/bin/pip + +PIP_VERSION = "24.3.1" +PIP_WHEELS = setuptools==75.6.0 +PIP_WHEELS += setuptools-rust==1.10.2 +PIP_WHEELS += maturin==1.7.7 +PIP_WHEELS += wheel==0.45.1 +PIP_WHEELS += cffi==1.17.1 +PIP_WHEELS += crossenv==1.5.0 + +.PHONY: python312_native_post_install +python312_native_post_install: $(WORK_DIR)/python-native.mk + @$(MSG) Installing pip + @$(RUN) wget https://bootstrap.pypa.io/get-pip.py + @$(RUN) $(PYTHON) get-pip.py "pip==$(PIP_VERSION)" --no-setuptools --no-wheel --disable-pip-version-check + @$(MSG) Installing setuptools, wheel, cffi and crossenv + @$(PIP) --disable-pip-version-check install $(PIP_WHEELS) + +$(WORK_DIR)/python-native.mk: + @echo PIP=$(PIP_NATIVE) >> $@ diff --git a/native/python312/digests b/native/python312/digests new file mode 100644 index 00000000000..bbc77569f89 --- /dev/null +++ b/native/python312/digests @@ -0,0 +1,3 @@ +Python-3.12.8.tar.xz SHA1 8872c7a124c6970833e0bde4f25d6d7d61c6af6e +Python-3.12.8.tar.xz SHA256 c909157bb25ec114e5869124cc2a9c4a4d4c1e957ca4ff553f1edc692101154e +Python-3.12.8.tar.xz MD5 d46e5bf9f2e596a3ba45fc0b3c053dd2 diff --git a/native/python313/Makefile b/native/python313/Makefile new file mode 100644 index 00000000000..a9d26a00960 --- /dev/null +++ b/native/python313/Makefile @@ -0,0 +1,49 @@ +PKG_NAME = python313 +PKG_VERS = 3.13.1 +PKG_EXT = tar.xz +PKG_DIST_NAME = Python-$(PKG_VERS).$(PKG_EXT) +PKG_DIST_SITE = https://www.python.org/ftp/python/$(PKG_VERS) +PKG_DIR = Python-$(PKG_VERS) + +HOMEPAGE = https://www.python.org/ +COMMENT = Python Programming Language +LICENSE = PSF + +GNU_CONFIGURE = 1 +CONFIGURE_ARGS = --enable-ipv6 +CONFIGURE_ARGS += --without-static-libpython +# installed pip is not on PATH +CONFIGURE_ARGS += --with-ensurepip=no +# test modules are required for optimization only +CONFIGURE_ARGS += --disable-test-modules +# Uses system default libssl-dev +CONFIGURE_ARGS += --with-ssl-default-suites=openssl + +COMPILE_MAKE_OPTIONS += all + +POST_INSTALL_TARGET = python313_native_post_install + +include ../../mk/spksrc.native-cc.mk + +PYTHON = $(WORK_DIR)/install/usr/local/bin/python3 +PIP = $(WORK_DIR)/install/usr/local/bin/pip +PIP_NATIVE = $(WORK_DIR)/../../../native/$(PKG_NAME)/work-native/install/usr/local/bin/pip + +PIP_VERSION = "24.3.1" +PIP_WHEELS = setuptools==75.6.0 +PIP_WHEELS += setuptools-rust==1.10.2 +PIP_WHEELS += maturin==1.7.7 +PIP_WHEELS += wheel==0.45.1 +PIP_WHEELS += cffi==1.17.1 +PIP_WHEELS += crossenv==1.5.0 + +.PHONY: python313_native_post_install +python313_native_post_install: $(WORK_DIR)/python-native.mk + @$(MSG) Installing pip + @$(RUN) wget https://bootstrap.pypa.io/get-pip.py + @$(RUN) $(PYTHON) get-pip.py "pip==$(PIP_VERSION)" --no-setuptools --no-wheel --disable-pip-version-check + @$(MSG) Installing setuptools, wheel, cffi and crossenv + @$(PIP) --disable-pip-version-check install $(PIP_WHEELS) + +$(WORK_DIR)/python-native.mk: + @echo PIP=$(PIP_NATIVE) >> $@ diff --git a/native/python313/digests b/native/python313/digests new file mode 100644 index 00000000000..35979854910 --- /dev/null +++ b/native/python313/digests @@ -0,0 +1,3 @@ +Python-3.13.1.tar.xz SHA1 4b0c2a49a848c3c5d611416099636262a0b9090f +Python-3.13.1.tar.xz SHA256 9cf9427bee9e2242e3877dd0f6b641c1853ca461f39d6503ce260a59c80bf0d9 +Python-3.13.1.tar.xz MD5 80c16badb94ffe235280d4d9a099b8bc diff --git a/spk/deluge/Makefile b/spk/deluge/Makefile index 99f69addc47..18f16a6f2ba 100644 --- a/spk/deluge/Makefile +++ b/spk/deluge/Makefile @@ -15,7 +15,7 @@ MAINTAINER = SynoCommunity DESCRIPTION = Deluge is a cross platform BitTorrent client, based on libtorrent rasterbar. This package integrates both the deluge deamon \(deluged\), as well as its web counterpart \(deluge-web\), which serves the deluge web UI. DESCRIPTION_FRE = Deluge est un client BitTorrent multi-plateforme, basé sur libtorrent rasterbar. Ce paquet intègre à la fois le démon deluge \(deluged\) ainsi que son penchant web \(deluge-web\), desservant l\'interface utilisateur web deluge. STARTABLE = yes -CHANGELOG = "1. Update to latest github development commit
2. Update to libtorrent 2.0.9
3. Update to OpenSSL 3.1.2
4. Fix for newer shared python" +CHANGELOG = "1. Update to latest github development commit
2. Update to libtorrent 2.0.10" DISPLAY_NAME = Deluge HOMEPAGE = https://deluge-torrent.org @@ -49,7 +49,7 @@ include ../../mk/spksrc.python.mk # [libtorrent] UNSUPPORTED_ARCHS += $(ARMv5_ARCHS) $(ARMv7L_ARCHS) $(OLD_PPC_ARCHS) -DEPENDS += cross/openssl +DEPENDS += cross/openssl3 DEPENDS += cross/geoip DEPENDS += cross/libiconv DEPENDS += cross/boost_1.82 diff --git a/spk/deluge/src/requirements-crossenv.txt b/spk/deluge/src/requirements-crossenv.txt index 9e9eaa83d9a..84b59626879 100644 --- a/spk/deluge/src/requirements-crossenv.txt +++ b/spk/deluge/src/requirements-crossenv.txt @@ -2,14 +2,12 @@ ## required wheels that need cross compilation ## -#deluge==2.1.1 ==> pure - # [deluge] -#deluge==2.1.1 +#deluge==2.1.1 ==> pure # Latest commit on develop branch #git+https://github.com/deluge-torrent/deluge.git@develop#egg=deluge==2.1.1 -# Commit from May30th on develop branch -git+https://github.com/deluge-torrent/deluge.git@8001110625dd95c188c7425d0d95f93abe65f03c#egg=deluge==2.1.1.dev61 +# Commit from August 27th 2024 on develop branch +git+https://github.com/deluge-torrent/deluge.git@8df36c454be320571005231a1c77cedb656557e1#egg=deluge==2.1.1.dev127 # [rencode] 1.0.6 ==> abi3 @@ -19,12 +17,12 @@ GeoIP==1.3.2 MarkupSafe==2.1.3 zope.interface==6.0 -# [libtorrent] 2.0.9 -# Depends: openssl, boost 1.82, geoip +# [libtorrent] 2.0.10 +# Depends: openssl3, boost 1.82, geoip # Require environment variables # BOOST_LIBRARIES # BOOST_BUILD_PATH # Only supported on DSM7 armv7, aarch64, x64 -git+https://github.com/arvidn/libtorrent.git@v2.0.9#egg=libtorrent==2.0.9 +git+https://github.com/arvidn/libtorrent.git@v2.0.9#egg=libtorrent==2.0.10 # Use RC_2_0 for latest development snapshots -# git+https://github.com/arvidn/libtorrent.git@RC_2_0#egg=libtorrent==2.0.9 +# git+https://github.com/arvidn/libtorrent.git@RC_2_0#egg=libtorrent==2.0.10 diff --git a/spk/ffsync/Makefile b/spk/ffsync/Makefile index c8649b4b1c7..8173abebc91 100644 --- a/spk/ffsync/Makefile +++ b/spk/ffsync/Makefile @@ -33,11 +33,7 @@ SERVICE_PORT_TITLE = $(DISPLAY_NAME) ADMIN_PORT = $(SERVICE_PORT) # [cryptography] -# Mandatory of using OPENSSL_*_DIR starting with version >= 40 -# https://docs.rs/openssl/latest/openssl/#automatic DEPENDS += cross/openssl3 -ENV += OPENSSL_LIB_DIR=$(STAGING_INSTALL_PREFIX)/lib/ -ENV += OPENSSL_INCLUDE_DIR=$(STAGING_INSTALL_PREFIX)/include/ # [mysqlclient] ENV += MYSQLCLIENT_CFLAGS="$(CFLAGS) -I$(STAGING_INSTALL_PREFIX)/include/mysql -I$(STAGING_INSTALL_PREFIX)/$(PYTHON_INC_DIR)" diff --git a/spk/homeassistant/Makefile b/spk/homeassistant/Makefile index b69d396c98b..8110cb88222 100644 --- a/spk/homeassistant/Makefile +++ b/spk/homeassistant/Makefile @@ -90,12 +90,6 @@ WHEELS_BUILD_ARGS += --enable-freetype WHEELS_BUILD_ARGS += --enable-jpeg WHEELS_BUILD_ARGS += --enable-zlib -# [bcrypt, cryptography] -ENV += PYO3_CROSS_LIB_DIR=$(STAGING_INSTALL_PREFIX)/lib/ -ENV += PYO3_CROSS_INCLUDE_DIR=$(STAGING_INSTALL_PREFIX)/include/ -# fix for openssl-sys crate (for cryptography >= 40.0.0) -# https://docs.rs/openssl/latest/openssl/#manual - # [gevent] DEPENDS += cross/libev cross/c-ares ENV += GEVENTSETUP_EMBED_CARES=FALSE diff --git a/spk/python310/Makefile b/spk/python310/Makefile index 1ffdbc8aac3..8e58d605318 100644 --- a/spk/python310/Makefile +++ b/spk/python310/Makefile @@ -1,7 +1,7 @@ SPK_NAME = python310 -SPK_VERS = 3.10.15 +SPK_VERS = 3.10.16 SPK_VERS_MAJOR_MINOR = $(word 1,$(subst ., ,$(SPK_VERS))).$(word 2,$(subst ., ,$(SPK_VERS))) -SPK_REV = 21 +SPK_REV = 22 SPK_ICON = src/python3.png DEPENDS = cross/python310 @@ -13,7 +13,7 @@ DESCRIPTION_FRE = Language de programmation Python. DESCRIPTION_SPN = Lenguaje de programación Python. STARTABLE = no DISPLAY_NAME = Python 3.10 -CHANGELOG = "1. Update to Python 3.10.15
2. Update all mandatory wheels" +CHANGELOG = "1. Update to Python 3.10.16
2. Update all mandatory wheels" HOMEPAGE = https://www.python.org LICENSE = PSF @@ -163,7 +163,5 @@ endif .PHONY: python310_extra_install python310_extra_install: - @$(MSG) - Remove test folder - rm -rf $(STAGING_DIR)/$(PYTHON_LIB_DIR)/test/ @$(MSG) - Remove compiled files from __pycache__ find $(STAGING_DIR)/$(PYTHON_LIB_DIR) -type f -regex '.*\.py[co]' -delete diff --git a/spk/python310/crossenv/requirements-default.txt b/spk/python310/crossenv/requirements-default.txt new file mode 100644 index 00000000000..4b8f768e596 --- /dev/null +++ b/spk/python310/crossenv/requirements-default.txt @@ -0,0 +1,19 @@ +pip==24.3.1 +pip-tools==7.4.1 +setuptools==75.4.0 +build==1.2.2 +wheel==0.45.0 +# +cffi==1.17.1 +cryptography==41.0.3 +Cython==3.0.11 +flit==3.10.1 +maturin==1.7.4 +meson-python==0.17.1 +msgpack==1.0.5 +poetry==1.8.4 +scikit-build==0.18.1 +scikit-build-core==0.10.7 +setuptools-rust==1.10.2 +setuptools-scm==8.1.0 +typing_extensions==4.12.2 diff --git a/spk/python310/crossenv/requirements-frozenlist.txt b/spk/python310/crossenv/requirements-frozenlist.txt new file mode 100644 index 00000000000..4edc3b107fb --- /dev/null +++ b/spk/python310/crossenv/requirements-frozenlist.txt @@ -0,0 +1,8 @@ +pip==24.3.1 +pip-tools==7.4.1 +setuptools==75.4.0 +build==1.2.2 +wheel==0.45.0 +# +Cython==3.0.11 +expandvars==0.12.0 diff --git a/spk/python310/crossenv/requirements-numpy-1.22.4.txt b/spk/python310/crossenv/requirements-numpy-1.22.4.txt new file mode 100644 index 00000000000..e740501ce2d --- /dev/null +++ b/spk/python310/crossenv/requirements-numpy-1.22.4.txt @@ -0,0 +1,14 @@ +pip==23.2.1 +setuptools==63.4.3 +wheel==0.41.2 +# +cffi==1.15.1 +cryptography==41.0.3 +Cython==0.29.36 +flit==3.9.0 +maturin==1.2.3 +msgpack==1.0.5 +poetry==1.6.1 +scikit-build==0.17.6 +setuptools-rust==1.7.0 +setuptools-scm==7.1.0 diff --git a/spk/python310/crossenv/requirements-numpy-1.24.4.txt b/spk/python310/crossenv/requirements-numpy-1.24.4.txt new file mode 100644 index 00000000000..e740501ce2d --- /dev/null +++ b/spk/python310/crossenv/requirements-numpy-1.24.4.txt @@ -0,0 +1,14 @@ +pip==23.2.1 +setuptools==63.4.3 +wheel==0.41.2 +# +cffi==1.15.1 +cryptography==41.0.3 +Cython==0.29.36 +flit==3.9.0 +maturin==1.2.3 +msgpack==1.0.5 +poetry==1.6.1 +scikit-build==0.17.6 +setuptools-rust==1.7.0 +setuptools-scm==7.1.0 diff --git a/spk/python310/crossenv/requirements-numpy-1.25.1.txt b/spk/python310/crossenv/requirements-numpy-1.25.1.txt new file mode 100644 index 00000000000..e740501ce2d --- /dev/null +++ b/spk/python310/crossenv/requirements-numpy-1.25.1.txt @@ -0,0 +1,14 @@ +pip==23.2.1 +setuptools==63.4.3 +wheel==0.41.2 +# +cffi==1.15.1 +cryptography==41.0.3 +Cython==0.29.36 +flit==3.9.0 +maturin==1.2.3 +msgpack==1.0.5 +poetry==1.6.1 +scikit-build==0.17.6 +setuptools-rust==1.7.0 +setuptools-scm==7.1.0 diff --git a/spk/python310/crossenv/requirements-pydantic_core.txt b/spk/python310/crossenv/requirements-pydantic_core.txt new file mode 100644 index 00000000000..aab8e3a040e --- /dev/null +++ b/spk/python310/crossenv/requirements-pydantic_core.txt @@ -0,0 +1,10 @@ +pip==24.3.1 +pip-tools==7.4.1 +setuptools==75.4.0 +build==1.2.2 +wheel==0.45.0 +# +# [pydantic_core] depends on Cython < 3.x +Cython==0.29.37 +maturin==1.7.4 +typing_extensions==4.12.2 diff --git a/spk/python310/crossenv/requirements-yarl.txt b/spk/python310/crossenv/requirements-yarl.txt new file mode 100644 index 00000000000..4edc3b107fb --- /dev/null +++ b/spk/python310/crossenv/requirements-yarl.txt @@ -0,0 +1,8 @@ +pip==24.3.1 +pip-tools==7.4.1 +setuptools==75.4.0 +build==1.2.2 +wheel==0.45.0 +# +Cython==3.0.11 +expandvars==0.12.0 diff --git a/spk/python310/src/requirements-pure.txt b/spk/python310/src/requirements-pure.txt index 1fade6b6191..617e77197ba 100644 --- a/spk/python310/src/requirements-pure.txt +++ b/spk/python310/src/requirements-pure.txt @@ -1,10 +1,8 @@ # basic default wheels # ==> Always install latest version (service-setup.sh:install_python_virtualenv) -pip==24.2 - -# Always match what's in cross/python310/Makefile -setuptools==68.1.2 -wheel==0.44.0 +pip==24.3.1 +setuptools==75.6.0 +wheel==0.45.1 # Always use latest version available # certifi==2024.8.30 @@ -14,12 +12,12 @@ certifi # to create their local virtualenv # in order to install wheels within # their running environment -virtualenv==20.26.6 +virtualenv==20.28.0 # Other mandatory wheels that # gets install by default as # basic dependencies of above -distlib==0.3.8 +distlib==0.3.9 filelock==3.16.1 platformdirs==4.3.6 six==1.16.0 diff --git a/spk/python311-wheels/Makefile b/spk/python311-wheels/Makefile new file mode 100644 index 00000000000..4e788f243de --- /dev/null +++ b/spk/python311-wheels/Makefile @@ -0,0 +1,160 @@ +SPK_NAME = python311-wheels +SPK_VERS = 1.0 +SPK_VERS_MAJOR_MINOR = $(word 1,$(subst ., ,$(SPK_VERS))).$(word 2,$(subst ., ,$(SPK_VERS))) +SPK_REV = 1 +SPK_ICON = src/python3-pip.png + +# Platform "powerpc-none-linux-gnuspe" with compiler "gcc" is not supported by the +# CPython core team, see https://peps.python.org/pep-0011/ for more information. +# And compiler must support std=c++11 (OlD_PPC_ARCHS fail, but ARMv5_ARCHS have no issue). +UNSUPPORTED_ARCHS = $(OLD_PPC_ARCHS) + +PYTHON_PACKAGE = python311 +SPK_DEPENDS = "$(PYTHON_PACKAGE)" + +MAINTAINER = SynoCommunity +DESCRIPTION = Collection of programs for the Python 3.11 programming language. +DESCRIPTION_FRE = Collection of programs for the Python 3.11 programming language. +DESCRIPTION_SPN = Colección de programas para el lenguaje de programación Python 3.11. +STARTABLE = no +DISPLAY_NAME = Python 3.11 Wheels Collection +CHANGELOG = "1. Initial package" + +HOMEPAGE = https://www.python.org +LICENSE = PSF + +# Enable debug_info symgols +#GCC_DEBUG_INFO := 1 + +WHEELS = src/requirements-abi3.txt +WHEELS += src/requirements-crossenv.txt +WHEELS += src/requirements-pure.txt + +include ../../mk/spksrc.common.mk + +# [borgbackup] +# Use OpenSSL path as defined by either +# spksrc.wheel-env.mk or spksrc.python.mk +ENV += BORG_OPENSSL_PREFIX="$(OPENSSL_STAGING_PREFIX)" +ENV += BORG_LIBLZ4_PREFIX="$(STAGING_INSTALL_PREFIX)" +ENV += BORG_LIBZSTD_PREFIX="$(STAGING_INSTALL_PREFIX)" +ENV += BORG_LIBB2_PREFIX="$(STAGING_INSTALL_PREFIX)" +DEPENDS += cross/attr cross/acl cross/openssl3 cross/lz4 cross/zstd cross/libb2 cross/fuse + +# [cryptography] +# Use cross/cryptography to generate py36-abi3 limited API +# NOTE: It's not possible to build py36-abi3 limited API using pip due to PEP517 +# To generate py311-py311 regular build use src/requirements-crossenv.txt +DEPENDS += cross/cryptography + +# [gevent] +DEPENDS += cross/libev cross/c-ares +ENV += GEVENTSETUP_EMBED_CARES=FALSE +ENV += GEVENTSETUP_EMBED_LIBEV=FALSE + +# [lxml] +DEPENDS += cross/libxml2 +DEPENDS += cross/libxslt + +# [mysqlclient] +DEPENDS += cross/mysql-connector-c +DEPENDS += cross/mariadb-connector-c +ENV += MYSQLCLIENT_CFLAGS="$(CFLAGS) -I$(STAGING_INSTALL_PREFIX)/include/mysql -I$(STAGING_INSTALL_PREFIX)/include/mariadb -I$(STAGING_INSTALL_PREFIX)/$(PYTHON_INC_DIR)" +ENV += MYSQLCLIENT_LDFLAGS="$(LDFLAGS)" + +# [Pillow] +DEPENDS += cross/freetype cross/libjpeg cross/zlib +WHEELS_BUILD_ARGS += [Pillow] +WHEELS_BUILD_ARGS += build_ext +WHEELS_BUILD_ARGS += --disable-platform-guessing +WHEELS_BUILD_ARGS += --enable-freetype +WHEELS_BUILD_ARGS += --enable-jpeg +WHEELS_BUILD_ARGS += --enable-zlib + +# [pycares] +DEPENDS += cross/c-ares +ENV += PYCARES_USE_SYSTEM_LIB=1 + +# [pycurl] +DEPENDS += cross/curl +ENV += PYCURL_CURL_CONFIG=$(STAGING_INSTALL_PREFIX)/bin/curl-config + +# [PyNaCl] +DEPENDS += cross/libsodium +ENV += SODIUM_INSTALL=system + +# [PyYAML] +DEPENDS += cross/libyaml + +# [rpds-py] +# maturin canot be built as pre-requisite crossenv +ifneq ($(findstring $(ARCH),$(ARMv5_ARCHS)),$(ARCH)) +WHEELS += src/requirements-crossenv-rpds-py.txt +# Requires path to maturin from crossenv +ENV += PATH=$(WORK_DIR)/crossenv/build/bin:$(PATH) +endif + +## +## Addition of requirements files beyond spksrc.python.mk +## will not be taken into consideration for processing +## unless WHEELS has been previously populated. This is due to +## the makefile analysis phase which discard ifeq instructions. +## + +include ../../mk/spksrc.python.mk + +# [greenlet] +ifeq ($(call version_ge, $(TC_GCC), 5.0),1) +WHEELS += src/requirements-crossenv-greenlet-v3.txt +else ifeq ($(call version_ge, $(TC_GCC), 4.9)$(call version_lt, $(TC_GCC), 5.0),11) +WHEELS += src/requirements-crossenv-greenlet-v3-gcc4.txt +WHEELS_CPPFLAGS += [greenlet] -std=c++11 -fpermissive +else +WHEELS += src/requirements-crossenv-greenlet-v1.txt +endif + +# [numpy] <= 1.21.6 (armv5) +# This version is now unsupported using py311 +ifneq ($(findstring $(ARCH),$(ARMv5_ARCHS)),$(ARCH)) +# [numpy] <= 1.22.4 (armv7l) +ifeq ($(findstring $(ARCH),$(ARMv7L_ARCHS)),$(ARCH)) +WHEELS += src/requirements-crossenv-numpy-armv7l.txt +# [numpy] <= 1.24.4 last working version with gcc-4.9 +else ifeq ($(call version_le, $(TC_GCC), 5.0),1) +WHEELS += src/requirements-crossenv-numpy-gcc4.txt +# [numpy] >= 1.25.0 requires c++17 +else ifeq ($(call version_gt, $(TC_GCC), 5.0),1) +WHEELS += src/requirements-crossenv-numpy.txt +endif +endif + +# workaround for compiler bug: +# https://github.com/numpy/numpy/issues/13622 +ifeq ($(call version_le, $(TC_GCC), 5.0),1) +ifeq ($(findstring $(ARCH),$(ARMv8_ARCHS)),$(ARCH)) +WHEELS_CFLAGS += [numpy] -O0 +endif +endif + +# [pycryptodome] +ifeq ($(call version_ge, $(TC_GCC), 4.9),1) +WHEELS_CFLAGS += [pycryptodome] -std=c11 +else +WHEELS_CFLAGS += [pycryptodome] -std=c99 +endif + +# [pycryptodomex] +ifeq ($(call version_ge, $(TC_GCC), 4.9),1) +WHEELS_CFLAGS += [pycryptodomex] -std=c11 +else +WHEELS_CFLAGS += [pycryptodomex] -std=c99 +endif + +# [pydantic_core] +ifeq ($(call version_ge, $(TC_GCC), 4.9),1) +WHEELS_CFLAGS += [pydantic_core] -std=c11 +else +WHEELS_CFLAGS += [pydantic_core] -std=c99 +endif +# Requires path to maturin from crossenv +ENV += PATH=$(WORK_DIR)/crossenv/build/bin:$(PATH) diff --git a/spk/python311-wheels/PLIST b/spk/python311-wheels/PLIST new file mode 100644 index 00000000000..4cfaf73a12c --- /dev/null +++ b/spk/python311-wheels/PLIST @@ -0,0 +1 @@ +rsc:share/wheelhouse diff --git a/spk/python311-wheels/src/python3-pip.png b/spk/python311-wheels/src/python3-pip.png new file mode 100644 index 00000000000..d195821833d Binary files /dev/null and b/spk/python311-wheels/src/python3-pip.png differ diff --git a/spk/python311/src/requirements-abi3.txt b/spk/python311-wheels/src/requirements-abi3.txt similarity index 100% rename from spk/python311/src/requirements-abi3.txt rename to spk/python311-wheels/src/requirements-abi3.txt diff --git a/spk/python311/src/requirements-crossenv-greenlet-v1.txt b/spk/python311-wheels/src/requirements-crossenv-greenlet-v1.txt similarity index 100% rename from spk/python311/src/requirements-crossenv-greenlet-v1.txt rename to spk/python311-wheels/src/requirements-crossenv-greenlet-v1.txt diff --git a/spk/python311/src/requirements-crossenv-greenlet-v2.txt b/spk/python311-wheels/src/requirements-crossenv-greenlet-v3-gcc4.txt similarity index 100% rename from spk/python311/src/requirements-crossenv-greenlet-v2.txt rename to spk/python311-wheels/src/requirements-crossenv-greenlet-v3-gcc4.txt diff --git a/spk/python311-wheels/src/requirements-crossenv-greenlet-v3.txt b/spk/python311-wheels/src/requirements-crossenv-greenlet-v3.txt new file mode 100644 index 00000000000..837c343884b --- /dev/null +++ b/spk/python311-wheels/src/requirements-crossenv-greenlet-v3.txt @@ -0,0 +1,11 @@ +## +## All configurations below are optional and +## are provided to demonstrate how to build +## various wheels. Uncoment to enable. +## + +# [greenlet] +# - Mandatory require full c++11 support +greenlet==3.0.3 +# - Mandatory require full c++20 support added with gcc >= 8 +greenlet==3.1.1 diff --git a/spk/python311/src/requirements-crossenv-numpy-armv7l.txt b/spk/python311-wheels/src/requirements-crossenv-numpy-armv7l.txt similarity index 100% rename from spk/python311/src/requirements-crossenv-numpy-armv7l.txt rename to spk/python311-wheels/src/requirements-crossenv-numpy-armv7l.txt diff --git a/spk/python311/src/requirements-crossenv-numpy-gcc4.txt b/spk/python311-wheels/src/requirements-crossenv-numpy-gcc4.txt similarity index 100% rename from spk/python311/src/requirements-crossenv-numpy-gcc4.txt rename to spk/python311-wheels/src/requirements-crossenv-numpy-gcc4.txt diff --git a/spk/python311-wheels/src/requirements-crossenv-numpy.txt b/spk/python311-wheels/src/requirements-crossenv-numpy.txt new file mode 100644 index 00000000000..3e96eb87910 --- /dev/null +++ b/spk/python311-wheels/src/requirements-crossenv-numpy.txt @@ -0,0 +1,17 @@ +## +## All configurations below are optional and +## are provided to demonstrate how to build +## various wheels. Uncoment to enable. +## + +# [numpy] +# - Require Cython in cross/python310 crossenv +# - Numpy >= 1.25.x require c++17 +# - Numpy >= 1.26.x requires: <-- FAIILS to build +# c++17, meson-python, scikit-build-core +numpy==1.24.4 +numpy==1.25.2 +#numpy==1.26.4 +#numpy==2.0.2 +#numpy==2.1.3 +#numpy==2.2.1 diff --git a/spk/python311/src/requirements-crossenv-rpds-py.txt b/spk/python311-wheels/src/requirements-crossenv-rpds-py.txt similarity index 100% rename from spk/python311/src/requirements-crossenv-rpds-py.txt rename to spk/python311-wheels/src/requirements-crossenv-rpds-py.txt diff --git a/spk/python311/src/requirements-crossenv.txt b/spk/python311-wheels/src/requirements-crossenv.txt similarity index 83% rename from spk/python311/src/requirements-crossenv.txt rename to spk/python311-wheels/src/requirements-crossenv.txt index 40c49bdcdb1..20bbba27003 100644 --- a/spk/python311/src/requirements-crossenv.txt +++ b/spk/python311-wheels/src/requirements-crossenv.txt @@ -15,21 +15,29 @@ bcrypt==4.2.0 # https://docs.rs/openssl/latest/openssl/#automatic # ENV += OPENSSL_LIB_DIR=$(STAGING_INSTALL_PREFIX)/lib/ # ENV += OPENSSL_INCLUDE_DIR=$(STAGING_INSTALL_PREFIX)/include/ -cryptography==43.0.1 +cryptography==43.0.3 +cryptography==44.0.0 # Requirement for cryptography -cffi==1.17.0 +cffi==1.15.1 +cffi==1.17.1 # commonly used cross-compiled wheels # All tested and can be enabled but may conflict # with local python apps requirements +borgbackup==1.2.6 +charset-normalizer==3.2.0 immutables==0.20 +llfuse==1.5.0 MarkupSafe==2.1.5 +msgpack==1.0.5 # used compiled verrsion for performance msgpack-python==0.5.6 netifaces==0.11.0 psutil==6.0.0 +pyrsistent==0.19.3 regex==2024.7.24 +ruamel.yaml.clib==0.2.7 SQLAlchemy==2.0.32 zope.interface==7.0.2 @@ -92,6 +100,14 @@ PyYAML==6.0.2 # rencode==1.0.6 <<-- unsupported git+https://github.com/totaam/rencode.git@f6254ab26161f90b9c5e97915b9193fee805fc1f#egg=rencode==1.0.7 +# [rpds-py] +# Require environment variables +# PYO3_CROSS_LIB_DIR=$(STAGING_INSTALL_PREFIX)/lib/ +# PYO3_CROSS_INCLUDE_DIR=$(STAGING_INSTALL_PREFIX)/include/ +# Requires path to maturin from crossenv +# ENV += PATH=$(WORK_DIR)/crossenv/build/bin:$(PATH) +rpds-py==0.10.2 + # [ujson] # - Require setuptools-scm in cross/python3* crossenv ujson==5.10.0 diff --git a/spk/python311-wheels/src/requirements-pure.txt b/spk/python311-wheels/src/requirements-pure.txt new file mode 100644 index 00000000000..617e77197ba --- /dev/null +++ b/spk/python311-wheels/src/requirements-pure.txt @@ -0,0 +1,29 @@ +# basic default wheels +# ==> Always install latest version (service-setup.sh:install_python_virtualenv) +pip==24.3.1 +setuptools==75.6.0 +wheel==0.45.1 + +# Always use latest version available +# certifi==2024.8.30 +certifi + +# Mandatory for python application +# to create their local virtualenv +# in order to install wheels within +# their running environment +virtualenv==20.28.0 + +# Other mandatory wheels that +# gets install by default as +# basic dependencies of above +distlib==0.3.9 +filelock==3.16.1 +platformdirs==4.3.6 +six==1.16.0 + +## +## All configurations below are optional and +## are provided to demonstrate how to build +## various wheels. Uncoment to enable. +## diff --git a/spk/python311/Makefile b/spk/python311/Makefile index 87eba19e7ee..6ba22500b43 100644 --- a/spk/python311/Makefile +++ b/spk/python311/Makefile @@ -1,7 +1,7 @@ SPK_NAME = python311 -SPK_VERS = 3.11.10 +SPK_VERS = 3.11.11 SPK_VERS_MAJOR_MINOR = $(word 1,$(subst ., ,$(SPK_VERS))).$(word 2,$(subst ., ,$(SPK_VERS))) -SPK_REV = 9 +SPK_REV = 10 SPK_ICON = src/python3.png # Platform "powerpc-none-linux-gnuspe" with compiler "gcc" is not supported by the @@ -9,7 +9,7 @@ SPK_ICON = src/python3.png # And compiler must support std=c++11 (OlD_PPC_ARCHS fail, but ARMv5_ARCHS have no issue). UNSUPPORTED_ARCHS = $(OLD_PPC_ARCHS) -DEPENDS = cross/$(SPK_NAME) +DEPENDS = cross/python311 DEPENDS += cross/pip MAINTAINER = SynoCommunity @@ -18,18 +18,18 @@ DESCRIPTION_FRE = Language de programmation Python. DESCRIPTION_SPN = Lenguaje de programación Python. STARTABLE = no DISPLAY_NAME = Python 3.11 -CHANGELOG = "1. Update to Python 3.11.10
2. Update all mandatory wheels" +CHANGELOG = "1. Update to Python 3.11.11
2. Update all mandatory wheels" HOMEPAGE = https://www.python.org LICENSE = PSF +# Force compiler LTO optimizations +ENV += PYTHON_OPTIMIZE=1 + # Force building pure-python wheels WHEELS_PURE_PYTHON_PACKAGING_ENABLE = 1 WHEELS = src/requirements-pure.txt -# Force testing all wheel builds -WHEELS_TEST_ALL = 0 - SERVICE_SETUP = src/service-setup.sh PYTHON_LIB_DIR = lib/python$(SPK_VERS_MAJOR_MINOR) @@ -38,162 +38,9 @@ POST_STRIP_TARGET = python311_extra_install SPK_USR_LOCAL_LINKS = bin:bin/python3.11 -## -## All configurations below are optional and -## are provided to demonstrate how to build -## various wheels. Uncoment to enable. -## -## WHEELS_TEST_ALL: Force testing all wheel building -ifeq ($(strip $(WHEELS_TEST_ALL)),1) -WHEELS += src/requirements-crossenv.txt -WHEELS += src/requirements-abi3.txt - -# [cryptography] -# Use cross/cryptography to generate py36-abi3 limited API -# NOTE: It's not possible to build py36-abi3 limited API using pip due to PEP517 -# To generate py311-py311 regular build use src/requirements-crossenv.txt -DEPENDS += cross/cryptography - -# [gevent] -DEPENDS += cross/libev cross/c-ares -ENV += GEVENTSETUP_EMBED_CARES=FALSE -ENV += GEVENTSETUP_EMBED_LIBEV=FALSE - -# [lxml] -DEPENDS += cross/libxml2 -DEPENDS += cross/libxslt - -# [mysqlclient] -DEPENDS += cross/mysql-connector-c -DEPENDS += cross/mariadb-connector-c -ENV += MYSQLCLIENT_CFLAGS="$(CFLAGS) -I$(STAGING_INSTALL_PREFIX)/include/mysql -I$(STAGING_INSTALL_PREFIX)/include/mariadb -I$(STAGING_INSTALL_PREFIX)/$(PYTHON_INC_DIR)" -ENV += MYSQLCLIENT_LDFLAGS="$(LDFLAGS)" - -# [Pillow] -DEPENDS += cross/freetype cross/libjpeg cross/zlib -WHEELS_BUILD_ARGS += [Pillow] -WHEELS_BUILD_ARGS += build_ext -WHEELS_BUILD_ARGS += --disable-platform-guessing -WHEELS_BUILD_ARGS += --enable-freetype -WHEELS_BUILD_ARGS += --enable-jpeg -WHEELS_BUILD_ARGS += --enable-zlib - -# [pycares] -DEPENDS += cross/c-ares -ENV += PYCARES_USE_SYSTEM_LIB=1 - -# [pycurl] -DEPENDS += cross/curl -ENV += PYCURL_CURL_CONFIG=$(STAGING_INSTALL_PREFIX)/bin/curl-config - -# [PyNaCl] -DEPENDS += cross/libsodium -ENV += SODIUM_INSTALL=system - -# [PyYAML] -DEPENDS += cross/libyaml - -# WHEELS_TEST_ALL: Force testing all wheel building -endif - -include ../../mk/spksrc.common.mk - -# Enable debug_info symgols for all archs -#GCC_DEBUG_INFO := 1 - -# Force compiler LTO optimizations except: -# - when testing all wheels -# - when including debug_info symbols -# - when using OLD_PPC_ARCHS arch -ifneq ($(strip $(WHEELS_TEST_ALL)),1) -ifneq ($(strip $(GCC_DEBUG_INFO)),1) -ifneq ($(findstring $(ARCH),$(OLD_PPC_ARCHS)),$(ARCH)) -ENV += PYTHON_OPTIMIZE=1 -endif -endif -endif - -## WHEELS_TEST_ALL: Force testing all wheel building -ifeq ($(strip $(WHEELS_TEST_ALL)),1) - -# [rpds-py] -# maturin canot be built as pre-requisite crossenv -ifneq ($(findstring $(ARCH),$(ARMv5_ARCHS)),$(ARCH)) -WHEELS += src/requirements-crossenv-rpds-py.txt -# Requires path to maturin from crossenv -ENV += PATH=$(WORK_DIR)/crossenv/build/bin:$(PATH) -endif - -# WHEELS_TEST_ALL: Force testing all wheel building -endif - include ../../mk/spksrc.spk.mk -## WHEELS_TEST_ALL: Force testing all wheel building -ifeq ($(strip $(WHEELS_TEST_ALL)),1) - -# [greenlet] -ifeq ($(call version_ge, $(TC_GCC), 4.9),1) -WHEELS += src/requirements-crossenv-greenlet-v2.txt -ifeq ($(call version_lt, $(TC_GCC), 5.0),1) -WHEELS_CPPFLAGS += [greenlet] -std=c++11 -fpermissive -endif -else -WHEELS += src/requirements-crossenv-greenlet-v1.txt -endif - -# [numpy] <= 1.21.6 (armv5) -# This version is now unsupported using py311 -ifneq ($(findstring $(ARCH),$(ARMv5_ARCHS)),$(ARCH)) -# [numpy] <= 1.22.4 (armv7l) -ifeq ($(findstring $(ARCH),$(ARMv7L_ARCHS)),$(ARCH)) -WHEELS += src/requirements-crossenv-numpy-armv7l.txt -# [numpy] <= 1.24.4 last working version with gcc-4.9 -else ifeq ($(call version_le, $(TC_GCC), 5.0),1) -WHEELS += src/requirements-crossenv-numpy-gcc4.txt -# [numpy] >= 1.25.0 requires c++17 -else ifeq ($(call version_gt, $(TC_GCC), 5.0),1) -WHEELS += src/requirements-crossenv-numpy.txt -endif -endif - -# workaround for compiler bug: -# https://github.com/numpy/numpy/issues/13622 -ifeq ($(call version_le, $(TC_GCC), 5.0),1) -ifeq ($(findstring $(ARCH),$(ARMv8_ARCHS)),$(ARCH)) -WHEELS_CFLAGS += [numpy] -O0 -endif -endif - -# [pycryptodome] -ifeq ($(call version_ge, $(TC_GCC), 4.9),1) -WHEELS_CFLAGS += [pycryptodome] -std=c11 -else -WHEELS_CFLAGS += [pycryptodome] -std=c99 -endif - -# [pycryptodomex] -ifeq ($(call version_ge, $(TC_GCC), 4.9),1) -WHEELS_CFLAGS += [pycryptodomex] -std=c11 -else -WHEELS_CFLAGS += [pycryptodomex] -std=c99 -endif - -# [pydantic_core] -ifeq ($(call version_ge, $(TC_GCC), 4.9),1) -WHEELS_CFLAGS += [pydantic_core] -std=c11 -else -WHEELS_CFLAGS += [pydantic_core] -std=c99 -endif -# Requires path to maturin from crossenv -ENV += PATH=$(WORK_DIR)/crossenv/build/bin:$(PATH) - -# WHEELS_TEST_ALL: Force testing all wheel building -endif - .PHONY: python311_extra_install python311_extra_install: - @$(MSG) - Remove test folder - rm -rf $(STAGING_DIR)/$(PYTHON_LIB_DIR)/test/ @$(MSG) - Remove compiled files from __pycache__ find $(STAGING_DIR)/$(PYTHON_LIB_DIR) -type f -regex '.*\.py[co]' -delete diff --git a/spk/python311/crossenv/requirements-default.txt b/spk/python311/crossenv/requirements-default.txt new file mode 100644 index 00000000000..4b8f768e596 --- /dev/null +++ b/spk/python311/crossenv/requirements-default.txt @@ -0,0 +1,19 @@ +pip==24.3.1 +pip-tools==7.4.1 +setuptools==75.4.0 +build==1.2.2 +wheel==0.45.0 +# +cffi==1.17.1 +cryptography==41.0.3 +Cython==3.0.11 +flit==3.10.1 +maturin==1.7.4 +meson-python==0.17.1 +msgpack==1.0.5 +poetry==1.8.4 +scikit-build==0.18.1 +scikit-build-core==0.10.7 +setuptools-rust==1.10.2 +setuptools-scm==8.1.0 +typing_extensions==4.12.2 diff --git a/spk/python311/crossenv/requirements-frozenlist.txt b/spk/python311/crossenv/requirements-frozenlist.txt new file mode 100644 index 00000000000..4edc3b107fb --- /dev/null +++ b/spk/python311/crossenv/requirements-frozenlist.txt @@ -0,0 +1,8 @@ +pip==24.3.1 +pip-tools==7.4.1 +setuptools==75.4.0 +build==1.2.2 +wheel==0.45.0 +# +Cython==3.0.11 +expandvars==0.12.0 diff --git a/spk/python311/crossenv/requirements-numpy-1.22.4.txt b/spk/python311/crossenv/requirements-numpy-1.22.4.txt new file mode 100644 index 00000000000..2268dcdffc4 --- /dev/null +++ b/spk/python311/crossenv/requirements-numpy-1.22.4.txt @@ -0,0 +1,7 @@ +pip==23.2.1 +setuptools==63.4.3 +wheel==0.41.2 +# +Cython==0.29.36 +scikit-build==0.17.6 +setuptools-scm==7.1.0 diff --git a/spk/python311/crossenv/requirements-numpy-1.24.4.txt b/spk/python311/crossenv/requirements-numpy-1.24.4.txt new file mode 100644 index 00000000000..2268dcdffc4 --- /dev/null +++ b/spk/python311/crossenv/requirements-numpy-1.24.4.txt @@ -0,0 +1,7 @@ +pip==23.2.1 +setuptools==63.4.3 +wheel==0.41.2 +# +Cython==0.29.36 +scikit-build==0.17.6 +setuptools-scm==7.1.0 diff --git a/spk/python311/crossenv/requirements-numpy-1.25.2.txt b/spk/python311/crossenv/requirements-numpy-1.25.2.txt new file mode 100644 index 00000000000..2268dcdffc4 --- /dev/null +++ b/spk/python311/crossenv/requirements-numpy-1.25.2.txt @@ -0,0 +1,7 @@ +pip==23.2.1 +setuptools==63.4.3 +wheel==0.41.2 +# +Cython==0.29.36 +scikit-build==0.17.6 +setuptools-scm==7.1.0 diff --git a/spk/python311/crossenv/requirements-numpy-1.26.4.txt b/spk/python311/crossenv/requirements-numpy-1.26.4.txt new file mode 100644 index 00000000000..1e314bd472f --- /dev/null +++ b/spk/python311/crossenv/requirements-numpy-1.26.4.txt @@ -0,0 +1,5 @@ +Cython==3.0.11 +meson-python==0.17.1 +scikit-build==0.18.1 +scikit-build-core==0.10.7 +setuptools-scm==8.1.0 diff --git a/spk/python311/crossenv/requirements-pydantic_core.txt b/spk/python311/crossenv/requirements-pydantic_core.txt new file mode 100644 index 00000000000..aab8e3a040e --- /dev/null +++ b/spk/python311/crossenv/requirements-pydantic_core.txt @@ -0,0 +1,10 @@ +pip==24.3.1 +pip-tools==7.4.1 +setuptools==75.4.0 +build==1.2.2 +wheel==0.45.0 +# +# [pydantic_core] depends on Cython < 3.x +Cython==0.29.37 +maturin==1.7.4 +typing_extensions==4.12.2 diff --git a/spk/python311/crossenv/requirements-yarl.txt b/spk/python311/crossenv/requirements-yarl.txt new file mode 100644 index 00000000000..4edc3b107fb --- /dev/null +++ b/spk/python311/crossenv/requirements-yarl.txt @@ -0,0 +1,8 @@ +pip==24.3.1 +pip-tools==7.4.1 +setuptools==75.4.0 +build==1.2.2 +wheel==0.45.0 +# +Cython==3.0.11 +expandvars==0.12.0 diff --git a/spk/python311/src/requirements-pure.txt b/spk/python311/src/requirements-pure.txt index 5dedc5cf9b8..617e77197ba 100644 --- a/spk/python311/src/requirements-pure.txt +++ b/spk/python311/src/requirements-pure.txt @@ -1,10 +1,8 @@ # basic default wheels # ==> Always install latest version (service-setup.sh:install_python_virtualenv) -pip==24.2 - -# Always match what's in cross/python311/Makefile -setuptools==68.1.2 -wheel==0.44.0 +pip==24.3.1 +setuptools==75.6.0 +wheel==0.45.1 # Always use latest version available # certifi==2024.8.30 @@ -14,12 +12,12 @@ certifi # to create their local virtualenv # in order to install wheels within # their running environment -virtualenv==20.26.6 +virtualenv==20.28.0 # Other mandatory wheels that # gets install by default as # basic dependencies of above -distlib==0.3.8 +distlib==0.3.9 filelock==3.16.1 platformdirs==4.3.6 six==1.16.0 diff --git a/spk/python312-wheels/Makefile b/spk/python312-wheels/Makefile new file mode 100644 index 00000000000..79b5840e848 --- /dev/null +++ b/spk/python312-wheels/Makefile @@ -0,0 +1,147 @@ +SPK_NAME = python312-wheels +SPK_VERS = 1.0 +SPK_VERS_MAJOR_MINOR = $(word 1,$(subst ., ,$(SPK_VERS))).$(word 2,$(subst ., ,$(SPK_VERS))) +SPK_REV = 1 +SPK_ICON = src/python3-pip.png + +# Compiler must support std=c++11 +UNSUPPORTED_ARCHS = $(OLD_PPC_ARCHS) $(ARMv5_ARCHS) + +PYTHON_PACKAGE = python312 +SPK_DEPENDS = "$(PYTHON_PACKAGE)" + +MAINTAINER = SynoCommunity +DESCRIPTION = Collection of programs for the Python 3.12 programming language. +DESCRIPTION_FRE = Collection of programs for the Python 3.12 programming language. +DESCRIPTION_SPN = Colección de programas para el lenguaje de programación Python 3.12. +STARTABLE = no +DISPLAY_NAME = Python 3.12 Wheels Collection +CHANGELOG = "1. Initial package" + +HOMEPAGE = https://www.python.org +LICENSE = PSF + +# Enable debug_info symgols +#GCC_DEBUG_INFO := 1 + +WHEELS = src/requirements-crossenv.txt +WHEELS += src/requirements-abi3.txt + +include ../../mk/spksrc.common.mk + +# [borgbackup] +# Use OpenSSL path as defined by either +# spksrc.wheel-env.mk or spksrc.python.mk +ENV += BORG_OPENSSL_PREFIX="$(OPENSSL_STAGING_PREFIX)" +ENV += BORG_LIBLZ4_PREFIX="$(STAGING_INSTALL_PREFIX)" +ENV += BORG_LIBZSTD_PREFIX="$(STAGING_INSTALL_PREFIX)" +ENV += BORG_LIBB2_PREFIX="$(STAGING_INSTALL_PREFIX)" +DEPENDS += cross/attr cross/acl cross/openssl3 cross/lz4 cross/zstd cross/libb2 cross/fuse +ifeq ($(call version_lt, $(TC_GCC), 5.0),1) +WHEELS_CFLAGS += [borgbackup] -std=c11 +endif + +# [cryptography] +# Use cross/cryptography to generate py36-abi3 limited API +# NOTE: It's not possible to build py36-abi3 limited API using pip due to PEP517 +# To generate py311-py311 regular build use src/requirements-crossenv.txt +DEPENDS += cross/cryptography + +# [gevent] +DEPENDS += cross/libev cross/c-ares +ENV += GEVENTSETUP_EMBED_CARES=FALSE +ENV += GEVENTSETUP_EMBED_LIBEV=FALSE +ifeq ($(call version_lt, $(TC_GCC), 5.0),1) +WHEELS_CFLAGS += [gevent] -std=c11 +endif + +# [greenlet] +ifeq ($(call version_ge, $(TC_GCC), 5.0),1) +WHEELS += src/requirements-crossenv-greenlet-v3.txt +else +WHEELS += src/requirements-crossenv-greenlet-v3-gcc4.txt +WHEELS_CPPFLAGS += [greenlet] -std=c++11 -fpermissive +endif + +# [llfuse] +ifeq ($(call version_lt, $(TC_GCC), 5.0),1) +WHEELS_CFLAGS += [llfuse] -std=c11 +endif + +# [lxml] +DEPENDS += cross/libxml2 +DEPENDS += cross/libxslt +ifeq ($(call version_lt, $(TC_GCC), 5.0),1) +WHEELS_CFLAGS += [lxml] -std=c11 +endif + +# [msgpack] +ifeq ($(call version_lt, $(TC_GCC), 5.0),1) +WHEELS_CFLAGS += [msgpack] -std=c11 +endif + +# [mysqlclient] +DEPENDS += cross/mysql-connector-c +DEPENDS += cross/mariadb-connector-c +ENV += MYSQLCLIENT_CFLAGS="$(CFLAGS) -I$(STAGING_INSTALL_PREFIX)/include/mysql -I$(STAGING_INSTALL_PREFIX)/include/mariadb -I$(STAGING_INSTALL_PREFIX)/$(PYTHON_INC_DIR)" +ENV += MYSQLCLIENT_LDFLAGS="$(LDFLAGS)" + +# [numpy] <= 1.21.6 (armv5) +# [numpy] <= 1.22.4 (armv7l) +# [numpy] <= 1.24.4 last working version with gcc-4.9 +# These versions are now unsupported using py312 +# [numpy] >= 1.25.0 requires c++17 +ifeq ($(call version_gt, $(TC_GCC), 5.0),1) +WHEELS += src/requirements-crossenv-numpy.txt +endif + +# [Pillow] +DEPENDS += cross/freetype cross/libjpeg cross/zlib +WHEELS_BUILD_ARGS += [Pillow] +WHEELS_BUILD_ARGS += build_ext +WHEELS_BUILD_ARGS += --disable-platform-guessing +WHEELS_BUILD_ARGS += --enable-freetype +WHEELS_BUILD_ARGS += --enable-jpeg +WHEELS_BUILD_ARGS += --enable-zlib + +# [pycares] +DEPENDS += cross/c-ares +ENV += PYCARES_USE_SYSTEM_LIB=1 + +# [pycryptodome] +ifeq ($(call version_lt, $(TC_GCC), 5.0),1) +WHEELS_CFLAGS += [pycryptodome] -std=c11 +endif + +# [pycryptodomex] +ifeq ($(call version_lt, $(TC_GCC), 5.0),1) +WHEELS_CFLAGS += [pycryptodomex] -std=c11 +endif + +# [pycurl] +DEPENDS += cross/curl +ENV += PYCURL_CURL_CONFIG=$(STAGING_INSTALL_PREFIX)/bin/curl-config + +# [pydantic_core] +# Requires path to maturin from crossenv +ifeq ($(call version_lt, $(TC_GCC), 5.0),1) +WHEELS_CFLAGS += [pydantic_core] -std=c11 +endif + +# [PyNaCl] +DEPENDS += cross/libsodium +ENV += SODIUM_INSTALL=system + +# [PyYAML] +DEPENDS += cross/libyaml + +# [ruamel.yaml.clib] +ifeq ($(call version_lt, $(TC_GCC), 5.0),1) +WHEELS_CFLAGS += [ruamel.yaml.clib] -std=c11 +endif + +# [rpds-py], [pydantic_core] +# Requires path to maturin from crossenv +ENV += PATH=$(WORK_DIR)/crossenv/build/bin:$(PATH) + +include ../../mk/spksrc.python.mk diff --git a/spk/python312-wheels/PLIST b/spk/python312-wheels/PLIST new file mode 100644 index 00000000000..4cfaf73a12c --- /dev/null +++ b/spk/python312-wheels/PLIST @@ -0,0 +1 @@ +rsc:share/wheelhouse diff --git a/spk/python312-wheels/src/python3-pip.png b/spk/python312-wheels/src/python3-pip.png new file mode 100644 index 00000000000..d195821833d Binary files /dev/null and b/spk/python312-wheels/src/python3-pip.png differ diff --git a/spk/python312-wheels/src/requirements-abi3.txt b/spk/python312-wheels/src/requirements-abi3.txt new file mode 100644 index 00000000000..4e50951c5f1 --- /dev/null +++ b/spk/python312-wheels/src/requirements-abi3.txt @@ -0,0 +1,12 @@ +## +## All configurations below are optional and +## are provided to demonstrate how to build +## various wheels. Uncoment to enable. +## + +# [pycryptodome] + [pycryptodomex] +# Require: +# - CFLAGS=-sdt=c99 < gcc-4.9 +# - CFLAGS=-sdt=c11 >= gcc-4.9 +pycryptodome==3.20.0 +pycryptodomex==3.20.0 diff --git a/spk/python312-wheels/src/requirements-crossenv-greenlet-v3-gcc4.txt b/spk/python312-wheels/src/requirements-crossenv-greenlet-v3-gcc4.txt new file mode 100644 index 00000000000..c2b4802c7ad --- /dev/null +++ b/spk/python312-wheels/src/requirements-crossenv-greenlet-v3-gcc4.txt @@ -0,0 +1,9 @@ +## +## All configurations below are optional and +## are provided to demonstrate how to build +## various wheels. Uncoment to enable. +## + +# [greenlet] +# - Mandatory require full c++11 support +greenlet==3.0.3 diff --git a/spk/python312-wheels/src/requirements-crossenv-greenlet-v3.txt b/spk/python312-wheels/src/requirements-crossenv-greenlet-v3.txt new file mode 100644 index 00000000000..837c343884b --- /dev/null +++ b/spk/python312-wheels/src/requirements-crossenv-greenlet-v3.txt @@ -0,0 +1,11 @@ +## +## All configurations below are optional and +## are provided to demonstrate how to build +## various wheels. Uncoment to enable. +## + +# [greenlet] +# - Mandatory require full c++11 support +greenlet==3.0.3 +# - Mandatory require full c++20 support added with gcc >= 8 +greenlet==3.1.1 diff --git a/spk/python311/src/requirements-crossenv-numpy.txt b/spk/python312-wheels/src/requirements-crossenv-numpy.txt similarity index 70% rename from spk/python311/src/requirements-crossenv-numpy.txt rename to spk/python312-wheels/src/requirements-crossenv-numpy.txt index 8ee5a285e37..9e5b9788cf4 100644 --- a/spk/python311/src/requirements-crossenv-numpy.txt +++ b/spk/python312-wheels/src/requirements-crossenv-numpy.txt @@ -6,9 +6,11 @@ # [numpy] # - Require Cython in cross/python310 crossenv -# - Numpy 1.25.x require c++17 -# - Numpy 1.26.x requires: +# - Numpy >= 1.26.x requires: # c++17, meson-python, scikit-build-core +numpy==2.1.3 +numpy==2.0.2 +numpy==1.26.4 + +# unsupported #numpy==1.25.2 -# - Temp. reverted to 1.24.x -numpy==1.24.4 diff --git a/spk/python312-wheels/src/requirements-crossenv.txt b/spk/python312-wheels/src/requirements-crossenv.txt new file mode 100644 index 00000000000..65f3088ff05 --- /dev/null +++ b/spk/python312-wheels/src/requirements-crossenv.txt @@ -0,0 +1,117 @@ +## +## All configurations below are optional and +## are provided to demonstrate how to build +## various wheels. Uncoment to enable. +## + +# [bcrypt] +# Require environment variables +# PYO3_CROSS_LIB_DIR=$(STAGING_INSTALL_PREFIX)/lib/ +# PYO3_CROSS_INCLUDE_DIR=$(STAGING_INSTALL_PREFIX)/include/ +bcrypt==4.2.0 + +# [cryptography] +# Mandatory of using OPENSSL_*_DIR starting with version >= 40 +# https://docs.rs/openssl/latest/openssl/#automatic +# ENV += OPENSSL_LIB_DIR=$(STAGING_INSTALL_PREFIX)/lib/ +# ENV += OPENSSL_INCLUDE_DIR=$(STAGING_INSTALL_PREFIX)/include/ +cryptography==43.0.3 +cryptography==44.0.0 + +# Requirement for cryptography +cffi==1.15.1 +cffi==1.17.1 + +# commonly used cross-compiled wheels +# All tested and can be enabled but may conflict +# with local python apps requirements + +borgbackup==1.2.6 +charset_normalizer==3.2.0 +immutables==0.20 +### llfuse==1.5.0 # fails to find "clock_gettime" +MarkupSafe==2.1.5 +msgpack==1.0.5 # used compiled verrsion for performance +msgpack_python==0.5.6 +netifaces==0.11.0 +psutil==6.0.0 +pyrsistent==0.19.3 +regex==2024.7.24 +ruamel.yaml.clib==0.2.12 +SQLAlchemy==2.0.32 +zope.interface==7.0.2 + +# [gevent] +# Depends: libev, c-ares +# Require environment variables +# GEVENTSETUP_EMBED_CARES=FALSE +# GEVENTSETUP_EMBED_LIBEV=FALSE +gevent==24.2.1 + +# [lxml] +# Depends: libxml2, libxslt +lxml==5.3.0 + +# [mysqlclient] +# Depends: mysql-connector-c, mariadb-connector-c +# Require environment variables +# MYSQLCLIENT_CFLAGS +# MYSQLCLIENT_LDFLAGS +mysqlclient==2.2.4 + +# [Pillow] +# Require --global-options arguments +# WHEELS_BUILD_ARGS = [Pillow] build_ext --disable-platform-guessing +Pillow==9.5.0 + +# [pycares] +# Depends: c-ares +# Require environment variables +# PYCARES_USE_SYSTEM_LIB=1 +pycares==4.4.0 + +# [pycurl] +# Depends: curl +# Require environment variables +# PYCURL_CURL_CONFIG +pycurl==7.45.3 + +# [pydantic_core] +# Requires path to maturin from crossenv +# Requires WHEELS_CFLAGS = -std=c11 for = gcc-4.9 +# Requires WHEELS_CFLAGS = -std=c99 for < gcc-4.9 +# Require environment variables +# PYO3_CROSS_LIB_DIR=$(STAGING_INSTALL_PREFIX)/lib/ +# PYO3_CROSS_INCLUDE_DIR=$(STAGING_INSTALL_PREFIX)/include/ +pydantic_core==2.23.0 + +# [PyNaCl] +# Depends: cross/libsodium +# Require environment variables +# SODIUM_INSTALL=system +PyNaCl==1.5.0 + +# [PyYAML] +# Depends: libyaml +PyYAML==6.0.2 + +# [rencode] +# Updated fork of the project +# rencode==1.0.6 <<-- unsupported +git+https://github.com/totaam/rencode.git@f6254ab26161f90b9c5e97915b9193fee805fc1f#egg=rencode==1.0.7 + +# [rpds-py] +# Require environment variables +# PYO3_CROSS_LIB_DIR=$(STAGING_INSTALL_PREFIX)/lib/ +# PYO3_CROSS_INCLUDE_DIR=$(STAGING_INSTALL_PREFIX)/include/ +# Requires path to maturin from crossenv +# ENV += PATH=$(WORK_DIR)/crossenv/build/bin:$(PATH) +rpds_py==0.20.0 + +# [ujson] +# - Require setuptools-scm in cross/python3* crossenv +ujson==5.10.0 + +# [webrtcvad] +# webrtcvad==2.0.10 # requires unreleased version at specific commit for qoriq arch +git+https://github.com/wiseman/py-webrtcvad@3bd761332a9404f5c9276105070ee814c4428342#egg=webrtcvad==2.0.10 diff --git a/spk/python312/Makefile b/spk/python312/Makefile new file mode 100644 index 00000000000..fea0f1d29b4 --- /dev/null +++ b/spk/python312/Makefile @@ -0,0 +1,44 @@ +SPK_NAME = python312 +SPK_VERS = 3.12.8 +SPK_VERS_MAJOR_MINOR = $(word 1,$(subst ., ,$(SPK_VERS))).$(word 2,$(subst ., ,$(SPK_VERS))) +SPK_REV = 1 +SPK_ICON = src/python3.png + +# Compiler must support std=c++11 +UNSUPPORTED_ARCHS = $(OLD_PPC_ARCHS) $(ARMv5_ARCHS) + +DEPENDS = cross/python312 +DEPENDS += cross/pip + +MAINTAINER = SynoCommunity +DESCRIPTION = Python Programming Language. +DESCRIPTION_FRE = Language de programmation Python. +DESCRIPTION_SPN = Lenguaje de programación Python. +STARTABLE = no +DISPLAY_NAME = Python 3.12 +CHANGELOG = "1. Initial Python 3.12.8 package release" + +HOMEPAGE = https://www.python.org +LICENSE = PSF + +# Force compiler LTO optimizations +ENV += PYTHON_OPTIMIZE=1 + +# Force building pure-python wheels +WHEELS_PURE_PYTHON_PACKAGING_ENABLE = 1 +WHEELS = src/requirements-pure.txt + +SERVICE_SETUP = src/service-setup.sh + +PYTHON_LIB_DIR = lib/python$(SPK_VERS_MAJOR_MINOR) + +POST_STRIP_TARGET = python312_extra_install + +SPK_USR_LOCAL_LINKS = bin:bin/python3.12 + +include ../../mk/spksrc.spk.mk + +.PHONY: python312_extra_install +python312_extra_install: + @$(MSG) - Remove compiled files from __pycache__ + find $(STAGING_DIR)/$(PYTHON_LIB_DIR) -type f -regex '.*\.py[co]' -delete diff --git a/spk/python312/PLIST b/spk/python312/PLIST new file mode 100644 index 00000000000..4cfaf73a12c --- /dev/null +++ b/spk/python312/PLIST @@ -0,0 +1 @@ +rsc:share/wheelhouse diff --git a/spk/python312/crossenv/requirements-default.txt b/spk/python312/crossenv/requirements-default.txt new file mode 100644 index 00000000000..9400a96724e --- /dev/null +++ b/spk/python312/crossenv/requirements-default.txt @@ -0,0 +1,19 @@ +pip==24.3.1 +pip-tools==7.4.1 +setuptools==75.4.0 +build==1.2.2 +wheel==0.45.0 +# +cffi==1.17.1 +cryptography==43.0.3 +Cython==3.0.11 +flit==3.10.1 +maturin==1.7.4 +meson-python==0.17.1 +msgpack==1.0.5 +poetry==1.8.4 +scikit-build==0.18.1 +scikit-build-core==0.10.7 +setuptools-rust==1.10.2 +setuptools-scm==8.1.0 +typing_extensions==4.12.2 diff --git a/spk/python312/crossenv/requirements-frozenlist.txt b/spk/python312/crossenv/requirements-frozenlist.txt new file mode 100644 index 00000000000..4edc3b107fb --- /dev/null +++ b/spk/python312/crossenv/requirements-frozenlist.txt @@ -0,0 +1,8 @@ +pip==24.3.1 +pip-tools==7.4.1 +setuptools==75.4.0 +build==1.2.2 +wheel==0.45.0 +# +Cython==3.0.11 +expandvars==0.12.0 diff --git a/spk/python312/crossenv/requirements-numpy-1.22.4.txt b/spk/python312/crossenv/requirements-numpy-1.22.4.txt new file mode 100644 index 00000000000..e740501ce2d --- /dev/null +++ b/spk/python312/crossenv/requirements-numpy-1.22.4.txt @@ -0,0 +1,14 @@ +pip==23.2.1 +setuptools==63.4.3 +wheel==0.41.2 +# +cffi==1.15.1 +cryptography==41.0.3 +Cython==0.29.36 +flit==3.9.0 +maturin==1.2.3 +msgpack==1.0.5 +poetry==1.6.1 +scikit-build==0.17.6 +setuptools-rust==1.7.0 +setuptools-scm==7.1.0 diff --git a/spk/python312/crossenv/requirements-numpy-1.24.4.txt b/spk/python312/crossenv/requirements-numpy-1.24.4.txt new file mode 100644 index 00000000000..e740501ce2d --- /dev/null +++ b/spk/python312/crossenv/requirements-numpy-1.24.4.txt @@ -0,0 +1,14 @@ +pip==23.2.1 +setuptools==63.4.3 +wheel==0.41.2 +# +cffi==1.15.1 +cryptography==41.0.3 +Cython==0.29.36 +flit==3.9.0 +maturin==1.2.3 +msgpack==1.0.5 +poetry==1.6.1 +scikit-build==0.17.6 +setuptools-rust==1.7.0 +setuptools-scm==7.1.0 diff --git a/spk/python312/crossenv/requirements-numpy-1.25.1.txt b/spk/python312/crossenv/requirements-numpy-1.25.1.txt new file mode 100644 index 00000000000..e740501ce2d --- /dev/null +++ b/spk/python312/crossenv/requirements-numpy-1.25.1.txt @@ -0,0 +1,14 @@ +pip==23.2.1 +setuptools==63.4.3 +wheel==0.41.2 +# +cffi==1.15.1 +cryptography==41.0.3 +Cython==0.29.36 +flit==3.9.0 +maturin==1.2.3 +msgpack==1.0.5 +poetry==1.6.1 +scikit-build==0.17.6 +setuptools-rust==1.7.0 +setuptools-scm==7.1.0 diff --git a/spk/python312/crossenv/requirements-pydantic_core.txt b/spk/python312/crossenv/requirements-pydantic_core.txt new file mode 100644 index 00000000000..aab8e3a040e --- /dev/null +++ b/spk/python312/crossenv/requirements-pydantic_core.txt @@ -0,0 +1,10 @@ +pip==24.3.1 +pip-tools==7.4.1 +setuptools==75.4.0 +build==1.2.2 +wheel==0.45.0 +# +# [pydantic_core] depends on Cython < 3.x +Cython==0.29.37 +maturin==1.7.4 +typing_extensions==4.12.2 diff --git a/spk/python312/crossenv/requirements-yarl.txt b/spk/python312/crossenv/requirements-yarl.txt new file mode 100644 index 00000000000..4edc3b107fb --- /dev/null +++ b/spk/python312/crossenv/requirements-yarl.txt @@ -0,0 +1,8 @@ +pip==24.3.1 +pip-tools==7.4.1 +setuptools==75.4.0 +build==1.2.2 +wheel==0.45.0 +# +Cython==3.0.11 +expandvars==0.12.0 diff --git a/spk/python312/src/python3.png b/spk/python312/src/python3.png new file mode 100644 index 00000000000..7c9cb8f7d16 Binary files /dev/null and b/spk/python312/src/python3.png differ diff --git a/spk/python312/src/requirements-pure.txt b/spk/python312/src/requirements-pure.txt new file mode 100644 index 00000000000..617e77197ba --- /dev/null +++ b/spk/python312/src/requirements-pure.txt @@ -0,0 +1,29 @@ +# basic default wheels +# ==> Always install latest version (service-setup.sh:install_python_virtualenv) +pip==24.3.1 +setuptools==75.6.0 +wheel==0.45.1 + +# Always use latest version available +# certifi==2024.8.30 +certifi + +# Mandatory for python application +# to create their local virtualenv +# in order to install wheels within +# their running environment +virtualenv==20.28.0 + +# Other mandatory wheels that +# gets install by default as +# basic dependencies of above +distlib==0.3.9 +filelock==3.16.1 +platformdirs==4.3.6 +six==1.16.0 + +## +## All configurations below are optional and +## are provided to demonstrate how to build +## various wheels. Uncoment to enable. +## diff --git a/spk/python312/src/service-setup.sh b/spk/python312/src/service-setup.sh new file mode 100644 index 00000000000..bd7b2c47850 --- /dev/null +++ b/spk/python312/src/service-setup.sh @@ -0,0 +1,16 @@ +PATH="${SYNOPKG_PKGDEST}/bin:$PATH" + +service_postinst () +{ + # Install the wheels + install_python_wheels + + # Log installation informations + echo "Installed version: $( ${SYNOPKG_PKGDEST}/bin/python3 --version 2>&1 )" + + # Byte-compile in background + PYTHON_SHORT_VER=$(${SYNOPKG_PKGDEST}/bin/python3 -c 'import sys; print("{0}.{1}".format(*sys.version_info[:2]))') + ${SYNOPKG_PKGDEST}/bin/python3 -m compileall -q -f ${SYNOPKG_PKGDEST}/lib/python${PYTHON_SHORT_VER} /dev/null & + ${SYNOPKG_PKGDEST}/bin/python3 -OO -m compileall -q -f ${SYNOPKG_PKGDEST}/lib/python${PYTHON_SHORT_VER} /dev/null & +} + diff --git a/spk/python313/Makefile b/spk/python313/Makefile new file mode 100644 index 00000000000..dbbe8d6dbc1 --- /dev/null +++ b/spk/python313/Makefile @@ -0,0 +1,44 @@ +SPK_NAME = python313 +SPK_VERS = 3.13.1 +SPK_VERS_MAJOR_MINOR = $(word 1,$(subst ., ,$(SPK_VERS))).$(word 2,$(subst ., ,$(SPK_VERS))) +SPK_REV = 1 +SPK_ICON = src/python3.png + +# Compiler must support std=c++11 +UNSUPPORTED_ARCHS = $(OLD_PPC_ARCHS) $(ARMv5_ARCHS) + +DEPENDS = cross/python313 +DEPENDS += cross/pip + +MAINTAINER = SynoCommunity +DESCRIPTION = Python Programming Language. +DESCRIPTION_FRE = Language de programmation Python. +DESCRIPTION_SPN = Lenguaje de programación Python. +STARTABLE = no +DISPLAY_NAME = Python 3.13 +CHANGELOG = "1. Initial Python 3.13.1 package release" + +HOMEPAGE = https://www.python.org +LICENSE = PSF + +# Force compiler LTO optimizations +ENV += PYTHON_OPTIMIZE=1 + +# Force building pure-python wheels +WHEELS_PURE_PYTHON_PACKAGING_ENABLE = 1 +WHEELS = src/requirements-pure.txt + +SERVICE_SETUP = src/service-setup.sh + +PYTHON_LIB_DIR = lib/python$(SPK_VERS_MAJOR_MINOR) + +POST_STRIP_TARGET = python313_extra_install + +SPK_USR_LOCAL_LINKS = bin:bin/python3.13 + +include ../../mk/spksrc.spk.mk + +.PHONY: python313_extra_install +python313_extra_install: + @$(MSG) - Remove compiled files from __pycache__ + find $(STAGING_DIR)/$(PYTHON_LIB_DIR) -type f -regex '.*\.py[co]' -delete diff --git a/spk/python313/PLIST b/spk/python313/PLIST new file mode 100644 index 00000000000..4cfaf73a12c --- /dev/null +++ b/spk/python313/PLIST @@ -0,0 +1 @@ +rsc:share/wheelhouse diff --git a/spk/python313/crossenv/requirements-default.txt b/spk/python313/crossenv/requirements-default.txt new file mode 100644 index 00000000000..9400a96724e --- /dev/null +++ b/spk/python313/crossenv/requirements-default.txt @@ -0,0 +1,19 @@ +pip==24.3.1 +pip-tools==7.4.1 +setuptools==75.4.0 +build==1.2.2 +wheel==0.45.0 +# +cffi==1.17.1 +cryptography==43.0.3 +Cython==3.0.11 +flit==3.10.1 +maturin==1.7.4 +meson-python==0.17.1 +msgpack==1.0.5 +poetry==1.8.4 +scikit-build==0.18.1 +scikit-build-core==0.10.7 +setuptools-rust==1.10.2 +setuptools-scm==8.1.0 +typing_extensions==4.12.2 diff --git a/spk/python313/crossenv/requirements-frozenlist.txt b/spk/python313/crossenv/requirements-frozenlist.txt new file mode 100644 index 00000000000..4edc3b107fb --- /dev/null +++ b/spk/python313/crossenv/requirements-frozenlist.txt @@ -0,0 +1,8 @@ +pip==24.3.1 +pip-tools==7.4.1 +setuptools==75.4.0 +build==1.2.2 +wheel==0.45.0 +# +Cython==3.0.11 +expandvars==0.12.0 diff --git a/spk/python313/crossenv/requirements-numpy-1.22.4.txt b/spk/python313/crossenv/requirements-numpy-1.22.4.txt new file mode 100644 index 00000000000..e740501ce2d --- /dev/null +++ b/spk/python313/crossenv/requirements-numpy-1.22.4.txt @@ -0,0 +1,14 @@ +pip==23.2.1 +setuptools==63.4.3 +wheel==0.41.2 +# +cffi==1.15.1 +cryptography==41.0.3 +Cython==0.29.36 +flit==3.9.0 +maturin==1.2.3 +msgpack==1.0.5 +poetry==1.6.1 +scikit-build==0.17.6 +setuptools-rust==1.7.0 +setuptools-scm==7.1.0 diff --git a/spk/python313/crossenv/requirements-numpy-1.24.4.txt b/spk/python313/crossenv/requirements-numpy-1.24.4.txt new file mode 100644 index 00000000000..e740501ce2d --- /dev/null +++ b/spk/python313/crossenv/requirements-numpy-1.24.4.txt @@ -0,0 +1,14 @@ +pip==23.2.1 +setuptools==63.4.3 +wheel==0.41.2 +# +cffi==1.15.1 +cryptography==41.0.3 +Cython==0.29.36 +flit==3.9.0 +maturin==1.2.3 +msgpack==1.0.5 +poetry==1.6.1 +scikit-build==0.17.6 +setuptools-rust==1.7.0 +setuptools-scm==7.1.0 diff --git a/spk/python313/crossenv/requirements-numpy-1.25.1.txt b/spk/python313/crossenv/requirements-numpy-1.25.1.txt new file mode 100644 index 00000000000..e740501ce2d --- /dev/null +++ b/spk/python313/crossenv/requirements-numpy-1.25.1.txt @@ -0,0 +1,14 @@ +pip==23.2.1 +setuptools==63.4.3 +wheel==0.41.2 +# +cffi==1.15.1 +cryptography==41.0.3 +Cython==0.29.36 +flit==3.9.0 +maturin==1.2.3 +msgpack==1.0.5 +poetry==1.6.1 +scikit-build==0.17.6 +setuptools-rust==1.7.0 +setuptools-scm==7.1.0 diff --git a/spk/python313/crossenv/requirements-pydantic_core.txt b/spk/python313/crossenv/requirements-pydantic_core.txt new file mode 100644 index 00000000000..aab8e3a040e --- /dev/null +++ b/spk/python313/crossenv/requirements-pydantic_core.txt @@ -0,0 +1,10 @@ +pip==24.3.1 +pip-tools==7.4.1 +setuptools==75.4.0 +build==1.2.2 +wheel==0.45.0 +# +# [pydantic_core] depends on Cython < 3.x +Cython==0.29.37 +maturin==1.7.4 +typing_extensions==4.12.2 diff --git a/spk/python313/crossenv/requirements-yarl.txt b/spk/python313/crossenv/requirements-yarl.txt new file mode 100644 index 00000000000..4edc3b107fb --- /dev/null +++ b/spk/python313/crossenv/requirements-yarl.txt @@ -0,0 +1,8 @@ +pip==24.3.1 +pip-tools==7.4.1 +setuptools==75.4.0 +build==1.2.2 +wheel==0.45.0 +# +Cython==3.0.11 +expandvars==0.12.0 diff --git a/spk/python313/src/python3.png b/spk/python313/src/python3.png new file mode 100644 index 00000000000..1d3d99794de Binary files /dev/null and b/spk/python313/src/python3.png differ diff --git a/spk/python313/src/python3.svg b/spk/python313/src/python3.svg new file mode 100644 index 00000000000..5d4ba4b925b --- /dev/null +++ b/spk/python313/src/python3.svg @@ -0,0 +1,261 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + diff --git a/spk/python313/src/requirements-pure.txt b/spk/python313/src/requirements-pure.txt new file mode 100644 index 00000000000..617e77197ba --- /dev/null +++ b/spk/python313/src/requirements-pure.txt @@ -0,0 +1,29 @@ +# basic default wheels +# ==> Always install latest version (service-setup.sh:install_python_virtualenv) +pip==24.3.1 +setuptools==75.6.0 +wheel==0.45.1 + +# Always use latest version available +# certifi==2024.8.30 +certifi + +# Mandatory for python application +# to create their local virtualenv +# in order to install wheels within +# their running environment +virtualenv==20.28.0 + +# Other mandatory wheels that +# gets install by default as +# basic dependencies of above +distlib==0.3.9 +filelock==3.16.1 +platformdirs==4.3.6 +six==1.16.0 + +## +## All configurations below are optional and +## are provided to demonstrate how to build +## various wheels. Uncoment to enable. +## diff --git a/spk/python313/src/service-setup.sh b/spk/python313/src/service-setup.sh new file mode 100644 index 00000000000..bd7b2c47850 --- /dev/null +++ b/spk/python313/src/service-setup.sh @@ -0,0 +1,16 @@ +PATH="${SYNOPKG_PKGDEST}/bin:$PATH" + +service_postinst () +{ + # Install the wheels + install_python_wheels + + # Log installation informations + echo "Installed version: $( ${SYNOPKG_PKGDEST}/bin/python3 --version 2>&1 )" + + # Byte-compile in background + PYTHON_SHORT_VER=$(${SYNOPKG_PKGDEST}/bin/python3 -c 'import sys; print("{0}.{1}".format(*sys.version_info[:2]))') + ${SYNOPKG_PKGDEST}/bin/python3 -m compileall -q -f ${SYNOPKG_PKGDEST}/lib/python${PYTHON_SHORT_VER} /dev/null & + ${SYNOPKG_PKGDEST}/bin/python3 -OO -m compileall -q -f ${SYNOPKG_PKGDEST}/lib/python${PYTHON_SHORT_VER} /dev/null & +} + diff --git a/spk/rdiff-backup/Makefile b/spk/rdiff-backup/Makefile index 6e09b10c85d..b21b2d30af8 100644 --- a/spk/rdiff-backup/Makefile +++ b/spk/rdiff-backup/Makefile @@ -11,9 +11,6 @@ WHEELS = src/requirements-crossenv.txt src/requirements-pure.txt DEPENDS = cross/librsync cross/attr cross/acl -# required to build frozenlist and yarl -ADDITIONAL_CROSSENV_WHEELS = expandvars==0.12.0 - # [PyYAML] DEPENDS += cross/libyaml