From 5936ca408d86d3a5ccfc8e4084b84403fd208693 Mon Sep 17 00:00:00 2001 From: hgy59 Date: Sat, 2 Mar 2024 20:03:01 +0100 Subject: [PATCH 1/6] openssl3: fix for ARMv5 and OLD_PPC_ARCHS - enable openssl3 for toolchains lacking libatomic - fixes build of openssl 3.x with threads enabled but without libatomic --- cross/openssl3/Makefile | 13 ++++++----- .../001-avoid-the-use-of-libatomic.patch | 22 +++++++++++++++++++ .../001-avoid-the-use-of-libatomic.patch | 22 +++++++++++++++++++ 3 files changed, 52 insertions(+), 5 deletions(-) create mode 100644 cross/openssl3/patches/88f6281/001-avoid-the-use-of-libatomic.patch create mode 100644 cross/openssl3/patches/ppc853x/001-avoid-the-use-of-libatomic.patch diff --git a/cross/openssl3/Makefile b/cross/openssl3/Makefile index 8cb6edd44f0..234247a2cec 100644 --- a/cross/openssl3/Makefile +++ b/cross/openssl3/Makefile @@ -40,8 +40,6 @@ endif ifeq ($(findstring $(ARCH),$(ARMv5_ARCHS)),$(ARCH)) OPENSSL_PLATFORM = linux-armv4 CONFIGURE_ARGS += -march=armv5 -# threads need libatomic that is missing in ARMv5 toolchain -CONFIGURE_ARGS += no-threads endif ifeq ($(findstring $(ARCH),$(ARMv7_ARCHS) $(ARMv7L_ARCHS)),$(ARCH)) OPENSSL_PLATFORM = linux-armv4 @@ -52,10 +50,15 @@ endif ifeq ($(findstring $(ARCH),$(PPC_ARCHS)),$(ARCH)) OPENSSL_PLATFORM = linux-ppc CONFIGURE_ARGS += no-asm -ifeq ($(findstring $(ARCH),$(OLD_PPC_ARCHS)),$(ARCH)) -# threads need libatomic that is missing in OLD_PPC_ARCHS toolchains -CONFIGURE_ARGS += no-threads endif + +ifeq ($(findstring $(ARCH),$(OLD_PPC_ARCHS) $(ARMv5_ARCHS)),$(ARCH)) +# threads need libatomic that is missing in ARMv5_ARCHS and OLD_PPC_ARCHS toolchains +#CONFIGURE_ARGS += no-threads +# BUT the following packages require OpenSSL with threads support (OPENSSL_THREADS) +# - python311 #error "OPENSSL_THREADS is not defined, Python requires thread-safe OpenSSL" +# - stunnel #error OpenSSL library compiled without thread support +# A first approach is to avoid the need of libatomic (see patches/*/001-avoid-the-use-of-libatomic.patch) endif ifeq ($(strip $(OPENSSL_PLATFORM)),) diff --git a/cross/openssl3/patches/88f6281/001-avoid-the-use-of-libatomic.patch b/cross/openssl3/patches/88f6281/001-avoid-the-use-of-libatomic.patch new file mode 100644 index 00000000000..cbaf43ec8dc --- /dev/null +++ b/cross/openssl3/patches/88f6281/001-avoid-the-use-of-libatomic.patch @@ -0,0 +1,22 @@ +# avoid linking with libatomic for ARMv5_ARCHS and OLD_PPC_ARCHS +# +--- Configurations/10-main.conf.orig 2024-01-30 13:22:11.000000000 +0000 ++++ Configurations/10-main.conf 2024-03-02 14:04:09.586401205 +0000 +@@ -712,7 +712,7 @@ + }, + + "linux-ppc" => { +- inherit_from => [ "linux-latomic" ], ++ inherit_from => [ "linux-generic32" ], + asm_arch => 'ppc32', + perlasm_scheme => "linux32", + lib_cppflags => add("-DB_ENDIAN"), +@@ -767,7 +767,7 @@ + # + # ./Configure linux-armv4 -march=armv6 -D__ARM_MAX_ARCH__=8 + # +- inherit_from => [ "linux-latomic" ], ++ inherit_from => [ "linux-generic32" ], + asm_arch => 'armv4', + perlasm_scheme => "linux32", + }, diff --git a/cross/openssl3/patches/ppc853x/001-avoid-the-use-of-libatomic.patch b/cross/openssl3/patches/ppc853x/001-avoid-the-use-of-libatomic.patch new file mode 100644 index 00000000000..cbaf43ec8dc --- /dev/null +++ b/cross/openssl3/patches/ppc853x/001-avoid-the-use-of-libatomic.patch @@ -0,0 +1,22 @@ +# avoid linking with libatomic for ARMv5_ARCHS and OLD_PPC_ARCHS +# +--- Configurations/10-main.conf.orig 2024-01-30 13:22:11.000000000 +0000 ++++ Configurations/10-main.conf 2024-03-02 14:04:09.586401205 +0000 +@@ -712,7 +712,7 @@ + }, + + "linux-ppc" => { +- inherit_from => [ "linux-latomic" ], ++ inherit_from => [ "linux-generic32" ], + asm_arch => 'ppc32', + perlasm_scheme => "linux32", + lib_cppflags => add("-DB_ENDIAN"), +@@ -767,7 +767,7 @@ + # + # ./Configure linux-armv4 -march=armv6 -D__ARM_MAX_ARCH__=8 + # +- inherit_from => [ "linux-latomic" ], ++ inherit_from => [ "linux-generic32" ], + asm_arch => 'armv4', + perlasm_scheme => "linux32", + }, From dd33c68c73419985e9ea5ddb325aac40a6e0aec5 Mon Sep 17 00:00:00 2001 From: hgy59 Date: Sat, 2 Mar 2024 21:55:55 +0100 Subject: [PATCH 2/6] python311: bring back builds for ARMv5_ARCHS and OLD_PPC_ARCHS - enable build of python311 for ARMv5 and OLD_PPC - enable build of cross/cryptography for ARMv5 - bring back python311 customization for OLD_PPC_ARCHS - adjust patches for python311 and older toolchains --- cross/cryptography/Makefile | 4 -- cross/python311/Makefile | 20 +++++----- ...05-configure.ac-remove-unknown-flags.patch | 5 ++- ...static_assert_undefined-fix-GH-94766.patch | 39 +++++++++++++++++++ ...05-configure.ac-remove-unknown-flags.patch | 30 +++++++------- ...05-configure.ac-remove-unknown-flags.patch | 2 +- spk/python311/Makefile | 6 --- 7 files changed, 68 insertions(+), 38 deletions(-) create mode 100644 cross/python311/patches/ppc853x-5.2/001-revert-static_assert_undefined-fix-GH-94766.patch diff --git a/cross/cryptography/Makefile b/cross/cryptography/Makefile index 20053bbbc57..f87252594f6 100644 --- a/cross/cryptography/Makefile +++ b/cross/cryptography/Makefile @@ -11,10 +11,6 @@ HOMEPAGE = https://github.com/pyca/cryptography COMMENT = Provide cryptographic recipes and primitives to Python developers LICENSE = BSD/ASL2 -# Unsupported due to lack of libatomic -# being mandatory with OpenSSL >= 3.x -UNSUPPORTED_ARCHS = $(ARMv5_ARCHS) - ### ### This cross/cryptography is needed to generate python-limited abi3 wheels ### Ref: https://github.com/pyca/cryptography/issues/7671 diff --git a/cross/python311/Makefile b/cross/python311/Makefile index cf89c24872c..48aa69b0368 100644 --- a/cross/python311/Makefile +++ b/cross/python311/Makefile @@ -6,14 +6,6 @@ PKG_DIST_NAME = Python-$(PKG_VERS).$(PKG_EXT) PKG_DIST_SITE = https://www.python.org/ftp/python/$(PKG_VERS) PKG_DIR = Python-$(PKG_VERS) -# 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. -UNSUPPORTED_ARCHS = $(OLD_PPC_ARCHS) -# Missing libatomic for proper openssl >= 3.x support -# Ref: https://github.com/SynoCommunity/spksrc/issues/5841 -# https://github.com/SynoCommunity/spksrc/pull/5820#issuecomment-1678221438 -UNSUPPORTED_ARCHS += $(ARMv5_ARCHS) - BUILD_DEPENDS = native/$(PKG_NAME) DEPENDS = cross/zlib cross/sqlite cross/readline cross/ncursesw cross/bzip2 cross/xz @@ -39,9 +31,12 @@ CONFIGURE_ARGS += --with-build-python include ../../mk/spksrc.archs.mk -# optionally generate optimized code +# optionally generate optimized code (optimizaton is always disabled for OLD_PPC_ARCHS) 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 @@ -49,6 +44,11 @@ else CONFIGURE_ARGS += --disable-test-modules endif +ifeq ($(findstring $(ARCH),$(OLD_PPC_ARCHS)),$(ARCH)) +# older gcc does not know -Wno-unused-result +CONFIGURE_ARGS += ac_cv_disable_unused_result_warning=no +endif + CONFIGURE_ARGS += ac_cv_buggy_getaddrinfo=no CONFIGURE_ARGS += ac_cv_file__dev_ptmx=no CONFIGURE_ARGS += ac_cv_file__dev_ptc=no @@ -166,7 +166,7 @@ endif endif # [maturin] -ifneq ($(findstring $(ARCH),$(ARMv5_ARCHS)),$(ARCH)) +ifneq ($(findstring $(ARCH),$(ARMv5_ARCHS) $(OLD_PPC_ARCHS)),$(ARCH)) CROSSENV_WHEELS += maturin==1.2.3 endif diff --git a/cross/python311/patches/88f6281/005-configure.ac-remove-unknown-flags.patch b/cross/python311/patches/88f6281/005-configure.ac-remove-unknown-flags.patch index 6629a7cb00b..6e379adf32d 100644 --- a/cross/python311/patches/88f6281/005-configure.ac-remove-unknown-flags.patch +++ b/cross/python311/patches/88f6281/005-configure.ac-remove-unknown-flags.patch @@ -1,6 +1,7 @@ -# remove lto optimization flags unknown by ARMv5 gcc +# remove flags unknown by gcc 4.6.4 of ARMv5 toolchain # - remove -ffat-lto-objects - +# - replace -std=c11 by -std=c99 +# --- configure.ac.orig 2022-06-06 11:53:30.000000000 +0000 +++ configure.ac 2022-06-19 15:36:23.019811638 +0000 @@ -1872,7 +1872,7 @@ if test "$Py_LTO" = 'true' ; then diff --git a/cross/python311/patches/ppc853x-5.2/001-revert-static_assert_undefined-fix-GH-94766.patch b/cross/python311/patches/ppc853x-5.2/001-revert-static_assert_undefined-fix-GH-94766.patch new file mode 100644 index 00000000000..3b2c36f60c8 --- /dev/null +++ b/cross/python311/patches/ppc853x-5.2/001-revert-static_assert_undefined-fix-GH-94766.patch @@ -0,0 +1,39 @@ +--- Include/pymacro.h-orig 2023-06-06 22:00:27.000000000 +0000 ++++ Include/pymacro.h 2023-07-03 19:36:57.974496974 +0000 +@@ -3,23 +3,20 @@ + + // gh-91782: On FreeBSD 12, if the _POSIX_C_SOURCE and _XOPEN_SOURCE macros are + // defined, disables C11 support and does not define +-// the static_assert() macro. ++// the static_assert() macro. Define the static_assert() macro in Python until ++// suports C11: + // https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=255290 +-// +-// macOS <= 10.10 doesn't define static_assert in assert.h at all despite +-// having C11 compiler support. +-// +-// static_assert is defined in glibc from version 2.16. Compiler support for +-// the C11 _Static_assert keyword is in gcc >= 4.6. +-// +-// MSVC makes static_assert a keyword in C11-17, contrary to the standards. +-// +-// In C++11 and C2x, static_assert is a keyword, redefining is undefined +-// behaviour. So only define if building as C (if __STDC_VERSION__ is defined), +-// not C++, and only for C11-17. +-#if !defined(static_assert) && (defined(__GNUC__) || defined(__clang__)) \ +- && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L \ +- && __STDC_VERSION__ <= 201710L ++#if defined(__FreeBSD__) && !defined(static_assert) ++# define static_assert _Static_assert ++#endif ++ ++// static_assert is defined in glibc from version 2.16. Before it requires ++// compiler support (gcc >= 4.6) and is called _Static_assert. ++// In C++ 11 static_assert is a keyword, redefining is undefined behaviour. ++#if (defined(__GLIBC__) \ ++ && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ <= 16)) \ ++ && !(defined(__cplusplus) && __cplusplus >= 201103L) \ ++ && !defined(static_assert)) + # define static_assert _Static_assert + #endif + diff --git a/cross/python311/patches/ppc853x-5.2/005-configure.ac-remove-unknown-flags.patch b/cross/python311/patches/ppc853x-5.2/005-configure.ac-remove-unknown-flags.patch index 5ba6dd935a2..8196eef030c 100644 --- a/cross/python311/patches/ppc853x-5.2/005-configure.ac-remove-unknown-flags.patch +++ b/cross/python311/patches/ppc853x-5.2/005-configure.ac-remove-unknown-flags.patch @@ -1,19 +1,10 @@ -# remove lto optimization flags unknown by older gcc -# - remove -fuse-linker-plugin +# remove flags unknown by gcc 4.3.2 (lto optimization is disabled at all for ppc853x arch) # - remove -fprofile-correction - ---- configure.ac.orig 2022-06-06 11:53:30.000000000 +0000 -+++ configure.ac 2022-06-19 15:36:23.019811638 +0000 -@@ -1427,7 +1427,7 @@ - LTOCFLAGS="-flto" - ;; - *) -- LTOFLAGS="-flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none" -+ LTOFLAGS="-flto -ffat-lto-objects -flto-partition=none" - ;; - esac - ;; -@@ -1506,7 +1506,7 @@ +# - replace -std=c11 by -std=c99 +# +--- configure.ac.orig 2023-08-24 12:09:18.000000000 +0000 ++++ configure.ac 2024-03-02 20:17:15.812508858 +0000 +@@ -1989,7 +1989,7 @@ ;; *) PGO_PROF_GEN_FLAG="-fprofile-generate" @@ -22,3 +13,12 @@ LLVM_PROF_MERGER="true" LLVM_PROF_FILE="" ;; +@@ -2195,7 +2195,7 @@ + # tweak BASECFLAGS based on compiler and platform + case $GCC in + yes) +- CFLAGS_NODIST="$CFLAGS_NODIST -std=c11" ++ CFLAGS_NODIST="$CFLAGS_NODIST -std=c99" + + PY_CHECK_CC_WARNING([enable], [extra], [if we can add -Wextra]) + AS_VAR_IF([ac_cv_enable_extra_warning], [yes], diff --git a/cross/python311/patches/x86-5.2/005-configure.ac-remove-unknown-flags.patch b/cross/python311/patches/x86-5.2/005-configure.ac-remove-unknown-flags.patch index db1065c944c..3843affc1d4 100644 --- a/cross/python311/patches/x86-5.2/005-configure.ac-remove-unknown-flags.patch +++ b/cross/python311/patches/x86-5.2/005-configure.ac-remove-unknown-flags.patch @@ -1,6 +1,6 @@ # remove lto optimization flags unknown by older gcc # - remove -fuse-linker-plugin - +# --- configure.ac.orig 2022-06-06 11:53:30.000000000 +0000 +++ configure.ac 2022-06-19 15:36:23.019811638 +0000 @@ -1427,7 +1427,7 @@ diff --git a/spk/python311/Makefile b/spk/python311/Makefile index f798fc7989b..8e6f0d13d58 100644 --- a/spk/python311/Makefile +++ b/spk/python311/Makefile @@ -4,12 +4,6 @@ SPK_VERS_MAJOR_MINOR = $(word 1,$(subst ., ,$(SPK_VERS))).$(word 2,$(subst ., ,$ SPK_REV = 8 SPK_ICON = src/python3.png -UNSUPPORTED_ARCHS = $(OLD_PPC_ARCHS) -# Missing libatomic for proper openssl >= 3.x support -# Ref: https://github.com/SynoCommunity/spksrc/issues/5841 -# https://github.com/SynoCommunity/spksrc/pull/5820#issuecomment-1678221438 -UNSUPPORTED_ARCHS += $(ARMv5_ARCHS) - DEPENDS = cross/$(SPK_NAME) DEPENDS += cross/pip From 3a73202a706c8542366f065bae87323b42e225aa Mon Sep 17 00:00:00 2001 From: hgy59 Date: Sun, 3 Mar 2024 20:57:37 +0100 Subject: [PATCH 3/6] use different patch for ppc853x to avoid undefined static_assert --- cross/python311/Makefile | 2 +- .../001-avoid_static_assert_undefined.patch | 16 ++++++++ ...static_assert_undefined-fix-GH-94766.patch | 39 ------------------- 3 files changed, 17 insertions(+), 40 deletions(-) create mode 100644 cross/python311/patches/ppc853x-5.2/001-avoid_static_assert_undefined.patch delete mode 100644 cross/python311/patches/ppc853x-5.2/001-revert-static_assert_undefined-fix-GH-94766.patch diff --git a/cross/python311/Makefile b/cross/python311/Makefile index 48aa69b0368..9a8c572ec0c 100644 --- a/cross/python311/Makefile +++ b/cross/python311/Makefile @@ -24,7 +24,7 @@ CONFIGURE_ARGS = --enable-shared CONFIGURE_ARGS += --without-static-libpython CONFIGURE_ARGS += --enable-ipv6 # installed pip is not on PATH -CONFIGURE_ARGS += --with-ensurepip=no +CONFIGURE_ARGS += --without-ensurepip CONFIGURE_ARGS += --enable-loadable-sqlite-extensions CONFIGURE_ARGS += --with-computed-gotos=yes CONFIGURE_ARGS += --with-build-python diff --git a/cross/python311/patches/ppc853x-5.2/001-avoid_static_assert_undefined.patch b/cross/python311/patches/ppc853x-5.2/001-avoid_static_assert_undefined.patch new file mode 100644 index 00000000000..33eea81d2af --- /dev/null +++ b/cross/python311/patches/ppc853x-5.2/001-avoid_static_assert_undefined.patch @@ -0,0 +1,16 @@ +# gcc 4.3.2 is lacking static_assert for c code (available for c++ code only). +# +# Since static_assert acts at compile time only, it does not affect the runtime +# behaviour when omitting the implementation. +# +--- Include/pymacro.h.orig 2023-08-24 12:09:18.000000000 +0000 ++++ Include/pymacro.h 2024-03-02 18:15:00.033365138 +0000 +@@ -21,6 +21,8 @@ + && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L \ + && __STDC_VERSION__ <= 201710L + # define static_assert _Static_assert ++#else ++# define static_assert + #endif + + /* Minimum value between x and y */ diff --git a/cross/python311/patches/ppc853x-5.2/001-revert-static_assert_undefined-fix-GH-94766.patch b/cross/python311/patches/ppc853x-5.2/001-revert-static_assert_undefined-fix-GH-94766.patch deleted file mode 100644 index 3b2c36f60c8..00000000000 --- a/cross/python311/patches/ppc853x-5.2/001-revert-static_assert_undefined-fix-GH-94766.patch +++ /dev/null @@ -1,39 +0,0 @@ ---- Include/pymacro.h-orig 2023-06-06 22:00:27.000000000 +0000 -+++ Include/pymacro.h 2023-07-03 19:36:57.974496974 +0000 -@@ -3,23 +3,20 @@ - - // gh-91782: On FreeBSD 12, if the _POSIX_C_SOURCE and _XOPEN_SOURCE macros are - // defined, disables C11 support and does not define --// the static_assert() macro. -+// the static_assert() macro. Define the static_assert() macro in Python until -+// suports C11: - // https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=255290 --// --// macOS <= 10.10 doesn't define static_assert in assert.h at all despite --// having C11 compiler support. --// --// static_assert is defined in glibc from version 2.16. Compiler support for --// the C11 _Static_assert keyword is in gcc >= 4.6. --// --// MSVC makes static_assert a keyword in C11-17, contrary to the standards. --// --// In C++11 and C2x, static_assert is a keyword, redefining is undefined --// behaviour. So only define if building as C (if __STDC_VERSION__ is defined), --// not C++, and only for C11-17. --#if !defined(static_assert) && (defined(__GNUC__) || defined(__clang__)) \ -- && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L \ -- && __STDC_VERSION__ <= 201710L -+#if defined(__FreeBSD__) && !defined(static_assert) -+# define static_assert _Static_assert -+#endif -+ -+// static_assert is defined in glibc from version 2.16. Before it requires -+// compiler support (gcc >= 4.6) and is called _Static_assert. -+// In C++ 11 static_assert is a keyword, redefining is undefined behaviour. -+#if (defined(__GLIBC__) \ -+ && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ <= 16)) \ -+ && !(defined(__cplusplus) && __cplusplus >= 201103L) \ -+ && !defined(static_assert)) - # define static_assert _Static_assert - #endif - From 424987cf5e7a18abd9b85d5a7032ce4d074f65a6 Mon Sep 17 00:00:00 2001 From: hgy59 Date: Tue, 5 Mar 2024 19:27:09 +0100 Subject: [PATCH 4/6] cleanup: - disable python311 for OLD_PPC_ARCHS - avoid wget progress logging for pip download --- cross/python310/Makefile | 2 +- cross/python311/Makefile | 18 +++++++++--------- native/python310/Makefile | 2 +- spk/python311/Makefile | 5 +++++ 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/cross/python310/Makefile b/cross/python310/Makefile index 8aaa979c9b6..418f47c1eb5 100644 --- a/cross/python310/Makefile +++ b/cross/python310/Makefile @@ -161,7 +161,7 @@ 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 https://bootstrap.pypa.io/get-pip.py + . $(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==23.2.1" --no-setuptools --no-wheel --disable-pip-version-check . $(WORK_DIR)/crossenv/bin/activate && $(RUN) python get-pip.py "pip==23.2.1" --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.41.2" diff --git a/cross/python311/Makefile b/cross/python311/Makefile index 9a8c572ec0c..0cfc01afa1d 100644 --- a/cross/python311/Makefile +++ b/cross/python311/Makefile @@ -6,6 +6,11 @@ PKG_DIST_NAME = Python-$(PKG_VERS).$(PKG_EXT) PKG_DIST_SITE = https://www.python.org/ftp/python/$(PKG_VERS) PKG_DIR = Python-$(PKG_VERS) +# 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) + BUILD_DEPENDS = native/$(PKG_NAME) DEPENDS = cross/zlib cross/sqlite cross/readline cross/ncursesw cross/bzip2 cross/xz @@ -31,7 +36,7 @@ CONFIGURE_ARGS += --with-build-python include ../../mk/spksrc.archs.mk -# optionally generate optimized code (optimizaton is always disabled for OLD_PPC_ARCHS) +# 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. @@ -44,11 +49,6 @@ else CONFIGURE_ARGS += --disable-test-modules endif -ifeq ($(findstring $(ARCH),$(OLD_PPC_ARCHS)),$(ARCH)) -# older gcc does not know -Wno-unused-result -CONFIGURE_ARGS += ac_cv_disable_unused_result_warning=no -endif - CONFIGURE_ARGS += ac_cv_buggy_getaddrinfo=no CONFIGURE_ARGS += ac_cv_file__dev_ptmx=no CONFIGURE_ARGS += ac_cv_file__dev_ptc=no @@ -149,7 +149,7 @@ CROSSENV_WHEELS += poetry==1.6.1 CROSSENV_WHEELS += scikit-build==0.17.6 CROSSENV_WHEELS += setuptools-rust==1.7.0 CROSSENV_WHEELS += setuptools-scm==7.1.0 -# For future usages when building numpy >= 1.26 +# For future use when building numpy >= 1.26 #CROSSENV_WHEELS += meson-python==0.13.2 #CROSSENV_WHEELS += scikit-build-core==0.5.0 @@ -166,7 +166,7 @@ endif endif # [maturin] -ifneq ($(findstring $(ARCH),$(ARMv5_ARCHS) $(OLD_PPC_ARCHS)),$(ARCH)) +ifneq ($(findstring $(ARCH),$(ARMv5_ARCHS)),$(ARCH)) CROSSENV_WHEELS += maturin==1.2.3 endif @@ -177,7 +177,7 @@ 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 https://bootstrap.pypa.io/get-pip.py + . $(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==23.2.1" --no-setuptools --no-wheel --disable-pip-version-check . $(WORK_DIR)/crossenv/bin/activate && $(RUN) python get-pip.py "pip==23.2.1" --no-setuptools --no-wheel --disable-pip-version-check . $(WORK_DIR)/crossenv/bin/activate && $(RUN) build-pip --disable-pip-version-check install "setuptools==63.4.3" "wheel==0.41.2" diff --git a/native/python310/Makefile b/native/python310/Makefile index 1f75f14a489..b2ba8e32ef1 100644 --- a/native/python310/Makefile +++ b/native/python310/Makefile @@ -34,7 +34,7 @@ PIP_NATIVE = $(WORK_DIR)/../../../native/$(PKG_NAME)/work-native/install/usr/loc .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) wget --no-verbose https://bootstrap.pypa.io/get-pip.py @$(RUN) $(PYTHON) get-pip.py "pip==23.2.1" --no-setuptools --no-wheel --disable-pip-version-check @$(MSG) Installing setuptools, wheel, cffi and cross env @$(PIP) --disable-pip-version-check install "setuptools==68.1.2" "setuptools-rust==1.7.0" "maturin==1.2.3" "wheel==0.41.2" "cffi==1.15.1" "crossenv==1.4.0" diff --git a/spk/python311/Makefile b/spk/python311/Makefile index 8e6f0d13d58..30a7c204f9a 100644 --- a/spk/python311/Makefile +++ b/spk/python311/Makefile @@ -4,6 +4,11 @@ SPK_VERS_MAJOR_MINOR = $(word 1,$(subst ., ,$(SPK_VERS))).$(word 2,$(subst ., ,$ SPK_REV = 8 SPK_ICON = src/python3.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) + DEPENDS = cross/$(SPK_NAME) DEPENDS += cross/pip From d3c1b718a4d93b828befa3a5633f5b02d7799403 Mon Sep 17 00:00:00 2001 From: hgy59 Date: Tue, 5 Mar 2024 22:00:02 +0100 Subject: [PATCH 5/6] try to recreate packages for ARMv5 - beets - borgbackup - mercurial - octoprint - rdiff-backup --- cross/python311/Makefile | 2 -- spk/beets/Makefile | 4 ++-- spk/borgbackup/Makefile | 6 +++--- spk/mercurial/Makefile | 4 ++-- spk/octoprint/Makefile | 4 ++-- spk/rdiff-backup/Makefile | 4 ++-- 6 files changed, 11 insertions(+), 13 deletions(-) diff --git a/cross/python311/Makefile b/cross/python311/Makefile index 0cfc01afa1d..98e04488b9e 100644 --- a/cross/python311/Makefile +++ b/cross/python311/Makefile @@ -166,9 +166,7 @@ endif endif # [maturin] -ifneq ($(findstring $(ARCH),$(ARMv5_ARCHS)),$(ARCH)) CROSSENV_WHEELS += maturin==1.2.3 -endif # Create the crossenv in preparation for # cross-compiling all the necessary wheels diff --git a/spk/beets/Makefile b/spk/beets/Makefile index 6a5a355cb40..e7f1968703c 100644 --- a/spk/beets/Makefile +++ b/spk/beets/Makefile @@ -5,7 +5,7 @@ SPK_ICON = src/beets.png PYTHON_PACKAGE = python311 SPK_DEPENDS = "python311>=3.11.5-8" -UNSUPPORTED_ARCHS = $(OLD_PPC_ARCHS) $(ARMv5_ARCHS) +UNSUPPORTED_ARCHS = $(OLD_PPC_ARCHS) WHEELS = src/requirements-crossenv.txt src/requirements-pure.txt @@ -29,7 +29,7 @@ MAINTAINER = ymartin59 DESCRIPTION = "Beets is the media library management system for obsessive-compulsive music geeks. The purpose of beets is to get your music collection right once and for all. It catalogs your collection, automatically improving its metadata as it goes. It then provides a bouquet of tools for manipulating and accessing your music. Plugins not available due to lacking dependencies: AcousticBrainz Submit, Gmusic, ReplayGain." DISPLAY_NAME = beets -CHANGELOG = "1. Migrate to python 3.11
2. Update to all wheels
3. Mark ARMv5 as unsupported" +CHANGELOG = "1. Migrate to python 3.11.
2. Update to all wheels." HOMEPAGE = http://beets.io/ LICENSE = GPL diff --git a/spk/borgbackup/Makefile b/spk/borgbackup/Makefile index 8ddede1e63b..a0c94257fcb 100644 --- a/spk/borgbackup/Makefile +++ b/spk/borgbackup/Makefile @@ -1,11 +1,11 @@ SPK_NAME = borgbackup SPK_VERS = 1.2.6 SPK_REV = 14 -SPK_ICON = src/$(SPK_NAME).png +SPK_ICON = src/borgbackup.png PYTHON_PACKAGE = python311 SPK_DEPENDS = "python311>=3.11.5-8" -UNSUPPORTED_ARCHS = $(OLD_PPC_ARCHS) $(ARMv5_ARCHS) +UNSUPPORTED_ARCHS = $(OLD_PPC_ARCHS) DEPENDS = cross/attr cross/acl cross/openssl3 cross/lz4 cross/zstd cross/libb2 cross/fuse @@ -30,7 +30,7 @@ DESCRIPTION = Deduplicating backup program with compression and authenticated en DISPLAY_NAME = Borg STARTABLE = no -CHANGELOG = "1. Update borg to v1.2.6
2. Update borgmatic to v1.8.2.
3. Update emborg to v1.37.
4. Migrate to python 3.11
5. Mark ARMv5 as unsupported" +CHANGELOG = "1. Update borg to v1.2.6.
2. Update borgmatic to v1.8.2.
3. Update emborg to v1.37.
4. Migrate to python 3.11." HOMEPAGE = https://borgbackup.readthedocs.io LICENSE = 3-Clause BSD diff --git a/spk/mercurial/Makefile b/spk/mercurial/Makefile index 74a508945c4..24c77fd5c9b 100644 --- a/spk/mercurial/Makefile +++ b/spk/mercurial/Makefile @@ -5,7 +5,7 @@ SPK_ICON = src/mercurial.png PYTHON_PACKAGE = python311 SPK_DEPENDS = "python311>=3.11.5-8" -UNSUPPORTED_ARCHS = $(OLD_PPC_ARCHS) $(ARMv5_ARCHS) +UNSUPPORTED_ARCHS = $(OLD_PPC_ARCHS) WHEELS = src/requirements-crossenv.txt src/requirements-pure.txt @@ -13,7 +13,7 @@ MAINTAINER = SynoCommunity DESCRIPTION = Mercurial is a free, distributed source control management tool STARTABLE = no DISPLAY_NAME = Mercurial -CHANGELOG = "1. Update mercurial to 6.5
2. Update to Python 3.11
3. Mark ARMv5 as unsupported" +CHANGELOG = "1. Update mercurial to 6.5.
2. Update to Python 3.11." HOMEPAGE = https://www.mercurial-scm.org/ LICENSE = MPL1.1 diff --git a/spk/octoprint/Makefile b/spk/octoprint/Makefile index 07954097b68..42b2a3c7cef 100644 --- a/spk/octoprint/Makefile +++ b/spk/octoprint/Makefile @@ -6,7 +6,7 @@ DSM_UI_DIR = app PYTHON_PACKAGE = python311 SPK_DEPENDS = "python311>=3.11.5-8" -UNSUPPORTED_ARCHS = $(OLD_PPC_ARCHS) $(ARMv5_ARCHS) +UNSUPPORTED_ARCHS = $(OLD_PPC_ARCHS) WHEELS = src/requirements-crossenv.txt src/requirements-pure.txt @@ -21,7 +21,7 @@ ADMIN_PORT = $(SERVICE_PORT) DISPLAY_NAME = OctoPrint HOMEPAGE = https://octoprint.org/ LICENSE = AGPLv3 -CHANGELOG = "1. Update OctoPrint to v1.9.2
2. Python dependency to 3.11
3. Mark ARMv5 as unsupported" +CHANGELOG = "1. Update OctoPrint to v1.9.2.
2. Python dependency to 3.11." # SERVICE_COMMAND is in src/service-setup.sh STARTABLE = yes diff --git a/spk/rdiff-backup/Makefile b/spk/rdiff-backup/Makefile index af68edf11a3..9f548bc5a41 100644 --- a/spk/rdiff-backup/Makefile +++ b/spk/rdiff-backup/Makefile @@ -5,7 +5,7 @@ SPK_ICON = src/rdiff-backup.png PYTHON_PACKAGE = python311 SPK_DEPENDS = "python311>=3.11.5-8" -UNSUPPORTED_ARCHS = $(OLD_PPC_ARCHS) $(ARMv5_ARCHS) +UNSUPPORTED_ARCHS = $(OLD_PPC_ARCHS) WHEELS = src/requirements-crossenv.txt src/requirements-pure.txt @@ -18,7 +18,7 @@ MAINTAINER = SynoCommunity DESCRIPTION = Reverse differential backup tool, over a network or locally. STARTABLE = no DISPLAY_NAME = rdiff-backup -CHANGELOG = "1. Update to v2.2.5
2. Migrate to Python 3.11
3. Mark ARMv5 as unsupported" +CHANGELOG = "1. Update to v2.2.5.
2. Migrate to Python 3.11." HOMEPAGE = https://rdiff-backup.net/ LICENSE = GPLv2 From d38fae2416ce59f2e68d67b0b5496d39e42f2ae6 Mon Sep 17 00:00:00 2001 From: hgy59 Date: Wed, 6 Mar 2024 02:02:48 +0100 Subject: [PATCH 6/6] fix kiwix: avoid the use of a specific mirror to download source of cross/libmicrohttpd --- cross/libmicrohttpd/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cross/libmicrohttpd/Makefile b/cross/libmicrohttpd/Makefile index 942d8bde794..69e21b28ab1 100644 --- a/cross/libmicrohttpd/Makefile +++ b/cross/libmicrohttpd/Makefile @@ -2,7 +2,7 @@ PKG_NAME = libmicrohttpd PKG_VERS = 0.9.75 PKG_EXT = tar.gz PKG_DIST_NAME = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT) -PKG_DIST_SITE = https://mirror.kumi.systems/gnu/libmicrohttpd +PKG_DIST_SITE = https://ftp.gnu.org/gnu/libmicrohttpd PKG_DIR = $(PKG_NAME)-$(PKG_VERS) DEPENDS =