From 668a0f9dd8baa2fb6275ff0e022b6f1bf390b7c2 Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Mon, 30 Oct 2023 19:32:26 +0800 Subject: [PATCH 01/17] pyodbc: Fix segmentation fault 4.0.36 included a change to decimal parsing[1] that requires the decimal module. Trying to load the pyodbc module without python3-decimal installed would lead to a segmentation fault. This adds python3-decimal as a dependency. This also adds python3-uuid as a dependency as the module can accept and return uuid objects[2]. [1]: https://github.com/mkleehammer/pyodbc/commit/6b107a2bcaf7379e5ba182007b6ecae1bc2fc931 [2]: https://github.com/mkleehammer/pyodbc/commit/2ad7a9ced7c9c33232c173668c0830a484cc92f3 Fixes: f02f3ee8c768 ("pyodbc: Update to 4.0.39") Signed-off-by: Jeffery To --- lang/python/pyodbc/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lang/python/pyodbc/Makefile b/lang/python/pyodbc/Makefile index 4f10f91ec..6c8fca8c4 100644 --- a/lang/python/pyodbc/Makefile +++ b/lang/python/pyodbc/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=pyodbc PKG_VERSION:=4.0.39 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PYPI_NAME:=$(PKG_NAME) PKG_HASH:=e528bb70dd6d6299ee429868925df0866e3e919c772b9eff79c8e17920d8f116 @@ -27,7 +27,7 @@ define Package/python3-pyodbc SUBMENU:=Python TITLE:=python3-pyodbc URL:=https://github.com/mkleehammer/pyodbc - DEPENDS:=+unixodbc +python3-light +libstdcpp + DEPENDS:=+unixodbc +python3-light +python3-decimal +python3-uuid +libstdcpp endef define Package/python3-pyodbc/description From d6d9763e31e0e81f8f1fe9fb63c1f9267391bfb0 Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Mon, 30 Oct 2023 20:02:46 +0800 Subject: [PATCH 02/17] pyodbc: Update to 5.0.1, rename source package This renames the source package to python-pyodbc to match other Python packages. This also updates the unixodbc dependency to libodbc, updates the package title and description, and adds a test.sh script for the packages feed CI. Signed-off-by: Jeffery To --- .../python/{pyodbc => python-pyodbc}/Makefile | 23 ++++++++++--------- lang/python/python-pyodbc/test.sh | 5 ++++ 2 files changed, 17 insertions(+), 11 deletions(-) rename lang/python/{pyodbc => python-pyodbc}/Makefile (55%) create mode 100644 lang/python/python-pyodbc/test.sh diff --git a/lang/python/pyodbc/Makefile b/lang/python/python-pyodbc/Makefile similarity index 55% rename from lang/python/pyodbc/Makefile rename to lang/python/python-pyodbc/Makefile index 6c8fca8c4..6357d4bd6 100644 --- a/lang/python/pyodbc/Makefile +++ b/lang/python/python-pyodbc/Makefile @@ -4,17 +4,18 @@ include $(TOPDIR)/rules.mk -PKG_NAME:=pyodbc -PKG_VERSION:=4.0.39 -PKG_RELEASE:=2 +PKG_NAME:=python-pyodbc +PKG_VERSION:=5.0.1 +PKG_RELEASE:=1 -PYPI_NAME:=$(PKG_NAME) -PKG_HASH:=e528bb70dd6d6299ee429868925df0866e3e919c772b9eff79c8e17920d8f116 +PYPI_NAME:=pyodbc +PKG_HASH:=03d7d0b04d5a9156099ce8d03e92f3956783746fa9234eb6f5b5cfc12b645011 PKG_LICENSE:=MIT PKG_LICENSE_FILES:=LICENSE.txt PKG_MAINTAINER:=Jeffery To +# for odbc_config PKG_BUILD_DEPENDS:=unixodbc/host include ../pypi.mk @@ -25,17 +26,17 @@ define Package/python3-pyodbc SECTION:=lang CATEGORY:=Languages SUBMENU:=Python - TITLE:=python3-pyodbc + TITLE:=DB API module for ODBC URL:=https://github.com/mkleehammer/pyodbc - DEPENDS:=+unixodbc +python3-light +python3-decimal +python3-uuid +libstdcpp + DEPENDS:=+python3-light +python3-decimal +python3-uuid +libodbc +libstdcpp endef define Package/python3-pyodbc/description -DB API Module for ODBC - -A Python DB API 2 module for ODBC. This project provides an up-to-date, -convenient interface to ODBC using native data types like datetime and decimal. +pyodbc is an open source Python module that makes accessing ODBC +databases simple. It implements the DB API 2.0 specification but is +packed with even more Pythonic convenience. endef $(eval $(call Py3Package,python3-pyodbc)) $(eval $(call BuildPackage,python3-pyodbc)) +# no src package - the module does not contain any Python code diff --git a/lang/python/python-pyodbc/test.sh b/lang/python/python-pyodbc/test.sh new file mode 100644 index 000000000..f6cf04b11 --- /dev/null +++ b/lang/python/python-pyodbc/test.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +[ "$1" = python3-pyodbc ] || exit 0 + +python3 -c 'import pyodbc' From 58d8f9272139f29ec63f8fdde74a835fe031dece Mon Sep 17 00:00:00 2001 From: Oskari Rauta Date: Tue, 31 Oct 2023 22:07:46 +0200 Subject: [PATCH 03/17] speedtestcpp: update to 1.20.3 changes: - fixes a bug where science notations (exponentials) are displayed during tests during high speed bursts Signed-off-by: Oskari Rauta --- net/speedtestcpp/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/speedtestcpp/Makefile b/net/speedtestcpp/Makefile index 95e8dc382..bd39bfe1d 100644 --- a/net/speedtestcpp/Makefile +++ b/net/speedtestcpp/Makefile @@ -1,12 +1,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=speedtestcpp -PKG_VERSION:=1.20.2 +PKG_VERSION:=1.20.3 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/oskarirauta/speedtestcpp/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=7d5c85f1d9a46f7d8a3ac4261ef1f92e53c511430bae096f7ec6f12a33d38904 +PKG_HASH:=8154e2161c56c0ac1275e57c34f448aaf98fb49937ff824ce975d95984395025 PKG_MAINTAINER:=Oskari Rauta PKG_LICENSE:=MIT From 3e51eef14c3be57d1a5ac3c1ecd4150aa5d8e639 Mon Sep 17 00:00:00 2001 From: Hirokazu MORIKAWA Date: Wed, 1 Nov 2023 10:03:48 +0900 Subject: [PATCH 04/17] node: upgrade to v20.9.0 node.js version 20.x is now active LTS. mipsel (pistachio) is no longer supported. Due to build difficulties, libuv shared libraries are not used. Signed-off-by: Hirokazu MORIKAWA --- lang/node/Makefile | 19 ++- lang/node/patches/003-path.patch | 2 +- lang/node/patches/004-musl_support.patch | 2 +- lang/node/patches/200-uv_gyp.patch | 10 ++ lang/node/patches/201-zlib_gyp.patch | 10 ++ lang/node/patches/202-node_gyp.patch | 10 ++ ...nflict.patch => 203-icu-generic_gyp.patch} | 32 ++++ lang/node/patches/204-v8_gyp.patch | 158 ++++++++++++++++++ ...necessary_libraries_for_host_execute.patch | 78 --------- lang/node/patches/991-v8_zlib_support.patch | 92 ---------- .../patches/992-v8_add_include_dirs.patch | 26 --- lang/node/patches/999-cast_for_mips32.patch | 11 -- .../patches/999-localhost-no-addrconfig.patch | 2 +- ...able_pointer_authentication_on_arm64.patch | 2 +- 14 files changed, 235 insertions(+), 219 deletions(-) create mode 100644 lang/node/patches/200-uv_gyp.patch create mode 100644 lang/node/patches/201-zlib_gyp.patch create mode 100644 lang/node/patches/202-node_gyp.patch rename lang/node/patches/{999-fix_icu_conflict.patch => 203-icu-generic_gyp.patch} (69%) create mode 100644 lang/node/patches/204-v8_gyp.patch delete mode 100644 lang/node/patches/990-delete_unnecessary_libraries_for_host_execute.patch delete mode 100644 lang/node/patches/991-v8_zlib_support.patch delete mode 100644 lang/node/patches/992-v8_add_include_dirs.patch delete mode 100644 lang/node/patches/999-cast_for_mips32.patch diff --git a/lang/node/Makefile b/lang/node/Makefile index e93590b5d..692bedf38 100644 --- a/lang/node/Makefile +++ b/lang/node/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=node -PKG_VERSION:=v18.18.2 +PKG_VERSION:=v20.9.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://nodejs.org/dist/$(PKG_VERSION) -PKG_HASH:=7249e2f0af943ec38599504f4b2a2bd31fb938787291b6ccca6c8badf01e3b56 +PKG_HASH:=a23d96810abf0455426b349d47ce5310f33095b7bc0571b9cc510f481c3a4519 PKG_MAINTAINER:=Hirokazu MORIKAWA , Adrian Panella PKG_LICENSE:=MIT @@ -26,7 +26,6 @@ HOST_BUILD_PARALLEL:=1 PKG_BUILD_DEPENDS:=python3/host PKG_BUILD_PARALLEL:=1 PKG_INSTALL:=1 -PKG_BUILD_FLAGS:=no-mips16 PKG_ASLR_PIE:=0 include $(INCLUDE_DIR)/host-build.mk @@ -38,8 +37,8 @@ define Package/node SUBMENU:=Node.js TITLE:=Node.js is a platform built on Chrome's JavaScript runtime URL:=https://nodejs.org/ - DEPENDS:=@HAS_FPU @(i386||x86_64||arm||aarch64||mipsel) \ - +libstdcpp +libopenssl +zlib +libnghttp2 +libuv \ + DEPENDS:=@HAS_FPU @(i386||x86_64||arm||aarch64) \ + +libstdcpp +libopenssl +zlib +libnghttp2 \ +libcares +libatomic +NODEJS_ICU_SYSTEM:icu +NODEJS_ICU_SYSTEM:icu-full-data endef @@ -47,8 +46,9 @@ define Package/node/description Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient. Node.js' package ecosystem, npm, is the largest ecosystem of open source libraries in the world. + *** The following preparations must be made on the host side. *** - 1. gcc 8.3 or higher is required. + 1. gcc 10.1 or higher is required. 2. To build a 32-bit target, gcc-multilib, g++-multilib are required. 3. Requires libatomic package. (If necessary, install the 32-bit library at the same time.) ex) sudo apt-get install gcc-multilib g++-multilib @@ -115,7 +115,6 @@ CONFIGURE_ARGS:= \ --shared-zlib \ --shared-openssl \ --shared-nghttp2 \ - --shared-libuv \ --shared-cares \ --with-intl=$(if $(CONFIG_NODEJS_ICU_SMALL),small-icu,$(if $(CONFIG_NODEJS_ICU_SYSTEM),system-icu,none)) \ $(if $(findstring +neon",$(CONFIG_CPU_TYPE)),--with-arm-fpu=neon) \ @@ -157,7 +156,11 @@ define Package/node-npm/install endef define Host/Install - $(RM) -rf $(1)/lib/node_modules/npm + rm -f $(1)/bin/npm + rm -f $(1)/bin/npx + rm -rf $(1)/lib/node_modules/npm + rm -f $(1)/bin/corepack + rm -rf $(1)/lib/node_modules/corepack $(call Host/Install/Default) endef diff --git a/lang/node/patches/003-path.patch b/lang/node/patches/003-path.patch index 8e390d88c..011b02489 100644 --- a/lang/node/patches/003-path.patch +++ b/lang/node/patches/003-path.patch @@ -1,6 +1,6 @@ --- a/lib/internal/modules/cjs/loader.js +++ b/lib/internal/modules/cjs/loader.js -@@ -1391,7 +1391,8 @@ Module._initPaths = function() { +@@ -1378,7 +1378,8 @@ Module._initPaths = function() { path.resolve(process.execPath, '..') : path.resolve(process.execPath, '..', '..'); diff --git a/lang/node/patches/004-musl_support.patch b/lang/node/patches/004-musl_support.patch index 5e7e54b72..b0f950315 100644 --- a/lang/node/patches/004-musl_support.patch +++ b/lang/node/patches/004-musl_support.patch @@ -20,7 +20,7 @@ result = clock_gettime(CLOCK_MONOTONIC, &ts); --- a/deps/v8/src/base/platform/platform-posix.cc +++ b/deps/v8/src/base/platform/platform-posix.cc -@@ -1066,7 +1066,7 @@ bool Thread::Start() { +@@ -1147,7 +1147,7 @@ bool Thread::Start() { #if V8_OS_DARWIN // Default on Mac OS X is 512kB -- bump up to 1MB stack_size = 1 * 1024 * 1024; diff --git a/lang/node/patches/200-uv_gyp.patch b/lang/node/patches/200-uv_gyp.patch new file mode 100644 index 000000000..75bc8f2e5 --- /dev/null +++ b/lang/node/patches/200-uv_gyp.patch @@ -0,0 +1,10 @@ +--- a/deps/uv/uv.gyp ++++ b/deps/uv/uv.gyp +@@ -155,6 +155,7 @@ + 'target_name': 'libuv', + 'toolsets': ['host', 'target'], + 'type': '<(uv_library)', ++ 'include_dirs!': [ '(0))); -+ Operand(static_cast(0))); - } - } - // Functions with JS linkage have at least one parameter (the receiver). diff --git a/lang/node/patches/999-localhost-no-addrconfig.patch b/lang/node/patches/999-localhost-no-addrconfig.patch index dadfd14ec..092dc0de3 100644 --- a/lang/node/patches/999-localhost-no-addrconfig.patch +++ b/lang/node/patches/999-localhost-no-addrconfig.patch @@ -13,7 +13,7 @@ Forwarded: https://github.com/nodejs/node/issues/33816 // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the -@@ -1321,13 +1322,6 @@ function lookupAndConnect(self, options) +@@ -1330,13 +1331,6 @@ function lookupAndConnect(self, options) hints: options.hints || 0, }; diff --git a/lang/node/patches/999-revert_enable_pointer_authentication_on_arm64.patch b/lang/node/patches/999-revert_enable_pointer_authentication_on_arm64.patch index 44fc715fe..fe9dd59d0 100644 --- a/lang/node/patches/999-revert_enable_pointer_authentication_on_arm64.patch +++ b/lang/node/patches/999-revert_enable_pointer_authentication_on_arm64.patch @@ -1,6 +1,6 @@ --- a/configure.py +++ b/configure.py -@@ -1291,7 +1291,6 @@ def configure_node(o): +@@ -1270,7 +1270,6 @@ def configure_node(o): # Enable branch protection for arm64 if target_arch == 'arm64': From 8acd006b6e0d679fa60e5cdf263b90e940c6ccef Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Tue, 31 Oct 2023 11:42:05 +0800 Subject: [PATCH 05/17] python-versioneer: Add new host-only package From the README: This is a tool for managing a recorded version number in setuptools-based python projects. The goal is to remove the tedious and error-prone "update the embedded version string" step from your release process. Making a new release should be as easy as recording a new tag in your version-control system, and maybe making new tarballs. Signed-off-by: Jeffery To --- lang/python/python-versioneer/Makefile | 51 ++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 lang/python/python-versioneer/Makefile diff --git a/lang/python/python-versioneer/Makefile b/lang/python/python-versioneer/Makefile new file mode 100644 index 000000000..b21866a86 --- /dev/null +++ b/lang/python/python-versioneer/Makefile @@ -0,0 +1,51 @@ +# +# Copyright (C) 2023 Jeffery To +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-versioneer +PKG_VERSION:=0.29 +PKG_RELEASE:=1 + +PYPI_NAME:=versioneer +PKG_HASH:=5ab283b9857211d61b53318b7c792cf68e798e765ee17c27ade9f6c924235731 + +PKG_LICENSE:=Unlicense +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Jeffery To + +PKG_HOST_ONLY:=1 +HOST_BUILD_DEPENDS:=python3/host python-build/host python-installer/host python-wheel/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/host-build.mk +include ../python3-package.mk +include ../python3-host-build.mk + +define Package/python3-versioneer + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Easy VCS-based management of project version strings + URL:=https://github.com/python-versioneer/python-versioneer + DEPENDS:=+python3-light + BUILDONLY:=1 +endef + +define Package/python3-versioneer/description +This is a tool for managing a recorded version number in +setuptools-based python projects. The goal is to remove the tedious and +error-prone "update the embedded version string" step from your release +process. Making a new release should be as easy as recording a new tag +in your version-control system, and maybe making new tarballs. +endef + +$(eval $(call Py3Package,python3-versioneer)) +$(eval $(call BuildPackage,python3-versioneer)) +$(eval $(call BuildPackage,python3-versioneer-src)) +$(eval $(call HostBuild)) From 1fbe4b9a8b60ac22759e45845518d3e0d4fe35af Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Tue, 31 Oct 2023 11:43:33 +0800 Subject: [PATCH 06/17] python-constantly: Update to 23.10.4, add new build dependency This also adds a test.sh script for the packages feed CI. Signed-off-by: Jeffery To --- lang/python/python-constantly/Makefile | 10 ++++--- .../patches/001-unpin-setuptools.patch | 9 +++++++ lang/python/python-constantly/test.sh | 27 +++++++++++++++++++ 3 files changed, 42 insertions(+), 4 deletions(-) create mode 100644 lang/python/python-constantly/patches/001-unpin-setuptools.patch create mode 100644 lang/python/python-constantly/test.sh diff --git a/lang/python/python-constantly/Makefile b/lang/python/python-constantly/Makefile index 129a72b5c..f0cd24659 100644 --- a/lang/python/python-constantly/Makefile +++ b/lang/python/python-constantly/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2018 OpenWrt.org +# Copyright (C) 2018, 2023 Jeffery To # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -8,16 +8,18 @@ include $(TOPDIR)/rules.mk PKG_NAME:=python-constantly -PKG_VERSION:=15.1.0 -PKG_RELEASE:=2 +PKG_VERSION:=23.10.4 +PKG_RELEASE:=1 PYPI_NAME:=constantly -PKG_HASH:=586372eb92059873e29eba4f9dec8381541b4d3834660707faf8ba59146dfc35 +PKG_HASH:=aa92b70a33e2ac0bb33cd745eb61776594dc48764b06c35e0efd050b7f1c7cbd PKG_LICENSE:=MIT PKG_LICENSE_FILES:=LICENSE PKG_MAINTAINER:=Jeffery To +PKG_BUILD_DEPENDS:=python-versioneer/host + include ../pypi.mk include $(INCLUDE_DIR)/package.mk include ../python3-package.mk diff --git a/lang/python/python-constantly/patches/001-unpin-setuptools.patch b/lang/python/python-constantly/patches/001-unpin-setuptools.patch new file mode 100644 index 000000000..9d890abc9 --- /dev/null +++ b/lang/python/python-constantly/patches/001-unpin-setuptools.patch @@ -0,0 +1,9 @@ +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -1,5 +1,5 @@ + [build-system] +-requires = ["setuptools>=68.2", "versioneer[toml]==0.29"] ++requires = ["setuptools", "versioneer[toml]==0.29"] + build-backend = "setuptools.build_meta" + + [project] diff --git a/lang/python/python-constantly/test.sh b/lang/python/python-constantly/test.sh new file mode 100644 index 000000000..d6b367ccf --- /dev/null +++ b/lang/python/python-constantly/test.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +[ "$1" = python3-constantly ] || exit 0 + +python3 - << 'EOF' + +from constantly import NamedConstant, Names +class Letters(Names): + a = NamedConstant() + b = NamedConstant() + c = NamedConstant() + +assert Letters.lookupByName('a') is Letters.a +assert Letters.a < Letters.b +assert Letters.b < Letters.c +assert Letters.a < Letters.c + +from constantly import ValueConstant, Values +class STATUS(Values): + OK = ValueConstant('200') + FOUND = ValueConstant('302') + NOT_FOUND = ValueConstant('404') + +assert STATUS.OK.value == '200' +assert STATUS.lookupByValue('404') == STATUS.NOT_FOUND + +EOF From c4a223ed8714d43a6e06d9c675447281f8c50127 Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Tue, 31 Oct 2023 11:53:33 +0800 Subject: [PATCH 07/17] python-cryptography: Update to 41.0.5 This also adds a CPE ID for the package and updates the test.sh script to use an assert. Signed-off-by: Jeffery To --- lang/python/python-cryptography/Makefile | 5 +++-- lang/python/python-cryptography/test.sh | 10 ++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/lang/python/python-cryptography/Makefile b/lang/python/python-cryptography/Makefile index 6ef9cb969..bee53fd79 100644 --- a/lang/python/python-cryptography/Makefile +++ b/lang/python/python-cryptography/Makefile @@ -8,15 +8,16 @@ include $(TOPDIR)/rules.mk PKG_NAME:=python-cryptography -PKG_VERSION:=41.0.4 +PKG_VERSION:=41.0.5 PKG_RELEASE:=1 PYPI_NAME:=cryptography -PKG_HASH:=7febc3094125fc126a7f6fb1f420d0da639f3f32cb15c8ff0dc3997c4549f51a +PKG_HASH:=392cb88b597247177172e02da6b7a63deeff1937fa6fec3bbf902ebd75d97ec7 PKG_LICENSE:=Apache-2.0 BSD-3-Clause PKG_LICENSE_FILES:=LICENSE.APACHE LICENSE.BSD PKG_MAINTAINER:=Jeffery To +PKG_CPE_ID:=cpe:/a:cryptography_project:cryptography PKG_BUILD_DEPENDS:=libffi/host python-cffi/host python-setuptools-rust/host diff --git a/lang/python/python-cryptography/test.sh b/lang/python/python-cryptography/test.sh index b706d561a..308f5456b 100644 --- a/lang/python/python-cryptography/test.sh +++ b/lang/python/python-cryptography/test.sh @@ -2,11 +2,13 @@ [ "$1" = python3-cryptography ] || exit 0 -python3 - << EOF -import sys +python3 - << 'EOF' + from cryptography.fernet import Fernet key = Fernet.generate_key() f = Fernet(key) -token = f.encrypt(b"my deep dark secret") -sys.exit(0 if f.decrypt(token) == b"my deep dark secret" else 1) +msg = b"my deep dark secret" +token = f.encrypt(msg) +assert f.decrypt(token) == msg + EOF From 8b4316f2d5a112bf7472f43b6386ffa1d0b2c38d Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Tue, 31 Oct 2023 12:04:02 +0800 Subject: [PATCH 08/17] python-setuptools-rust: Update to 1.8.1, remove patch 0001-Allow-profile-to-be-set-by-SETUPTOOLS_RUST_CARGO_PROFILE-env-variable.patch has been merged in this version. This also updates the list of dependencies for the package. Signed-off-by: Jeffery To --- lang/python/python-setuptools-rust/Makefile | 8 ++-- ...OOLS_RUST_CARGO_PROFILE-env-variable.patch | 48 ------------------- 2 files changed, 3 insertions(+), 53 deletions(-) delete mode 100644 lang/python/python-setuptools-rust/patches/0001-Allow-profile-to-be-set-by-SETUPTOOLS_RUST_CARGO_PROFILE-env-variable.patch diff --git a/lang/python/python-setuptools-rust/Makefile b/lang/python/python-setuptools-rust/Makefile index 00a243bee..7fe77ff7a 100644 --- a/lang/python/python-setuptools-rust/Makefile +++ b/lang/python/python-setuptools-rust/Makefile @@ -8,11 +8,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=python-setuptools-rust -PKG_VERSION:=1.7.0 -PKG_RELEASE:=2 +PKG_VERSION:=1.8.1 +PKG_RELEASE:=1 PYPI_NAME:=setuptools-rust -PKG_HASH:=c7100999948235a38ae7e555fe199aa66c253dc384b125f5d85473bf81eae3a3 +PKG_HASH:=94b1dd5d5308b3138d5b933c3a2b55e6d6927d1a22632e509fcea9ddd0f7e486 PKG_LICENSE:=MIT PKG_LICENSE_FILES:=LICENSE @@ -26,7 +26,6 @@ HOST_BUILD_DEPENDS:= \ python-wheel/host \ python-setuptools-scm/host \ python-semantic-version/host \ - python-typing-extensions/host \ rust/host include ../pypi.mk @@ -46,7 +45,6 @@ define Package/python3-setuptools-rust +python3-logging \ +python3-semantic-version \ +python3-setuptools \ - +python3-typing-extensions \ +rust BUILDONLY:=1 endef diff --git a/lang/python/python-setuptools-rust/patches/0001-Allow-profile-to-be-set-by-SETUPTOOLS_RUST_CARGO_PROFILE-env-variable.patch b/lang/python/python-setuptools-rust/patches/0001-Allow-profile-to-be-set-by-SETUPTOOLS_RUST_CARGO_PROFILE-env-variable.patch deleted file mode 100644 index 842bc4019..000000000 --- a/lang/python/python-setuptools-rust/patches/0001-Allow-profile-to-be-set-by-SETUPTOOLS_RUST_CARGO_PROFILE-env-variable.patch +++ /dev/null @@ -1,48 +0,0 @@ -From b10cab4efeb80abb5a236d651c9ff9355e470527 Mon Sep 17 00:00:00 2001 -From: Jeffery To -Date: Mon, 2 Oct 2023 16:13:51 +0800 -Subject: [PATCH] Allow profile to be set by SETUPTOOLS_RUST_CARGO_PROFILE env - variable - -This allows the profile to be set dynamically, without having to edit -pyproject.toml/setup.py. ---- - setuptools_rust/build.py | 20 ++++++++++++++++---- - 1 file changed, 16 insertions(+), 4 deletions(-) - ---- a/setuptools_rust/build.py -+++ b/setuptools_rust/build.py -@@ -528,10 +528,10 @@ class build_rust(RustCommand): - if target_triple is not None: - args.extend(["--target", target_triple]) - -- if release: -- profile = ext.get_cargo_profile() -- if not profile: -- args.append("--release") -+ ext_profile = ext.get_cargo_profile() -+ env_profile = os.getenv("SETUPTOOLS_RUST_CARGO_PROFILE") -+ if release and not ext_profile and not env_profile: -+ args.append("--release") - - if quiet: - args.append("-q") -@@ -552,6 +552,18 @@ class build_rust(RustCommand): - if ext.args is not None: - args.extend(ext.args) - -+ if env_profile: -+ if ext_profile: -+ args = [p for p in args if not p.startswith("--profile=")] -+ while True: -+ try: -+ index = args.index("--profile") -+ del args[index:index + 2] -+ except ValueError: -+ break -+ -+ args.extend(["--profile", env_profile]) -+ - if ext.cargo_manifest_args is not None: - args.extend(ext.cargo_manifest_args) - From d10b26525c29a8fc694f3bab0db3a678b4bf3ebd Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Mon, 16 Oct 2023 11:59:33 +0200 Subject: [PATCH 09/17] wavemon: bump to 9.5.0 The current version is broken, as it refuses to work properly with the current nl80211 state. Bumping this fixes full wavemon support Changelog: 9.5.0: https://github.com/uoaerg/wavemon/releases/tag/v0.9.5 Changelog 9.4.0: https://github.com/uoaerg/wavemon/releases/tag/v0.9.4 Note that since 0.9.4, wavemon has a dependency on libnl-cli Signed-off-by: Koen Vandeputte --- net/wavemon/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/wavemon/Makefile b/net/wavemon/Makefile index 65c69b370..b701835c3 100644 --- a/net/wavemon/Makefile +++ b/net/wavemon/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=wavemon -PKG_VERSION:=0.9.3 +PKG_VERSION:=0.9.5 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/uoaerg/wavemon/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=ddbeb6ec8ed7d94fa895e5d57ecfe338495df3991f6facc7cf40aa121bf7ff60 +PKG_HASH:=f84c55a40b470f2b98908d20cd0b38ffef6f587daed23b50281c9592df3331c6 PKG_MAINTAINER:=Jonathan McCrohan PKG_LICENSE:=GPL-2.0-or-later @@ -28,7 +28,7 @@ define Package/wavemon SECTION:=net CATEGORY:=Network TITLE:=N-curses based wireless network devices monitor - DEPENDS:=+libncurses +libpthread +libnl-genl + DEPENDS:=+libncurses +libpthread +libnl-genl +libnl-cli SUBMENU:=Wireless URL:=https://github.com/uoaerg/wavemon/releases endef From 3085608448e97130b59f3c82da2a582ec6794103 Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Sun, 15 Oct 2023 22:56:42 +0800 Subject: [PATCH 10/17] micropython-mpremote: Update to 1.21.0, rename package, move into utils This renames the package to mpremote and moves it into utils, as this is a command-line utility and not a Python/MicroPython library. This also adds a test.sh script for the packages feed CI. Signed-off-by: Jeffery To --- .../mpremote}/Makefile | 25 +++++++++---------- .../patches/001-no-importlib_metadata.patch | 0 utils/mpremote/test.sh | 5 ++++ 3 files changed, 17 insertions(+), 13 deletions(-) rename {lang/python/micropython-mpremote => utils/mpremote}/Makefile (62%) rename {lang/python/micropython-mpremote => utils/mpremote}/patches/001-no-importlib_metadata.patch (100%) create mode 100644 utils/mpremote/test.sh diff --git a/lang/python/micropython-mpremote/Makefile b/utils/mpremote/Makefile similarity index 62% rename from lang/python/micropython-mpremote/Makefile rename to utils/mpremote/Makefile index 9beca0156..af69d8088 100644 --- a/lang/python/micropython-mpremote/Makefile +++ b/utils/mpremote/Makefile @@ -7,12 +7,12 @@ include $(TOPDIR)/rules.mk -PKG_NAME:=micropython-mpremote -PKG_VERSION:=1.20.0 +PKG_NAME:=mpremote +PKG_VERSION:=1.21.0 PKG_RELEASE:=1 PYPI_NAME:=mpremote -PKG_HASH:=5c342762a04791309dd49bce63c70a075aa7c548b1c0076262b96f9ccc398ca2 +PKG_HASH:=65bc94511f6ff499e901ab59462a5f0744ff7e2cf71d8c75700d14a89c54ed61 PKG_LICENSE:=MIT PKG_LICENSE_FILES:=LICENSE @@ -20,25 +20,24 @@ PKG_MAINTAINER:=Jeffery To PKG_BUILD_DEPENDS:=python-hatchling/host python-hatch-requirements-txt/host python-hatch-vcs/host -include ../pypi.mk +include ../../lang/python/pypi.mk include $(INCLUDE_DIR)/package.mk -include ../python3-package.mk +include ../../lang/python/python3-package.mk -define Package/micropython-mpremote - SECTION:=lang - CATEGORY:=Languages - SUBMENU:=Python +define Package/mpremote + SECTION:=utils + CATEGORY:=Utilities TITLE:=Interacting remotely with MicroPython devices URL:=https://github.com/micropython/micropython DEPENDS:=+python3-light +python3-urllib +python3-pyserial endef -define Package/micropython-mpremote/description +define Package/mpremote/description This CLI tool provides an integrated set of utilities to remotely interact with and automate a MicroPython device over a serial connection. endef -$(eval $(call Py3Package,micropython-mpremote)) -$(eval $(call BuildPackage,micropython-mpremote)) -$(eval $(call BuildPackage,micropython-mpremote-src)) +$(eval $(call Py3Package,mpremote)) +$(eval $(call BuildPackage,mpremote)) +$(eval $(call BuildPackage,mpremote-src)) diff --git a/lang/python/micropython-mpremote/patches/001-no-importlib_metadata.patch b/utils/mpremote/patches/001-no-importlib_metadata.patch similarity index 100% rename from lang/python/micropython-mpremote/patches/001-no-importlib_metadata.patch rename to utils/mpremote/patches/001-no-importlib_metadata.patch diff --git a/utils/mpremote/test.sh b/utils/mpremote/test.sh new file mode 100644 index 000000000..3010c24c4 --- /dev/null +++ b/utils/mpremote/test.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +[ "$1" = mpremote ] || exit 0 + +mpremote version | grep -Fx "mpremote $PKG_VERSION" From 47c8bf1a095ea023e076e32fc51132c926360207 Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Tue, 31 Oct 2023 13:25:50 +0800 Subject: [PATCH 11/17] newt: Update to 0.52.24, add test.sh script for packages feed CI Signed-off-by: Jeffery To --- libs/newt/Makefile | 4 ++-- libs/newt/test.sh | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 libs/newt/test.sh diff --git a/libs/newt/Makefile b/libs/newt/Makefile index c0bc799df..30b9b5b27 100644 --- a/libs/newt/Makefile +++ b/libs/newt/Makefile @@ -10,12 +10,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=newt -PKG_VERSION:=0.52.23 +PKG_VERSION:=0.52.24 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://releases.pagure.org/newt -PKG_HASH:=caa372907b14ececfe298f0d512a62f41d33b290610244a58aed07bbc5ada12a +PKG_HASH:=5ded7e221f85f642521c49b1826c8de19845aa372baf5d630a51774b544fbdbb PKG_MAINTAINER:=Jeffery To PKG_LICENSE:=LGPL-2.0-only diff --git a/libs/newt/test.sh b/libs/newt/test.sh new file mode 100644 index 000000000..ae9006771 --- /dev/null +++ b/libs/newt/test.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +case "$1" in + +python3-newt) + python3 -c 'import snack' + ;; + +whiptail) + whiptail --version | grep -Fx "whiptail (newt): $PKG_VERSION" + ;; + +esac From a8df73ce7277134c5bd318b3e63cc14e2c70e9a7 Mon Sep 17 00:00:00 2001 From: "S. Brusch" Date: Sat, 21 Oct 2023 19:22:13 +0200 Subject: [PATCH 12/17] crowdsec-firewall-bouncer: add ujail MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * added ujail for crowdsec-firewall-bouncer * set nice to reduce priority for process Signed-off-by: S. Brusch Maintainer: Kerma Gérald Run tested: mediatek/filogic, BPI-R3, Openwrt 23.05.0 --- net/crowdsec-firewall-bouncer/Makefile | 2 +- .../files/crowdsec-firewall-bouncer.initd | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/net/crowdsec-firewall-bouncer/Makefile b/net/crowdsec-firewall-bouncer/Makefile index ee8c73223..3f1464099 100644 --- a/net/crowdsec-firewall-bouncer/Makefile +++ b/net/crowdsec-firewall-bouncer/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=crowdsec-firewall-bouncer PKG_VERSION:=0.0.28 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/crowdsecurity/cs-firewall-bouncer/tar.gz/v$(PKG_VERSION)? diff --git a/net/crowdsec-firewall-bouncer/files/crowdsec-firewall-bouncer.initd b/net/crowdsec-firewall-bouncer/files/crowdsec-firewall-bouncer.initd index 04acd1617..eb5b79b7b 100755 --- a/net/crowdsec-firewall-bouncer/files/crowdsec-firewall-bouncer.initd +++ b/net/crowdsec-firewall-bouncer/files/crowdsec-firewall-bouncer.initd @@ -210,6 +210,13 @@ run_bouncer() { procd_set_param command "$PROG" -c "$VARCONFIG" procd_set_param stdout 1 procd_set_param stderr 1 + procd_set_param nice 10 + if [ -x "/sbin/ujail" ]; then + procd_add_jail cs-bouncer log + procd_add_jail_mount $VARCONFIG + procd_add_jail_mount_rw /var/log/ + procd_set_param no_new_privs 1 + fi procd_close_instance fi } From f25f4d395d854b299a8bc81bb2834df7916b9153 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Sun, 29 Oct 2023 16:31:41 +0100 Subject: [PATCH 13/17] haproxy: move to PCRE2 Move to PCRE2 as PCRE is EOL and won't receive any more security update anymore. Signed-off-by: Christian Marangi --- net/haproxy/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/net/haproxy/Makefile b/net/haproxy/Makefile index 9f57f746b..182f51718 100644 --- a/net/haproxy/Makefile +++ b/net/haproxy/Makefile @@ -11,7 +11,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=haproxy PKG_VERSION:=2.8.3 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://www.haproxy.org/download/2.8/src @@ -46,7 +46,7 @@ endef define Package/haproxy $(call Package/haproxy/Default) TITLE+=with SSL support - DEPENDS+= +libpcre +libltdl +zlib +libpthread +liblua5.3 +libopenssl +libncurses +libreadline +libatomic + DEPENDS+= +libpcre2 +libltdl +zlib +libpthread +liblua5.3 +libopenssl +libncurses +libreadline +libatomic VARIANT:=ssl endef @@ -59,7 +59,7 @@ define Package/haproxy-nossl $(call Package/haproxy/Default) TITLE+=without SSL support VARIANT:=nossl - DEPENDS+= +libpcre +libltdl +zlib +libpthread +liblua5.3 +libatomic + DEPENDS+= +libpcre2 +libltdl +zlib +libpthread +liblua5.3 +libatomic CONFLICTS:=haproxy endef @@ -92,7 +92,7 @@ define Build/Compile PCREDIR="$(STAGING_DIR)/usr/" \ USE_LUA=1 LUA_LIB_NAME="lua5.3" LUA_INC="$(STAGING_DIR)/usr/include/lua5.3" LUA_LIB="$(STAGING_DIR)/usr/lib" \ SMALL_OPTS="-DBUFSIZE=16384 -DMAXREWRITE=1030 -DSYSTEM_MAXCONN=165530" \ - USE_ZLIB=1 USE_PCRE=1 USE_PCRE_JIT=1 USE_PTHREAD_PSHARED=1 USE_LIBATOMIC=1 USE_PROMEX=1 \ + USE_ZLIB=1 USE_PCRE2=1 USE_PCRE2_JIT=1 USE_PTHREAD_PSHARED=1 USE_LIBATOMIC=1 USE_PROMEX=1 \ VERSION="$(PKG_VERSION)" SUBVERS="-$(PKG_RELEASE)" \ VERDATE="$(shell date -d @$(SOURCE_DATE_EPOCH) '+%Y/%m/%d')" IGNOREGIT=1 \ $(ADDON) \ From 97a7165e7238f0966d6404faf775df8cf5f99a77 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Wed, 1 Nov 2023 01:42:59 +0100 Subject: [PATCH 14/17] libndpi: bump to release 4.8 Bump to release 4.8 to make it easier to backport PCRE2 support patch. Signed-off-by: Christian Marangi --- libs/libndpi/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/libndpi/Makefile b/libs/libndpi/Makefile index 41878f57e..94a86f7e6 100644 --- a/libs/libndpi/Makefile +++ b/libs/libndpi/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libndpi -PKG_VERSION:=4.6 +PKG_VERSION:=4.8 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/ntop/nDPI/tar.gz/$(PKG_VERSION)? -PKG_HASH:=6f307e23ab11b2b9e84a696120810e27a854072576a49783ff84fd37a1d7411b +PKG_HASH:=8f6235ba672d4ac8e4cbebb5611bc712a74587d9d53a649f483e4bcca5b80e58 PKG_BUILD_DIR:=$(BUILD_DIR)/nDPI-$(PKG_VERSION) PKG_MAINTAINER:=Banglang Huang , Toni Uhlig From baa0d5127062929fd26671adb5388f9b30b61a36 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Wed, 1 Nov 2023 01:43:36 +0100 Subject: [PATCH 15/17] libndpi: backport patch for PCRE2 support Backport patch for PCRE2 support as PCRE is EOL and won't receive any support updates anymore. Signed-off-by: Christian Marangi --- libs/libndpi/Makefile | 4 +- .../patches/001-Move-from-PCRE-to-PCRE2.patch | 197 ++++++++++++++++++ 2 files changed, 199 insertions(+), 2 deletions(-) create mode 100644 libs/libndpi/patches/001-Move-from-PCRE-to-PCRE2.patch diff --git a/libs/libndpi/Makefile b/libs/libndpi/Makefile index 94a86f7e6..66dfc3653 100644 --- a/libs/libndpi/Makefile +++ b/libs/libndpi/Makefile @@ -36,7 +36,7 @@ CONFIGURE_ARGS += --with-local-libgcrypt endif ifneq ($(CONFIG_LIBNDPI_PCRE),) -CONFIGURE_ARGS += --with-pcre +CONFIGURE_ARGS += --with-pcre2 endif ifneq ($(CONFIG_LIBNDPI_MAXMINDDB),) @@ -48,7 +48,7 @@ define Package/libndpi CATEGORY:=Libraries TITLE:=Library for deep-packet inspection URL:=https://github.com/ntop/nDPI - DEPENDS:=+LIBNDPI_GCRYPT:libgcrypt +LIBNDPI_PCRE:libpcre +LIBNDPI_MAXMINDDB:libmaxminddb +LIBNDPI_NDPIREADER:libpcap + DEPENDS:=+LIBNDPI_GCRYPT:libgcrypt +LIBNDPI_PCRE:libpcre2 +LIBNDPI_MAXMINDDB:libmaxminddb +LIBNDPI_NDPIREADER:libpcap endef define Package/libndpi/description diff --git a/libs/libndpi/patches/001-Move-from-PCRE-to-PCRE2.patch b/libs/libndpi/patches/001-Move-from-PCRE-to-PCRE2.patch new file mode 100644 index 000000000..731d1b290 --- /dev/null +++ b/libs/libndpi/patches/001-Move-from-PCRE-to-PCRE2.patch @@ -0,0 +1,197 @@ +From 8fed2be3d5b83949fabb2bdf39d6de4f24d2e68f Mon Sep 17 00:00:00 2001 +From: Christian Marangi +Date: Mon, 30 Oct 2023 18:10:51 +0100 +Subject: [PATCH] Move from PCRE to PCRE2 + +Move from PCRE to PCRE2. PCRE is EOL and won't receive any security +updates anymore. Convert to PCRE2 by converting any function PCRE2 new +API. + +Signed-off-by: Christian Marangi +--- + configure.ac | 18 ++++---- + src/lib/ndpi_utils.c | 46 ++++++++++----------- + src/lib/third_party/include/rce_injection.h | 6 +-- + tests/do.sh.in | 4 +- + 4 files changed, 37 insertions(+), 37 deletions(-) + +--- a/configure.ac ++++ b/configure.ac +@@ -359,14 +359,14 @@ AS_IF([test "${with_local_libgcrypt+set} + AC_DEFINE_UNQUOTED(USE_HOST_LIBGCRYPT, 1, [Use locally installed libgcrypt instead of builtin gcrypt-light]) + ]) + +-dnl> PCRE +-PCRE_ENABLED=0 +-AC_ARG_WITH(pcre, AS_HELP_STRING([--with-pcre], [Enable nDPI build with libpcre])) +-if test "${with_pcre+set}" = set; then : +- AC_CHECK_LIB(pcre, pcre_compile, AC_DEFINE_UNQUOTED(HAVE_PCRE, 1, [libpcre(-dev) is present])) +- if test "x$ac_cv_lib_pcre_pcre_compile" = xyes; then : +- ADDITIONAL_LIBS="${ADDITIONAL_LIBS} -lpcre" +- PCRE_ENABLED=1 ++dnl> PCRE2 ++PCRE2_ENABLED=0 ++AC_ARG_WITH(pcre2, AS_HELP_STRING([--with-pcre2], [Enable nDPI build with libpcre2])) ++if test "${with_pcre2+set}" = set; then : ++ AC_CHECK_LIB(pcre2-8, pcre2_compile_8, AC_DEFINE_UNQUOTED(HAVE_PCRE2, 1, [libpcre2(-dev) is present])) ++ if test "x$ac_cv_lib_pcre2_8_pcre2_compile_8" = xyes; then : ++ ADDITIONAL_LIBS="${ADDITIONAL_LIBS} -lpcre2-8" ++ PCRE2_ENABLED=1 + fi + fi + +@@ -420,7 +420,7 @@ AC_SUBST(GPROF_CFLAGS) + AC_SUBST(GPROF_LIBS) + AC_SUBST(GPROF_ENABLED) + AC_SUBST(USE_HOST_LIBGCRYPT) +-AC_SUBST(PCRE_ENABLED) ++AC_SUBST(PCRE2_ENABLED) + AC_SUBST(NBPF_ENABLED) + AC_SUBST(HANDLE_TLS_SIGS) + AC_SUBST(DISABLE_NPCAP) +--- a/src/lib/ndpi_utils.c ++++ b/src/lib/ndpi_utils.c +@@ -62,12 +62,12 @@ + + // #define DEBUG_REASSEMBLY + +-#ifdef HAVE_PCRE +-#include ++#ifdef HAVE_PCRE2 ++#define PCRE2_CODE_UNIT_WIDTH 8 ++#include + +-struct pcre_struct { +- pcre *compiled; +- pcre_extra *optimized; ++struct pcre2_struct { ++ pcre2_code *compiled; + }; + #endif + +@@ -1712,18 +1712,19 @@ static int ndpi_is_xss_injection(char* q + + /* ********************************** */ + +-#ifdef HAVE_PCRE ++#ifdef HAVE_PCRE2 + + static void ndpi_compile_rce_regex() { +- const char *pcreErrorStr = NULL; +- int pcreErrorOffset; ++ PCRE2_UCHAR pcreErrorStr[128]; ++ PCRE2_SIZE pcreErrorOffset; ++ int pcreErrorCode; + + for(int i = 0; i < N_RCE_REGEX; i++) { +- comp_rx[i] = (struct pcre_struct*)ndpi_malloc(sizeof(struct pcre_struct)); ++ comp_rx[i] = (struct pcre2_struct*)ndpi_malloc(sizeof(struct pcre2_struct)); + +- comp_rx[i]->compiled = pcre_compile(rce_regex[i], 0, &pcreErrorStr, ++ comp_rx[i]->compiled = pcre2_compile((PCRE2_SPTR)rce_regex[i], PCRE2_ZERO_TERMINATED, 0, &pcreErrorCode, + &pcreErrorOffset, NULL); +- ++ pcre2_get_error_message(pcreErrorCode, pcreErrorStr, 128); + if(comp_rx[i]->compiled == NULL) { + #ifdef DEBUG + NDPI_LOG_ERR(ndpi_str, "ERROR: Could not compile '%s': %s\n", rce_regex[i], +@@ -1733,17 +1734,16 @@ static void ndpi_compile_rce_regex() { + continue; + } + +- comp_rx[i]->optimized = pcre_study(comp_rx[i]->compiled, 0, &pcreErrorStr); ++ pcreErrorCode = pcre2_jit_compile(comp_rx[i]->compiled, PCRE2_JIT_COMPLETE); + + #ifdef DEBUG +- if(pcreErrorStr != NULL) { +- NDPI_LOG_ERR(ndpi_str, "ERROR: Could not study '%s': %s\n", rce_regex[i], ++ if(pcreErrorCode < 0) { ++ pcre2_get_error_message(pcreErrorCode, pcreErrorStr, 128); ++ NDPI_LOG_ERR(ndpi_str, "ERROR: Could not jit compile '%s': %s\n", rce_regex[i], + pcreErrorStr); + } + #endif + } +- +- ndpi_free((void *)pcreErrorStr); + } + + static int ndpi_is_rce_injection(char* query) { +@@ -1752,17 +1752,17 @@ static int ndpi_is_rce_injection(char* q + initialized_comp_rx = 1; + } + ++ pcre2_match_data *pcreMatchData; + int pcreExecRet; +- int subStrVec[30]; + + for(int i = 0; i < N_RCE_REGEX; i++) { + unsigned int length = strlen(query); + +- pcreExecRet = pcre_exec(comp_rx[i]->compiled, +- comp_rx[i]->optimized, +- query, length, 0, 0, subStrVec, 30); +- +- if(pcreExecRet >= 0) { ++ pcreMatchData = pcre2_match_data_create_from_pattern(comp_rx[i]->compiled, NULL); ++ pcreExecRet = pcre2_match(comp_rx[i]->compiled, ++ (PCRE2_SPTR)query, length, 0, 0, pcreMatchData, NULL); ++ pcre2_match_data_free(pcreMatchData); ++ if(pcreExecRet > 0) { + return 1; + } + #ifdef DEBUG +@@ -1852,7 +1852,7 @@ ndpi_risk_enum ndpi_validate_url(char *u + rc = NDPI_URL_POSSIBLE_XSS; + else if(ndpi_is_sql_injection(decoded)) + rc = NDPI_URL_POSSIBLE_SQL_INJECTION; +-#ifdef HAVE_PCRE ++#ifdef HAVE_PCRE2 + else if(ndpi_is_rce_injection(decoded)) + rc = NDPI_URL_POSSIBLE_RCE_INJECTION; + #endif +--- a/src/lib/third_party/include/rce_injection.h ++++ b/src/lib/third_party/include/rce_injection.h +@@ -1,4 +1,4 @@ +-#ifdef HAVE_PCRE ++#ifdef HAVE_PCRE2 + + #ifndef NDPI_RCE_H + #define NDPI_RCE_H +@@ -8,7 +8,7 @@ + #define N_RCE_REGEX 7 + + /* Compiled regex */ +-static struct pcre_struct *comp_rx[N_RCE_REGEX]; ++static struct pcre2_struct *comp_rx[N_RCE_REGEX]; + + static unsigned int initialized_comp_rx = 0; + +@@ -615,4 +615,4 @@ static const char *pwsh_commands[] = { + "-PSConsoleFile" + }; + +-#endif //HAVE_PCRE +\ No newline at end of file ++#endif //HAVE_PCRE2 +\ No newline at end of file +--- a/tests/do.sh.in ++++ b/tests/do.sh.in +@@ -26,7 +26,7 @@ CMD_COLORDIFF="$(which colordiff)" + + EXE_SUFFIX=@EXE_SUFFIX@ + GPROF_ENABLED=@GPROF_ENABLED@ +-PCRE_ENABLED=@PCRE_ENABLED@ ++PCRE2_ENABLED=@PCRE2_ENABLED@ + PCRE_PCAPS="WebattackRCE.pcap" + NBPF_ENABLED=@NBPF_ENABLED@ + NBPF_PCAPS="h323-overflow.pcap" +@@ -84,7 +84,7 @@ check_results() { + [ $SKIP_PCAP = 1 ] && continue + fi + SKIP_PCAP=0 +- if [ $PCRE_ENABLED -eq 0 ]; then ++ if [ $PCRE2_ENABLED -eq 0 ]; then + for p in $PCRE_PCAPS; do + if [ $f = $p ]; then + SKIP_PCAP=1 From dc52f47abbbba839fd89c84f4aacb74abd88757f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Espen=20J=C3=BCrgensen?= Date: Sat, 28 Oct 2023 00:30:17 +0200 Subject: [PATCH 16/17] owntone: update to 28.8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The dependency to libevent-pthread came in version 28.7. The changelog doesn't directly say it, but it is part of the "drop support for libevent < 2.1.4", ref. OwnTone PR #1574: "Support for libevent < 2.1.4 has been removed, and libevent pthreads is now a hard requirement." The configure option --without-libevent_pthreads also no longer exists. Signed-off-by: Espen Jürgensen --- sound/owntone/Makefile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sound/owntone/Makefile b/sound/owntone/Makefile index 0c4ba66a9..108da781d 100644 --- a/sound/owntone/Makefile +++ b/sound/owntone/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=owntone -PKG_VERSION:=28.5 +PKG_VERSION:=28.8 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://github.com/owntone/owntone-server/releases/download/$(PKG_VERSION)/ -PKG_HASH:=c9ee0152dc488f782a25a68e72d24c109882bef3dd2914315fe499c8415fd898 +PKG_HASH:=ebaee52ae617f08c41859522ba0a839d1865dcac7d6c0eb9e3fee81caf8fd47c PKG_FIXUP:=autoreconf PKG_BUILD_FLAGS:=no-mips16 @@ -32,7 +32,7 @@ CATEGORY:=Sound TITLE:=iTunes (DAAP) server for Apple Remote and AirPlay URL:=https://github.com/owntone/owntone-server DEPENDS:=+libgpg-error +libgcrypt +libgdbm +zlib +libexpat +libunistring \ - +libevent2 +libdaemon +confuse +alsa-lib +libffmpeg-full \ + +libevent2 +libevent2-pthreads +libdaemon +confuse +alsa-lib +libffmpeg-full \ +mxml +libavahi-client +sqlite3-cli +libplist +libcurl +libjson-c \ +libprotobuf-c +libgnutls +libsodium +libwebsockets +libuuid $(ICONV_DEPENDS) endef @@ -54,8 +54,7 @@ CONFIGURE_ARGS += \ --disable-install_conf_file \ --disable-install_user \ --with-alsa \ - --without-pulseaudio \ - --without-libevent_pthreads + --without-pulseaudio TARGET_CFLAGS += $(FPIC) From db9202ccc52a3ef360cd1918db9376a5cfa4b25f Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Sun, 15 Oct 2023 22:16:44 +0800 Subject: [PATCH 17/17] micropython: Update to 1.21.0, refresh/redo patches Removed 050-py-stackctrl-fix-gcc-13.patch as it has been merged in the new version. This also: * Add STRIP= (empty value) to skip micropython's stripping step, letting the OpenWrt build system control stripping. * Add a workaround for "variable might be clobbered" warning leading to build error on riscv64 (https://github.com/micropython/micropython/issues/12838). * Change Build/InstallDev to install host tools into an unversioned directory, and update micropython-lib to use the unversioned path. There is no need to keep available multiple versions of the host tools. * Add a test.sh script for the packages feed CI. Signed-off-by: Jeffery To --- lang/python/micropython-lib/Makefile | 3 +- lang/python/micropython/Makefile | 26 ++++++++++------ .../patches/030-target-no-darwin.patch | 4 +-- .../040-extmod-use-external-mbedtls.patch | 5 +-- .../patches/050-py-stackctrl-fix-gcc-13.patch | 31 ------------------- .../unix/variants/standard/manifest-nossl.py | 2 +- lang/python/micropython/test.sh | 6 ++++ 7 files changed, 29 insertions(+), 48 deletions(-) delete mode 100644 lang/python/micropython/patches/050-py-stackctrl-fix-gcc-13.patch create mode 100644 lang/python/micropython/test.sh diff --git a/lang/python/micropython-lib/Makefile b/lang/python/micropython-lib/Makefile index 490e6e2e7..095b89010 100644 --- a/lang/python/micropython-lib/Makefile +++ b/lang/python/micropython-lib/Makefile @@ -24,7 +24,6 @@ PKG_BUILD_DEPENDS:=python3/host PKG_BUILD_PARALLEL:=1 # keep in sync with micropython -MP_VERSION:=1.20.0 MP_MPY_FILE_VERSION:=6 include $(INCLUDE_DIR)/package.mk @@ -88,7 +87,7 @@ This contains source files for packages specific to the MicroPython Unix port. endef -MP_INSTALLDEV_PATH:=$(STAGING_DIR)/host/lib/micropython-$(MP_VERSION) +MP_INSTALLDEV_PATH:=$(STAGING_DIR)/host/lib/micropython define MicroPythonLib/Compile cd "$(PKG_BUILD_DIR)" && python3 tools/build.py \ diff --git a/lang/python/micropython/Makefile b/lang/python/micropython/Makefile index 6e129c15d..17b0bdd0c 100644 --- a/lang/python/micropython/Makefile +++ b/lang/python/micropython/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=micropython -PKG_VERSION:=1.20.0 +PKG_VERSION:=1.21.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://github.com/micropython/micropython/releases/download/v$(PKG_VERSION) -PKG_HASH:=098ef8e40abdc62551b5460d0ffe9489074240c0cb5589ca3c3a425551beb9bf +PKG_HASH:=abd2152613559d3f44728668346e78be9d93458133a03b700baf222c322fd4d5 PKG_MAINTAINER:=Jeffery To PKG_LICENSE:=MIT @@ -70,14 +70,20 @@ $(call Package/micropython/Default/description) This version is built without TLS and mip. endef -MAKE_FLAGS += BUILD_VERBOSE=1 +MAKE_FLAGS += BUILD_VERBOSE=1 STRIP= ifneq ($(CONFIG_DEBUG),) MAKE_FLAGS += DEBUG=1 endif ifeq ($(BUILD_VARIANT),nossl) - MAKE_FLAGS += MICROPY_PY_USSL=0 FROZEN_MANIFEST=variants/standard/manifest-nossl.py + MAKE_FLAGS += MICROPY_PY_SSL=0 FROZEN_MANIFEST=variants/standard/manifest-nossl.py +endif + +# Work around "variable might be clobbered" warning leading to build error +# https://github.com/micropython/micropython/issues/12838 +ifeq ($(ARCH),riscv64) + MAKE_FLAGS += CFLAGS_EXTRA=-Wno-error=clobbered endif MAKE_PATH = ports/unix @@ -89,20 +95,20 @@ define Build/Configure endef define Build/InstallDev - $(INSTALL_DIR) $(2)/lib/micropython-$(PKG_VERSION)/mpy-cross + $(INSTALL_DIR) $(2)/lib/micropython/mpy-cross $(CP) \ $(PKG_BUILD_DIR)/mpy-cross/mpy_cross \ - $(2)/lib/micropython-$(PKG_VERSION)/mpy-cross/ + $(2)/lib/micropython/mpy-cross/ - $(INSTALL_DIR) $(2)/lib/micropython-$(PKG_VERSION)/mpy-cross/build + $(INSTALL_DIR) $(2)/lib/micropython/mpy-cross/build $(INSTALL_BIN) \ $(PKG_BUILD_DIR)/mpy-cross/build/mpy-cross \ - $(2)/lib/micropython-$(PKG_VERSION)/mpy-cross/build/ + $(2)/lib/micropython/mpy-cross/build/ - $(INSTALL_DIR) $(2)/lib/micropython-$(PKG_VERSION)/tools + $(INSTALL_DIR) $(2)/lib/micropython/tools $(INSTALL_DATA) \ $(PKG_BUILD_DIR)/tools/manifestfile.py \ - $(2)/lib/micropython-$(PKG_VERSION)/tools/ + $(2)/lib/micropython/tools/ endef define Package/micropython/Default/install diff --git a/lang/python/micropython/patches/030-target-no-darwin.patch b/lang/python/micropython/patches/030-target-no-darwin.patch index a847e96b4..9dc4c59bc 100644 --- a/lang/python/micropython/patches/030-target-no-darwin.patch +++ b/lang/python/micropython/patches/030-target-no-darwin.patch @@ -1,7 +1,7 @@ --- a/ports/unix/Makefile +++ b/ports/unix/Makefile -@@ -31,7 +31,7 @@ QSTR_DEFS = qstrdefsport.h - QSTR_GLOBAL_DEPENDENCIES = $(VARIANT_DIR)/mpconfigvariant.h +@@ -31,7 +31,7 @@ QSTR_DEFS += qstrdefsport.h + QSTR_GLOBAL_DEPENDENCIES += $(VARIANT_DIR)/mpconfigvariant.h # OS name, for simple autoconfig -UNAME_S := $(shell uname -s) diff --git a/lang/python/micropython/patches/040-extmod-use-external-mbedtls.patch b/lang/python/micropython/patches/040-extmod-use-external-mbedtls.patch index dccd5ba51..3399412e4 100644 --- a/lang/python/micropython/patches/040-extmod-use-external-mbedtls.patch +++ b/lang/python/micropython/patches/040-extmod-use-external-mbedtls.patch @@ -9,7 +9,7 @@ Subject: [PATCH 06/10] extmod: Use system mbedtls --- a/extmod/extmod.mk +++ b/extmod/extmod.mk -@@ -131,84 +131,8 @@ SRC_THIRDPARTY_C += $(addprefix $(AXTLS_ +@@ -131,85 +131,8 @@ SRC_THIRDPARTY_C += $(addprefix $(AXTLS_ crypto/sha1.c \ ) else ifeq ($(MICROPY_SSL_MBEDTLS),1) @@ -54,7 +54,6 @@ Subject: [PATCH 06/10] extmod: Use system mbedtls - md4.c \ - md5.c \ - md.c \ -- md_wrap.c \ - oid.c \ - padlock.c \ - pem.c \ @@ -79,9 +78,11 @@ Subject: [PATCH 06/10] extmod: Use system mbedtls - ssl_cli.c \ - ssl_cookie.c \ - ssl_srv.c \ +- ssl_msg.c \ - ssl_ticket.c \ - ssl_tls.c \ - timing.c \ +- constant_time.c \ - x509.c \ - x509_create.c \ - x509_crl.c \ diff --git a/lang/python/micropython/patches/050-py-stackctrl-fix-gcc-13.patch b/lang/python/micropython/patches/050-py-stackctrl-fix-gcc-13.patch deleted file mode 100644 index 8cd7df66e..000000000 --- a/lang/python/micropython/patches/050-py-stackctrl-fix-gcc-13.patch +++ /dev/null @@ -1,31 +0,0 @@ -From f1c6cb7725960487195daa5c5c196fd8d3563811 Mon Sep 17 00:00:00 2001 -From: Damien George -Date: Wed, 3 May 2023 15:23:24 +1000 -Subject: [PATCH] py/stackctrl: Add gcc pragmas to ignore dangling-pointer - warning. - -This warning became apparent in gcc 13. - -Signed-off-by: Damien George ---- - py/stackctrl.c | 7 +++++++ - 1 file changed, 7 insertions(+) - ---- a/py/stackctrl.c -+++ b/py/stackctrl.c -@@ -28,8 +28,15 @@ - #include "py/stackctrl.h" - - void mp_stack_ctrl_init(void) { -+ #if __GNUC__ >= 13 -+ #pragma GCC diagnostic push -+ #pragma GCC diagnostic ignored "-Wdangling-pointer" -+ #endif - volatile int stack_dummy; - MP_STATE_THREAD(stack_top) = (char *)&stack_dummy; -+ #if __GNUC__ >= 13 -+ #pragma GCC diagnostic pop -+ #endif - } - - void mp_stack_set_top(void *top) { diff --git a/lang/python/micropython/src/ports/unix/variants/standard/manifest-nossl.py b/lang/python/micropython/src/ports/unix/variants/standard/manifest-nossl.py index 21f53bddd..ee2b4620d 100644 --- a/lang/python/micropython/src/ports/unix/variants/standard/manifest-nossl.py +++ b/lang/python/micropython/src/ports/unix/variants/standard/manifest-nossl.py @@ -1 +1 @@ -include("$(MPY_DIR)/extmod/uasyncio") +include("$(MPY_DIR)/extmod/asyncio") diff --git a/lang/python/micropython/test.sh b/lang/python/micropython/test.sh new file mode 100644 index 000000000..82cf2ecd0 --- /dev/null +++ b/lang/python/micropython/test.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +nl=" +" + +micropython -c "import sys${nl}print(sys.version)" | grep -F " MicroPython v${PKG_VERSION} "