diff --git a/.github/workflows/build-openwrt-huge.yml b/.github/workflows/build-openwrt-huge.yml index da9f5ee8..9449398a 100644 --- a/.github/workflows/build-openwrt-huge.yml +++ b/.github/workflows/build-openwrt-huge.yml @@ -66,8 +66,14 @@ jobs: env: DEBIAN_FRONTEND: noninteractive run: | - docker rmi `docker images -q` + #docker rmi `docker images -q` + sudo swapoff -a + sudo rm -f /swapfile /mnt/swapfile + sudo docker image prune -a -f + sudo systemctl stop docker + sudo snap set system refresh.retain=2 sudo rm -rf /usr/share/dotnet /etc/apt/sources.list.d /usr/local/lib/android 2>/dev/null + sudo sed -i '/NVM_DIR/d;/skel/d' /root/{.bashrc,.profile} sudo -E apt -y purge azure-cli ghc* zulu* texlive* firefox google* dotnet* powershell openjdk* mongodb* moby* || true [[ -n "${AGENT_TOOLSDIRECTORY}" ]] && sudo rm -rf "${AGENT_TOOLSDIRECTORY}" sudo -E apt update @@ -77,17 +83,43 @@ jobs: sudo -E systemctl daemon-reload sudo -E apt clean && sudo -E apt autoclean sudo timedatectl set-timezone "$TZ" - sudo mkdir -p /mnt/workdir - sudo chown $USER:$GROUPS /mnt/workdir + #sudo mkdir -p /builder + #sudo chown $USER:$GROUPS /builder echo "status=success" >> ${GITHUB_OUTPUT} df -Th + + - name: Create Swap + run: | + sudo dd if=/dev/zero of=/mnt/swapfile bs=1M count=8192 + sudo chmod 600 /mnt/swapfile + sudo mkswap /mnt/swapfile + sudo swapon /mnt/swapfile + free -h | grep -i swap + - name: Create simulated physical disk + run: | + mnt_size=$(expr $(df -h /mnt | tail -1 | awk '{print $4}' | sed 's/[[:alpha:]]//g' | sed 's/\..*//') - 1) + root_size=$(expr $(df -h / | tail -1 | awk '{print $4}' | sed 's/[[:alpha:]]//g' | sed 's/\..*//') - 4) + sudo truncate -s "${mnt_size}"G /mnt/mnt.img + sudo truncate -s "${root_size}"G /root.img + sudo losetup /dev/loop6 /mnt/mnt.img + sudo losetup /dev/loop7 /root.img + sudo pvcreate /dev/loop6 + sudo pvcreate /dev/loop7 + sudo vgcreate github /dev/loop6 /dev/loop7 + sudo lvcreate -n runner -l 100%FREE github + sudo mkfs.xfs /dev/github/runner + sudo mkdir -p /builder + sudo mount /dev/github/runner /builder + sudo chown -R runner.runner /builder + df -Th + - name: Clone source code - working-directory: /mnt/workdir + working-directory: /builder run: | df -hT $PWD git clone $REPO_URL -b $REPO_BRANCH openwrt - ln -sf /mnt/workdir/openwrt $GITHUB_WORKSPACE/openwrt + ln -sf /builder/openwrt $GITHUB_WORKSPACE/openwrt cd openwrt useVersionInfo=$(git show -s --date=short --format="Author: %an
date: %cd
commit: %s
commit hash: %H") echo "useVersionInfo=$useVersionInfo" >> $GITHUB_ENV diff --git a/ARMv8/lede-huge.config b/ARMv8/lede-huge.config index b5ca86a7..fde27591 100644 --- a/ARMv8/lede-huge.config +++ b/ARMv8/lede-huge.config @@ -5538,7 +5538,7 @@ CONFIG_PACKAGE_luci-app-unblockmusic_INCLUDE_UnblockNeteaseMusic_Go=y CONFIG_PACKAGE_luci-app-upnp=y CONFIG_PACKAGE_luci-app-usb-printer=y # CONFIG_PACKAGE_luci-app-usbmodem is not set -CONFIG_PACKAGE_luci-app-uugamebooster=y +# CONFIG_PACKAGE_luci-app-uugamebooster is not set CONFIG_PACKAGE_luci-app-v2ray-server=y CONFIG_PACKAGE_luci-app-verysync=y CONFIG_PACKAGE_luci-app-vlmcsd=y @@ -6017,7 +6017,7 @@ CONFIG_PACKAGE_luci-i18n-unblockmusic-zh-cn=y CONFIG_PACKAGE_luci-i18n-upnp-zh-cn=y # CONFIG_PACKAGE_luci-i18n-upnp-zh-tw is not set CONFIG_PACKAGE_luci-i18n-usb-printer-zh-cn=y -CONFIG_PACKAGE_luci-i18n-uugamebooster-zh-cn=y +# CONFIG_PACKAGE_luci-i18n-uugamebooster-zh-cn is not set CONFIG_PACKAGE_luci-i18n-v2ray-server-zh-cn=y CONFIG_PACKAGE_luci-i18n-verysync-zh-cn=y CONFIG_PACKAGE_luci-i18n-vlmcsd-zh-cn=y @@ -7530,7 +7530,7 @@ CONFIG_PACKAGE_udpxy=y # CONFIG_PACKAGE_umdns is not set # CONFIG_PACKAGE_usbip is not set # CONFIG_PACKAGE_usteer is not set -CONFIG_PACKAGE_uugamebooster=y +# CONFIG_PACKAGE_uugamebooster is not set # CONFIG_PACKAGE_v2ray-core is not set # CONFIG_PACKAGE_vallumd is not set CONFIG_PACKAGE_verysync=y diff --git a/diy-part2.sh b/diy-part2.sh index e626dadb..388383a1 100755 --- a/diy-part2.sh +++ b/diy-part2.sh @@ -242,8 +242,8 @@ rm -rf feeds/packages/multimedia/ffmpeg cp -rf $GITHUB_WORKSPACE/general/ffmpeg feeds/packages/multimedia # btrfs-progs -sed -i 's/PKG_VERSION:=.*/PKG_VERSION:=6.8/g' feeds/packages/utils/btrfs-progs/Makefile -sed -i 's/PKG_HASH:=.*/PKG_HASH:=9c21645feac182611e28b47769d5f613cb9e2ecab58ece60b10e6c55a9ead575/g' feeds/packages/utils/btrfs-progs/Makefile +sed -i 's/PKG_VERSION:=.*/PKG_VERSION:=6.9/g' feeds/packages/utils/btrfs-progs/Makefile +sed -i 's/PKG_HASH:=.*/PKG_HASH:=7e14a5d597f323dd7d1b453e3a4e661a7e9f07ea060efbff4f76ff8315917de8/g' feeds/packages/utils/btrfs-progs/Makefile rm -rf feeds/packages/utils/btrfs-progs/patches #sed -i '68i\ --disable-libudev \\' feeds/packages/utils/btrfs-progs/Makefile @@ -252,7 +252,8 @@ rm -rf feeds/packages/utils/btrfs-progs/patches #sed -i 's/PKG_HASH:=.*/PKG_HASH:=da240744c6cc5953d7c4d298a02a0cf36d2c8897931819f1e6459bd5270a7c5c/g' feeds/packages/net/qBittorrent/Makefile #sed -i '41i\ +qt5-sql \\' feeds/packages/net/qBittorrent/Makefile #cp -rf $GITHUB_WORKSPACE/general/qBittorrent/patches feeds/packages/net/qBittorrent -cp -f $GITHUB_WORKSPACE/general/qBittorrent/Makefile feeds/packages/net/qBittorrent/Makefile +rm -f feeds/packages/net/qBittorrent/Makefile +cp -f $GITHUB_WORKSPACE/general/qBittorrent/Makefile.qt6 feeds/packages/net/qBittorrent/Makefile #sed -i 's/zh/zh_CN/g' feeds/luci/applications/luci-app-qbittorrent/root/etc/config/qbittorrent # libtorrent-rasterbar_v2 @@ -274,16 +275,16 @@ rm -rf feeds/packages/net/curl merge_package https://github.com/openwrt/packages packages/net/curl # Qt5 -qtbase -sed -i "s/PKG_BUGFIX:=.*/PKG_BUGFIX:=13/g" feeds/packages/libs/qtbase/Makefile -sed -i "s/PKG_HASH:=.*/PKG_HASH:=4cca51dcc1f22ceeee6b3e33cd1c3a60b14e85e24644dca3af89a2c2989ab809/g" feeds/packages/libs/qtbase/Makefile -#rm -rf feeds/packages/libs/qtbase -#cp -rf $GITHUB_WORKSPACE/general/qt6base feeds/packages/libs +#sed -i "s/PKG_BUGFIX:=.*/PKG_BUGFIX:=13/g" feeds/packages/libs/qtbase/Makefile +#sed -i "s/PKG_HASH:=.*/PKG_HASH:=4cca51dcc1f22ceeee6b3e33cd1c3a60b14e85e24644dca3af89a2c2989ab809/g" feeds/packages/libs/qtbase/Makefile +rm -rf feeds/packages/libs/qtbase +cp -rf $GITHUB_WORKSPACE/general/qtbase feeds/packages/libs # Qt5 -qttools -sed -i "s/PKG_BUGFIX:=.*/PKG_BUGFIX:=13/g" feeds/packages/libs/qttools/Makefile -sed -i "s/PKG_HASH:=.*/PKG_HASH:=57c9794c572c4e02871f2e7581525752b0cf85ea16cfab23a4ac9ba7b39a5d34/g" feeds/packages/libs/qttools/Makefile -#rm -rf feeds/packages/libs/qttools -#cp -rf $GITHUB_WORKSPACE/general/qt6tools feeds/packages/libs +#sed -i "s/PKG_BUGFIX:=.*/PKG_BUGFIX:=13/g" feeds/packages/libs/qttools/Makefile +#sed -i "s/PKG_HASH:=.*/PKG_HASH:=57c9794c572c4e02871f2e7581525752b0cf85ea16cfab23a4ac9ba7b39a5d34/g" feeds/packages/libs/qttools/Makefile +rm -rf feeds/packages/libs/qttools +cp -rf $GITHUB_WORKSPACE/general/qttools feeds/packages/libs #fix speedtest-cli #sed -i "s/PKG_VERSION:=.*/PKG_VERSION:=2.1.3/g" feeds/packages/lang/python/python3-speedtest-cli/Makefile @@ -320,8 +321,8 @@ rm -rf feeds/packages/utils/dockerd cp -rf $GITHUB_WORKSPACE/general/dockerd feeds/packages/utils/dockerd # docker-compose -sed -i 's/PKG_VERSION:=.*/PKG_VERSION:=2.27.1/g' feeds/packages/utils/docker-compose/Makefile -sed -i 's/PKG_HASH:=.*/PKG_HASH:=5abf8de3a413894c2ed061812d68c8d8eb4e255b25bf38e2ac58d3ba0546a218/g' feeds/packages/utils/docker-compose/Makefile +sed -i 's/PKG_VERSION:=.*/PKG_VERSION:=2.28.0/g' feeds/packages/utils/docker-compose/Makefile +sed -i 's/PKG_HASH:=.*/PKG_HASH:=752a6c95d077126d6c459150f1db8111d2b7d01fa7495667dced07d8e3e8ef31/g' feeds/packages/utils/docker-compose/Makefile # containerd #sed -i 's/PKG_VERSION:=.*/PKG_VERSION:=1.5.11/g' feeds/packages/utils/containerd/Makefile @@ -372,8 +373,8 @@ sed -i 's/PKG_MIRROR_HASH:=.*/PKG_MIRROR_HASH:=ac817f63605508779ebebf612fcb7d594 # php8 #rm -rf feeds/packages/lang/php8 #svn co https://github.com/openwrt/packages/trunk/lang/php8 feeds/packages/lang/php8 -sed -i 's/PKG_VERSION:=.*/PKG_VERSION:=8.3.7/g' feeds/packages/lang/php8/Makefile -sed -i 's/PKG_HASH:=.*/PKG_HASH:=d53433c1ca6b2c8741afa7c524272e6806c1e895e5912a058494fea89988570a/g' feeds/packages/lang/php8/Makefile +sed -i 's/PKG_VERSION:=.*/PKG_VERSION:=8.3.8/g' feeds/packages/lang/php8/Makefile +sed -i 's/PKG_HASH:=.*/PKG_HASH:=aea358b56186f943c2bbd350c9005b9359133d47e954cfc561385319ae5bb8d7/g' feeds/packages/lang/php8/Makefile # python-docker sed -i 's/PKG_VERSION:=.*/PKG_VERSION:=7.1.0/g' feeds/packages/lang/python/python-docker/Makefile @@ -577,8 +578,8 @@ sed -i 's/PKG_HASH:=.*/PKG_HASH:=15f54bb72048eb105f8c0e936a04b899e74c3db9a19bbc1 #svn co https://github.com/openwrt/packages/trunk/net/softethervpn5 feeds/packages/net/softethervpn5 # hwdata -sed -i 's/PKG_VERSION:=.*/PKG_VERSION:=0.381/g' feeds/packages/utils/hwdata/Makefile -sed -i 's/PKG_HASH:=.*/PKG_HASH:=53435c73964ddc24ac53fa86e29e8b9244ca1cab0578ffdd82fd280f35863004/g' feeds/packages/utils/hwdata/Makefile +sed -i 's/PKG_VERSION:=.*/PKG_VERSION:=0.383/g' feeds/packages/utils/hwdata/Makefile +sed -i 's/PKG_HASH:=.*/PKG_HASH:=97f328f85e51ea78ad14620705dba269cbbb47911e56bdd8b35360e6cdccc00c/g' feeds/packages/utils/hwdata/Makefile # gawk sed -i 's/PKG_VERSION:=.*/PKG_VERSION:=5.3.0/g' feeds/packages/utils/gawk/Makefile @@ -667,8 +668,8 @@ rm -rf feeds/packages/utils/nano cp -rf $GITHUB_WORKSPACE/general/nano feeds/packages/utils # dnsproxy -sed -i 's/PKG_VERSION:=.*/PKG_VERSION:=0.71.1/g' feeds/packages/net/dnsproxy/Makefile -sed -i 's/PKG_HASH:=.*/PKG_HASH:=9c55c83ce3521c5197293a7618ed3ff103d236344aabf73ba37055e3964d2087/g' feeds/packages/net/dnsproxy/Makefile +sed -i 's/PKG_VERSION:=.*/PKG_VERSION:=0.71.2/g' feeds/packages/net/dnsproxy/Makefile +sed -i 's/PKG_HASH:=.*/PKG_HASH:=9ea0a3ad75b2afdae8972aa563ec102c545c0e78acef07ab6862cba4d9508f62/g' feeds/packages/net/dnsproxy/Makefile # libnl-tiny #sed -i 's/PKG_RELEASE:=.*/PKG_RELEASE:=1/g' package/libs/libnl-tiny/Makefile @@ -852,8 +853,8 @@ rm -rf feeds/packages/utils/coreutils cp -r $GITHUB_WORKSPACE/general/coreutils feeds/packages/utils # frp -sed -i 's/PKG_VERSION:=.*/PKG_VERSION:=0.56.0/g' feeds/packages/net/frp/Makefile -sed -i 's/PKG_HASH:=.*/PKG_HASH:=084542bad79f9bed7fb18f31e7763589663e1dca243fe1c3d3dbfec45610ad5a/g' feeds/packages/net/frp/Makefile +sed -i 's/PKG_VERSION:=.*/PKG_VERSION:=0.58.1/g' feeds/packages/net/frp/Makefile +sed -i 's/PKG_HASH:=.*/PKG_HASH:=c6eabdc2bf39bdb4a7ab7794a4b2ad94be5e0cab50b6cc540a6431e61208b1e6/g' feeds/packages/net/frp/Makefile # openconnect #sed -i 's/PKG_VERSION:=.*/PKG_VERSION:=8.20/g' feeds/packages/net/openconnect/Makefile @@ -911,10 +912,10 @@ sed -i 's/PKG_HASH:=.*/PKG_HASH:=84404ca8431b595e86c473d8f23d8bb102810001f15feaf #svn co https://github.com/immortalwrt/packages/trunk/net/verysync feeds/packages/net/verysync # haproxy -#sed -i 's/PKG_VERSION:=.*/PKG_VERSION:=2.8.9/g' feeds/packages/net/haproxy/Makefile +sed -i 's/PKG_VERSION:=.*/PKG_VERSION:=3.0.2/g' feeds/packages/net/haproxy/Makefile #sed -i 's/PKG_RELEASE:=.*/PKG_RELEASE:=1/g' feeds/packages/net/haproxy/Makefile -#sed -i 's/PKG_HASH:=.*/PKG_HASH:=7a821478f36f847607f51a51e80f4f890c37af4811d60438e7f63783f67592ff/g' feeds/packages/net/haproxy/Makefile -#sed -i 's/BASE_TAG:=.*/BASE_TAG=v2.8.9/g' feeds/packages/net/haproxy/get-latest-patches.sh +sed -i 's/PKG_HASH:=.*/PKG_HASH:=9672ee43b109f19356c35d72687b222dcf82b879360c6e82677397376cf5dc36/g' feeds/packages/net/haproxy/Makefile +sed -i 's/BASE_TAG:=.*/BASE_TAG=v3.0.2/g' feeds/packages/net/haproxy/get-latest-patches.sh #sed -i 's|PKG_SOURCE_URL:=.*|PKG_SOURCE_URL:=https://www.haproxy.org/download/2.8/src|g' feeds/packages/net/haproxy/Makefile # perl @@ -961,16 +962,16 @@ cp -rf $GITHUB_WORKSPACE/general/lsof feeds/packages/utils #cp -rf $GITHUB_WORKSPACE/general/iptables package/network/utils # nghttp2 -sed -i 's/PKG_VERSION:=.*/PKG_VERSION:=1.57.0/g' feeds/packages/libs/nghttp2/Makefile -sed -i 's/PKG_HASH:=.*/PKG_HASH:=9210b0113109f43be526ac5835d58a701411821a4d39e155c40d67c40f47a958/g' feeds/packages/libs/nghttp2/Makefile +sed -i 's/PKG_VERSION:=.*/PKG_VERSION:=1.62.1/g' feeds/packages/libs/nghttp2/Makefile +sed -i 's/PKG_HASH:=.*/PKG_HASH:=2345d4dc136fda28ce243e0bb21f2e7e8ef6293d62c799abbf6f633a6887af72/g' feeds/packages/libs/nghttp2/Makefile # libiconv-full #sed -i 's/PKG_VERSION:=.*/PKG_VERSION:=1.17/g' package/libs/libiconv-full/Makefile #sed -i 's/PKG_HASH:=.*/PKG_HASH:=8f74213b56238c85a50a5329f77e06198771e70dd9a739779f4c02f65d971313/g' package/libs/libiconv-full/Makefile # bind -sed -i 's/PKG_VERSION:=.*/PKG_VERSION:=9.18.26/g' feeds/packages/net/bind/Makefile -sed -i 's/PKG_HASH:=.*/PKG_HASH:=75ffee52731e9604c849b658df29e927f1c4f01d5a71ea3ebcbeb63702cb6651/g' feeds/packages/net/bind/Makefile +sed -i 's/PKG_VERSION:=.*/PKG_VERSION:=9.18.27/g' feeds/packages/net/bind/Makefile +sed -i 's/PKG_HASH:=.*/PKG_HASH:=ea3f3d8cfa2f6ae78c8722751d008f54bc17a3aed2be3f7399eb7bf5f4cda8f1/g' feeds/packages/net/bind/Makefile sed -i 's/PKG_RELEASE:=.*/PKG_RELEASE:=1/g' feeds/packages/net/bind/Makefile # libwebp @@ -1116,6 +1117,12 @@ curl -so files/root/.bashrc https://raw.githubusercontent.com/sbwml/r4s_build_sc # musl patch cp -fv $GITHUB_WORKSPACE/PATCH/001-elf.h-add-typedefs-for-Elf-_Relr.patch toolchain/musl/patches +rm -rf feeds/packages/lang/python +cp -rf $GITHUB_WORKSPACE/general/python feeds/packages/lang + +rm -rf feeds/packages/net/uugamebooster +cp -rf $GITHUB_WORKSPACE/general/uugamebooster feeds/packages/net + ./scripts/feeds update -a ./scripts/feeds install -a diff --git a/general/containerd/Makefile b/general/containerd/Makefile index 052e377a..d8f54cb7 100644 --- a/general/containerd/Makefile +++ b/general/containerd/Makefile @@ -1,15 +1,15 @@ include $(TOPDIR)/rules.mk PKG_NAME:=containerd -PKG_VERSION:=1.7.15 +PKG_VERSION:=1.7.18 PKG_RELEASE:=1 PKG_LICENSE:=Apache-2.0 PKG_LICENSE_FILES:=LICENSE PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/containerd/containerd/tar.gz/v${PKG_VERSION}? -PKG_HASH:=2dc491434b182334b51350f810ed68ace3624c8a2d6e1eac490d93c653498a33 -PKG_SOURCE_VERSION:=926c9586fe4a6236699318391cd44976a98e31f1 +PKG_HASH:=91685cebd50e3f353a402adadf61e2a6aeda3f63754fa0fcc978a043e00acac4 +PKG_SOURCE_VERSION:=ae71819c4f5e67bb4d5ae76a6b735f29cc25774e PKG_MAINTAINER:=Gerard Ryan diff --git a/general/docker/Makefile b/general/docker/Makefile index a30e8b92..6f8af657 100644 --- a/general/docker/Makefile +++ b/general/docker/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=docker -PKG_VERSION:=26.1.3 +PKG_VERSION:=26.1.4 PKG_RELEASE:=1 PKG_LICENSE:=Apache-2.0 PKG_LICENSE_FILES:=LICENSE @@ -10,8 +10,8 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_GIT_URL:=github.com/docker/cli PKG_GIT_REF:=v$(PKG_VERSION) PKG_SOURCE_URL:=https://codeload.$(PKG_GIT_URL)/tar.gz/$(PKG_GIT_REF)? -PKG_HASH:=d361896cd02deb3bd160c627401eba2cd8e2513a085c55427319bea8c6412ad4 -PKG_GIT_SHORT_COMMIT:=b72abbb # SHA1 used within the docker executables +PKG_HASH:=73f914421db873d1a19d4d15e8ae21bebc35079f3034f574dfc6cd0449edcf89 +PKG_GIT_SHORT_COMMIT:=5650f9b # SHA1 used within the docker executables PKG_MAINTAINER:=Gerard Ryan diff --git a/general/dockerd/Makefile b/general/dockerd/Makefile index bd26a7cb..9c0030db 100644 --- a/general/dockerd/Makefile +++ b/general/dockerd/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dockerd -PKG_VERSION:=26.1.3 +PKG_VERSION:=26.1.4 PKG_RELEASE:=1 PKG_LICENSE:=Apache-2.0 PKG_LICENSE_FILES:=LICENSE @@ -10,8 +10,8 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_GIT_URL:=github.com/moby/moby PKG_GIT_REF:=v$(PKG_VERSION) PKG_SOURCE_URL:=https://codeload.$(PKG_GIT_URL)/tar.gz/$(PKG_GIT_REF)? -PKG_HASH:=2f51e2dd1c122e364510c95f66e94b7fff9d5199545484e92c2e52b0efcdc2e6 -PKG_GIT_SHORT_COMMIT:=8e96db1 # SHA1 used within the docker executables +PKG_HASH:=74d3f38f2b88399012e0b889e6408d81e2d198437deda71da6d1da72dcc8afcc +PKG_GIT_SHORT_COMMIT:=de5c9cf # SHA1 used within the docker executables PKG_MAINTAINER:=Gerard Ryan diff --git a/general/golang/golang/Makefile b/general/golang/golang/Makefile index 5aa7257d..9e8d6a1c 100644 --- a/general/golang/golang/Makefile +++ b/general/golang/golang/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk GO_VERSION_MAJOR_MINOR:=1.22 -GO_VERSION_PATCH:=3 +GO_VERSION_PATCH:=4 PKG_NAME:=golang PKG_VERSION:=$(GO_VERSION_MAJOR_MINOR)$(if $(GO_VERSION_PATCH),.$(GO_VERSION_PATCH)) @@ -20,7 +20,7 @@ GO_SOURCE_URLS:=https://dl.google.com/go/ \ PKG_SOURCE:=go$(PKG_VERSION).src.tar.gz PKG_SOURCE_URL:=$(GO_SOURCE_URLS) -PKG_HASH:=80648ef34f903193d72a59c0dff019f5f98ae0c9aa13ade0b0ecbff991a76f68 +PKG_HASH:=fed720678e728a7ca30ba8d1ded1caafe27d16028fab0232b8ba8e22008fb784 PKG_MAINTAINER:=Jeffery To PKG_LICENSE:=BSD-3-Clause diff --git a/general/pcre2/Makefile b/general/pcre2/Makefile index 7fe81e9a..ea9d65a8 100644 --- a/general/pcre2/Makefile +++ b/general/pcre2/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=pcre2 -PKG_VERSION:=10.43 +PKG_VERSION:=10.44 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=https://github.com/PCRE2Project/pcre2/releases/download/$(PKG_NAME)-$(PKG_VERSION) -PKG_HASH:=e2a53984ff0b07dfdb5ae4486bbb9b21cca8e7df2434096cc9bf1b728c350bcb +PKG_HASH:=d34f02e113cf7193a1ebf2770d3ac527088d485d4e047ed10e5d217c6ef5de96 PKG_MAINTAINER:=Shane Peelar PKG_LICENSE:=BSD-3-Clause diff --git a/general/python/2to3/Makefile b/general/python/2to3/Makefile new file mode 100644 index 00000000..ec15eda1 --- /dev/null +++ b/general/python/2to3/Makefile @@ -0,0 +1,51 @@ +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=2to3 +PKG_VERSION:=1.0 +PKG_RELEASE:=1 + +PKG_MAINTAINER:=Gerald Kerma ,Jeffery To +PKG_LICENSE:=PSF-2.0 +PKG_LICENSE_FILES:=copyright + +PKG_HOST_ONLY:=1 +HOST_BUILD_DEPENDS:=python3/host + +include $(INCLUDE_DIR)/host-build.mk +include $(INCLUDE_DIR)/package.mk + +define Package/2to3 + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=2to3 binary using python3 + URL:=https://salsa.debian.org/cpython-team/python3-defaults + BUILDONLY:=1 +endef + +define Package/2to3/description + 2to3 is a Python program that reads Python 2.x source code and applies a + series of fixers to transform it into valid Python 3.x code. The standard + library contains a rich set of fixers that will handle almost all code. 2to3 + supporting library lib2to3 is, however, a flexible and generic library, so it + is possible to write your own fixers for 2to3. lib2to3 could also be adapted + to custom applications in which Python code needs to be edited automatically. +endef + +define Host/Install + $(INSTALL_DIR) $(1)/bin + $(INSTALL_BIN) ./files/2to3.py $(1)/bin/2to3 + $(SED) '1c#!$(STAGING_DIR_HOSTPKG)/bin/python3' $(1)/bin/2to3 +endef + +define Host/Clean + rm -f $(STAGING_DIR_HOSTPKG)/bin/2to3 +endef + +$(eval $(call HostBuild)) +$(eval $(call BuildPackage,2to3)) diff --git a/general/python/2to3/files/2to3.py b/general/python/2to3/files/2to3.py new file mode 100644 index 00000000..bf4194b6 --- /dev/null +++ b/general/python/2to3/files/2to3.py @@ -0,0 +1,5 @@ +#! /usr/bin/python3 +import sys +from lib2to3.main import main + +sys.exit(main("lib2to3.fixes")) diff --git a/general/python/2to3/files/copyright b/general/python/2to3/files/copyright new file mode 100644 index 00000000..b96d7cd7 --- /dev/null +++ b/general/python/2to3/files/copyright @@ -0,0 +1,319 @@ +This is the Debian GNU/Linux prepackaged version of the Python programming +language. Python was written by Guido van Rossum and others. + +This package was put together by Klee Dienes from +sources from ftp.python.org:/pub/python, based on the Debianization by +the previous maintainers Bernd S. Brentrup and +Bruce Perens. + +Current maintainer is Matthias Klose until the final +2.3 version is released. + + +Copyright notice (as found in LICENSE in the original source). +-------------------------------------------------------------- + +A. HISTORY OF THE SOFTWARE +========================== + +Python was created in the early 1990s by Guido van Rossum at Stichting +Mathematisch Centrum (CWI, see http://www.cwi.nl) in the Netherlands +as a successor of a language called ABC. Guido remains Python's +principal author, although it includes many contributions from others. + +In 1995, Guido continued his work on Python at the Corporation for +National Research Initiatives (CNRI, see http://www.cnri.reston.va.us) +in Reston, Virginia where he released several versions of the +software. + +In May 2000, Guido and the Python core development team moved to +BeOpen.com to form the BeOpen PythonLabs team. In October of the same +year, the PythonLabs team moved to Digital Creations (now Zope +Corporation, see http://www.zope.com). In 2001, the Python Software +Foundation (PSF, see http://www.python.org/psf/) was formed, a +non-profit organization created specifically to own Python-related +Intellectual Property. Zope Corporation is a sponsoring member of +the PSF. + +All Python releases are Open Source (see http://www.opensource.org for +the Open Source Definition). Historically, most, but not all, Python +releases have also been GPL-compatible; the table below summarizes +the various releases. + + Release Derived Year Owner GPL- + from compatible? (1) + + 0.9.0 thru 1.2 1991-1995 CWI yes + 1.3 thru 1.5.2 1.2 1995-1999 CNRI yes + 1.6 1.5.2 2000 CNRI no + 2.0 1.6 2000 BeOpen.com no + 1.6.1 1.6 2001 CNRI yes (2) + 2.1 2.0+1.6.1 2001 PSF no + 2.0.1 2.0+1.6.1 2001 PSF yes + 2.1.1 2.1+2.0.1 2001 PSF yes + 2.2 2.1.1 2001 PSF yes + 2.1.2 2.1.1 2002 PSF yes + 2.1.3 2.1.2 2002 PSF yes + 2.2.1 2.2 2002 PSF yes + 2.2.2 2.2.1 2002 PSF yes + 2.2.3 2.2.2 2003 PSF yes + 2.3 2.2.2 2002-2003 PSF yes + 2.3.1 2.3 2002-2003 PSF yes + 2.3.2 2.3.1 2002-2003 PSF yes + 2.3.3 2.3.2 2002-2003 PSF yes + 2.3.4 2.3.3 2004 PSF yes + 2.3.5 2.3.4 2005 PSF yes + 2.4 2.3 2004 PSF yes + 2.4.1 2.4 2005 PSF yes + 2.4.2 2.4.1 2005 PSF yes + 2.4.3 2.4.2 2006 PSF yes + 2.4.4 2.4.3 2006 PSF yes + 2.5 2.4 2006 PSF yes + 2.5.1 2.5 2007 PSF yes + 2.5.2 2.5.1 2008 PSF yes + 2.5.3 2.5.2 2008 PSF yes + 2.6 2.5 2008 PSF yes + 2.6.1 2.6 2008 PSF yes + 2.6.2 2.6.1 2009 PSF yes + 2.6.3 2.6.2 2009 PSF yes + 2.6.4 2.6.3 2009 PSF yes + 3.0 2.6 2008 PSF yes + 3.0.1 3.0 2009 PSF yes + 3.1 3.0.1 2009 PSF yes + 3.1.1 3.1 2009 PSF yes + +Footnotes: + +(1) GPL-compatible doesn't mean that we're distributing Python under + the GPL. All Python licenses, unlike the GPL, let you distribute + a modified version without making your changes open source. The + GPL-compatible licenses make it possible to combine Python with + other software that is released under the GPL; the others don't. + +(2) According to Richard Stallman, 1.6.1 is not GPL-compatible, + because its license has a choice of law clause. According to + CNRI, however, Stallman's lawyer has told CNRI's lawyer that 1.6.1 + is "not incompatible" with the GPL. + +Thanks to the many outside volunteers who have worked under Guido's +direction to make these releases possible. + + +B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON +=============================================================== + +PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 +-------------------------------------------- + +1. This LICENSE AGREEMENT is between the Python Software Foundation +("PSF"), and the Individual or Organization ("Licensee") accessing and +otherwise using this software ("Python") in source or binary form and +its associated documentation. + +2. Subject to the terms and conditions of this License Agreement, PSF hereby +grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, +analyze, test, perform and/or display publicly, prepare derivative works, +distribute, and otherwise use Python alone or in any derivative version, +provided, however, that PSF's License Agreement and PSF's notice of copyright, +i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 +Python Software Foundation; All Rights Reserved" are retained in Python alone or +in any derivative version prepared by Licensee. + +3. In the event Licensee prepares a derivative work that is based on +or incorporates Python or any part thereof, and wants to make +the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to Python. + +4. PSF is making Python available to Licensee on an "AS IS" +basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. Nothing in this License Agreement shall be deemed to create any +relationship of agency, partnership, or joint venture between PSF and +Licensee. This License Agreement does not grant permission to use PSF +trademarks or trade name in a trademark sense to endorse or promote +products or services of Licensee, or any third party. + +8. By copying, installing or otherwise using Python, Licensee +agrees to be bound by the terms and conditions of this License +Agreement. + + +BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0 +------------------------------------------- + +BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1 + +1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an +office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the +Individual or Organization ("Licensee") accessing and otherwise using +this software in source or binary form and its associated +documentation ("the Software"). + +2. Subject to the terms and conditions of this BeOpen Python License +Agreement, BeOpen hereby grants Licensee a non-exclusive, +royalty-free, world-wide license to reproduce, analyze, test, perform +and/or display publicly, prepare derivative works, distribute, and +otherwise use the Software alone or in any derivative version, +provided, however, that the BeOpen Python License is retained in the +Software, alone or in any derivative version prepared by Licensee. + +3. BeOpen is making the Software available to Licensee on an "AS IS" +basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE +SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS +AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY +DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +5. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +6. This License Agreement shall be governed by and interpreted in all +respects by the law of the State of California, excluding conflict of +law provisions. Nothing in this License Agreement shall be deemed to +create any relationship of agency, partnership, or joint venture +between BeOpen and Licensee. This License Agreement does not grant +permission to use BeOpen trademarks or trade names in a trademark +sense to endorse or promote products or services of Licensee, or any +third party. As an exception, the "BeOpen Python" logos available at +http://www.pythonlabs.com/logos.html may be used according to the +permissions granted on that web page. + +7. By copying, installing or otherwise using the software, Licensee +agrees to be bound by the terms and conditions of this License +Agreement. + + +CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1 +--------------------------------------- + +1. This LICENSE AGREEMENT is between the Corporation for National +Research Initiatives, having an office at 1895 Preston White Drive, +Reston, VA 20191 ("CNRI"), and the Individual or Organization +("Licensee") accessing and otherwise using Python 1.6.1 software in +source or binary form and its associated documentation. + +2. Subject to the terms and conditions of this License Agreement, CNRI +hereby grants Licensee a nonexclusive, royalty-free, world-wide +license to reproduce, analyze, test, perform and/or display publicly, +prepare derivative works, distribute, and otherwise use Python 1.6.1 +alone or in any derivative version, provided, however, that CNRI's +License Agreement and CNRI's notice of copyright, i.e., "Copyright (c) +1995-2001 Corporation for National Research Initiatives; All Rights +Reserved" are retained in Python 1.6.1 alone or in any derivative +version prepared by Licensee. Alternately, in lieu of CNRI's License +Agreement, Licensee may substitute the following text (omitting the +quotes): "Python 1.6.1 is made available subject to the terms and +conditions in CNRI's License Agreement. This Agreement together with +Python 1.6.1 may be located on the Internet using the following +unique, persistent identifier (known as a handle): 1895.22/1013. This +Agreement may also be obtained from a proxy server on the Internet +using the following URL: http://hdl.handle.net/1895.22/1013". + +3. In the event Licensee prepares a derivative work that is based on +or incorporates Python 1.6.1 or any part thereof, and wants to make +the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to Python 1.6.1. + +4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS" +basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. This License Agreement shall be governed by the federal +intellectual property law of the United States, including without +limitation the federal copyright law, and, to the extent such +U.S. federal law does not apply, by the law of the Commonwealth of +Virginia, excluding Virginia's conflict of law provisions. +Notwithstanding the foregoing, with regard to derivative works based +on Python 1.6.1 that incorporate non-separable material that was +previously distributed under the GNU General Public License (GPL), the +law of the Commonwealth of Virginia shall govern this License +Agreement only as to issues arising under or with respect to +Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this +License Agreement shall be deemed to create any relationship of +agency, partnership, or joint venture between CNRI and Licensee. This +License Agreement does not grant permission to use CNRI trademarks or +trade name in a trademark sense to endorse or promote products or +services of Licensee, or any third party. + +8. By clicking on the "ACCEPT" button where indicated, or by copying, +installing or otherwise using Python 1.6.1, Licensee agrees to be +bound by the terms and conditions of this License Agreement. + + ACCEPT + + +CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2 +-------------------------------------------------- + +Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam, +The Netherlands. All rights reserved. + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Stichting Mathematisch +Centrum or CWI not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO +THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE +FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT +OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + +py3compile, py3clean and debpython module: +========================================== +Copyright © 2010-2013 Piotr Ożarowski + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/general/python/Flask/Makefile b/general/python/Flask/Makefile new file mode 100644 index 00000000..70c386ae --- /dev/null +++ b/general/python/Flask/Makefile @@ -0,0 +1,42 @@ +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=Flask +PKG_VERSION:=2.0.2 +PKG_RELEASE:=6 + +PYPI_NAME:=$(PKG_NAME) +PKG_HASH:=7b2fb8e934ddd50731893bdcdb00fc8c0315916f9fcd50d22c7cc1a95ab634e2 + +PKG_MAINTAINER:=Michal Vasilek +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=LICENSE.rst +PKG_CPE_ID:=cpe:/a:palletsprojects:flask + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-flask + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Flask + URL:=https://palletsprojects.com/p/flask/ + DEPENDS:=+python3-asyncio +python3-click +python3-codecs +python3-decimal \ + +python3-itsdangerous +python3-jinja2 +python3 +python3-logging \ + +python3-markupsafe +python3-multiprocessing +python3-setuptools \ + +python3-werkzeug +endef + +define Package/python3-flask/description + Flask is a microframework for Python based on Werkzeug, Jinja 2 and good + intentions. And before you ask: It.s BSD licensed! +endef + +$(eval $(call Py3Package,python3-flask)) +$(eval $(call BuildPackage,python3-flask)) +$(eval $(call BuildPackage,python3-flask-src)) diff --git a/general/python/README.md b/general/python/README.md new file mode 100644 index 00000000..2a05d3c0 --- /dev/null +++ b/general/python/README.md @@ -0,0 +1,398 @@ +# Python packages folder + +## Table of contents + +1. [Description](#description) +2. [Introduction](#introduction) +3. [Python 2 end-of-life](#python-2-end-of-life) +4. [Using Python in external/other package feeds](#using-python-in-externalother-package-feeds) +5. [Build considerations](#build-considerations) +6. [General folder structure](#general-folder-structure) +7. [Building a Python package](#building-a-python-package) + 1. [Include python3-package.mk](#include-python3-packagemk) + 2. [Add Package/ OpenWrt definitions](#add-packagepkg_name-openwrt-definitions) + 3. [Python package dependencies](#python-package-dependencies) + 4. [Wrapping things up so that they build](#wrapping-things-up-so-that-they-build) + 5. [Customizing things](#customizing-things) + 6. [Host-side Python packages for build](#host-side-python-packages-for-build) + +## Description + +This section describes specifics for the Python packages that are present in this repo, and how things are structured. + +In terms of license, contributing guide, etc, all of that information is described in the top [README.md](../../README.md) file, and it applies here as well. This document attempts to cover only technical aspects of Python packages, and maybe some explanations about how things are (and why they are as they are). + +## Introduction + +This sub-tree came to exist after a number of contributions (Python packages) were made to this repo, and the [lang](../) subtree grew to a point where a decision was made to move all Python packages under [lang/python](./). + +It contains the Python 3 interpreter and Python packages. Most of the Python packages are downloaded from [pypi.org](https://pypi.org/). Python packages from pypi.org are typically preferred when adding new packages. + +If more packages (than the ones packaged here) are needed, they can be downloaded via [pip](https://pip.pypa.io). Note that the versions of `pip` & `setuptools` [available in this repo] are the ones that are packaged inside the Python package (yes, Python comes packaged with `pip` & `setuptools`). + +## Python 2 end-of-life + +Python 2 [will not be maintained past 2020](https://www.python.org/dev/peps/pep-0373/). All Python 2 packages have been removed from the packages feed (this repo) and archived in the [abandoned packages feed](https://github.com/openwrt/packages-abandoned). + +## Using Python in external/other package feeds + +In the feeds.conf (or feeds.conf.default file, whatever is preferred), the packages repo should be present. + +Example +``` +src-git packages https://git.openwrt.org/feed/packages.git +src-git luci https://git.openwrt.org/project/luci.git +src-git routing https://git.openwrt.org/feed/routing.git +src-git telephony https://git.openwrt.org/feed/telephony.git +# +# +src-git someotherfeed https://github.com// +``` + +Assuming that there are Python packages in the ``, they should include `python3-package.mk` like this: +``` +include $(TOPDIR)/feeds/packages/lang/python/python3-package.mk +``` + +Same rules apply for `python3-package.mk` as the Python packages in this repo. + +**One important consideration:**: if the local name is not `packages`, it's something else, like `openwrt-packages`. And in `feeds.conf[.default]` it's: +``` +src-git openwrt-packages https://git.openwrt.org/feed/packages.git +``` + +Then, the inclusions also change: +``` +include $(TOPDIR)/feeds/openwrt-packages/lang/python/python3-package.mk +``` + +Each maintainer[s] of external packages feeds is responsible for the local name, and relative inclusion path back to this feed (which is named `packages` by default). + +In case there is a need/requirement such that the local package feed is named something else than `packages`, one approach to make the package flexible to change is: + +``` +PYTHON3_PACKAGE_MK:=$(wildcard $(TOPDIR)/feeds/*/lang/python/python3-package.mk) + +# verify that there is only one single file returned +ifneq (1,$(words $(PYTHON3_PACKAGE_MK))) +ifeq (0,$(words $(PYTHON3_PACKAGE_MK))) +$(error did not find python3-package.mk in any feed) +else +$(error found multiple python3-package.mk files in the feeds) +endif +else +$(info found python3-package.mk at $(PYTHON3_PACKAGE_MK)) +endif + +include $(PYTHON3_PACKAGE_MK) +``` + +This should solve the corner-case where the `python3-package.mk` can be in some other feed, or if the packages feed will be named something else locally. + +## Build considerations + +In order to build the Python interpreter, a host Python interpreter needs to be built, in order to process some of the build for the target Python build. The host Python interpreter is also needed so that Python bytecodes are generated, so the host interpreter needs to be the exact version as on the target. And finally, the host Python interpreter also provides pip, so that it may be used to install some Python packages that are required to build other Python packages. +That's why you'll also see a Python build & staging directories. + +As you're probably thinking, this sounds [and is] somewhat too much complication [just for packaging], but the status of things is-as-it-is, and it's probably much worse than what's currently visible on the surface [with respect to packaging Python & packages]. + +As mentioned earlier, Python packages are shipped with bytecodes, and the reason for this is simply performance & size. +The thought/discussion matrix derives a bit like this: +* shipping both Python source-code & bytecodes takes too much space on some devices ; Python source code & byte-code take about similar disk-size +* shipping only Python source code has a big performance penalty [on some lower end systems] ; something like 500 msecs (Python source-only) -> 70 msecs (Python byte-codes) time reduction for a simple "Hello World" script +* shipping only Python byte-codes seems like a good trade-off, and this means that `python3-src` can be provided for people that want the source code + +By default, automatic Python byte-code generation is disabled when running a Python script, in order to prevent a disk from accidentally filling up. Since some disks reside in RAM, this also means not filling up the RAM. If someone wants to convert Python source to byte-code then he/she is free to compile it [directly on the device] manually via the Python interpreter & library. + +## General folder structure + +The basis of all these packages is: +* [lang/python/python3](./python3) - The Python 3.x.y interpreter + +This is a normal OpenWrt package, which will build the Python interpreter. This also provides `python3-pip` & `python3-setuptools`. Each Python package is actually split into multiple sub-packages [e.g. python3-email, python3-sqlite3, etc]. This can be viewed inside [lang/python/python3/files](./python3/files). + +The reason for this splitting, is purely to offer a way for some people to package Python in as-minimal-as-possible-and-still-runable way, and also to be somewhat maintainable when packaging. A standard Python installation can take ~20-30 MBs of disk, which can be somewhat big for some people, so there is the `python3-base` package which brings that down to ~5 MBs. This seems to be good enough (and interesting) for a number of people. + +The Python interpreter is structured like this: +* `python3-base`, which is just the minimal package to startup Python and run basic commands +* `python3` is a meta-package, which installs almost everything (python3-base [plus] Python library [minus] some unit-tests & some windows-y things) +* `python3-light` is `python3` [minus] packages that are in [lang/python/python3/files](./python3/files) ; the size of this package may be sensible (and interesting) to another group of people + +All other Python packages (aside from the intepreter) typically use these files: +* **python3-host.mk** - this file contains paths and build rules for running the Python interpreter on the host-side; they also provide paths to host interprete, host Python lib-dir & so on +* **python3-package.mk** + * includes **python3-host.mk** + * contains all the default build rules for Python packages; these will be detailed below in the [Building a Python package](#building-a-python-package) section + +**Note** that Python packages don't need to use these files (i.e. `python3-package.mk` & `python3-host.mk`), but they do provide some ease-of-use & reduction of duplicate code. And they do contain some learned-lessons about packaging Python packages, so it's a good idea to use them. + +## Building a Python package + +### Include python3-package.mk + +Add this after `include $(INCLUDE_DIR)/package.mk` +``` +include ../python3-package.mk +``` + +This will make sure that build rules for Python can be specified and picked up for build. + +### Include pypi.mk (optional) + +`pypi.mk` is an include file that makes downloading package source code from [pypi.org](https://pypi.org/) simpler. + +To use `pypi.mk`, add this **before** `include $(INCLUDE_DIR)/package.mk`: +``` +include ../pypi.mk +``` + +`pypi.mk` has several `PYPI_*` variables that can/must be set (see below); these should be set before `pypi.mk` is included, i.e. before the `include ../pypi.mk` line. + +`pypi.mk` also provides default values for `PKG_SOURCE` and `PKG_SOURCE_URL`, so these variables may be omitted. + +Required variables: + +* `PYPI_NAME`: Package name on pypi.org. This should match the PyPI name exactly. + + For example (from the `python-yaml` package): + ``` + PYPI_NAME:=PyYAML + ``` + +Optional variables: + +* `PYPI_SOURCE_NAME`: Package name component of the source tarball filename + Default: Same value as `PYPI_NAME` + +* `PYPI_SOURCE_EXT`: File extension of the source tarball filename + Default: `tar.gz` + +`pypi.mk` constructs the default `PKG_SOURCE` value from these variables (and `PKG_VERSION`): +``` +PKG_SOURCE?=$(PYPI_SOURCE_NAME)-$(PKG_VERSION).$(PYPI_SOURCE_EXT) +``` + +### Add Package/ OpenWrt definitions + +This part is similar to default OpenWrt packages. + +Example: +``` +define Package/python3-lxml + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Pythonic XML processing library + URL:=https://lxml.de + DEPENDS:=+python3-light +libxml2 +libxslt +libexslt +endef + +define Package/python3-lxml/description + The lxml XML toolkit is a Pythonic binding + for the C libraries libxml2 and libxslt. +endef +``` + +Some considerations here (based on the example above): +* typically the package is named `Package/python3-` ; this convention makes things easier to follow, though it could work without naming things this way +* `TITLE` can be something a bit more verbose/neat ; typically the name is short as seen above + +### Python package dependencies + +Aside from other libraries and programs, every Python package will depend on at least one of these three types of packages: + +* The Python interpreter: All Python packages should depend on one of these three interpreter packages: + + * `python3-light` is the best default for most Python packages. + + * `python3-base` should only be used as a dependency if you are certain the bare interpreter is sufficient. + + * `python3` is useful if many (more than three) Python standard library packages are needed. + +* Python standard library packages: As noted above, many parts of the Python standard library are packaged separate from the Python interpreter. These packages are defined by the files in [lang/python/python3/files](./python3/files). + + To find out which of these separate standard library packages are necessary, after completing a draft Makefile (including the `$(eval ...)` lines described in the next section), run `make` with the `configure` target and `PY3=stdlib V=s` in the command line. For example: + + ``` + make package/python-lxml/configure PY3=stdlib V=s + ``` + + If the package has been built previously, include the `clean` target to trigger configure again: + + ``` + make package/python-lxml/{clean,configure} PY3=stdlib V=s + ``` + + This will search the package for module imports and generate a list of suggested dependencies. Some of the found imports may be false positives, e.g. in example or test files, so examine the matches for more information. + +* Other Python packages: The easiest way to find these dependencies is to look for the `install_requires` keyword inside the package's `setup.py` file (it will be a keyword argument to the `setup()` function). This will be a list of run-time dependencies for the package. + + There may already be packages in the packages feed that provide these dependencies. If not, they will need to be packaged for your Python package to function correctly. + + Any packages in a `setup_requires` keyword argument are build-time dependencies that may need to be installed on the host (host Python inside of OpenWrt buildroot, not system Python that is part of the outer computer system). To ensure these build-time dependencies are present, see [Host-side Python packages for build](#host-side-python-packages-for-build). (Note that Setuptools is already installed as part of host Python.) + +### Wrapping things up so that they build + +If all the above prerequisites have been met, all that's left is: + +``` +$(eval $(call Py3Package,python3-lxml)) +$(eval $(call BuildPackage,python3-lxml)) +``` + +The `$(eval $(call Py3Package,python3-lxml))` part will instantiate all the default Python build rules so that the final Python package is packaged into an OpenWrt. +And `$(eval $(call BuildPackage,python3-lxml))` will bind all the rules generated with `$(eval $(call Py3Package,python3-lxml))` into the OpenWrt build system. + +These packages will contain byte-codes and binaries (shared libs & other stuff). + +If a user wishes to ship source code, adding one more line creates one more package that ship Python source code: +``` +$(eval $(call Py3Package,python3-lxml)) +$(eval $(call BuildPackage,python3-lxml)) +$(eval $(call BuildPackage,python3-lxml-src)) +``` + +The name `*-src` must be the Python package name; so for `python3-lxml-src` a equivalent `python3-lxml` name must exist. + +### Customizing things + +Some packages need custom build rules (because they do). + +The default package build and install processes are defined in `python3-package.mk`. + +#### Building + +The default build process calls `setup.py install` inside the directory where the Python source package is extracted (`PKG_BUILD_DIR`). This "installs" the Python package to an intermediate location (`PKG_INSTALL_DIR`) where it is used by the default install process. + +There are several Makefile variables that can be used to customize this process (all optional): + +* `PYTHON3_PKG_SETUP_DIR`: Path where `setup.py` can be found, relative to the package directory (`PKG_BUILD_DIR`). + Default: empty value (`setup.py` is in the package directory) +* `PYTHON3_PKG_SETUP_VARS`: Additional environment variables to set for the call to `setup.py`. Should be in the form of `VARIABLE1=value VARIABLE2=value ...`. + Default: empty value +* `PYTHON3_PKG_SETUP_GLOBAL_ARGS`: Additional command line arguments to pass to `setup.py`, before / in front of the `install` command. + Default: empty value +* `PYTHON3_PKG_SETUP_ARGS`: Additional command line arguments to pass to `setup.py`, after the `install` command. + Default: `--single-version-externally-managed` + +Conceptually, these variables are used in this way: + +``` +cd $(PKG_BUILD_DIR)/$(PYTHON3_PKG_SETUP_DIR) +$(PYTHON3_PKG_SETUP_VARS) python3 setup.py $(PYTHON3_PKG_SETUP_GLOBAL_ARGS) install $(PYTHON3_PKG_SETUP_ARGS) +``` + +The default build process can be completely overridden by defining a custom `Py3Build/Compile` rule in the package Makefile. + +#### Installing + +The default install process copies some/all of the files from `PKG_INSTALL_DIR`, placed there by the build process, to a location passed to the install rule as the first argument (`$(1)`). The OpenWrt build system will then take those files and create the actual .ipk package archives. + +This default process uses 2 build rules: +* `Py3Package//filespec` which are Python library files relative to `/usr/lib/pythonX.Y` ; by default this is `/usr/lib/python$(PYTHON3_VERSION)/site-packages` (`PYTHON3_PKG_DIR`) ; most Python packages generate files that get installed in this sub-folder +* `Py3Package//install` is similar to `Package//install` ; this allows binary (or other files) to be installed on the target + +Both the 2 above rules generate a `Package//install` build rule, which gets picked up by the build system. Both can be used together (they are not mutually exclusive), and provide a good enough flexibility for specifying Python packages. + +The `Py3Package//filespec` rule contains one or more lines of the following format (whitespace added for clarity): + +``` + | | +``` + +The initial character controls the action that will be taken: + +* `+`: Install the given path. If the path is a directory, all files and subdirectories inside are installed. + * If file permissions is specified (optional), then the file or directory (and all files and subdirectories) are assigned the given permissions; if omitted, then the file or directory retains its original permissions. +* `-`: Remove the given path. Useful when most of a directory should be installed except for a few files or subdirectories. + * File permissions is not used / ignored in this case. +* `=`: Assign the given file permissions to the given path. File permissions is required in this case. + +As mentioned, the default `Py3Package//filespec` installs `PYTHON3_PKG_DIR`: + +``` +define Py3Package/python3-example/filespec ++|$(PYTHON3_PKG_DIR) +endef +``` + +If the package installs a `example_package` directory inside `PYTHON3_PKG_DIR`, and there is an `examples` directory and `test_*.py` files that can be omitted to save space, this can be specified as: + +``` +define Py3Package/python3-example/filespec ++|$(PYTHON3_PKG_DIR) +-|$(PYTHON3_PKG_DIR)/example_package/examples +-|$(PYTHON3_PKG_DIR)/example_package/test_*.py +endef +``` + +### Host-side Python packages for build + +These can be installed via pip and ideally they should only be installed like this, because it's a bit simpler than running them through the OpenWrt build system. + +#### Requirements files + +All host-side Python packages are installed with pip using [requirements files](https://pip.pypa.io/en/stable/user_guide/#requirements-files), with [hash-checking mode](https://pip.pypa.io/en/stable/reference/pip_install/#hash-checking-mode) enabled. These requirements files are stored in the [host-pip-requirements](./host-pip-requirements) directory. + +Each requirements file is named after the Python package it installs and contains the package's pinned version and `--hash` option. The `--hash` option value is the SHA256 hash of the package's source tarball; this value can be found on [pypi.org](https://pypi.org/). + +For example, the requirements file for setuptools-scm ([setuptools-scm.txt](./host-pip-requirements/setuptools-scm.txt)) contains: + +``` +setuptools-scm==4.1.2 --hash=sha256:a8994582e716ec690f33fec70cca0f85bd23ec974e3f783233e4879090a7faa8 +``` + +If the Python package to be installed depends on other Python packages, those dependencies, with their pinned versions and `--hash` options, also need to be specified in the requirements file. For instance, [cffi.txt](./host-pip-requirements/cffi.txt) includes information for pycparser because pycparser is a dependency of cffi and will be installed with cffi. + +There are two types of requirements files in [host-pip-requirements](./host-pip-requirements): + +* Installs the latest version of a Python package. + + A requirements file of this type is named with the package name only (for example, [setuptools-scm.txt](./host-pip-requirements/setuptools-scm.txt)) and is used when there is no strict version requirement. + + These files will be updated as newer versions of the Python packages are available. + +* Installs a specific version of a Python package. + + A requirements file of this type is named with the package name and version number (for example, [Django-1.11.txt](./host-pip-requirements/Django-1.11.txt)) and is used when a specific (usually older) version is required. + + Installing the latest versions of packages is preferred over specific versions whenever possible. + +#### Installing host-side Python packages + +Set `HOST_PYTHON3_PACKAGE_BUILD_DEPENDS` to the names of one or more requirements files in [host-pip-requirements](./host-pip-requirements), without the directory path or ".txt" extension. + +For example: + +``` +HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:=setuptools-scm +``` + +The Python package will be installed in `$(STAGING_DIR_HOSTPKG)/lib/pythonX.Y/site-packages`. + +#### Non-Python packages installing host-side Python packages + +Non-Python packages can also install host-side Python packages using the same mechanism: + +* Set `HOST_PYTHON3_PACKAGE_BUILD_DEPENDS` (see above for details). + +* Include `python3-package.mk` (set `PYTHON3_PKG_BUILD:=0` to avoid using the default Python package build recipes). + +* Call `Py3Build/InstallBuildDepends` to initiate the installation. + +For example: + +``` +PYTHON3_PKG_BUILD:=0 +HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:=setuptools-scm + +include $(INCLUDE_DIR)/package.mk +include ../../lang/python/python3-package.mk +# If outside of the packages feed: +# include $(TOPDIR)/feeds/packages/lang/python/python3-package.mk + +define Build/Compile + $(call Py3Build/InstallBuildDepends) + $(call Build/Compile/Default) +endef +``` diff --git a/general/python/django-restframework/Makefile b/general/python/django-restframework/Makefile new file mode 100644 index 00000000..eb40c1f5 --- /dev/null +++ b/general/python/django-restframework/Makefile @@ -0,0 +1,40 @@ +# +# Copyright (C) 2007-2017 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=django-restframework +PKG_VERSION:=3.15.1 +PKG_RELEASE:=1 + +PYPI_NAME:=djangorestframework +PKG_HASH:=f88fad74183dfc7144b2756d0d2ac716ea5b4c7c9840995ac3bfd8ec034333c1 + +PKG_MAINTAINER:=Alexandru Ardelean +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=LICENSE.md + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-django-restframework + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Web APIs for Django, made easy. + URL:=https://www.django-rest-framework.org + DEPENDS:=+python3 +django +endef + +define Package/python3-django-restframework/description + Web APIs for Django, made easy. +endef + +$(eval $(call Py3Package,python3-django-restframework)) +$(eval $(call BuildPackage,python3-django-restframework)) +$(eval $(call BuildPackage,python3-django-restframework-src)) diff --git a/general/python/django/Makefile b/general/python/django/Makefile new file mode 100644 index 00000000..b33906e8 --- /dev/null +++ b/general/python/django/Makefile @@ -0,0 +1,48 @@ +# +# Copyright (C) Alexandru Ardelean +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=django +PKG_VERSION:=5.0.6 +PKG_RELEASE:=1 + +PYPI_NAME:=Django +PKG_HASH:=ff1b61005004e476e0aeea47c7f79b85864c70124030e95146315396f1e7951f + +PKG_MAINTAINER:=Alexandru Ardelean , Peter Stadler +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=LICENSE LICENSE.python +PKG_CPE_ID:=cpe:/a:djangoproject:django + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-django + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=The web framework for perfectionists with deadlines. + URL:=https://www.djangoproject.com/ + DEPENDS:= +python3 +python3-pytz +python3-sqlparse +python3-asgiref + CONFLICTS:=python3-django1 + PROVIDES:=django +endef + +define Package/python3-django/description + The web framework for perfectionists with deadlines. +endef + +define Py3Package/python3-django/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/django-admin $(1)/usr/bin +endef + +$(eval $(call Py3Package,python3-django)) +$(eval $(call BuildPackage,python3-django)) +$(eval $(call BuildPackage,python3-django-src)) diff --git a/general/python/django/test.sh b/general/python/django/test.sh new file mode 100644 index 00000000..40eecc17 --- /dev/null +++ b/general/python/django/test.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +[ "$1" = "python3-django" ] || exit 0 + +GOT_VER=$(/usr/bin/django-admin version) +[ "$GOT_VER" = "$2" ] || { + echo "Incorrect version: expected '$2' ; obtained '$GOT_VER'" + exit 1 +} + +python3 - << EOF +import sys +import django + +if (django.__version__) != "$GOT_VER": + print("Wrong version: " + django.__version__) + sys.exit(1) + +sys.exit(0) +EOF + diff --git a/general/python/flup/Makefile b/general/python/flup/Makefile new file mode 100644 index 00000000..a0b2051b --- /dev/null +++ b/general/python/flup/Makefile @@ -0,0 +1,40 @@ +# +# Copyright (C) 2007-2016 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=flup +PKG_VERSION:=1.0.3 +PKG_RELEASE:=4 + +PYPI_NAME:=flup +PKG_HASH:=5eb09f26eb0751f8380d8ac43d1dfb20e1d42eca0fa45ea9289fa532a79cd159 + +PKG_MAINTAINER:=Alexandru Ardelean , Josef Schlehofer +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=PKG-INFO + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-flup + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Random assortment of WSGI servers + URL:=https://www.saddi.com/software/flup/ + DEPENDS:=+python3-light +python3-logging +endef + +define Package/python3-flup/description + Random assortment of WSGI servers. +endef + +$(eval $(call Py3Package,python3-flup)) +$(eval $(call BuildPackage,python3-flup)) +$(eval $(call BuildPackage,python3-flup-src)) diff --git a/general/python/itsdangerous/Makefile b/general/python/itsdangerous/Makefile new file mode 100644 index 00000000..f6408bf0 --- /dev/null +++ b/general/python/itsdangerous/Makefile @@ -0,0 +1,38 @@ +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=itsdangerous +PKG_VERSION:=2.1.2 +PKG_RELEASE:=1 + +PYPI_NAME:=$(PKG_NAME) +PKG_HASH:=5dbbc68b317e5e42f327f9021763545dc3fc3bfe22e6deb96aaf1fc38874156a + +PKG_MAINTAINER:=Jeffery To +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-itsdangerous + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=ItsDangerous + URL:=https://palletsprojects.com/p/itsdangerous/ + DEPENDS:=+python3-light +endef + +define Package/python3-itsdangerous/description + Various helpers to pass trusted data to untrusted environments and back. +endef + +$(eval $(call Py3Package,python3-itsdangerous)) +$(eval $(call BuildPackage,python3-itsdangerous)) +$(eval $(call BuildPackage,python3-itsdangerous-src)) + diff --git a/general/python/micropython-lib/Makefile b/general/python/micropython-lib/Makefile new file mode 100644 index 00000000..d5fdd77f --- /dev/null +++ b/general/python/micropython-lib/Makefile @@ -0,0 +1,135 @@ +# +# Copyright (C) 2008-2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=micropython-lib +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/micropython/micropython-lib.git +PKG_SOURCE_VERSION:=d8e163bb5f3ef45e71e145c27bc4f207beaad70f +PKG_SOURCE_DATE:=20231031 +PKG_MIRROR_HASH:=311651a719ae645d3e40c3c8ebf706fa2e964ac1455d84bee73606ec6d7c13a2 + +PKG_MAINTAINER:=Jeffery To +PKG_LICENSE:=MIT Python-2.0.1 +PKG_LICENSE_FILES:=LICENSE + +PKG_BUILD_DEPENDS:=python3/host +PKG_BUILD_PARALLEL:=1 + +# keep in sync with micropython (MPY_VERSION in py/persistentcode.h) +MICROPYTHON_MPY_VERSION:=6 + +include $(INCLUDE_DIR)/package.mk + +define Package/micropython-lib/Default + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=MicroPython package repository + URL:=https://github.com/micropython/micropython-lib +endef + +define Package/micropython-lib +$(call Package/micropython-lib/Default) + DEPENDS:=+micropython +endef + +define Package/micropython-lib-src +$(call Package/micropython-lib/Default) + TITLE+= (sources) +endef + +define Package/micropython-lib-unix +$(call Package/micropython-lib/Default) + TITLE+= - Unix port packages + DEPENDS:=+micropython +libpcre2 +librt +libsqlite3 +endef + +define Package/micropython-lib-unix-src +$(call Package/micropython-lib/Default) + TITLE+= - Unix port packages (sources) +endef + +define Package/micropython-lib/Default/description +This is a repository of packages designed to be useful for writing +MicroPython applications. +endef + +define Package/micropython-lib/description +$(call Package/micropython-lib/Default/description) + +This contains packages common to all MicroPython ports. +endef + +define Package/micropython-lib-src/description +$(call Package/micropython-lib/Default/description) + +This contains source files for packages common to all MicroPython ports. +endef + +define Package/micropython-lib-unix/description +$(call Package/micropython-lib/Default/description) + +This contains packages specific to the MicroPython Unix port. +endef + +define Package/micropython-lib-unix-src/description +$(call Package/micropython-lib/Default/description) + +This contains source files for packages specific to the MicroPython Unix +port. +endef + +MP_INSTALLDEV_PATH:=$(STAGING_DIR)/host/lib/micropython + +define MicroPythonLib/Compile + cd "$(PKG_BUILD_DIR)" && python3 tools/build.py \ + --hash-prefix 64 \ + --micropython "$(MP_INSTALLDEV_PATH)" \ + --mpy-cross "$(MP_INSTALLDEV_PATH)/mpy-cross/build/mpy-cross" \ + --output "$(PKG_BUILD_DIR)/$(strip $(1))" \ + $(2) +endef + +define MicroPythonLib/Install + python3 install.py \ + --input "$(PKG_BUILD_DIR)/$(strip $(1))" \ + --output "$(strip $(3))" \ + --version "$(strip $(2))" +endef + +define Build/Compile + $(call MicroPythonLib/Compile) + $(call MicroPythonLib/Compile,unix-ffi-index,--unix-ffi) +endef + +define Package/micropython-lib/install + $(call MicroPythonLib/Install,,$(MICROPYTHON_MPY_VERSION),$(1)/usr/lib/micropython) +endef + +define Package/micropython-lib-src/install + $(call MicroPythonLib/Install,,py,$(1)/usr/lib/micropython) +endef + +define Package/micropython-lib-unix/install + $(call MicroPythonLib/Install,unix-ffi-index,$(MICROPYTHON_MPY_VERSION),$(1)/usr/lib/micropython/unix) + + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) ./files/micropython-unix $(1)/usr/bin/ +endef + +define Package/micropython-lib-unix-src/install + $(call MicroPythonLib/Install,unix-ffi-index,py,$(1)/usr/lib/micropython/unix) +endef + +$(eval $(call BuildPackage,micropython-lib)) +$(eval $(call BuildPackage,micropython-lib-src)) +$(eval $(call BuildPackage,micropython-lib-unix)) +$(eval $(call BuildPackage,micropython-lib-unix-src)) diff --git a/general/python/micropython-lib/files/micropython-unix b/general/python/micropython-lib/files/micropython-unix new file mode 100644 index 00000000..a0c372cf --- /dev/null +++ b/general/python/micropython-lib/files/micropython-unix @@ -0,0 +1,3 @@ +#!/bin/sh +export MICROPYPATH=".frozen:~/.micropython/lib:/usr/lib/micropython/unix:/usr/lib/micropython" +exec micropython "$@" diff --git a/general/python/micropython-lib/install.py b/general/python/micropython-lib/install.py new file mode 100644 index 00000000..f1070723 --- /dev/null +++ b/general/python/micropython-lib/install.py @@ -0,0 +1,62 @@ +#!/usr/bin/env python3 +# +# Copyright (C) 2023 Jeffery To +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +import json +import os +import re +import shutil +import sys + + +def install(input_path, mpy_version, output_path): + index_json_path = os.path.join(input_path, "index.json") + files = {} + + with open(index_json_path) as f: + index_json = json.load(f) + + for p in index_json["packages"]: + package_name = p["name"] + package_json_path = os.path.join(input_path, "package", mpy_version, package_name, "latest.json") + + with open(package_json_path) as f: + package_json = json.load(f) + + for file_name, file_hash in package_json["hashes"]: + if file_name in files: + if file_hash != files[file_name]: + print("File name/hash collision:", package_name, file=sys.stderr) + print(" File: ", file_name, file=sys.stderr) + print(" Curent hash: ", file_hash, file=sys.stderr) + print(" Previous hash: ", files[file_name], file=sys.stderr) + sys.exit(1) + else: + files[file_name] = file_hash + + for file_name, file_hash in files.items(): + in_file_path = os.path.join(input_path, "file", file_hash[:2], file_hash) + out_file_path = os.path.join(output_path, file_name) + + os.makedirs(os.path.dirname(out_file_path), exist_ok=True) + shutil.copy2(in_file_path, out_file_path) + + +def main(): + import argparse + + cmd_parser = argparse.ArgumentParser(description="Install compiled micropython-lib packages.") + cmd_parser.add_argument("--input", required=True, help="input directory") + cmd_parser.add_argument("--version", required=True, help="mpy version to install") + cmd_parser.add_argument("--output", required=True, help="output directory") + args = cmd_parser.parse_args() + + install(args.input, args.version, args.output) + + +if __name__ == "__main__": + main() diff --git a/general/python/micropython-lib/patches/001-build-unix-ffi.patch b/general/python/micropython-lib/patches/001-build-unix-ffi.patch new file mode 100644 index 00000000..4dfaca6f --- /dev/null +++ b/general/python/micropython-lib/patches/001-build-unix-ffi.patch @@ -0,0 +1,37 @@ +--- a/tools/build.py ++++ b/tools/build.py +@@ -284,7 +284,7 @@ def _update_index_package_metadata(index + index_package_json["versions"][v].append(metadata.version) + + +-def build(output_path, hash_prefix_len, mpy_cross_path): ++def build(output_path, unix_ffi, hash_prefix_len, mpy_cross_path): + import manifestfile + import mpy_cross + +@@ -310,7 +310,7 @@ def build(output_path, hash_prefix_len, + + # For now, don't process unix-ffi. In the future this can be extended to + # allow a way to request unix-ffi packages via mip. +- lib_dirs = ["micropython", "python-stdlib", "python-ecosys"] ++ lib_dirs = ["unix-ffi"] if unix_ffi else ["micropython", "python-stdlib", "python-ecosys"] + + mpy_version, _mpy_sub_version = mpy_cross.mpy_version(mpy_cross=mpy_cross_path) + mpy_version = str(mpy_version) +@@ -438,6 +438,7 @@ def main(): + + cmd_parser = argparse.ArgumentParser(description="Compile micropython-lib for serving to mip.") + cmd_parser.add_argument("--output", required=True, help="output directory") ++ cmd_parser.add_argument("--unix-ffi", action="store_true", help="process unix-ffi packages") + cmd_parser.add_argument("--hash-prefix", default=8, type=int, help="hash prefix length") + cmd_parser.add_argument("--mpy-cross", default=None, help="optional path to mpy-cross binary") + cmd_parser.add_argument("--micropython", default=None, help="path to micropython repo") +@@ -447,7 +448,7 @@ def main(): + sys.path.append(os.path.join(args.micropython, "tools")) # for manifestfile + sys.path.append(os.path.join(args.micropython, "mpy-cross")) # for mpy_cross + +- build(args.output, hash_prefix_len=max(4, args.hash_prefix), mpy_cross_path=args.mpy_cross) ++ build(args.output, args.unix_ffi, hash_prefix_len=max(4, args.hash_prefix), mpy_cross_path=args.mpy_cross) + + + if __name__ == "__main__": diff --git a/general/python/micropython-lib/patches/002-add-unix-ffi-os-path.patch b/general/python/micropython-lib/patches/002-add-unix-ffi-os-path.patch new file mode 100644 index 00000000..5ebc6820 --- /dev/null +++ b/general/python/micropython-lib/patches/002-add-unix-ffi-os-path.patch @@ -0,0 +1,53 @@ +From dcce62dd525cf0f8e572e56a8990aea7ec2f0ade Mon Sep 17 00:00:00 2001 +From: Jeffery To +Date: Tue, 30 May 2023 23:47:59 +0800 +Subject: [PATCH] unix-ffi/os-path: Add unix-ffi version of `os-path` package. + +This package reuses the code from the python-stdlib version of `os-path` +but requires the unix-ffi version of `os`. + +This also updates `glob` to require this version of `os-path`. + +Signed-off-by: Jeffery To +--- + unix-ffi/glob/manifest.py | 2 +- + unix-ffi/os-path/manifest.py | 6 ++++++ + unix-ffi/os/os/__init__.py | 6 ++++++ + 3 files changed, 13 insertions(+), 1 deletion(-) + create mode 100644 unix-ffi/os-path/manifest.py + +--- a/unix-ffi/glob/manifest.py ++++ b/unix-ffi/glob/manifest.py +@@ -1,7 +1,7 @@ + metadata(version="0.5.2") + + require("os", unix_ffi=True) +-require("os-path") ++require("os-path", unix_ffi=True) + require("re", unix_ffi=True) + require("fnmatch") + +--- /dev/null ++++ b/unix-ffi/os-path/manifest.py +@@ -0,0 +1,6 @@ ++metadata(version="0.1.4") ++ ++# Originally written by Paul Sokolovsky. ++ ++require("os", unix_ffi=True) ++package("os", base_path="../../python-stdlib/os-path") +--- a/unix-ffi/os/os/__init__.py ++++ b/unix-ffi/os/os/__init__.py +@@ -5,6 +5,12 @@ import stat as stat_ + import ffilib + import uos + ++# Provide optional dependencies (which may be installed separately). ++try: ++ from . import path ++except ImportError: ++ pass ++ + R_OK = const(4) + W_OK = const(2) + X_OK = const(1) diff --git a/general/python/micropython-lib/patches/003-add-unix-ffi-uu.patch b/general/python/micropython-lib/patches/003-add-unix-ffi-uu.patch new file mode 100644 index 00000000..363fae39 --- /dev/null +++ b/general/python/micropython-lib/patches/003-add-unix-ffi-uu.patch @@ -0,0 +1,37 @@ +From 2e7bfd08a306bd9e80b22097ef8fe66e1dd85054 Mon Sep 17 00:00:00 2001 +From: Jeffery To +Date: Wed, 31 May 2023 00:00:11 +0800 +Subject: [PATCH] unix-ffi/uu: Add unix-ffi version of `uu` package. + +This package reuses the code from the python-stdlib version of `uu` but +requires the unix-ffi version of `os-path`. + +This also updates `email.message` to require this version of `uu`. + +Signed-off-by: Jeffery To +--- + unix-ffi/email.message/manifest.py | 2 +- + unix-ffi/uu/manifest.py | 6 ++++++ + 2 files changed, 7 insertions(+), 1 deletion(-) + create mode 100644 unix-ffi/uu/manifest.py + +--- a/unix-ffi/email.message/manifest.py ++++ b/unix-ffi/email.message/manifest.py +@@ -1,7 +1,7 @@ + metadata(version="0.5.3") + + require("re", unix_ffi=True) +-require("uu") ++require("uu", unix_ffi=True) + require("base64") + require("binascii") + require("email.utils", unix_ffi=True) +--- /dev/null ++++ b/unix-ffi/uu/manifest.py +@@ -0,0 +1,6 @@ ++metadata(version="0.5.1") ++ ++require("binascii") ++require("os-path", unix_ffi=True) ++ ++module("uu.py", base_path="../../python-stdlib/uu") diff --git a/general/python/micropython/Makefile b/general/python/micropython/Makefile new file mode 100644 index 00000000..5867da1d --- /dev/null +++ b/general/python/micropython/Makefile @@ -0,0 +1,124 @@ +# +# Copyright (C) 2008-2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=micropython +PKG_VERSION:=1.21.0 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +PKG_SOURCE_URL:=https://github.com/micropython/micropython/releases/download/v$(PKG_VERSION) +PKG_HASH:=abd2152613559d3f44728668346e78be9d93458133a03b700baf222c322fd4d5 + +PKG_MAINTAINER:=Jeffery To +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE +PKG_CPE_ID:=cpe:/a:micropython:micropython + +PKG_BUILD_DEPENDS:=python3/host +PKG_BUILD_FLAGS:=no-mips16 no-mold +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/host-build.mk +include $(INCLUDE_DIR)/package.mk + +define Package/micropython/Default + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=MicroPython + URL:=https://micropython.org + DEPENDS:=+libffi + PROVIDES:=micropython +endef + +define Package/micropython-mbedtls +$(call Package/micropython/Default) + TITLE+= (mbedtls) + DEPENDS+= +PACKAGE_micropython-mbedtls:libmbedtls + CONFLICTS:=micropython-nossl + VARIANT:=mbedtls + DEFAULT_VARIANT:=1 +endef + +define Package/micropython-nossl +$(call Package/micropython/Default) + TITLE+= (nossl) + VARIANT:=nossl +endef + +define Package/micropython/Default/description +MicroPython is a lean and efficient implementation of the Python 3 +programming language that includes a small subset of the Python standard +library and is optimised to run on microcontrollers and in constrained +environments. +endef + +define Package/micropython-mbedtls/description +$(call Package/micropython/Default/description) + +This version uses the Mbed TLS library. +endef + +define Package/micropython-nossl/description +$(call Package/micropython/Default/description) + +This version is built without TLS and mip. +endef + +MAKE_FLAGS += BUILD_VERBOSE=1 STRIP= + +ifneq ($(CONFIG_DEBUG),) + MAKE_FLAGS += DEBUG=1 +endif + +ifeq ($(BUILD_VARIANT),nossl) + 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 + +define Build/Configure + +$(HOST_MAKE_VARS) \ + $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/mpy-cross \ + $(HOST_MAKE_FLAGS) BUILD_VERBOSE=1 +endef + +define Build/InstallDev + $(INSTALL_DIR) $(2)/lib/micropython/mpy-cross + $(CP) \ + $(PKG_BUILD_DIR)/mpy-cross/mpy_cross \ + $(2)/lib/micropython/mpy-cross/ + + $(INSTALL_DIR) $(2)/lib/micropython/mpy-cross/build + $(INSTALL_BIN) \ + $(PKG_BUILD_DIR)/mpy-cross/build/mpy-cross \ + $(2)/lib/micropython/mpy-cross/build/ + + $(INSTALL_DIR) $(2)/lib/micropython/tools + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/tools/manifestfile.py \ + $(2)/lib/micropython/tools/ +endef + +define Package/micropython/Default/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ports/unix/build-standard/micropython $(1)/usr/bin/ +endef + +Package/micropython-mbedtls/install = $(Package/micropython/Default/install) +Package/micropython-nossl/install = $(Package/micropython/Default/install) + +$(eval $(call BuildPackage,micropython-mbedtls)) +$(eval $(call BuildPackage,micropython-nossl)) diff --git a/general/python/micropython/patches/010-cdefs.patch b/general/python/micropython/patches/010-cdefs.patch new file mode 100644 index 00000000..897c880b --- /dev/null +++ b/general/python/micropython/patches/010-cdefs.patch @@ -0,0 +1,64 @@ +--- a/lib/berkeley-db-1.xx/PORT/bsd.4.4/include/db.h ++++ b/lib/berkeley-db-1.xx/PORT/bsd.4.4/include/db.h +@@ -37,7 +37,7 @@ + #define _DB_H_ + + #include +-#include ++#include "cdefs.h" + + #include + +--- a/lib/berkeley-db-1.xx/PORT/clib/memmove.c ++++ b/lib/berkeley-db-1.xx/PORT/clib/memmove.c +@@ -38,7 +38,7 @@ + static char sccsid[] = "@(#)bcopy.c 8.1 (Berkeley) 6/4/93"; + #endif /* LIBC_SCCS and not lint */ + +-#include ++#include "cdefs.h" + #include + + /* +--- a/lib/berkeley-db-1.xx/PORT/clib/snprintf.c ++++ b/lib/berkeley-db-1.xx/PORT/clib/snprintf.c +@@ -1,5 +1,5 @@ + #include +-#include ++#include "cdefs.h" + + #include + +--- a/lib/berkeley-db-1.xx/PORT/hpux.9.01/local/hp_siglist.c ++++ b/lib/berkeley-db-1.xx/PORT/hpux.9.01/local/hp_siglist.c +@@ -2,7 +2,7 @@ + * Derived from: + * static char sccsid[] = "@(#)siglist.c 8.1 (Berkeley) 6/4/93"; + */ +-#include ++#include "cdefs.h" + + #include + +--- a/lib/berkeley-db-1.xx/PORT/ultrix.4.2/include/db.h ++++ b/lib/berkeley-db-1.xx/PORT/ultrix.4.2/include/db.h +@@ -37,7 +37,7 @@ + #define _DB_H_ + + #include +-#include ++#include "cdefs.h" + + #include + +--- a/lib/berkeley-db-1.xx/include/db.h ++++ b/lib/berkeley-db-1.xx/include/db.h +@@ -37,7 +37,7 @@ + #define _DB_H_ + + #include +-#include ++#include "cdefs.h" + + #include + diff --git a/general/python/micropython/patches/030-target-no-darwin.patch b/general/python/micropython/patches/030-target-no-darwin.patch new file mode 100644 index 00000000..9dc4c59b --- /dev/null +++ b/general/python/micropython/patches/030-target-no-darwin.patch @@ -0,0 +1,11 @@ +--- a/ports/unix/Makefile ++++ b/ports/unix/Makefile +@@ -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) ++UNAME_S := Linux + + # include py core make definitions + include $(TOP)/py/py.mk diff --git a/general/python/micropython/patches/040-extmod-use-external-mbedtls.patch b/general/python/micropython/patches/040-extmod-use-external-mbedtls.patch new file mode 100644 index 00000000..3399412e --- /dev/null +++ b/general/python/micropython/patches/040-extmod-use-external-mbedtls.patch @@ -0,0 +1,99 @@ +From 9717338f1917fa5db63fe7c9758639417ab06f61 Mon Sep 17 00:00:00 2001 +From: yangfl +Date: Mon, 4 Jan 2021 23:09:41 +0800 +Subject: [PATCH 06/10] extmod: Use system mbedtls + +--- + extmod/extmod.mk | 77 ++---------------------------------------------- + 1 file changed, 2 insertions(+), 75 deletions(-) + +--- a/extmod/extmod.mk ++++ b/extmod/extmod.mk +@@ -131,85 +131,8 @@ SRC_THIRDPARTY_C += $(addprefix $(AXTLS_ + crypto/sha1.c \ + ) + else ifeq ($(MICROPY_SSL_MBEDTLS),1) +-MBEDTLS_DIR = lib/mbedtls +-MBEDTLS_CONFIG_FILE ?= \"mbedtls/mbedtls_config.h\" +-GIT_SUBMODULES += $(MBEDTLS_DIR) +-CFLAGS_EXTMOD += -DMBEDTLS_CONFIG_FILE=$(MBEDTLS_CONFIG_FILE) +-CFLAGS_EXTMOD += -DMICROPY_SSL_MBEDTLS=1 -I$(TOP)/$(MBEDTLS_DIR)/include +-SRC_THIRDPARTY_C += lib/mbedtls_errors/mp_mbedtls_errors.c +-SRC_THIRDPARTY_C += $(addprefix $(MBEDTLS_DIR)/library/,\ +- aes.c \ +- aesni.c \ +- arc4.c \ +- asn1parse.c \ +- asn1write.c \ +- base64.c \ +- bignum.c \ +- blowfish.c \ +- camellia.c \ +- ccm.c \ +- certs.c \ +- chacha20.c \ +- chachapoly.c \ +- cipher.c \ +- cipher_wrap.c \ +- cmac.c \ +- ctr_drbg.c \ +- debug.c \ +- des.c \ +- dhm.c \ +- ecdh.c \ +- ecdsa.c \ +- ecjpake.c \ +- ecp.c \ +- ecp_curves.c \ +- entropy.c \ +- entropy_poll.c \ +- gcm.c \ +- havege.c \ +- hmac_drbg.c \ +- md2.c \ +- md4.c \ +- md5.c \ +- md.c \ +- oid.c \ +- padlock.c \ +- pem.c \ +- pk.c \ +- pkcs11.c \ +- pkcs12.c \ +- pkcs5.c \ +- pkparse.c \ +- pk_wrap.c \ +- pkwrite.c \ +- platform.c \ +- platform_util.c \ +- poly1305.c \ +- ripemd160.c \ +- rsa.c \ +- rsa_internal.c \ +- sha1.c \ +- sha256.c \ +- sha512.c \ +- ssl_cache.c \ +- ssl_ciphersuites.c \ +- 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 \ +- x509_crt.c \ +- x509_csr.c \ +- x509write_crt.c \ +- x509write_csr.c \ +- xtea.c \ +- ) ++CFLAGS_EXTMOD += -DMICROPY_SSL_MBEDTLS=1 ++LDFLAGS_MOD += -lmbedx509 -lmbedtls -lmbedcrypto + endif + endif + diff --git a/general/python/micropython/src/ports/unix/variants/standard/manifest-nossl.py b/general/python/micropython/src/ports/unix/variants/standard/manifest-nossl.py new file mode 100644 index 00000000..ee2b4620 --- /dev/null +++ b/general/python/micropython/src/ports/unix/variants/standard/manifest-nossl.py @@ -0,0 +1 @@ +include("$(MPY_DIR)/extmod/asyncio") diff --git a/general/python/micropython/test.sh b/general/python/micropython/test.sh new file mode 100644 index 00000000..82cf2ecd --- /dev/null +++ b/general/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} " diff --git a/general/python/numpy/Makefile b/general/python/numpy/Makefile new file mode 100644 index 00000000..3cd9827b --- /dev/null +++ b/general/python/numpy/Makefile @@ -0,0 +1,91 @@ +# +# Copyright (C) 2019 Jakub Piotr Cłapa +# Copyright (C) 2020 Alexandru Ardelean +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=numpy +PKG_VERSION:=1.26.4 +PKG_RELEASE:=1 + +PYPI_NAME:=$(PKG_NAME) +PKG_HASH:=2a02aba9ed12e4ac4eb3ea9421c420301a0c6460d9830d74a9df87efa4912010 + +PKG_MAINTAINER:=Alexandru Ardelean + +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=LICENSE.txt +PKG_CPE_ID:=cpe:/a:numpy:numpy + +PKG_CONFIG_DEPENDS:= \ + CONFIG_NUMPY_OPENBLAS_SUPPORT + +PKG_BUILD_DEPENDS:=python-cython/host pyproject-metadata/host + +# Ensure numpy does not find openblas if openblas support is not enabled +PYTHON3_PKG_BUILD_VARS:= \ + $(if $(CONFIG_NUMPY_OPENBLAS_SUPPORT),,NPY_BLAS_ORDER= NPY_LAPACK_ORDER= ) + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-numpy + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=The fundamental package for scientific computing with Python + URL:=https://www.numpy.org/ + DEPENDS:=@!SOFT_FLOAT +INSTALL_GFORTRAN:libgfortran +python3 +libstdcpp \ + +NUMPY_OPENBLAS_SUPPORT:openblas +endef + +# We need to duplicate the omitted arhitectures same as openblas +define Package/python3-numpy/config +menu "Configuration" +depends on !powerpc +depends on !arc + +config NUMPY_OPENBLAS_SUPPORT + bool "Enable OpenBLAS support" + default n + +endmenu +endef + +ifeq ($(ARCH),x86_64) +# FIXME: temporary fix for x86_64 with GCC 13 + musl; +# numpy does not detect this compiler extension, so we just enable it +TARGET_CFLAGS += -mavx512f +endif + +define Build/Prepare/numpy-sitecfg + echo "[DEFAULT]" > $(PKG_BUILD_DIR)/site.cfg + echo "library_dirs = $(STAGING_DIR)/usr/lib" >> $(PKG_BUILD_DIR)/site.cfg + echo "include_dirs = $(STAGING_DIR)/usr/include" >> $(PKG_BUILD_DIR)/site.cfg + + ifdef CONFIG_NUMPY_OPENBLAS_SUPPORT + echo >> $(PKG_BUILD_DIR)/site.cfg + echo "[openblas]" >> $(PKG_BUILD_DIR)/site.cfg + echo "libraries = openblas" >> $(PKG_BUILD_DIR)/site.cfg + echo "runtime_library_dirs = /usr/lib" >> $(PKG_BUILD_DIR)/site.cfg + endif +endef + +define Build/Prepare + $(call Build/Prepare/Default) + $(call Build/Prepare/numpy-sitecfg) +endef + +define Package/python3-numpy/description +NumPy is the fundamental package for array computing with Python. + +By default, this package is built without some modules. +For some modules to be available, the INSTALL_GFORTRAN symbol needs +to be enabled in the OpenWrt core/toolchain. +endef + +$(eval $(call Py3Package,python3-numpy)) +$(eval $(call BuildPackage,python3-numpy)) +$(eval $(call BuildPackage,python3-numpy-src)) diff --git a/general/python/numpy/patches/002-avoid-build-user-config-files.patch b/general/python/numpy/patches/002-avoid-build-user-config-files.patch new file mode 100644 index 00000000..c3d70207 --- /dev/null +++ b/general/python/numpy/patches/002-avoid-build-user-config-files.patch @@ -0,0 +1,11 @@ +--- a/numpy/distutils/system_info.py ++++ b/numpy/distutils/system_info.py +@@ -404,7 +404,7 @@ def get_standard_file(fname): + pass + else: + user_file = os.path.join(f, fname) +- if os.path.isfile(user_file): ++ if "_PYTHON_HOST_PLATFORM" not in os.environ and os.path.isfile(user_file): + filenames.append(user_file) + + # Local file diff --git a/general/python/numpy/patches/003-without-vendored-meson.patch b/general/python/numpy/patches/003-without-vendored-meson.patch new file mode 100644 index 00000000..a2a9c5f7 --- /dev/null +++ b/general/python/numpy/patches/003-without-vendored-meson.patch @@ -0,0 +1,32 @@ +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -1,8 +1,8 @@ + [build-system] +-build-backend = "mesonpy" ++#build-backend = "mesonpy" + requires = [ + "Cython>=0.29.34,<3.1", +- "meson-python>=0.15.0,<0.16.0", ++# "meson-python>=0.15.0,<0.16.0", + ] + + [project] +@@ -181,14 +181,14 @@ environment = {PKG_CONFIG_PATH="/opt/32/ + config-settings = "setup-args=--vsenv setup-args=-Dallow-noblas=true" + repair-wheel-command = "" + +-[tool.meson-python] +-meson = 'vendored-meson/meson/meson.py' ++#[tool.meson-python] ++#meson = 'vendored-meson/meson/meson.py' + + [tool.spin] + package = 'numpy' + +-[tool.spin.meson] +-cli = 'vendored-meson/meson/meson.py' ++#[tool.spin.meson] ++#cli = 'vendored-meson/meson/meson.py' + + [tool.spin.commands] + "Build" = [ diff --git a/general/python/openpyxl/Makefile b/general/python/openpyxl/Makefile new file mode 100644 index 00000000..0edb9517 --- /dev/null +++ b/general/python/openpyxl/Makefile @@ -0,0 +1,40 @@ +# +# Copyright (C) 2007-2017 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-openpyxl +PKG_VERSION:=3.0.10 +PKG_RELEASE:=1 + +PKG_MAINTAINER:=Alexandru Ardelean +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENCE.rst + +PYPI_NAME:=openpyxl +PKG_HASH:=e47805627aebcf860edb4edf7987b1309c1b3632f3750538ed962bbcc3bd7449 + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-openpyxl + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=A Python library to read/write Excel 2010 xlsx/xlsm files + URL:=https://openpyxl.readthedocs.org/ + DEPENDS:=+python3 +python3-defusedxml +python3-et_xmlfile +python3-jdcal +endef + +define Package/python3-openpyxl/description + A Python library to read/write Excel 2010 xlsx/xlsm files +endef + +$(eval $(call Py3Package,python3-openpyxl)) +$(eval $(call BuildPackage,python3-openpyxl)) +$(eval $(call BuildPackage,python3-openpyxl-src)) diff --git a/general/python/pillow/Makefile b/general/python/pillow/Makefile new file mode 100644 index 00000000..c6b1faf0 --- /dev/null +++ b/general/python/pillow/Makefile @@ -0,0 +1,56 @@ +# +# Copyright © 1997-2011 by Secret Labs AB +# Copyright © 1995-2011 by Fredrik Lundh +# Copyright © 2016 by Alex Clark and contributors +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=pillow +PKG_VERSION:=10.1.0 +PKG_RELEASE:=1 + +PYPI_NAME:=Pillow +PKG_HASH:=e6bf8de6c36ed96c86ea3b6e1d5273c53f46ef518a062464cd7ef5dd2cf92e38 + +PKG_BUILD_DEPENDS:=python-setuptools-scm/host + +PKG_MAINTAINER:=Alexandru Ardelean +PKG_LICENSE:=HPND +PKG_LICENSE_FILES:=LICENSE +PKG_CPE_ID:=cpe:/a:python:pillow + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-pillow + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=The friendly PIL fork + URL:=https://python-pillow.org/ + DEPENDS:=+libfreetype +libjpeg +libtiff +zlib \ + +libwebp +python3 +endef + +define Package/python3-pillow/description + The friendly PIL fork +endef + +PYTHON3_PKG_BUILD_CONFIG_SETTINGS += \ + --build-option=build_ext \ + --build-option=--enable-zlib \ + --build-option=--enable-jpeg \ + --build-option=--enable-webp \ + --build-option=--enable-webpmux \ + --build-option=--enable-tiff \ + --build-option=--enable-freetype \ + --build-option=--disable-lcms \ + --build-option=--disable-jpeg2000 \ + --build-option=--disable-imagequant \ + --build-option=--disable-platform-guessing + +$(eval $(call Py3Package,python3-pillow)) +$(eval $(call BuildPackage,python3-pillow)) +$(eval $(call BuildPackage,python3-pillow-src)) diff --git a/general/python/pillow/patches/001-remove-setuptools-version-limit.patch b/general/python/pillow/patches/001-remove-setuptools-version-limit.patch new file mode 100644 index 00000000..e5ac168c --- /dev/null +++ b/general/python/pillow/patches/001-remove-setuptools-version-limit.patch @@ -0,0 +1,11 @@ +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -1,7 +1,7 @@ + [build-system] + build-backend = "backend" + requires = [ +- "setuptools>=67.8", ++ "setuptools", + ] + backend-path = [ + "_custom_build", diff --git a/general/python/pillow/test.sh b/general/python/pillow/test.sh new file mode 100644 index 00000000..9bad2924 --- /dev/null +++ b/general/python/pillow/test.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +[ "$1" = "python3-pillow" ] || exit 0 + +python3 - << EOF +import sys +from PIL import Image, ImageDraw + +if (Image.__version__ != "$2"): + print("Wrong version: " + Image.__version__) + sys.exit(1) + +from PIL import Image, ImageDraw +img = Image.new('RGB', (100, 30), color = (73, 109, 137)) +d = ImageDraw.Draw(img) +d.text((10,10), "Hello World", fill=(255,255,0)) + +# Getting here means we did not get exceptions +sys.exit(0) +EOF diff --git a/general/python/pipx/Makefile b/general/python/pipx/Makefile new file mode 100644 index 00000000..f45abe5f --- /dev/null +++ b/general/python/pipx/Makefile @@ -0,0 +1,56 @@ +# +# 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:=pipx +PKG_VERSION:=1.3.3 +PKG_RELEASE:=1 + +PYPI_NAME:=pipx +PKG_HASH:=6d5474e71e78c28d83570443e5418c56599aa8319a950ccf5984c5cb0a35f0a7 + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Jeffery To + +PKG_BUILD_DEPENDS:=python-hatchling/host python-hatch-vcs/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/pipx + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Install/Run Python Applications in Isolated Environments + URL:=https://pipx.pypa.io/ + DEPENDS:= \ + +python3-light \ + +python3-logging \ + +python3-urllib \ + +python3-venv \ + +python3-argcomplete \ + +python3-packaging \ + +python3-platformdirs \ + +python3-userpath +endef + +define Package/pipx/description +pipx is a tool to help you install and run end-user applications written +in Python. It's roughly similar to macOS's brew, JavaScript's npx, and +Linux's apt. + +It's closely related to pip. In fact, it uses pip, but is focused on +installing and managing Python packages that can be run from the command +line directly as applications. +endef + +$(eval $(call Py3Package,pipx)) +$(eval $(call BuildPackage,pipx)) +$(eval $(call BuildPackage,pipx-src)) diff --git a/general/python/pipx/test.sh b/general/python/pipx/test.sh new file mode 100644 index 00000000..a4f2348a --- /dev/null +++ b/general/python/pipx/test.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +[ "$1" = pipx ] || exit 0 + +pipx --version | grep -Fx "$PKG_VERSION" diff --git a/general/python/pymysql/Makefile b/general/python/pymysql/Makefile new file mode 100644 index 00000000..025a97ad --- /dev/null +++ b/general/python/pymysql/Makefile @@ -0,0 +1,63 @@ +# +# Copyright (C) Alexandru Ardelean +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=pymysql +PKG_VERSION:=1.1.0 +PKG_RELEASE:=2 + +PYPI_NAME:=PyMySQL +PKG_HASH:=4f13a7df8bf36a51e81dd9f3605fede45a4878fe02f9236349fd82a3f0612f96 + +PKG_MAINTAINER:=Alexandru Ardelean +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE + +PKG_CONFIG_DEPENDS:=CONFIG_PYTHON3_PYMYSQL_SHA_PASSWORD_SUPPORT + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-pymysql/Default + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Pure Python MySQL Client + URL:=https://pymysql.readthedocs.io/ +endef + +define Package/python3-pymysql +$(call Package/python3-pymysql/Default) + DEPENDS:=+python3 +endef + +define Package/python3-pymysql/description + This package contains a pure-Python MySQL client library, based on PEP 249. +endef + +define Package/python3-pymysql-sha-pwd +$(call Package/python3-pymysql/Default) + TITLE+=w/ SHA256 password auth + DEPENDS:=+python3-pymysql $(RUST_ARCH_DEPENDS) +PACKAGE_python3-pymysql-sha-pwd:python3-cryptography +endef + +define Package/python3-pymysql-sha-pwd/description + This is a meta-package installing python3-pymysql and python3-cryptography + packages to be able to use pymysql with “sha256_password” or + “caching_sha2_password” for authentication. +endef + +define Package/python3-pymysql-sha-pwd/install + true +endef + +$(eval $(call Py3Package,python3-pymysql)) +$(eval $(call BuildPackage,python3-pymysql)) +$(eval $(call BuildPackage,python3-pymysql-src)) +$(eval $(call BuildPackage,python3-pymysql-sha-pwd)) diff --git a/general/python/pypi.mk b/general/python/pypi.mk new file mode 100644 index 00000000..cc0cb760 --- /dev/null +++ b/general/python/pypi.mk @@ -0,0 +1,24 @@ +# +# Copyright (C) 2019 Jeffery To +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +ifndef DUMP + ifdef __package_mk + $(warning pypi.mk should be included before package.mk) + endif +endif + +ifneq ($(strip $(PYPI_NAME)),) + PYPI_SOURCE_NAME?=$(PYPI_NAME) + PYPI_SOURCE_EXT?=tar.gz + PYPI_NAME_FIRST_LETTER?=$(strip $(foreach a,$(chars_lower) $(chars_upper) 0 1 2 3 4 5 6 7 8 9 _ -,$(if $(PYPI_NAME:$a%=),,$a))) + + PKG_SOURCE?=$(PYPI_SOURCE_NAME)-$(PKG_VERSION).$(PYPI_SOURCE_EXT) + PKG_SOURCE_URL?=https://files.pythonhosted.org/packages/source/$(PYPI_NAME_FIRST_LETTER)/$(PYPI_NAME) + + PKG_BUILD_DIR:=$(BUILD_DIR)/pypi/$(if $(BUILD_VARIANT),$(PKG_NAME)-$(BUILD_VARIANT)/)$(PYPI_SOURCE_NAME)$(if $(PKG_VERSION),-$(PKG_VERSION)) + HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/pypi/$(PYPI_SOURCE_NAME)$(if $(PKG_VERSION),-$(PKG_VERSION)) +endif diff --git a/general/python/pyproject-metadata/Makefile b/general/python/pyproject-metadata/Makefile new file mode 100644 index 00000000..2e53f36e --- /dev/null +++ b/general/python/pyproject-metadata/Makefile @@ -0,0 +1,39 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=pyproject-metadata +PKG_VERSION:=0.7.1 +PKG_RELEASE:=1 + +PYPI_NAME:=pyproject-metadata +PKG_HASH:=0a94f18b108b9b21f3a26a3d541f056c34edcb17dc872a144a15618fed7aef67 + +PKG_MAINTAINER:=Andy Syam +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE + +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-pyproject-metadata + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=PEP 621 metadata parsing + URL:=https://github.com/FFY00/python-pyproject-metadata + DEPENDS:=+python3 +endef + +define Package/python3-pyproject-metadata/description +This project does not implement the parsing of pyproject.toml containing PEP 621 metadata. +Instead, given a Python data structure representing PEP 621 metadata (already parsed), it will validate this input and generate a PEP 643-compliant metadata file (e.g. PKG-INFO). +endef + +$(eval $(call Py3Package,python3-pyproject-metadata)) +$(eval $(call BuildPackage,python3-pyproject-metadata)) +$(eval $(call BuildPackage,python3-pyproject-metadata-src)) +$(eval $(call HostBuild)) diff --git a/general/python/python-aio-mqtt-mod/Makefile b/general/python/python-aio-mqtt-mod/Makefile new file mode 100644 index 00000000..ae553fc4 --- /dev/null +++ b/general/python/python-aio-mqtt-mod/Makefile @@ -0,0 +1,39 @@ +# +# Copyright (C) 2023 +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-aio-mqtt-mod +PKG_VERSION:=0.3.4 +PKG_RELEASE:=1 + +PYPI_NAME:=aio-mqtt-mod +PKG_HASH:=340184b35771b7eb7982072fcca313213d856638dd7f98b99bda3ab16ba23552 + +PKG_MAINTAINER:=Quintin Hill +PKG_LICENSE:=Apache-2.0 +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-aio-mqtt-mod + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Asynchronous MQTT client + URL:=https://github.com/devbis/aio-mqtt + DEPENDS:=+python3-light +python3-asyncio +endef + +define Package/python3-aio-mqtt-mod/description + Asynchronous MQTT client for 3.1.1 protocol version (mod). +endef + +$(eval $(call Py3Package,python3-aio-mqtt-mod)) +$(eval $(call BuildPackage,python3-aio-mqtt-mod)) +$(eval $(call BuildPackage,python3-aio-mqtt-mod-src)) diff --git a/general/python/python-aiohttp-cors/Makefile b/general/python/python-aiohttp-cors/Makefile new file mode 100644 index 00000000..892a660c --- /dev/null +++ b/general/python/python-aiohttp-cors/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2019 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=aiohttp-cors +PKG_VERSION:=0.7.0 +PKG_RELEASE:=2 + +PYPI_NAME:=aiohttp_cors +PYPI_SOURCE_NAME:=aiohttp-cors +PKG_HASH:=4d39c6d7100fd9764ed1caf8cebf0eb01bf5e3f24e2e073fda6234bc48b19f5d + +PKG_MAINTAINER:=Josef Schlehofer +PKG_LICENSE:=Apache-2.0 +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-aiohttp-cors + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=CORS support for aiohttp + URL:=https://github.com/aio-libs/aiohttp-cors + DEPENDS:= \ + +python3-aiohttp \ + +python3-light +endef + +define Package/python3-aiohttp-cors/description + Implements Cross Origin Resource Sharing (CORS) support for aiohttp asyncio-powered asynchronous HTTP server. +endef + +$(eval $(call Py3Package,python3-aiohttp-cors)) +$(eval $(call BuildPackage,python3-aiohttp-cors)) +$(eval $(call BuildPackage,python3-aiohttp-cors-src)) diff --git a/general/python/python-aiohttp/Makefile b/general/python/python-aiohttp/Makefile new file mode 100644 index 00000000..2c4b68a3 --- /dev/null +++ b/general/python/python-aiohttp/Makefile @@ -0,0 +1,49 @@ +# +# Copyright (C) 2019-2021 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-aiohttp +PKG_VERSION:=3.9.3 +PKG_RELEASE:=1 + +PYPI_NAME:=aiohttp +PKG_HASH:=90842933e5d1ff760fae6caca4b2b3edba53ba8f4b71e95dacf2818a2aca06f7 + +PKG_MAINTAINER:=Josef Schlehofer +PKG_LICENSE:=Apache-2.0 +PKG_LICENSE_FILES:=LICENSE.txt +PKG_CPE_ID:=cpe:/a:aiohttp:aiohttp + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-aiohttp + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Async http client/server framework (asyncio) + URL:=https://github.com/aio-libs/aiohttp + DEPENDS:= \ + +python3 \ + +python3-aiosignal \ + +python3-async-timeout \ + +python3-attrs \ + +python3-charset-normalizer \ + +python3-frozenlist \ + +python3-multidict \ + +python3-yarl +endef + +define Package/python3-aiohttp/description + Asynchronous HTTP client/server framework for asyncio and Python3. +endef + +$(eval $(call Py3Package,python3-aiohttp)) +$(eval $(call BuildPackage,python3-aiohttp)) +$(eval $(call BuildPackage,python3-aiohttp-src)) diff --git a/general/python/python-aiosignal/Makefile b/general/python/python-aiosignal/Makefile new file mode 100644 index 00000000..bb433812 --- /dev/null +++ b/general/python/python-aiosignal/Makefile @@ -0,0 +1,40 @@ +# +# 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-aiosignal +PKG_VERSION:=1.3.1 +PKG_RELEASE:=1 + +PYPI_NAME:=aiosignal +PKG_HASH:=54cd96e15e1649b75d6c87526a6ff0b6c1b0dd3459f43d9ca11d48c339b68cfc + +PKG_LICENSE:=Apache-2.0 +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Jeffery To + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-aiosignal + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=List of registered asynchronous callbacks + URL:=https://github.com/aio-libs/aiosignal + DEPENDS:=+python3-light +python3-frozenlist +endef + +define Package/python3-aiosignal/description +A project to manage callbacks in asyncio projects. +endef + +$(eval $(call Py3Package,python3-aiosignal)) +$(eval $(call BuildPackage,python3-aiosignal)) +$(eval $(call BuildPackage,python3-aiosignal-src)) diff --git a/general/python/python-apipkg/Makefile b/general/python/python-apipkg/Makefile new file mode 100644 index 00000000..233ce3ef --- /dev/null +++ b/general/python/python-apipkg/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2020 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-apipkg +PKG_VERSION:=3.0.1 +PKG_RELEASE:=1 + +PYPI_NAME:=apipkg +PKG_HASH:=f8c021adafc9132ac2fba9fd3c5768365d0a8c10aa375fb15e329f1fce8a5f01 + +PKG_MAINTAINER:=Jan Pavlinec +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE + +PKG_BUILD_DEPENDS:=python-hatchling/host python-hatch-vcs/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-apipkg + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Namespace control and lazy-import mechanism + URL:=https://github.com/pytest-dev/apipkg + DEPENDS:=+python3-light +endef + +define Package/python3-apipkg/description +apipkg is used to control the exported namespace of a Python package and +greatly reduce the number of imports for users. +endef + +$(eval $(call Py3Package,python3-apipkg)) +$(eval $(call BuildPackage,python3-apipkg)) +$(eval $(call BuildPackage,python3-apipkg-src)) diff --git a/general/python/python-appdirs/Makefile b/general/python/python-appdirs/Makefile new file mode 100644 index 00000000..a17bb51a --- /dev/null +++ b/general/python/python-appdirs/Makefile @@ -0,0 +1,36 @@ +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-appdirs +PKG_VERSION:=1.4.4 +PKG_RELEASE:=1 +PKG_MAINTAINER:=Josef Schlehofer   + +PYPI_NAME:=appdirs +PKG_HASH:=7d5d0167b2b1ba821647616af46a749d1c653740dd0d2415100fe26e27afdf41 +PKG_LICENSE:=MIT + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-appdirs + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + URL:=https://github.com/ActiveState/appdirs + TITLE:=Determining platform-specific dirs + DEPENDS:=+python3-light +endef + +define Package/python-appdirs/description + A small Python module for determining appropriate platform-specific + dirs, e.g. a "user data dir". +endef + +$(eval $(call Py3Package,python3-appdirs)) +$(eval $(call BuildPackage,python3-appdirs)) +$(eval $(call BuildPackage,python3-appdirs-src)) diff --git a/general/python/python-argcomplete/Makefile b/general/python/python-argcomplete/Makefile new file mode 100644 index 00000000..b725a4bb --- /dev/null +++ b/general/python/python-argcomplete/Makefile @@ -0,0 +1,43 @@ +# +# 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-argcomplete +PKG_VERSION:=3.2.1 +PKG_RELEASE:=1 + +PYPI_NAME:=argcomplete +PKG_HASH:=437f67fb9b058da5a090df505ef9be0297c4883993f3f56cb186ff087778cfb4 + +PKG_LICENSE:=Apache-2.0 +PKG_LICENSE_FILES:=LICENSE.rst +PKG_MAINTAINER:=Jeffery To + +PKG_BUILD_DEPENDS:=python-setuptools-scm/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-argcomplete + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Bash tab completion for argparse + URL:=https://github.com/kislyuk/argcomplete + DEPENDS:=+python3-light +endef + +define Package/python3-argcomplete/description +Argcomplete provides easy, extensible command line tab completion of +arguments for your Python application. +endef + +$(eval $(call Py3Package,python3-argcomplete)) +$(eval $(call BuildPackage,python3-argcomplete)) +$(eval $(call BuildPackage,python3-argcomplete-src)) diff --git a/general/python/python-argcomplete/patches/001-unpin-setuptools.patch b/general/python/python-argcomplete/patches/001-unpin-setuptools.patch new file mode 100644 index 00000000..a85ce857 --- /dev/null +++ b/general/python/python-argcomplete/patches/001-unpin-setuptools.patch @@ -0,0 +1,9 @@ +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -1,5 +1,5 @@ + [build-system] +-requires = ["setuptools>=67.7.2", "setuptools_scm[toml]>=6.2"] ++requires = ["setuptools", "setuptools_scm[toml]>=6.2"] + build-backend = "setuptools.build_meta" + + [project] diff --git a/general/python/python-argcomplete/test.sh b/general/python/python-argcomplete/test.sh new file mode 100644 index 00000000..0ecba3e5 --- /dev/null +++ b/general/python/python-argcomplete/test.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +[ "$1" = python3-argcomplete ] || exit 0 + +python3 -c 'import argcomplete' diff --git a/general/python/python-asgiref/Makefile b/general/python/python-asgiref/Makefile new file mode 100644 index 00000000..4547758d --- /dev/null +++ b/general/python/python-asgiref/Makefile @@ -0,0 +1,34 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-asgiref +PKG_VERSION:=3.7.2 +PKG_RELEASE:=1 + +PYPI_NAME:=asgiref +PKG_HASH:=9e0ce3aa93a819ba5b45120216b23878cf6e8525eb3848653452b4192b92afed + +PKG_MAINTAINER:=Peter Stadler +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-asgiref + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=ASGI specs, helper code, and adapters + URL:=https://github.com/django/asgiref/ + DEPENDS:=+python3-light +python3-logging +python3-asyncio +endef + +define Package/python3-asgiref/description + ASGI is a standard for Python asynchronous web apps and servers to communicate + with each other, and positioned as an asynchronous successor to WSGI. +endef + +$(eval $(call Py3Package,python3-asgiref)) +$(eval $(call BuildPackage,python3-asgiref)) +$(eval $(call BuildPackage,python3-asgiref-src)) diff --git a/general/python/python-astral/Makefile b/general/python/python-astral/Makefile new file mode 100644 index 00000000..cbabdea8 --- /dev/null +++ b/general/python/python-astral/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2019-2021 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-astral +PKG_VERSION:=3.2 +PKG_RELEASE:=1 + +PYPI_NAME:=astral +PKG_HASH:=9b7c3b412e9e69d172cfb24be0e6addcc9f1bd01a28db8bebe66d75ccc533d88 + +PKG_LICENSE:=Apache-2.0 +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Josef Schlehofer + +PKG_BUILD_DEPENDS:=python-poetry-core/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-astral + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Calculations for the position of the sun and moon + URL:=https://github.com/sffjunkie/astral + DEPENDS+= \ + +python3-light +endef + +define Package/python3-astral/description +Astral is a python module for calculating the times of various aspects of the sun and moon. +endef + +$(eval $(call Py3Package,python3-astral)) +$(eval $(call BuildPackage,python3-astral)) +$(eval $(call BuildPackage,python3-astral-src)) diff --git a/general/python/python-async-generator/Makefile b/general/python/python-async-generator/Makefile new file mode 100644 index 00000000..b3e64903 --- /dev/null +++ b/general/python/python-async-generator/Makefile @@ -0,0 +1,42 @@ +# +# Copyright (C) 2022 Julien Malik +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-async-generator +PKG_VERSION:=1.10 +PKG_RELEASE:=1 + +PYPI_NAME:=async_generator +PKG_HASH:=6ebb3d106c12920aaae42ccb6f787ef5eefdcdd166ea3d628fa8476abe712144 + +PKG_LICENSE:=Apache-2.0|MIT +PKG_LICENSE_FILES:=LICENSE.APACHE2|LICENSE.MIT +PKG_MAINTAINER:=Julien Malik + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-async-generator + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Async generators and context managers for Python 3.5+ + URL:=https://github.com/python-trio/async_generator + DEPENDS:=+python3-light +endef + +define Package/python3-async-generator/description + Python 3.6 added async generators. Python 3.7 adds some more tools to make them usable, like contextlib.asynccontextmanager. + + This library gives you all that back to Python 3.5. +endef + +$(eval $(call Py3Package,python3-async-generator)) +$(eval $(call BuildPackage,python3-async-generator)) +$(eval $(call BuildPackage,python3-async-generator-src)) diff --git a/general/python/python-async-timeout/Makefile b/general/python/python-async-timeout/Makefile new file mode 100644 index 00000000..f6d0a4c8 --- /dev/null +++ b/general/python/python-async-timeout/Makefile @@ -0,0 +1,42 @@ +# +# Copyright (C) 2019 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-async-timeout +PKG_VERSION:=4.0.2 +PKG_RELEASE:=1 + +PYPI_NAME:=async-timeout +PKG_HASH:=2163e1640ddb52b7a8c80d0a67a08587e5d245cc9c553a74a847056bc2976b15 + +PKG_MAINTAINER:=Josef Schlehofer +PKG_LICENSE:=Apache-2.0 +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-async-timeout + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Timeout context manager for asyncio programs + URL:=https://github.com/aio-libs/async-timeout + DEPENDS:= \ + +python3-light \ + +python3-asyncio +endef + +define Package/python3-async-timeout/description +Timeout context manager for asyncio programs +endef + +$(eval $(call Py3Package,python3-async-timeout)) +$(eval $(call BuildPackage,python3-async-timeout)) +$(eval $(call BuildPackage,python3-async-timeout-src)) diff --git a/general/python/python-atomicwrites/Makefile b/general/python/python-atomicwrites/Makefile new file mode 100644 index 00000000..efa0803b --- /dev/null +++ b/general/python/python-atomicwrites/Makefile @@ -0,0 +1,40 @@ +# +# Copyright (C) 2019-2020 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-atomicwrites +PKG_VERSION:=1.4.1 +PKG_RELEASE:=1 + +PYPI_NAME:=atomicwrites +PKG_HASH:=81b2c9071a49367a7f770170e5eec8cb66567cfbbc8c73d20ce5ca4a8d71cf11 + +PKG_MAINTAINER:=Jan Pavlinec +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-atomicwrites + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Atomic file writes + URL:=https://github.com/untitaker/python-atomicwrites + DEPENDS:=+python3-light +endef + +define Package/python3-atomicwrites/description + Python library for atomic file writes. +endef + +$(eval $(call Py3Package,python3-atomicwrites)) +$(eval $(call BuildPackage,python3-atomicwrites)) +$(eval $(call BuildPackage,python3-atomicwrites-src)) diff --git a/general/python/python-attrs/Makefile b/general/python/python-attrs/Makefile new file mode 100644 index 00000000..d93b939c --- /dev/null +++ b/general/python/python-attrs/Makefile @@ -0,0 +1,44 @@ +# +# Copyright (C) 2016, 2018-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-attrs +PKG_VERSION:=23.1.0 +PKG_RELEASE:=1 + +PYPI_NAME:=attrs +PKG_HASH:=6279836d581513a26f1bf235f9acd333bc9115683f14f7e8fae46c98fc50e015 + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Jeffery To + +PKG_BUILD_DEPENDS:=python-hatchling/host python-hatch-vcs/host python-hatch-fancy-pypi-readme/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-attrs + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Classes Without Boilerplate + URL:=https://www.attrs.org/ + DEPENDS:=+python3-light +endef + +define Package/python3-attrs/description +attrs is an MIT-licensed Python package with class decorators that ease +the chores of implementing the most common attribute-related object +protocols. +endef + +$(eval $(call Py3Package,python3-attrs)) +$(eval $(call BuildPackage,python3-attrs)) +$(eval $(call BuildPackage,python3-attrs-src)) diff --git a/general/python/python-augeas/Makefile b/general/python/python-augeas/Makefile new file mode 100644 index 00000000..e366d429 --- /dev/null +++ b/general/python/python-augeas/Makefile @@ -0,0 +1,42 @@ +# +# Copyright (C) 2020 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-augeas +PKG_VERSION:=1.1.0 +PKG_RELEASE:=2 + +PYPI_NAME:=python-augeas +PKG_HASH:=5194a49e86b40ffc57055f73d833f87e39dce6fce934683e7d0d5bbb8eff3b8c + +PKG_MAINTAINER:=Jan Pavlinec +PKG_LICENSE:=LGPL-2.1-or-later +PKG_LICENSE_FILES:=COPYING + +PKG_BUILD_DEPENDS:=python-cffi/host # cffi>=1.0.0 + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-augeas + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Python bindings for Augeas + URL:=http://augeas.net + DEPENDS:=+python3-light +python3-cffi +augeas +endef + +define Package/python3-augeas/description + Pure python bindings for Augeas. +endef + +$(eval $(call Py3Package,python3-augeas)) +$(eval $(call BuildPackage,python3-augeas)) +$(eval $(call BuildPackage,python3-augeas-src)) diff --git a/general/python/python-augeas/patches/001-backport-ffi-fix.patch b/general/python/python-augeas/patches/001-backport-ffi-fix.patch new file mode 100644 index 00000000..4009469f --- /dev/null +++ b/general/python/python-augeas/patches/001-backport-ffi-fix.patch @@ -0,0 +1,89 @@ +From 712c2028568df7760bc98d95577e35709078bfea Mon Sep 17 00:00:00 2001 +From: Jeffery To +Date: Sun, 8 Nov 2020 21:51:09 +0800 +Subject: [PATCH] Use CFFI in out-of-line API mode (#49) + +Currently, ffi.py is called during setup to generate augeas.py; this +file would normally be used for out-of-line ABI mode. ffi.py is also +imported at run-time, instead of the generated augeas.py, and used in +in-line ABI mode. + +This changes usage of CFFI to out-of-line API mode (CFFI's "main mode of +usage"): ffi.py is called during setup to generate _augeas.abi3.so (a C +extension module); this generated module is imported at run-time. + +With this change, the headers/development files for augeas (i.e. +libaugeas-dev on Debian, augeas-devel on Fedora, etc.) and the C +compiler are required for build/setup. (These were not necessary +previously.) + +Closes https://github.com/hercules-team/python-augeas/issues/48. +--- + augeas/__init__.py | 2 +- + augeas/ffi.py | 27 ++++++++++++++++++++++----- + setup.py | 1 + + 3 files changed, 24 insertions(+), 6 deletions(-) + +--- a/augeas/__init__.py ++++ b/augeas/__init__.py +@@ -32,7 +32,7 @@ format and the transformation into a tre + + from sys import version_info as _pyver + +-from augeas.ffi import ffi, lib ++from _augeas import ffi, lib + + __author__ = "Nathaniel McCallum " + __credits__ = """Jeff Schroeder +--- a/augeas/ffi.py ++++ b/augeas/ffi.py +@@ -1,9 +1,28 @@ ++import os ++import subprocess ++ + from cffi import FFI + ++def get_include_dirs(): ++ XML2_CONFIG = os.environ.get('XML2_CONFIG', 'xml2-config') ++ PKG_CONFIG = os.environ.get('PKG_CONFIG', 'pkg-config') ++ try: ++ stdout = subprocess.check_output([XML2_CONFIG, '--cflags']) ++ except (OSError, subprocess.CalledProcessError): ++ try: ++ stdout = subprocess.check_output([PKG_CONFIG, '--cflags', 'libxml-2.0']) ++ except (OSError, subprocess.CalledProcessError): ++ stdout = b'' ++ cflags = stdout.decode('utf-8').split() ++ return [cflag[2:] for cflag in cflags if cflag.startswith('-I')] ++ + ffi = FFI() +-ffi.set_source("augeas", +- None, +- libraries=['augeas']) ++ffi.set_source("_augeas", ++ """ ++ #include ++ """, ++ libraries=['augeas'], ++ include_dirs=get_include_dirs()) + + ffi.cdef(""" + typedef struct augeas augeas; +@@ -44,7 +63,5 @@ const char *aug_error_details(augeas *au + void free(void *); + """) + +-lib = ffi.dlopen("augeas") +- + if __name__ == "__main__": + ffi.compile(verbose=True) +--- a/setup.py ++++ b/setup.py +@@ -22,6 +22,7 @@ setup(name=name, + setup_requires=["cffi>=1.0.0"], + cffi_modules=["augeas/ffi.py:ffi"], + install_requires=["cffi>=1.0.0"], ++ zip_safe=False, + url="http://augeas.net/", + classifiers=[ + "Programming Language :: Python :: 2.7", diff --git a/general/python/python-automat/Makefile b/general/python/python-automat/Makefile new file mode 100644 index 00000000..83fc3ced --- /dev/null +++ b/general/python/python-automat/Makefile @@ -0,0 +1,52 @@ +# +# Copyright (C) 2018-2020, 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-automat +PKG_VERSION:=22.10.0 +PKG_RELEASE:=1 + +PYPI_NAME:=Automat +PKG_HASH:=e56beb84edad19dcc11d30e8d9b895f75deeb5ef5e96b84a467066b3b84bb04e + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Jeffery To + +PKG_BUILD_DEPENDS:=python-setuptools-scm/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-automat + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Concise, idiomatic finite-state automata + URL:=https://github.com/glyph/Automat + DEPENDS:= \ + +python3-light \ + +python3-attrs \ + +python3-six +endef + +define Package/python3-automat/description +Automat is a library for concise, idiomatic Python expression of +finite-state automata (particularly deterministic finite-state +transducers). +endef + +define Py3Package/python3-automat/filespec ++|$(PYTHON3_PKG_DIR) +-|$(PYTHON3_PKG_DIR)/automat/_visualize.py +endef + +$(eval $(call Py3Package,python3-automat)) +$(eval $(call BuildPackage,python3-automat)) +$(eval $(call BuildPackage,python3-automat-src)) diff --git a/general/python/python-automat/patches/002-omit-visualize.patch b/general/python/python-automat/patches/002-omit-visualize.patch new file mode 100644 index 00000000..977f9613 --- /dev/null +++ b/general/python/python-automat/patches/002-omit-visualize.patch @@ -0,0 +1,18 @@ +--- a/setup.py ++++ b/setup.py +@@ -22,15 +22,6 @@ setup( + "attrs>=19.2.0", + "six", + ], +- extras_require={ +- "visualize": ["graphviz>0.5.1", +- "Twisted>=16.1.1"], +- }, +- entry_points={ +- "console_scripts": [ +- "automat-visualize = automat._visualize:tool" +- ], +- }, + author='Glyph', + author_email='glyph@twistedmatrix.com', + include_package_data=True, diff --git a/general/python/python-automat/patches/003-omit-tests.patch b/general/python/python-automat/patches/003-omit-tests.patch new file mode 100644 index 00000000..58eccf00 --- /dev/null +++ b/general/python/python-automat/patches/003-omit-tests.patch @@ -0,0 +1,19 @@ +--- a/setup.py ++++ b/setup.py +@@ -12,7 +12,7 @@ setup( + Self-service finite-state machines for the programmer on the go. + """.strip(), + readme='README.md', +- packages=find_packages(exclude=[]), ++ packages=find_packages(exclude=["*._test", "*._test.*"]), + package_dir={'automat': 'automat'}, + setup_requires=[ + 'wheel', +@@ -25,6 +25,7 @@ setup( + author='Glyph', + author_email='glyph@twistedmatrix.com', + include_package_data=True, ++ exclude_package_data={'':['_test/*']}, + license="MIT", + keywords='fsm finite state machine automata', + classifiers=[ diff --git a/general/python/python-awesomeversion/Makefile b/general/python/python-awesomeversion/Makefile new file mode 100644 index 00000000..8b09ce6f --- /dev/null +++ b/general/python/python-awesomeversion/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2021 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-awesomeversion +PKG_VERSION:=23.5.0 +PKG_RELEASE:=1 + +PYPI_NAME:=awesomeversion +PKG_HASH:=a505558316010d2d10d487226f79c1157204af00fa462fdcf948e347011dd491 + +PKG_MAINTAINER:=Josef Schlehofer +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENCE.md + +PKG_BUILD_DEPENDS:=python-poetry-core/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-awesomeversion + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Make anything a version object + URL:=https://github.com/ludeeus/awesomeversion + DEPENDS:=+python3-light +endef + +define Package/python3-awesomeversion/description +Make anything a version object, and compare against a vast selection of +other version formats. +endef + +$(eval $(call Py3Package,python3-awesomeversion)) +$(eval $(call BuildPackage,python3-awesomeversion)) +$(eval $(call BuildPackage,python3-awesomeversion-src)) diff --git a/general/python/python-awscli/Makefile b/general/python/python-awscli/Makefile new file mode 100644 index 00000000..e255b116 --- /dev/null +++ b/general/python/python-awscli/Makefile @@ -0,0 +1,40 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-awscli +PKG_VERSION:=1.29.7 +PKG_RELEASE:=1 + +PYPI_NAME:=awscli +PKG_HASH:=b3a7076cb317a21410a2d41734ba338add80f0480804cf9d68cbc52b1d39612a + +PKG_MAINTAINER:=Daniel Danzberger +PKG_LICENSE:=Apache-2.0 +PKG_LICENSE_FILES:=LICENSE.txt + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-awscli + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Universal Command Line Environment for AWS + URL:=https://github.com/aws/aws-cli + DEPENDS:=+python3 \ + +python3-botocore \ + +python3-colorama \ + +python3-docutils \ + +python3-rsa \ + +python3-s3transfer \ + +python3-yaml +endef + +define Package/python3-awscli/description +This package provides a unified command line interface to Amazon Web +Services. +endef + +$(eval $(call Py3Package,python3-awscli)) +$(eval $(call BuildPackage,python3-awscli)) +$(eval $(call BuildPackage,python3-awscli-src)) diff --git a/general/python/python-babel/Makefile b/general/python/python-babel/Makefile new file mode 100644 index 00000000..8968abb7 --- /dev/null +++ b/general/python/python-babel/Makefile @@ -0,0 +1,53 @@ +# +# Copyright (C) 2019-2021 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-babel +PKG_VERSION:=2.12.1 +PKG_RELEASE:=1 + +PYPI_NAME:=Babel +PKG_HASH:=cc2d99999cd01d44420ae725a21c9e3711b3aadc7976d6147f622d8581963455 + +PKG_MAINTAINER:=Josef Schlehofer +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=LICENSE + +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-babel + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Internationalization utilities + URL:=https://babel.pocoo.org/ + DEPENDS:= \ + +python3-decimal \ + +python3-distutils \ + +python3-email \ + +python3-light \ + +python3-logging \ + +python3-urllib +endef + +define Package/python3-babel/description + Babel is an integrated collection of utilities that assist in + internationalizing and localizing Python applications + with an emphasis on web-based applications. +endef + +$(eval $(call Py3Package,python3-babel)) +$(eval $(call BuildPackage,python3-babel)) +$(eval $(call BuildPackage,python3-babel-src)) +$(eval $(call HostBuild)) diff --git a/general/python/python-bcrypt/Makefile b/general/python/python-bcrypt/Makefile new file mode 100644 index 00000000..0d2a1d51 --- /dev/null +++ b/general/python/python-bcrypt/Makefile @@ -0,0 +1,41 @@ +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-bcrypt +PKG_VERSION:=4.1.2 +PKG_RELEASE:=1 + +PYPI_NAME:=bcrypt +PKG_HASH:=33313a1200a3ae90b75587ceac502b048b840fc69e7f7a0905b5f87fac7a1258 + +PKG_LICENSE:=Apache-2.0 +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Jeffery To + +PKG_BUILD_DEPENDS:=python-setuptools-rust/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-bcrypt + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Modern password hashing + URL:=https://github.com/pyca/bcrypt/ + DEPENDS:=+python3-light $(RUST_ARCH_DEPENDS) +endef + +define Package/python3-bcrypt/description +Acceptable password hashing for your software and your servers (but you +should really use argon2id or scrypt) +endef + +$(eval $(call Py3Package,python3-bcrypt)) +$(eval $(call BuildPackage,python3-bcrypt)) +$(eval $(call BuildPackage,python3-bcrypt-src)) diff --git a/general/python/python-bcrypt/test.sh b/general/python/python-bcrypt/test.sh new file mode 100644 index 00000000..0f59e743 --- /dev/null +++ b/general/python/python-bcrypt/test.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +[ "$1" = python3-bcrypt ] || exit 0 + +python3 - << 'EOF' + +import bcrypt +password = b"super secret password" +hashed = bcrypt.hashpw(password, bcrypt.gensalt()) +assert bcrypt.checkpw(password, hashed) + +EOF diff --git a/general/python/python-bidict/Makefile b/general/python/python-bidict/Makefile new file mode 100644 index 00000000..1e90deb0 --- /dev/null +++ b/general/python/python-bidict/Makefile @@ -0,0 +1,41 @@ +# +# Copyright (C) 2021 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-bidict +PKG_VERSION:=0.22.1 +PKG_RELEASE:=1 + +PYPI_NAME:=bidict +PKG_HASH:=1e0f7f74e4860e6d0943a05d4134c63a2fad86f3d4732fb265bd79e4e856d81d + +PKG_MAINTAINER:=Jan Pavlinec +PKG_LICENSE:=MPL-2.0 +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-bidict + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Bidirectional mapping library + URL:=https://bidict.readthedocs.io/ + DEPENDS:= \ + +python3-light +endef + +define Package/python3-bidict/description + The bidirectional mapping library for Python. +endef + +$(eval $(call Py3Package,python3-bidict)) +$(eval $(call BuildPackage,python3-bidict)) +$(eval $(call BuildPackage,python3-bidict-src)) diff --git a/general/python/python-ble2mqtt/Makefile b/general/python/python-ble2mqtt/Makefile new file mode 100644 index 00000000..f8610d55 --- /dev/null +++ b/general/python/python-ble2mqtt/Makefile @@ -0,0 +1,47 @@ +# +# Copyright (C) 2023 +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-ble2mqtt +PKG_VERSION:=0.2.2 +PKG_RELEASE:=1 + +PYPI_NAME:=ble2mqtt +PKG_HASH:=6c8abb4fe3d8ba77e42f23e4acdfbb99e337ed5bdea05db4e1b92d455186c8e6 + +PKG_MAINTAINER:=Quintin Hill +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-ble2mqtt + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Bluetooth to MQTT bridge + URL:=https://github.com/devbis/ble2mqtt/ + DEPENDS:=+python3-light +python3-aio-mqtt-mod +python3-asyncio +python3-bleak +python3-logging +python3-uuid +endef + +define Package/python3-ble2mqtt/description + Bluetooth to MQTT bridge, add your bluetooth-capable (including controllable) + devices to your smart home +endef + +define Py3Package/python3-ble2mqtt/install + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/ble2mqtt.init $(1)/etc/init.d/ble2mqtt + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/ +endef + +$(eval $(call Py3Package,python3-ble2mqtt)) +$(eval $(call BuildPackage,python3-ble2mqtt)) +$(eval $(call BuildPackage,python3-ble2mqtt-src)) diff --git a/general/python/python-ble2mqtt/files/ble2mqtt.init b/general/python/python-ble2mqtt/files/ble2mqtt.init new file mode 100755 index 00000000..e3651c0a --- /dev/null +++ b/general/python/python-ble2mqtt/files/ble2mqtt.init @@ -0,0 +1,15 @@ +#!/bin/sh /etc/rc.common + +START=98 +USE_PROCD=1 + +start_service() +{ + procd_open_instance + + procd_set_param env BLE2MQTT_CONFIG=/etc/ble2mqtt.json + procd_set_param command /usr/bin/ble2mqtt + procd_set_param stdout 1 + procd_set_param stderr 1 + procd_close_instance +} diff --git a/general/python/python-bleak/Makefile b/general/python/python-bleak/Makefile new file mode 100644 index 00000000..32550e28 --- /dev/null +++ b/general/python/python-bleak/Makefile @@ -0,0 +1,45 @@ +# +# Copyright (C) 2023 +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-bleak +PKG_VERSION:=0.21.1 +PKG_RELEASE:=2 + +PYPI_NAME:=bleak +PKG_HASH:=ec4a1a2772fb315b992cbaa1153070c7e26968a52b0e2727035f443a1af5c18f + +PKG_MAINTAINER:=Quintin Hill +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE + +PKG_BUILD_DEPENDS:=python-poetry-core/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-bleak + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Bluetooth Low Energy platform Agnostic Klient + URL:=https://github.com/hbldh/bleak + DEPENDS:=+python3-light +python3-async-timeout +python3-asyncio \ + +python3-dbus-fast +python3-ctypes +python3-typing-extensions +python3-logging +endef + +define Package/python3-bleak/description + Bleak is an acronym for Bluetooth Low Energy platform Agnostic Klient. + Bleak is a GATT client software, capable of connecting to BLE devices acting + as GATT servers. It is designed to provide a asynchronous, cross-platform + Python API to connect and communicate with e.g. sensors. +endef + +$(eval $(call Py3Package,python3-bleak)) +$(eval $(call BuildPackage,python3-bleak)) +$(eval $(call BuildPackage,python3-bleak-src)) diff --git a/general/python/python-boto3/Makefile b/general/python/python-boto3/Makefile new file mode 100644 index 00000000..ebc38ecd --- /dev/null +++ b/general/python/python-boto3/Makefile @@ -0,0 +1,41 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-boto3 +PKG_VERSION:=1.28.7 +PKG_RELEASE:=1 + +PYPI_NAME:=boto3 +PKG_HASH:=ef6a465d3b25b89bcd00ff69675b33917166145e544735dcb9978091f5b0b752 + +PKG_MAINTAINER:=Daniel Danzberger +PKG_LICENSE:=Apache-2.0 +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-boto3 + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=AWS SDK + URL:=https://github.com/boto/boto3 + DEPENDS:= \ + +python3-light \ + +python3-decimal \ + +python3-logging \ + +python3-botocore \ + +python3-jmespath \ + +python3-s3transfer +endef + +define Package/python3-boto3/description +Boto3 is the Amazon Web Services (AWS) Software Development Kit (SDK) +for Python, which allows Python developers to write software that makes +use of services like Amazon S3 and Amazon EC2. +endef + +$(eval $(call Py3Package,python3-boto3)) +$(eval $(call BuildPackage,python3-boto3)) +$(eval $(call BuildPackage,python3-boto3-src)) diff --git a/general/python/python-botocore/Makefile b/general/python/python-botocore/Makefile new file mode 100644 index 00000000..cf47f9ad --- /dev/null +++ b/general/python/python-botocore/Makefile @@ -0,0 +1,37 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-botocore +PKG_VERSION:=1.31.7 +PKG_RELEASE:=1 + +PYPI_NAME:=botocore +PKG_HASH:=f4473f66c153c262b8262404d737f4249366daf00fb068b495577a24b830ebcb + +PKG_MAINTAINER:=Daniel Danzberger +PKG_LICENSE:=Apache-2.0 +PKG_LICENSE_FILES:=LICENSE.txt + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-botocore + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Low-level, data-driven core of boto 3 + URL:=https://github.com/boto/botocore + DEPENDS:=+python3 \ + +python3-dateutil \ + +python3-jmespath \ + +python3-urllib3 +endef + +define Package/python3-botocore/description +A low-level interface to a growing number of Amazon Web Services. The +botocore package is the foundation for the AWS CLI as well as boto3. +endef + +$(eval $(call Py3Package,python3-botocore)) +$(eval $(call BuildPackage,python3-botocore)) +$(eval $(call BuildPackage,python3-botocore-src)) diff --git a/general/python/python-build/Makefile b/general/python/python-build/Makefile new file mode 100644 index 00000000..3b2ab65c --- /dev/null +++ b/general/python/python-build/Makefile @@ -0,0 +1,57 @@ +# +# 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-build +PKG_VERSION:=1.0.3 +PKG_RELEASE:=1 + +PYPI_NAME:=build +PKG_HASH:=538aab1b64f9828977f84bc63ae570b060a8ed1be419e7870b8b4fc5e6ea553b + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Jeffery To + +PKG_HOST_ONLY:=1 +HOST_BUILD_DEPENDS:= \ + python3/host \ + python-installer/host \ + python-flit-core/host \ + python-packaging/host \ + python-pyproject-hooks/host + +PYTHON3_HOST_BUILD_VARS:=PYTHONPATH=src + +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-build + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=A simple, correct Python build frontend + URL:=https://github.com/pypa/build + DEPENDS:=+python3-light +python3-logging + BUILDONLY:=1 +endef + +define Package/python3-build/description +A simple, correct PEP 517 build frontend. + +build will invoke the PEP 517 hooks to build a distribution package. It +is a simple build tool and does not perform any dependency management. +endef + +$(eval $(call Py3Package,python3-build)) +$(eval $(call BuildPackage,python3-build)) +$(eval $(call BuildPackage,python3-build-src)) +$(eval $(call HostBuild)) diff --git a/general/python/python-cached-property/Makefile b/general/python/python-cached-property/Makefile new file mode 100644 index 00000000..a95d298a --- /dev/null +++ b/general/python/python-cached-property/Makefile @@ -0,0 +1,33 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-cached-property +PKG_VERSION:=1.5.2 +PKG_RELEASE:=2 + +PYPI_NAME:=cached-property +PKG_HASH:=9fa5755838eecbb2d234c3aa390bd80fbd3ac6b6869109bfc1b499f7bd89a130 + +PKG_MAINTAINER:=Javier Marcet +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-cached-property + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=A decorator for caching properties in classes + URL:=https://github.com/pydanny/cached-property + DEPENDS:=+python3-light +endef + +define Package/python3-cached-property/description + A decorator for caching properties in classes. +endef + +$(eval $(call Py3Package,python3-cached-property)) +$(eval $(call BuildPackage,python3-cached-property)) +$(eval $(call BuildPackage,python3-cached-property-src)) diff --git a/general/python/python-cachelib/Makefile b/general/python/python-cachelib/Makefile new file mode 100644 index 00000000..6fcef3b4 --- /dev/null +++ b/general/python/python-cachelib/Makefile @@ -0,0 +1,38 @@ +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-cachelib +PKG_VERSION:=0.10.2 +PKG_RELEASE:=1 + +PYPI_NAME:=cachelib +PKG_HASH:=593faeee62a7c037d50fc835617a01b887503f972fb52b188ae7e50e9cb69740 + +PKG_MAINTAINER:=Stepan Henek +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=LICENSE.rst + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-cachelib + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Collection of cache libraries + URL:=https://github.com/pallets-eco/cachelib/ + DEPENDS:=+python3-light +python3-logging +endef + +define Package/python3-cachelib/description + A collection of cache libraries in the same API interface. + Extracted from werkzeug. +endef + +$(eval $(call Py3Package,python3-cachelib)) +$(eval $(call BuildPackage,python3-cachelib)) +$(eval $(call BuildPackage,python3-cachelib-src)) diff --git a/general/python/python-cachetools/Makefile b/general/python/python-cachetools/Makefile new file mode 100644 index 00000000..fbe2dff9 --- /dev/null +++ b/general/python/python-cachetools/Makefile @@ -0,0 +1,42 @@ +# +# Copyright (C) 2019 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-cachetools +PKG_VERSION:=5.3.1 +PKG_RELEASE:=1 + +PYPI_NAME:=cachetools +PKG_HASH:=dce83f2d9b4e1f732a8cd44af8e8fab2dbe46201467fc98b3ef8f269092bf62b + +PKG_MAINTAINER:=Josef Schlehofer +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-cachetools + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Extensible memoizing collections and decorators + URL:=https://github.com/tkem/cachetools + DEPENDS:=+python3-light +endef + +define Package/python3-cachetools/description +This module provides various memoizing collections and decorators, +including variants of the Python 3 Standard Library's @lru_cache +function decorator. +endef + +$(eval $(call Py3Package,python3-cachetools)) +$(eval $(call BuildPackage,python3-cachetools)) +$(eval $(call BuildPackage,python3-cachetools-src)) diff --git a/general/python/python-calver/Makefile b/general/python/python-calver/Makefile new file mode 100644 index 00000000..cd46859c --- /dev/null +++ b/general/python/python-calver/Makefile @@ -0,0 +1,48 @@ +# +# 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-calver +PKG_VERSION:=2022.6.26 +PKG_RELEASE:=1 + +PYPI_NAME:=calver +PKG_HASH:=e05493a3b17517ef1748fbe610da11f10485faa7c416b9d33fd4a52d74894f8b + +PKG_LICENSE:=Apache-2.0 +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-calver + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Setuptools extension for CalVer package versions + URL:=https://github.com/di/calver + DEPENDS:=+python3-light + BUILDONLY:=1 +endef + +define Package/python3-calver/description +The calver package is a setuptools extension for automatically defining +your Python package version as a calendar version. +endef + +$(eval $(call Py3Package,python3-calver)) +$(eval $(call BuildPackage,python3-calver)) +$(eval $(call BuildPackage,python3-calver-src)) +$(eval $(call HostBuild)) diff --git a/general/python/python-certifi/Makefile b/general/python/python-certifi/Makefile new file mode 100644 index 00000000..f31d34d2 --- /dev/null +++ b/general/python/python-certifi/Makefile @@ -0,0 +1,40 @@ +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-certifi +PKG_VERSION:=2024.2.2 +PKG_RELEASE:=1 + +PKG_MAINTAINER:=Eneas U de Queiroz +PKG_LICENSE:=MPL-2.0 +PKG_LICENSE_FILES:=LICENSE + +PYPI_NAME:=certifi +PKG_HASH:=0569859f95fc761b18b45ef421b1290a0f65f147e92a1e5eb3e635f9a5e4e66f + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-certifi + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Python package for Mozilla's CA Bundle + URL:=https://github.com/certifi/python-certifi + DEPENDS:=+python3-light +python3-urllib +endef + +define Package/python3-certifi/description +Certifi provides Mozilla's carefully curated collection of Root +Certificates for validating the trustworthiness of SSL certificates +while verifying the identity of TLS hosts. +endef + +$(eval $(call Py3Package,python3-certifi)) +$(eval $(call BuildPackage,python3-certifi)) +$(eval $(call BuildPackage,python3-certifi-src)) diff --git a/general/python/python-certifi/test.sh b/general/python/python-certifi/test.sh new file mode 100644 index 00000000..b2802165 --- /dev/null +++ b/general/python/python-certifi/test.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +case "$1" in + *-src) + ;; + python3-certifi) + BUNDLE=$(python3 -m certifi) || { + echo "Failed to run the certfi module script. Exit status=$?." >&2 + echo "Output='$BUNDLE'" >&2 + exit 1 + } + ls -l "$BUNDLE" + ;; + *) + echo "Unexpected package '$1'" >&2 + exit 1 + ;; +esac diff --git a/general/python/python-cffi/Makefile b/general/python/python-cffi/Makefile new file mode 100644 index 00000000..74020d15 --- /dev/null +++ b/general/python/python-cffi/Makefile @@ -0,0 +1,54 @@ +# +# Copyright (C) 2015-2016, 2018-2021, 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-cffi +PKG_VERSION:=1.16.0 +PKG_RELEASE:=1 + +PYPI_NAME:=cffi +PKG_HASH:=bcb3ef43e58665bbda2fb198698fcae6776483e0c4a631aa5647806c25e02cc0 + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Jeffery To + +HOST_BUILD_DEPENDS:= \ + python3/host \ + python-build/host \ + python-installer/host \ + python-wheel/host \ + python-pycparser/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-cffi + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=C Foreign Function Interface + URL:=https://cffi.readthedocs.org/ + DEPENDS:= \ + +libffi \ + +python3-light \ + +python3-ctypes \ + +python3-pycparser +endef + +define Package/python3-cffi/description +Foreign Function Interface for Python calling C code. +endef + +$(eval $(call Py3Package,python3-cffi)) +$(eval $(call BuildPackage,python3-cffi)) +$(eval $(call BuildPackage,python3-cffi-src)) +$(eval $(call HostBuild)) diff --git a/general/python/python-cffi/patches/001-unpin-setuptools.patch b/general/python/python-cffi/patches/001-unpin-setuptools.patch new file mode 100644 index 00000000..bf2774f5 --- /dev/null +++ b/general/python/python-cffi/patches/001-unpin-setuptools.patch @@ -0,0 +1,10 @@ +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -2,6 +2,6 @@ + requires = [ + # first version that supports Python 3.12; older versions may work + # with previous Python versions, but are not tested +- "setuptools >= 66.1" ++ "setuptools" + ] + build-backend = "setuptools.build_meta" diff --git a/general/python/python-cffi/test.sh b/general/python/python-cffi/test.sh new file mode 100644 index 00000000..48ea3adb --- /dev/null +++ b/general/python/python-cffi/test.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +[ "$1" = python3-cffi ] || exit 0 + +python3 - << EOF +from cffi import FFI +ffibuilder = FFI() +EOF diff --git a/general/python/python-chardet/Makefile b/general/python/python-chardet/Makefile new file mode 100644 index 00000000..8f9703cd --- /dev/null +++ b/general/python/python-chardet/Makefile @@ -0,0 +1,47 @@ +# +# Copyright (C) 2007-2017 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-chardet +PKG_VERSION:=5.2.0 +PKG_RELEASE:=1 +PKG_LICENSE:=LGPL-2.1 + +PYPI_NAME:=chardet +PKG_HASH:=1b3b6ff479a8c414bc3fa2c0852995695c4a026dcd6d0633b2dd092ca39c1cf7 + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-chardet + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + MAINTAINER:=Alexandru Ardelean + URL:=https://github.com/chardet/chardet + TITLE:=Universal encoding detector + DEPENDS:=+python3-light +python3-logging +endef + +define Package/python3-chardet/description + Universal encoding detector for Python +endef + +define Py3Package/python3-chardet/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/ + for bin in $(1)/usr/bin/*; do \ + mv $$$$bin $$$${bin}3 ; \ + $(LN) $$$${bin##*/}3 $$$$bin ; \ + done +endef + +$(eval $(call Py3Package,python3-chardet)) +$(eval $(call BuildPackage,python3-chardet)) +$(eval $(call BuildPackage,python3-chardet-src)) diff --git a/general/python/python-charset-normalizer/Makefile b/general/python/python-charset-normalizer/Makefile new file mode 100644 index 00000000..4ba811e9 --- /dev/null +++ b/general/python/python-charset-normalizer/Makefile @@ -0,0 +1,43 @@ +# +# 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-charset-normalizer +PKG_VERSION:=3.3.2 +PKG_RELEASE:=1 + +PYPI_NAME:=charset-normalizer +PKG_HASH:=f30c3cb33b24454a82faecaf01b19c18562b1e89558fb6c56de4d9118a032fd5 + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Jeffery To + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-charset-normalizer + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Real First Universal Charset Detector + URL:=https://github.com/Ousret/charset_normalizer + DEPENDS:=+python3-light +python3-codecs +python3-logging +endef + +define Package/python3-charset-normalizer/description +A library that helps you read text from an unknown charset encoding. +Motivated by chardet, I'm trying to resolve the issue by taking a new +approach. All IANA character set names for which the Python core library +provides codecs are supported. +endef + +$(eval $(call Py3Package,python3-charset-normalizer)) +$(eval $(call BuildPackage,python3-charset-normalizer)) +$(eval $(call BuildPackage,python3-charset-normalizer-src)) diff --git a/general/python/python-charset-normalizer/test.sh b/general/python/python-charset-normalizer/test.sh new file mode 100644 index 00000000..398b017c --- /dev/null +++ b/general/python/python-charset-normalizer/test.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +[ "$1" = python3-charset-normalizer ] || exit 0 + +python3 - << 'EOF' + +from charset_normalizer import from_bytes +s = 'Bсеки човек има право на образование.' +byte_str = s.encode('cp1251') +result = from_bytes(byte_str).best() +assert str(result) == s + +EOF diff --git a/general/python/python-ciso8601/Makefile b/general/python/python-ciso8601/Makefile new file mode 100644 index 00000000..ddcb41ce --- /dev/null +++ b/general/python/python-ciso8601/Makefile @@ -0,0 +1,42 @@ +# +# Copyright (C) 2020 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-ciso8601 +PKG_VERSION:=2.3.0 +PKG_RELEASE:=1 + +PYPI_NAME:=ciso8601 +PKG_HASH:=19e3fbd786d8bec3358eac94d8774d365b694b604fd1789244b87083f66c8900 + +PKG_MAINTAINER:=Josef Schlehofer +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-ciso8601 + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Fast ISO8601 date time parser written in C + URL:=https://github.com/closeio/ciso8601 + DEPENDS:=+python3-light +endef + +define Package/python3-ciso8601/description +ciso8601 converts ISO 8601 or RFC 3339 date time strings into Python +datetime objects. +endef + +$(eval $(call Py3Package,python3-ciso8601)) +$(eval $(call BuildPackage,python3-ciso8601)) +$(eval $(call BuildPackage,python3-ciso8601-src)) + diff --git a/general/python/python-click-log/Makefile b/general/python/python-click-log/Makefile new file mode 100644 index 00000000..4ad7c125 --- /dev/null +++ b/general/python/python-click-log/Makefile @@ -0,0 +1,36 @@ +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-click-log +PKG_VERSION:=0.4.0 +PKG_RELEASE:=1 +PKG_MAINTAINER:=Josef Schlehofer   + +PYPI_NAME:=click-log +PKG_HASH:=3970f8570ac54491237bcdb3d8ab5e3eef6c057df29f8c3d1151a51a9c23b975 +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-click-log + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + URL:=https://github.com/click-contrib/click-log + TITLE:=Logging integration for Click + DEPENDS:=+python3-light +python3-logging +python3-click +endef + +define Package/python3-click-log/description + Simple and beautiful logging for click applications +endef + +$(eval $(call Py3Package,python3-click-log)) +$(eval $(call BuildPackage,python3-click-log)) +$(eval $(call BuildPackage,python3-click-log-src)) diff --git a/general/python/python-click/Makefile b/general/python/python-click/Makefile new file mode 100644 index 00000000..a0807fa9 --- /dev/null +++ b/general/python/python-click/Makefile @@ -0,0 +1,40 @@ +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-click +PKG_VERSION:=8.1.7 +PKG_RELEASE:=1 + +PYPI_NAME:=click +PKG_HASH:=ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de + +PKG_MAINTAINER:=Jeffery To +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=LICENSE.rst + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-click + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Composable command line interface toolkit + URL:=https://palletsprojects.com/p/click/ + DEPENDS:=+python3-light +python3-urllib +python3-uuid +endef + +define Package/python3-click/description +Click is a Python package for creating beautiful command line interfaces +in a composable way with as little code as necessary. It's the "Command +Line Interface Creation Kit". It's highly configurable but comes with +sensible defaults out of the box. +endef + +$(eval $(call Py3Package,python3-click)) +$(eval $(call BuildPackage,python3-click)) +$(eval $(call BuildPackage,python3-click-src)) diff --git a/general/python/python-colorama/Makefile b/general/python/python-colorama/Makefile new file mode 100644 index 00000000..fca74e00 --- /dev/null +++ b/general/python/python-colorama/Makefile @@ -0,0 +1,36 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-colorama +PKG_VERSION:=0.4.6 +PKG_RELEASE:=1 + +PYPI_NAME:=colorama +PKG_HASH:=08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44 + +PKG_MAINTAINER:=Daniel Danzberger +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=LICENSE.txt + +PKG_BUILD_DEPENDS:=python-hatchling/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-colorama + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Cross-platform colored terminal text + URL:=https://github.com/tartley/colorama + DEPENDS:=+python3-light +endef + +define Package/python3-colorama/description +Makes ANSI escape character sequences (for producing colored terminal +text and cursor positioning) work under MS Windows. +endef + +$(eval $(call Py3Package,python3-colorama)) +$(eval $(call BuildPackage,python3-colorama)) +$(eval $(call BuildPackage,python3-colorama-src)) diff --git a/general/python/python-constantly/Makefile b/general/python/python-constantly/Makefile new file mode 100644 index 00000000..f0cd2465 --- /dev/null +++ b/general/python/python-constantly/Makefile @@ -0,0 +1,44 @@ +# +# Copyright (C) 2018, 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-constantly +PKG_VERSION:=23.10.4 +PKG_RELEASE:=1 + +PYPI_NAME:=constantly +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 + +define Package/python3-constantly + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Symbolic constants in Python + URL:=https://github.com/twisted/constantly + DEPENDS:=+python3-light +endef + +define Package/python3-constantly/description +A library that provides symbolic constant support. It includes +collections and constants with text, numeric, and bit flag values. +Originally twisted.python.constants from the Twisted project. +endef + +$(eval $(call Py3Package,python3-constantly)) +$(eval $(call BuildPackage,python3-constantly)) +$(eval $(call BuildPackage,python3-constantly-src)) diff --git a/general/python/python-constantly/patches/001-unpin-setuptools.patch b/general/python/python-constantly/patches/001-unpin-setuptools.patch new file mode 100644 index 00000000..9d890abc --- /dev/null +++ b/general/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/general/python/python-constantly/test.sh b/general/python/python-constantly/test.sh new file mode 100644 index 00000000..d6b367cc --- /dev/null +++ b/general/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 diff --git a/general/python/python-contextlib2/Makefile b/general/python/python-contextlib2/Makefile new file mode 100644 index 00000000..499ef00e --- /dev/null +++ b/general/python/python-contextlib2/Makefile @@ -0,0 +1,38 @@ +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-contextlib2 +PKG_VERSION:=21.6.0 +PKG_RELEASE:=1 + +PYPI_NAME:=contextlib2 +PKG_HASH:=ab1e2bfe1d01d968e1b7e8d9023bc51ef3509bba217bb730cee3827e1ee82869 + +PKG_MAINTAINER:=Josef Schlehofer   +PKG_LICENSE:=PSF-2.0 Apache-2.0 +PKG_LICENSE_FILES:=LICENSE.txt + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-contextlib2 + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + URL:=https://contextlib2.readthedocs.org + TITLE:=Backports and enhancements for the contextlib module + DEPENDS:=+python3-light +endef + +define Package/python-contextlib2/description +contextlib2 is a backport of the standard library's contextlib module to +earlier Python versions. +endef + +$(eval $(call Py3Package,python3-contextlib2)) +$(eval $(call BuildPackage,python3-contextlib2)) +$(eval $(call BuildPackage,python3-contextlib2-src)) diff --git a/general/python/python-crcmod/Makefile b/general/python/python-crcmod/Makefile new file mode 100644 index 00000000..6d4ded9c --- /dev/null +++ b/general/python/python-crcmod/Makefile @@ -0,0 +1,36 @@ +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-crcmod +PKG_VERSION:=1.7 +PKG_RELEASE:=2 + +PYPI_NAME:=crcmod +PKG_HASH:=dc7051a0db5f2bd48665a990d3ec1cc305a466a77358ca4492826f41f283601e + +PKG_LICENSE:=MIT +PKG_MAINTAINER:=David Bauer + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-crcmod + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=python3-crcmod + URL:=http://crcmod.sourceforge.net/ + DEPENDS:=+python3-light +endef + +define Package/python3-crcmod/description +The software in this package is a Python module for generating +objects that compute the Cyclic Redundancy Check (CRC). +endef + +$(eval $(call Py3Package,python3-crcmod)) +$(eval $(call BuildPackage,python3-crcmod)) +$(eval $(call BuildPackage,python3-crcmod-src)) diff --git a/general/python/python-cryptodome/Makefile b/general/python/python-cryptodome/Makefile new file mode 100644 index 00000000..3ce76c2e --- /dev/null +++ b/general/python/python-cryptodome/Makefile @@ -0,0 +1,43 @@ +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-cryptodome +PKG_VERSION:=3.18.0 +PKG_RELEASE:=1 + +PYPI_NAME:=pycryptodome +PKG_HASH:=c9adee653fc882d98956e33ca2c1fb582e23a8af7ac82fee75bd6113c55a0413 + +PKG_LICENSE:=Public-Domain BSD-2-Clause +PKG_LICENSE_FILES:=LICENSE.rst +PKG_MAINTAINER:=Richard Yu +PKG_CPE_ID:=cpe:/a:pycryptodome:pycryptodome + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +PYTHON3_PKG_BUILD_VARS:= \ + CONFIG_BIG_ENDIAN="$(CONFIG_BIG_ENDIAN)" + +define Package/python3-cryptodome + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Self-contained cryptographic library + URL:=https://www.pycryptodome.org/ + DEPENDS:=+libgmp +python3-light +python3-cffi + PROVIDES:=python3-crypto +endef + +define Package/python3-cryptodome/description +PyCryptodome is a self-contained Python package of low-level +cryptographic primitives. +endef + +$(eval $(call Py3Package,python3-cryptodome)) +$(eval $(call BuildPackage,python3-cryptodome)) +$(eval $(call BuildPackage,python3-cryptodome-src)) diff --git a/general/python/python-cryptodome/patches/001-fix-libgmp-loading.patch b/general/python/python-cryptodome/patches/001-fix-libgmp-loading.patch new file mode 100644 index 00000000..a0d9674b --- /dev/null +++ b/general/python/python-cryptodome/patches/001-fix-libgmp-loading.patch @@ -0,0 +1,11 @@ +--- a/lib/Crypto/Math/_IntegerGMP.py ++++ b/lib/Crypto/Math/_IntegerGMP.py +@@ -97,7 +97,7 @@ gmp_defs = """typedef unsigned long UNIX + if sys.platform == "win32": + raise ImportError("Not using GMP on Windows") + +-lib = load_lib("gmp", gmp_defs) ++lib = load_lib("libgmp.so.10", gmp_defs) + implementation = {"library": "gmp", "api": backend} + + if hasattr(lib, "__mpir_version"): diff --git a/general/python/python-cryptodome/patches/002-omit-tests.patch b/general/python/python-cryptodome/patches/002-omit-tests.patch new file mode 100644 index 00000000..43e2cc3d --- /dev/null +++ b/general/python/python-cryptodome/patches/002-omit-tests.patch @@ -0,0 +1,12 @@ +--- a/setup.py ++++ b/setup.py +@@ -276,6 +276,9 @@ package_data = { + "Crypto.Util" : [ "*.pyi" ], + } + ++packages = [i for i in packages if not i.startswith('Crypto.SelfTest')] ++package_data = {k: v for k, v in package_data.items() if not k.startswith('Crypto.SelfTest')} ++ + ext_modules = [ + # Hash functions + Extension("Crypto.Hash._MD2", diff --git a/general/python/python-cryptodomex/Makefile b/general/python/python-cryptodomex/Makefile new file mode 100644 index 00000000..4fb5fe0f --- /dev/null +++ b/general/python/python-cryptodomex/Makefile @@ -0,0 +1,42 @@ +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-cryptodomex +PKG_VERSION:=3.18.0 +PKG_RELEASE:=1 + +PYPI_NAME:=pycryptodomex +PKG_HASH:=3e3ecb5fe979e7c1bb0027e518340acf7ee60415d79295e5251d13c68dde576e + +PKG_LICENSE:=Public-Domain BSD-2-Clause +PKG_LICENSE_FILES:=LICENSE.rst +PKG_MAINTAINER:=Richard Yu +PKG_CPE_ID:=cpe:/a:pycryptodome:pycryptodomex + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +PYTHON3_PKG_BUILD_VARS:= \ + CONFIG_BIG_ENDIAN="$(CONFIG_BIG_ENDIAN)" + +define Package/python3-cryptodomex + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Self-contained cryptographic library + URL:=https://www.pycryptodome.org/ + DEPENDS:=+libgmp +python3-light +python3-cffi +endef + +define Package/python3-cryptodomex/description +PyCryptodome is a self-contained Python package of low-level +cryptographic primitives. +endef + +$(eval $(call Py3Package,python3-cryptodomex)) +$(eval $(call BuildPackage,python3-cryptodomex)) +$(eval $(call BuildPackage,python3-cryptodomex-src)) diff --git a/general/python/python-cryptodomex/patches/001-fix-libgmp-loading.patch b/general/python/python-cryptodomex/patches/001-fix-libgmp-loading.patch new file mode 100644 index 00000000..305ef696 --- /dev/null +++ b/general/python/python-cryptodomex/patches/001-fix-libgmp-loading.patch @@ -0,0 +1,11 @@ +--- a/lib/Cryptodome/Math/_IntegerGMP.py ++++ b/lib/Cryptodome/Math/_IntegerGMP.py +@@ -97,7 +97,7 @@ gmp_defs = """typedef unsigned long UNIX + if sys.platform == "win32": + raise ImportError("Not using GMP on Windows") + +-lib = load_lib("gmp", gmp_defs) ++lib = load_lib("libgmp.so.10", gmp_defs) + implementation = {"library": "gmp", "api": backend} + + if hasattr(lib, "__mpir_version"): diff --git a/general/python/python-cryptodomex/patches/002-omit-tests.patch b/general/python/python-cryptodomex/patches/002-omit-tests.patch new file mode 100644 index 00000000..43e2cc3d --- /dev/null +++ b/general/python/python-cryptodomex/patches/002-omit-tests.patch @@ -0,0 +1,12 @@ +--- a/setup.py ++++ b/setup.py +@@ -276,6 +276,9 @@ package_data = { + "Crypto.Util" : [ "*.pyi" ], + } + ++packages = [i for i in packages if not i.startswith('Crypto.SelfTest')] ++package_data = {k: v for k, v in package_data.items() if not k.startswith('Crypto.SelfTest')} ++ + ext_modules = [ + # Hash functions + Extension("Crypto.Hash._MD2", diff --git a/general/python/python-cryptography/Makefile b/general/python/python-cryptography/Makefile new file mode 100644 index 00000000..c8b1950d --- /dev/null +++ b/general/python/python-cryptography/Makefile @@ -0,0 +1,52 @@ +# +# Copyright (C) 2015-2016, 2018-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-cryptography +PKG_VERSION:=41.0.7 +PKG_RELEASE:=1 + +PYPI_NAME:=cryptography +PKG_HASH:=13f93ce9bea8016c253b34afc6bd6a75993e5c40672ed5405a9c832f0d4a00bc + +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 + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-cryptography + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Cryptographic recipes and primitives + URL:=https://github.com/pyca/cryptography + DEPENDS:= \ + +libopenssl \ + +libopenssl-legacy \ + +python3-light \ + +python3-email \ + +python3-urllib \ + +python3-cffi \ + $(RUST_ARCH_DEPENDS) +endef + +define Package/python3-cryptography/description +cryptography is a package which provides cryptographic recipes and +primitives to Python developers. Our goal is for it to be your +"cryptographic standard library". +endef + +$(eval $(call Py3Package,python3-cryptography)) +$(eval $(call BuildPackage,python3-cryptography)) +$(eval $(call BuildPackage,python3-cryptography-src)) diff --git a/general/python/python-cryptography/patches/001-Update-ouroboros.patch b/general/python/python-cryptography/patches/001-Update-ouroboros.patch new file mode 100644 index 00000000..93abe3a4 --- /dev/null +++ b/general/python/python-cryptography/patches/001-Update-ouroboros.patch @@ -0,0 +1,13 @@ +Fixes https://rustsec.org/advisories/RUSTSEC-2023-0042.html + +--- a/src/rust/Cargo.toml ++++ b/src/rust/Cargo.toml +@@ -15,7 +15,7 @@ cryptography-cffi = { path = "cryptograp + cryptography-x509 = { path = "cryptography-x509" } + cryptography-openssl = { path = "cryptography-openssl" } + pem = "1.1" +-ouroboros = "0.15" ++ouroboros = "0.18" + openssl = "0.10.54" + openssl-sys = "0.9.88" + foreign-types-shared = "0.1" diff --git a/general/python/python-cryptography/test.sh b/general/python/python-cryptography/test.sh new file mode 100644 index 00000000..308f5456 --- /dev/null +++ b/general/python/python-cryptography/test.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +[ "$1" = python3-cryptography ] || exit 0 + +python3 - << 'EOF' + +from cryptography.fernet import Fernet +key = Fernet.generate_key() +f = Fernet(key) +msg = b"my deep dark secret" +token = f.encrypt(msg) +assert f.decrypt(token) == msg + +EOF diff --git a/general/python/python-curl/Makefile b/general/python/python-curl/Makefile new file mode 100644 index 00000000..b239efd3 --- /dev/null +++ b/general/python/python-curl/Makefile @@ -0,0 +1,53 @@ +# +# This is free software, licensed under the GNU General Public License v2. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=pycurl +PKG_VERSION:=7.45.2 +PKG_RELEASE:=3 + +PYPI_NAME:=$(PKG_NAME) +PKG_HASH:=5730590be0271364a5bddd9e245c9cc0fb710c4cbacbdd95264a3122d23224ca + +PKG_MAINTAINER:=Waldemar Konik +PKG_LICENSE:=LGPL-2.1 +PKG_LICENSE_FILES:=COPYING-LGPL + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-curl + CATEGORY:=Languages + SECTION:=lang + SUBMENU:=Python + TITLE:=Python module interface to the cURL library + URL:=http://pycurl.io/ + DEPENDS:=+libcurl +python3 +endef + +define Package/python3-curl/description +PycURL is a Python interface to libcurl, the multiprotocol file transfer library. +endef + +ifdef CONFIG_LIBCURL_OPENSSL + PYTHON3_PKG_BUILD_VARS:=PYCURL_SSL_LIBRARY=openssl +endif + +ifdef CONFIG_LIBCURL_GNUTLS + PYTHON3_PKG_BUILD_VARS:=PYCURL_SSL_LIBRARY=gnutls +endif + +ifdef CONFIG_LIBCURL_MBEDTLS + PYTHON3_PKG_BUILD_VARS:=PYCURL_SSL_LIBRARY=mbedtls +endif + +ifdef CONFIG_LIBCURL_WOLFSSL + PYTHON3_PKG_BUILD_VARS:=PYCURL_SSL_LIBRARY=wolfssl +endif + +$(eval $(call Py3Package,python3-curl)) +$(eval $(call BuildPackage,python3-curl)) +$(eval $(call BuildPackage,python3-curl-src)) diff --git a/general/python/python-curl/patches/100_macos_compat.patch b/general/python/python-curl/patches/100_macos_compat.patch new file mode 100644 index 00000000..ba5e0b8d --- /dev/null +++ b/general/python/python-curl/patches/100_macos_compat.patch @@ -0,0 +1,15 @@ +Support build on MacOS +This patch should be deleted after resolving https://github.com/pycurl/pycurl/issues/727 +--- +--- a/setup.py ++++ b/setup.py +@@ -341,9 +341,6 @@ ignore this message.''') + if not self.libraries: + self.libraries.append("curl") + +- # Add extra compile flag for MacOS X +- if sys.platform.startswith('darwin'): +- self.extra_link_args.append("-flat_namespace") + + # Recognize --avoid-stdio on Unix so that it can be tested + self.check_avoid_stdio() diff --git a/general/python/python-cython/Makefile b/general/python/python-cython/Makefile new file mode 100644 index 00000000..76b22f0a --- /dev/null +++ b/general/python/python-cython/Makefile @@ -0,0 +1,57 @@ +# +# 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-cython +PKG_VERSION:=3.0.10 +PKG_RELEASE:=1 + +PYPI_NAME:=Cython +PKG_HASH:=dcc96739331fb854dcf503f94607576cfe8488066c61ca50dfd55836f132de99 + +PKG_LICENSE:=Apache-2.0 +PKG_LICENSE_FILES:=LICENSE.txt +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-cython + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Cython compiler for writing C extensions + URL:=https://cython.org/ + DEPENDS:=+python3 + BUILDONLY:=1 +endef + +define Package/python3-cython/description +Cython is a language that makes writing C extensions for Python as easy +as Python itself. Cython is based on Pyrex, but supports more cutting +edge functionality and optimizations. + +The Cython language is very close to the Python language, but Cython +additionally supports calling C functions and declaring C types on +variables and class attributes. This allows the compiler to generate +very efficient C code from Cython code. + +This makes Cython the ideal language for wrapping external C libraries, +and for fast C modules that speed up the execution of Python code. +endef + +$(eval $(call Py3Package,python3-cython)) +$(eval $(call BuildPackage,python3-cython)) +$(eval $(call BuildPackage,python3-cython-src)) +$(eval $(call HostBuild)) diff --git a/general/python/python-dateutil/Makefile b/general/python/python-dateutil/Makefile new file mode 100644 index 00000000..8d06c49a --- /dev/null +++ b/general/python/python-dateutil/Makefile @@ -0,0 +1,41 @@ +# +# Copyright (C) 2007-2017 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-dateutil +PKG_VERSION:=2.9.0.post0 +PKG_RELEASE:=1 +PKG_LICENSE:=BSD-2-Clause + +PYPI_NAME:=$(PKG_NAME) +PKG_HASH:=37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3 +PKG_MAINTAINER:=Alexandru Ardelean + +PKG_BUILD_DEPENDS:=python-setuptools-scm/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk + +include ../python3-package.mk + +define Package/python3-dateutil + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Extensions to the standard Python datetime module + URL:=https://dateutil.readthedocs.org/ + DEPENDS:=+python3 +python3-six +endef + +define Package/python3-dateutil/description + Extensions to the standard Python datetime module +endef + +$(eval $(call Py3Package,python3-dateutil)) +$(eval $(call BuildPackage,python3-dateutil)) +$(eval $(call BuildPackage,python3-dateutil-src)) diff --git a/general/python/python-dbus-fast/Makefile b/general/python/python-dbus-fast/Makefile new file mode 100644 index 00000000..a0f653d3 --- /dev/null +++ b/general/python/python-dbus-fast/Makefile @@ -0,0 +1,45 @@ +# +# Copyright (C) 2023 +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-dbus-fast +PKG_VERSION:=2.21.1 +PKG_RELEASE:=1 + +PYPI_NAME:=dbus-fast +PYPI_SOURCE_NAME:=dbus_fast +PKG_HASH:=87b852d2005f1d59399ca51c5f3538f28a4742d739d7abe82b7ae8d01d8a5d02 + +PKG_MAINTAINER:=Quintin Hill +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE + +PKG_BUILD_DEPENDS:=python-poetry-core/host python-cython/host python-wheel/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-dbus-fast + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=A faster version of dbus-next + URL:=https://github.com/Bluetooth-Devices/dbus-fast + DEPENDS:=+python3-light +python3-async-timeout +python3-asyncio \ + +python3-logging +python3-urllib +python3-xml +endef + +define Package/python3-dbus-fast/description + dbus-fast is a Python library for DBus that aims to be a performant fully + featured high level library primarily geared towards integration of + applications into Linux desktop and mobile environments. +endef + +$(eval $(call Py3Package,python3-dbus-fast)) +$(eval $(call BuildPackage,python3-dbus-fast)) +$(eval $(call BuildPackage,python3-dbus-fast-src)) diff --git a/general/python/python-decorator/Makefile b/general/python/python-decorator/Makefile new file mode 100644 index 00000000..de2a49a1 --- /dev/null +++ b/general/python/python-decorator/Makefile @@ -0,0 +1,31 @@ +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-decorator +PKG_VERSION:=4.4.2 +PKG_RELEASE:=1 +PKG_MAINTAINER:=Josef Schlehofer   +PKG_CPE_ID:=cpe:/a:python:decorator + +PYPI_NAME:=decorator +PKG_HASH:=e3a62f0520172440ca0dcc823749319382e377f37f140a0b99ef45fecb84bfe7 + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-decorator + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + URL:=https://github.com/micheles/decorator + TITLE:=python3-decodator + DEPENDS:=+python3-light +endef + +$(eval $(call Py3Package,python3-decorator)) +$(eval $(call BuildPackage,python3-decorator)) +$(eval $(call BuildPackage,python3-decorator-src)) diff --git a/general/python/python-defusedxml/Makefile b/general/python/python-defusedxml/Makefile new file mode 100644 index 00000000..1e233955 --- /dev/null +++ b/general/python/python-defusedxml/Makefile @@ -0,0 +1,41 @@ +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-defusedxml +PKG_VERSION:=0.7.1 +PKG_RELEASE:=1 + +PKG_MAINTAINER:=Eneas U de Queiroz +PKG_LICENSE:=Python-2.0 +PKG_LICENSE_FILES:=LICENSE + +PYPI_NAME:=defusedxml +PKG_HASH:=1bb3032db185915b62d7c6209c5a8792be6a32ab2fedacc84e01b52c51aa3e69 + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-defusedxml + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=XML bomb protection for Python + URL:=https://github.com/tiran/defusedxml + DEPENDS:= \ + +python3-light \ + +python3-xml +endef + +define Package/python3-defusedxml/description + The defusedxml package contains several Python-only workarounds and fixes for + denial of service and other vulnerabilities in Python’s XML libraries. +endef + +$(eval $(call Py3Package,python3-defusedxml)) +$(eval $(call BuildPackage,python3-defusedxml)) +$(eval $(call BuildPackage,python3-defusedxml-src)) diff --git a/general/python/python-distro/Makefile b/general/python/python-distro/Makefile new file mode 100644 index 00000000..9312ba7d --- /dev/null +++ b/general/python/python-distro/Makefile @@ -0,0 +1,34 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-distro +PKG_VERSION:=1.9.0 +PKG_RELEASE:=1 + +PYPI_NAME:=distro +PKG_HASH:=2fa77c6fd8940f116ee1d6b94a2f90b13b5ea8d019b98bc8bafdcabcdd9bdbed + +PKG_MAINTAINER:=Javier Marcet +PKG_LICENSE:=Apache-2.0 +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-distro + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=OS platform information API + URL:=https://github.com/python-distro/distro + DEPENDS:=+python3-light +python3-logging +endef + +define Package/python3-distro/description +distro provides information about the OS distribution it runs on, such +as a reliable machine-readable ID, or version information. +endef + +$(eval $(call Py3Package,python3-distro)) +$(eval $(call BuildPackage,python3-distro)) +$(eval $(call BuildPackage,python3-distro-src)) diff --git a/general/python/python-dns/Makefile b/general/python/python-dns/Makefile new file mode 100644 index 00000000..03fbffee --- /dev/null +++ b/general/python/python-dns/Makefile @@ -0,0 +1,44 @@ +# +# Copyright (C) 2014 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-dns +PKG_VERSION:=2.4.1 +PKG_RELEASE:=1 + +PYPI_NAME:=dnspython +PKG_HASH:=c33971c79af5be968bb897e95c2448e11a645ee84d93b265ce0b7aabe5dfdca8 + +PKG_LICENSE:=ISC +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Josef Schlehofer + +PKG_BUILD_DEPENDS:=python-poetry-core/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-dns + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=DNS toolkit + URL:=https://www.dnspython.org/ + DEPENDS:=+python3 +endef + +define Package/python3-dns/description +dnspython is a DNS toolkit for Python. It supports almost all record +types. It can be used for queries, zone transfers, and dynamic updates. +It supports TSIG authenticated messages and EDNS0. +endef + +$(eval $(call Py3Package,python3-dns)) +$(eval $(call BuildPackage,python3-dns)) +$(eval $(call BuildPackage,python3-dns-src)) diff --git a/general/python/python-docker/Makefile b/general/python/python-docker/Makefile new file mode 100644 index 00000000..f8220a27 --- /dev/null +++ b/general/python/python-docker/Makefile @@ -0,0 +1,41 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-docker +PKG_VERSION:=7.0.0 +PKG_RELEASE:=1 + +PYPI_NAME:=docker +PKG_HASH:=323736fb92cd9418fc5e7133bc953e11a9da04f4483f828b527db553f1e7e5a3 + +PKG_MAINTAINER:=Javier Marcet +PKG_LICENSE:=Apache-2.0 +PKG_LICENSE_FILES:=LICENSE +PKG_CPE_ID:=cpe:/a:docker:docker-py + +PKG_BUILD_DEPENDS:=python-setuptools-scm/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-docker + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=A Python library for the Docker Engine API + URL:=https://github.com/docker/docker-py + DEPENDS:=\ + +python3-light +python3-distutils +python3-logging \ + +python3-openssl +python3-packaging +python3-paramiko +python3-six \ + +python3-requests +python3-urllib3 +python3-websocket-client +endef + +define Package/python3-docker/description + A Python library for the Docker Engine API. It lets you do anything the + docker command does, but from within Python apps – run containers manage + containers, manage Swarms, etc. +endef + +$(eval $(call Py3Package,python3-docker)) +$(eval $(call BuildPackage,python3-docker)) +$(eval $(call BuildPackage,python3-docker-src)) diff --git a/general/python/python-dockerpty/Makefile b/general/python/python-dockerpty/Makefile new file mode 100644 index 00000000..8addc132 --- /dev/null +++ b/general/python/python-dockerpty/Makefile @@ -0,0 +1,33 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-dockerpty +PKG_VERSION:=0.4.1 +PKG_RELEASE:=4 + +PYPI_NAME:=dockerpty +PKG_HASH:=69a9d69d573a0daa31bcd1c0774eeed5c15c295fe719c61aca550ed1393156ce + +PKG_MAINTAINER:=Javier Marcet +PKG_LICENSE:=Apache-2.0 +PKG_LICENSE_FILES:=LICENSE.txt + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-dockerpty + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Python library to use the pseudo-tty of a docker container + URL:=https://github.com/d11wtq/dockerpty + DEPENDS:=+python3-light +python3-openssl +python3-six +endef + +define Package/python3-dockerpty/description + Python library to use the pseudo-tty of a docker container +endef + +$(eval $(call Py3Package,python3-dockerpty)) +$(eval $(call BuildPackage,python3-dockerpty)) +$(eval $(call BuildPackage,python3-dockerpty-src)) diff --git a/general/python/python-docopt/Makefile b/general/python/python-docopt/Makefile new file mode 100644 index 00000000..fa6e9824 --- /dev/null +++ b/general/python/python-docopt/Makefile @@ -0,0 +1,33 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-docopt +PKG_VERSION:=0.6.2 +PKG_RELEASE:=3 + +PYPI_NAME:=docopt +PKG_HASH:=49b3a825280bd66b3aa83585ef59c4a8c82f2c8a522dbe754a8bc8d08c85c491 + +PKG_MAINTAINER:=Javier Marcet +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE-MIT + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-docopt + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Pythonic argument parser, that will make you smile + URL:=http://docopt.org/ + DEPENDS:=+python3-light +endef + +define Package/python3-docopt/description + Pythonic argument parser, that will make you smile +endef + +$(eval $(call Py3Package,python3-docopt)) +$(eval $(call BuildPackage,python3-docopt)) +$(eval $(call BuildPackage,python3-docopt-src)) diff --git a/general/python/python-docutils/Makefile b/general/python/python-docutils/Makefile new file mode 100644 index 00000000..bd85be0a --- /dev/null +++ b/general/python/python-docutils/Makefile @@ -0,0 +1,36 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-docutils +PKG_VERSION:=0.20.1 +PKG_RELEASE:=1 + +PYPI_NAME:=docutils +PKG_HASH:=f08a4e276c3a1583a86dce3e34aba3fe04d02bba2dd51ed16106244e8a923e3b + +PKG_MAINTAINER:=Daniel Danzberger +PKG_LICENSE:=Public-Domain BSD-2-License Python-2.0.1 GPL-3.0-or-later +PKG_LICENSE_FILES:=COPYING.txt licenses/BSD-2-Clause.txt licenses/python-2-1-1.txt licenses/gpl-3-0.txt + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-docutils + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Documentation Utilities + URL:=https://docutils.sourceforge.io/ + DEPENDS:=+python3 +endef + +define Package/python3-docutils/description +Docutils is a modular system for processing documentation into useful +formats, such as HTML, XML, and LaTeX. For input Docutils supports +reStructuredText, an easy-to-read, what-you-see-is-what-you-get +plaintext markup syntax. +endef + +$(eval $(call Py3Package,python3-docutils)) +$(eval $(call BuildPackage,python3-docutils)) +$(eval $(call BuildPackage,python3-docutils-src)) diff --git a/general/python/python-dotenv/Makefile b/general/python/python-dotenv/Makefile new file mode 100644 index 00000000..b01e2bab --- /dev/null +++ b/general/python/python-dotenv/Makefile @@ -0,0 +1,35 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-dotenv +PKG_VERSION:=1.0.1 +PKG_RELEASE:=1 + +PYPI_NAME:=python-dotenv +PKG_HASH:=e324ee90a023d808f1959c46bcbc04446a10ced277783dc6ee09987c37ec10ca + +PKG_MAINTAINER:=Javier Marcet +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-dotenv + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Add .env support to your django/flask apps in development and deployments + URL:=http://github.com/theskumar/python-dotenv + DEPENDS:=+python3-click +python3-light +python3-logging +endef + +define Package/python3-dotenv/description + A Python library which reads the key-value pair from .env file and adds them + to environment variable. It is great for managing app settings during + development and in production using 12-factor principles. +endef + +$(eval $(call Py3Package,python3-dotenv)) +$(eval $(call BuildPackage,python3-dotenv)) +$(eval $(call BuildPackage,python3-dotenv-src)) diff --git a/general/python/python-editables/Makefile b/general/python/python-editables/Makefile new file mode 100644 index 00000000..127c3179 --- /dev/null +++ b/general/python/python-editables/Makefile @@ -0,0 +1,52 @@ +# +# 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-editables +PKG_VERSION:=0.5 +PKG_RELEASE:=1 + +PYPI_NAME:=editables +PKG_HASH:=309627d9b5c4adc0e668d8c6fa7bac1ba7c8c5d415c2d27f60f081f8e80d1de2 + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE.txt +PKG_MAINTAINER:=Jeffery To + +PKG_HOST_ONLY:=1 +HOST_BUILD_DEPENDS:=python3/host python-build/host python-installer/host python-flit-core/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-editables + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Editable installations + URL:=https://github.com/pfmoore/editables + DEPENDS:=+python3-light + BUILDONLY:=1 +endef + +define Package/python3-editables/description +A Python library for creating "editable wheels" + +This library supports the building of wheels which, when installed, will +expose packages in a local directory on sys.path in "editable mode". In +other words, changes to the package source will be reflected in the +package visible to Python, without needing a reinstall. +endef + +$(eval $(call Py3Package,python3-editables)) +$(eval $(call BuildPackage,python3-editables)) +$(eval $(call BuildPackage,python3-editables-src)) +$(eval $(call HostBuild)) diff --git a/general/python/python-engineio/Makefile b/general/python/python-engineio/Makefile new file mode 100644 index 00000000..64ba091a --- /dev/null +++ b/general/python/python-engineio/Makefile @@ -0,0 +1,46 @@ +# +# Copyright (C) 2021 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-engineio +PKG_VERSION:=4.5.1 +PKG_RELEASE:=1 + +PYPI_NAME:=python-engineio +PKG_HASH:=b167a1b208fcdce5dbe96a61a6ca22391cfa6715d796c22de93e3adf9c07ae0c + +PKG_MAINTAINER:=Jan Pavlinec +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE +PKG_CPE_ID:=cpe:/a:python-engineio_project:python-engineio + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-engineio + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Engine.IO server and client + URL:=https://github.com/miguelgrinberg/python-engineio + DEPENDS:= \ + +python3-light \ + +python3-asyncio \ + +python3-logging \ + +python3-openssl \ + +python3-urllib +endef + +define Package/python3-engineio/description + Python implementation of the Engine.IO realtime client and server. +endef + +$(eval $(call Py3Package,python3-engineio)) +$(eval $(call BuildPackage,python3-engineio)) +$(eval $(call BuildPackage,python3-engineio-src)) diff --git a/general/python/python-et_xmlfile/Makefile b/general/python/python-et_xmlfile/Makefile new file mode 100644 index 00000000..10c04d00 --- /dev/null +++ b/general/python/python-et_xmlfile/Makefile @@ -0,0 +1,41 @@ +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-et_xmlfile +PKG_VERSION:=1.1.0 +PKG_RELEASE:=1 + +PKG_MAINTAINER:=Alexandru Ardelean , Eneas U de Queiroz +PKG_LICENSE:=MIT + +PYPI_NAME:=et_xmlfile +PKG_HASH:=8eb9e2bc2f8c97e37a2dc85a09ecdcdec9d8a396530a6d5a33b30b9a92da0c5c + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-et_xmlfile + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Low memory library for creating large XML files. + URL:=https://bitbucket.org/openpyxl/et_xmlfile + DEPENDS:= \ + +python3-light \ + +python3-lxml +endef + +define Package/python3-et_xmlfile/description + An implementation of lxml.xmlfile for the standard library. + It is based upon the xmlfile module from lxml with the aim of + allowing code to be developed that will work with both libraries. +endef + +$(eval $(call Py3Package,python3-et_xmlfile)) +$(eval $(call BuildPackage,python3-et_xmlfile)) +$(eval $(call BuildPackage,python3-et_xmlfile-src)) diff --git a/general/python/python-evdev/Makefile b/general/python/python-evdev/Makefile new file mode 100644 index 00000000..6568e5ec --- /dev/null +++ b/general/python/python-evdev/Makefile @@ -0,0 +1,50 @@ +# +# Copyright (C) 2017 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=python-evdev +PKG_VERSION:=1.7.1 +PKG_RELEASE:=1 + +PKG_LICENSE:=BSD-3-Clause +PKG_MAINTAINER:=Paulo Costa , Alexandru Ardelean + +PYPI_NAME:=evdev +PKG_HASH:=0c72c370bda29d857e188d931019c32651a9c1ea977c08c8d939b1ced1637fde + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-evdev + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=python3-evdev + URL:=https://github.com/gvalkov/python-evdev + DEPENDS:= \ + +python3-light \ + +python3-ctypes +endef + +define Package/python3-evdev/description + Bindings to the Linux input handling subsystem +endef + +LINUX_EVDEV_HEADERS="$(LINUX_DIR)/include/uapi/linux/input.h:$(LINUX_DIR)/include/uapi/linux/input-event-codes.h" + +PYTHON3_PKG_BUILD_CONFIG_SETTINGS:= \ + --build-option=build \ + --build-option=build_ecodes \ + --build-option=--evdev-headers="$(LINUX_EVDEV_HEADERS)" \ + --build-option=build_ext + +$(eval $(call Py3Package,python3-evdev)) +$(eval $(call BuildPackage,python3-evdev)) +$(eval $(call BuildPackage,python3-evdev-src)) diff --git a/general/python/python-eventlet/Makefile b/general/python/python-eventlet/Makefile new file mode 100644 index 00000000..8b01f5be --- /dev/null +++ b/general/python/python-eventlet/Makefile @@ -0,0 +1,50 @@ +# +# Copyright (C) 2021 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-eventlet +PKG_VERSION:=0.33.3 +PKG_RELEASE:=1 + +PYPI_NAME:=eventlet +PKG_HASH:=722803e7eadff295347539da363d68ae155b8b26ae6a634474d0a920be73cfda + +PKG_MAINTAINER:=Jan Pavlinec +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-eventlet + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Python concurrent networking library + URL:=https://eventlet.net/ + DEPENDS:= \ + +python3-light \ + +python3-six \ + +python3-dns \ + +python3-greenlet \ + +python3-distutils \ + +python3-email \ + +python3-logging \ + +python3-openssl \ + +python3-urllib +endef + +define Package/python3-eventlet/description + Eventlet is a concurrent networking library for Python that + allows you to change how you run your code, not how you write it. +endef + +$(eval $(call Py3Package,python3-eventlet)) +$(eval $(call BuildPackage,python3-eventlet)) +$(eval $(call BuildPackage,python3-eventlet-src)) diff --git a/general/python/python-execnet/Makefile b/general/python/python-execnet/Makefile new file mode 100644 index 00000000..2df01409 --- /dev/null +++ b/general/python/python-execnet/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2020-2021 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-execnet +PKG_VERSION:=2.0.2 +PKG_RELEASE:=1 + +PYPI_NAME:=execnet +PKG_HASH:=cc59bc4423742fd71ad227122eb0dd44db51efb3dc4095b45ac9a08c770096af + +PKG_MAINTAINER:=Jan Pavlinec +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE + +PKG_BUILD_DEPENDS:=python-hatchling/host python-hatch-vcs/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-execnet + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Rapid multi-Python deployment + URL:=https://execnet.readthedocs.io + DEPENDS:=+python3-light +endef + +define Package/python3-execnet/description +execnet provides carefully tested means to ad-hoc interact with Python +interpreters across version, platform and network barriers. +endef + +$(eval $(call Py3Package,python3-execnet)) +$(eval $(call BuildPackage,python3-execnet)) +$(eval $(call BuildPackage,python3-execnet-src)) diff --git a/general/python/python-flask-babel/Makefile b/general/python/python-flask-babel/Makefile new file mode 100644 index 00000000..c23fb476 --- /dev/null +++ b/general/python/python-flask-babel/Makefile @@ -0,0 +1,48 @@ +# +# Copyright (C) 2019-2020 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-flask-babel +PKG_VERSION:=3.1.0 +PKG_RELEASE:=1 + +PYPI_NAME:=flask-babel +PYPI_SOURCE_NAME:=flask_babel +PKG_HASH:=be015772c5d7f046f3b99c508dcf618636eb93d21b713b356db79f3e79f69f39 + +PKG_MAINTAINER:=Josef Schlehofer +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=LICENSE + +PKG_BUILD_DEPENDS:=python-poetry-core/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-flask-babel + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=i18n/l10n support for Flask applications + URL:=https://github.com/python-babel/flask-babel + DEPENDS:= \ + +python3-light \ + +python3-flask \ + +python3-babel \ + +python3-jinja2 \ + +python3-pytz +endef + +define Package/python3-flask-babel/description + Implements i18n and l10n support for Flask. +endef + +$(eval $(call Py3Package,python3-flask-babel)) +$(eval $(call BuildPackage,python3-flask-babel)) +$(eval $(call BuildPackage,python3-flask-babel-src)) diff --git a/general/python/python-flask-httpauth/Makefile b/general/python/python-flask-httpauth/Makefile new file mode 100644 index 00000000..13fd50a5 --- /dev/null +++ b/general/python/python-flask-httpauth/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2021 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-flask-httpauth +PKG_VERSION:=4.8.0 +PKG_RELEASE:=1 + +PYPI_NAME:=Flask-HTTPAuth +PKG_HASH:=66568a05bc73942c65f1e2201ae746295816dc009edd84b482c44c758d75097a + +PKG_MAINTAINER:=Jan Pavlinec +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-flask-httpauth + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=HTTP authentication for Flask routes + URL:=https://github.com/miguelgrinberg/flask-httpauth + DEPENDS:= \ + +python3-light \ + +python3-flask +endef + +define Package/python3-flask-httpauth/description + Flask-HTTPAuth is a Flask extension that simplifies the + use of HTTP authentication with Flask routes +endef + +$(eval $(call Py3Package,python3-flask-httpauth)) +$(eval $(call BuildPackage,python3-flask-httpauth)) +$(eval $(call BuildPackage,python3-flask-httpauth-src)) diff --git a/general/python/python-flask-login/Makefile b/general/python/python-flask-login/Makefile new file mode 100644 index 00000000..7153bbfc --- /dev/null +++ b/general/python/python-flask-login/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2019-2020 CZ.NIC z.s.p.o. (http://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-flask-login +PKG_VERSION:=0.6.2 +PKG_RELEASE:=1 + +PYPI_NAME:=Flask-Login +PKG_HASH:=c0a7baa9fdc448cdd3dd6f0939df72eec5177b2f7abe6cb82fc934d29caac9c3 + +PKG_MAINTAINER:=Jan Pavlinec +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-flask-login + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=User authentication and session management for Flask + URL:=https://github.com/maxcountryman/flask-login + DEPENDS:=+python3-light +python3-urllib +python3-flask +python3-werkzeug +endef + +define Package/python3-flask-login/description + Flask-Login provides user session management for Flask. + It handles the common tasks of logging in, logging out, + and remembering your users’ sessions over extended periods of time. +endef + +$(eval $(call Py3Package,python3-flask-login)) +$(eval $(call BuildPackage,python3-flask-login)) +$(eval $(call BuildPackage,python3-flask-login-src)) diff --git a/general/python/python-flask-seasurf/Makefile b/general/python/python-flask-seasurf/Makefile new file mode 100644 index 00000000..24518269 --- /dev/null +++ b/general/python/python-flask-seasurf/Makefile @@ -0,0 +1,44 @@ +# +# Copyright (C) 2019-2021 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-flask-seasurf +PKG_VERSION:=1.1.1 +PKG_RELEASE:=1 + +PYPI_NAME:=Flask-SeaSurf +PKG_HASH:=54537008c769ac0ada8237877327c3e7ed74dcd8b01e74a9120ee0232c5951a9 + +PKG_MAINTAINER:=Josef Schlehofer +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-flask-seasurf + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Updated CSRF extension for Flask + URL:=https://github.com/maxcountryman/flask-seasurf + DEPENDS:= \ + +python3-flask \ + +python3-light \ + +python3-urllib +endef + +define Package/python3-flask-seasurf/description +SeaSurf is a Flask extension for preventing cross-site request forgery +(CSRF). +endef + +$(eval $(call Py3Package,python3-flask-seasurf)) +$(eval $(call BuildPackage,python3-flask-seasurf)) +$(eval $(call BuildPackage,python3-flask-seasurf-src)) diff --git a/general/python/python-flask-session/Makefile b/general/python/python-flask-session/Makefile new file mode 100644 index 00000000..c5f7800f --- /dev/null +++ b/general/python/python-flask-session/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2019-2020 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-flask-session +PKG_VERSION:=0.3.2 +PKG_RELEASE:=1 + +PYPI_NAME:=Flask-Session +PKG_HASH:=0768e2bbf06f963ec1aa711bde7aa32dc39ff70f89b495d6db687d899eae4423 + +PKG_MAINTAINER:=Josef Schlehofer +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-flask-session + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Flask Session + URL:=https://github.com/fengsp/flask-session + DEPENDS:= \ + +python3-cachelib \ + +python3-flask \ + +python3-light +endef + +define Package/python3-flask-session/description + Adds server-side session support to your Flask application. +endef + +$(eval $(call Py3Package,python3-flask-session)) +$(eval $(call BuildPackage,python3-flask-session)) +$(eval $(call BuildPackage,python3-flask-session-src)) diff --git a/general/python/python-flask-socketio/Makefile b/general/python/python-flask-socketio/Makefile new file mode 100644 index 00000000..e71cd47d --- /dev/null +++ b/general/python/python-flask-socketio/Makefile @@ -0,0 +1,44 @@ +# +# Copyright (C) 2021 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-flask-socketio +PKG_VERSION:=5.3.5 +PKG_RELEASE:=1 + +PYPI_NAME:=Flask-SocketIO +PKG_HASH:=5f01158d10db71aa78c969b631ce3b9148b47ab0de1995158f9577f85b004d25 + +PKG_MAINTAINER:=Jan Pavlinec +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-flask-socketio + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Socket.IO integration for Flask + URL:=https://github.com/miguelgrinberg/Flask-SocketIO/ + DEPENDS:= \ + +python3-light \ + +python3-flask \ + +python3-socketio +endef + +define Package/python3-flask-socketio/description + Flask-SocketIO gives Flask applications access to low latency + bi-directional communications between the clients and the server. +endef + +$(eval $(call Py3Package,python3-flask-socketio)) +$(eval $(call BuildPackage,python3-flask-socketio)) +$(eval $(call BuildPackage,python3-flask-socketio-src)) diff --git a/general/python/python-flit-core/Makefile b/general/python/python-flit-core/Makefile new file mode 100644 index 00000000..66b246ca --- /dev/null +++ b/general/python/python-flit-core/Makefile @@ -0,0 +1,60 @@ +# +# 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-flit-core +PKG_VERSION:=3.9.0 +PKG_RELEASE:=1 + +PYPI_NAME:=flit-core +PYPI_SOURCE_NAME:=flit_core +PKG_HASH:=72ad266176c4a3fcfab5f2930d76896059851240570ce9a98733b658cb786eba + +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Jeffery To + +PKG_HOST_ONLY:=1 +HOST_BUILD_DEPENDS:=python3/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-flit-core + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Distribution-building parts of Flit + URL:=https://github.com/pypa/flit + DEPENDS:=+python3-light +python3-email +python3-logging + BUILDONLY:=1 +endef + +define Package/python3-flit-core/description +This provides a PEP 517 build backend for packages using Flit. The only +public interface is the API specified by PEP 517, at flit_core.buildapi. +endef + +define Py3Host/Install/Installer + $(call HostPython3/Run, \ + $(HOST_BUILD_DIR), \ + bootstrap_install.py \ + --installdir "$(1)/lib/python$(PYTHON3_VERSION)/site-packages" \ + "$(PYTHON3_HOST_BUILD_DIR)"/openwrt-build/$(PYPI_SOURCE_NAME)-$(PKG_VERSION)-*.whl \ + ) +endef + +Host/Compile=$(Py3Host/Compile/Bootstrap) + +$(eval $(call Py3Package,python3-flit-core)) +$(eval $(call BuildPackage,python3-flit-core)) +$(eval $(call BuildPackage,python3-flit-core-src)) +$(eval $(call HostBuild)) diff --git a/general/python/python-flit-scm/Makefile b/general/python/python-flit-scm/Makefile new file mode 100644 index 00000000..87188fd7 --- /dev/null +++ b/general/python/python-flit-scm/Makefile @@ -0,0 +1,55 @@ +# +# 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-flit-scm +PKG_VERSION:=1.7.0 +PKG_RELEASE:=2 + +PYPI_NAME:=flit-scm +PYPI_SOURCE_NAME:=flit_scm +PKG_HASH:=961bd6fb24f31bba75333c234145fff88e6de0a90fc0f7e5e7c79deca69f6bb2 + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Jeffery To + +PKG_HOST_ONLY:=1 +HOST_BUILD_DEPENDS:= \ + python3/host \ + python-build/host \ + python-installer/host \ + python-flit-core/host \ + python-setuptools-scm/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-flit-scm + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=A PEP 518 build backend that uses setuptools_scm and flit + URL:=https://gitlab.com/WillDaSilva/flit_scm + DEPENDS:=+python3-light +python3-flit-core +python3-setuptools-scm + BUILDONLY:=1 +endef + +define Package/python3-flit-scm/description +A PEP 518 build backend that uses setuptools_scm to generate a version +file from your version control system, then flit_core to build the +package. +endef + +$(eval $(call Py3Package,python3-flit-scm)) +$(eval $(call BuildPackage,python3-flit-scm)) +$(eval $(call BuildPackage,python3-flit-scm-src)) +$(eval $(call HostBuild)) diff --git a/general/python/python-fnv-hash-fast/Makefile b/general/python/python-fnv-hash-fast/Makefile new file mode 100644 index 00000000..b4758598 --- /dev/null +++ b/general/python/python-fnv-hash-fast/Makefile @@ -0,0 +1,38 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-fnv-hash-fast +PKG_VERSION:=0.5.0 +PKG_RELEASE:=1 + +PYPI_NAME:=fnv-hash-fast +PYPI_SOURCE_NAME:=fnv_hash_fast +PKG_HASH:=a84d658952776a186418f4158fc8e55ff3c576ac32cc9ef7f8077efdf2d0b89f + +PKG_MAINTAINER:=Timothy Ace +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE + +PKG_BUILD_DEPENDS:=python-cython/host python-poetry-core/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-fnv-hash-fast + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=A fast version of fnv1a + URL:=https://github.com/bdraco/fnv-hash-fast + DEPENDS:=+libstdcpp +python3-light +python3-fnvhash +endef + +define Package/python3-fnv-hash-fast/description +A fast version of fnv1a. This library will use a CPP implementation of fnv1a +(32) if cython is available, and will fallback to pure python from the fnvhash +package if it is not. +endef + +$(eval $(call Py3Package,python3-fnv-hash-fast)) +$(eval $(call BuildPackage,python3-fnv-hash-fast)) +$(eval $(call BuildPackage,python3-fnv-hash-fast-src)) diff --git a/general/python/python-fnvhash/Makefile b/general/python/python-fnvhash/Makefile new file mode 100644 index 00000000..b0c2316d --- /dev/null +++ b/general/python/python-fnvhash/Makefile @@ -0,0 +1,33 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-fnvhash +PKG_VERSION:=0.1.0 +PKG_RELEASE:=1 + +PYPI_NAME:=fnvhash +PKG_HASH:=3e82d505054f9f3987b2b5b649f7e7b6f48349f6af8a1b8e4d66779699c85a8e + +PKG_MAINTAINER:=Timothy Ace +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-fnvhash + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Pure Python FNV hash implementation + URL:=https://github.com/znerol/py-fnvhash + DEPENDS:=+python3-light +endef + +define Package/python3-fnvhash/description +Pure Python implementation of the FNV hash family with 100% test coverage. +endef + +$(eval $(call Py3Package,python3-fnvhash)) +$(eval $(call BuildPackage,python3-fnvhash)) +$(eval $(call BuildPackage,python3-fnvhash-src)) diff --git a/general/python/python-frozenlist/Makefile b/general/python/python-frozenlist/Makefile new file mode 100644 index 00000000..0c9df170 --- /dev/null +++ b/general/python/python-frozenlist/Makefile @@ -0,0 +1,43 @@ +# +# 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-frozenlist +PKG_VERSION:=1.4.0 +PKG_RELEASE:=1 + +PYPI_NAME:=frozenlist +PKG_HASH:=09163bdf0b2907454042edb19f887c6d33806adc71fbd54afc14908bfdc22251 + +PKG_LICENSE:=Apache-2.0 +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Jeffery To + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-frozenlist + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=List-like structure + URL:=https://github.com/aio-libs/frozenlist + DEPENDS:=+python3-light +endef + +define Package/python3-frozenlist/description +frozenlist.FrozenList is a list-like structure which implements +collections.abc.MutableSequence. The list is mutable until +FrozenList.freeze is called, after which list modifications raise +RuntimeError. +endef + +$(eval $(call Py3Package,python3-frozenlist)) +$(eval $(call BuildPackage,python3-frozenlist)) +$(eval $(call BuildPackage,python3-frozenlist-src)) diff --git a/general/python/python-gevent/Makefile b/general/python/python-gevent/Makefile new file mode 100644 index 00000000..92e2dbc2 --- /dev/null +++ b/general/python/python-gevent/Makefile @@ -0,0 +1,49 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-gevent +PKG_VERSION:=23.9.1 +PKG_RELEASE:=1 + +PYPI_NAME:=gevent +PKG_HASH:=72c002235390d46f94938a96920d8856d4ffd9ddf62a303a0d7c118894097e34 + +PKG_MAINTAINER:=Andy Syam +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE + +PKG_BUILD_FLAGS:=no-mips16 +PKG_BUILD_DEPENDS:=python-cffi/host python-greenlet/host python-cython/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +PYTHON3_PKG_SETUP_VARS:= \ + GEVENTSETUP_EMBED=0 \ + GEVENTSETUP_EMBED_LIBEV=0 \ + GEVENTSETUP_EMBED_CARES=0 + +define Package/python3-gevent + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Coroutine-based network library + URL:=https://github.com/gevent/gevent + DEPENDS:= \ + +python3-light \ + +python3-cffi \ + +python3-greenlet \ + +python3-zope-interface \ + +libcares \ + +libev \ + +libuv +endef + +define Package/python3-gevent/description + gevent is a coroutine -based Python networking library that uses greenlet + to provide a high-level synchronous API on top of the libev or libuv event loop. +endef + +$(eval $(call Py3Package,python3-gevent)) +$(eval $(call BuildPackage,python3-gevent)) +$(eval $(call BuildPackage,python3-gevent-src)) diff --git a/general/python/python-gmpy2/Makefile b/general/python/python-gmpy2/Makefile new file mode 100644 index 00000000..6aa371e6 --- /dev/null +++ b/general/python/python-gmpy2/Makefile @@ -0,0 +1,46 @@ +# +# Copyright (C) 2015-2016, 2018-2020, 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-gmpy2 +PKG_VERSION:=2.1.5 +PKG_RELEASE:=1 + +PYPI_NAME:=gmpy2 +PKG_HASH:=bc297f1fd8c377ae67a4f493fc0f926e5d1b157e5c342e30a4d84dc7b9f95d96 + +PKG_LICENSE:=LGPL-3.0-or-later +PKG_LICENSE_FILES:=COPYING.LESSER +PKG_MAINTAINER:=Jeffery To + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-gmpy2 + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=GMP/MPIR, MPFR, and MPC interface + URL:=https://github.com/aleaxit/gmpy + DEPENDS:=+libgmp +libmpc +libmpfr +python3-light +endef + +define Package/python3-gmpy2/description +gmpy2 is a C-coded Python extension module that supports multiple-precision +arithmetic. gmpy2 is the successor to the original gmpy module. The gmpy module +only supported the GMP multiple-precision library. gmpy2 adds support for the +MPFR (correctly rounded real floating-point arithmetic) and MPC (correctly +rounded complex floating-point arithmetic) libraries. gmpy2 also updates the +API and naming conventions to be more consistent and support the additional +functionality. +endef + +$(eval $(call Py3Package,python3-gmpy2)) +$(eval $(call BuildPackage,python3-gmpy2)) +$(eval $(call BuildPackage,python3-gmpy2-src)) diff --git a/general/python/python-gnupg/Makefile b/general/python/python-gnupg/Makefile new file mode 100644 index 00000000..98192ac8 --- /dev/null +++ b/general/python/python-gnupg/Makefile @@ -0,0 +1,43 @@ +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-gnupg +PKG_VERSION:=0.5.1 +PKG_RELEASE:=1 + +PYPI_NAME:=python-gnupg +PKG_HASH:=5674bad4e93876c0b0d3197e314d7f942d39018bf31e2b833f6788a6813c3fb8 + +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=LICENSE.txt +PKG_MAINTAINER:=Jeffery To +PKG_CPE_ID:=cpe:/a:python:python-gnupg + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-gnupg + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=A wrapper for GnuPG + URL:=https://github.com/vsajip/python-gnupg + DEPENDS:=+python3-light +python3-logging +endef + +define Package/python3-gnupg/description + The gnupg module allows Python programs to make use of the + functionality provided by the GNU Privacy Guard (abbreviated GPG or + GnuPG). Using this module, Python programs can encrypt and decrypt + data, digitally sign documents and verify digital signatures, manage + (generate, list and delete) encryption keys, using Public Key + Infrastructure (PKI) encryption technology based on OpenPGP. +endef + +$(eval $(call Py3Package,python3-gnupg)) +$(eval $(call BuildPackage,python3-gnupg)) +$(eval $(call BuildPackage,python3-gnupg-src)) diff --git a/general/python/python-greenlet/Makefile b/general/python/python-greenlet/Makefile new file mode 100644 index 00000000..dced8ade --- /dev/null +++ b/general/python/python-greenlet/Makefile @@ -0,0 +1,58 @@ +# +# Copyright (C) 2021 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-greenlet +PKG_VERSION:=3.0.2 +PKG_RELEASE:=1 + +PYPI_NAME:=greenlet +PKG_HASH:=1c1129bc47266d83444c85a8e990ae22688cf05fb20d7951fd2866007c2ba9bc + +PKG_MAINTAINER:=Jan Pavlinec +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE +# FIXME: remove when GCC10 is the oldest supported compiler, or the issue goes away +PKG_BUILD_FLAGS:=no-mips16 + +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-greenlet + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Lightweight coroutines for in-process concurrent programming + URL:=https://github.com/python-greenlet/greenlet + DEPENDS:= \ + +python3-light \ + +libstdcpp \ + @!arc +endef + +define Package/python3-greenlet/description + The greenlet package is a spin-off of Stackless + a version of CPython that supports micro-threads called tasklets. +endef + +# FIXME: remove when GCC10 is the oldest supported compiler, or the issue goes away +# This is required in addition to PKG_BUILD_FLAGS:=no-mips16 because otherwise MIPS16 +# flags are inherited from the Python base package (via sysconfig module) +ifdef CONFIG_USE_MIPS16 +TARGET_CFLAGS += -mno-mips16 -mno-interlink-mips16 +endif + +$(eval $(call Py3Package,python3-greenlet)) +$(eval $(call BuildPackage,python3-greenlet)) +$(eval $(call BuildPackage,python3-greenlet-src)) +$(eval $(call HostBuild)) diff --git a/general/python/python-hatch-fancy-pypi-readme/Makefile b/general/python/python-hatch-fancy-pypi-readme/Makefile new file mode 100644 index 00000000..6633a635 --- /dev/null +++ b/general/python/python-hatch-fancy-pypi-readme/Makefile @@ -0,0 +1,57 @@ +# +# 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-hatch-fancy-pypi-readme +PKG_VERSION:=23.1.0 +PKG_RELEASE:=1 + +PYPI_NAME:=hatch-fancy-pypi-readme +PYPI_SOURCE_NAME:=hatch_fancy_pypi_readme +PKG_HASH:=b1df44063094af1e8248ceacd47a92c9cf313d6b9823bf66af8a927c3960287d + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE.txt +PKG_MAINTAINER:=Jeffery To + +PKG_HOST_ONLY:=1 +HOST_BUILD_DEPENDS:=python3/host python-build/host python-installer/host python-hatchling/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-hatch-fancy-pypi-readme + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Fancy PyPI READMEs with Hatch + URL:=https://github.com/hynek/hatch-fancy-pypi-readme + DEPENDS:=+python3-light +python3-hatchling + BUILDONLY:=1 +endef + +define Package/python3-hatch-fancy-pypi-readme/description +hatch-fancy-pypi-readme is a Hatch metadata plugin for everyone who +cares about the first impression of their project’s PyPI landing page. +It allows you to define your PyPI project description in terms of +concatenated fragments that are based on static strings, files, and most +importantly: parts of files defined using cut-off points or regular +expressions. + +Once you’ve assembled your readme, you can additionally run regular +expression-based substitutions over it. For instance to make relative +links absolute or to linkify users and issue numbers in your changelog. +endef + +$(eval $(call Py3Package,python3-hatch-fancy-pypi-readme)) +$(eval $(call BuildPackage,python3-hatch-fancy-pypi-readme)) +$(eval $(call BuildPackage,python3-hatch-fancy-pypi-readme-src)) +$(eval $(call HostBuild)) diff --git a/general/python/python-hatch-requirements-txt/Makefile b/general/python/python-hatch-requirements-txt/Makefile new file mode 100644 index 00000000..ae6cd13b --- /dev/null +++ b/general/python/python-hatch-requirements-txt/Makefile @@ -0,0 +1,53 @@ +# +# 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-hatch-requirements-txt +PKG_VERSION:=0.4.0 +PKG_RELEASE:=1 + +PYPI_NAME:=hatch-requirements-txt +PYPI_SOURCE_NAME:=hatch_requirements_txt +PKG_HASH:=800509946e85d9e56d73242fab223ec36db50372e870a04e2dd1fd9bad98455d + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Jeffery To + +PKG_HOST_ONLY:=1 +HOST_BUILD_DEPENDS:= \ + python3/host \ + python-build/host \ + python-installer/host \ + python-hatchling/host \ + python-packaging/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-hatch-requirements-txt + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Read project dependencies from requirements.txt + URL:=https://github.com/repo-helper/hatch-requirements-txt + DEPENDS:=+python3-light +python3-hatchling +python3-packaging + BUILDONLY:=1 +endef + +define Package/python3-hatch-requirements-txt/description +Hatchling plugin to read project dependencies from requirements.txt +endef + +$(eval $(call Py3Package,python3-hatch-requirements-txt)) +$(eval $(call BuildPackage,python3-hatch-requirements-txt)) +$(eval $(call BuildPackage,python3-hatch-requirements-txt-src)) +$(eval $(call HostBuild)) diff --git a/general/python/python-hatch-vcs/Makefile b/general/python/python-hatch-vcs/Makefile new file mode 100644 index 00000000..6726a777 --- /dev/null +++ b/general/python/python-hatch-vcs/Makefile @@ -0,0 +1,54 @@ +# +# 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-hatch-vcs +PKG_VERSION:=0.4.0 +PKG_RELEASE:=1 + +PYPI_NAME:=hatch-vcs +PYPI_SOURCE_NAME:=hatch_vcs +PKG_HASH:=093810748fe01db0d451fabcf2c1ac2688caefd232d4ede967090b1c1b07d9f7 + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE.txt +PKG_MAINTAINER:=Jeffery To + +PKG_HOST_ONLY:=1 +HOST_BUILD_DEPENDS:= \ + python3/host \ + python-build/host \ + python-installer/host \ + python-hatchling/host \ + python-setuptools-scm/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-hatch-vcs + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Hatch plugin for versioning with your preferred VCS + URL:=https://github.com/ofek/hatch-vcs + DEPENDS:=+python3-light +python3-hatchling +python3-setuptools-scm + BUILDONLY:=1 +endef + +define Package/python3-hatch-vcs/description +This provides a plugin for Hatch that uses your preferred version +control system (like Git) to determine project versions. +endef + +$(eval $(call Py3Package,python3-hatch-vcs)) +$(eval $(call BuildPackage,python3-hatch-vcs)) +$(eval $(call BuildPackage,python3-hatch-vcs-src)) +$(eval $(call HostBuild)) diff --git a/general/python/python-hatchling/Makefile b/general/python/python-hatchling/Makefile new file mode 100644 index 00000000..b44b7774 --- /dev/null +++ b/general/python/python-hatchling/Makefile @@ -0,0 +1,62 @@ +# +# 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-hatchling +PKG_VERSION:=1.18.0 +PKG_RELEASE:=1 + +PYPI_NAME:=hatchling +PKG_HASH:=50e99c3110ce0afc3f7bdbadff1c71c17758e476731c27607940cfa6686489ca + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE.txt +PKG_MAINTAINER:=Jeffery To + +PKG_HOST_ONLY:=1 +HOST_BUILD_DEPENDS:= \ + python3/host \ + python-build/host \ + python-installer/host \ + python-editables/host \ + python-packaging/host \ + python-pathspec/host \ + python-pluggy/host \ + python-trove-classifiers/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-hatchling + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Modern, extensible Python build backend + URL:=https://hatch.pypa.io/latest/ + DEPENDS:= \ + +python3-light \ + +python3-email \ + +python3-editables \ + +python3-packaging \ + +python3-pathspec \ + +python3-pluggy \ + +python3-trove-classifiers + BUILDONLY:=1 +endef + +define Package/python3-hatchling/description +This is the extensible, standards compliant build backend used by Hatch. +endef + +$(eval $(call Py3Package,python3-hatchling)) +$(eval $(call BuildPackage,python3-hatchling)) +$(eval $(call BuildPackage,python3-hatchling-src)) +$(eval $(call HostBuild)) diff --git a/general/python/python-hyperlink/Makefile b/general/python/python-hyperlink/Makefile new file mode 100644 index 00000000..4583683b --- /dev/null +++ b/general/python/python-hyperlink/Makefile @@ -0,0 +1,50 @@ +# +# Copyright (C) 2018 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-hyperlink +PKG_VERSION:=21.0.0 +PKG_RELEASE:=1 + +PYPI_NAME:=hyperlink +PKG_HASH:=427af957daa58bc909471c6c40f74c5450fa123dd093fc53efd2e91d2705a56b + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Jeffery To + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-hyperlink + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Pure-Python immutable URLs + URL:=https://github.com/python-hyper/hyperlink + DEPENDS:= \ + +python3-light \ + +python3-codecs \ + +python3-idna +endef + +define Package/python3-hyperlink/description +Hyperlink provides a pure-Python implementation of immutable URLs. Based +on RFC 3986 and 3987, the Hyperlink URL makes working with both URIs and +IRIs easy. +endef + +define Py3Package/python3-hyperlink/filespec ++|$(PYTHON3_PKG_DIR) +-|$(PYTHON3_PKG_DIR)/hyperlink/hypothesis.py +endef + +$(eval $(call Py3Package,python3-hyperlink)) +$(eval $(call BuildPackage,python3-hyperlink)) +$(eval $(call BuildPackage,python3-hyperlink-src)) diff --git a/general/python/python-hyperlink/patches/001-omit-tests.patch b/general/python/python-hyperlink/patches/001-omit-tests.patch new file mode 100644 index 00000000..5b0a7fe8 --- /dev/null +++ b/general/python/python-hyperlink/patches/001-omit-tests.patch @@ -0,0 +1,11 @@ +--- a/setup.py ++++ b/setup.py +@@ -25,7 +25,7 @@ setup( + author=__author__, + author_email=__contact__, + url=__url__, +- packages=find_packages(where="src"), ++ packages=find_packages(where="src", exclude=["*.test", "*.test.*"]), + package_dir={"": "src"}, + package_data=dict(hyperlink=["py.typed", "idna-tables-properties.csv.gz"]), + zip_safe=False, diff --git a/general/python/python-idna/Makefile b/general/python/python-idna/Makefile new file mode 100644 index 00000000..33129b03 --- /dev/null +++ b/general/python/python-idna/Makefile @@ -0,0 +1,45 @@ +# +# Copyright (C) 2015-2016, 2018-2020, 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-idna +PKG_VERSION:=3.6 +PKG_RELEASE:=1 + +PYPI_NAME:=idna +PKG_HASH:=9ecdbbd083b06798ae1e86adcbfe8ab1479cf864e4ee30fe4e46a003d12491ca + +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=LICENSE.md +PKG_MAINTAINER:=Jeffery To + +PKG_BUILD_DEPENDS:=python-flit-core/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-idna + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=IDNA library + URL:=https://github.com/kjd/idna + DEPENDS:=+python3-light +python3-codecs +endef + +define Package/python3-idna/description +A library to support the Internationalised Domain Names in Applications +(IDNA) protocol as specified in RFC 5891. This version of the protocol +is often referred to as "IDNA2008" and can produce different results +from the earlier standard from 2003. +endef + +$(eval $(call Py3Package,python3-idna)) +$(eval $(call BuildPackage,python3-idna)) +$(eval $(call BuildPackage,python3-idna-src)) diff --git a/general/python/python-idna/test.sh b/general/python/python-idna/test.sh new file mode 100644 index 00000000..85f779c2 --- /dev/null +++ b/general/python/python-idna/test.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +[ "$1" = python3-idna ] || exit 0 + +python3 - << 'EOF' + +import idna +import idna.codec + +assert idna.encode('ドメイン.テスト') == b'xn--eckwd4c7c.xn--zckzah' +assert idna.decode('xn--eckwd4c7c.xn--zckzah') == 'ドメイン.テスト' + +assert 'домен.испытание'.encode('idna2008') == b'xn--d1acufc.xn--80akhbyknj4f' +assert b'xn--d1acufc.xn--80akhbyknj4f'.decode('idna2008') == 'домен.испытание' + +assert idna.alabel('测试') == b'xn--0zwm56d' + +assert idna.encode('Königsgäßchen', uts46=True) == b'xn--knigsgchen-b4a3dun' +assert idna.decode('xn--knigsgchen-b4a3dun') == 'königsgäßchen' + +assert idna.encode('Königsgäßchen', uts46=True, transitional=True) == b'xn--knigsgsschen-lcb0w' + +EOF diff --git a/general/python/python-ifaddr/Makefile b/general/python/python-ifaddr/Makefile new file mode 100644 index 00000000..db9dd422 --- /dev/null +++ b/general/python/python-ifaddr/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2019-2020 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-ifaddr +PKG_VERSION:=0.2.0 +PKG_RELEASE:=1 + +PYPI_NAME:=ifaddr +PKG_HASH:=cc0cbfcaabf765d44595825fb96a99bb12c79716b73b44330ea38ee2b0c4aed4 + +PKG_MAINTAINER:=Josef Schlehofer +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE.txt + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-ifaddr + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Network interface and IP address enumeration library + URL:=https://github.com/pydron/ifaddr + DEPENDS:= \ + +python3-light \ + +python3-ctypes +endef + +define Package/python3-ifaddr/description +ifaddr is a small Python library that allows you to find all the +Ethernet and IP addresses of the computer. +endef + +$(eval $(call Py3Package,python3-ifaddr)) +$(eval $(call BuildPackage,python3-ifaddr)) +$(eval $(call BuildPackage,python3-ifaddr-src)) diff --git a/general/python/python-incremental/Makefile b/general/python/python-incremental/Makefile new file mode 100644 index 00000000..0cfbe6b2 --- /dev/null +++ b/general/python/python-incremental/Makefile @@ -0,0 +1,45 @@ +# +# Copyright (C) 2018, 2021, 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-incremental +PKG_VERSION:=22.10.0 +PKG_RELEASE:=1 + +PYPI_NAME:=incremental +PKG_HASH:=912feeb5e0f7e0188e6f42241d2f450002e11bbc0937c65865045854c24c0bd0 + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Jeffery To + +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-incremental + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Versions your Python projects + URL:=https://github.com/twisted/incremental + DEPENDS:=+python3-light +python3-distutils +python3-pkg-resources +endef + +define Package/python3-incremental/description +Incremental is a small library that versions your Python projects. +endef + +$(eval $(call Py3Package,python3-incremental)) +$(eval $(call BuildPackage,python3-incremental)) +$(eval $(call BuildPackage,python3-incremental-src)) +$(eval $(call HostBuild)) diff --git a/general/python/python-incremental/patches/001-omit-tests.patch b/general/python/python-incremental/patches/001-omit-tests.patch new file mode 100644 index 00000000..b71c6e35 --- /dev/null +++ b/general/python/python-incremental/patches/001-omit-tests.patch @@ -0,0 +1,14 @@ +--- a/setup.cfg ++++ b/setup.cfg +@@ -30,7 +30,10 @@ zip_safe = False + + [options.packages.find] + where = src +-exclude = exampleproj ++exclude = ++ exampleproj ++ *.tests ++ *.tests.* + + [options.package_data] + incremental = py.typed diff --git a/general/python/python-influxdb/Makefile b/general/python/python-influxdb/Makefile new file mode 100644 index 00000000..a71d9fd4 --- /dev/null +++ b/general/python/python-influxdb/Makefile @@ -0,0 +1,43 @@ +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-influxdb +PKG_VERSION:=5.3.1 +PKG_RELEASE:=1 +PKG_MAINTAINER:=Josef Schlehofer   + +PYPI_NAME:=influxdb +PKG_HASH:=46f85e7b04ee4b3dee894672be6a295c94709003a7ddea8820deec2ac4d8b27a + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-influxdb + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + URL:=https://github.com/influxdb/influxdb-python + TITLE:=InfluxDB client + DEPENDS:=\ + +python3-light \ + +python3-requests \ + +python3-pytz \ + +python3-six \ + +python3-dateutil \ + +python3-msgpack +endef + +define Package/python3-influxdb/description + Python client for InfluxDB +endef + +$(eval $(call Py3Package,python3-influxdb)) +$(eval $(call BuildPackage,python3-influxdb)) +$(eval $(call BuildPackage,python3-influxdb-src)) diff --git a/general/python/python-iniconfig/Makefile b/general/python/python-iniconfig/Makefile new file mode 100644 index 00000000..be844883 --- /dev/null +++ b/general/python/python-iniconfig/Makefile @@ -0,0 +1,42 @@ +# +# Copyright (C) 2020 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-iniconfig +PKG_VERSION:=2.0.0 +PKG_RELEASE:=1 + +PYPI_NAME:=iniconfig +PKG_HASH:=2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3 + +PKG_MAINTAINER:=Jan Pavlinec +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE + +PKG_BUILD_DEPENDS:=python-hatchling/host python-hatch-vcs/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-iniconfig + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Simple config-ini parser + URL:=https://github.com/pytest-dev/iniconfig + DEPENDS:= +python3-light +endef + +define Package/python3-iniconfig/description + iniconfig is a small and simple INI-file parser module. +endef + +$(eval $(call Py3Package,python3-iniconfig)) +$(eval $(call BuildPackage,python3-iniconfig)) +$(eval $(call BuildPackage,python3-iniconfig-src)) diff --git a/general/python/python-installer/Makefile b/general/python/python-installer/Makefile new file mode 100644 index 00000000..898a74a3 --- /dev/null +++ b/general/python/python-installer/Makefile @@ -0,0 +1,53 @@ +# +# 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-installer +PKG_VERSION:=0.7.0 +PKG_RELEASE:=1 + +PYPI_NAME:=installer +PKG_HASH:=a26d3e3116289bb08216e0d0f7d925fcef0b0194eedfa0c944bcaaa106c4b631 + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Jeffery To + +PKG_HOST_ONLY:=1 +HOST_BUILD_DEPENDS:=python3/host python-flit-core/host + +PYTHON3_HOST_INSTALL_VARS:=PYTHONPATH=src + +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-installer + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=A library for installing Python wheels + URL:=https://github.com/pypa/installer + DEPENDS:=+python3-light +python3-email + BUILDONLY:=1 +endef + +define Package/python3-installer/description +This is a low-level library for installing a Python package from a wheel +distribution. It provides basic functionality and abstractions for +handling wheels and installing packages from wheels. +endef + +Host/Compile=$(Py3Host/Compile/Bootstrap) + +$(eval $(call Py3Package,python3-installer)) +$(eval $(call BuildPackage,python3-installer)) +$(eval $(call BuildPackage,python3-installer-src)) +$(eval $(call HostBuild)) diff --git a/general/python/python-intelhex/Makefile b/general/python/python-intelhex/Makefile new file mode 100644 index 00000000..40c38426 --- /dev/null +++ b/general/python/python-intelhex/Makefile @@ -0,0 +1,38 @@ +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-intelhex +PKG_VERSION:=2.3.0 +PKG_RELEASE:=1 + +PYPI_NAME:=intelhex +PKG_HASH:=892b7361a719f4945237da8ccf754e9513db32f5628852785aea108dcd250093 + +PKG_MAINTAINER:=Josef Schlehofer   +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=LICENSE.txt + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-intelhex + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Intel HEX files manipulations + URL:=https://github.com/python-intelhex/intelhex + DEPENDS:=+python3-light +endef + +define Package/python3-intelhex/description + This work implements an intelhex Python library to read, write, create from + scratch and manipulate data from Intel HEX file format. +endef + +$(eval $(call Py3Package,python3-intelhex)) +$(eval $(call BuildPackage,python3-intelhex)) +$(eval $(call BuildPackage,python3-intelhex-src)) diff --git a/general/python/python-jdcal/Makefile b/general/python/python-jdcal/Makefile new file mode 100644 index 00000000..c1da5c3d --- /dev/null +++ b/general/python/python-jdcal/Makefile @@ -0,0 +1,38 @@ +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-jdcal +PKG_VERSION:=1.4.1 +PKG_RELEASE:=2 + +PKG_MAINTAINER:=Alexandru Ardelean , Eneas U de Queiroz +PKG_LICENSE:=BSD-2-Clause +PKG_LICENSE_FILES:=LICENSE.txt + +PYPI_NAME:=jdcal +PKG_HASH:=472872e096eb8df219c23f2689fc336668bdb43d194094b5cc1707e1640acfc8 + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-jdcal + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Julian dates from proleptic Gregorian and Julian calendars + URL:=https://github.com/phn/jdcal + DEPENDS:= +python3-light +endef + +define Package/python3-jdcal/description + This module contains functions for converting between Julian dates and calendar dates. +endef + +$(eval $(call Py3Package,python3-jdcal)) +$(eval $(call BuildPackage,python3-jdcal)) +$(eval $(call BuildPackage,python3-jdcal-src)) diff --git a/general/python/python-jinja2/Makefile b/general/python/python-jinja2/Makefile new file mode 100644 index 00000000..e7514ff1 --- /dev/null +++ b/general/python/python-jinja2/Makefile @@ -0,0 +1,49 @@ +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-jinja2 +PKG_VERSION:=3.1.2 +PKG_RELEASE:=1 + +PYPI_NAME:=Jinja2 +PKG_HASH:=31351a702a408a9e7595a8fc6150fc3f43bb6bf7e319770cbc0db9df9437e852 + +PKG_MAINTAINER:=Michal Vasilek +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=LICENSE.rst +PKG_CPE_ID:=cpe:/a:pocoo:jinja2 +HOST_BUILD_DEPENDS:= python-markupsafe/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-jinja2 + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Very fast and expressive template engine + URL:=https://palletsprojects.com/p/jinja/ + DEPENDS:= \ + +python3-light \ + +python3-asyncio \ + +python3-logging \ + +python3-urllib \ + +python3-markupsafe +endef + +define Package/python3-jinja2/description +Jinja2 is a full featured template engine for Python. It has full +unicode support, an optional integrated sandboxed execution +environment, widely used and BSD licensed. +endef + +$(eval $(call Py3Package,python3-jinja2)) +$(eval $(call BuildPackage,python3-jinja2)) +$(eval $(call BuildPackage,python3-jinja2-src)) +$(eval $(call HostBuild)) diff --git a/general/python/python-jmespath/Makefile b/general/python/python-jmespath/Makefile new file mode 100644 index 00000000..bc1181ef --- /dev/null +++ b/general/python/python-jmespath/Makefile @@ -0,0 +1,34 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-jmespath +PKG_VERSION:=1.0.1 +PKG_RELEASE:=1 + +PYPI_NAME:=jmespath +PKG_HASH:=90261b206d6defd58fdd5e85f478bf633a2901798906be2ad389150c5c60edbe + +PKG_MAINTAINER:=Daniel Danzberger +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE.txt + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-jmespath + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=JSON Matching Expressions + URL:=https://github.com/jmespath/jmespath.py + DEPENDS:=+python3-light +endef + +define Package/python3-jmespath/description +JMESPath (pronounced “james path”) allows you to declaratively specify +how to extract elements from a JSON document. +endef + +$(eval $(call Py3Package,python3-jmespath)) +$(eval $(call BuildPackage,python3-jmespath)) +$(eval $(call BuildPackage,python3-jmespath-src)) diff --git a/general/python/python-jsonpath-ng/Makefile b/general/python/python-jsonpath-ng/Makefile new file mode 100644 index 00000000..e3b0669b --- /dev/null +++ b/general/python/python-jsonpath-ng/Makefile @@ -0,0 +1,48 @@ +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-jsonpath-ng +PKG_VERSION:=1.5.3 +PKG_RELEASE:=1 +PKG_MAINTAINER:=Josef Schlehofer   + +PYPI_NAME:=jsonpath-ng +PKG_HASH:=a273b182a82c1256daab86a313b937059261b5c5f8c4fa3fc38b882b344dd567 + +PKG_LICENSE:=Apache-2.0 +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-jsonpath-ng + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + URL:=https://github.com/h2non/jsonpath-ng + TITLE:=Standard compliant implementation of JSONPath + DEPENDS:= \ + +python3-light \ + +python3-logging \ + +python3-ply \ + +python3-six \ + +python3-decorator +endef + +define Package/python3-jsonpath-ng/description +A final implementation of JSONPath for Python that aims to be standard +compliant, including arithmetic and binary comparison operators, as +defined in the original JSONPath proposal. + +This packages merges both jsonpath-rw and jsonpath-rw-ext and provides +several AST API enhancements, such as the ability to update or removes +nodes in the tree. +endef + +$(eval $(call Py3Package,python3-jsonpath-ng)) +$(eval $(call BuildPackage,python3-jsonpath-ng)) +$(eval $(call BuildPackage,python3-jsonpath-ng-src)) diff --git a/general/python/python-jsonschema-specifications/Makefile b/general/python/python-jsonschema-specifications/Makefile new file mode 100644 index 00000000..c33f57e0 --- /dev/null +++ b/general/python/python-jsonschema-specifications/Makefile @@ -0,0 +1,45 @@ +# +# 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-jsonschema-specifications +PKG_VERSION:=2023.11.2 +PKG_RELEASE:=1 + +PYPI_NAME:=jsonschema-specifications +PYPI_SOURCE_NAME:=jsonschema_specifications +PKG_HASH:=9472fc4fea474cd74bea4a2b190daeccb5a9e4db2ea80efcf7a1b582fc9a81b8 + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=COPYING +PKG_MAINTAINER:=Jeffery To + +PKG_BUILD_DEPENDS:=python-hatchling/host python-hatch-vcs/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-jsonschema-specifications + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=JSON Schema meta-schemas and vocabularies + URL:=https://github.com/python-jsonschema/jsonschema-specifications + DEPENDS:=+python3-light +python3-referencing +endef + +define Package/python3-jsonschema-specifications/description +JSON support files from the JSON Schema Specifications (metaschemas, +vocabularies, etc.), packaged for runtime access from Python as a +referencing-based Schema Registry. +endef + +$(eval $(call Py3Package,python3-jsonschema-specifications)) +$(eval $(call BuildPackage,python3-jsonschema-specifications)) +$(eval $(call BuildPackage,python3-jsonschema-specifications-src)) diff --git a/general/python/python-jsonschema-specifications/test.sh b/general/python/python-jsonschema-specifications/test.sh new file mode 100644 index 00000000..cdf2f571 --- /dev/null +++ b/general/python/python-jsonschema-specifications/test.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +[ "$1" = python3-jsonschema-specifications ] || exit 0 + +python3 - << 'EOF' + +from jsonschema_specifications import REGISTRY as SPECIFICATIONS + +DRAFT202012_DIALECT_URI = "https://json-schema.org/draft/2020-12/schema" +assert SPECIFICATIONS.contents(DRAFT202012_DIALECT_URI) != "" + +EOF diff --git a/general/python/python-jsonschema/Makefile b/general/python/python-jsonschema/Makefile new file mode 100644 index 00000000..82ce406b --- /dev/null +++ b/general/python/python-jsonschema/Makefile @@ -0,0 +1,43 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-jsonschema +PKG_VERSION:=4.22.0 +PKG_RELEASE:=1 + +PYPI_NAME:=jsonschema +PKG_HASH:=5b22d434a45935119af990552c862e5d6d564e8f6601206b305a61fdf661a2b7 + +PKG_MAINTAINER:=Javier Marcet +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=COPYING + +PKG_BUILD_DEPENDS:=python-hatchling/host python-hatch-vcs/host python-hatch-fancy-pypi-readme/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-jsonschema + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=An implementation of JSON Schema validation + URL:=https://github.com/python-jsonschema/jsonschema + DEPENDS:= \ + +python3-light \ + +python3-decimal \ + +python3-urllib \ + +python3-uuid \ + +python3-attrs \ + +python3-jsonschema-specifications \ + +python3-referencing \ + +python3-rpds-py +endef + +define Package/python3-jsonschema/description + jsonschema is an implementation of JSON Schema validation for Python. +endef + +$(eval $(call Py3Package,python3-jsonschema)) +$(eval $(call BuildPackage,python3-jsonschema)) +$(eval $(call BuildPackage,python3-jsonschema-src)) diff --git a/general/python/python-jsonschema/test.sh b/general/python/python-jsonschema/test.sh new file mode 100644 index 00000000..37fe4925 --- /dev/null +++ b/general/python/python-jsonschema/test.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +[ "$1" = python3-jsonschema ] || exit 0 + +python3 - << 'EOF' + +from jsonschema import validate + +# A sample schema, like what we'd get from json.load() +schema = { + "type" : "object", + "properties" : { + "price" : {"type" : "number"}, + "name" : {"type" : "string"}, + }, +} + +# If no exception is raised by validate(), the instance is valid. +validate(instance={"name" : "Eggs", "price" : 34.99}, schema=schema) + +EOF diff --git a/general/python/python-libmodbus/Makefile b/general/python/python-libmodbus/Makefile new file mode 100644 index 00000000..79de6898 --- /dev/null +++ b/general/python/python-libmodbus/Makefile @@ -0,0 +1,36 @@ +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=python-libmodbus +PKG_VERSION:=0.6.2 +PKG_RELEASE:=1 + +PYPI_NAME:=pylibmodbus +PKG_HASH:=7989af81f57cc7593c86b2d74201978e931bc80f6bbe62564273477fc7059c20 + +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Jeffery To + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-libmodbus + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Wrapper for libmodbus + URL:=https://github.com/stephane/pylibmodbus + DEPENDS:=+libmodbus \ + +python3-light \ + +python3-cffi +endef + +define Package/python3-libmodbus/description + Python Interface for libmodbus written with CFFI. +endef + +$(eval $(call Py3Package,python3-libmodbus)) +$(eval $(call BuildPackage,python3-libmodbus)) +$(eval $(call BuildPackage,python3-libmodbus-src)) diff --git a/general/python/python-lru-dict/Makefile b/general/python/python-lru-dict/Makefile new file mode 100644 index 00000000..a5171d6e --- /dev/null +++ b/general/python/python-lru-dict/Makefile @@ -0,0 +1,37 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-lru-dict +PKG_VERSION:=1.3.0 +PKG_RELEASE:=1 + +PYPI_NAME:=lru-dict +PKG_HASH:=54fd1966d6bd1fcde781596cb86068214edeebff1db13a2cea11079e3fd07b6b + +PKG_MAINTAINER:=Timothy Ace +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-lru-dict + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=An Dict like LRU container + URL:=https://github.com/amitdev/lru-dict + DEPENDS:=+python3-light +endef + +define Package/python3-lru-dict/description +A fixed size dict like container which evicts Least Recently Used (LRU) items +once size limit is exceeded. There are many python implementations available +which does similar things. This is a fast and efficient C implementation. LRU +maximum capacity can be modified at run-time. If you are looking for pure +python version, look elsewhere. +endef + +$(eval $(call Py3Package,python3-lru-dict)) +$(eval $(call BuildPackage,python3-lru-dict)) +$(eval $(call BuildPackage,python3-lru-dict-src)) diff --git a/general/python/python-lxml/Makefile b/general/python/python-lxml/Makefile new file mode 100644 index 00000000..d517cd84 --- /dev/null +++ b/general/python/python-lxml/Makefile @@ -0,0 +1,48 @@ +# +# Copyright (C) 2017 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-lxml +PKG_VERSION:=5.2.2 +PKG_RELEASE:=1 + +PYPI_NAME:=lxml +PKG_HASH:=bb2dc4898180bea79863d5487e5f9c7c34297414bad54bcd0f0852aee9cfdb87 + +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=LICENSES.txt +PKG_MAINTAINER:=Alexandru Ardelean +PKG_CPE_ID:=cpe:/a:lxml:lxml + +PKG_BUILD_DEPENDS:=python-cython/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-lxml + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Pythonic XML processing library + URL:=https://lxml.de + DEPENDS:=+libxml2 +libxslt +libexslt +python3-light +endef + +define Package/python3-lxml/description + lxml is a Pythonic, mature binding for the libxml2 and libxslt + libraries. It provides safe and convenient access to these libraries + using the ElementTree API. + + It extends the ElementTree API significantly to offer support for + XPath, RelaxNG, XML Schema, XSLT, C14N and much more. +endef + +$(eval $(call Py3Package,python3-lxml)) +$(eval $(call BuildPackage,python3-lxml)) +$(eval $(call BuildPackage,python3-lxml-src)) diff --git a/general/python/python-lxml/test.sh b/general/python/python-lxml/test.sh new file mode 100644 index 00000000..6ea15a0e --- /dev/null +++ b/general/python/python-lxml/test.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +[ "$1" = "python3-lxml" ] || exit 0 + +EXP_VER="$2" + +python3 - << EOF +import lxml +import sys + +if (lxml.__version__) != "$EXP_VER": + print("Wrong version: " + lxml.__version__) + sys.exit(1) + +from lxml import etree + +root = etree.Element("root") +root.append(etree.Element("child1")) +root.append(etree.Element("child2")) +root.append(etree.Element("child3")) + +exp_str = "b''" +got_str = str(etree.tostring(root)) +if (got_str != exp_str): + print("Expected: '" + exp_str + "' . Got: '" + got_str + "'") +else: + print("OK") + +sys.exit(0) +EOF + diff --git a/general/python/python-mako/Makefile b/general/python/python-mako/Makefile new file mode 100644 index 00000000..7d3d4179 --- /dev/null +++ b/general/python/python-mako/Makefile @@ -0,0 +1,59 @@ +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-mako +PKG_VERSION:=1.3.0 +PKG_RELEASE:=1 + +PYPI_NAME:=Mako +PKG_HASH:=e3a9d388fd00e87043edbe8792f45880ac0114e9c4adc69f6e9bfb2c55e3b11b + +PKG_MAINTAINER:=Jeffery To +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE +PKG_CPE_ID:=cpe:/a:sqlalchemy:mako + +PKG_HOST_ONLY:=1 +HOST_BUILD_DEPENDS:= \ + python3/host \ + python-build/host \ + python-installer/host \ + python-wheel/host \ + python-markupsafe/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-mako + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Super-fast templating language + URL:=https://www.makotemplates.org/ + DEPENDS:=+python3-light +python3-urllib +python3-markupsafe + BUILDONLY:=1 +endef + +define Package/python3-mako/description +Mako is a template library written in Python. It provides a familiar, +non-XML syntax which compiles into Python modules for maximum +performance. Mako's syntax and API borrows from the best ideas of many +others, including Django templates, Cheetah, Myghty, and Genshi. +Conceptually, Mako is an embedded Python (i.e. Python Server Page) +language, which refines the familiar ideas of componentized layout and +inheritance to produce one of the most straightforward and flexible +models available, while also maintaining close ties to Python calling +and scoping semantics. +endef + +$(eval $(call Py3Package,python3-mako)) +$(eval $(call BuildPackage,python3-mako)) +$(eval $(call BuildPackage,python3-mako-src)) +$(eval $(call HostBuild)) diff --git a/general/python/python-markdown/Makefile b/general/python/python-markdown/Makefile new file mode 100644 index 00000000..1ab6bda3 --- /dev/null +++ b/general/python/python-markdown/Makefile @@ -0,0 +1,46 @@ +# +# Copyright (C) 2019-2O21 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-markdown +PKG_VERSION:=3.4.4 +PKG_RELEASE:=1 + +PYPI_NAME:=Markdown +PKG_HASH:=225c6123522495d4119a90b3a3ba31a1e87a70369e03f14799ea9c0d7183a3d6 + +PKG_MAINTAINER:=Josef Schlehofer +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=LICENSE.md + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-markdown + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Implementation of John Gruber's Markdown + URL:=https://python-markdown.github.io/ + DEPENDS:= \ + +python3-light \ + +python3-codecs \ + +python3-logging \ + +python3-xml +endef + +define Package/python3-markdown/description +This is a Python implementation of John Gruber’s Markdown. It is almost +completely compliant with the reference implementation, though there are +a few very minor differences. +endef + +$(eval $(call Py3Package,python3-markdown)) +$(eval $(call BuildPackage,python3-markdown)) +$(eval $(call BuildPackage,python3-markdown-src)) diff --git a/general/python/python-markupsafe/Makefile b/general/python/python-markupsafe/Makefile new file mode 100644 index 00000000..63e5309d --- /dev/null +++ b/general/python/python-markupsafe/Makefile @@ -0,0 +1,46 @@ +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-markupsafe +PKG_VERSION:=2.1.3 +PKG_RELEASE:=1 + +PYPI_NAME:=MarkupSafe +PKG_HASH:=af598ed32d6ae86f1b747b82783958b1a4ab8f617b06fe68795c7f026abbdcad + +PKG_MAINTAINER:=Jeffery To +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=LICENSE.rst + +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-markupsafe + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Safely add untrusted strings to HTML/XML markup + URL:=https://palletsprojects.com/p/markupsafe/ + DEPENDS:=+python3-light +endef + +define Package/python3-markupsafe/description +MarkupSafe implements a text object that escapes characters so it is +safe to use in HTML and XML. Characters that have special meanings are +replaced so that they display as the actual characters. This mitigates +injection attacks, meaning untrusted user input can safely be displayed +on a page. +endef + +$(eval $(call Py3Package,python3-markupsafe)) +$(eval $(call BuildPackage,python3-markupsafe)) +$(eval $(call BuildPackage,python3-markupsafe-src)) +$(eval $(call HostBuild)) diff --git a/general/python/python-maturin/Makefile b/general/python/python-maturin/Makefile new file mode 100644 index 00000000..67bb1e0a --- /dev/null +++ b/general/python/python-maturin/Makefile @@ -0,0 +1,51 @@ +# SPDX-License-Identifier: GPL-2.0-only +# +# Copyright (C) 2023 Luca Barbato + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-maturin +PKG_VERSION:=1.3.0 +PKG_RELEASE:=1 + +PYPI_NAME:=maturin +PKG_HASH:=f6c69bc7ae147a5effd55587447b35cab1ceb726ba244d08698bc7518b8688ac + +PKG_MAINTAINER:=Luca Barbato +PKG_LICENSE:=Apache-2.0 MIT +PKG_LICENSE_FILES:=license-apache license-mit + +HOST_BUILD_DEPENDS:= \ + python3/host \ + python-build/host \ + python-installer/host \ + python-wheel/host \ + python-setuptools-rust/host +HOST_BUILD_PARALLEL:=1 +PKG_HOST_ONLY:=1 + +include ../pypi.mk +include $(INCLUDE_DIR)/host-build.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk +include ../python3-host-build.mk + +define Package/python3-maturin + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Build and publish crates as python packages + DEPENDS:=$(RUST_ARCH_DEPENDS) + URL:=https://maturin.rs + BUILDONLY:=1 +endef + +define Package/python3-maturin/description + Build and publish crates with pyo3, rust-cpython, cffi and uniffi + bindings as well as rust binaries as python packages. +endef + +$(eval $(call HostBuild)) +$(eval $(call Py3Package,python3-maturin)) +$(eval $(call BuildPackage,python3-maturin)) +$(eval $(call BuildPackage,python3-maturin-src)) diff --git a/general/python/python-maxminddb/Makefile b/general/python/python-maxminddb/Makefile new file mode 100644 index 00000000..6a6367db --- /dev/null +++ b/general/python/python-maxminddb/Makefile @@ -0,0 +1,41 @@ +# +# Copyright (C) 2019-2020 CZ.NIC z.s.p.o. (http://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-maxminddb +PKG_VERSION:=2.4.0 +PKG_RELEASE:=1 + +PYPI_NAME:=maxminddb +PKG_HASH:=81e54e53408bd502650e5969ccba16780af659ec1db1c44b2c997e4330a5ed96 + +PKG_MAINTAINER:=Jan Pavlinec +PKG_LICENSE:=Apache-2.0 +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-maxminddb + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Reader for the MaxMind DB format + URL:=https://www.maxmind.com/ + DEPENDS:=+python3-light +libmaxminddb +endef + +define Package/python3-maxminddb/description + Module for reading MaxMind DB files +endef + +$(eval $(call Py3Package,python3-maxminddb)) +$(eval $(call BuildPackage,python3-maxminddb)) +$(eval $(call BuildPackage,python3-maxminddb-src)) diff --git a/general/python/python-more-itertools/Makefile b/general/python/python-more-itertools/Makefile new file mode 100644 index 00000000..a16ed56d --- /dev/null +++ b/general/python/python-more-itertools/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2019-2021 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-more-itertools +PKG_VERSION:=10.1.0 +PKG_RELEASE:=1 + +PYPI_NAME:=more-itertools +PKG_HASH:=626c369fa0eb37bac0291bce8259b332fd59ac792fa5497b59837309cd5b114a + +PKG_MAINTAINER:=Jan Pavlinec +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE + +PKG_BUILD_DEPENDS:=python-flit-core/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-more-itertools + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=More routines for operating on iterables, beyond itertools + URL:=https://github.com/more-itertools/more-itertools + DEPENDS:=+python3-light +endef + +define Package/python3-more-itertools/description + more-itertools library collects additional building blocks, + recipes, and routines for working with Python iterables. +endef + +$(eval $(call Py3Package,python3-more-itertools)) +$(eval $(call BuildPackage,python3-more-itertools)) +$(eval $(call BuildPackage,python3-more-itertools-src)) diff --git a/general/python/python-msgpack/Makefile b/general/python/python-msgpack/Makefile new file mode 100644 index 00000000..6e4e6316 --- /dev/null +++ b/general/python/python-msgpack/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2017-2020 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-msgpack +PKG_VERSION:=1.0.7 +PKG_RELEASE:=1 + +PYPI_NAME:=msgpack +PKG_HASH:=572efc93db7a4d27e404501975ca6d2d9775705c2d922390d878fcf768d92c87 + +PKG_MAINTAINER:=Jan Pavlinec +PKG_LICENSE:=Apache-2.0 +PKG_LICENSE_FILES:=COPYING + +PKG_BUILD_DEPENDS:=python-cython/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-msgpack + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=MessagePack serializer + URL:=https://msgpack.org/ + DEPENDS:=+python3-light +libstdcpp +endef + +define Package/python3-msgpack/description + MessagePack is an efficient binary serialization format. + It lets you exchange data among multiple languages like JSON. +endef + +$(eval $(call Py3Package,python3-msgpack)) +$(eval $(call BuildPackage,python3-msgpack)) +$(eval $(call BuildPackage,python3-msgpack-src)) diff --git a/general/python/python-multidict/Makefile b/general/python/python-multidict/Makefile new file mode 100644 index 00000000..67d1a488 --- /dev/null +++ b/general/python/python-multidict/Makefile @@ -0,0 +1,41 @@ +# +# Copyright (C) 2019 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-multidict +PKG_VERSION:=6.0.4 +PKG_RELEASE:=1 + +PYPI_NAME:=multidict +PKG_HASH:=3666906492efb76453c0e7b97f2cf459b0682e7402c0489a95484965dbc1da49 + +PKG_MAINTAINER:=Josef Schlehofer +PKG_LICENSE:=Apache-2.0 +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-multidict + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=multidict implementation + URL:=https://github.com/aio-libs/multidict + DEPENDS:=+python3-light +endef + +define Package/python3-multidict/description +Multidict is dict-like collection of key-value pairs where key might be +occurred more than once in the container. +endef + +$(eval $(call Py3Package,python3-multidict)) +$(eval $(call BuildPackage,python3-multidict)) +$(eval $(call BuildPackage,python3-multidict-src)) diff --git a/general/python/python-netdisco/Makefile b/general/python/python-netdisco/Makefile new file mode 100644 index 00000000..1c497190 --- /dev/null +++ b/general/python/python-netdisco/Makefile @@ -0,0 +1,48 @@ +# +# Copyright (C) 2019 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-netdisco +PKG_VERSION:=3.0.0 +PKG_RELEASE:=1 + +PYPI_NAME:=netdisco +PKG_HASH:=4dbb590482f377ccc461e01742707ccbe8f1d2d1b28578af91dc9b7febcdcbd2 + +PKG_MAINTAINER:=Josef Schlehofer +PKG_LICENSE:=Apache-2.0 +PKG_LICENSE_FILES:=LICENSE.md + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-netdisco + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Discover devices on your local network + URL:=https://github.com/home-assistant/netdisco + DEPENDS:= \ + +python3-light \ + +python3-logging \ + +python3-urllib \ + +python3-xml \ + +python3-requests \ + +python3-zeroconf +endef + +define Package/python3-netdisco/description +NetDisco is a Python 3 library to discover local devices and services. +It allows to scan on demand or offer a service that will scan the +network in the background in a set interval. +endef + +$(eval $(call Py3Package,python3-netdisco)) +$(eval $(call BuildPackage,python3-netdisco)) +$(eval $(call BuildPackage,python3-netdisco-src)) diff --git a/general/python/python-netifaces/Makefile b/general/python/python-netifaces/Makefile new file mode 100644 index 00000000..351752a5 --- /dev/null +++ b/general/python/python-netifaces/Makefile @@ -0,0 +1,40 @@ +# +# Copyright (C) 2019 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-netifaces +PKG_VERSION:=0.11.0 +PKG_RELEASE:=1 + +PYPI_NAME:=netifaces +PKG_HASH:=043a79146eb2907edf439899f262b3dfe41717d34124298ed281139a8b93ca32 + +PKG_MAINTAINER:=Josef Schlehofer +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-netifaces + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Portable network interface information + URL:=https://github.com/al45tair/netifaces + DEPENDS:=+python3-light +endef + +define Package/python3-netifaces/description + Portable network interface information. +endef + +$(eval $(call Py3Package,python3-netifaces)) +$(eval $(call BuildPackage,python3-netifaces)) +$(eval $(call BuildPackage,python3-netifaces-src)) diff --git a/general/python/python-networkx/Makefile b/general/python/python-networkx/Makefile new file mode 100644 index 00000000..1f67591e --- /dev/null +++ b/general/python/python-networkx/Makefile @@ -0,0 +1,40 @@ +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-networkx +PKG_VERSION:=3.3 +PKG_RELEASE:=1 + +PYPI_NAME:=networkx +PKG_HASH:=0c127d8b2f4865f59ae9cb8aafcd60b5c70f3241ebd66f7defad7c4ab90126c9 + +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=LICENSE.txt +PKG_CPE_ID:=cpe:/a:python:networkx +PKG_MAINTAINER:=W. Michael Petullo + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-networkx + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Creating and manipulating graphs and networks + URL:=https://networkx.org/ + DEPENDS:=+python3-light +python3-uuid +python3-xml +endef + +define Package/python3-networkx/description +NetworkX is a Python package for the creation, manipulation, and study +of the structure, dynamics, and functions of complex networks. +endef + +$(eval $(call Py3Package,python3-networkx)) +$(eval $(call BuildPackage,python3-networkx)) +$(eval $(call BuildPackage,python3-networkx-src)) diff --git a/general/python/python-orjson/Makefile b/general/python/python-orjson/Makefile new file mode 100644 index 00000000..9352d65c --- /dev/null +++ b/general/python/python-orjson/Makefile @@ -0,0 +1,37 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-orjson +PKG_VERSION:=3.10.0 +PKG_RELEASE:=1 + +PYPI_NAME:=orjson +PKG_HASH:=ba4d8cac5f2e2cff36bea6b6481cdb92b38c202bcec603d6f5ff91960595a1ed + +PKG_MAINTAINER:=Timothy Ace +PKG_LICENSE:=Apache-2.0 MIT +PKG_LICENSE_FILES:=LICENSE-APACHE LICENSE-MIT + +PKG_BUILD_DEPENDS:=python-maturin/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-orjson + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Fast, correct Python JSON library + URL:=https://github.com/ijl/orjson + DEPENDS:= \ + +python3-light \ + $(RUST_ARCH_DEPENDS) +endef + +define Package/python3-orjson/description +Fast, correct Python JSON library supporting dataclasses, datetimes, and numpy +endef + +$(eval $(call Py3Package,python3-orjson)) +$(eval $(call BuildPackage,python3-orjson)) +$(eval $(call BuildPackage,python3-orjson-src)) diff --git a/general/python/python-outcome/Makefile b/general/python/python-outcome/Makefile new file mode 100644 index 00000000..05ec2412 --- /dev/null +++ b/general/python/python-outcome/Makefile @@ -0,0 +1,42 @@ +# +# Copyright (C) 2022 Julien Malik +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-outcome +PKG_VERSION:=1.2.0 +PKG_RELEASE:=1 + +PYPI_NAME:=outcome +PKG_HASH:=6f82bd3de45da303cf1f771ecafa1633750a358436a8bb60e06a1ceb745d2672 + +PKG_LICENSE:=Apache-2.0|MIT +PKG_LICENSE_FILES:=LICENSE.APACHE2|LICENSE.MIT +PKG_MAINTAINER:=Julien Malik + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-outcome + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Capture the outcome of Python function calls. + URL:=https://outcome.readthedocs.io + DEPENDS:= \ + +python3-light \ + +python3-attrs +endef + +define Package/python3-outcome/description + Capture the outcome of Python function calls. Extracted from the Trio project. +endef + +$(eval $(call Py3Package,python3-outcome)) +$(eval $(call BuildPackage,python3-outcome)) +$(eval $(call BuildPackage,python3-outcome-src)) diff --git a/general/python/python-package-install.sh b/general/python/python-package-install.sh new file mode 100644 index 00000000..4e7fb7af --- /dev/null +++ b/general/python/python-package-install.sh @@ -0,0 +1,140 @@ +#!/bin/sh + +log() { + printf '%s\n' "$*" +} + +error() { + printf 'Error: %s\n' "$*" >&2 +} + +path_exists() { + local dir="$1" + local path="$2" + + [ -n "$(find "$dir"/$path -print -quit 2>/dev/null)" ] +} + +file_dir_chmod() { + local dir="$1" + local path="$2" + local file_mode="$3" + local dir_mode="$4" + shift; shift; shift; shift; + + if [ -n "$file_mode" ]; then + find "$dir"/$path -type f "$@" -exec chmod "$file_mode" -- '{}' + + fi + + if [ -n "$dir_mode" ]; then + find "$dir"/$path -type d "$@" -exec chmod "$dir_mode" -- '{}' + + fi +} + +src="$1" +dest="$2" +filespec="$3" + +if [ -z "$src" ]; then + error "Missing source directory" + exit 1 +fi +if [ -z "$dest" ]; then + error "Missing destination directory" + exit 1 +fi + +while IFS='|' read -r cmd path file_mode dir_mode; do + + # trim whitespace + + cmd="${cmd#"${cmd%%[![:space:]]*}"}" + cmd="${cmd%"${cmd##*[![:space:]]}"}" + + path="${path#"${path%%[![:space:]]*}"}" + path="${path%"${path##*[![:space:]]}"}" + + file_mode="${file_mode#"${file_mode%%[![:space:]]*}"}" + file_mode="${file_mode%"${file_mode##*[![:space:]]}"}" + + dir_mode="${dir_mode#"${dir_mode%%[![:space:]]*}"}" + dir_mode="${dir_mode%"${dir_mode##*[![:space:]]}"}" + + + if [ -z "$cmd" ] || [ "$cmd" != "${cmd#\#}" ]; then + continue + fi + + if [ -z "$path" ]; then + error "Missing path for \"$cmd\"" + exit 1 + fi + + case "$cmd" in + +) + log "Copying: \"$path\"" + + if ! path_exists "$src" "$path"; then + error "\"$src/$path\" not found" + exit 1 + fi + + dir="${path%/*}" + mkdir -p "$dest/$dir" + cp -fpR "$src"/$path "$dest/$dir/" + + file_dir_chmod "$dest" "$path" "$file_mode" "$dir_mode" + ;; + + -) + log "Removing: \"$path\"" + + if ! path_exists "$dest" "$path"; then + error "\"$dest/$path\" not found" + exit 1 + fi + + rm -fR -- "$dest"/$path + ;; + + =) + log "Setting recursive permissions \"${file_mode:-(none)}\"/\"${dir_mode:-(none)}\" on \"$path\"" + + if ! path_exists "$dest" "$path"; then + error "\"$dest/$path\" not found" + exit 1 + fi + + if [ -z "$file_mode$dir_mode" ]; then + error "Missing recursive permissions for \"$path\"" + exit 1 + fi + + file_dir_chmod "$dest" "$path" "$file_mode" "$dir_mode" + ;; + + ==) + log "Setting permissions \"${file_mode:-(none)}\"/\"${dir_mode:-(none)}\" on \"$path\"" + + if ! path_exists "$dest" "$path"; then + error "\"$dest/$path\" not found" + exit 1 + fi + + if [ -z "$file_mode$dir_mode" ]; then + error "Missing permissions for \"$path\"" + exit 1 + fi + + file_dir_chmod "$dest" "$path" "$file_mode" "$dir_mode" -maxdepth 0 + ;; + + *) + error "Unknown command \"$cmd\"" + exit 1 + ;; + esac + +done << EOF +$filespec +EOF diff --git a/general/python/python-packaging/Makefile b/general/python/python-packaging/Makefile new file mode 100644 index 00000000..1bec008b --- /dev/null +++ b/general/python/python-packaging/Makefile @@ -0,0 +1,48 @@ +# +# Copyright (C) 2020-2021 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-packaging +PKG_VERSION:=23.2 +PKG_RELEASE:=1 + +PYPI_NAME:=packaging +PKG_HASH:=048fb0e9405036518eaaf48a55953c750c11e1a1b68e0dd1a9d62ed0c092cfc5 + +PKG_MAINTAINER:=Jan Pavlinec , Jeffery To +PKG_LICENSE:=Apache-2.0 BSD-2-Clause +PKG_LICENSE_FILES:=LICENSE.APACHE LICENSE.BSD + +PKG_BUILD_DEPENDS:=python-flit-core/host +HOST_BUILD_DEPENDS:=python3/host python-flit-core/host python-installer/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-packaging + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Core utilities for Python packages + URL:=https://github.com/pypa/packaging + DEPENDS:=+python3-light +python3-email +python3-logging +python3-urllib +endef + +define Package/python3-packaging/description + The packaging project includes version handling, specifiers, + markers, requirements, tags, utilities. +endef + +Host/Compile=$(Py3Host/Compile/Bootstrap) + +$(eval $(call Py3Package,python3-packaging)) +$(eval $(call BuildPackage,python3-packaging)) +$(eval $(call BuildPackage,python3-packaging-src)) +$(eval $(call HostBuild)) diff --git a/general/python/python-packaging/test.sh b/general/python/python-packaging/test.sh new file mode 100644 index 00000000..4fc13bae --- /dev/null +++ b/general/python/python-packaging/test.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +[ "$1" = python3-packaging ] || exit 0 + +python3 - << EOF +import sys +from packaging.version import Version, parse +v1 = parse("1.0a5") +v2 = Version("1.0") +sys.exit(0 if v1 < v2 else 1) +EOF diff --git a/general/python/python-paho-mqtt/Makefile b/general/python/python-paho-mqtt/Makefile new file mode 100644 index 00000000..4028dc9c --- /dev/null +++ b/general/python/python-paho-mqtt/Makefile @@ -0,0 +1,37 @@ +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-paho-mqtt +PKG_VERSION:=1.6.1 +PKG_RELEASE:=2 + +PKG_MAINTAINER:=Josef Schlehofer , Alexandru Ardelean +PKG_LICENSE:=EPL-2.0 Eclipse Distribution License v1.0 +PKG_LICENSE_FILES:=epl-v20 edl-v10 LICENSE.txt + +PYPI_NAME:=paho-mqtt +PKG_HASH:=2a8291c81623aec00372b5a85558a372c747cbca8e9934dfe218638b8eefc26f + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-paho-mqtt + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=MQTT version 5.0/3.1.1 client class + URL:=http://eclipse.org/paho + DEPENDS:=+python3-light +python3-uuid +endef + +define Package/python3-paho-mqtt/description + MQTT version 3.1/3.1.1/5.0 client class +endef + +$(eval $(call Py3Package,python3-paho-mqtt)) +$(eval $(call BuildPackage,python3-paho-mqtt)) +$(eval $(call BuildPackage,python3-paho-mqtt-src)) diff --git a/general/python/python-paramiko/Makefile b/general/python/python-paramiko/Makefile new file mode 100644 index 00000000..7c381749 --- /dev/null +++ b/general/python/python-paramiko/Makefile @@ -0,0 +1,38 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-paramiko +PKG_VERSION:=2.12.0 +PKG_RELEASE:=2 + +PYPI_NAME:=paramiko +PKG_HASH:=376885c05c5d6aa6e1f4608aac2a6b5b0548b1add40274477324605903d9cd49 + +PKG_MAINTAINER:=Javier Marcet +PKG_LICENSE:=LGPL-2.1-or-later +PKG_LICENSE_FILES:=LICENSE +PKG_CPE_ID:=cpe:/a:paramiko:paramiko + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-paramiko + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=SSH2 protocol library + URL:=https://github.com/paramiko/paramiko/ + DEPENDS:=+python3-light +python3-logging +python3-bcrypt \ + +python3-cryptography +python3-openssl +python3-pynacl +endef + +define Package/python3-paramiko/description + Paramiko is a Python (2.7, 3.4+) implementation of the SSHv2 protocol, + providing both client and server functionality. While it leverages a Python + C extension for low level cryptography (Cryptography), Paramiko itself is a + pure Python interface around SSH networking concepts. +endef + +$(eval $(call Py3Package,python3-paramiko)) +$(eval $(call BuildPackage,python3-paramiko)) +$(eval $(call BuildPackage,python3-paramiko-src)) diff --git a/general/python/python-parsley/Makefile b/general/python/python-parsley/Makefile new file mode 100644 index 00000000..cff3d3ed --- /dev/null +++ b/general/python/python-parsley/Makefile @@ -0,0 +1,40 @@ +# +# Copyright (C) 2015, 2017-2018 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-parsley +PKG_VERSION:=1.3 +PKG_RELEASE:=6 + +PYPI_NAME:=Parsley +PKG_HASH:=9444278d47161d5f2be76a767809a3cbe6db4db822f46a4fd7481d4057208d41 + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Jeffery To + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-parsley + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Parsing and pattern matching + URL:=http://launchpad.net/parsley + DEPENDS:=+python3-light +endef + +define Package/python3-parsley/description +Parsing and pattern matching made easy. +endef + +$(eval $(call Py3Package,python3-parsley)) +$(eval $(call BuildPackage,python3-parsley)) +$(eval $(call BuildPackage,python3-parsley-src)) diff --git a/general/python/python-parsley/patches/001-py3-read-utf8.patch b/general/python/python-parsley/patches/001-py3-read-utf8.patch new file mode 100644 index 00000000..f3e63dcc --- /dev/null +++ b/general/python/python-parsley/patches/001-py3-read-utf8.patch @@ -0,0 +1,19 @@ +--- a/setup.py ++++ b/setup.py +@@ -4,6 +4,7 @@ + Setup script for the Parsley distribution. + """ + ++import io + from distutils.core import setup + setup( + name="Parsley", +@@ -13,7 +14,7 @@ setup( + author="Allen Short", + author_email="washort42@gmail.com", + license="MIT License", +- long_description=open("README").read(), ++ long_description=io.open("README", encoding="utf-8").read(), + packages=["ometa", "terml", "ometa._generated", "terml._generated", + "ometa.test", "terml.test"], + py_modules=["parsley"] diff --git a/general/python/python-parsley/patches/002-omit-tests.patch b/general/python/python-parsley/patches/002-omit-tests.patch new file mode 100644 index 00000000..4fe43b87 --- /dev/null +++ b/general/python/python-parsley/patches/002-omit-tests.patch @@ -0,0 +1,11 @@ +--- a/setup.py ++++ b/setup.py +@@ -15,7 +15,6 @@ setup( + author_email="washort42@gmail.com", + license="MIT License", + long_description=io.open("README", encoding="utf-8").read(), +- packages=["ometa", "terml", "ometa._generated", "terml._generated", +- "ometa.test", "terml.test"], ++ packages=["ometa", "terml", "ometa._generated", "terml._generated"], + py_modules=["parsley"] + ) diff --git a/general/python/python-passlib/Makefile b/general/python/python-passlib/Makefile new file mode 100644 index 00000000..bcd6dc51 --- /dev/null +++ b/general/python/python-passlib/Makefile @@ -0,0 +1,40 @@ +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-passlib +PKG_VERSION:=1.7.4 +PKG_RELEASE:=1 + +PYPI_NAME:=passlib +PKG_HASH:=defd50f72b65c5402ab2c573830a6978e5f202ad0d984793c8dde2c4152ebe04 + +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-passlib + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Comprehensive password hashing framework + URL:=https://passlib.readthedocs.io/ + DEPENDS:=+python3 +endef + +define Package/python3-passlib/description +Passlib is a password hashing library for Python 2 & 3, which provides +cross-platform implementations of over 30 password hashing algorithms, +as well as a framework for managing existing password hashes. It’s +designed to be useful for a wide range of tasks, from verifying a hash +found in /etc/shadow, to providing full-strength password hashing for +multi-user applications. +endef + +$(eval $(call Py3Package,python3-passlib)) +$(eval $(call BuildPackage,python3-passlib)) +$(eval $(call BuildPackage,python3-passlib-src)) diff --git a/general/python/python-pathspec/Makefile b/general/python/python-pathspec/Makefile new file mode 100644 index 00000000..e2dcacfd --- /dev/null +++ b/general/python/python-pathspec/Makefile @@ -0,0 +1,50 @@ +# +# 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-pathspec +PKG_VERSION:=0.12.1 +PKG_RELEASE:=1 + +PYPI_NAME:=pathspec +PKG_HASH:=a482d51503a1ab33b1c67a6c3813a26953dbdc71c31dacaef9a838c4e29f5712 + +PKG_LICENSE:=MPL-2.0 +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Jeffery To + +PKG_HOST_ONLY:=1 +HOST_BUILD_DEPENDS:=python3/host python-build/host python-installer/host python-flit-core/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-pathspec + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=gitignore style pattern matching of file paths + URL:=https://github.com/cpburnz/python-pathspec + DEPENDS:=+python3-light + BUILDONLY:=1 +endef + +define Package/python3-pathspec/description +pathspec is a utility library for pattern matching of file paths. So far +this only includes Git's wildmatch pattern matching which itself is +derived from Rsync's wildmatch. Git uses wildmatch for its gitignore +files. +endef + +$(eval $(call Py3Package,python3-pathspec)) +$(eval $(call BuildPackage,python3-pathspec)) +$(eval $(call BuildPackage,python3-pathspec-src)) +$(eval $(call HostBuild)) diff --git a/general/python/python-pip/Makefile b/general/python/python-pip/Makefile new file mode 100644 index 00000000..7d50f3f7 --- /dev/null +++ b/general/python/python-pip/Makefile @@ -0,0 +1,56 @@ +# +# 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-pip +PKG_VERSION:=23.3.1 +PKG_RELEASE:=1 + +PYPI_NAME:=pip +PKG_HASH:=1fcaa041308d01f14575f6d0d2ea4b75a3e2871fe4f9c694976f908768e14174 + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE.txt +PKG_MAINTAINER:=Jeffery To +PKG_CPE_ID:=cpe:/a:pypa:pip + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-pip + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=PyPA recommended tool for installing Python packages + URL:=https://pip.pypa.io/ + DEPENDS:=+python3 +endef + +define Package/python3-pip/description +pip is the package installer for Python. You can use pip to install +packages from the Python Package Index and other indexes. +endef + +define Package/python3-pip/conffiles +/etc/pip.conf +endef + +define Py3Package/python3-pip/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/pip$(PYTHON3_VERSION) $(1)/usr/bin/ + $(LN) pip$(PYTHON3_VERSION) $(1)/usr/bin/pip3 + $(LN) pip$(PYTHON3_VERSION) $(1)/usr/bin/pip + + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DATA) ./files/pip.conf $(1)/etc/ +endef + +$(eval $(call Py3Package,python3-pip)) +$(eval $(call BuildPackage,python3-pip)) +$(eval $(call BuildPackage,python3-pip-src)) diff --git a/general/python/python-pip/files/pip.conf b/general/python/python-pip/files/pip.conf new file mode 100644 index 00000000..08900815 --- /dev/null +++ b/general/python/python-pip/files/pip.conf @@ -0,0 +1,2 @@ +[global] +cache-dir = /var/cache/pip diff --git a/general/python/python-pip/patches/001-pyproject-hooks-pyc-fix.patch b/general/python/python-pip/patches/001-pyproject-hooks-pyc-fix.patch new file mode 100644 index 00000000..e9eafab9 --- /dev/null +++ b/general/python/python-pip/patches/001-pyproject-hooks-pyc-fix.patch @@ -0,0 +1,19 @@ +--- a/src/pip/_vendor/pyproject_hooks/_in_process/__init__.py ++++ b/src/pip/_vendor/pyproject_hooks/_in_process/__init__.py +@@ -11,8 +11,14 @@ try: + except AttributeError: + # Python 3.8 compatibility + def _in_proc_script_path(): +- return resources.path(__package__, '_in_process.py') ++ filename = '_in_process.pyc' ++ if resources.is_resource(__package__, '_in_process.py'): ++ filename = '_in_process.py' ++ return resources.path(__package__, filename) + else: + def _in_proc_script_path(): ++ filename = '_in_process.pyc' ++ if resources.files(__package__).joinpath('_in_process.py').is_file(): ++ filename = '_in_process.py' + return resources.as_file( +- resources.files(__package__).joinpath('_in_process.py')) ++ resources.files(__package__).joinpath(filename)) diff --git a/general/python/python-pip/patches/002-pip-runner-pyc-fix.patch b/general/python/python-pip/patches/002-pip-runner-pyc-fix.patch new file mode 100644 index 00000000..8f68049a --- /dev/null +++ b/general/python/python-pip/patches/002-pip-runner-pyc-fix.patch @@ -0,0 +1,15 @@ +--- a/src/pip/_internal/build_env.py ++++ b/src/pip/_internal/build_env.py +@@ -54,7 +54,11 @@ def get_runnable_pip() -> str: + # case, we can use that directly. + return str(source) + +- return os.fsdecode(source / "__pip-runner__.py") ++ filename = "__pip-runner__.pyc" ++ py = source / "__pip-runner__.py" ++ if py.is_file(): ++ filename = "__pip-runner__.py" ++ return os.fsdecode(source / filename) + + + def _get_system_sitepackages() -> Set[str]: diff --git a/general/python/python-pip/patches/003-disable-pip-version-check.patch b/general/python/python-pip/patches/003-disable-pip-version-check.patch new file mode 100644 index 00000000..99a0258a --- /dev/null +++ b/general/python/python-pip/patches/003-disable-pip-version-check.patch @@ -0,0 +1,20 @@ +From: Barry Warsaw +Date: Fri, 18 Nov 2016 17:07:47 -0500 +Subject: Set --disable-pip-version-check=True by default. + +Patch-Name: disable-pip-version-check.patch +--- + src/pip/_internal/cli/cmdoptions.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/src/pip/_internal/cli/cmdoptions.py ++++ b/src/pip/_internal/cli/cmdoptions.py +@@ -895,7 +895,7 @@ disable_pip_version_check: Callable[..., + "--disable-pip-version-check", + dest="disable_pip_version_check", + action="store_true", +- default=False, ++ default=True, + help="Don't periodically check PyPI to determine whether a new version " + "of pip is available for download. Implied with --no-index.", + ) diff --git a/general/python/python-pip/test.sh b/general/python/python-pip/test.sh new file mode 100644 index 00000000..10355b3e --- /dev/null +++ b/general/python/python-pip/test.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +[ "$1" = python3-pip ] || exit 0 + +pip --version | grep -F "pip $PKG_VERSION " diff --git a/general/python/python-pkgconfig/Makefile b/general/python/python-pkgconfig/Makefile new file mode 100644 index 00000000..d2021036 --- /dev/null +++ b/general/python/python-pkgconfig/Makefile @@ -0,0 +1,48 @@ +# +# 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-pkgconfig +PKG_VERSION:=1.5.5 +PKG_RELEASE:=1 + +PYPI_NAME:=pkgconfig +PKG_HASH:=deb4163ef11f75b520d822d9505c1f462761b4309b1bb713d08689759ea8b899 + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Jeffery To + +PKG_HOST_ONLY:=1 +HOST_BUILD_DEPENDS:=python3/host python-build/host python-installer/host python-poetry-core/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-pkgconfig + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Interface Python with pkg-config + URL:=https://github.com/matze/pkgconfig + DEPENDS:=+python3-light + BUILDONLY:=1 +endef + +define Package/python3-pkgconfig/description +pkgconfig is a Python module to interface with the pkg-config command +line tool for Python 3.3+. +endef + +$(eval $(call Py3Package,python3-pkgconfig)) +$(eval $(call BuildPackage,python3-pkgconfig)) +$(eval $(call BuildPackage,python3-pkgconfig-src)) +$(eval $(call HostBuild)) diff --git a/general/python/python-platformdirs/Makefile b/general/python/python-platformdirs/Makefile new file mode 100644 index 00000000..cd867cd1 --- /dev/null +++ b/general/python/python-platformdirs/Makefile @@ -0,0 +1,47 @@ +# +# 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-platformdirs +PKG_VERSION:=4.1.0 +PKG_RELEASE:=1 + +PYPI_NAME:=platformdirs +PKG_HASH:=906d548203468492d432bcb294d4bc2fff751bf84971fbb2c10918cc206ee420 + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Jeffery To + +PKG_BUILD_DEPENDS:=python-hatchling/host python-hatch-vcs/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-platformdirs + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Determine appropriate platform-specific dirs + URL:=https://github.com/platformdirs/platformdirs + DEPENDS:=+python3-light +python3-urllib +endef + +define Package/python3-platformdirs/description +When writing desktop application, finding the right location to store +user data and configuration varies per platform. Even for +single-platform apps, there may by plenty of nuances in figuring out the +right location. + +This kind of thing is what the platformdirs package is for. +endef + +$(eval $(call Py3Package,python3-platformdirs)) +$(eval $(call BuildPackage,python3-platformdirs)) +$(eval $(call BuildPackage,python3-platformdirs-src)) diff --git a/general/python/python-platformdirs/test.sh b/general/python/python-platformdirs/test.sh new file mode 100644 index 00000000..40dabb2f --- /dev/null +++ b/general/python/python-platformdirs/test.sh @@ -0,0 +1,33 @@ +#!/bin/sh + +[ "$1" = python3-platformdirs ] || exit 0 + +python3 - << 'EOF' + +from platformdirs import * +appname = "SuperApp" +appauthor = "Acme" + +assert user_data_dir(appname, appauthor) == '/root/.local/share/SuperApp' +assert user_cache_dir(appname, appauthor) == '/root/.cache/SuperApp' +assert user_log_dir(appname, appauthor) == '/root/.local/state/SuperApp/log' +assert user_config_dir(appname) == '/root/.config/SuperApp' +assert user_documents_dir() == '/root/Documents' +assert user_downloads_dir() == '/root/Downloads' +assert user_pictures_dir() == '/root/Pictures' +assert user_videos_dir() == '/root/Videos' +assert user_music_dir() == '/root/Music' +assert user_desktop_dir() == '/root/Desktop' +assert user_runtime_dir(appname, appauthor) == '/run/user/0/SuperApp' + +assert site_data_dir(appname, appauthor) == '/usr/local/share/SuperApp' +assert site_data_dir(appname, appauthor, multipath=True) == '/usr/local/share/SuperApp:/usr/share/SuperApp' + +assert site_config_dir(appname) == '/etc/xdg/SuperApp' + +import os +os.environ["XDG_CONFIG_DIRS"] = "/etc:/usr/local/etc" + +assert site_config_dir(appname, multipath=True) == '/etc/SuperApp:/usr/local/etc/SuperApp' + +EOF diff --git a/general/python/python-pluggy/Makefile b/general/python/python-pluggy/Makefile new file mode 100644 index 00000000..83ab84cf --- /dev/null +++ b/general/python/python-pluggy/Makefile @@ -0,0 +1,51 @@ +# +# Copyright (C) 2020 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-pluggy +PKG_VERSION:=1.3.0 +PKG_RELEASE:=1 + +PYPI_NAME:=pluggy +PKG_HASH:=cf61ae8f126ac6f7c451172cf30e3e43d3ca77615509771b3a984a0730651e12 + +PKG_MAINTAINER:=Jan Pavlinec , Jeffery To +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE + +PKG_BUILD_DEPENDS:=python-setuptools-scm/host +HOST_BUILD_DEPENDS:= \ + python3/host \ + python-build/host \ + python-installer/host \ + python-wheel/host \ + python-setuptools-scm/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-pluggy + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Plugin and hook calling mechanisms for Python + URL:=https://github.com/pytest-dev/pluggy + DEPENDS:=+python3-light +endef + +define Package/python3-pluggy/description + A minimalist production ready plugin system for python +endef + +$(eval $(call Py3Package,python3-pluggy)) +$(eval $(call BuildPackage,python3-pluggy)) +$(eval $(call BuildPackage,python3-pluggy-src)) +$(eval $(call HostBuild)) diff --git a/general/python/python-ply/Makefile b/general/python/python-ply/Makefile new file mode 100644 index 00000000..002bfa96 --- /dev/null +++ b/general/python/python-ply/Makefile @@ -0,0 +1,46 @@ +# +# Copyright (C) 2015-2016, 2018, 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-ply +PKG_VERSION:=3.11 +PKG_RELEASE:=2 + +PYPI_NAME:=ply +PKG_HASH:=00c7c1aaa88358b9c765b6d3000c6eec0ba42abca5351b095321aef446081da3 + +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=README.md +PKG_MAINTAINER:=Jeffery To + +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-ply + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=lex and yacc for Python + URL:=http://www.dabeaz.com/ply/ + DEPENDS:=+python3-light +endef + +define Package/python3-ply/description +PLY is a 100% Python implementation of the common parsing tools lex +and yacc. +endef + +$(eval $(call Py3Package,python3-ply)) +$(eval $(call BuildPackage,python3-ply)) +$(eval $(call BuildPackage,python3-ply-src)) +$(eval $(call HostBuild)) diff --git a/general/python/python-poetry-core/Makefile b/general/python/python-poetry-core/Makefile new file mode 100644 index 00000000..ab0d12aa --- /dev/null +++ b/general/python/python-poetry-core/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-poetry-core +PKG_VERSION:=1.8.1 +PKG_RELEASE:=1 + +PYPI_NAME:=poetry-core +PYPI_SOURCE_NAME:=poetry_core +PKG_HASH:=67a76c671da2a70e55047cddda83566035b701f7e463b32a2abfeac6e2a16376 + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Jeffery To + +PKG_HOST_ONLY:=1 +HOST_BUILD_DEPENDS:=python3/host python-build/host python-installer/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-poetry-core + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Poetry PEP 517 Build Backend + URL:=https://github.com/python-poetry/poetry-core + DEPENDS:=+python3 + BUILDONLY:=1 +endef + +define Package/python3-poetry-core/description +A PEP 517 build backend implementation developed for Poetry. This +project is intended to be a light weight, fully compliant, +self-contained package allowing PEP 517 compatible build frontends to +build Poetry managed projects. +endef + +$(eval $(call Py3Package,python3-poetry-core)) +$(eval $(call BuildPackage,python3-poetry-core)) +$(eval $(call BuildPackage,python3-poetry-core-src)) +$(eval $(call HostBuild)) diff --git a/general/python/python-psutil/Makefile b/general/python/python-psutil/Makefile new file mode 100644 index 00000000..b4ba535b --- /dev/null +++ b/general/python/python-psutil/Makefile @@ -0,0 +1,42 @@ +# +# Copyright (C) 2020-2021 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-psutil +PKG_VERSION:=5.9.5 +PKG_RELEASE:=1 + +PYPI_NAME:=psutil +PKG_HASH:=5410638e4df39c54d957fc51ce03048acd8e6d60abc0f5107af51e5fb566eb3c + +PKG_MAINTAINER:=Jan Pavlinec +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=LICENSE +PKG_CPE_ID:=cpe:/a:psutil_project:psutil + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-psutil + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Process and system monitoring + URL:=https://github.com/giampaolo/psutil + DEPENDS:=+python3-light +endef + +define Package/python3-psutil/description + psutil is a cross-platform library for retrieving information + on running processes and system utilization. +endef + +$(eval $(call Py3Package,python3-psutil)) +$(eval $(call BuildPackage,python3-psutil)) +$(eval $(call BuildPackage,python3-psutil-src)) diff --git a/general/python/python-psutil/patches/100-fix-non-Linux-compile.patch b/general/python/python-psutil/patches/100-fix-non-Linux-compile.patch new file mode 100644 index 00000000..eea19c82 --- /dev/null +++ b/general/python/python-psutil/patches/100-fix-non-Linux-compile.patch @@ -0,0 +1,29 @@ +--- a/setup.py ++++ b/setup.py +@@ -43,16 +43,16 @@ HERE = os.path.abspath(os.path.dirname(_ + # ...so we can import _common.py and _compat.py + sys.path.insert(0, os.path.join(HERE, "psutil")) + +-from _common import AIX # NOQA +-from _common import BSD # NOQA +-from _common import FREEBSD # NOQA +-from _common import LINUX # NOQA +-from _common import MACOS # NOQA +-from _common import NETBSD # NOQA +-from _common import OPENBSD # NOQA +-from _common import POSIX # NOQA +-from _common import SUNOS # NOQA +-from _common import WINDOWS # NOQA ++AIX = False ++BSD = False ++FREEBSD = False ++LINUX = True ++MACOS = False ++NETBSD = False ++OPENBSD = False ++POSIX = True ++SUNOS = False ++WINDOWS = False + from _common import hilite # NOQA + from _compat import PY3 # NOQA + from _compat import which # NOQA diff --git a/general/python/python-psycopg2/Makefile b/general/python/python-psycopg2/Makefile new file mode 100644 index 00000000..cd9ae976 --- /dev/null +++ b/general/python/python-psycopg2/Makefile @@ -0,0 +1,46 @@ +# +# Copyright (C) 2016 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-psycopg2 +PKG_VERSION:=2.9.7 +PKG_RELEASE:=1 + +PYPI_NAME:=psycopg2 +PKG_HASH:=f00cc35bd7119f1fed17b85bd1007855194dde2cbd8de01ab8ebb17487440ad8 + +PKG_MAINTAINER:=Daniel Danzberger +PKG_LICENSE:=LGPL-3.0-or-later +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-psycopg2 + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=PostgreSQL database adapter + URL:=https://www.psycopg.org/ + DEPENDS:= \ + +python3-light \ + +python3-decimal \ + +python3-logging \ + +python3-uuid \ + +libpq +endef + +define Package/python3-psycopg2/description +Psycopg is the most popular PostgreSQL adapter for the Python +programming language +endef + +$(eval $(call Py3Package,python3-psycopg2)) +$(eval $(call BuildPackage,python3-psycopg2)) +$(eval $(call BuildPackage,python3-psycopg2-src)) diff --git a/general/python/python-py/Makefile b/general/python/python-py/Makefile new file mode 100644 index 00000000..28880999 --- /dev/null +++ b/general/python/python-py/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2019-2021 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-py +PKG_VERSION:=1.11.0 +PKG_RELEASE:=1 + +PYPI_NAME:=py +PKG_HASH:=51c75c4126074b472f746a24399ad32f6053d1b34b68d2fa41e558e6f4a98719 + +PKG_MAINTAINER:=Jan Pavlinec +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE +PKG_CPE_ID:=cpe:/a:pytest:py + +PKG_BUILD_DEPENDS:=python-setuptools-scm/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-py + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Python development support library + URL:=https://github.com/pytest-dev/py + DEPENDS:=+python3-light +python3-xml +python3-urllib +python3-uuid +endef + +define Package/python3-py/description + Library with cross-python path, ini-parsing, io, code, log facilities +endef + +$(eval $(call Py3Package,python3-py)) +$(eval $(call BuildPackage,python3-py)) +$(eval $(call BuildPackage,python3-py-src)) diff --git a/general/python/python-pyasn1-modules/Makefile b/general/python/python-pyasn1-modules/Makefile new file mode 100644 index 00000000..18859162 --- /dev/null +++ b/general/python/python-pyasn1-modules/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2015-2018 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-pyasn1-modules +PKG_VERSION:=0.2.8 +PKG_RELEASE:=2 + +PYPI_NAME:=pyasn1-modules +PKG_HASH:=905f84c712230b2c592c19470d3ca8d552de726050d1d1716282a1f6146be65e + +PKG_LICENSE:=BSD-2-Clause +PKG_LICENSE_FILES:=LICENSE.txt +PKG_MAINTAINER:=Jeffery To + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-pyasn1-modules + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Collection of ASN.1 modules + URL:=https://github.com/etingof/pyasn1-modules + DEPENDS:= \ + +python3-light \ + +python3-pyasn1 +endef + +define Package/python3-pyasn1-modules/description +This is a small but growing collection of ASN.1 data structures +expressed in Python terms using pyasn1 data model. +endef + +$(eval $(call Py3Package,python3-pyasn1-modules)) +$(eval $(call BuildPackage,python3-pyasn1-modules)) +$(eval $(call BuildPackage,python3-pyasn1-modules-src)) diff --git a/general/python/python-pyasn1/Makefile b/general/python/python-pyasn1/Makefile new file mode 100644 index 00000000..b44ea2a4 --- /dev/null +++ b/general/python/python-pyasn1/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2015, 2018-2020, 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-pyasn1 +PKG_VERSION:=0.5.1 +PKG_RELEASE:=1 + +PYPI_NAME:=pyasn1 +PKG_HASH:=6d391a96e59b23130a5cfa74d6fd7f388dbbe26cc8f1edf39fdddf08d9d6676c + +PKG_LICENSE:=BSD-2-Clause +PKG_LICENSE_FILES:=LICENSE.rst +PKG_MAINTAINER:=Jeffery To + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-pyasn1 + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=ASN.1 types and DER/BER/CER codecs (X.208) + URL:=https://github.com/pyasn1/pyasn1 + DEPENDS:=+python3-light +python3-logging +endef + +define Package/python3-pyasn1/description +This is an implementation of ASN.1 types and codecs in Python programming +language. It has been first written to support particular protocol (SNMP) +but then generalized to be suitable for a wide range of protocols +based on ASN.1 specification. +endef + +$(eval $(call Py3Package,python3-pyasn1)) +$(eval $(call BuildPackage,python3-pyasn1)) +$(eval $(call BuildPackage,python3-pyasn1-src)) diff --git a/general/python/python-pyasn1/test.sh b/general/python/python-pyasn1/test.sh new file mode 100644 index 00000000..2f13e5fc --- /dev/null +++ b/general/python/python-pyasn1/test.sh @@ -0,0 +1,51 @@ +#!/bin/sh + +[ "$1" = python3-pyasn1 ] || exit 0 + +python3 - << 'EOF' + +from collections import OrderedDict + +from pyasn1.type import namedtype +from pyasn1.type import tag +from pyasn1.type import univ +from pyasn1.codec.der.encoder import encode as derEncode +from pyasn1.codec.der.decoder import decode as derDecode +from pyasn1.codec.native.encoder import encode as nativeEncode +from pyasn1.codec.native.decoder import decode as nativeDecode + +class Record(univ.Sequence): + componentType = namedtype.NamedTypes( + namedtype.NamedType('id', univ.Integer()), + namedtype.OptionalNamedType( + 'room', univ.Integer().subtype( + implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0) + ) + ), + namedtype.DefaultedNamedType( + 'house', univ.Integer(0).subtype( + implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1) + ) + ) + ) + +# encoding modifies the object (https://github.com/pyasn1/pyasn1/issues/53) +# so test decoding before encoding + +record = Record() +record['id'] = 123 +record['room'] = 321 +assert str(record) == 'Record:\n id=123\n room=321\n' + +substrate = b'0\x07\x02\x01{\x80\x02\x01A' + +received_record, _ = derDecode(substrate, asn1Spec=Record()) +assert received_record == record + +dict_record = nativeDecode({'id': 123, 'room': 321}, asn1Spec=Record()) +assert dict_record == record + +assert derEncode(record) == substrate +assert nativeEncode(record) == OrderedDict([('id', 123), ('room', 321), ('house', 0)]) + +EOF diff --git a/general/python/python-pycares/Makefile b/general/python/python-pycares/Makefile new file mode 100644 index 00000000..f16e2b1e --- /dev/null +++ b/general/python/python-pycares/Makefile @@ -0,0 +1,36 @@ + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-pycares +PKG_VERSION:=4.4.0 +PKG_RELEASE:=1 + +PYPI_NAME:=pycares +PKG_HASH:=f47579d508f2f56eddd16ce72045782ad3b1b3b678098699e2b6a1b30733e1c2 + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Fabian Lipken + +PKG_BUILD_DEPENDS:=libffi/host python-cffi/host # cffi>=1.5.0 + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-pycares + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Python interface for c-ares + URL:=https://github.com/saghul/pycares + DEPENDS:=+python3-light +python3-cffi +endef + +define Package/python3-pycares/description +Python interface for c-ares +endef + +$(eval $(call Py3Package,python3-pycares)) +$(eval $(call BuildPackage,python3-pycares)) +$(eval $(call BuildPackage,python3-pycares-src)) diff --git a/general/python/python-pycparser/Makefile b/general/python/python-pycparser/Makefile new file mode 100644 index 00000000..5085372d --- /dev/null +++ b/general/python/python-pycparser/Makefile @@ -0,0 +1,55 @@ +# +# Copyright (C) 2015-2018 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-pycparser +PKG_VERSION:=2.21 +PKG_RELEASE:=2 + +PYPI_NAME:=pycparser +PKG_HASH:=e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206 + +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Jeffery To + +PKG_BUILD_DEPENDS:=python-ply/host # ply==3.10 +HOST_BUILD_DEPENDS:= \ + python3/host \ + python-build/host \ + python-installer/host \ + python-wheel/host \ + python-ply/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-pycparser + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=C parser in Python + URL:=https://github.com/eliben/pycparser + DEPENDS:= \ + +python3-light \ + +python3-ply +endef + +define Package/python3-pycparser/description +pycparser is a parser for the C language, written in pure Python. It is a +module designed to be easily integrated into applications that need to parse +C source code. +endef + +$(eval $(call Py3Package,python3-pycparser)) +$(eval $(call BuildPackage,python3-pycparser)) +$(eval $(call BuildPackage,python3-pycparser-src)) +$(eval $(call HostBuild)) diff --git a/general/python/python-pycparser/patches/001-use-external-ply.patch b/general/python/python-pycparser/patches/001-use-external-ply.patch new file mode 100644 index 00000000..b6f2eac9 --- /dev/null +++ b/general/python/python-pycparser/patches/001-use-external-ply.patch @@ -0,0 +1,35 @@ +--- a/pycparser/c_lexer.py ++++ b/pycparser/c_lexer.py +@@ -8,8 +8,8 @@ + #------------------------------------------------------------------------------ + import re + +-from .ply import lex +-from .ply.lex import TOKEN ++from ply import lex ++from ply.lex import TOKEN + + + class CLexer(object): +--- a/pycparser/c_parser.py ++++ b/pycparser/c_parser.py +@@ -6,7 +6,7 @@ + # Eli Bendersky [https://eli.thegreenplace.net/] + # License: BSD + #------------------------------------------------------------------------------ +-from .ply import yacc ++from ply import yacc + + from . import c_ast + from .c_lexer import CLexer +--- a/setup.py ++++ b/setup.py +@@ -64,7 +64,7 @@ setup( + 'Programming Language :: Python :: 3.10', + ], + python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", +- packages=['pycparser', 'pycparser.ply'], ++ packages=['pycparser'], + package_data={'pycparser': ['*.cfg']}, + cmdclass={'install': install, 'sdist': sdist}, + ) diff --git a/general/python/python-pycrate/Makefile b/general/python/python-pycrate/Makefile new file mode 100644 index 00000000..5717cf74 --- /dev/null +++ b/general/python/python-pycrate/Makefile @@ -0,0 +1,37 @@ +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-pycrate +PKG_VERSION:=0.6.0 +PKG_RELEASE:=1 + +PYPI_NAME:=pycrate +PKG_HASH:=b49738c02a3f93ba9f76c0dac82b689a5341882814b36c714e9600e9f560daf7 + +PKG_LICENSE:=LGPL-2.1-or-later +PKG_LICENSE_FILES:=license.txt +PKG_MAINTAINER:=David Bauer + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-pycrate + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=A software suite to handle various data formats + URL:=https://github.com/P1sec/pycrate + DEPENDS:=+python3-light +endef + +define Package/python3-pycrate/description +Provides a runtime for encoding and decoding data structures, including CSN.1 +and ASN.1. Additionally, it features a 3G and LTE mobile core network. +endef + +$(eval $(call Py3Package,python3-pycrate)) +$(eval $(call BuildPackage,python3-pycrate)) +$(eval $(call BuildPackage,python3-pycrate-src)) diff --git a/general/python/python-pyfuse3/Makefile b/general/python/python-pyfuse3/Makefile new file mode 100644 index 00000000..c058bb64 --- /dev/null +++ b/general/python/python-pyfuse3/Makefile @@ -0,0 +1,48 @@ +# +# Copyright (C) 2022 Julien Malik +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-pyfuse3 +PKG_VERSION:=3.3.0 +PKG_RELEASE:=1 + +PYPI_NAME:=pyfuse3 +PKG_HASH:=2b31fe412479f9620da2067dd739ed23f4cc37364224891938dedf7766e573bd + +PKG_LICENSE:=LGPL-2.0-or-later +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Julien Malik + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-pyfuse3 + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=libfuse 3 bindings with async I/O support + URL:=https://github.com/libfuse/pyfuse3 + DEPENDS:= \ + +python3-light \ + +python3-asyncio \ + +python3-logging \ + +python3-trio \ + +libfuse3 +endef + +define Package/python3-pyfuse3/description + pyfuse3 is a set of Python 3 bindings for libfuse 3. + + It provides an asynchronous API compatible with Trio and asyncio, + and enables you to easily write a full-featured Linux filesystem in Python. +endef + +$(eval $(call Py3Package,python3-pyfuse3)) +$(eval $(call BuildPackage,python3-pyfuse3)) +$(eval $(call BuildPackage,python3-pyfuse3-src)) diff --git a/general/python/python-pynacl/Makefile b/general/python/python-pynacl/Makefile new file mode 100644 index 00000000..72d8debc --- /dev/null +++ b/general/python/python-pynacl/Makefile @@ -0,0 +1,37 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-pynacl +PKG_VERSION:=1.5.0 +PKG_RELEASE:=3 + +PYPI_NAME:=PyNaCl +PKG_HASH:=8ac7448f09ab85811607bdd21ec2464495ac8b7c66d146bf545b0f08fb9220ba + +PKG_MAINTAINER:=Javier Marcet +PKG_LICENSE:=Apache-2.0 +PKG_LICENSE_FILES:=LICENSE + +PKG_BUILD_DEPENDS:=libffi/host python-cffi/host # cffi>=1.4.1 + +PYTHON3_PKG_BUILD_VARS:=SODIUM_INSTALL=system + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-pynacl + CATEGORY:=Languages + SECTION:=lang + SUBMENU:=Python + TITLE:=Python binding to the libsodium library + URL:=https://github.com/pyca/pynacl/ + DEPENDS:=+libsodium +python3-light +python3-cffi +python3-six +endef + +define Package/python3-pynacl/description + PyNaCl is a Python binding to libsodium, which is a fork of the Networking and Cryptography library. +endef + +$(eval $(call Py3Package,python3-pynacl)) +$(eval $(call BuildPackage,python3-pynacl)) +$(eval $(call BuildPackage,python3-pynacl-src)) diff --git a/general/python/python-pynacl/patches/001-always-compile-ed25519.patch b/general/python/python-pynacl/patches/001-always-compile-ed25519.patch new file mode 100644 index 00000000..274f1ab0 --- /dev/null +++ b/general/python/python-pynacl/patches/001-always-compile-ed25519.patch @@ -0,0 +1,22 @@ +--- a/src/bindings/minimal/crypto_scalarmult.h ++++ b/src/bindings/minimal/crypto_scalarmult.h +@@ -13,7 +13,7 @@ + * limitations under the License. + */ + +-#ifdef SODIUM_LIBRARY_MINIMAL ++#if 0 + static const int PYNACL_HAS_CRYPTO_SCALARMULT_ED25519 = 0; + + size_t (*crypto_scalarmult_ed25519_bytes)() = NULL; +--- a/src/bindings/minimal/crypto_core.h ++++ b/src/bindings/minimal/crypto_core.h +@@ -13,7 +13,7 @@ + * limitations under the License. + */ + +-#ifdef SODIUM_LIBRARY_MINIMAL ++#if 0 + static const int PYNACL_HAS_CRYPTO_CORE_ED25519 = 0; + + size_t (*crypto_core_ed25519_bytes)() = NULL; diff --git a/general/python/python-pyodbc/Makefile b/general/python/python-pyodbc/Makefile new file mode 100644 index 00000000..6357d4bd --- /dev/null +++ b/general/python/python-pyodbc/Makefile @@ -0,0 +1,42 @@ +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-pyodbc +PKG_VERSION:=5.0.1 +PKG_RELEASE:=1 + +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 +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-pyodbc + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=DB API module for ODBC + URL:=https://github.com/mkleehammer/pyodbc + DEPENDS:=+python3-light +python3-decimal +python3-uuid +libodbc +libstdcpp +endef + +define Package/python3-pyodbc/description +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/general/python/python-pyodbc/test.sh b/general/python/python-pyodbc/test.sh new file mode 100644 index 00000000..f6cf04b1 --- /dev/null +++ b/general/python/python-pyodbc/test.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +[ "$1" = python3-pyodbc ] || exit 0 + +python3 -c 'import pyodbc' diff --git a/general/python/python-pyopenssl/Makefile b/general/python/python-pyopenssl/Makefile new file mode 100644 index 00000000..6aed546a --- /dev/null +++ b/general/python/python-pyopenssl/Makefile @@ -0,0 +1,44 @@ +# +# Copyright (C) 2015-2016, 2018-2021, 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-pyopenssl +PKG_VERSION:=23.3.0 +PKG_RELEASE:=1 + +PYPI_NAME:=pyOpenSSL +PKG_HASH:=6b2cba5cc46e822750ec3e5a81ee12819850b11303630d575e98108a079c2b12 + +PKG_LICENSE:=Apache-2.0 +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Jeffery To +PKG_CPE_ID:=cpe:/a:pyopenssl_project:pyopenssl + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-pyopenssl + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=OpenSSL wrapper + URL:=https://pyopenssl.org/ + DEPENDS:= \ + +python3-light \ + +python3-openssl \ + +python3-cryptography +endef + +define Package/python3-pyopenssl/description +Python wrapper module around the OpenSSL library +endef + +$(eval $(call Py3Package,python3-pyopenssl)) +$(eval $(call BuildPackage,python3-pyopenssl)) +$(eval $(call BuildPackage,python3-pyopenssl-src)) diff --git a/general/python/python-pyopenssl/test.sh b/general/python/python-pyopenssl/test.sh new file mode 100644 index 00000000..141dedd4 --- /dev/null +++ b/general/python/python-pyopenssl/test.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +[ "$1" = python3-pyopenssl ] || exit 0 + +python3 -m OpenSSL.debug diff --git a/general/python/python-pyotp/Makefile b/general/python/python-pyotp/Makefile new file mode 100644 index 00000000..468d7479 --- /dev/null +++ b/general/python/python-pyotp/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2019 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-pyotp +PKG_VERSION:=2.9.0 +PKG_RELEASE:=1 + +PYPI_NAME:=pyotp +PKG_HASH:=346b6642e0dbdde3b4ff5a930b664ca82abfa116356ed48cc42c7d6590d36f63 + +PKG_MAINTAINER:=Josef Schlehofer +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-pyotp + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=One-Time Password Library + URL:=https://github.com/pyauth/pyotp + DEPENDS:=+python3-light +python3-codecs +python3-urllib +endef + +define Package/python3-pyotp/description +PyOTP is a Python library for generating and verifying one-time +passwords. It can be used to implement two-factor (2FA) or multi-factor +(MFA) authentication methods in web applications and in other systems +that require users to log in. +endef + +$(eval $(call Py3Package,python3-pyotp)) +$(eval $(call BuildPackage,python3-pyotp)) +$(eval $(call BuildPackage,python3-pyotp-src)) diff --git a/general/python/python-pyparsing/Makefile b/general/python/python-pyparsing/Makefile new file mode 100644 index 00000000..68502935 --- /dev/null +++ b/general/python/python-pyparsing/Makefile @@ -0,0 +1,47 @@ +# +# Copyright (C) 2019-2020 CZ.NIC z.s.p.o. (http://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-pyparsing +PKG_VERSION:=3.1.1 +PKG_RELEASE:=1 + +PYPI_NAME:=pyparsing +PKG_HASH:=ede28a1a32462f5a9705e07aea48001a08f7cf81a021585011deba701581a0db + +PKG_MAINTAINER:=Jan Pavlinec +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE + +PKG_BUILD_DEPENDS:=python-flit-core/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-pyparsing + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Define and execute parsing grammars + URL:=https://github.com/pyparsing/pyparsing/ + DEPENDS:=+python3-light +endef + +define Package/python3-pyparsing/description + The pyparsing module is an alternative approach to creating + and executing simple grammars, vs. the traditional lex/yacc + approach, or the use of regular expressions. + The pyparsing module provides a library of classes that + client code uses to construct the grammar directly in Python code. +endef + +$(eval $(call Py3Package,python3-pyparsing)) +$(eval $(call BuildPackage,python3-pyparsing)) +$(eval $(call BuildPackage,python3-pyparsing-src)) diff --git a/general/python/python-pyproject-hooks/Makefile b/general/python/python-pyproject-hooks/Makefile new file mode 100644 index 00000000..316a8026 --- /dev/null +++ b/general/python/python-pyproject-hooks/Makefile @@ -0,0 +1,52 @@ +# +# 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-pyproject-hooks +PKG_VERSION:=1.0.0 +PKG_RELEASE:=2 + +PYPI_NAME:=pyproject_hooks +PKG_HASH:=f271b298b97f5955d53fb12b72c1fb1948c22c1a6b70b315c54cedaca0264ef5 + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Jeffery To + +PKG_HOST_ONLY:=1 +HOST_BUILD_DEPENDS:=python3/host python-flit-core/host python-installer/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-pyproject-hooks + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Wrappers to call pyproject.toml-based build backend hooks + URL:=https://github.com/pypa/pyproject-hooks + DEPENDS:=+python3-light + BUILDONLY:=1 +endef + +define Package/python3-pyproject-hooks/description +This is a low-level library for calling build-backends in +pyproject.toml-based project. It provides the basic functionality to +help write tooling that generates distribution files from Python +projects. +endef + +Host/Compile=$(Py3Host/Compile/Bootstrap) + +$(eval $(call Py3Package,python3-pyproject-hooks)) +$(eval $(call BuildPackage,python3-pyproject-hooks)) +$(eval $(call BuildPackage,python3-pyproject-hooks-src)) +$(eval $(call HostBuild)) diff --git a/general/python/python-pyroute2/Makefile b/general/python/python-pyroute2/Makefile new file mode 100644 index 00000000..45996ca1 --- /dev/null +++ b/general/python/python-pyroute2/Makefile @@ -0,0 +1,42 @@ +# +# Copyright (C) 2019-2021 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-pyroute2 +PKG_VERSION:=0.7.9 +PKG_RELEASE:=1 + +PYPI_NAME:=pyroute2 +PKG_HASH:=b69d82f140b0774317d7ba40f6c5fa1d755098ba3f3eb619982d16e750dc631a + +PKG_MAINTAINER:=Martin Matějek +PKG_LICENSE:=GPL-2.0-or-later Apache-2.0 +PKG_LICENSE_FILES:=LICENSE.GPL-2.0-or-later LICENSE.Apache-2.0 + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-pyroute2 + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Python netlink library + URL:=https://github.com/svinota/pyroute2 + DEPENDS:=+python3 +endef + +define Package/python3-pyroute2/description + Pyroute2 is a pure Python netlink library. + The library was started as an RTNL protocol implementation, + but now it supports many netlink protocols. +endef + +$(eval $(call Py3Package,python3-pyroute2)) +$(eval $(call BuildPackage,python3-pyroute2)) +$(eval $(call BuildPackage,python3-pyroute2-src)) diff --git a/general/python/python-pyrsistent/Makefile b/general/python/python-pyrsistent/Makefile new file mode 100644 index 00000000..5f8294e6 --- /dev/null +++ b/general/python/python-pyrsistent/Makefile @@ -0,0 +1,42 @@ +# +# Copyright (C) 2019 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-pyrsistent +PKG_VERSION:=0.19.3 +PKG_RELEASE:=1 + +PYPI_NAME:=pyrsistent +PKG_HASH:=1a2994773706bbb4995c31a97bc94f1418314923bd1048c6d964837040376440 + +PKG_MAINTAINER:=Josef Schlehofer +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE.mit + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-pyrsistent + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Persistent/Functional/Immutable data structures + URL:=https://github.com/tobgu/pyrsistent + DEPENDS:=+python3-light +endef + +define Package/python3-pyrsistent/description +Pyrsistent is a number of persistent collections (by some referred to as +functional data structures). Persistent in the sense that they are +immutable. +endef + +$(eval $(call Py3Package,python3-pyrsistent)) +$(eval $(call BuildPackage,python3-pyrsistent)) +$(eval $(call BuildPackage,python3-pyrsistent-src)) diff --git a/general/python/python-pyserial/Makefile b/general/python/python-pyserial/Makefile new file mode 100644 index 00000000..e6c6b401 --- /dev/null +++ b/general/python/python-pyserial/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-pyserial +PKG_VERSION:=3.5 +PKG_RELEASE:=1 + +PYPI_NAME:=pyserial +PKG_HASH:=3c77e014170dfffbd816e6ffc205e9842efb10be9f58ec16d3e8675b4925cddb + +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=LICENSE.txt +PKG_MAINTAINER:=Micke Prag + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-pyserial + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Serial Port Extension + URL:=https://github.com/pyserial/pyserial + DEPENDS:=+python3-light +python3-logging +python3-urllib +endef + +define Package/python3-pyserial/description +This module encapsulates the access for the serial port. It provides +backends for Python running on Windows, OSX, Linux, BSD (possibly any +POSIX compliant system) and IronPython. The module named "serial" +automatically selects the appropriate backend. +endef + +$(eval $(call Py3Package,python3-pyserial)) +$(eval $(call BuildPackage,python3-pyserial)) +$(eval $(call BuildPackage,python3-pyserial-src)) diff --git a/general/python/python-pysocks/Makefile b/general/python/python-pysocks/Makefile new file mode 100644 index 00000000..cf3e05bb --- /dev/null +++ b/general/python/python-pysocks/Makefile @@ -0,0 +1,45 @@ +# +# Copyright (C) 2021 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-pysocks +PKG_VERSION:=1.7.1 +PKG_RELEASE:=1 + +PYPI_NAME:=PySocks +PKG_HASH:=3f8804571ebe159c380ac6de37643bb4685970655d3bba243530d6558b799aa0 + +PKG_MAINTAINER:=Jan Pavlinec +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-pysocks + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Python SOCKS client module + URL:=https://github.com/Anorov/PySocks + DEPENDS:= \ + +python3-light \ + +python3-logging \ + +python3-openssl \ + +python3-urllib +endef + +define Package/python3-pysocks/description + PySocks lets you send traffic through SOCKS proxy servers. + It is a modern fork of SocksiPy with bug fixes and extra features. +endef + +$(eval $(call Py3Package,python3-pysocks)) +$(eval $(call BuildPackage,python3-pysocks)) +$(eval $(call BuildPackage,python3-pysocks-src)) diff --git a/general/python/python-pytest-forked/Makefile b/general/python/python-pytest-forked/Makefile new file mode 100644 index 00000000..2b464337 --- /dev/null +++ b/general/python/python-pytest-forked/Makefile @@ -0,0 +1,42 @@ +# +# Copyright (C) 2020 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-pytest-forked +PKG_VERSION:=1.6.0 +PKG_RELEASE:=1 + +PYPI_NAME:=pytest-forked +PKG_HASH:=4dafd46a9a600f65d822b8f605133ecf5b3e1941ebb3588e943b4e3eb71a5a3f + +PKG_MAINTAINER:=Jan Pavlinec +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE + +PKG_BUILD_DEPENDS:=python-setuptools-scm/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-pytest-forked + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Runs tests in isolated forked subprocesses + URL:=https://github.com/pytest-dev/pytest-forked + DEPENDS:= +python3-light +python3-pytest +python3-py +endef + +define Package/python3-pytest-forked/description + Pytest plugin which enables to run tests in isolated forked subprocesses +endef + +$(eval $(call Py3Package,python3-pytest-forked)) +$(eval $(call BuildPackage,python3-pytest-forked)) +$(eval $(call BuildPackage,python3-pytest-forked-src)) diff --git a/general/python/python-pytest-xdist/Makefile b/general/python/python-pytest-xdist/Makefile new file mode 100644 index 00000000..68d8a3db --- /dev/null +++ b/general/python/python-pytest-xdist/Makefile @@ -0,0 +1,48 @@ +# +# Copyright (C) 2020-2021 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-pytest-xdist +PKG_VERSION:=3.3.1 +PKG_RELEASE:=1 + +PYPI_NAME:=pytest-xdist +PKG_HASH:=d5ee0520eb1b7bcca50a60a518ab7a7707992812c578198f8b44fdfac78e8c93 + +PKG_MAINTAINER:=Jan Pavlinec +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE + +PKG_BUILD_DEPENDS:=python-setuptools-scm/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-pytest-xdist + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=pytest plugin for distributed testing + URL:=https://github.com/pytest-dev/pytest-xdist + DEPENDS:= \ + +python3-light \ + +python3-uuid \ + +python3-execnet \ + +python3-pytest +endef + +define Package/python3-pytest-xdist/description +The pytest-xdist plugin extends pytest with new test execution modes, +the most used being distributing tests across multiple CPUs to speed up +test execution. +endef + +$(eval $(call Py3Package,python3-pytest-xdist)) +$(eval $(call BuildPackage,python3-pytest-xdist)) +$(eval $(call BuildPackage,python3-pytest-xdist-src)) diff --git a/general/python/python-pytest/Makefile b/general/python/python-pytest/Makefile new file mode 100644 index 00000000..6643e14b --- /dev/null +++ b/general/python/python-pytest/Makefile @@ -0,0 +1,47 @@ +# +# Copyright (C) 2020-2021 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-pytest +PKG_VERSION:=7.4.0 +PKG_RELEASE:=1 + +PYPI_NAME:=pytest +PKG_HASH:=b4bf8c45bd59934ed84001ad51e11b4ee40d40a1229d2c79f9c592b0a3f6bd8a + +PKG_MAINTAINER:=Jan Pavlinec +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE + +PKG_BUILD_DEPENDS:=python-setuptools-scm/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-pytest + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Python testing framework + URL:=https://pytest.org/ + DEPENDS:= \ + +python3 \ + +python3-iniconfig \ + +python3-packaging \ + +python3-pluggy +endef + +define Package/python3-pytest/description +The pytest framework makes it easy to write small tests, yet scales to +support complex functional testing for applications and libraries. +endef + +$(eval $(call Py3Package,python3-pytest)) +$(eval $(call BuildPackage,python3-pytest)) +$(eval $(call BuildPackage,python3-pytest-src)) diff --git a/general/python/python-pytz/Makefile b/general/python/python-pytz/Makefile new file mode 100644 index 00000000..1b364962 --- /dev/null +++ b/general/python/python-pytz/Makefile @@ -0,0 +1,40 @@ +# +# Copyright (C) 2007-2019 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-pytz +PKG_VERSION:=2024.1 +PKG_RELEASE:=1 + +PYPI_NAME:=pytz +PKG_HASH:=2a29735ea9c18baf14b448846bde5a48030ed267578472d8955cd0e7443a9812 + +PKG_MAINTAINER:=Alexandru Ardelean +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE.txt + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-pytz + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=World timezone definitions, modern and historical + URL:=https://pythonhosted.org/pytz/ + DEPENDS:=+python3-light +endef + +define Package/python3-pytz/description + World timezone definitions, modern and historical +endef + +$(eval $(call Py3Package,python3-pytz)) +$(eval $(call BuildPackage,python3-pytz)) +$(eval $(call BuildPackage,python3-pytz-src)) diff --git a/general/python/python-referencing/Makefile b/general/python/python-referencing/Makefile new file mode 100644 index 00000000..7575ba77 --- /dev/null +++ b/general/python/python-referencing/Makefile @@ -0,0 +1,47 @@ +# +# 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-referencing +PKG_VERSION:=0.32.0 +PKG_RELEASE:=1 + +PYPI_NAME:=referencing +PKG_HASH:=689e64fe121843dcfd57b71933318ef1f91188ffb45367332700a86ac8fd6161 + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=COPYING +PKG_MAINTAINER:=Jeffery To + +PKG_BUILD_DEPENDS:=python-hatchling/host python-hatch-vcs/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-referencing + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=JSON Referencing + Python + URL:=https://github.com/python-jsonschema/referencing + DEPENDS:= \ + +python3-light \ + +python3-email \ + +python3-urllib \ + +python3-attrs \ + +python3-rpds-py +endef + +define Package/python3-referencing/description +An implementation-agnostic implementation of JSON reference resolution. +endef + +$(eval $(call Py3Package,python3-referencing)) +$(eval $(call BuildPackage,python3-referencing)) +$(eval $(call BuildPackage,python3-referencing-src)) diff --git a/general/python/python-referencing/test.sh b/general/python/python-referencing/test.sh new file mode 100644 index 00000000..0517ba16 --- /dev/null +++ b/general/python/python-referencing/test.sh @@ -0,0 +1,35 @@ +#!/bin/sh + +[ "$1" = python3-referencing ] || exit 0 + +python3 - << 'EOF' + +from referencing import Registry, Resource +import referencing.jsonschema + +schema = Resource.from_contents( # Parse some contents into a 2020-12 JSON Schema + { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "urn:example:a-202012-schema", + "$defs": { + "nonNegativeInteger": { + "$anchor": "nonNegativeInteger", + "type": "integer", + "minimum": 0, + }, + }, + } +) +registry = schema @ Registry() # Add the resource to a new registry + +# From here forward, this would usually be done within a library wrapping this one, +# like a JSON Schema implementation +resolver = registry.resolver() +resolved = resolver.lookup("urn:example:a-202012-schema#nonNegativeInteger") +assert resolved.contents == { + "$anchor": "nonNegativeInteger", + "type": "integer", + "minimum": 0, +} + +EOF diff --git a/general/python/python-requests/Makefile b/general/python/python-requests/Makefile new file mode 100644 index 00000000..cd961448 --- /dev/null +++ b/general/python/python-requests/Makefile @@ -0,0 +1,46 @@ +# +# Copyright (C) 2007-2019 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-requests +PKG_VERSION:=2.32.3 +PKG_RELEASE:=1 + +PKG_MAINTAINER:=Josef Schlehofer , Alexandru Ardelean +PKG_LICENSE:=Apache-2.0 +PKG_LICENSE_FILES:=LICENSE +PKG_CPE_ID:=cpe:/a:python:requests + +PYPI_NAME:=requests +PKG_HASH:=55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760 + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-requests + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=HTTP library for Python + URL:=https://requests.readthedocs.io + DEPENDS:= \ + +python3-light \ + +python3-chardet \ + +python3-idna \ + +python3-urllib3 \ + +python3-certifi +endef + +define Package/python3-requests/description + Requests is the only Non-GMO HTTP library for Python, safe for human consumption +endef + +$(eval $(call Py3Package,python3-requests)) +$(eval $(call BuildPackage,python3-requests)) +$(eval $(call BuildPackage,python3-requests-src)) diff --git a/general/python/python-rpds-py/Makefile b/general/python/python-rpds-py/Makefile new file mode 100644 index 00000000..c2aef845 --- /dev/null +++ b/general/python/python-rpds-py/Makefile @@ -0,0 +1,43 @@ +# +# 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-rpds-py +PKG_VERSION:=0.10.6 +PKG_RELEASE:=1 + +PYPI_NAME:=rpds-py +PYPI_SOURCE_NAME:=rpds_py +PKG_HASH:=4ce5a708d65a8dbf3748d2474b580d606b1b9f91b5c6ab2a316e0b0cf7a4ba50 + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Jeffery To + +PKG_BUILD_DEPENDS:=python-maturin/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-rpds-py + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Bindings to Rust's persistent data structures + URL:=https://github.com/crate-py/rpds + DEPENDS:=+python3-light $(RUST_ARCH_DEPENDS) +endef + +define Package/python3-rpds-py/description +Python bindings to the Rust rpds crate for persistent data structures. +endef + +$(eval $(call Py3Package,python3-rpds-py)) +$(eval $(call BuildPackage,python3-rpds-py)) +$(eval $(call BuildPackage,python3-rpds-py-src)) diff --git a/general/python/python-rpds-py/test.sh b/general/python/python-rpds-py/test.sh new file mode 100644 index 00000000..d5dec8f5 --- /dev/null +++ b/general/python/python-rpds-py/test.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +[ "$1" = python3-rpds-py ] || exit 0 + +python3 - << 'EOF' + +from rpds import HashTrieMap, HashTrieSet, List + +m = HashTrieMap({"foo": "bar", "baz": "quux"}) +assert m.insert("spam", 37) == HashTrieMap({"foo": "bar", "baz": "quux", "spam": 37}) +assert m.remove("foo") == HashTrieMap({"baz": "quux"}) + +s = HashTrieSet({"foo", "bar", "baz", "quux"}) +assert s.insert("spam") == HashTrieSet({"foo", "bar", "baz", "quux", "spam"}) +assert s.remove("foo") == HashTrieSet({"bar", "baz", "quux"}) + +L = List([1, 3, 5]) +assert L.push_front(-1) == List([-1, 1, 3, 5]) +assert L.rest == List([3, 5]) + +EOF diff --git a/general/python/python-rsa/Makefile b/general/python/python-rsa/Makefile new file mode 100644 index 00000000..92b40524 --- /dev/null +++ b/general/python/python-rsa/Makefile @@ -0,0 +1,39 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-rsa +PKG_VERSION:=4.9 +PKG_RELEASE:=1 + +PYPI_NAME:=rsa +PKG_HASH:=e38464a49c6c85d7f1351b0126661487a7e0a14a50f1675ec50eb34d4f20ef21 + +PKG_MAINTAINER:=Daniel Danzberger +PKG_LICENSE:=Apache-2.0 +PKG_LICENSE_FILES:=LICENSE +PKG_CPE_ID:=cpe:/a:python-rsa_project:python-rsa + +PKG_BUILD_DEPENDS:=python-poetry-core/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-rsa + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Pure-Python RSA implementation + URL:=https://stuvel.eu/rsa + DEPENDS:=+python3-light +python3-multiprocessing +python3-pydoc +python3-pyasn1 +endef + +define Package/python3-rsa/description +Python-RSA is a pure-Python RSA implementation. It supports encryption +and decryption, signing and verifying signatures, and key generation +according to PKCS#1 version 1.5. It can be used as a Python library as +well as on the commandline. +endef + +$(eval $(call Py3Package,python3-rsa)) +$(eval $(call BuildPackage,python3-rsa)) +$(eval $(call BuildPackage,python3-rsa-src)) diff --git a/general/python/python-ruamel-yaml/Makefile b/general/python/python-ruamel-yaml/Makefile new file mode 100644 index 00000000..048a23a2 --- /dev/null +++ b/general/python/python-ruamel-yaml/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2019 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-ruamel-yaml +PKG_VERSION:=0.17.32 +PKG_RELEASE:=1 + +PYPI_NAME:=ruamel.yaml +PKG_HASH:=ec939063761914e14542972a5cba6d33c23b0859ab6342f61cf070cfc600efc2 + +PKG_MAINTAINER:=Josef Schlehofer +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE +PKG_CPE_ID:=cpe:/a:ruamel.yaml_project:ruamel.yaml + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-ruamel-yaml + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=YAML 1.2 loader/dumper + URL:=https://sourceforge.net/p/ruamel-yaml/code/ci/default/tree + DEPENDS:= \ + +python3-light +endef + +define Package/python3-ruamel-yaml/description +ruamel-yaml is a YAML parser/emitter that supports roundtrip +preservation of comments, seq/map flow style, and map key order +endef + +$(eval $(call Py3Package,python3-ruamel-yaml)) +$(eval $(call BuildPackage,python3-ruamel-yaml)) +$(eval $(call BuildPackage,python3-ruamel-yaml-src)) diff --git a/general/python/python-s3transfer/Makefile b/general/python/python-s3transfer/Makefile new file mode 100644 index 00000000..39aa803e --- /dev/null +++ b/general/python/python-s3transfer/Makefile @@ -0,0 +1,37 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-s3transfer +PKG_VERSION:=0.6.1 +PKG_RELEASE:=1 + +PYPI_NAME:=s3transfer +PKG_HASH:=640bb492711f4c0c0905e1f62b6aaeb771881935ad27884852411f8e9cacbca9 + +PKG_MAINTAINER:=Daniel Danzberger +PKG_LICENSE:=Apache-2.0 +PKG_LICENSE_FILES:=LICENSE.txt + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-s3transfer + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Amazon S3 Transfer Manager + URL:=https://github.com/boto/s3transfer + DEPENDS:= \ + +python3-light \ + +python3-logging \ + +python3-multiprocessing \ + +python3-botocore +endef + +define Package/python3-s3transfer/description +S3transfer is a Python library for managing Amazon S3 transfers. +endef + +$(eval $(call Py3Package,python3-s3transfer)) +$(eval $(call BuildPackage,python3-s3transfer)) +$(eval $(call BuildPackage,python3-s3transfer-src)) diff --git a/general/python/python-schedule/Makefile b/general/python/python-schedule/Makefile new file mode 100644 index 00000000..134a2c57 --- /dev/null +++ b/general/python/python-schedule/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2019 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-schedule +PKG_VERSION:=1.2.0 +PKG_RELEASE:=1 + +PYPI_NAME:=schedule +PKG_HASH:=b4ad697aafba7184c9eb6a1e2ebc41f781547242acde8ceae9a0a25b04c0922d + +PKG_MAINTAINER:=Josef Schlehofer +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE.txt + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-schedule + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Job scheduling for humans + URL:=https://github.com/dbader/schedule + DEPENDS:=+python3-light +python3-logging +endef + +define Package/python3-schedule/description +An in-process scheduler for periodic jobs that uses the builder pattern +for configuration. The Schedule lets you run Python functions (or any +other callable) periodically at predetermined intervals using a simple, +human-friendly syntax. +endef + +$(eval $(call Py3Package,python3-schedule)) +$(eval $(call BuildPackage,python3-schedule)) +$(eval $(call BuildPackage,python3-schedule-src)) diff --git a/general/python/python-schema/Makefile b/general/python/python-schema/Makefile new file mode 100644 index 00000000..537a32fb --- /dev/null +++ b/general/python/python-schema/Makefile @@ -0,0 +1,40 @@ +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-schema +PKG_VERSION:=0.7.5 +PKG_RELEASE:=1 +PKG_MAINTAINER:=Josef Schlehofer   + +PYPI_NAME:=schema +PKG_HASH:=f06717112c61895cabc4707752b88716e8420a8819d71404501e114f91043197 + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE-MIT + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-schema + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + URL:=https://github.com/keleshev/schema + TITLE:=Simple data validation library + DEPENDS:=+python3-light +python3-contextlib2 +endef + +define Package/python3-schema/description +schema is a library for validating Python data structures, such as those +obtained from config-files, forms, external services or command-line +parsing, converted from JSON/YAML (or something else) to Python +data-types. +endef + +$(eval $(call Py3Package,python3-schema)) +$(eval $(call BuildPackage,python3-schema)) +$(eval $(call BuildPackage,python3-schema-src)) diff --git a/general/python/python-selinux/Makefile b/general/python/python-selinux/Makefile new file mode 100644 index 00000000..25ab8559 --- /dev/null +++ b/general/python/python-selinux/Makefile @@ -0,0 +1,74 @@ +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-selinux +PKG_VERSION:=3.6 +PKG_RELEASE:=1 + +SRC_NAME:=libselinux +PKG_SOURCE:=$(SRC_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/$(PKG_VERSION) +PKG_HASH:=ba4e0ef34b270e7672a5e5f1b523fe2beab3a40bb33d9389f4ad3a8728f21b52 +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(SRC_NAME)-$(PKG_VERSION) + +PKG_MAINTAINER:=Thomas Petazzoni +PKG_LICENSE:=libselinux-1.0 +PKG_LICENSE_FILES:=LICENSE +PKG_CPE_ID:=cpe:/a:selinuxproject:libselinux + +PKG_BUILD_DEPENDS:=swig/host +PKG_BUILD_PARALLEL:=1 +PYTHON3_PKG_BUILD:=0 + +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-selinux + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=SELinux runtime library bindings + DEPENDS:=+python3-light +libselinux + URL:=http://selinuxproject.org/page/Main_Page +endef + +define Package/python3-selinux/description + libselinux is the runtime SELinux library that provides + interfaces (e.g. library functions for the SELinux kernel + APIs like getcon(), other support functions like + getseuserbyname()) to SELinux-aware applications. libselinux + may use the shared libsepol to manipulate the binary policy + if necessary (e.g. to downgrade the policy format to an + older version supported by the kernel) when loading policy. + + This package provides the Python bindings for libselinux. +endef + +MAKE_VARS += \ + $(PYTHON3_VARS) \ + $(HOST_PYTHON3_PIP_VARS) \ + PYTHON_SETUP_ARGS=--no-compile + +MAKE_FLAGS += \ + SHLIBDIR=/usr/lib + +ifneq ($(CONFIG_USE_MUSL),) + MAKE_FLAGS += FTS_LDLIBS=-lfts + TARGET_CFLAGS += -D_LARGEFILE64_SOURCE +endif + +define Build/Compile + $(call Build/Compile/Default,pywrap) +endef + +define Build/Install + $(call Build/Install/Default,install-pywrap) +endef + +$(eval $(call Py3Package,python3-selinux)) +$(eval $(call BuildPackage,python3-selinux)) +$(eval $(call BuildPackage,python3-selinux-src)) diff --git a/general/python/python-semanage/Makefile b/general/python/python-semanage/Makefile new file mode 100644 index 00000000..33e148cf --- /dev/null +++ b/general/python/python-semanage/Makefile @@ -0,0 +1,64 @@ +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-semanage +PKG_VERSION:=3.5 +PKG_RELEASE:=1 + +SRC_NAME:=libsemanage +PKG_SOURCE:=$(SRC_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/$(PKG_VERSION) +PKG_HASH:=f53534e50247538280ed0d76c6ce81d8fb3939bd64cadb89da10dba42e40dd9c +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(SRC_NAME)-$(PKG_VERSION) + +PKG_MAINTAINER:=Thomas Petazzoni +PKG_LICENSE:=LGPL-2.1-or-later +PKG_LICENSE_FILES:=LICENSE +PKG_CPE_ID:=cpe:/a:selinuxproject:libsemanage + +PKG_BUILD_DEPENDS:=swig/host +PKG_BUILD_PARALLEL:=1 +PYTHON3_PKG_BUILD:=0 + +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-semanage + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=SELinux policy management library bindings + DEPENDS:=+python3-light +libsemanage + URL:=http://selinuxproject.org/page/Main_Page +endef + +define Package/python3-semanage/description + libsemanage is the policy management library. It uses + libsepol for binary policy manipulation and libselinux for + interacting with the SELinux system. It also exec's helper + programs for loading policy and for checking whether the + file_contexts configuration is valid (load_policy and + setfiles from policycoreutils) presently, although this may + change at least for the bootstrapping case (for rpm). + + This package provides the Python bindings for libsemanage. +endef + +MAKE_VARS += \ + $(PYTHON3_VARS) + +define Build/Compile + $(call Build/Compile/Default,pywrap) +endef + +define Build/Install + $(call Build/Install/Default,install-pywrap) +endef + +$(eval $(call Py3Package,python3-semanage)) +$(eval $(call BuildPackage,python3-semanage)) +$(eval $(call BuildPackage,python3-semanage-src)) diff --git a/general/python/python-semantic-version/Makefile b/general/python/python-semantic-version/Makefile new file mode 100644 index 00000000..9a78393f --- /dev/null +++ b/general/python/python-semantic-version/Makefile @@ -0,0 +1,49 @@ +# +# 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-semantic-version +PKG_VERSION:=2.10.0 +PKG_RELEASE:=1 + +PYPI_NAME:=semantic-version +PYPI_SOURCE_NAME:=semantic_version +PKG_HASH:=bdabb6d336998cbb378d4b9db3a4b56a1e3235701dc05ea2690d9a997ed5041c + +PKG_LICENSE:=BSD-2-Clause +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-semantic-version + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Library implementing the 'SemVer' scheme + URL:=https://github.com/rbarrois/python-semanticversion + DEPENDS:=+python3-light + BUILDONLY:=1 +endef + +define Package/python3-semantic-version/description +This small python library provides a few tools to handle SemVer in +Python. It follows strictly the 2.0.0 version of the SemVer scheme. +endef + +$(eval $(call Py3Package,python3-semantic-version)) +$(eval $(call BuildPackage,python3-semantic-version)) +$(eval $(call BuildPackage,python3-semantic-version-src)) +$(eval $(call HostBuild)) diff --git a/general/python/python-sentry-sdk/Makefile b/general/python/python-sentry-sdk/Makefile new file mode 100644 index 00000000..c65bda30 --- /dev/null +++ b/general/python/python-sentry-sdk/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2019 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-sentry-sdk +PKG_VERSION:=1.29.2 +PKG_RELEASE:=1 + +PYPI_NAME:=sentry-sdk +PKG_HASH:=a99ee105384788c3f228726a88baf515fe7b5f1d2d0f215a03d194369f158df7 + +PKG_MAINTAINER:=Josef Schlehofer +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-sentry-sdk + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Client for Sentry + URL:=https://github.com/getsentry/sentry-python + DEPENDS:= \ + +python3 \ + +python3-certifi \ + +python3-urllib3 +endef + +define Package/python3-sentry-sdk/description +This is the official Python SDK for Sentry. +endef + +$(eval $(call Py3Package,python3-sentry-sdk)) +$(eval $(call BuildPackage,python3-sentry-sdk)) +$(eval $(call BuildPackage,python3-sentry-sdk-src)) diff --git a/general/python/python-service-identity/Makefile b/general/python/python-service-identity/Makefile new file mode 100644 index 00000000..eb51e3a4 --- /dev/null +++ b/general/python/python-service-identity/Makefile @@ -0,0 +1,49 @@ +# +# Copyright (C) 2015, 2018-2020, 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-service-identity +PKG_VERSION:=23.1.0 +PKG_RELEASE:=1 + +PYPI_NAME:=service-identity +PYPI_SOURCE_NAME:=service_identity +PKG_HASH:=ecb33cd96307755041e978ab14f8b14e13b40f1fbd525a4dc78f46d2b986431d + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Jeffery To + +PKG_BUILD_DEPENDS:=python-hatchling/host python-hatch-vcs/host python-hatch-fancy-pypi-readme/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-service-identity + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Service identity verification + URL:=https://service-identity.readthedocs.io/ + DEPENDS:= \ + +python3-light \ + +python3-attrs \ + +python3-cryptography \ + +python3-pyasn1 \ + +python3-pyasn1-modules +endef + +define Package/python3-service-identity/description +service_identity aspires to give you all the tools you need for +verifying whether a certificate is valid for the intended purposes. +endef + +$(eval $(call Py3Package,python3-service-identity)) +$(eval $(call BuildPackage,python3-service-identity)) +$(eval $(call BuildPackage,python3-service-identity-src)) diff --git a/general/python/python-setuptools-rust/Makefile b/general/python/python-setuptools-rust/Makefile new file mode 100644 index 00000000..7fe77ff7 --- /dev/null +++ b/general/python/python-setuptools-rust/Makefile @@ -0,0 +1,60 @@ +# +# 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-setuptools-rust +PKG_VERSION:=1.8.1 +PKG_RELEASE:=1 + +PYPI_NAME:=setuptools-rust +PKG_HASH:=94b1dd5d5308b3138d5b933c3a2b55e6d6927d1a22632e509fcea9ddd0f7e486 + +PKG_LICENSE:=MIT +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 \ + python-setuptools-scm/host \ + python-semantic-version/host \ + rust/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-setuptools-rust + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Setuptools Rust extension plugin + URL:=https://github.com/PyO3/setuptools-rust + DEPENDS:= \ + +python3-light \ + +python3-logging \ + +python3-semantic-version \ + +python3-setuptools \ + +rust + BUILDONLY:=1 +endef + +define Package/python3-setuptools-rust/description +setuptools-rust is a plugin for setuptools to build Rust Python +extensions implemented with PyO3 or rust-cpython. +endef + +$(eval $(call Py3Package,python3-setuptools-rust)) +$(eval $(call BuildPackage,python3-setuptools-rust)) +$(eval $(call BuildPackage,python3-setuptools-rust-src)) +$(eval $(call HostBuild)) diff --git a/general/python/python-setuptools-scm/Makefile b/general/python/python-setuptools-scm/Makefile new file mode 100644 index 00000000..5e197a57 --- /dev/null +++ b/general/python/python-setuptools-scm/Makefile @@ -0,0 +1,66 @@ +# +# 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-setuptools-scm +PKG_VERSION:=7.1.0 +PKG_RELEASE:=2 + +PYPI_NAME:=setuptools-scm +PYPI_SOURCE_NAME:=setuptools_scm +PKG_HASH:=6c508345a771aad7d56ebff0e70628bf2b0ec7573762be9960214730de278f27 + +PKG_LICENSE:=MIT +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 \ + python-packaging/host \ + python-typing-extensions/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-setuptools-scm + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=the blessed package to manage your versions by scm tags + URL:=https://github.com/pypa/setuptools_scm + DEPENDS:= \ + +python3-light \ + +python3-logging \ + +python3-packaging \ + +python3-setuptools \ + +python3-typing-extensions + BUILDONLY:=1 +endef + +define Package/python3-setuptools-scm/description +setuptools_scm extracts Python package versions from git or hg metadata +instead of declaring them as the version argument or in a SCM managed +file. + +Additionally setuptools_scm provides setuptools with a list of files +that are managed by the SCM (i.e. it automatically adds all of the +SCM-managed files to the sdist). Unwanted files must be excluded by +discarding them via MANIFEST.in. +endef + +$(eval $(call Py3Package,python3-setuptools-scm)) +$(eval $(call BuildPackage,python3-setuptools-scm)) +$(eval $(call BuildPackage,python3-setuptools-scm-src)) +$(eval $(call HostBuild)) diff --git a/general/python/python-setuptools/Makefile b/general/python/python-setuptools/Makefile new file mode 100644 index 00000000..b2ebfa1c --- /dev/null +++ b/general/python/python-setuptools/Makefile @@ -0,0 +1,82 @@ +# +# 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-setuptools +PKG_VERSION:=69.0.2 +PKG_RELEASE:=1 + +PYPI_NAME:=setuptools +PKG_HASH:=735896e78a4742605974de002ac60562d286fa8051a7e2299445e8e8fbb01aa6 + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Jeffery To +CPE_ID:=cpe:/a:python:setuptools + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-setuptools/Default + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + URL:=https://github.com/pypa/setuptools +endef + +define Package/python3-pkg-resources +$(call Package/python3-setuptools/Default) + TITLE:=Package resource API + DEPENDS:=+python3-light +python3-email +python3-logging +python3-urllib +endef + +define Package/python3-setuptools +$(call Package/python3-setuptools/Default) + TITLE:=Fully-featured library to package Python projects + DEPENDS:=+python3 +python3-pkg-resources +endef + +define Package/python3-setuptools/description/Default +Setuptools is a fully-featured, actively-maintained, and stable library +designed to facilitate packaging Python projects. + +It helps developers to easily share reusable code (in the form of a +library) and programs (e.g., CLI/GUI tools implemented in Python), that +can be installed with pip and uploaded to PyPI. +endef + +define Package/python3-pkg-resources/description +$(call Package/python3-setuptools/description/Default) + +This is the pkg_resources module of setuptools. +endef + +define Package/python3-setuptools/description +$(call Package/python3-setuptools/description/Default) + +This is the main setuptools module. +endef + +define Py3Package/python3-pkg-resources/filespec ++|$(PYTHON3_PKG_DIR)/pkg_resources +endef + +define Py3Package/python3-setuptools/filespec ++|$(PYTHON3_PKG_DIR) +-|$(PYTHON3_PKG_DIR)/pkg_resources +endef + +$(eval $(call Py3Package,python3-pkg-resources)) +$(eval $(call Py3Package,python3-setuptools)) + +$(eval $(call BuildPackage,python3-pkg-resources)) +$(eval $(call BuildPackage,python3-setuptools)) + +$(eval $(call BuildPackage,python3-pkg-resources-src)) +$(eval $(call BuildPackage,python3-setuptools-src)) diff --git a/general/python/python-setuptools/test.sh b/general/python/python-setuptools/test.sh new file mode 100644 index 00000000..bc35600c --- /dev/null +++ b/general/python/python-setuptools/test.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +[ "$1" = python3-setuptools ] || exit 0 + +python3 -c 'from setuptools import setup' diff --git a/general/python/python-six/Makefile b/general/python/python-six/Makefile new file mode 100644 index 00000000..6712baa3 --- /dev/null +++ b/general/python/python-six/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2015, 2017-2018 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-six +PKG_VERSION:=1.16.0 +PKG_RELEASE:=1 + +PYPI_NAME:=six +PKG_HASH:=1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926 + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Jeffery To + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-six + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Python 2 and 3 compatibility library + URL:=https://github.com/benjaminp/six + DEPENDS:=+python3-light +endef + +define Package/python3-six/description +Six is a Python 2 and 3 compatibility library. It provides utility functions +for smoothing over the differences between the Python versions with the goal of +writing Python code that is compatible on both Python versions. See the +documentation for more information on what is provided. +endef + +$(eval $(call Py3Package,python3-six)) +$(eval $(call BuildPackage,python3-six)) +$(eval $(call BuildPackage,python3-six-src)) diff --git a/general/python/python-slugify/Makefile b/general/python/python-slugify/Makefile new file mode 100644 index 00000000..2c7b82e7 --- /dev/null +++ b/general/python/python-slugify/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2019-2020 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-slugify +PKG_VERSION:=8.0.1 +PKG_RELEASE:=1 + +PYPI_NAME:=$(PKG_NAME) +PKG_HASH:=ce0d46ddb668b3be82f4ed5e503dbc33dd815d83e2eb6824211310d3fb172a27 + +PKG_MAINTAINER:=Josef Schlehofer +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-slugify + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Slugify application that handles Unicode + URL:=https://github.com/un33k/python-slugify + DEPENDS:= \ + +python3-light \ + +python3-codecs \ + +python3-text-unidecode +endef + +define Package/python3-slugify/description + A Python slugify application that handles unicode. +endef + +$(eval $(call Py3Package,python3-slugify)) +$(eval $(call BuildPackage,python3-slugify)) +$(eval $(call BuildPackage,python3-slugify-src)) diff --git a/general/python/python-sniffio/Makefile b/general/python/python-sniffio/Makefile new file mode 100644 index 00000000..eef65ad6 --- /dev/null +++ b/general/python/python-sniffio/Makefile @@ -0,0 +1,40 @@ +# +# Copyright (C) 2022 Julien Malik +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-sniffio +PKG_VERSION:=1.3.0 +PKG_RELEASE:=1 + +PYPI_NAME:=sniffio +PKG_HASH:=e60305c5e5d314f5389259b7f22aaa33d8f7dee49763119234af3755c55b9101 + +PKG_LICENSE:=Apache-2.0|MIT +PKG_LICENSE_FILES:=LICENSE.APACHE2|LICENSE.MIT +PKG_MAINTAINER:=Julien Malik + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-sniffio + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Sniff out which async library your code is running under + URL:=https://sniffio.readthedocs.io + DEPENDS:=+python3-light +endef + +define Package/python3-sniffio/description + This is a tiny package whose only purpose is to let you detect which async library your code is running under. +endef + +$(eval $(call Py3Package,python3-sniffio)) +$(eval $(call BuildPackage,python3-sniffio)) +$(eval $(call BuildPackage,python3-sniffio-src)) diff --git a/general/python/python-socketio/Makefile b/general/python/python-socketio/Makefile new file mode 100644 index 00000000..61a1128c --- /dev/null +++ b/general/python/python-socketio/Makefile @@ -0,0 +1,46 @@ +# +# Copyright (C) 2021 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-socketio +PKG_VERSION:=5.8.0 +PKG_RELEASE:=1 + +PYPI_NAME:=python-socketio +PKG_HASH:=e714f4dddfaaa0cb0e37a1e2deef2bb60590a5b9fea9c343dd8ca5e688416fd9 + +PKG_MAINTAINER:=Jan Pavlinec +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-socketio + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Socket.IO server and client + URL:=https://github.com/miguelgrinberg/python-socketio + DEPENDS:= \ + +python3-light \ + +python3-bidict \ + +python3-engineio \ + +python3-asyncio \ + +python3-logging \ + +python3-uuid +endef + +define Package/python3-socketio/description + Python implementation of the Socket.IO realtime client and server. +endef + +$(eval $(call Py3Package,python3-socketio)) +$(eval $(call BuildPackage,python3-socketio)) +$(eval $(call BuildPackage,python3-socketio-src)) diff --git a/general/python/python-sortedcontainers/Makefile b/general/python/python-sortedcontainers/Makefile new file mode 100644 index 00000000..b049eb98 --- /dev/null +++ b/general/python/python-sortedcontainers/Makefile @@ -0,0 +1,40 @@ +# +# Copyright (C) 2022 Julien Malik +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-sortedcontainers +PKG_VERSION:=2.4.0 +PKG_RELEASE:=1 + +PYPI_NAME:=sortedcontainers +PKG_HASH:=25caa5a06cc30b6b83d11423433f65d1f9d76c4c6a0c90e3379eaa43b9bfdb88 + +PKG_LICENSE:=Apache-2.0 +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Julien Malik + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-sortedcontainers + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Sorted Containers -- Sorted List, Sorted Dict, Sorted Set + URL:=https://grantjenks.com/docs/sortedcontainers + DEPENDS:=+python3-light +endef + +define Package/python3-sortedcontainers/description + Sorted Containers is an Apache2 licensed sorted collections library, written in pure-Python, and fast as C-extensions. +endef + +$(eval $(call Py3Package,python3-sortedcontainers)) +$(eval $(call BuildPackage,python3-sortedcontainers)) +$(eval $(call BuildPackage,python3-sortedcontainers-src)) diff --git a/general/python/python-sqlalchemy/Makefile b/general/python/python-sqlalchemy/Makefile new file mode 100644 index 00000000..c69c37f2 --- /dev/null +++ b/general/python/python-sqlalchemy/Makefile @@ -0,0 +1,47 @@ +# +# Copyright (C) 2019-2021 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-sqlalchemy +PKG_VERSION:=2.0.23 +PKG_RELEASE:=1 + +PYPI_NAME:=SQLAlchemy +PKG_HASH:=c1bda93cbbe4aa2aa0aa8655c5aeda505cd219ff3e8da91d1d329e143e4aff69 + +PKG_MAINTAINER:=Josef Schlehofer +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE +PKG_CPE_ID:=cpe:/a:sqlalchemy:sqlalchemy + +PKG_BUILD_DEPENDS:=python-cython/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-sqlalchemy + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Database Abstraction Library + URL:=https://www.sqlalchemy.org + DEPENDS:=+python3 +python3-typing-extensions +endef + +define Package/python3-sqlalchemy/description +SQLAlchemy is the Python SQL toolkit and Object Relational Mapper that +gives application developers the full power and flexibility of SQL. +SQLAlchemy provides a full suite of well known enterprise-level +persistence patterns, designed for efficient and high-performing +database access, adapted into a simple and Pythonic domain language. +endef + +$(eval $(call Py3Package,python3-sqlalchemy)) +$(eval $(call BuildPackage,python3-sqlalchemy)) +$(eval $(call BuildPackage,python3-sqlalchemy-src)) diff --git a/general/python/python-sqlparse/Makefile b/general/python/python-sqlparse/Makefile new file mode 100644 index 00000000..d7f37b88 --- /dev/null +++ b/general/python/python-sqlparse/Makefile @@ -0,0 +1,37 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=sqlparse +PKG_VERSION:=0.4.4 +PKG_RELEASE:=1 + +PYPI_NAME:=sqlparse +PKG_HASH:=d446183e84b8349fa3061f0fe7f06ca94ba65b426946ffebe6e3e8295332420c + +PKG_MAINTAINER:=Peter Stadler +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=LICENSE +PKG_CPE_ID:=cpe:/a:sqlparse_project:sqlparse + +PKG_BUILD_DEPENDS:=python-flit-core/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-sqlparse + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Non-validating SQL parser + URL:=https://github.com/andialbrecht/sqlparse + DEPENDS:=+python3-light +endef + +define Package/python3-sqlparse/description +sqlparse is a non-validating SQL parser for Python. It provides support +for parsing, splitting and formatting SQL statements. +endef + +$(eval $(call Py3Package,python3-sqlparse)) +$(eval $(call BuildPackage,python3-sqlparse)) +$(eval $(call BuildPackage,python3-sqlparse-src)) diff --git a/general/python/python-stem/Makefile b/general/python/python-stem/Makefile new file mode 100644 index 00000000..a8701fd0 --- /dev/null +++ b/general/python/python-stem/Makefile @@ -0,0 +1,34 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-stem +PKG_VERSION:=1.8.2 +PKG_RELEASE:=1 + +PYPI_NAME:=stem +PKG_HASH:=83fb19ffd4c9f82207c006051480389f80af221a7e4783000aedec4e384eb582 + +PKG_MAINTAINER:=Javier Marcet +PKG_LICENSE:=LGPL-3.0-only +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-stem + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=A controller library for Tor + URL:=https://stem.torproject.org/ + DEPENDS:=+python3 +endef + +define Package/python3-stem/description + Stem is a Python controller library for Tor. With it you can use Tor's control + protocol to script against the Tor process, or build things such as Nyx. +endef + +$(eval $(call Py3Package,python3-stem)) +$(eval $(call BuildPackage,python3-stem)) +$(eval $(call BuildPackage,python3-stem-src)) diff --git a/general/python/python-texttable/Makefile b/general/python/python-texttable/Makefile new file mode 100644 index 00000000..20fec724 --- /dev/null +++ b/general/python/python-texttable/Makefile @@ -0,0 +1,33 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-texttable +PKG_VERSION:=1.7.0 +PKG_RELEASE:=1 + +PYPI_NAME:=texttable +PKG_HASH:=2d2068fb55115807d3ac77a4ca68fa48803e84ebb0ee2340f858107a36522638 + +PKG_MAINTAINER:=Javier Marcet +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-texttable + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Module for creating simple ASCII tables + URL:=https://github.com/foutaise/texttable/ + DEPENDS:=+python3-light +python3-codecs +endef + +define Package/python3-texttable/description + Module for creating simple ASCII tables +endef + +$(eval $(call Py3Package,python3-texttable)) +$(eval $(call BuildPackage,python3-texttable)) +$(eval $(call BuildPackage,python3-texttable-src)) diff --git a/general/python/python-toml/Makefile b/general/python/python-toml/Makefile new file mode 100644 index 00000000..262ac066 --- /dev/null +++ b/general/python/python-toml/Makefile @@ -0,0 +1,40 @@ +# +# Copyright (C) 2020 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-toml +PKG_VERSION:=0.10.2 +PKG_RELEASE:=1 + +PYPI_NAME:=toml +PKG_HASH:=b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f + +PKG_MAINTAINER:=Jan Pavlinec +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-toml + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=A Python library for parsing and creating TOML + URL:=https://github.com/uiri/toml + DEPENDS:= +python3-light +python3-decimal +endef + +define Package/python3-toml/description + Python Library for Tom's Obvious, Minimal Language +endef + +$(eval $(call Py3Package,python3-toml)) +$(eval $(call BuildPackage,python3-toml)) +$(eval $(call BuildPackage,python3-toml-src)) diff --git a/general/python/python-tornado/Makefile b/general/python/python-tornado/Makefile new file mode 100644 index 00000000..c8599c18 --- /dev/null +++ b/general/python/python-tornado/Makefile @@ -0,0 +1,45 @@ +# +# Copyright (C) 2020 CZ.NIC z.s.p.o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-tornado +PKG_VERSION:=6.3.3 +PKG_RELEASE:=1 + +PYPI_NAME:=tornado +PKG_HASH:=e7d8db41c0181c80d76c982aacc442c0783a2c54d6400fe028954201a2e032fe + +PKG_MAINTAINER:=Josef Schlehofer +PKG_LICENSE:=Apache-2.0 +PKG_LICENSE_FILES:=LICENSE +PKG_CPE_ID:=cpe:/a:tornadoweb:tornado + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-tornado + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Web framework and asynchronous networking library + URL:=https://www.tornadoweb.org + DEPENDS:=+python3 +endef + +define Package/python3-tornado/description + Tornado is a Python web framework and asynchronous networking library, + originally developed at FriendFeed. By using non-blocking network I/O, + Tornado can scale to tens of thousands of open connections, making it + ideal for long polling, WebSockets, and other applications that require + a long-lived connection to each user. +endef + +$(eval $(call Py3Package,python3-tornado)) +$(eval $(call BuildPackage,python3-tornado)) +$(eval $(call BuildPackage,python3-tornado-src)) diff --git a/general/python/python-trio/Makefile b/general/python/python-trio/Makefile new file mode 100644 index 00000000..d90f1b8f --- /dev/null +++ b/general/python/python-trio/Makefile @@ -0,0 +1,47 @@ +# +# Copyright (C) 2022 Julien Malik +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-trio +PKG_VERSION:=0.22.2 +PKG_RELEASE:=1 + +PYPI_NAME:=trio +PKG_HASH:=3887cf18c8bcc894433420305468388dac76932e9668afa1c49aa3806b6accb3 + +PKG_LICENSE:=Apache-2.0 MIT +PKG_LICENSE_FILES:=LICENSE.APACHE2 LICENSE.MIT +PKG_MAINTAINER:=Julien Malik + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-trio + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Friendly library for async concurrency and I/O + URL:=https://github.com/python-trio/trio + DEPENDS:= \ + +python3-light \ + +python3-attrs \ + +python3-idna \ + +python3-outcome \ + +python3-sniffio \ + +python3-sortedcontainers +endef + +define Package/python3-trio/description +The Trio project’s goal is to produce a production-quality, permissively +licensed, async/await-native I/O library for Python. +endef + +$(eval $(call Py3Package,python3-trio)) +$(eval $(call BuildPackage,python3-trio)) +$(eval $(call BuildPackage,python3-trio-src)) diff --git a/general/python/python-trove-classifiers/Makefile b/general/python/python-trove-classifiers/Makefile new file mode 100644 index 00000000..fd802604 --- /dev/null +++ b/general/python/python-trove-classifiers/Makefile @@ -0,0 +1,56 @@ +# +# 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-trove-classifiers +PKG_VERSION:=2023.11.29 +PKG_RELEASE:=1 + +PYPI_NAME:=trove-classifiers +PKG_HASH:=ff8f7fd82c7932113b46e7ef6742c70091cc63640c8c65db00d91f2e940b9514 + +PKG_LICENSE:=Apache-2.0 +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Jeffery To + +PKG_HOST_ONLY:=1 +PKG_BUILD_DEPENDS:=python-calver/host +HOST_BUILD_DEPENDS:= \ + python3/host \ + python-build/host \ + python-installer/host \ + python-wheel/host \ + python-calver/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-trove-classifiers + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Canonical source for classifiers on PyPI (pypi.org). + URL:=https://github.com/pypa/trove-classifiers + DEPENDS:=+python3-light + BUILDONLY:=1 +endef + +define Package/python3-trove-classifiers/description +Canonical source for classifiers on PyPI. + +Classifiers categorize projects per PEP 301. Use this package to +validate classifiers in packages for PyPI upload or download. +endef + +$(eval $(call Py3Package,python3-trove-classifiers)) +$(eval $(call BuildPackage,python3-trove-classifiers)) +$(eval $(call BuildPackage,python3-trove-classifiers-src)) +$(eval $(call HostBuild)) diff --git a/general/python/python-twisted/Makefile b/general/python/python-twisted/Makefile new file mode 100644 index 00000000..79f2f2a2 --- /dev/null +++ b/general/python/python-twisted/Makefile @@ -0,0 +1,77 @@ +# +# Copyright (C) 2006-2011 OpenWrt.org +# Copyright (C) 2015-2016, 2018-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-twisted +PKG_VERSION:=23.10.0 +PKG_RELEASE:=1 + +PYPI_NAME:=Twisted +PYPI_SOURCE_NAME:=twisted +PKG_HASH:=987847a0790a2c597197613686e2784fd54167df3a55d0fb17c8412305d76ce5 + +PKG_BUILD_DEPENDS:=libtirpc + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Jeffery To +PKG_CPE_ID:=cpe:/a:twistedmatrix:twisted + +PKG_BUILD_DEPENDS:=python-hatchling/host python-hatch-fancy-pypi-readme/host python-incremental/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-twisted + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Asynchronous networking framework + URL:=https://twistedmatrix.com/ + DEPENDS:= \ + +python3 \ + +python3-appdirs \ + +python3-attrs \ + +python3-automat \ + +python3-bcrypt \ + +python3-constantly \ + +python3-cryptography \ + +python3-hyperlink \ + +python3-idna \ + +python3-incremental \ + +python3-pyopenssl \ + +python3-service-identity \ + +python3-typing-extensions \ + +python3-zope-interface +endef + +define Package/python3-twisted/description +Twisted is a networking engine written in Python, supporting numerous +protocols. It contains a web server, numerous chat clients, chat +servers, mail servers, and more. +endef + +define Py3Package/python3-twisted/filespec ++|$(PYTHON3_PKG_DIR) +-|$(PYTHON3_PKG_DIR)/twisted/conch/scripts/tkconch.py +endef + +define Py3Package/python3-twisted/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/ + for bin in $(1)/usr/bin/*; do \ + mv $$$$bin $$$${bin}3 ; \ + $(LN) $$$${bin##*/}3 $$$$bin ; \ + done +endef + +$(eval $(call Py3Package,python3-twisted)) +$(eval $(call BuildPackage,python3-twisted)) +$(eval $(call BuildPackage,python3-twisted-src)) diff --git a/general/python/python-twisted/patches/001-omit-tkconch.patch b/general/python/python-twisted/patches/001-omit-tkconch.patch new file mode 100644 index 00000000..d9ad0d59 --- /dev/null +++ b/general/python/python-twisted/patches/001-omit-tkconch.patch @@ -0,0 +1,18 @@ +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -138,7 +138,6 @@ ckeygen = "twisted.conch.scripts.ckeygen + conch = "twisted.conch.scripts.conch:run" + mailmail = "twisted.mail.scripts.mailmail:run" + pyhtmlizer = "twisted.scripts.htmlizer:run" +-tkconch = "twisted.conch.scripts.tkconch:run" + trial = "twisted.scripts.trial:run" + twist = "twisted.application.twist._twist:Twist.main" + twistd = "twisted.scripts.twistd:run" +--- a/src/twisted/python/twisted-completion.zsh ++++ b/src/twisted/python/twisted-completion.zsh +@@ -1,4 +1,4 @@ +-#compdef twist twistd trial conch cftp ckeygen pyhtmlizer tkconch ++#compdef twist twistd trial conch cftp ckeygen pyhtmlizer + # + # This is the ZSH completion file for Twisted commands. It calls the current + # command-line with the special "--_shell-completion" option which is handled diff --git a/general/python/python-twisted/patches/002-omit-tests.patch b/general/python/python-twisted/patches/002-omit-tests.patch new file mode 100644 index 00000000..ddf8f9e3 --- /dev/null +++ b/general/python/python-twisted/patches/002-omit-tests.patch @@ -0,0 +1,10 @@ +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -182,6 +182,7 @@ exclude = [ + "*.pxi", + "*.pyx", + "build.bat", ++ "test", + ] + + [tool.hatch.build.targets.sdist] diff --git a/general/python/python-twisted/test.sh b/general/python/python-twisted/test.sh new file mode 100644 index 00000000..3b931079 --- /dev/null +++ b/general/python/python-twisted/test.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +[ "$1" = python3-twisted ] || exit 0 + +python3 -c 'from twisted.internet import reactor' diff --git a/general/python/python-typing-extensions/Makefile b/general/python/python-typing-extensions/Makefile new file mode 100644 index 00000000..501eec31 --- /dev/null +++ b/general/python/python-typing-extensions/Makefile @@ -0,0 +1,54 @@ +# +# Copyright (C) 2021 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-typing-extensions +PKG_VERSION:=4.9.0 +PKG_RELEASE:=1 + +PYPI_NAME:=typing-extensions +PYPI_SOURCE_NAME:=typing_extensions +PKG_HASH:=23478f88c37f27d76ac8aee6c905017a143b0b1b886c3c9f66bc2fd94f9f5783 + +PKG_MAINTAINER:=Jan Pavlinec , Jeffery To +PKG_LICENSE:=Python-2.0.1 0BSD +PKG_LICENSE_FILES:=LICENSE + +PKG_BUILD_DEPENDS:=python-flit-core/host +HOST_BUILD_DEPENDS:=python3/host python-build/host python-installer/host python-flit-core/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-typing-extensions + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Backported and Experimental Type Hints + URL:=https://github.com/python/typing_extensions + DEPENDS:=+python3-light +endef + +define Package/python3-typing-extensions/description +The typing_extensions module serves two related purposes: + +* Enable use of new type system features on older Python versions. For + example, typing.TypeGuard is new in Python 3.10, but typing_extensions + allows users on previous Python versions to use it too. + +* Enable experimentation with new type system PEPs before they are + accepted and added to the typing module. +endef + +$(eval $(call Py3Package,python3-typing-extensions)) +$(eval $(call BuildPackage,python3-typing-extensions)) +$(eval $(call BuildPackage,python3-typing-extensions-src)) +$(eval $(call HostBuild)) diff --git a/general/python/python-typing-extensions/test.sh b/general/python/python-typing-extensions/test.sh new file mode 100644 index 00000000..623cb242 --- /dev/null +++ b/general/python/python-typing-extensions/test.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +[ "$1" = python3-typing-extensions ] || exit 0 + +python3 -c 'import typing_extensions' diff --git a/general/python/python-ubus/Makefile b/general/python/python-ubus/Makefile new file mode 100644 index 00000000..79471461 --- /dev/null +++ b/general/python/python-ubus/Makefile @@ -0,0 +1,42 @@ +# +# Copyright (C) 2018-2020 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-ubus +PKG_VERSION:=0.1.2 +PKG_RELEASE:=1 + +PYPI_NAME:=ubus +PKG_HASH:=4dc4ef0fbcc8abb7a2354691475a58ff3eb015f1bab3150750729f7f657dd440 + +PKG_MAINTAINER:=Erik Larsson +PKG_LICENSE:=LGPL-2.1-or-later +PKG_LICENSE_FILES:=LICENSE + +PYTHON3_PKG_FORCE_DISTUTILS_SETUP:=1 + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-ubus + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=libubus bindings + URL:=https://gitlab.nic.cz/turris/python-ubus/ + DEPENDS:=+libubus +libblobmsg-json +python3-light +endef + +define Package/python3-ubus/description + Python bindings for ubus. +endef + +$(eval $(call Py3Package,python3-ubus)) +$(eval $(call BuildPackage,python3-ubus)) +$(eval $(call BuildPackage,python3-ubus-src)) diff --git a/general/python/python-uci/Makefile b/general/python/python-uci/Makefile new file mode 100644 index 00000000..5d834d0d --- /dev/null +++ b/general/python/python-uci/Makefile @@ -0,0 +1,40 @@ +# +# Copyright (C) 2018-2022 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-uci +PKG_VERSION:=0.9.0 +PKG_RELEASE:=1 + +PYPI_NAME:=pyuci +PKG_HASH:=865a45d48fb5d363f1230e94fa2c5b01ae6487f02f2180b0a6f78193a70166e2 + +PKG_MAINTAINER:=Josef Schlehofer +PKG_LICENSE:=GPL-3.0-or-later +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-uci + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Python UCI bindings + URL:=https://gitlab.nic.cz/turris/pyuci/ + DEPENDS:=+python3-light +libuci +endef + +define Package/python3-uci/description + Python3 bindings for Unified Configuration Interface. +endef + +$(eval $(call Py3Package,python3-uci)) +$(eval $(call BuildPackage,python3-uci)) +$(eval $(call BuildPackage,python3-uci-src)) diff --git a/general/python/python-unidecode/Makefile b/general/python/python-unidecode/Makefile new file mode 100644 index 00000000..424f361a --- /dev/null +++ b/general/python/python-unidecode/Makefile @@ -0,0 +1,40 @@ +# +# Copyright (C) 2019 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-unidecode +PKG_VERSION:=1.3.6 +PKG_RELEASE:=1 + +PYPI_NAME:=Unidecode +PKG_HASH:=fed09cf0be8cf415b391642c2a5addfc72194407caee4f98719e40ec2a72b830 + +PKG_MAINTAINER:=Josef Schlehofer +PKG_LICENSE:=GPL-2.0-or-later +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-unidecode + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=ASCII transliterations of Unicode text + URL:=https://github.com/avian2/unidecode + DEPENDS:=+python3-light +endef + +define Package/python-unidecode/description + Unidecode, lossy ASCII transliterations of Unicode text +endef + +$(eval $(call Py3Package,python3-unidecode)) +$(eval $(call BuildPackage,python3-unidecode)) +$(eval $(call BuildPackage,python3-unidecode-src)) diff --git a/general/python/python-urllib3/Makefile b/general/python/python-urllib3/Makefile new file mode 100644 index 00000000..323e7cda --- /dev/null +++ b/general/python/python-urllib3/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2007-2017 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-urllib3 +PKG_VERSION:=2.0.4 +PKG_RELEASE:=1 + +PKG_MAINTAINER:=Josef Schlehofer +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE.txt +PKG_CPE_ID:=cpe:/a:python:urllib3 + +PYPI_NAME:=urllib3 +PKG_HASH:=8d22f86aae8ef5e410d4f539fde9ce6b2113a001bb4d189e0aed70642d602b11 + +PKG_BUILD_DEPENDS:=python-hatchling/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-urllib3 + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Sanity-friendly HTTP client + URL:=https://urllib3.readthedocs.io/ + DEPENDS:=+python3 +endef + +define Package/python3-urllib3/description + HTTP library with thread-safe connection pooling, file post, and more. +endef + +$(eval $(call Py3Package,python3-urllib3)) +$(eval $(call BuildPackage,python3-urllib3)) +$(eval $(call BuildPackage,python3-urllib3-src)) diff --git a/general/python/python-userpath/Makefile b/general/python/python-userpath/Makefile new file mode 100644 index 00000000..969a238b --- /dev/null +++ b/general/python/python-userpath/Makefile @@ -0,0 +1,42 @@ +# +# 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-userpath +PKG_VERSION:=1.9.1 +PKG_RELEASE:=1 + +PYPI_NAME:=userpath +PKG_HASH:=ce8176728d98c914b6401781bf3b23fccd968d1647539c8788c7010375e02796 + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE.txt +PKG_MAINTAINER:=Jeffery To + +PKG_BUILD_DEPENDS:=python-hatchling/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-userpath + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Cross-platform tool for modifying a user's PATH + URL:=https://github.com/ofek/userpath + DEPENDS:=+python3-light +python3-click +python3-psutil +endef + +define Package/python3-userpath/description +This is a tool for modifying a user's PATH. +endef + +$(eval $(call Py3Package,python3-userpath)) +$(eval $(call BuildPackage,python3-userpath)) +$(eval $(call BuildPackage,python3-userpath-src)) diff --git a/general/python/python-userpath/patches/0001-Handle-OSErrors-when-running-show-path-commands.patch b/general/python/python-userpath/patches/0001-Handle-OSErrors-when-running-show-path-commands.patch new file mode 100644 index 00000000..3a412e62 --- /dev/null +++ b/general/python/python-userpath/patches/0001-Handle-OSErrors-when-running-show-path-commands.patch @@ -0,0 +1,31 @@ +From 9175a0a97c7bc2eeb995e53d50a07be6a7e834f0 Mon Sep 17 00:00:00 2001 +From: Jeffery To +Date: Thu, 9 Nov 2023 14:20:58 +0800 +Subject: [PATCH] Handle OSErrors when running show path commands + +Bash may not always be installed, for example on OpenWrt, and attempting +to call the show path commands for Bash will cause a FileNotFoundError +to be raised. + +This wraps the subprocess call with a try statement and returns the +empty string in the case of an OSError. +--- + userpath/utils.py | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +--- a/userpath/utils.py ++++ b/userpath/utils.py +@@ -30,8 +30,11 @@ def ensure_parent_dir_exists(path): + + + def get_flat_output(command, sep=os.pathsep, **kwargs): +- process = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, **kwargs) +- output = process.communicate()[0].decode(locale.getpreferredencoding(False)).strip() ++ try: ++ process = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, **kwargs) ++ output = process.communicate()[0].decode(locale.getpreferredencoding(False)).strip() ++ except OSError: ++ return '' + + # We do this because the output may contain new lines. + lines = [line.strip() for line in output.splitlines()] diff --git a/general/python/python-userpath/patches/0001-Use-Sh-as-base-class-for-Bash-and-Zsh.patch b/general/python/python-userpath/patches/0001-Use-Sh-as-base-class-for-Bash-and-Zsh.patch new file mode 100644 index 00000000..69dfde2d --- /dev/null +++ b/general/python/python-userpath/patches/0001-Use-Sh-as-base-class-for-Bash-and-Zsh.patch @@ -0,0 +1,89 @@ +From dffcc1c5823bcce10b420467db41e42ec41f4702 Mon Sep 17 00:00:00 2001 +From: Jeffery To +Date: Thu, 9 Nov 2023 17:48:50 +0800 +Subject: [PATCH 1/2] Use Sh as base class for Bash and Zsh + +--- + userpath/shells.py | 41 ++++++++++++++++++++++++++--------------- + 1 file changed, 26 insertions(+), 15 deletions(-) + +--- a/userpath/shells.py ++++ b/userpath/shells.py +@@ -12,24 +12,36 @@ class Shell(object): + + + class Sh(Shell): +- def config(self, location, front=True): ++ name = 'sh' ++ ++ def _config_contents(self, location, front=True): + head, tail = (location, '$PATH') if front else ('$PATH', location) + new_path = '{}{}{}'.format(head, pathsep, tail) ++ return 'export PATH="{}"'.format(new_path) ++ ++ def config(self, location, front=True): ++ contents = self._config_contents(location, front=front) ++ return {path.join(self.home, '.profile'): contents} + +- return {path.join(self.home, '.profile'): 'PATH="{}"'.format(new_path)} ++ @classmethod ++ def _interactive_show_path_command(cls): ++ return [cls.name, '-i', '-c', 'echo $PATH'] ++ ++ @classmethod ++ def _interactive_login_show_path_command(cls): ++ return [cls.name, '-i', '-l', '-c', 'echo $PATH'] + + @classmethod + def show_path_commands(cls): + # TODO: Find out what file influences non-login shells. The issue may simply be our Docker setup. +- return [['sh', '-i', '-l', '-c', 'echo $PATH']] ++ return [cls._interactive_login_show_path_command()] + + +-class Bash(Shell): +- def config(self, location, front=True): +- head, tail = (location, '$PATH') if front else ('$PATH', location) +- new_path = '{}{}{}'.format(head, pathsep, tail) +- contents = 'export PATH="{}"'.format(new_path) ++class Bash(Sh): ++ name = 'bash' + ++ def config(self, location, front=True): ++ contents = self._config_contents(location, front=front) + configs = {path.join(self.home, '.bashrc'): contents} + + # https://github.com/ofek/userpath/issues/3#issuecomment-492491977 +@@ -50,7 +62,7 @@ class Bash(Shell): + + @classmethod + def show_path_commands(cls): +- return [['bash', '-i', '-c', 'echo $PATH'], ['bash', '-i', '-l', '-c', 'echo $PATH']] ++ return [cls._interactive_show_path_command(), cls._interactive_login_show_path_command()] + + + class Fish(Shell): +@@ -88,18 +100,17 @@ class Xonsh(Shell): + return [['xonsh', '-i', '-c', command], ['xonsh', '-i', '--login', '-c', command]] + + +-class Zsh(Shell): +- def config(self, location, front=True): +- head, tail = (location, '$PATH') if front else ('$PATH', location) +- new_path = '{}{}{}'.format(head, pathsep, tail) +- contents = 'export PATH="{}"'.format(new_path) ++class Zsh(Sh): ++ name = 'zsh' + ++ def config(self, location, front=True): ++ contents = self._config_contents(location, front=front) + zdotdir = environ.get('ZDOTDIR', self.home) + return {path.join(zdotdir, '.zshrc'): contents, path.join(zdotdir, '.zprofile'): contents} + + @classmethod + def show_path_commands(cls): +- return [['zsh', '-i', '-c', 'echo $PATH'], ['zsh', '-i', '-l', '-c', 'echo $PATH']] ++ return [cls._interactive_show_path_command(), cls._interactive_login_show_path_command()] + + + SHELLS = { diff --git a/general/python/python-userpath/patches/0002-Add-support-for-ash-Almquist-shell.patch b/general/python/python-userpath/patches/0002-Add-support-for-ash-Almquist-shell.patch new file mode 100644 index 00000000..2c1132ea --- /dev/null +++ b/general/python/python-userpath/patches/0002-Add-support-for-ash-Almquist-shell.patch @@ -0,0 +1,112 @@ +From 7823b9b39c486aedf830783329abdc3bd9664ba4 Mon Sep 17 00:00:00 2001 +From: Jeffery To +Date: Thu, 9 Nov 2023 17:51:21 +0800 +Subject: [PATCH 2/2] Add support for ash (Almquist shell) + +--- + tests/docker/debian | 2 +- + tests/test_ash.py | 65 +++++++++++++++++++++++++++++++++++++++++++++ + userpath/shells.py | 5 ++++ + 3 files changed, 71 insertions(+), 1 deletion(-) + create mode 100644 tests/test_ash.py + +--- a/tests/docker/debian ++++ b/tests/docker/debian +@@ -2,7 +2,7 @@ ARG PYTHON_VERSION + FROM python:${PYTHON_VERSION} + + RUN apt-get update \ +- && apt-get --no-install-recommends -y install fish zsh ++ && apt-get --no-install-recommends -y install ash fish zsh + + COPY requirements.txt / + RUN pip install -r requirements.txt +--- /dev/null ++++ b/tests/test_ash.py +@@ -0,0 +1,65 @@ ++import pytest ++import userpath ++ ++from .utils import SKIP_WINDOWS_CI, get_random_path ++ ++SHELL_NAME = 'ash' ++ ++pytestmark = [SKIP_WINDOWS_CI, pytest.mark.ash] ++ ++ ++@pytest.mark.usefixtures('shell_test') ++class TestDebian(object): ++ DOCKERFILE = 'debian' ++ ++ def test_prepend(self, request, shell_test): ++ if shell_test is None: ++ location = get_random_path() ++ assert not userpath.in_current_path(location) ++ assert userpath.prepend(location, check=True) ++ assert userpath.in_new_path(location) ++ assert userpath.need_shell_restart(location) ++ else: ++ process = shell_test(request.node.name) ++ stdout, stderr = process.communicate() ++ ++ assert process.returncode == 0, (stdout + stderr).decode('utf-8') ++ ++ def test_prepend_multiple(self, request, shell_test): ++ if shell_test is None: ++ locations = [get_random_path(), get_random_path()] ++ assert not userpath.in_current_path(locations) ++ assert userpath.prepend(locations, check=True) ++ assert userpath.in_new_path(locations) ++ assert userpath.need_shell_restart(locations) ++ else: ++ process = shell_test(request.node.name) ++ stdout, stderr = process.communicate() ++ ++ assert process.returncode == 0, (stdout + stderr).decode('utf-8') ++ ++ def test_append(self, request, shell_test): ++ if shell_test is None: ++ location = get_random_path() ++ assert not userpath.in_current_path(location) ++ assert userpath.append(location, check=True) ++ assert userpath.in_new_path(location) ++ assert userpath.need_shell_restart(location) ++ else: ++ process = shell_test(request.node.name) ++ stdout, stderr = process.communicate() ++ ++ assert process.returncode == 0, (stdout + stderr).decode('utf-8') ++ ++ def test_append_multiple(self, request, shell_test): ++ if shell_test is None: ++ locations = [get_random_path(), get_random_path()] ++ assert not userpath.in_current_path(locations) ++ assert userpath.append(locations, check=True) ++ assert userpath.in_new_path(locations) ++ assert userpath.need_shell_restart(locations) ++ else: ++ process = shell_test(request.node.name) ++ stdout, stderr = process.communicate() ++ ++ assert process.returncode == 0, (stdout + stderr).decode('utf-8') +--- a/userpath/shells.py ++++ b/userpath/shells.py +@@ -37,6 +37,10 @@ class Sh(Shell): + return [cls._interactive_login_show_path_command()] + + ++class Ash(Sh): ++ name = 'ash' ++ ++ + class Bash(Sh): + name = 'bash' + +@@ -114,6 +118,7 @@ class Zsh(Sh): + + + SHELLS = { ++ 'ash': Ash, + 'bash': Bash, + 'fish': Fish, + 'sh': Sh, diff --git a/general/python/python-userpath/test.sh b/general/python/python-userpath/test.sh new file mode 100644 index 00000000..e87d325b --- /dev/null +++ b/general/python/python-userpath/test.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +[ "$1" = python3-userpath ] || exit 0 + +userpath --version | grep -Fx "userpath, version $PKG_VERSION" diff --git a/general/python/python-versioneer/Makefile b/general/python/python-versioneer/Makefile new file mode 100644 index 00000000..b21866a8 --- /dev/null +++ b/general/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)) diff --git a/general/python/python-voluptuous-serialize/Makefile b/general/python/python-voluptuous-serialize/Makefile new file mode 100644 index 00000000..28204ede --- /dev/null +++ b/general/python/python-voluptuous-serialize/Makefile @@ -0,0 +1,42 @@ +# +# Copyright (C) 2019-2021 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-voluptuous-serialize +PKG_VERSION:=2.6.0 +PKG_RELEASE:=1 + +PYPI_NAME:=voluptuous-serialize +PKG_HASH:=79acdc58239582a393144402d827fa8efd6df0f5350cdc606d9242f6f9bca7c4 + +PKG_MAINTAINER:=Josef Schlehofer +PKG_LICENSE:=Apache-2.0 +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-voluptuous-serialize + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Python Voluptuous Serialize + URL:=https://github.com/balloob/voluptuous-serialize + DEPENDS:= \ + +python3-light \ + +python3-voluptuous +endef + +define Package/python3-voluptuous-serialize/description + Convert Voluptuous schemas to dictionaries so they can be serialized. +endef + +$(eval $(call Py3Package,python3-voluptuous-serialize)) +$(eval $(call BuildPackage,python3-voluptuous-serialize)) +$(eval $(call BuildPackage,python3-voluptuous-serialize-src)) diff --git a/general/python/python-voluptuous/Makefile b/general/python/python-voluptuous/Makefile new file mode 100644 index 00000000..ceb6a85f --- /dev/null +++ b/general/python/python-voluptuous/Makefile @@ -0,0 +1,41 @@ +# +# Copyright (C) 2019 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-voluptuous +PKG_VERSION:=0.13.1 +PKG_RELEASE:=1 + +PYPI_NAME:=voluptuous +PKG_HASH:=e8d31c20601d6773cb14d4c0f42aee29c6821bbd1018039aac7ac5605b489723 + +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=COPYING +PKG_MAINTAINER:=Josef Schlehofer + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-voluptuous + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Data validation library + URL:=https://github.com/alecthomas/voluptuous + DEPENDS:=+python3-light +python3-decimal +python3-urllib +endef + +define Package/python3-voluptuous/description +It is primarily intended for validating data coming into Python as JSON, +YAML, etc. +endef + +$(eval $(call Py3Package,python3-voluptuous)) +$(eval $(call BuildPackage,python3-voluptuous)) +$(eval $(call BuildPackage,python3-voluptuous-src)) diff --git a/general/python/python-wcwidth/Makefile b/general/python/python-wcwidth/Makefile new file mode 100644 index 00000000..03af3f5f --- /dev/null +++ b/general/python/python-wcwidth/Makefile @@ -0,0 +1,42 @@ +# +# Copyright (C) 2019-2020 CZ.NIC z.s.p.o. (http://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-wcwidth +PKG_VERSION:=0.2.6 +PKG_RELEASE:=1 + +PYPI_NAME:=wcwidth +PKG_HASH:=a5220780a404dbe3353789870978e472cfe477761f06ee55077256e509b156d0 + +PKG_MAINTAINER:=Jan Pavlinec +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-wcwidth + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Terminal width calculation library + URL:=https://github.com/jquast/wcwidth + DEPENDS:=+python3-light +endef + +define Package/python3-wcwidth/description +Python library that measures the width of unicode strings rendered to a +terminal +endef + +$(eval $(call Py3Package,python3-wcwidth)) +$(eval $(call BuildPackage,python3-wcwidth)) +$(eval $(call BuildPackage,python3-wcwidth-src)) diff --git a/general/python/python-websocket-client/Makefile b/general/python/python-websocket-client/Makefile new file mode 100644 index 00000000..d77fabd0 --- /dev/null +++ b/general/python/python-websocket-client/Makefile @@ -0,0 +1,41 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-websocket-client +PKG_VERSION:=1.7.0 +PKG_RELEASE:=1 + +PYPI_NAME:=websocket-client +PKG_HASH:=10e511ea3a8c744631d3bd77e61eb17ed09304c413ad42cf6ddfa4c7787e8fe6 + +PKG_MAINTAINER:=Javier Marcet +PKG_LICENSE:=Apache-2.0 +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-websocket-client + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=WebSocket client for Python. hybi13 is supported + URL:=https://github.com/websocket-client/websocket-client + DEPENDS:=+python3-light +python3-logging +python3-openssl +endef + +define Package/python3-websocket-client/description + websocket-client module is WebSocket client for python. This provide the low + level APIs for WebSocket. All APIs are the synchronous functions. + + websocket-client supports only hybi-13. +endef + +define Py3Package/python3-websocket-client/filespec ++|$(PYTHON3_PKG_DIR) +-|$(PYTHON3_PKG_DIR)/websocket/tests +endef + +$(eval $(call Py3Package,python3-websocket-client)) +$(eval $(call BuildPackage,python3-websocket-client)) +$(eval $(call BuildPackage,python3-websocket-client-src)) diff --git a/general/python/python-websockets/Makefile b/general/python/python-websockets/Makefile new file mode 100644 index 00000000..fac0d741 --- /dev/null +++ b/general/python/python-websockets/Makefile @@ -0,0 +1,45 @@ +# +# Copyright (C) 2018-2022 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-websockets +PKG_VERSION:=11.0.3 +PKG_RELEASE:=1 + +PYPI_NAME:=websockets +PKG_HASH:=88fc51d9a26b10fc331be344f1781224a375b78488fc343620184e95a4b27016 + +PKG_MAINTAINER:=Michal Vasilek +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-websockets + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Implementation of the WebSocket Protocol + URL:=https://github.com/aaugustin/websockets + DEPENDS:=+python3 +endef + +define Package/python3-websockets/description +websockets is a library for building WebSocket servers and clients in +Python with a focus on correctness, simplicity, robustness, and +performance. + +Built on top of asyncio, Python's standard asynchronous I/O framework, +the default implementation provides an elegant coroutine-based API. +endef + +$(eval $(call Py3Package,python3-websockets)) +$(eval $(call BuildPackage,python3-websockets)) +$(eval $(call BuildPackage,python3-websockets-src)) diff --git a/general/python/python-werkzeug/Makefile b/general/python/python-werkzeug/Makefile new file mode 100644 index 00000000..08c67d77 --- /dev/null +++ b/general/python/python-werkzeug/Makefile @@ -0,0 +1,40 @@ +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-werkzeug +PKG_VERSION:=2.3.6 +PKG_RELEASE:=1 + +PYPI_NAME:=Werkzeug +PKG_HASH:=98c774df2f91b05550078891dee5f0eb0cb797a522c757a2452b9cee5b202330 + +PKG_MAINTAINER:=Jeffery To +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=LICENSE.rst +PKG_CPE_ID:=cpe:/a:palletsprojects:werkzeug + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-werkzeug + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Comprehensive WSGI web application library + URL:=https://palletsprojects.com/p/werkzeug/ + DEPENDS:=+python3 +python3-markupsafe +endef + +define Package/python3-werkzeug/description +Werkzeug is a comprehensive WSGI web application library. It began as a +simple collection of various utilities for WSGI applications and has +become one of the most advanced WSGI utility libraries. +endef + +$(eval $(call Py3Package,python3-werkzeug)) +$(eval $(call BuildPackage,python3-werkzeug)) +$(eval $(call BuildPackage,python3-werkzeug-src)) diff --git a/general/python/python-wheel/Makefile b/general/python/python-wheel/Makefile new file mode 100644 index 00000000..28f549b5 --- /dev/null +++ b/general/python/python-wheel/Makefile @@ -0,0 +1,48 @@ +# +# 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-wheel +PKG_VERSION:=0.42.0 +PKG_RELEASE:=1 + +PYPI_NAME:=wheel +PKG_HASH:=c45be39f7882c9d34243236f2d63cbd58039e360f85d0913425fbd7ceea617a8 + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE.txt +PKG_MAINTAINER:=Jeffery To + +PKG_HOST_ONLY:=1 +HOST_BUILD_DEPENDS:=python3/host python-build/host python-installer/host python-flit-core/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-wheel + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=A built-package format for Python + URL:=https://github.com/pypa/wheel + DEPENDS:=+python3-light +python3-email +python3-logging +python3-setuptools + BUILDONLY:=1 +endef + +define Package/python3-wheel/description +This library is the reference implementation of the Python wheel +packaging standard, as defined in PEP 427. +endef + +$(eval $(call Py3Package,python3-wheel)) +$(eval $(call BuildPackage,python3-wheel)) +$(eval $(call BuildPackage,python3-wheel-src)) +$(eval $(call HostBuild)) diff --git a/general/python/python-xmltodict/Makefile b/general/python/python-xmltodict/Makefile new file mode 100644 index 00000000..87b841f5 --- /dev/null +++ b/general/python/python-xmltodict/Makefile @@ -0,0 +1,41 @@ +# +# Copyright (C) 2019 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-xmltodict +PKG_VERSION:=0.13.0 +PKG_RELEASE:=1 + +PYPI_NAME:=xmltodict +PKG_HASH:=341595a488e3e01a85a9d8911d8912fd922ede5fecc4dce437eb4b6c8d037e56 + +PKG_MAINTAINER:=Josef Schlehofer +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-xmltodict + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Work with XML like JSON + URL:=https://github.com/martinblech/xmltodict + DEPENDS:=+python3-light +python3-xml +endef + +define Package/python3-xmltodict/description +xmltodict is a Python module that makes working with XML feel like you +are working with JSON. +endef + +$(eval $(call Py3Package,python3-xmltodict)) +$(eval $(call BuildPackage,python3-xmltodict)) +$(eval $(call BuildPackage,python3-xmltodict-src)) diff --git a/general/python/python-yaml/Makefile b/general/python/python-yaml/Makefile new file mode 100644 index 00000000..8a62c7f3 --- /dev/null +++ b/general/python/python-yaml/Makefile @@ -0,0 +1,49 @@ +# +# Copyright (C) 2008-2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-yaml +PKG_VERSION:=6.0.1 +PKG_RELEASE:=2 + +PYPI_NAME:=PyYAML +PKG_HASH:=bfdf460b1736c775f2ba9f6a92bca30bc2095067b8a9d77876d1fad6cc3b4a43 + +PKG_MAINTAINER:=Josef Schlehofer +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE +PKG_CPE_ID:=cpe:/a:pyyaml:pyyaml + +PKG_BUILD_DEPENDS:=python-cython/host +HOST_BUILD_DEPENDS:=python-cython/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-yaml + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=YAML parser and emitter + URL:=https://github.com/yaml/pyyaml + DEPENDS:=+libyaml +python3-light +endef + +define Package/python3-yaml/description + PyYAML is a YAML parser and emitter for the Python programming language. +endef + +PYTHON3_PKG_BUILD_VARS:=PYYAML_FORCE_LIBYAML=1 + +$(eval $(call Py3Package,python3-yaml)) +$(eval $(call BuildPackage,python3-yaml)) +$(eval $(call BuildPackage,python3-yaml-src)) +$(eval $(call HostBuild)) diff --git a/general/python/python-yaml/patches/001-cython3.patch b/general/python/python-yaml/patches/001-cython3.patch new file mode 100644 index 00000000..fe3956c2 --- /dev/null +++ b/general/python/python-yaml/patches/001-cython3.patch @@ -0,0 +1,18 @@ +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -1,3 +1,3 @@ + [build-system] +-requires = ["setuptools", "wheel", "Cython<3.0"] ++requires = ["setuptools", "wheel", "Cython"] + build-backend = "setuptools.build_meta" +--- a/setup.py ++++ b/setup.py +@@ -82,7 +82,7 @@ if 'sdist' in sys.argv or os.environ.get + with_cython = True + try: + from Cython.Distutils.extension import Extension as _Extension +- from Cython.Distutils import build_ext as _build_ext ++ from Cython.Distutils.old_build_ext import old_build_ext as _build_ext + with_cython = True + except ImportError: + if with_cython: diff --git a/general/python/python-yarl/Makefile b/general/python/python-yarl/Makefile new file mode 100644 index 00000000..63d89997 --- /dev/null +++ b/general/python/python-yarl/Makefile @@ -0,0 +1,44 @@ +# +# Copyright (C) 2019-2021 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=yarl +PKG_VERSION:=1.9.2 +PKG_RELEASE:=1 + +PYPI_NAME:=$(PKG_NAME) +PKG_HASH:=04ab9d4b9f587c06d801c2abfe9317b77cdf996c65a90d5e84ecc45010823571 + +PKG_MAINTAINER:=Josef Schlehofer +PKG_LICENSE:=Apache-2.0 +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-yarl + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Yet another URL library + URL:=https://github.com/aio-libs/yarl + DEPENDS:= \ + +python3-light \ + +python3-multidict \ + +python3-urllib \ + +python3-idna +endef + +define Package/python3-yarl/description +Yet another URL library +endef + +$(eval $(call Py3Package,python3-yarl)) +$(eval $(call BuildPackage,python3-yarl)) +$(eval $(call BuildPackage,python3-yarl-src)) diff --git a/general/python/python-zeroconf/Makefile b/general/python/python-zeroconf/Makefile new file mode 100644 index 00000000..1950b579 --- /dev/null +++ b/general/python/python-zeroconf/Makefile @@ -0,0 +1,46 @@ +# +# Copyright (C) 2019-2021 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-zeroconf +PKG_VERSION:=0.131.0 +PKG_RELEASE:=1 + +PYPI_NAME:=zeroconf +PKG_HASH:=90c431e99192a044a5e0217afd7ca0ca9824af93190332e6f7baf4da5375f331 + +PKG_MAINTAINER:=Josef Schlehofer +PKG_LICENSE:=LGPL-2.1-or-later +PKG_LICENSE_FILES:=COPYING + +PKG_BUILD_DEPENDS:=python-cython/host python-poetry-core/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-zeroconf + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Multicast DNS Service Discovery Library + URL:=https://github.com/python-zeroconf/python-zeroconf + DEPENDS:= \ + +python3-light \ + +python3-asyncio \ + +python3-logging \ + +python3-ifaddr +endef + +define Package/python3-zeroconf/description + Pure Python Multicast DNS Service Discovery Library (Bonjour/Avahi compatible) +endef + +$(eval $(call Py3Package,python3-zeroconf)) +$(eval $(call BuildPackage,python3-zeroconf)) +$(eval $(call BuildPackage,python3-zeroconf-src)) diff --git a/general/python/python-zipp/Makefile b/general/python/python-zipp/Makefile new file mode 100644 index 00000000..77a6d0d9 --- /dev/null +++ b/general/python/python-zipp/Makefile @@ -0,0 +1,35 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-zipp +PKG_VERSION:=3.16.2 +PKG_RELEASE:=1 + +PYPI_NAME:=zipp +PKG_HASH:=ebc15946aa78bd63458992fc81ec3b6f7b1e92d51c35e6de1c3804e73b799147 + +PKG_MAINTAINER:=Jan Pavlinec +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE + +PKG_BUILD_DEPENDS:=python-setuptools-scm/host # setuptools_scm[toml] >= 3.4.1 + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-zipp + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Zipfile object wrapper + URL:=https://github.com/jaraco/zipp + DEPENDS:=+python3-light +python3-urllib +endef + +define Package/python3-zipp/description + Backport of pathlib-compatible object wrapper for zip files +endef + +$(eval $(call Py3Package,python3-zipp)) +$(eval $(call BuildPackage,python3-zipp)) +$(eval $(call BuildPackage,python3-zipp-src)) diff --git a/general/python/python-zope-event/Makefile b/general/python/python-zope-event/Makefile new file mode 100644 index 00000000..4b4c0fde --- /dev/null +++ b/general/python/python-zope-event/Makefile @@ -0,0 +1,35 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-zope-event +PKG_VERSION:=5.0 +PKG_RELEASE:=1 + +PYPI_NAME:=zope.event +PKG_HASH:=bac440d8d9891b4068e2b5a2c5e2c9765a9df762944bda6955f96bb9b91e67cd + +PKG_LICENSE:=ZPL-2.1 +PKG_LICENSE_FILES:=LICENSE.txt +PKG_MAINTAINER:=Andy Syam + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-zope-event + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Very basic event publishing system + URL:=https://github.com/zopefoundation/zope.event + DEPENDS:=+python3-light +python3-logging +endef + +define Package/python3-zope-event/description +The zope.event package provides a simple event system, including: +An event publishing API, intended for use by applications which are unaware of any subscribers to their events. +A very simple synchronous event-dispatching system, on which more sophisticated event dispatching systems can be built. For example, a type-based event dispatching system that builds on zope.event can be found in zope.component. +endef + +$(eval $(call Py3Package,python3-zope-event)) +$(eval $(call BuildPackage,python3-zope-event)) +$(eval $(call BuildPackage,python3-zope-event-src)) diff --git a/general/python/python-zope-interface/Makefile b/general/python/python-zope-interface/Makefile new file mode 100644 index 00000000..81eac63f --- /dev/null +++ b/general/python/python-zope-interface/Makefile @@ -0,0 +1,44 @@ +# +# Copyright (C) 2006-2011 OpenWrt.org +# Copyright (C) 2015-2016, 2018-2021, 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-zope-interface +PKG_VERSION:=6.1 +PKG_RELEASE:=1 + +PYPI_NAME:=zope.interface +PKG_HASH:=2fdc7ccbd6eb6b7df5353012fbed6c3c5d04ceaca0038f75e601060e95345309 + +PKG_LICENSE:=ZPL-2.1 +PKG_LICENSE_FILES:=LICENSE.txt +PKG_MAINTAINER:=Jeffery To + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-zope-interface + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Interfaces for Python + URL:=https://github.com/zopefoundation/zope.interface + DEPENDS:=+python3-light +python3-logging +endef + +define Package/python3-zope-interface/description +This package provides an implementation of "object interfaces" for +Python. Interfaces are a mechanism for labeling objects as conforming to +a given API or contract. So, this package can be considered as +implementation of the Design By Contract methodology support in Python. +endef + +$(eval $(call Py3Package,python3-zope-interface)) +$(eval $(call BuildPackage,python3-zope-interface)) +$(eval $(call BuildPackage,python3-zope-interface-src)) diff --git a/general/python/python-zope-interface/patches/001-omit-tests.patch b/general/python/python-zope-interface/patches/001-omit-tests.patch new file mode 100644 index 00000000..40aed6e2 --- /dev/null +++ b/general/python/python-zope-interface/patches/001-omit-tests.patch @@ -0,0 +1,19 @@ +--- a/setup.py ++++ b/setup.py +@@ -125,7 +125,7 @@ setup(name='zope.interface', + "Framework :: Zope :: 3", + "Topic :: Software Development :: Libraries :: Python Modules", + ], +- packages=find_packages('src'), ++ packages=find_packages('src', exclude=["*.tests", "*.tests.*"]), + package_dir={'': 'src'}, + namespace_packages=["zope"], + cmdclass={ +@@ -133,6 +133,7 @@ setup(name='zope.interface', + }, + test_suite='zope.interface.tests', + include_package_data=True, ++ exclude_package_data={'':['tests/*']}, + zip_safe=False, + tests_require=tests_require, + install_requires=['setuptools'], diff --git a/general/python/python-zope-interface/test.sh b/general/python/python-zope-interface/test.sh new file mode 100644 index 00000000..48123771 --- /dev/null +++ b/general/python/python-zope-interface/test.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +[ "$1" = python3-zope-interface ] || exit 0 + +python3 -c 'import zope.interface' diff --git a/general/python/python3-bottle/Makefile b/general/python/python3-bottle/Makefile new file mode 100644 index 00000000..1a6913d2 --- /dev/null +++ b/general/python/python3-bottle/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python3-bottle +PKG_VERSION:=0.12.25 +PKG_RELEASE:=1 + +PYPI_NAME:=bottle +PKG_HASH:=e1a9c94970ae6d710b3fb4526294dfeb86f2cb4a81eff3a4b98dc40fb0e5e021 + +PKG_MAINTAINER:=Josef Schlehofer +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE +PKG_CPE_ID:=cpe:/a:bottlepy:bottle + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-bottle + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Fast and simple WSGI-framework for small web-applications + URL:=https://bottlepy.org + DEPENDS:=+python3 +endef + +define Package/python3-bottle/description + Bottle is a fast, simple and lightweight WSGI micro web-framework for Python. + It is distributed as a single file module and has no dependencies other than the + Python Standard Library. +endef + +$(eval $(call Py3Package,python3-bottle)) +$(eval $(call BuildPackage,python3-bottle)) +$(eval $(call BuildPackage,python3-bottle-src)) diff --git a/general/python/python3-django-cors-headers/Makefile b/general/python/python3-django-cors-headers/Makefile new file mode 100644 index 00000000..3d7b8533 --- /dev/null +++ b/general/python/python3-django-cors-headers/Makefile @@ -0,0 +1,33 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=django-cors-headers +PKG_VERSION:=3.10.0 +PKG_RELEASE:=2 + +PYPI_NAME:=django-cors-headers +PKG_HASH:=cd6f4360f5246569c149dc1c40c907c191f1ec45551e10d2a2e2e68512652f78 + +PKG_MAINTAINER:=Peter Stadler +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-django-cors-headers + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Django application for handling the server headers required for Cross-Origin Resource Sharing (CORS). + URL:=https://github.com/adamchainz/django-cors-headers + DEPENDS:=+python3-django +python3-urllib +python3-light +endef + +define Package/python3-django-cors-headers/description + Django application for handling the server headers required for Cross-Origin Resource Sharing (CORS). +endef + +$(eval $(call Py3Package,python3-django-cors-headers)) +$(eval $(call BuildPackage,python3-django-cors-headers)) +$(eval $(call BuildPackage,python3-django-cors-headers-src)) diff --git a/general/python/python3-drf-nested-routers/Makefile b/general/python/python3-drf-nested-routers/Makefile new file mode 100644 index 00000000..1e7e50ae --- /dev/null +++ b/general/python/python3-drf-nested-routers/Makefile @@ -0,0 +1,38 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=drf-nested-routers +PKG_VERSION:=0.93.4 +PKG_RELEASE:=2 + +PYPI_NAME:=drf-nested-routers +PKG_HASH:=01aa556b8c08608bb74fb34f6ca065a5183f2cda4dc0478192cc17a2581d71b0 + +PKG_MAINTAINER:=Peter Stadler +PKG_LICENSE:=Apache-2.0 +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-drf-nested-routers + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Nested resources for the Django Rest Framework + URL:=https://github.com/alanjds/drf-nested-routers + DEPENDS:=+python3-django-restframework +django +python3-light +endef + +define Package/python3-drf-nested-routers/description + Nested resources for the Django Rest Framework +endef + +define Py3Package/python3-drf-nested-routers/filespec ++|$(PYTHON3_PKG_DIR) +-|$(PYTHON3_PKG_DIR)/rest_framework_nested/runtests +endef + +$(eval $(call Py3Package,python3-drf-nested-routers)) +$(eval $(call BuildPackage,python3-drf-nested-routers)) +$(eval $(call BuildPackage,python3-drf-nested-routers-src)) diff --git a/general/python/python3-find-stdlib-depends.sh b/general/python/python3-find-stdlib-depends.sh new file mode 100644 index 00000000..c402d230 --- /dev/null +++ b/general/python/python3-find-stdlib-depends.sh @@ -0,0 +1,435 @@ +#!/bin/sh + +# Packages data +# +# Notes: +# * python3-codecs: Also contains codecs for CJK encodings but we don't +# have a good way to check for uses +# * python3-openssl: Don't include hashlib as it supports several +# standard algorithms without requiring OpenSSL + +packages=" +python3-asyncio: asyncio +python3-cgi: cgi +python3-cgitb: cgitb +python3-codecs: unicodedata +python3-ctypes: ctypes +python3-dbm: dbm dbm.dumb dbm.gnu dbm.ndbm +python3-decimal: decimal +python3-distutils: distutils +python3-email: email +python3-logging: logging +python3-lzma: lzma +python3-multiprocessing: multiprocessing +python3-ncurses: ncurses +python3-openssl: ssl +python3-pydoc: doctest pydoc +python3-readline: readline +python3-sqlite3: sqlite3 +python3-unittest: unittest +python3-urllib: urllib +python3-uuid: uuid +python3-xml: xml xmlrpc +" + + +# Constants + +stdin_name="" +grep_dir_filters=" +-Ir +--include=*.py +--exclude=setup.py +--exclude=test_*.py +--exclude=*_test.py +--exclude-dir=test +--exclude-dir=tests +--exclude-dir=ipkg-* +--exclude-dir=.pkgdir +" + +log_level_notice=5 +log_level_info=6 +log_level_debug=7 + +# /usr/include/sysexits.h +ex_usage=64 +ex_noinput=66 +ex_unavailable=69 +ex_software=70 + +newline=" +" +oifs="$IFS" + + +# Defaults + +grep_output_default_max_count=3 +grep_output_default_color_when="auto" +grep_output_default_line_prefix="-HnT --label=$stdin_name" +grep_output_default_context_num=1 + +log_level_default="$log_level_info" + + +# Global variables + +log_level= +grep= +grep_output_options= +grep_output_description= +stdin= +output_name= +is_first_search= + + +# Logging + +log() { + printf '%s\n' "$*" +} + +can_log_notice() { + [ "$log_level" -ge "$log_level_notice" ] +} + +can_log_info() { + [ "$log_level" -ge "$log_level_info" ] +} + +can_log_debug() { + [ "$log_level" -ge "$log_level_debug" ] +} + +log_notice() { + if can_log_notice; then + log "$@" + fi +} + +log_info() { + if can_log_info; then + log "$@" + fi +} + +log_debug() { + if can_log_debug; then + log "$@" + fi +} + +log_error() { + printf '%s\n' "Error: $*" >&2 +} + + +# Usage + +usage() { + cat <<- EOF + Usage: ${0##*/} [OPTION]... [FILE]... + Search for imports of certain Python standard libraries in each FILE, + generate a list of suggested package dependencies. + + With no FILE, or when FILE is -, read standard input. + + Options: + -c WHEN use color in output; + WHEN is 'always', 'never', or 'auto' (default: '$grep_output_default_color_when') + -h display this help text and exit + -m NUM show max NUM matches per package per file (default: $grep_output_default_max_count); + use 0 to show all matches + -n NAME when one or no FILE is given, use NAME instead of FILE in + displayed information + -q show suggested dependencies only + -v show verbose output (also show all matches) + -x NUM show NUM lines of context (default: $grep_output_default_context_num) + + EOF +} + + +# Imports search + +get_package_modules() { + local line="$1" + local field_num=0 + local IFS=: + + for field in $line; do + # strip leading and trailing whitespace + field="${field#"${field%%[! ]*}"}" + field="${field%"${field##*[! ]}"}" + + # set variables in search_path() + if [ "$field_num" -eq 0 ]; then + package="$field" + field_num=1 + elif [ "$field_num" -eq 1 ]; then + modules="$field" + field_num=2 + else + field_num=3 + fi + done + + if [ "$field_num" -ne 2 ] || [ -z "$package" ] || [ -z "$modules" ]; then + log_error "invalid package data \"$line\"" + exit "$ex_software" + fi +} + +search_path_for_modules() { + local path="$1" + local path_is_dir="$2" + local path_is_stdin="$3" + local package="$4" + local modules="$5" + local modules_regex + local regex + local remove_dir_prefix + local grep_results + local IFS="$oifs" + + log_debug " Looking for modules in $package ($modules)" + + modules_regex=$(printf '%s' "$modules" | sed -e 's/\./\\./g' -e 's/\s\+/|/g') + regex="\b(import\s+($modules_regex)|from\s+($modules_regex)\S*\s+import)\b" + + if [ -n "$path_is_dir" ]; then + remove_dir_prefix="s|^\(\(\x1b[[0-9;]*[mK]\)*\)$path|\1|" + grep_results=$($grep $grep_output_options $grep_dir_filters -E "$regex" "$path") + + elif [ -n "$path_is_stdin" ]; then + grep_results=$(printf '%s\n' "$stdin" | $grep $grep_output_options -E "$regex") + + else + grep_results=$($grep $grep_output_options -E "$regex" "$path") + fi + + if [ "$?" -ne 0 ]; then + log_debug " No imports found" + log_debug "" + return 0 + fi + + log_info " Found imports for: $modules" + + if can_log_info; then + printf '%s\n' "$grep_results" | sed -e "$remove_dir_prefix" -e "s/^/ /" + fi + + log_info "" + + # set variable in search_path() + suggested="$suggested +$package" +} + +search_path() { + local path="$1" + local name="$2" + local path_is_dir + local path_is_stdin + local package + local modules + local suggested + local IFS="$newline" + + if [ "$path" = "-" ]; then + path_is_stdin=1 + + else + if ! [ -e "$path" ]; then + log_error "$path does not exist" + exit "$ex_noinput" + fi + + if [ -d "$path" ]; then + path="${path%/}/" + path_is_dir=1 + fi + fi + + log_info "" + log_info "Searching $name (showing $grep_output_description):" + log_info "" + + if [ -n "$path_is_stdin" ]; then + stdin="$(cat)" + fi + + for line in $packages; do + # strip leading whitespace + line="${line#"${line%%[! ]*}"}" + + # skip blank lines or comments (beginning with #) + if [ -z "$line" ] || [ "$line" != "${line###}" ]; then + continue + fi + + package= + modules= + + get_package_modules "$line" + search_path_for_modules "$path" "$path_is_dir" "$path_is_stdin" "$package" "$modules" + done + + log_notice "Suggested dependencies for $name:" + + if [ -z "$suggested" ]; then + suggested="(none)" + fi + IFS="$oifs" + for package in $suggested; do + log_notice " $package" + done + + log_notice "" +} + + +# Find GNU grep + +if ggrep --version 2>&1 | grep -q GNU; then + grep="ggrep" +elif grep --version 2>&1 | grep -q GNU; then + grep="grep" +else + log_error "cannot find GNU grep" + exit "$ex_unavailable" +fi + + +# Process environment variables + +case $PYTHON3_FIND_STDLIB_DEPENDS_LOG_LEVEL in + notice) + log_level="$log_level_notice" + ;; + info) + log_level="$log_level_info" + ;; + debug) + log_level="$log_level_debug" + ;; + *) + log_level="$log_level_default" + ;; +esac + +grep_output_max_count="${PYTHON3_FIND_STDLIB_DEPENDS_MAX_COUNT:-$grep_output_default_max_count}" +grep_output_color_when="${PYTHON3_FIND_STDLIB_DEPENDS_COLOR_WHEN:-$grep_output_default_color_when}" +grep_output_line_prefix="${PYTHON3_FIND_STDLIB_DEPENDS_LINE_PREFIX:-$grep_output_default_line_prefix}" +grep_output_context_num="${PYTHON3_FIND_STDLIB_DEPENDS_CONTEXT_NUM:-$grep_output_default_context_num}" + + +# Process command line options + +while getopts c:hm:n:qvx: OPT; do + case $OPT in + c) + grep_output_color_when="$OPTARG" + ;; + h) + usage + exit 0 + ;; + m) + grep_output_max_count="$OPTARG" + ;; + n) + output_name="$OPTARG" + ;; + q) + log_level="$log_level_notice" + ;; + v) + log_level="$log_level_debug" + ;; + x) + grep_output_context_num="$OPTARG" + ;; + \?) + usage + exit "$ex_usage" + ;; + esac +done + +shift $((OPTIND - 1)) + + +# Set up grep output options + +if can_log_info; then + if [ "$grep_output_color_when" = "auto" ]; then + if [ -t 1 ]; then + grep_output_color_when="always" + else + grep_output_color_when="never" + fi + fi + + if ! can_log_debug && [ "$grep_output_max_count" -gt 0 ]; then + grep_output_options="-m $grep_output_max_count" + + if [ "$grep_output_max_count" -eq 1 ]; then + grep_output_description="max 1 match per file" + else + grep_output_description="max $grep_output_max_count matches per file" + fi + + else + grep_output_description="all matches" + fi + + if [ "$grep_output_context_num" -gt 0 ]; then + grep_output_options="$grep_output_options -C $grep_output_context_num" + + if [ "$grep_output_context_num" -eq 1 ]; then + grep_output_description="$grep_output_description, 1 line of context" + else + grep_output_description="$grep_output_description, $grep_output_context_num lines of context" + fi + fi + + grep_output_options="$grep_output_options --color=$grep_output_color_when $grep_output_line_prefix" + +else + grep_output_options="-q" +fi + + +# Main + +if [ "$#" -gt 0 ]; then + is_first_search=1 + + if [ "$#" -gt 1 ]; then + output_name= + fi + + for path; do + if [ -z "$is_first_search" ]; then + log_info "====" + fi + + if [ -z "$output_name" ]; then + if [ "$path" = "-" ]; then + output_name="$stdin_name" + else + output_name="$path" + fi + fi + + search_path "$path" "$output_name" + + is_first_search= + output_name= + done + +else + search_path "-" "${output_name:-$stdin_name}" +fi diff --git a/general/python/python3-host-build.mk b/general/python/python3-host-build.mk new file mode 100644 index 00000000..738d1572 --- /dev/null +++ b/general/python/python3-host-build.mk @@ -0,0 +1,99 @@ +# +# Copyright (C) 2023 Jeffery To +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +python3_mk_path:=$(dir $(lastword $(MAKEFILE_LIST))) +include $(python3_mk_path)python3-host.mk + +PYTHON3_HOST_BUILD?=1 + +PYTHON3_HOST_BUILD_CONFIG_SETTINGS?= +PYTHON3_HOST_BUILD_VARS?= +PYTHON3_HOST_BUILD_ARGS?= +PYTHON3_HOST_BUILD_PATH?= + +PYTHON3_HOST_INSTALL_VARS?= + +PYTHON3_HOST_WHEEL_NAME?=$(subst -,_,$(if $(PYPI_SOURCE_NAME),$(PYPI_SOURCE_NAME),$(PKG_NAME))) +PYTHON3_HOST_WHEEL_VERSION?=$(PKG_VERSION) + +PYTHON3_HOST_BUILD_DIR?=$(HOST_BUILD_DIR)/$(PYTHON3_HOST_BUILD_PATH) + + +PYTHON3_HOST_DIR_NAME:=$(lastword $(subst /,$(space),$(CURDIR))) +PYTHON3_HOST_STAGING_DIR:=$(TMP_DIR)/host-stage-$(PYTHON3_HOST_DIR_NAME) +PYTHON3_HOST_STAGING_FILES_LIST_DIR:=$(HOST_BUILD_PREFIX)/stamp +PYTHON3_HOST_STAGING_FILES_LIST:=$(PYTHON3_HOST_STAGING_FILES_LIST_DIR)/$(PYTHON3_HOST_DIR_NAME).list + +define Py3Host/Compile/Bootstrap + $(call HostPython3/Run, \ + $(HOST_BUILD_DIR), \ + -m flit_core.wheel \ + --outdir "$(PYTHON3_HOST_BUILD_DIR)"/openwrt-build \ + "$(PYTHON3_HOST_BUILD_DIR)" \ + ) +endef + +define Py3Host/Compile + $(call HostPython3/Run, \ + $(HOST_BUILD_DIR), \ + -m build \ + --no-isolation \ + --outdir "$(PYTHON3_HOST_BUILD_DIR)"/openwrt-build \ + --wheel \ + $(foreach setting,$(PYTHON3_HOST_BUILD_CONFIG_SETTINGS),--config-setting=$(setting)) \ + $(PYTHON3_HOST_BUILD_ARGS) \ + "$(PYTHON3_HOST_BUILD_DIR)" \ + , \ + $(PYTHON3_HOST_BUILD_VARS) \ + ) +endef + +define Py3Host/Install/Installer + $(call HostPython3/Run, \ + $(HOST_BUILD_DIR), \ + -m installer \ + --destdir "$(1)" \ + --prefix "" \ + "$(PYTHON3_HOST_BUILD_DIR)"/openwrt-build/$(PYTHON3_HOST_WHEEL_NAME)-$(PYTHON3_HOST_WHEEL_VERSION)-*.whl \ + , \ + $(PYTHON3_HOST_INSTALL_VARS) \ + ) +endef + +define Py3Host/Install + rm -rf "$(PYTHON3_HOST_STAGING_DIR)" + mkdir -p "$(PYTHON3_HOST_STAGING_DIR)" "$(PYTHON3_HOST_STAGING_FILES_LIST_DIR)" + + $(call Py3Host/Install/Installer,$(PYTHON3_HOST_STAGING_DIR)) + + $(call Py3Host/Uninstall,$(1)) + + cd "$(PYTHON3_HOST_STAGING_DIR)" && find ./ > "$(PYTHON3_HOST_STAGING_DIR).files" + + $(call locked, \ + mv "$(PYTHON3_HOST_STAGING_DIR).files" "$(PYTHON3_HOST_STAGING_FILES_LIST)" && \ + $(CP) "$(PYTHON3_HOST_STAGING_DIR)"/* "$(1)/", \ + host-staging-dir \ + ) + + rm -rf "$(PYTHON3_HOST_STAGING_DIR)" +endef + +define Py3Host/Uninstall + if [ -f "$(PYTHON3_HOST_STAGING_FILES_LIST)" ]; then \ + "$(SCRIPT_DIR)/clean-package.sh" \ + "$(PYTHON3_HOST_STAGING_FILES_LIST)" \ + "$(1)" ; \ + rm -f "$(PYTHON3_HOST_STAGING_FILES_LIST)" ; \ + fi +endef + +ifeq ($(strip $(PYTHON3_HOST_BUILD)),1) + Host/Compile=$(Py3Host/Compile) + Host/Install=$(Py3Host/Install) + Host/Uninstall=$(call Py3Host/Uninstall,$(HOST_BUILD_PREFIX)) +endif diff --git a/general/python/python3-host.mk b/general/python/python3-host.mk new file mode 100644 index 00000000..3cc20c2c --- /dev/null +++ b/general/python/python3-host.mk @@ -0,0 +1,122 @@ +# +# Copyright (C) 2017 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +# Note: include this file after `include $(TOPDIR)/rules.mk in your package Makefile +# if `python3-package.mk` is included, this will already be included + +# For PYTHON3_VERSION +python3_mk_path:=$(dir $(lastword $(MAKEFILE_LIST))) +include $(python3_mk_path)python3-version.mk +include $(python3_mk_path)../rust/rust-values.mk + +# Unset environment variables + +# https://docs.python.org/3/using/cmdline.html#environment-variables +unexport \ + PYTHONHOME \ + PYTHONPATH \ + PYTHONSAFEPATH \ + PYTHONPLATLIBDIR \ + PYTHONSTARTUP \ + PYTHONOPTIMIZE \ + PYTHONBREAKPOINT \ + PYTHONDEBUG \ + PYTHONINSPECT \ + PYTHONUNBUFFERED \ + PYTHONVERBOSE \ + PYTHONCASEOK \ + PYTHONDONTWRITEBYTECODE \ + PYTHONPYCACHEPREFIX \ + PYTHONHASHSEED \ + PYTHONINTMAXSTRDIGITS \ + PYTHONIOENCODING \ + PYTHONNOUSERSITE \ + PYTHONUSERBASE \ + PYTHONEXECUTABLE \ + PYTHONWARNINGS \ + PYTHONFAULTHANDLER \ + PYTHONTRACEMALLOC \ + PYTHONPROFILEIMPORTTIME \ + PYTHONASYNCIODEBUG \ + PYTHONMALLOC \ + PYTHONMALLOCSTATS \ + PYTHONLEGACYWINDOWSFSENCODING \ + PYTHONLEGACYWINDOWSSTDIO \ + PYTHONCOERCECLOCALE \ + PYTHONDEVMODE \ + PYTHONUTF8 \ + PYTHONWARNDEFAULTENCODING \ + PYTHONNODEBUGRANGES + +# https://docs.python.org/3/using/cmdline.html#debug-mode-variables +unexport \ + PYTHONTHREADDEBUG \ + PYTHONDUMPREFS \ + PYTHONDUMPREFSFILE + +HOST_PYTHON3_DIR:=$(STAGING_DIR_HOSTPKG) +HOST_PYTHON3_INC_DIR:=$(HOST_PYTHON3_DIR)/include/python$(PYTHON3_VERSION) +HOST_PYTHON3_LIB_DIR:=$(HOST_PYTHON3_DIR)/lib/python$(PYTHON3_VERSION) + +HOST_PYTHON3_PKG_DIR:=$(HOST_PYTHON3_DIR)/lib/python$(PYTHON3_VERSION)/site-packages + +HOST_PYTHON3_BIN:=$(HOST_PYTHON3_DIR)/bin/python$(PYTHON3_VERSION) + +HOST_PYTHON3PATH:=$(HOST_PYTHON3_LIB_DIR):$(HOST_PYTHON3_PKG_DIR) + +HOST_PYTHON3_VARS = \ + ARCH="$(HOST_ARCH)" \ + CC="$(HOSTCC)" \ + CCSHARED="$(HOSTCC) $(HOST_FPIC)" \ + CXX="$(HOSTCXX)" \ + LD="$(HOSTCC)" \ + LDSHARED="$(HOSTCC) -shared" \ + CFLAGS="$(HOST_CFLAGS)" \ + CPPFLAGS="$(HOST_CPPFLAGS) -I$(HOST_PYTHON3_INC_DIR)" \ + LDFLAGS="$(HOST_LDFLAGS) -lpython$(PYTHON3_VERSION) -Wl$(comma)-rpath$(comma)$(STAGING_DIR_HOSTPKG)/lib" \ + $(CARGO_HOST_CONFIG_VARS) \ + SETUPTOOLS_RUST_CARGO_PROFILE="$(CARGO_HOST_PROFILE)" + +# $(1) => directory of python script +# $(2) => python script and its arguments +# $(3) => additional variables +define HostPython3/Run + cd "$(if $(strip $(1)),$(strip $(1)),.)" && \ + $(HOST_PYTHON3_VARS) \ + $(3) \ + $(HOST_PYTHON3_BIN) $(2) +endef + +# Note: I shamelessly copied this from Yousong's logic (from python-packages); +HOST_PYTHON3_PIP:=$(STAGING_DIR_HOSTPKG)/bin/pip$(PYTHON3_VERSION) + +HOST_PYTHON3_PIP_CACHE_DIR:=$(DL_DIR)/pip-cache + +HOST_PYTHON3_PIP_VARS:= \ + PIP_CACHE_DIR="$(HOST_PYTHON3_PIP_CACHE_DIR)" \ + PIP_CONFIG_FILE=/dev/null \ + PIP_DISABLE_PIP_VERSION_CHECK=1 + +# Multiple concurrent pip processes can lead to errors or unexpected results: https://github.com/pypa/pip/issues/2361 +# $(1) => packages to install +define HostPython3/PipInstall + $(call locked, \ + $(HOST_PYTHON3_VARS) \ + $(HOST_PYTHON3_PIP_VARS) \ + $(HOST_PYTHON3_PIP) \ + install \ + --no-binary :all: \ + --progress-bar off \ + --require-hashes \ + $(1) \ + $(if $(CONFIG_PYTHON3_HOST_PIP_CACHE_WORLD_READABLE), \ + && $(FIND) $(HOST_PYTHON3_PIP_CACHE_DIR) -not -type d -exec chmod go+r '{}' \; \ + && $(FIND) $(HOST_PYTHON3_PIP_CACHE_DIR) -type d -exec chmod go+rx '{}' \; \ + ), \ + pip \ + ) +endef diff --git a/general/python/python3-iperf3/Makefile b/general/python/python3-iperf3/Makefile new file mode 100644 index 00000000..3715fceb --- /dev/null +++ b/general/python/python3-iperf3/Makefile @@ -0,0 +1,33 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=python3-iperf3 +PKG_VERSION:=0.1.11 +PKG_RELEASE:=1 + +PYPI_NAME:=iperf3 +PKG_HASH:=d50eebbf2dcf445a173f98a82f9c433e0302d3dfb7987e1f21b86b35ef63ce26 + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Nick Hainke + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-iperf3 + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Python wrapper around iperf3. + URL:=https://github.com/thiezn/iperf3-python + DEPENDS:=+python3-light +python3-ctypes +libiperf3 +endef + +define Package/python3-iperf3/description + iperf3 for python provides a wrapper around the iperf3 utility. +endef + +$(eval $(call Py3Package,python3-iperf3)) +$(eval $(call BuildPackage,python3-iperf3)) +$(eval $(call BuildPackage,python3-iperf3-src)) diff --git a/general/python/python3-package.mk b/general/python/python3-package.mk new file mode 100644 index 00000000..3300f1be --- /dev/null +++ b/general/python/python3-package.mk @@ -0,0 +1,294 @@ +# +# Copyright (C) 2007-2016 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +# Note: include this file after `include $(TOPDIR)/rules.mk in your package Makefile + +python3_mk_path:=$(dir $(lastword $(MAKEFILE_LIST))) +include $(python3_mk_path)python3-host.mk + +PYTHON3_DIR:=$(STAGING_DIR)/usr +PYTHON3_INC_DIR:=$(PYTHON3_DIR)/include/python$(PYTHON3_VERSION) +PYTHON3_LIB_DIR:=$(PYTHON3_DIR)/lib/python$(PYTHON3_VERSION) + +PYTHON3_PKG_DIR:=/usr/lib/python$(PYTHON3_VERSION)/site-packages + +PYTHON3:=python$(PYTHON3_VERSION) + +PYTHON3PATH:=$(PYTHON3_LIB_DIR):$(STAGING_DIR)/$(PYTHON3_PKG_DIR):$(PKG_INSTALL_DIR)/$(PYTHON3_PKG_DIR) + +-include $(PYTHON3_LIB_DIR)/openwrt/Makefile-vars + +# These configure args are needed in detection of path to Python header files +# using autotools. +CONFIGURE_ARGS += \ + _python_sysroot="$(STAGING_DIR)" \ + _python_prefix="/usr" \ + _python_exec_prefix="/usr" + +PYTHON3_VARS = \ + CC="$(TARGET_CC)" \ + CCSHARED="$(TARGET_CC) $(FPIC)" \ + CXX="$(TARGET_CXX)" \ + LD="$(TARGET_CC)" \ + LDSHARED="$(TARGET_CC) -shared" \ + CFLAGS="$(TARGET_CFLAGS)" \ + CPPFLAGS="$(TARGET_CPPFLAGS) -I$(PYTHON3_INC_DIR)" \ + LDFLAGS="$(TARGET_LDFLAGS) -lpython$(PYTHON3_VERSION)" \ + _PYTHON_HOST_PLATFORM="$(_PYTHON_HOST_PLATFORM)" \ + _PYTHON_SYSCONFIGDATA_NAME="_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH)" \ + PYTHONPATH="$(PYTHON3PATH)" \ + PYTHONDONTWRITEBYTECODE=1 \ + _python_sysroot="$(STAGING_DIR)" \ + _python_prefix="/usr" \ + _python_exec_prefix="/usr" \ + $(CARGO_PKG_CONFIG_VARS) \ + PYO3_CROSS_LIB_DIR="$(PYTHON3_LIB_DIR)" \ + SETUPTOOLS_RUST_CARGO_PROFILE="$(CARGO_PKG_PROFILE)" + +# $(1) => directory of python script +# $(2) => python script and its arguments +# $(3) => additional variables +define Python3/Run + cd "$(if $(strip $(1)),$(strip $(1)),.)" && \ + $(PYTHON3_VARS) \ + $(3) \ + $(HOST_PYTHON3_BIN) $(2) +endef + +define Python3/FixShebang + $(SED) "1"'!'"b;s,^#"'!'".*python.*,#"'!'"/usr/bin/python3," -i --follow-symlinks $(1) +endef + +# default max recursion is 10 +PYTHON3_COMPILEALL_MAX_RECURSION_LEVEL:=20 + +# $(1) => directory of python source files to compile +# +# XXX [So that you won't goof as I did] +# Note: Yes, I tried to use the -O & -OO flags here. +# However the generated byte-codes were not portable. +# So, we just stuck to un-optimized byte-codes, +# which is still way better/faster than running +# Python sources all the time. +# +# Setting a fixed hash seed value is less secure than using +# random seed values, but is necessary for reproducible builds +# (for now). +# +# Should revisit this when https://bugs.python.org/issue37596 +# (and other related reproducibility issues) are fixed. +define Python3/CompileAll + $(call Python3/Run,, \ + -m compileall -r "$(PYTHON3_COMPILEALL_MAX_RECURSION_LEVEL)" -b -d '/' $(1), + $(if $(SOURCE_DATE_EPOCH),PYTHONHASHSEED="$(SOURCE_DATE_EPOCH)") + ) +endef + +# $(1) => target directory +define Python3/DeleteSourceFiles + $(FIND) $(1) -type f -name '*.py' -delete +endef + +# $(1) => target directory +define Python3/DeleteNonSourceFiles + $(FIND) $(1) -not -type d -not -name '*.py' -delete +endef + +# $(1) => target directory +define Python3/DeleteEmptyDirs + $(FIND) $(1) -mindepth 1 -empty -type d -not -path '$(1)/CONTROL' -not -path '$(1)/CONTROL/*' -delete +endef + + +# Py3Package + +define Py3Package/filespec/Default ++|$(PYTHON3_PKG_DIR) +endef + +# $(1) => package name +# $(2) => src directory +# $(3) => dest directory +define Py3Package/ProcessFilespec + $(eval $(call shexport,Py3Package/$(1)/filespec)) + $(SHELL) $(python3_mk_path)python-package-install.sh \ + "$(2)" "$(3)" "$$$$$(call shvar,Py3Package/$(1)/filespec)" +endef + +define Py3Package + define Package/$(1)-src + $(call Package/$(1)) + DEPENDS:= + CONFLICTS:= + PROVIDES:= + EXTRA_DEPENDS:= + TITLE+= (sources) + USERID:= + MENU:= + endef + + define Package/$(1)-src/description + $$(call Package/$(1)/description) + + This package contains the Python source files for $(1). + endef + + define Package/$(1)-src/config + depends on PACKAGE_$(1) + endef + + # Add default PyPackage filespec none defined + ifeq ($(origin Py3Package/$(1)/filespec),undefined) + Py3Package/$(1)/filespec=$$(Py3Package/filespec/Default) + endif + + ifndef Py3Package/$(1)/install + define Py3Package/$(1)/install + if [ -d $(PKG_INSTALL_DIR)/usr/bin ]; then \ + $(INSTALL_DIR) $$(1)/usr/bin ; \ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $$(1)/usr/bin/ ; \ + fi + endef + endif + + ifndef Package/$(1)/install + define Package/$(1)/install + $$(call Py3Package/$(1)/install,$$(1)) + $$(call Py3Package/ProcessFilespec,$(1),$(PKG_INSTALL_DIR),$$(1)) + $(FIND) $$(1) -name '*.exe' -delete + $$(call Python3/CompileAll,$$(1)) + $$(call Python3/DeleteSourceFiles,$$(1)) + $$(call Python3/DeleteEmptyDirs,$$(1)) + if [ -d "$$(1)/usr/bin" ]; then \ + $$(call Python3/FixShebang,$$(1)/usr/bin/*) ; \ + fi + endef + + define Package/$(1)-src/install + $$(call Py3Package/$(1)/install,$$(1)) + $$(call Py3Package/ProcessFilespec,$(1),$(PKG_INSTALL_DIR),$$(1)) + $$(call Python3/DeleteNonSourceFiles,$$(1)) + $$(call Python3/DeleteEmptyDirs,$$(1)) + endef + endif # Package/$(1)/install +endef + + +# Py3Build + +PYTHON3_PKG_BUILD?=1 +PYTHON3_PKG_FORCE_DISTUTILS_SETUP?= + +PYTHON3_PKG_SETUP_DIR?= +PYTHON3_PKG_SETUP_GLOBAL_ARGS?= +PYTHON3_PKG_SETUP_ARGS?=--single-version-externally-managed +PYTHON3_PKG_SETUP_VARS?= + +PYTHON3_PKG_BUILD_CONFIG_SETTINGS?= +PYTHON3_PKG_BUILD_VARS?=$(PYTHON3_PKG_SETUP_VARS) +PYTHON3_PKG_BUILD_ARGS?= +PYTHON3_PKG_BUILD_PATH?=$(PYTHON3_PKG_SETUP_DIR) + +PYTHON3_PKG_INSTALL_VARS?= + +PYTHON3_PKG_WHEEL_NAME?=$(subst -,_,$(if $(PYPI_SOURCE_NAME),$(PYPI_SOURCE_NAME),$(PKG_NAME))) +PYTHON3_PKG_WHEEL_VERSION?=$(PKG_VERSION) + +PYTHON3_PKG_BUILD_DIR?=$(PKG_BUILD_DIR)/$(PYTHON3_PKG_BUILD_PATH) + + +PYTHON3_PKG_HOST_PIP_INSTALL_ARGS = \ + $(foreach req,$(HOST_PYTHON3_PACKAGE_BUILD_DEPENDS), \ + --requirement \ + $(if $(findstring /,$(req)),$(req),$(python3_mk_path)host-pip-requirements/$(req).txt) \ + ) + +define Py3Build/FindStdlibDepends + $(SHELL) $(python3_mk_path)python3-find-stdlib-depends.sh -n "$(PKG_NAME)" "$(PKG_BUILD_DIR)"; +endef + +ifneq ($(strip $(PYPI_NAME)),) +define Py3Build/CheckHostPipVersionMatch + if [ -d "$(python3_mk_path)host-pip-requirements" ] && \ + [ -n "$$$$($(FIND) $(python3_mk_path)host-pip-requirements -maxdepth 1 -mindepth 1 -name '*.txt' -print -quit 2>/dev/null)" ]; then \ + if grep -q "$(PYPI_NAME)==" $(python3_mk_path)host-pip-requirements/*.txt ; then \ + if ! grep -q "$(PYPI_NAME)==$(PKG_VERSION)" $(python3_mk_path)host-pip-requirements/*.txt ; then \ + printf "\nPlease update version of $(PYPI_NAME) to $(PKG_VERSION) in 'host-pip-requirements'/\n\n" ; \ + exit 1 ; \ + fi \ + fi \ + fi +endef +endif + +define Py3Build/InstallBuildDepends + $(if $(PYTHON3_PKG_HOST_PIP_INSTALL_ARGS), \ + $(call HostPython3/PipInstall,$(PYTHON3_PKG_HOST_PIP_INSTALL_ARGS)) \ + ) +endef + +define Py3Build/Compile/Distutils + $(call Py3Build/InstallBuildDepends) + $(INSTALL_DIR) $(PKG_INSTALL_DIR)/$(PYTHON3_PKG_DIR) + $(call Python3/Run, \ + $(PKG_BUILD_DIR)/$(strip $(PYTHON3_PKG_SETUP_DIR)), \ + setup.py \ + $(PYTHON3_PKG_SETUP_GLOBAL_ARGS) \ + install \ + --prefix="/usr" \ + --root="$(PKG_INSTALL_DIR)" \ + $(PYTHON3_PKG_SETUP_ARGS) \ + , \ + $(PYTHON3_PKG_SETUP_VARS) \ + ) +endef + +define Py3Build/Compile/Default + $(call Py3Build/InstallBuildDepends) + $(call Python3/Run, \ + $(PKG_BUILD_DIR), \ + -m build \ + --no-isolation \ + --outdir "$(PYTHON3_PKG_BUILD_DIR)"/openwrt-build \ + --wheel \ + $(foreach setting,$(PYTHON3_PKG_BUILD_CONFIG_SETTINGS),--config-setting=$(setting)) \ + $(PYTHON3_PKG_BUILD_ARGS) \ + "$(PYTHON3_PKG_BUILD_DIR)" \ + , \ + $(PYTHON3_PKG_BUILD_VARS) \ + ) +endef + +define Py3Build/Install/Default + $(call Python3/Run, \ + $(PKG_BUILD_DIR), \ + -m installer \ + --destdir "$(PKG_INSTALL_DIR)" \ + --no-compile-bytecode \ + --prefix /usr \ + "$(PYTHON3_PKG_BUILD_DIR)"/openwrt-build/$(PYTHON3_PKG_WHEEL_NAME)-$(PYTHON3_PKG_WHEEL_VERSION)-*.whl \ + , \ + $(PYTHON3_PKG_INSTALL_VARS) \ + ) +endef + +Py3Build/Compile=$(Py3Build/Compile/Default) +Py3Build/Install=$(Py3Build/Install/Default) + +ifeq ($(strip $(PYTHON3_PKG_FORCE_DISTUTILS_SETUP)),1) + Py3Build/Compile=$(Py3Build/Compile/Distutils) + Py3Build/Install:=: +endif + +ifeq ($(strip $(PYTHON3_PKG_BUILD)),1) + ifeq ($(PY3),stdlib) + Hooks/Configure/Post+=Py3Build/FindStdlibDepends + endif + Hooks/Configure/Post+=Py3Build/CheckHostPipVersionMatch + Build/Compile=$(Py3Build/Compile) + Build/Install=$(Py3Build/Install) +endif diff --git a/general/python/python3-packages/Makefile b/general/python/python3-packages/Makefile new file mode 100644 index 00000000..2cde3792 --- /dev/null +++ b/general/python/python3-packages/Makefile @@ -0,0 +1,136 @@ +# +# Copyright (C) 2019 Yousong Zhou +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python3-packages +PKG_VERSION:=1.0 +PKG_RELEASE:=2 + +PKG_MAINTAINER:=Yousong Zhou + +# +# NOTE: move the host module installation to Host/Compile when +# HOST_CONFIG_DEPENDS is supported +# +# NOTE: PKG_CONFIG_DEPENDS cannot correctly track changes of string type config +# options, so you may want to do manual cleanup on config change. +# +PKG_CONFIG_DEPENDS:= \ + CONFIG_PACKAGE_python3-packages-list-host \ + CONFIG_PACKAGE_python3-packages-list \ + CONFIG_PACKAGE_python3-packages-list-cleanup \ + CONFIG_PACKAGE_python3-packages-envs \ + CONFIG_PACKAGE_python3-packages-extra-deps \ + CONFIG_PACKAGE_python3-packages-index-url \ + CONFIG_PACKAGE_python3-packages-pip-opts \ + +PKG_BUILD_DEPENDS:=python3 python3/host + +PYTHON3_PKG_BUILD:=0 + +include $(INCLUDE_DIR)/package.mk +include ../python3-host.mk +include ../python3-package.mk + +define Package/python3-packages + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=A dummy package for packaging python3 modules with pip + DEPENDS:=@DEVEL +python3 +endef + +define Package/python3-packages/config +if PACKAGE_python3-packages +config PACKAGE_python3-packages-list-host + string "List of python3 packages to install on host" +config PACKAGE_python3-packages-list + string "List of python3 packages to install on target" +config PACKAGE_python3-packages-list-cleanup + string "List of python3 packages to cleanup to avoid clash with existing packages" +config PACKAGE_python3-packages-envs + string "Extra environment variables to pass on to pip and its children on target build" +config PACKAGE_python3-packages-extra-deps + string "List of deps fulfilled but not tracked by the build system" +config PACKAGE_python3-packages-index-url + string "Index URL passed to pip with --index-url" +config PACKAGE_python3-packages-pip-opts + string "Additional arguments to pip command line" +endif +endef + +CONFIG_PACKAGE_python3-packages-list-host:=$(call qstrip,$(CONFIG_PACKAGE_python3-packages-list-host)) +CONFIG_PACKAGE_python3-packages-list:=$(call qstrip,$(CONFIG_PACKAGE_python3-packages-list)) +CONFIG_PACKAGE_python3-packages-list-cleanup:=$(call qstrip,$(CONFIG_PACKAGE_python3-packages-list-cleanup)) +CONFIG_PACKAGE_python3-packages-envs:=$(call qstrip,$(CONFIG_PACKAGE_python3-packages-envs)) +CONFIG_PACKAGE_python3-packages-extra-deps:=$(call qstrip,$(CONFIG_PACKAGE_python3-packages-extra-deps)) +CONFIG_PACKAGE_python3-packages-index-url:=$(call qstrip,$(CONFIG_PACKAGE_python3-packages-index-url)) +CONFIG_PACKAGE_python3-packages-pip-opts:=$(call qstrip,$(CONFIG_PACKAGE_python3-packages-pip-opts)) + +decr=$(word $(1),0 1 2 3 4 5 6 7 8 9 10) +recur=$(if $(subst 0,,$(2)),$(call recur,$(1),$(call decr,$(2)),$(call $(1)$(2),$(3))),$(3)) +_req2dir1=$(subst >,gt,$(1)) +_req2dir2=$(subst <,lt,$(1)) +_req2dir3=$(subst >=,geq,$(1)) +_req2dir4=$(subst <=,leq,$(1)) +_req2dir5=$(subst ://,:::,$(1)) +_req2dir6=$(subst *,_,$(1)) +_req2dir7=$(subst ?,_,$(1)) +req2dir=$(call recur,_req2dir,7,$(1)) + +# --ignore-installed, it may happen that host pip will ignore target install if +# it was already installed as host module, e.g. cffi deps of cryptograph +# +# --no-build-isolation, this is a new addition in pip3 and is needed when build +# depends on host modules +HOST_PYTHON3_PIP_INSTALL=$(HOST_PYTHON3_PIP) install \ + --root=$(1) \ + --prefix=$(2) \ + --ignore-installed \ + --no-build-isolation \ + --no-compile \ + $(if $(CONFIG_PACKAGE_python3-packages-index-url), --index-url "$(CONFIG_PACKAGE_python3-packages-index-url)") \ + $(if $(CONFIG_PACKAGE_python3-packages-pip-opts), $(CONFIG_PACKAGE_python3-packages-pip-opts)) \ + +HOST_PYTHON3_PIP_INSTALL_HOST:=$(call HOST_PYTHON3_PIP_INSTALL,$(STAGING_DIR_HOSTPKG),"") +HOST_PYTHON3_PIP_INSTALL_TARGET=$(call HOST_PYTHON3_PIP_INSTALL,$(PKG_INSTALL_DIR)/$(call req2dir,$(pkg)),/usr) +HOST_PYTHON3_PIP_INSTALL_CLEANUP:=$(call HOST_PYTHON3_PIP_INSTALL,$(PKG_INSTALL_DIR)/_cleanup,/usr) + +define Build/Compile + $(foreach pkg,$(CONFIG_PACKAGE_python3-packages-list-host), + $(call HostPython3/Run,,$(HOST_PYTHON3_PIP_INSTALL_HOST) $(pkg)) + ) + $(foreach pkg,$(CONFIG_PACKAGE_python3-packages-list), + $(call Python3/Run,,$(call HOST_PYTHON3_PIP_INSTALL_TARGET,$(pkg)) $(pkg),$(CONFIG_PACKAGE_python3-packages-envs)) + ) + $(foreach pkg,$(CONFIG_PACKAGE_python3-packages-list-cleanup), + $(call Python3/Run,,$(HOST_PYTHON3_PIP_INSTALL_CLEANUP) $(pkg),$(CONFIG_PACKAGE_python3-packages-envs)) + ) +endef + +define Package/python3-packages/install + $(foreach pkg,$(CONFIG_PACKAGE_python3-packages-list), + $(CP) "$(PKG_INSTALL_DIR)/$(call req2dir,$(pkg))"/* $(1) + ) + + find "$(PKG_INSTALL_DIR)/_cleanup" -mindepth 1 -depth | while read sf; do \ + tf="$$$${sf#$(PKG_INSTALL_DIR)/_cleanup/}"; \ + tf="$(1)/$$$$tf"; \ + if [ -f "$$$$tf" -o -L "$$$$tf" ]; then \ + rm -vf "$$$$tf"; \ + elif [ -d "$$$$tf" ]; then \ + rmdir -v -p "$$$$tf" || true; \ + fi \ + done +endef + +define Package/python3-packages/extra_provides + echo $(CONFIG_PACKAGE_python3-packages-extra-deps) | tr ' ' '\n' +endef + +$(eval $(call BuildPackage,python3-packages)) diff --git a/general/python/python3-packages/README.md b/general/python/python3-packages/README.md new file mode 100644 index 00000000..01508bc9 --- /dev/null +++ b/general/python/python3-packages/README.md @@ -0,0 +1,72 @@ +This package allows users to package python3 modules without creating package +Makefiles for each individual module and their dependencies. It provides a +way making packaging python3 packages faster and may also facilitate the process +of developing Makefiles for new python3 packages + +This is a raw DEVEL only package. Using it may entails a lot of implementation +details and you may need to resolve target dependencies and package details on +your own + +- Third party python3 packages may depend on features not included in e.g. + python3-light +- Some python3 modules may require host install of another module to progress, + e.g. target cryptography requires host cffi +- Some python3 modules have external C library dependencies, e.g. pyOpenSSL + requires openssl libs +- Some packages may have an autoconf configure script whose arguments we + cannot control with pip and has to be passed on (hacked) by overriding some + environment variables + +## How it works + +1. Install host modules required for building target modules +2. Install each target module to separate directories +3. Install another copy of modules for cleanup purposes to make list of + installed files to be removed from target modules installed in step 2 + +Why should it be so + +1. Installing target cryptography requires host installation of cffi module +2. cryptography requires setuptools and pip will install its own copy with + --ignore-installed. When PACKAGE_python3-setuptools is also selected, opkg + will complain of data file clashes if it was not removed here. + +Pip will handle dependency requirements of python3 modules, but external +dependencies like c libraries has to be prepared by the build system. The +issue is that there is currently no way to express such dependencies, thus may +cause build failure, e.g. pycrypto requires the presence of libgmp to build +successfully. + +## Tips + +If something goes wrong, we can add additional arguments to pip command +line to check the detailed build process. Some useful arguments may be + +- -v, for verbose output. Repeat this option if the current level of + verbosity is not enough +- --no-clean, for preserving pip build dir on build failure + +## Examples + +tornado (python-only module) + + CONFIG_PACKAGE_python3-packages=y + CONFIG_PACKAGE_python3-packages-list="tornado==6.0.2" + +cryptography (requires installation of host modules and cleanup on target modules) + + CONFIG_PACKAGE_python3-packages=y + CONFIG_PACKAGE_python3-packages-list-host="cffi" + CONFIG_PACKAGE_python3-packages-list="cryptography" + CONFIG_PACKAGE_python3-packages-list-cleanup="setuptools" + +pycrypto 2.7a1 (python module with autoconf configure script; depends on +libgmp; broken wmmintrin.h). 2.6.1 does not work because of a flaw in +the setup.py hardcoding host include directory + + CONFIG_PACKAGE_libgmp=y + CONFIG_PACKAGE_python3-packages=y + CONFIG_PACKAGE_python3-packages-list="https://github.com/dlitz/pycrypto/archive/v2.7a1.tar.gz" + CONFIG_PACKAGE_python3-packages-envs="ac_cv_header_wmmintrin_h=no build_alias=$(GNU_HOST_NAME) host_alias=$(GNU_TARGET_NAME) target_alias=$(GNU_TARGET_NAME)" + CONFIG_PACKAGE_python3-packages-extra-deps="libgmp.so.10" + diff --git a/general/python/python3-pyinotify/Makefile b/general/python/python3-pyinotify/Makefile new file mode 100644 index 00000000..ea64bd71 --- /dev/null +++ b/general/python/python3-pyinotify/Makefile @@ -0,0 +1,40 @@ +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python3-pyinotify +PKG_VERSION:=0.9.6 +PKG_RELEASE:=1 + +PYPI_NAME:=pyinotify +PKG_HASH:=9c998a5d7606ca835065cdabc013ae6c66eb9ea76a00a1e3bc6e0cfe2b4f71f4 + +PKG_MAINTAINER:=Gerald Kerma +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=COPYING + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-pyinotify + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Linux filesystem events monitoring + URL:=https://github.com/seb-m/pyinotify + DEPENDS:= +python3-light \ + +python3-ctypes \ + +python3-logging +endef + +define Package/python3-pyinotify/description + Pyinotify is a Python module for monitoring filesystems changes. +endef + +$(eval $(call Py3Package,python3-pyinotify)) +$(eval $(call BuildPackage,python3-pyinotify)) +$(eval $(call BuildPackage,python3-pyinotify-src)) diff --git a/general/python/python3-speedtest-cli/Makefile b/general/python/python3-speedtest-cli/Makefile new file mode 100644 index 00000000..cc8b89bc --- /dev/null +++ b/general/python/python3-speedtest-cli/Makefile @@ -0,0 +1,34 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=python3-speedtest-cli +PKG_VERSION:=2.1.3 +PKG_RELEASE:=1 + +PYPI_NAME:=speedtest-cli +PKG_HASH:=5e2773233cedb5fa3d8120eb7f97bcc4974b5221b254d33ff16e2f1d413d90f0 + +PKG_MAINTAINER:=Jaymin Patel +PKG_LICENSE:=Apache-2.0 +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-speedtest-cli + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Command line interface for testing internet bandwidth using speedtest.net + URL:=https://github.com/sivel/speedtest-cli + DEPENDS:=+python3-light +python3-pkg-resources +python3-xml +python3-email \ + +python3-urllib +python3-codecs +python3-openssl +endef + +define Package/python3-speedtest-cli/description + Command line interface for testing internet bandwidth using speedtest.net +endef + +$(eval $(call Py3Package,python3-speedtest-cli)) +$(eval $(call BuildPackage,python3-speedtest-cli)) +$(eval $(call BuildPackage,python3-speedtest-cli-src)) diff --git a/general/python/python3-version.mk b/general/python/python3-version.mk new file mode 100644 index 00000000..555b1804 --- /dev/null +++ b/general/python/python3-version.mk @@ -0,0 +1,19 @@ +# +# Copyright (C) 2007-2016 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +# Note: keep in sync with setuptools & pip +PYTHON3_VERSION_MAJOR:=3 +PYTHON3_VERSION_MINOR:=11 +PYTHON3_VERSION_MICRO:=7 + +PYTHON3_VERSION:=$(PYTHON3_VERSION_MAJOR).$(PYTHON3_VERSION_MINOR) + +PYTHON3_SETUPTOOLS_PKG_RELEASE:=2 +PYTHON3_PIP_PKG_RELEASE:=1 + +PYTHON3_SETUPTOOLS_VERSION:=65.5.0 +PYTHON3_PIP_VERSION:=23.2.1 diff --git a/general/python/python3/Config-python3-light.in b/general/python/python3/Config-python3-light.in new file mode 100644 index 00000000..968c3472 --- /dev/null +++ b/general/python/python3/Config-python3-light.in @@ -0,0 +1,7 @@ +menu "Configuration" + +config PYTHON3_HOST_PIP_CACHE_WORLD_READABLE + bool "Ensure host pip cache is world-readable" + default n + +endmenu diff --git a/general/python/python3/Makefile b/general/python/python3/Makefile new file mode 100644 index 00000000..f34fc869 --- /dev/null +++ b/general/python/python3/Makefile @@ -0,0 +1,377 @@ +# +# Copyright (C) 2006-2016 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +# The file included below defines PYTHON3_VERSION +include ../python3-version.mk + +PKG_NAME:=python3 +PKG_RELEASE:=1 +PKG_VERSION:=$(PYTHON3_VERSION).$(PYTHON3_VERSION_MICRO) + +PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz +PKG_SOURCE_URL:=https://www.python.org/ftp/python/$(PKG_VERSION) +PKG_HASH:=18e1aa7e66ff3a58423d59ed22815a6954e53342122c45df20c96877c062b9b7 + +PKG_MAINTAINER:=Jeffery To +PKG_LICENSE:=Python-2.0.1 0BSD +PKG_LICENSE_FILES:=LICENSE Doc/copyright.rst Doc/license.rst Modules/_ctypes/darwin/LICENSE Modules/_ctypes/libffi_osx/LICENSE Modules/expat/COPYING +PKG_CPE_ID:=cpe:/a:python:python + +# This file provides the necsessary host build variables +include ../python3-host.mk + +# For Py3Package +PYTHON3_PKG_BUILD:=0 +include ../python3-package.mk + +PKG_FIXUP:=autoreconf +PKG_BUILD_PARALLEL:=1 +HOST_BUILD_PARALLEL:=1 +# LTO is handled here individually, see --with-lto below +# "no-lto" prevents CONFIG_USE_LTO to add additional and interfering flags +PKG_BUILD_FLAGS:=no-lto + +PKG_BUILD_DIR:=$(BUILD_DIR)/Python-$(PKG_VERSION) +HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/Python-$(PKG_VERSION) + +PKG_BUILD_DEPENDS:=bluez python3/host python-build/host python-installer/host python-wheel/host +HOST_BUILD_DEPENDS:=bzip2/host libffi/host + +include $(INCLUDE_DIR)/host-build.mk +include $(INCLUDE_DIR)/package.mk + +define Package/python3/Default + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=Python $(PYTHON3_VERSION) + URL:=https://www.python.org/ +endef + +define Package/python3/Default/description +Python is an interpreted, interactive, object-oriented programming +language. It incorporates modules, exceptions, dynamic typing, very high +level dynamic data types, and classes. It supports multiple programming +paradigms beyond object-oriented programming, such as procedural and +functional programming. Python combines remarkable power with very clear +syntax. It has interfaces to many system calls and libraries, as well as +to various window systems, and is extensible in C or C++. It is also +usable as an extension language for applications that need a +programmable interface. Finally, Python is portable: it runs on many +Unix variants including Linux and macOS, and on Windows. +endef + +define Package/libpython3 +$(call Package/python3/Default) + TITLE+= core library + DEPENDS:=+libpthread + ABI_VERSION:=$(PYTHON3_VERSION) +endef + +define Package/libpython3/description +$(call Package/python3/Default/description) + +This package contains only core Python library. +endef + +define Package/python3-base +$(call Package/python3/Default) + TITLE+= base interpreter + DEPENDS:=+libpython3 +endef + +define Package/python3-base/description +$(call Package/python3/Default/description) + +This package contains only the interpreter and the bare minimum for the +interpreter to start. +endef + +define Package/python3-light +$(call Package/python3/Default) + TITLE+= light installation + DEPENDS:=+python3-base +libbz2 +zlib +endef + +define Package/python3-light/config + source "$(SOURCE)/Config-python3-light.in" +endef + +define Package/python3-light/description +$(call Package/python3/Default/description) + +This package installs the base interpreter package and contains the most +commonly used parts of the standard library. +endef + +PYTHON3_LIB_FILES_DEL:= +PYTHON3_PACKAGES:= +PYTHON3_SO_SUFFIX:=cpython-$(PYTHON3_VERSION_MAJOR)$(PYTHON3_VERSION_MINOR)-*.so +PYTHON3_PACKAGES_DEPENDS:= +define Py3BasePackage + PYTHON3_PACKAGES+=$(1) + ifeq ($(3),) + PYTHON3_PACKAGES_DEPENDS+=$(1) + endif + PYTHON3_LIB_FILES_DEL+=$(2) + ifeq ($(2),) + Py3Package/$(1)/filespec= + else + define Py3Package/$(1)/filespec + $(foreach lib_file,$(2), + +|$(lib_file) + ) + endef + endif + Py3Package/$(1)/install?=: +endef + +include ./files/python3-package-*.mk + +define Package/python3 +$(call Package/python3/Default) + TITLE+= programming language + DEPENDS:=+python3-light $(foreach package,$(PYTHON3_PACKAGES_DEPENDS),+$(package)) +endef + +define Package/python3/description +$(call Package/python3/Default/description) + +This package installs almost all parts of the standard Python +installation. +endef + +# Set READELF here so that the exact same readelf program name can be +# replaced in _sysconfigdata_*.py (in Build/Install) +TARGET_CONFIGURE_OPTS+= \ + READELF="$(TARGET_CROSS)readelf" + +EXTRA_LDFLAGS+= \ + -L$(PKG_BUILD_DIR) \ + -L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib + +# Bypass configure tests for cross compilation +CONFIGURE_VARS += \ + ac_cv_buggy_getaddrinfo=no \ + ac_cv_file__dev_ptc=no \ + ac_cv_file__dev_ptmx=yes + +# Disable stdlib modules +# Check for a better way in the future: https://github.com/python/cpython/issues/98558 +CONFIGURE_VARS += \ + py_cv_module__tkinter=n/a \ + py_cv_module_nis=n/a + +# Workaround for hardfloat mips +# https://bugs.python.org/issue46265 +ifneq ($(findstring mips,$(CONFIG_ARCH)),) +ifeq ($(CONFIG_HAS_FPU),y) +CONFIGURE_VARS += \ + ax_cv_check_cflags___fno_semantic_interposition=no +endif +endif + +MAKE_VARS += \ + PYTHONSTRICTEXTENSIONBUILD=1 + +CONFIGURE_ARGS += \ + --enable-optimizations \ + --enable-shared \ + --disable-test-modules \ + --with-build-python \ + --with-system-ffi \ + --without-cxx-main \ + --without-ensurepip \ + $(if $(CONFIG_IPV6),--enable-ipv6) \ + $(if $(findstring mips,$(CONFIG_ARCH)),,--with-lto) + +define Build/Install + $(call Build/Install/Default,) + + $(SED) 's|$(TARGET_AR)|ar|g;s|$(TARGET_CROSS)readelf|readelf|g;s|$(TARGET_CC)|gcc|g;s|$(TARGET_CXX)|g++|g' \ + $(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON3_VERSION)/_sysconfigdata_*.py \ + $(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON3_VERSION)/config-$(PYTHON3_VERSION)-*/Makefile +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) \ + $(PKG_INSTALL_DIR)/usr/include/python$(PYTHON3_VERSION) \ + $(1)/usr/include/ + + $(INSTALL_DIR) $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON3_VERSION) \ + $(PKG_INSTALL_DIR)/usr/lib/libpython$(PYTHON3_VERSION).so* \ + $(1)/usr/lib/ + + $(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON3_VERSION)/openwrt + grep -E \ + '^(_PYTHON_HOST_PLATFORM|ABIFLAGS|MACHDEP|MULTIARCH)=' \ + $(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON3_VERSION)/config-$(PYTHON3_VERSION)-*/Makefile > \ + $(1)/usr/lib/python$(PYTHON3_VERSION)/openwrt/Makefile-vars + + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/python*.pc \ + $(1)/usr/lib/pkgconfig + + $(INSTALL_DIR) $(2)/bin + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/bin/python$(PYTHON3_VERSION)-config \ + $(2)/bin/ + $(SED) \ + 's|^prefix_real=.*$$$$|prefix_real="$(PYTHON3_DIR)"|' \ + $(2)/bin/python$(PYTHON3_VERSION)-config +endef + +PYTHON3_BASE_LIB_FILES:= \ + /usr/lib/python$(PYTHON3_VERSION)/encodings \ + /usr/lib/python$(PYTHON3_VERSION)/_collections_abc.py \ + /usr/lib/python$(PYTHON3_VERSION)/_sitebuiltins.py \ + /usr/lib/python$(PYTHON3_VERSION)/_sysconfigdata_*.py \ + /usr/lib/python$(PYTHON3_VERSION)/_weakrefset.py \ + /usr/lib/python$(PYTHON3_VERSION)/abc.py \ + /usr/lib/python$(PYTHON3_VERSION)/codecs.py \ + /usr/lib/python$(PYTHON3_VERSION)/genericpath.py \ + /usr/lib/python$(PYTHON3_VERSION)/io.py \ + /usr/lib/python$(PYTHON3_VERSION)/os.py \ + /usr/lib/python$(PYTHON3_VERSION)/posixpath.py \ + /usr/lib/python$(PYTHON3_VERSION)/site.py \ + /usr/lib/python$(PYTHON3_VERSION)/sysconfig.py \ + /usr/lib/python$(PYTHON3_VERSION)/stat.py + +PYTHON3_LIB_FILES_DEL+=$(PYTHON3_BASE_LIB_FILES) + +define Py3Package/python3-base/filespec ++|/usr/bin/python$(PYTHON3_VERSION) +$(foreach lib_file,$(PYTHON3_BASE_LIB_FILES), + +|$(lib_file) +) +endef + +define Py3Package/python3-light/filespec ++|/usr/lib/python$(PYTHON3_VERSION) +-|/usr/lib/python$(PYTHON3_VERSION)/distutils/cygwinccompiler.py +-|/usr/lib/python$(PYTHON3_VERSION)/idlelib +-|/usr/lib/python$(PYTHON3_VERSION)/tkinter +-|/usr/lib/python$(PYTHON3_VERSION)/turtledemo +-|/usr/lib/python$(PYTHON3_VERSION)/webbrowser.py +-|/usr/lib/python$(PYTHON3_VERSION)/_osx_support.py +$(foreach lib_file,$(filter /usr/lib/python$(PYTHON3_VERSION)/%,$(PYTHON3_LIB_FILES_DEL)), + -|$(lib_file) +) +endef + +define Package/libpython3/install + # Adding the lib-dynload folder (even just empty) suppresses 2 warnings when starting Python + $(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON3_VERSION)/lib-dynload/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpython$(PYTHON3_VERSION).so* $(1)/usr/lib/ +endef + +define Py3Package/python3-base/install + $(INSTALL_DIR) $(1)/usr/bin + $(LN) python$(PYTHON3_VERSION) $(1)/usr/bin/python3 + $(LN) python$(PYTHON3_VERSION) $(1)/usr/bin/python +endef + +Py3Package/python3-light/install:=: +Package/python3/install:=: + +# libuuid is provided by e2fsprogs and uuid/uuid.h is moved into +# $(STAGING_DIR_HOST)/include/e2fsprogs +HOST_CFLAGS += \ + -I$(STAGING_DIR_HOST)/include/e2fsprogs +HOST_CPPFLAGS += \ + -I$(STAGING_DIR_HOST)/include/e2fsprogs + +HOST_LDFLAGS += \ + -Wl$(comma)-rpath$(comma)$(STAGING_DIR_HOSTPKG)/lib + +ifeq ($(HOST_OS),Linux) +HOST_LDFLAGS += \ + -Wl,--no-as-needed -lrt +endif + +# Would be nice to be able to do this, but hosts are very fiddly +# HOST_MAKE_VARS += \ +# PYTHONSTRICTEXTENSIONBUILD=1 + +# Bypass configure test +HOST_CONFIGURE_VARS += \ + ac_cv_working_openssl_hashlib=yes + +ifeq ($(HOST_OS),Darwin) +HOST_CONFIGURE_VARS += \ + ac_cv_header_libintl_h=no +HOST_MAKE_VARS += \ + USE_PYTHON_CONFIG_PY=1 +endif + +HOST_CONFIGURE_ARGS += \ + --enable-optimizations \ + --disable-test-modules \ + --with-ensurepip=upgrade \ + --with-ssl-default-suites=openssl \ + --with-system-expat \ + --without-cxx-main + +define Host/Configure + $(SED) 's/^ENABLE_USER_SITE = None$$$$/ENABLE_USER_SITE = False/' $(HOST_BUILD_DIR)/Lib/site.py + $(call Host/Configure/Default) + ls $(HOST_BUILD_DIR)/Lib/ensurepip/_bundled/setuptools-$(PYTHON3_SETUPTOOLS_VERSION)-py3-none-any.whl + ls $(HOST_BUILD_DIR)/Lib/ensurepip/_bundled/pip-$(PYTHON3_PIP_VERSION)-py3-none-any.whl +endef + +define Host/Install + $(if $(wildcard $(HOST_PYTHON3_PKG_DIR)/.setuptools_installed_$(PYTHON3_SETUPTOOLS_VERSION)-$(PYTHON3_SETUPTOOLS_PKG_RELEASE)),, + rm -rf \ + $(HOST_PYTHON3_PKG_DIR)/pkg_resources \ + $(HOST_PYTHON3_PKG_DIR)/setuptools \ + $(HOST_PYTHON3_PKG_DIR)/setuptools-* \ + $(HOST_PYTHON3_PKG_DIR)/.setuptools-patched* \ + $(HOST_PYTHON3_PKG_DIR)/.setuptools_installed_* + ) + $(if $(wildcard $(HOST_PYTHON3_PKG_DIR)/.pip_installed_$(PYTHON3_PIP_VERSION)-$(PYTHON3_PIP_PKG_RELEASE)),, + rm -rf \ + $(HOST_PYTHON3_PKG_DIR)/pip \ + $(HOST_PYTHON3_PKG_DIR)/pip-* \ + $(HOST_PYTHON3_PKG_DIR)/.pip-patched* \ + $(HOST_PYTHON3_PKG_DIR)/.pip_installed_* + ) + $(call Host/Install/Default) + $(if $(wildcard $(HOST_PYTHON3_PKG_DIR)/.setuptools_installed_$(PYTHON3_SETUPTOOLS_VERSION)-$(PYTHON3_SETUPTOOLS_PKG_RELEASE)),, + $(call HostPatchDir,$(HOST_PYTHON3_PKG_DIR),./patches-host-setuptools,) + touch $(HOST_PYTHON3_PKG_DIR)/.setuptools_installed_$(PYTHON3_SETUPTOOLS_VERSION)-$(PYTHON3_SETUPTOOLS_PKG_RELEASE) + ) + $(if $(wildcard $(HOST_PYTHON3_PKG_DIR)/.pip_installed_$(PYTHON3_PIP_VERSION)-$(PYTHON3_PIP_PKG_RELEASE)),, + $(call HostPatchDir,$(HOST_PYTHON3_PKG_DIR),./patches-host-pip,) + touch $(HOST_PYTHON3_PKG_DIR)/.pip_installed_$(PYTHON3_PIP_VERSION)-$(PYTHON3_PIP_PKG_RELEASE) + ) +endef + +$(eval $(call HostBuild)) + +$(eval $(call BuildPackage,libpython3)) +$(eval $(call BuildPackage,python3)) + +$(eval $(call Py3Package,python3-base)) +$(eval $(call Py3Package,python3-light)) + +$(eval $(call BuildPackage,python3-base)) +$(eval $(call BuildPackage,python3-light)) + +$(eval $(call BuildPackage,python3-base-src)) +$(eval $(call BuildPackage,python3-light-src)) + +$(foreach package, $(PYTHON3_PACKAGES), \ + $(eval $(call Py3Package,$(package))) \ + $(eval $(call BuildPackage,$(package))) \ + $(eval $(call BuildPackage,$(package)-src)) \ +) diff --git a/general/python/python3/files/python3-package-asyncio.mk b/general/python/python3/files/python3-package-asyncio.mk new file mode 100644 index 00000000..c4c31394 --- /dev/null +++ b/general/python/python3/files/python3-package-asyncio.mk @@ -0,0 +1,22 @@ +# +# Copyright (C) 2006-2016 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python3-asyncio +$(call Package/python3/Default) + TITLE+= asyncio module + DEPENDS:=+python3-light +endef + +define Package/python3-asyncio/description +$(call Package/python3/Default/description) + +This package contains the asyncio module. +endef + +$(eval $(call Py3BasePackage,python3-asyncio, \ + /usr/lib/python$(PYTHON3_VERSION)/asyncio \ +)) diff --git a/general/python/python3/files/python3-package-cgi.mk b/general/python/python3/files/python3-package-cgi.mk new file mode 100644 index 00000000..e4bb110f --- /dev/null +++ b/general/python/python3/files/python3-package-cgi.mk @@ -0,0 +1,38 @@ +# +# Copyright (C) 2006-2017 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python3-cgi +$(call Package/python3/Default) + TITLE+= cgi module + DEPENDS:=+python3-light +python3-email +endef + +define Package/python3-cgitb +$(call Package/python3/Default) + TITLE+= cgitb module + DEPENDS:=+python3-light +python3-cgi +python3-pydoc +endef + +define Package/python3-cgi/description +$(call Package/python3/Default/description) + +This package contains the cgi module. +endef + +define Package/python3-cgitb/description +$(call Package/python3/Default/description) + +This package contains the cgitb module. +endef + +$(eval $(call Py3BasePackage,python3-cgi, \ + /usr/lib/python$(PYTHON3_VERSION)/cgi.py \ +)) + +$(eval $(call Py3BasePackage,python3-cgitb, \ + /usr/lib/python$(PYTHON3_VERSION)/cgitb.py \ +)) diff --git a/general/python/python3/files/python3-package-codecs.mk b/general/python/python3/files/python3-package-codecs.mk new file mode 100644 index 00000000..712cb28e --- /dev/null +++ b/general/python/python3/files/python3-package-codecs.mk @@ -0,0 +1,28 @@ +# +# Copyright (C) 2006-2016 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python3-codecs +$(call Package/python3/Default) + TITLE+= codecs/Unicode support + DEPENDS:=+python3-light +endef + +define Package/python3-codecs/description +$(call Package/python3/Default/description) + +This package contains codecs and Unicode support. +endef + +$(eval $(call Py3BasePackage,python3-codecs, \ + /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_codecs_cn.$(PYTHON3_SO_SUFFIX) \ + /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_codecs_hk.$(PYTHON3_SO_SUFFIX) \ + /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_codecs_iso2022.$(PYTHON3_SO_SUFFIX) \ + /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_codecs_jp.$(PYTHON3_SO_SUFFIX) \ + /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_codecs_kr.$(PYTHON3_SO_SUFFIX) \ + /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_codecs_tw.$(PYTHON3_SO_SUFFIX) \ + /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/unicodedata.$(PYTHON3_SO_SUFFIX) \ +)) diff --git a/general/python/python3/files/python3-package-ctypes.mk b/general/python/python3/files/python3-package-ctypes.mk new file mode 100644 index 00000000..bbd0aff3 --- /dev/null +++ b/general/python/python3/files/python3-package-ctypes.mk @@ -0,0 +1,23 @@ +# +# Copyright (C) 2006-2016 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python3-ctypes +$(call Package/python3/Default) + TITLE+= ctypes module + DEPENDS:=+python3-light +libffi +endef + +define Package/python3-ctypes/description +$(call Package/python3/Default/description) + +This package contains the ctypes module. +endef + +$(eval $(call Py3BasePackage,python3-ctypes, \ + /usr/lib/python$(PYTHON3_VERSION)/ctypes \ + /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_ctypes.$(PYTHON3_SO_SUFFIX) \ +)) diff --git a/general/python/python3/files/python3-package-dbm.mk b/general/python/python3/files/python3-package-dbm.mk new file mode 100644 index 00000000..3de584fc --- /dev/null +++ b/general/python/python3/files/python3-package-dbm.mk @@ -0,0 +1,24 @@ +# +# Copyright (C) 2006-2016 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python3-dbm +$(call Package/python3/Default) + TITLE+= dbm module + DEPENDS:=+python3-light +libgdbm +endef + +define Package/python3-dbm/description +$(call Package/python3/Default/description) + +This package contains the dbm module. +endef + +$(eval $(call Py3BasePackage,python3-dbm, \ + /usr/lib/python$(PYTHON3_VERSION)/dbm \ + /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_dbm.$(PYTHON3_SO_SUFFIX) \ + /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_gdbm.$(PYTHON3_SO_SUFFIX) \ +)) diff --git a/general/python/python3/files/python3-package-decimal.mk b/general/python/python3/files/python3-package-decimal.mk new file mode 100644 index 00000000..98f632b2 --- /dev/null +++ b/general/python/python3/files/python3-package-decimal.mk @@ -0,0 +1,23 @@ +# +# Copyright (C) 2006-2016 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python3-decimal +$(call Package/python3/Default) + TITLE+= decimal module + DEPENDS:=+python3-light +endef + +define Package/python3-decimal/description +$(call Package/python3/Default/description) + +This package contains the decimal module. +endef + +$(eval $(call Py3BasePackage,python3-decimal, \ + /usr/lib/python$(PYTHON3_VERSION)/decimal.py \ + /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_decimal.$(PYTHON3_SO_SUFFIX) \ +)) diff --git a/general/python/python3/files/python3-package-dev.mk b/general/python/python3/files/python3-package-dev.mk new file mode 100644 index 00000000..871fff9e --- /dev/null +++ b/general/python/python3/files/python3-package-dev.mk @@ -0,0 +1,35 @@ +# +# Copyright (C) 2006-2016 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python3-dev +$(call Package/python3/Default) + TITLE+= development files + DEPENDS:=+python3 +python3-lib2to3 +endef + +define Package/python3-dev/description +$(call Package/python3/Default/description) + +This package contains files for building Python modules, extending the +Python interpreter, or embedded Python in applications. +endef + +define Py3Package/python3-dev/install + $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/bin/python$(PYTHON3_VERSION)-config $(1)/usr/bin + $(LN) python$(PYTHON3_VERSION)-config $(1)/usr/bin/python3-config + $(LN) python$(PYTHON3_VERSION)-config $(1)/usr/bin/python-config + $(LN) python$(PYTHON3_VERSION)/config-$(PYTHON3_VERSION)/libpython$(PYTHON3_VERSION).a $(1)/usr/lib/ +endef + +$(eval $(call Py3BasePackage,python3-dev, \ + /usr/lib/python$(PYTHON3_VERSION)/config-$(PYTHON3_VERSION)-* \ + /usr/include/python$(PYTHON3_VERSION) \ + /usr/lib/pkgconfig \ + , \ + DO_NOT_ADD_TO_PACKAGE_DEPENDS \ +)) diff --git a/general/python/python3/files/python3-package-distutils.mk b/general/python/python3/files/python3-package-distutils.mk new file mode 100644 index 00000000..13a8f38c --- /dev/null +++ b/general/python/python3/files/python3-package-distutils.mk @@ -0,0 +1,22 @@ +# +# Copyright (C) 2006-2016 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python3-distutils +$(call Package/python3/Default) + TITLE+= distutils module + DEPENDS:=+python3-light +python3-email +endef + +define Package/python3-distutils/description +$(call Package/python3/Default/description) + +This package contains the distutils module. +endef + +$(eval $(call Py3BasePackage,python3-distutils, \ + /usr/lib/python$(PYTHON3_VERSION)/distutils \ +)) diff --git a/general/python/python3/files/python3-package-email.mk b/general/python/python3/files/python3-package-email.mk new file mode 100644 index 00000000..563f6f8a --- /dev/null +++ b/general/python/python3/files/python3-package-email.mk @@ -0,0 +1,22 @@ +# +# Copyright (C) 2006-2016 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python3-email +$(call Package/python3/Default) + TITLE+= email module + DEPENDS:=+python3-light +endef + +define Package/python3-email/description +$(call Package/python3/Default/description) + +This package contains the email module. +endef + +$(eval $(call Py3BasePackage,python3-email, \ + /usr/lib/python$(PYTHON3_VERSION)/email \ +)) diff --git a/general/python/python3/files/python3-package-lib2to3.mk b/general/python/python3/files/python3-package-lib2to3.mk new file mode 100644 index 00000000..c2aa84d1 --- /dev/null +++ b/general/python/python3/files/python3-package-lib2to3.mk @@ -0,0 +1,24 @@ +# +# Copyright (C) 2006-2016 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python3-lib2to3 +$(call Package/python3/Default) + TITLE+= lib2to3 module + DEPENDS:=+python3 +endef + +define Package/python3-lib2to3/description +$(call Package/python3/Default/description) + +This package contains the lib2to3 module. +endef + +$(eval $(call Py3BasePackage,python3-lib2to3, \ + /usr/lib/python$(PYTHON3_VERSION)/lib2to3 \ + , \ + DO_NOT_ADD_TO_PACKAGE_DEPENDS \ +)) diff --git a/general/python/python3/files/python3-package-logging.mk b/general/python/python3/files/python3-package-logging.mk new file mode 100644 index 00000000..7b770ded --- /dev/null +++ b/general/python/python3/files/python3-package-logging.mk @@ -0,0 +1,22 @@ +# +# Copyright (C) 2006-2016 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python3-logging +$(call Package/python3/Default) + TITLE+= logging module + DEPENDS:=+python3-light +endef + +define Package/python3-logging/description +$(call Package/python3/Default/description) + +This package contains the logging module. +endef + +$(eval $(call Py3BasePackage,python3-logging, \ + /usr/lib/python$(PYTHON3_VERSION)/logging \ +)) diff --git a/general/python/python3/files/python3-package-lzma.mk b/general/python/python3/files/python3-package-lzma.mk new file mode 100644 index 00000000..0e984cb7 --- /dev/null +++ b/general/python/python3/files/python3-package-lzma.mk @@ -0,0 +1,23 @@ +# +# Copyright (C) 2006-2016 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python3-lzma +$(call Package/python3/Default) + TITLE+= lzma module + DEPENDS:=+python3-light +liblzma +endef + +define Package/python3-lzma/description +$(call Package/python3/Default/description) + +This package contains the lzma module. +endef + +$(eval $(call Py3BasePackage,python3-lzma, \ + /usr/lib/python$(PYTHON3_VERSION)/lzma.py \ + /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_lzma.$(PYTHON3_SO_SUFFIX) \ +)) diff --git a/general/python/python3/files/python3-package-multiprocessing.mk b/general/python/python3/files/python3-package-multiprocessing.mk new file mode 100644 index 00000000..7f9b69a4 --- /dev/null +++ b/general/python/python3/files/python3-package-multiprocessing.mk @@ -0,0 +1,23 @@ +# +# Copyright (C) 2006-2016 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python3-multiprocessing +$(call Package/python3/Default) + TITLE+= multiprocessing module + DEPENDS:=+python3-light +endef + +define Package/python3-multiprocessing/description +$(call Package/python3/Default/description) + +This package contains the multiprocessing module. +endef + +$(eval $(call Py3BasePackage,python3-multiprocessing, \ + /usr/lib/python$(PYTHON3_VERSION)/multiprocessing \ + /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_multiprocessing.$(PYTHON3_SO_SUFFIX) \ +)) diff --git a/general/python/python3/files/python3-package-ncurses.mk b/general/python/python3/files/python3-package-ncurses.mk new file mode 100644 index 00000000..5db04b82 --- /dev/null +++ b/general/python/python3/files/python3-package-ncurses.mk @@ -0,0 +1,24 @@ +# +# Copyright (C) 2006-2016 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python3-ncurses +$(call Package/python3/Default) + TITLE+= ncurses module + DEPENDS:=+python3-light +libncursesw +endef + +define Package/python3-ncurses/description +$(call Package/python3/Default/description) + +This package contains the ncurses module. +endef + +$(eval $(call Py3BasePackage,python3-ncurses, \ + /usr/lib/python$(PYTHON3_VERSION)/curses \ + /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_curses.$(PYTHON3_SO_SUFFIX) \ + /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_curses_panel.$(PYTHON3_SO_SUFFIX) \ +)) diff --git a/general/python/python3/files/python3-package-openssl.mk b/general/python/python3/files/python3-package-openssl.mk new file mode 100644 index 00000000..eec9daf8 --- /dev/null +++ b/general/python/python3/files/python3-package-openssl.mk @@ -0,0 +1,23 @@ +# +# Copyright (C) 2006-2016 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python3-openssl +$(call Package/python3/Default) + TITLE+= ssl module + DEPENDS:=+python3-light +libopenssl +ca-certs +endef + +define Package/python3-openssl/description +$(call Package/python3/Default/description) + +This package contains the ssl module. +endef + +$(eval $(call Py3BasePackage,python3-openssl, \ + /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_hashlib.$(PYTHON3_SO_SUFFIX) \ + /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_ssl.$(PYTHON3_SO_SUFFIX) \ +)) diff --git a/general/python/python3/files/python3-package-pydoc.mk b/general/python/python3/files/python3-package-pydoc.mk new file mode 100644 index 00000000..d5bbe7c3 --- /dev/null +++ b/general/python/python3/files/python3-package-pydoc.mk @@ -0,0 +1,24 @@ +# +# Copyright (C) 2006-2016 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python3-pydoc +$(call Package/python3/Default) + TITLE+= pydoc module + DEPENDS:=+python3-light +endef + +define Package/python3-pydoc/description +$(call Package/python3/Default/description) + +This package contains the pydoc module. +endef + +$(eval $(call Py3BasePackage,python3-pydoc, \ + /usr/lib/python$(PYTHON3_VERSION)/doctest.py \ + /usr/lib/python$(PYTHON3_VERSION)/pydoc.py \ + /usr/lib/python$(PYTHON3_VERSION)/pydoc_data \ +)) diff --git a/general/python/python3/files/python3-package-readline.mk b/general/python/python3/files/python3-package-readline.mk new file mode 100644 index 00000000..846b7116 --- /dev/null +++ b/general/python/python3/files/python3-package-readline.mk @@ -0,0 +1,22 @@ +# +# Copyright (C) 2021 Alexandru Ardelean +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python3-readline +$(call Package/python3/Default) + TITLE+= readline module + DEPENDS:=+python3-light +libreadline +endef + +define Package/python3-readline/description +$(call Package/python3/Default/description) + +This package contains the readline module. +endef + +$(eval $(call Py3BasePackage,python3-readline, \ + /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/readline.$(PYTHON3_SO_SUFFIX) \ +)) diff --git a/general/python/python3/files/python3-package-sqlite3.mk b/general/python/python3/files/python3-package-sqlite3.mk new file mode 100644 index 00000000..06f34be6 --- /dev/null +++ b/general/python/python3/files/python3-package-sqlite3.mk @@ -0,0 +1,23 @@ +# +# Copyright (C) 2006-2016 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python3-sqlite3 +$(call Package/python3/Default) + TITLE+= sqlite3 module + DEPENDS:=+python3-light +libsqlite3 +endef + +define Package/python3-sqlite3/description +$(call Package/python3/Default/description) + +This package contains the sqlite3 module. +endef + +$(eval $(call Py3BasePackage,python3-sqlite3, \ + /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_sqlite3.$(PYTHON3_SO_SUFFIX) \ + /usr/lib/python$(PYTHON3_VERSION)/sqlite3 \ +)) diff --git a/general/python/python3/files/python3-package-unittest.mk b/general/python/python3/files/python3-package-unittest.mk new file mode 100644 index 00000000..eb5f09ec --- /dev/null +++ b/general/python/python3/files/python3-package-unittest.mk @@ -0,0 +1,22 @@ +# +# Copyright (C) 2006-2016 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python3-unittest +$(call Package/python3/Default) + TITLE+= unittest module + DEPENDS:=+python3-light +endef + +define Package/python3-unittest/description +$(call Package/python3/Default/description) + +This package contains the unittest module. +endef + +$(eval $(call Py3BasePackage,python3-unittest, \ + /usr/lib/python$(PYTHON3_VERSION)/unittest \ +)) diff --git a/general/python/python3/files/python3-package-urllib.mk b/general/python/python3/files/python3-package-urllib.mk new file mode 100644 index 00000000..e84e589d --- /dev/null +++ b/general/python/python3/files/python3-package-urllib.mk @@ -0,0 +1,22 @@ +# +# Copyright (C) 2019 Alexandru Ardelean +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python3-urllib +$(call Package/python3/Default) + TITLE+= URL handling modules + DEPENDS:=+python3-light +python3-email +endef + +define Package/python3-urllib/description +$(call Package/python3/Default/description) + +This package contains the URL handling modules. +endef + +$(eval $(call Py3BasePackage,python3-urllib, \ + /usr/lib/python$(PYTHON3_VERSION)/urllib \ +)) diff --git a/general/python/python3/files/python3-package-uuid.mk b/general/python/python3/files/python3-package-uuid.mk new file mode 100644 index 00000000..ae188738 --- /dev/null +++ b/general/python/python3/files/python3-package-uuid.mk @@ -0,0 +1,23 @@ +# +# Copyright (C) 2021 Alexandru Ardelean +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python3-uuid +$(call Package/python3/Default) + TITLE+= uuid module + DEPENDS:=+python3-light +libuuid +endef + +define Package/python3-uuid/description +$(call Package/python3/Default/description) + +This package contains the uuid module. +endef + +$(eval $(call Py3BasePackage,python3-uuid, \ + /usr/lib/python$(PYTHON3_VERSION)/uuid.py \ + /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_uuid.$(PYTHON3_SO_SUFFIX) \ +)) diff --git a/general/python/python3/files/python3-package-venv.mk b/general/python/python3/files/python3-package-venv.mk new file mode 100644 index 00000000..536c985f --- /dev/null +++ b/general/python/python3/files/python3-package-venv.mk @@ -0,0 +1,25 @@ +# +# Copyright (C) 2023 Jeffery To +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python3-venv +$(call Package/python3/Default) + TITLE+= venv module + DEPENDS:=+python3 +endef + +define Package/python3-venv/description +$(call Package/python3/Default/description) + +This package contains the venv module. +endef + +$(eval $(call Py3BasePackage,python3-venv, \ + /usr/lib/python$(PYTHON3_VERSION)/ensurepip \ + /usr/lib/python$(PYTHON3_VERSION)/venv \ + , \ + DO_NOT_ADD_TO_PACKAGE_DEPENDS \ +)) diff --git a/general/python/python3/files/python3-package-xml.mk b/general/python/python3/files/python3-package-xml.mk new file mode 100644 index 00000000..97669e5d --- /dev/null +++ b/general/python/python3/files/python3-package-xml.mk @@ -0,0 +1,25 @@ +# +# Copyright (C) 2006-2016 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python3-xml +$(call Package/python3/Default) + TITLE+= XML modules + DEPENDS:=+python3-light +python3-urllib +endef + +define Package/python3-xml/description +$(call Package/python3/Default/description) + +This package contains the XML modules. +endef + +$(eval $(call Py3BasePackage,python3-xml, \ + /usr/lib/python$(PYTHON3_VERSION)/xml \ + /usr/lib/python$(PYTHON3_VERSION)/xmlrpc \ + /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_elementtree.$(PYTHON3_SO_SUFFIX) \ + /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/pyexpat.$(PYTHON3_SO_SUFFIX) \ +)) diff --git a/general/python/python3/patches-host-pip/.gitkeep b/general/python/python3/patches-host-pip/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/general/python/python3/patches-host-setuptools/.gitkeep b/general/python/python3/patches-host-setuptools/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/general/python/python3/patches-host-setuptools/0001-Adjust-library-header-paths-for-cross-compilation.patch b/general/python/python3/patches-host-setuptools/0001-Adjust-library-header-paths-for-cross-compilation.patch new file mode 100644 index 00000000..06dbb431 --- /dev/null +++ b/general/python/python3/patches-host-setuptools/0001-Adjust-library-header-paths-for-cross-compilation.patch @@ -0,0 +1,38 @@ +From e359a7a3c4f9e70360a068bef19c95938fdacede Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Wed, 23 Dec 2015 11:33:14 +0100 +Subject: [PATCH] Adjust library/header paths for cross-compilation + +When cross-compiling third-party extensions, the get_python_inc() or +get_python_lib() can be called, to return the path to headers or +libraries. However, they use the sys.prefix of the host Python, which +returns incorrect paths when cross-compiling (paths pointing to host +headers and libraries). + +In order to fix this, we introduce the _python_sysroot, _python_prefix +and _python_exec_prefix variables, that allow to override these +values, and get correct header/library paths when cross-compiling +third-party Python modules. + +Signed-off-by: Thomas Petazzoni +[adapt for setuptools, rename environment variable, use fixed lib path] +Signed-off-by: Jeffery To +--- + Lib/distutils/command/build_ext.py | 5 ++++- + Lib/sysconfig.py | 15 +++++++++++---- + 2 files changed, 15 insertions(+), 5 deletions(-) + +--- a/setuptools/_distutils/command/build_ext.py ++++ b/setuptools/_distutils/command/build_ext.py +@@ -238,7 +238,10 @@ class build_ext(Command): + if sysconfig.get_config_var('Py_ENABLE_SHARED'): + if not sysconfig.python_build: + # building third party extensions +- self.library_dirs.append(sysconfig.get_config_var('LIBDIR')) ++ libdir = sysconfig.get_config_var('LIBDIR') ++ if 'STAGING_DIR' in os.environ: ++ libdir = os.environ.get('STAGING_DIR') + '/usr/lib' ++ self.library_dirs.append(libdir) + else: + # building python standard extensions + self.library_dirs.append('.') diff --git a/general/python/python3/patches/003-do-not-run-compileall.patch b/general/python/python3/patches/003-do-not-run-compileall.patch new file mode 100644 index 00000000..7c0044ff --- /dev/null +++ b/general/python/python3/patches/003-do-not-run-compileall.patch @@ -0,0 +1,18 @@ +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -2133,6 +2133,7 @@ libinstall: all $(srcdir)/Modules/xxmodu + $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \ + $(DESTDIR)$(LIBDEST)/distutils/tests ; \ + fi ++ifeq (1,) + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ + $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \ + -j0 -d $(LIBDEST) -f \ +@@ -2160,6 +2161,7 @@ libinstall: all $(srcdir)/Modules/xxmodu + $(PYTHON_FOR_BUILD) -Wi -OO $(DESTDIR)$(LIBDEST)/compileall.py \ + -j0 -d $(LIBDEST)/site-packages -f \ + -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages ++endif + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ + $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ diff --git a/general/python/python3/patches/004-do-not-write-bytes-codes.patch b/general/python/python3/patches/004-do-not-write-bytes-codes.patch new file mode 100644 index 00000000..6f01f9d8 --- /dev/null +++ b/general/python/python3/patches/004-do-not-write-bytes-codes.patch @@ -0,0 +1,11 @@ +--- a/Python/initconfig.c ++++ b/Python/initconfig.c +@@ -198,7 +198,7 @@ int Py_NoSiteFlag = 0; /* Suppress 'impo + int Py_BytesWarningFlag = 0; /* Warn on str(bytes) and str(buffer) */ + int Py_FrozenFlag = 0; /* Needed by getpath.c */ + int Py_IgnoreEnvironmentFlag = 0; /* e.g. PYTHONPATH, PYTHONHOME */ +-int Py_DontWriteBytecodeFlag = 0; /* Suppress writing bytecode files (*.pyc) */ ++int Py_DontWriteBytecodeFlag = 1; /* Suppress writing bytecode files (*.pyc) */ + int Py_NoUserSiteDirectory = 0; /* for -s and site.py */ + int Py_UnbufferedStdioFlag = 0; /* Unbuffered binary std{in,out,err} */ + int Py_HashRandomizationFlag = 0; /* for -R and PYTHONHASHSEED */ diff --git a/general/python/python3/patches/006-do-not-add-multiarch-local-paths.patch b/general/python/python3/patches/006-do-not-add-multiarch-local-paths.patch new file mode 100644 index 00000000..7b35eb7b --- /dev/null +++ b/general/python/python3/patches/006-do-not-add-multiarch-local-paths.patch @@ -0,0 +1,19 @@ +--- a/setup.py ++++ b/setup.py +@@ -843,16 +843,9 @@ class PyBuildExt(build_ext): + add_dir_to_list(dir_list, directory) + + def configure_compiler(self): +- # Ensure that /usr/local is always used, but the local build +- # directories (i.e. '.' and 'Include') must be first. See issue +- # 10520. +- if not CROSS_COMPILING: +- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') +- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') + # only change this for cross builds for 3.3, issues on Mageia + if CROSS_COMPILING: + self.add_cross_compiling_paths() +- self.add_multiarch_paths() + self.add_ldflags_cppflags() + + def init_inc_lib_dirs(self): diff --git a/general/python/python3/patches/008-distutils-use-python-sysroot.patch b/general/python/python3/patches/008-distutils-use-python-sysroot.patch new file mode 100644 index 00000000..c3e85629 --- /dev/null +++ b/general/python/python3/patches/008-distutils-use-python-sysroot.patch @@ -0,0 +1,60 @@ +From e359a7a3c4f9e70360a068bef19c95938fdacede Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Wed, 23 Dec 2015 11:33:14 +0100 +Subject: [PATCH] Adjust library/header paths for cross-compilation + +When cross-compiling third-party extensions, the get_python_inc() or +get_python_lib() can be called, to return the path to headers or +libraries. However, they use the sys.prefix of the host Python, which +returns incorrect paths when cross-compiling (paths pointing to host +headers and libraries). + +In order to fix this, we introduce the _python_sysroot, _python_prefix +and _python_exec_prefix variables, that allow to override these +values, and get correct header/library paths when cross-compiling +third-party Python modules. + +Signed-off-by: Thomas Petazzoni +--- + Lib/distutils/command/build_ext.py | 5 ++++- + Lib/sysconfig.py | 15 +++++++++++---- + 2 files changed, 15 insertions(+), 5 deletions(-) + +--- a/Lib/distutils/command/build_ext.py ++++ b/Lib/distutils/command/build_ext.py +@@ -234,7 +234,10 @@ class build_ext(Command): + if (sysconfig.get_config_var('Py_ENABLE_SHARED')): + if not sysconfig.python_build: + # building third party extensions +- self.library_dirs.append(sysconfig.get_config_var('LIBDIR')) ++ libdir = sysconfig.get_config_var('LIBDIR') ++ if "_python_sysroot" in os.environ: ++ libdir = os.environ.get("_python_sysroot") + libdir ++ self.library_dirs.append(libdir) + else: + # building python standard extensions + self.library_dirs.append('.') +--- a/Lib/sysconfig.py ++++ b/Lib/sysconfig.py +@@ -168,10 +168,17 @@ _SCHEME_KEYS = ('stdlib', 'platstdlib', + _PY_VERSION = sys.version.split()[0] + _PY_VERSION_SHORT = f'{sys.version_info[0]}.{sys.version_info[1]}' + _PY_VERSION_SHORT_NO_DOT = f'{sys.version_info[0]}{sys.version_info[1]}' +-_PREFIX = os.path.normpath(sys.prefix) +-_BASE_PREFIX = os.path.normpath(sys.base_prefix) +-_EXEC_PREFIX = os.path.normpath(sys.exec_prefix) +-_BASE_EXEC_PREFIX = os.path.normpath(sys.base_exec_prefix) ++if "_python_sysroot" in os.environ: ++ _sysroot=os.environ.get('_python_sysroot') ++ _PREFIX = os.path.normpath(_sysroot + os.environ.get('_python_prefix')) ++ _EXEC_PREFIX = os.path.normpath(_sysroot + os.environ.get('_python_exec_prefix')) ++ _BASE_PREFIX = _PREFIX ++ _BASE_EXEC_PREFIX = _EXEC_PREFIX ++else: ++ _PREFIX = os.path.normpath(sys.prefix) ++ _EXEC_PREFIX = os.path.normpath(sys.exec_prefix) ++ _BASE_PREFIX = os.path.normpath(sys.base_prefix) ++ _BASE_EXEC_PREFIX = os.path.normpath(sys.base_exec_prefix) + _CONFIG_VARS = None + _USER_BASE = None + diff --git a/general/python/python3/patches/024-musl-find_library.patch b/general/python/python3/patches/024-musl-find_library.patch new file mode 100644 index 00000000..f986a7a9 --- /dev/null +++ b/general/python/python3/patches/024-musl-find_library.patch @@ -0,0 +1,74 @@ +https://bugs.python.org/issue21622 + +Based on the patch from Alpine Linux +https://git.alpinelinux.org/aports/tree/main/python2/musl-find_library.patch + +--- a/Lib/ctypes/util.py ++++ b/Lib/ctypes/util.py +@@ -92,6 +92,8 @@ elif sys.platform.startswith("aix"): + elif os.name == "posix": + # Andreas Degert's find functions, using gcc, /sbin/ldconfig, objdump + import re, tempfile ++ from glob import glob ++ musl_ldso = glob('/lib/ld-musl-*.so.1') + + def _is_elf(filename): + "Return True if the given file is an ELF file" +@@ -265,6 +267,57 @@ elif os.name == "posix": + def find_library(name, is64 = False): + return _get_soname(_findLib_crle(name, is64) or _findLib_gcc(name)) + ++ elif musl_ldso and os.path.isfile(musl_ldso[0]): ++ ++ def _is_elf(filepath): ++ try: ++ with open(filepath, 'rb') as fh: ++ return fh.read(4) == b'\x7fELF' ++ except: ++ return False ++ ++ def find_library(name): ++ # absolute name? ++ if os.path.isabs(name): ++ if _is_elf(name): ++ return name ++ else: ++ return None ++ ++ # special case for unified standard libs ++ stdlibs = ['libcrypt.so', 'libdl.so', 'libm.so', 'libpthread.so', 'libresolv.so', 'librt.so', 'libutil.so', 'libxnet.so'] ++ if name in stdlibs: ++ name = 'libc.so' ++ elif ('lib' + name + '.so') in stdlibs: ++ name = 'c' ++ ++ paths = [] ++ # read path list from /etc/ld-musl-$(ARCH).path ++ path_list = musl_ldso[0].replace('/lib/', '/etc/').replace('.so.1', '.path') ++ try: ++ with open(path_list, 'r') as fh: ++ paths = [path for line in fh for path in line.rstrip('\n').split(':') if path] ++ except: ++ paths = [] ++ # default path list if /etc/ld-musl-$(ARCH).path is empty or does not exist ++ if not paths: ++ paths = ['/lib', '/usr/local/lib', '/usr/lib'] ++ ++ # prepend paths from LD_LIBRARY_PATH ++ if 'LD_LIBRARY_PATH' in os.environ: ++ paths = os.environ['LD_LIBRARY_PATH'].split(':') + paths ++ ++ for d in paths: ++ f = os.path.join(d, name) ++ if _is_elf(f): ++ return os.path.basename(f) ++ ++ prefix = os.path.join(d, 'lib'+name) ++ for suffix in ['.so', '.so.*']: ++ for f in glob('{0}{1}'.format(prefix, suffix)): ++ if _is_elf(f): ++ return os.path.basename(f) ++ + else: + + def _findSoname_ldconfig(name): diff --git a/general/python/python3/patches/025-choose-python-config-version.patch b/general/python/python3/patches/025-choose-python-config-version.patch new file mode 100644 index 00000000..3c74874c --- /dev/null +++ b/general/python/python3/patches/025-choose-python-config-version.patch @@ -0,0 +1,11 @@ +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -2178,7 +2178,7 @@ python-config: $(srcdir)/Misc/python-con + @ # On Darwin, always use the python version of the script, the shell + @ # version doesn't use the compiler customizations that are provided + @ # in python (_osx_support.py). +- @if test `uname -s` = Darwin; then \ ++ @if test "$(USE_PYTHON_CONFIG_PY)" = 1; then \ + cp python-config.py python-config; \ + fi + diff --git a/general/python/python3/patches/026-openssl-feature-flags.patch b/general/python/python3/patches/026-openssl-feature-flags.patch new file mode 100644 index 00000000..604f41d8 --- /dev/null +++ b/general/python/python3/patches/026-openssl-feature-flags.patch @@ -0,0 +1,65 @@ +--- a/Modules/_hashopenssl.c ++++ b/Modules/_hashopenssl.c +@@ -45,10 +45,18 @@ + + #define MUNCH_SIZE INT_MAX + ++#ifdef NID_id_scrypt + #define PY_OPENSSL_HAS_SCRYPT 1 ++#endif ++#ifdef NID_sha3_256 + #define PY_OPENSSL_HAS_SHA3 1 ++#endif ++#ifdef NID_shake256 + #define PY_OPENSSL_HAS_SHAKE 1 ++#endif ++#ifdef NID_blake2s256 + #define PY_OPENSSL_HAS_BLAKE2 1 ++#endif + + #if OPENSSL_VERSION_NUMBER >= 0x30000000L + #define PY_EVP_MD EVP_MD +@@ -120,19 +128,27 @@ static const py_hashentry_t py_hashes[] + PY_HASH_ENTRY(Py_hash_sha384, "SHA384", SN_sha384, NID_sha384), + PY_HASH_ENTRY(Py_hash_sha512, "SHA512", SN_sha512, NID_sha512), + /* truncated sha2 */ ++#ifdef NID_sha512_256 + PY_HASH_ENTRY(Py_hash_sha512_224, "SHA512_224", SN_sha512_224, NID_sha512_224), + PY_HASH_ENTRY(Py_hash_sha512_256, "SHA512_256", SN_sha512_256, NID_sha512_256), ++#endif + /* sha3 */ ++#ifdef PY_OPENSSL_HAS_SHA3 + PY_HASH_ENTRY(Py_hash_sha3_224, NULL, SN_sha3_224, NID_sha3_224), + PY_HASH_ENTRY(Py_hash_sha3_256, NULL, SN_sha3_256, NID_sha3_256), + PY_HASH_ENTRY(Py_hash_sha3_384, NULL, SN_sha3_384, NID_sha3_384), + PY_HASH_ENTRY(Py_hash_sha3_512, NULL, SN_sha3_512, NID_sha3_512), ++#endif + /* sha3 shake */ ++#ifdef PY_OPENSSL_HAS_SHAKE + PY_HASH_ENTRY(Py_hash_shake_128, NULL, SN_shake128, NID_shake128), + PY_HASH_ENTRY(Py_hash_shake_256, NULL, SN_shake256, NID_shake256), ++#endif + /* blake2 digest */ ++#ifdef PY_OPENSSL_HAS_BLAKE2 + PY_HASH_ENTRY(Py_hash_blake2s, "blake2s256", SN_blake2s256, NID_blake2s256), + PY_HASH_ENTRY(Py_hash_blake2b, "blake2b512", SN_blake2b512, NID_blake2b512), ++#endif + PY_HASH_ENTRY(NULL, NULL, NULL, 0), + }; + +@@ -874,11 +890,15 @@ py_evp_fromname(PyObject *module, const + goto exit; + } + ++#ifndef EVP_MD_FLAG_XOF ++ type = get_hashlib_state(module)->EVPtype; ++#else + if ((EVP_MD_flags(digest) & EVP_MD_FLAG_XOF) == EVP_MD_FLAG_XOF) { + type = get_hashlib_state(module)->EVPXOFtype; + } else { + type = get_hashlib_state(module)->EVPtype; + } ++#endif + + self = newEVPobject(type); + if (self == NULL) { diff --git a/general/python/python3/patches/100-gh-95855-Refactor-platform-triplet-detection-code-GH-107221.patch b/general/python/python3/patches/100-gh-95855-Refactor-platform-triplet-detection-code-GH-107221.patch new file mode 100644 index 00000000..8f1ae5bd --- /dev/null +++ b/general/python/python3/patches/100-gh-95855-Refactor-platform-triplet-detection-code-GH-107221.patch @@ -0,0 +1,476 @@ +From c163d7f0b67a568e9b64eeb9c1cbbaa127818596 Mon Sep 17 00:00:00 2001 +From: Jeffery To +Date: Thu, 24 Aug 2023 20:22:50 +0800 +Subject: [PATCH] gh-95855: Refactor platform triplet detection code, add + detection for MIPS soft float and musl libc (#107221) + +- Move platform triplet detection code into Misc/platform_triplet.c +- Refactor MIPS detection, use defined(__mips64) to detect MIPS64 +- Compute libc values in separate section +- Add detection for MIPS soft float +- Add detection for musl + +musl supports SPE with its soft-float ABI: +https://git.musl-libc.org/cgit/musl/commit/?id=7be59733d71ada3a32a98622507399253f1d5e48 + +Original patch by Christian Heimes. + +Co-authored-by: Christian Heimes +Co-authored-by: Erlend E. Aasland + +[omit news, changes to configure; adapt for Python 3.11] +Signed-off-by: Jeffery To +--- + ...3-07-25-02-30-00.gh-issue-95855.wA7rAf.rst | 2 + + Misc/platform_triplet.c | 255 ++++++++++++++++++ + configure | 192 +------------ + configure.ac | 192 +------------ + 4 files changed, 265 insertions(+), 376 deletions(-) + create mode 100644 Misc/NEWS.d/next/Build/2023-07-25-02-30-00.gh-issue-95855.wA7rAf.rst + create mode 100644 Misc/platform_triplet.c + +--- /dev/null ++++ b/Misc/platform_triplet.c +@@ -0,0 +1,255 @@ ++/* Detect platform triplet from builtin defines ++ * cc -E Misc/platform_triplet.c | grep '^PLATFORM_TRIPLET=' | tr -d ' ' ++ */ ++#undef bfin ++#undef cris ++#undef fr30 ++#undef linux ++#undef hppa ++#undef hpux ++#undef i386 ++#undef mips ++#undef powerpc ++#undef sparc ++#undef unix ++#if defined(__ANDROID__) ++ # Android is not a multiarch system. ++#elif defined(__linux__) ++/* ++ * BEGIN of Linux block ++ */ ++// Detect libc (based on config.guess) ++# include ++# if defined(__UCLIBC__) ++# error uclibc not supported ++# elif defined(__dietlibc__) ++# error dietlibc not supported ++# elif defined(__GLIBC__) ++# define LIBC gnu ++# define LIBC_X32 gnux32 ++# if defined(__ARM_PCS_VFP) ++# define LIBC_ARM gnueabihf ++# else ++# define LIBC_ARM gnueabi ++# endif ++# if defined(__loongarch__) ++# if defined(__loongarch_soft_float) ++# define LIBC_LA gnusf ++# elif defined(__loongarch_single_float) ++# define LIBC_LA gnuf32 ++# elif defined(__loongarch_double_float) ++# define LIBC_LA gnu ++# else ++# error unknown loongarch floating-point base abi ++# endif ++# endif ++# if defined(_MIPS_SIM) ++# if defined(__mips_hard_float) ++# if _MIPS_SIM == _ABIO32 ++# define LIBC_MIPS gnu ++# elif _MIPS_SIM == _ABIN32 ++# define LIBC_MIPS gnuabin32 ++# elif _MIPS_SIM == _ABI64 ++# define LIBC_MIPS gnuabi64 ++# else ++# error unknown mips sim value ++# endif ++# else ++# if _MIPS_SIM == _ABIO32 ++# define LIBC_MIPS gnusf ++# elif _MIPS_SIM == _ABIN32 ++# define LIBC_MIPS gnuabin32sf ++# elif _MIPS_SIM == _ABI64 ++# define LIBC_MIPS gnuabi64sf ++# else ++# error unknown mips sim value ++# endif ++# endif ++# endif ++# if defined(__SPE__) ++# define LIBC_PPC gnuspe ++# else ++# define LIBC_PPC gnu ++# endif ++# else ++// Heuristic to detect musl libc ++# include ++# ifdef __DEFINED_va_list ++# define LIBC musl ++# define LIBC_X32 muslx32 ++# if defined(__ARM_PCS_VFP) ++# define LIBC_ARM musleabihf ++# else ++# define LIBC_ARM musleabi ++# endif ++# if defined(__loongarch__) ++# if defined(__loongarch_soft_float) ++# define LIBC_LA muslsf ++# elif defined(__loongarch_single_float) ++# define LIBC_LA muslf32 ++# elif defined(__loongarch_double_float) ++# define LIBC_LA musl ++# else ++# error unknown loongarch floating-point base abi ++# endif ++# endif ++# if defined(_MIPS_SIM) ++# if defined(__mips_hard_float) ++# if _MIPS_SIM == _ABIO32 ++# define LIBC_MIPS musl ++# elif _MIPS_SIM == _ABIN32 ++# define LIBC_MIPS musln32 ++# elif _MIPS_SIM == _ABI64 ++# define LIBC_MIPS musl ++# else ++# error unknown mips sim value ++# endif ++# else ++# if _MIPS_SIM == _ABIO32 ++# define LIBC_MIPS muslsf ++# elif _MIPS_SIM == _ABIN32 ++# define LIBC_MIPS musln32sf ++# elif _MIPS_SIM == _ABI64 ++# define LIBC_MIPS muslsf ++# else ++# error unknown mips sim value ++# endif ++# endif ++# endif ++# if defined(_SOFT_FLOAT) || defined(__NO_FPRS__) ++# define LIBC_PPC muslsf ++# else ++# define LIBC_PPC musl ++# endif ++# else ++# error unknown libc ++# endif ++# endif ++ ++# if defined(__x86_64__) && defined(__LP64__) ++PLATFORM_TRIPLET=x86_64-linux-LIBC ++# elif defined(__x86_64__) && defined(__ILP32__) ++PLATFORM_TRIPLET=x86_64-linux-LIBC_X32 ++# elif defined(__i386__) ++PLATFORM_TRIPLET=i386-linux-LIBC ++# elif defined(__aarch64__) && defined(__AARCH64EL__) ++# if defined(__ILP32__) ++PLATFORM_TRIPLET=aarch64_ilp32-linux-LIBC ++# else ++PLATFORM_TRIPLET=aarch64-linux-LIBC ++# endif ++# elif defined(__aarch64__) && defined(__AARCH64EB__) ++# if defined(__ILP32__) ++PLATFORM_TRIPLET=aarch64_be_ilp32-linux-LIBC ++# else ++PLATFORM_TRIPLET=aarch64_be-linux-LIBC ++# endif ++# elif defined(__alpha__) ++PLATFORM_TRIPLET=alpha-linux-LIBC ++# elif defined(__ARM_EABI__) ++# if defined(__ARMEL__) ++PLATFORM_TRIPLET=arm-linux-LIBC_ARM ++# else ++PLATFORM_TRIPLET=armeb-linux-LIBC_ARM ++# endif ++# elif defined(__hppa__) ++PLATFORM_TRIPLET=hppa-linux-LIBC ++# elif defined(__ia64__) ++PLATFORM_TRIPLET=ia64-linux-LIBC ++# elif defined(__loongarch__) && defined(__loongarch_lp64) ++PLATFORM_TRIPLET=loongarch64-linux-LIBC_LA ++# elif defined(__m68k__) && !defined(__mcoldfire__) ++PLATFORM_TRIPLET=m68k-linux-LIBC ++# elif defined(__mips__) ++# if defined(__mips_isa_rev) && (__mips_isa_rev >=6) ++# if defined(_MIPSEL) && defined(__mips64) ++PLATFORM_TRIPLET=mipsisa64r6el-linux-LIBC_MIPS ++# elif defined(_MIPSEL) ++PLATFORM_TRIPLET=mipsisa32r6el-linux-LIBC_MIPS ++# elif defined(__mips64) ++PLATFORM_TRIPLET=mipsisa64r6-linux-LIBC_MIPS ++# else ++PLATFORM_TRIPLET=mipsisa32r6-linux-LIBC_MIPS ++# endif ++# else ++# if defined(_MIPSEL) && defined(__mips64) ++PLATFORM_TRIPLET=mips64el-linux-LIBC_MIPS ++# elif defined(_MIPSEL) ++PLATFORM_TRIPLET=mipsel-linux-LIBC_MIPS ++# elif defined(__mips64) ++PLATFORM_TRIPLET=mips64-linux-LIBC_MIPS ++# else ++PLATFORM_TRIPLET=mips-linux-LIBC_MIPS ++# endif ++# endif ++# elif defined(__or1k__) ++PLATFORM_TRIPLET=or1k-linux-LIBC ++# elif defined(__powerpc64__) ++# if defined(__LITTLE_ENDIAN__) ++PLATFORM_TRIPLET=powerpc64le-linux-LIBC ++# else ++PLATFORM_TRIPLET=powerpc64-linux-LIBC ++# endif ++# elif defined(__powerpc__) ++PLATFORM_TRIPLET=powerpc-linux-LIBC_PPC ++# elif defined(__s390x__) ++PLATFORM_TRIPLET=s390x-linux-LIBC ++# elif defined(__s390__) ++PLATFORM_TRIPLET=s390-linux-LIBC ++# elif defined(__sh__) && defined(__LITTLE_ENDIAN__) ++PLATFORM_TRIPLET=sh4-linux-LIBC ++# elif defined(__sparc__) && defined(__arch64__) ++PLATFORM_TRIPLET=sparc64-linux-LIBC ++# elif defined(__sparc__) ++PLATFORM_TRIPLET=sparc-linux-LIBC ++# elif defined(__riscv) ++# if __riscv_xlen == 32 ++PLATFORM_TRIPLET=riscv32-linux-LIBC ++# elif __riscv_xlen == 64 ++PLATFORM_TRIPLET=riscv64-linux-LIBC ++# else ++# error unknown platform triplet ++# endif ++# else ++# error unknown platform triplet ++# endif ++/* ++ * END of Linux block ++ */ ++#elif defined(__FreeBSD_kernel__) ++# if defined(__LP64__) ++PLATFORM_TRIPLET=x86_64-kfreebsd-gnu ++# elif defined(__i386__) ++PLATFORM_TRIPLET=i386-kfreebsd-gnu ++# else ++# error unknown platform triplet ++# endif ++#elif defined(__gnu_hurd__) ++PLATFORM_TRIPLET=i386-gnu ++#elif defined(__APPLE__) ++PLATFORM_TRIPLET=darwin ++#elif defined(__VXWORKS__) ++PLATFORM_TRIPLET=vxworks ++#elif defined(__wasm32__) ++# if defined(__EMSCRIPTEN__) ++PLATFORM_TRIPLET=wasm32-emscripten ++# elif defined(__wasi__) ++# if defined(_REENTRANT) ++PLATFORM_TRIPLET=wasm32-wasi-threads ++# else ++PLATFORM_TRIPLET=wasm32-wasi ++# endif ++# else ++# error unknown wasm32 platform ++# endif ++#elif defined(__wasm64__) ++# if defined(__EMSCRIPTEN__) ++PLATFORM_TRIPLET=wasm64-emscripten ++# elif defined(__wasi__) ++PLATFORM_TRIPLET=wasm64-wasi ++# else ++# error unknown wasm64 platform ++# endif ++#else ++# error unknown platform triplet ++#endif +--- a/configure.ac ++++ b/configure.ac +@@ -925,180 +925,14 @@ fi + + + AC_MSG_CHECKING([for the platform triplet based on compiler characteristics]) +-cat > conftest.c <=6) && defined(_MIPSEL) +-# if _MIPS_SIM == _ABIO32 +- mipsisa32r6el-linux-gnu +-# elif _MIPS_SIM == _ABIN32 +- mipsisa64r6el-linux-gnuabin32 +-# elif _MIPS_SIM == _ABI64 +- mipsisa64r6el-linux-gnuabi64 +-# else +-# error unknown platform triplet +-# endif +-# elif defined(__mips_hard_float) && defined(__mips_isa_rev) && (__mips_isa_rev >=6) +-# if _MIPS_SIM == _ABIO32 +- mipsisa32r6-linux-gnu +-# elif _MIPS_SIM == _ABIN32 +- mipsisa64r6-linux-gnuabin32 +-# elif _MIPS_SIM == _ABI64 +- mipsisa64r6-linux-gnuabi64 +-# else +-# error unknown platform triplet +-# endif +-# elif defined(__mips_hard_float) && defined(_MIPSEL) +-# if _MIPS_SIM == _ABIO32 +- mipsel-linux-gnu +-# elif _MIPS_SIM == _ABIN32 +- mips64el-linux-gnuabin32 +-# elif _MIPS_SIM == _ABI64 +- mips64el-linux-gnuabi64 +-# else +-# error unknown platform triplet +-# endif +-# elif defined(__mips_hard_float) +-# if _MIPS_SIM == _ABIO32 +- mips-linux-gnu +-# elif _MIPS_SIM == _ABIN32 +- mips64-linux-gnuabin32 +-# elif _MIPS_SIM == _ABI64 +- mips64-linux-gnuabi64 +-# else +-# error unknown platform triplet +-# endif +-# elif defined(__or1k__) +- or1k-linux-gnu +-# elif defined(__powerpc__) && defined(__SPE__) +- powerpc-linux-gnuspe +-# elif defined(__powerpc64__) +-# if defined(__LITTLE_ENDIAN__) +- powerpc64le-linux-gnu +-# else +- powerpc64-linux-gnu +-# endif +-# elif defined(__powerpc__) +- powerpc-linux-gnu +-# elif defined(__s390x__) +- s390x-linux-gnu +-# elif defined(__s390__) +- s390-linux-gnu +-# elif defined(__sh__) && defined(__LITTLE_ENDIAN__) +- sh4-linux-gnu +-# elif defined(__sparc__) && defined(__arch64__) +- sparc64-linux-gnu +-# elif defined(__sparc__) +- sparc-linux-gnu +-# elif defined(__riscv) +-# if __riscv_xlen == 32 +- riscv32-linux-gnu +-# elif __riscv_xlen == 64 +- riscv64-linux-gnu +-# else +-# error unknown platform triplet +-# endif +-# else +-# error unknown platform triplet +-# endif +-#elif defined(__FreeBSD_kernel__) +-# if defined(__LP64__) +- x86_64-kfreebsd-gnu +-# elif defined(__i386__) +- i386-kfreebsd-gnu +-# else +-# error unknown platform triplet +-# endif +-#elif defined(__gnu_hurd__) +- i386-gnu +-#elif defined(__APPLE__) +- darwin +-#elif defined(__VXWORKS__) +- vxworks +-#elif defined(__wasm32__) +-# if defined(__EMSCRIPTEN__) +- wasm32-emscripten +-# elif defined(__wasi__) +- wasm32-wasi +-# else +-# error unknown wasm32 platform +-# endif +-#elif defined(__wasm64__) +-# if defined(__EMSCRIPTEN__) +- wasm64-emscripten +-# elif defined(__wasi__) +- wasm64-wasi +-# else +-# error unknown wasm64 platform +-# endif +-#else +-# error unknown platform triplet +-#endif +- +-EOF +- +-if $CPP $CPPFLAGS conftest.c >conftest.out 2>/dev/null; then +- PLATFORM_TRIPLET=`grep -v '^#' conftest.out | grep -v '^ *$' | tr -d ' '` +- case "$build_os" in +- linux-musl*) +- PLATFORM_TRIPLET=`echo "$PLATFORM_TRIPLET" | sed 's/linux-gnu/linux-musl/'` +- ;; +- esac ++if $CPP $CPPFLAGS $srcdir/Misc/platform_triplet.c >conftest.out 2>/dev/null; then ++ PLATFORM_TRIPLET=`grep '^PLATFORM_TRIPLET=' conftest.out | tr -d ' '` ++ PLATFORM_TRIPLET="${PLATFORM_TRIPLET@%:@PLATFORM_TRIPLET=}" + AC_MSG_RESULT([$PLATFORM_TRIPLET]) + else + AC_MSG_RESULT([none]) + fi +-rm -f conftest.c conftest.out ++rm -f conftest.out + + AC_MSG_CHECKING([for multiarch]) + AS_CASE([$ac_sys_system], diff --git a/general/python/python3/test.sh b/general/python/python3/test.sh new file mode 100644 index 00000000..b45e6541 --- /dev/null +++ b/general/python/python3/test.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +case "$1" in +python3|python3-base|python3-light) + python3 --version | grep -Fx "Python $2" + ;; +esac diff --git a/general/python/text-unidecode/Makefile b/general/python/text-unidecode/Makefile new file mode 100644 index 00000000..89f7ef7c --- /dev/null +++ b/general/python/text-unidecode/Makefile @@ -0,0 +1,41 @@ +# +# Copyright (C) 2019 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-text-unidecode +PKG_VERSION:=1.3 +PKG_RELEASE:=2 + +PYPI_NAME:=text-unidecode +PKG_HASH:=bad6603bb14d279193107714b288be206cac565dfa49aa5b105294dd5c4aab93 + +PKG_LICENSE:=Artistic-1.0-cl8 +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Josef Schlehofer + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-text-unidecode + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=The most basic Text::Unidecode port + URL:=https://github.com/kmike/text-unidecode/ + DEPENDS:= \ + +python3-light +endef + +define Package/python3-text-unidecode/description +text-unidecode is the most basic port of the Text::Unidecode Perl library. +endef + +$(eval $(call Py3Package,python3-text-unidecode)) +$(eval $(call BuildPackage,python3-text-unidecode)) +$(eval $(call BuildPackage,python3-text-unidecode-src)) diff --git a/general/python/vobject/Makefile b/general/python/vobject/Makefile new file mode 100644 index 00000000..ebda4959 --- /dev/null +++ b/general/python/vobject/Makefile @@ -0,0 +1,34 @@ +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. + +include $(TOPDIR)/rules.mk + +PKG_NAME:=vobject +PKG_VERSION:=0.9.6.1 +PKG_RELEASE:=2 +PKG_LICENSE:=Apache-2.0 + +PYPI_NAME:=$(PKG_NAME) +PKG_HASH:=96512aec74b90abb71f6b53898dd7fe47300cc940104c4f79148f0671f790101 + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk + +include ../python3-package.mk + +define Package/python3-vobject + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=VObject + URL:=http://eventable.github.io/vobject/ + DEPENDS:=+python3 +python3-dateutil +endef + +define Package/python3-vobject/description + vCard and vCalendar support for Python +endef + +$(eval $(call Py3Package,python3-vobject)) +$(eval $(call BuildPackage,python3-vobject)) +$(eval $(call BuildPackage,python3-vobject-src)) diff --git a/general/qBittorrent/Makefile b/general/qBittorrent/Makefile index faee8a31..52b848f6 100644 --- a/general/qBittorrent/Makefile +++ b/general/qBittorrent/Makefile @@ -7,12 +7,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=qbittorrent -PKG_VERSION:=4.6.4 +PKG_VERSION:=4.6.5 PKG_RELEASE=1 PKG_SOURCE:=qBittorrent-release-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/qbittorrent/qBittorrent/tar.gz/release-$(PKG_VERSION)? -PKG_HASH:=5842eb2cc1745b72b090df562d35a7ec0a6469d898d411544808731578447e1d +PKG_HASH:=f330042fd0b27530b4a7b70b5d7ab356b2c9246393761df3b06891dc9dd8c106 PKG_BUILD_DIR:=$(BUILD_DIR)/qBittorrent-release-$(PKG_VERSION) diff --git a/general/qBittorrent/Makefile.qt6 b/general/qBittorrent/Makefile.qt6 index d8731e6d..09b9002c 100644 --- a/general/qBittorrent/Makefile.qt6 +++ b/general/qBittorrent/Makefile.qt6 @@ -7,12 +7,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=qbittorrent -PKG_VERSION:=4.6.4 +PKG_VERSION:=4.6.5 PKG_RELEASE=1 PKG_SOURCE:=qBittorrent-release-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/qbittorrent/qBittorrent/tar.gz/release-$(PKG_VERSION)? -PKG_HASH:=5842eb2cc1745b72b090df562d35a7ec0a6469d898d411544808731578447e1d +PKG_HASH:=f330042fd0b27530b4a7b70b5d7ab356b2c9246393761df3b06891dc9dd8c106 PKG_BUILD_DIR:=$(BUILD_DIR)/qBittorrent-release-$(PKG_VERSION) diff --git a/general/qtbase/Makefile b/general/qtbase/Makefile index 304715b5..ec9a750b 100644 --- a/general/qtbase/Makefile +++ b/general/qtbase/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=qt6base PKG_BASE:=6.7 -PKG_BUGFIX:=0 +PKG_BUGFIX:=2 PKG_VERSION:=$(PKG_BASE).$(PKG_BUGFIX) PKG_RELEASE:=1 @@ -17,7 +17,7 @@ PKG_SOURCE:=qtbase-everywhere-src-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://mirrors.tencent.com/qt/archive/qt/$(PKG_BASE)/$(PKG_VERSION)/submodules/ \ https://mirrors.aliyun.com/qt/archive/qt/$(PKG_BASE)/$(PKG_VERSION)/submodules/ \ http://download.qt-project.org/archive/qt/$(PKG_BASE)/$(PKG_VERSION)/submodules/ -PKG_HASH:=11b2e29e2e52fb0e3b453ea13bbe51a10fdff36e1c192d8868c5a40233b8b254 +PKG_HASH:=c5f22a5e10fb162895ded7de0963328e7307611c688487b5d152c9ee64767599 HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/qtbase-everywhere-src-$(PKG_VERSION) PKG_BUILD_DIR:=$(BUILD_DIR)/qtbase-everywhere-src-$(PKG_VERSION) @@ -30,6 +30,7 @@ PKG_CPE_ID:=cpe:/a:qt:qt PKG_BUILD_DEPENDS:=qtbase/host PKG_BUILD_PARALLEL:=1 PKG_USE_MIPS16:=0 +PKG_BUILD_FLAGS:=no-mips16 CMAKE_INSTALL:=1 include $(INCLUDE_DIR)/package.mk @@ -55,6 +56,7 @@ endef define Package/libQt6/install endef +TARGET_CFLAGS+= -I$(STAGING_DIR)/usr/include/libdrm ifdef CONFIG_USE_GLIBC ifeq ($(ARCH),x86_64) TARGET_LDFLAGS += -Wl,--sysroot=$(TOOLCHAIN_DIR) @@ -67,8 +69,10 @@ TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed -flto CMAKE_SHARED_LDFLAGS:=$(filter-out -Wl$(comma)-Bsymbolic-functions,$(CMAKE_SHARED_LDFLAGS)) CMAKE_HOST_OPTIONS+= \ + -DQT_FORCE_MIN_CMAKE_VERSION_FOR_BUILDING_QT=3.19 \ -DBUILD_SHARED_LIBS=OFF \ -DFEATURE_optimize_full=ON \ + -DFEATURE_glib=OFF \ -DFEATURE_zstd=OFF \ -DFEATURE_concurrent=OFF \ -DFEATURE_dbus=ON \ @@ -80,6 +84,8 @@ CMAKE_HOST_OPTIONS+= \ -DFEATURE_xml=ON CMAKE_OPTIONS+= \ + -DQT_FORCE_MIN_CMAKE_VERSION_FOR_BUILDING_QT=3.19 \ + -DQT_FORCE_MIN_CMAKE_VERSION_FOR_USING_QT=3.19 \ -DBUILD_SHARED_LIBS=ON \ -DCMAKE_SYSROOT=$(STAGING_DIR) \ -DQT_HOST_PATH=$(STAGING_DIR_HOSTPKG) \ diff --git a/general/qtbase/patches/010-marco.patch b/general/qtbase/patches/010-marco.patch index 0c742201..73625f57 100644 --- a/general/qtbase/patches/010-marco.patch +++ b/general/qtbase/patches/010-marco.patch @@ -1,8 +1,8 @@ --- a/src/corelib/plugin/qelfparser_p.cpp +++ b/src/corelib/plugin/qelfparser_p.cpp -@@ -374,7 +374,9 @@ - // list definitely not exhaustive! - case EM_NONE: d << ", no machine"; break; +@@ -386,7 +386,9 @@ Q_DECL_UNUSED Q_DECL_COLD_FUNCTION stati + case EM_ALPHA: d << ", Alpha"; break; + case EM_68K: d << ", MC68000"; break; case EM_ARM: d << ", ARM"; break; +#ifdef EM_AARCH64 case EM_AARCH64: d << ", AArch64"; break; diff --git a/general/qttools/Makefile b/general/qttools/Makefile index 08e4e327..f2fb56a5 100644 --- a/general/qttools/Makefile +++ b/general/qttools/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=qt6tools PKG_BASE:=6.7 -PKG_BUGFIX:=0 +PKG_BUGFIX:=2 PKG_VERSION:=$(PKG_BASE).$(PKG_BUGFIX) PKG_RELEASE:=1 @@ -17,7 +17,7 @@ PKG_SOURCE:=qttools-everywhere-src-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://mirrors.tencent.com/qt/archive/qt/$(PKG_BASE)/$(PKG_VERSION)/submodules/ \ https://mirrors.aliyun.com/qt/archive/qt/$(PKG_BASE)/$(PKG_VERSION)/submodules/ \ http://download.qt-project.org/archive/qt/$(PKG_BASE)/$(PKG_VERSION)/submodules/ -PKG_HASH:=c8da6b239e82fe1e23465cbf0936c0da5a334438d3fb433e19c503cbb1abee7b +PKG_HASH:=58e855ad1b2533094726c8a425766b63a04a0eede2ed85086860e54593aa4b2a HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/qttools-everywhere-src-$(PKG_VERSION) PKG_MAINTAINER:=Krypton Lee @@ -25,7 +25,7 @@ PKG_LICENSE:=LGPL-2.1 PKG_LICENSE_FILES:=COPYING PKG_CPE_ID:=cpe:/a:qt:qt -HOST_BUILD_DEPENDS:=qtbase/host libxml2/host +HOST_BUILD_DEPENDS:=qtbase/host HOST_BUILD_PARALLEL:=1 PKG_HOST_ONLY:=1 diff --git a/general/qttools/patches/010-no-clang.patch b/general/qttools/patches/010-no-clang.patch index 71f96991..674f25ec 100644 --- a/general/qttools/patches/010-no-clang.patch +++ b/general/qttools/patches/010-no-clang.patch @@ -1,6 +1,6 @@ --- a/configure.cmake +++ b/configure.cmake -@@ -14,7 +14,7 @@ +@@ -17,7 +17,7 @@ # Presumably because 6.0 ClangConfig.cmake files are not good enough? # In any case explicitly request a minimum version of 8.x for now, otherwise # building with CMake will fail at compilation time. diff --git a/general/qttools/patches/200-CMake-Re-enable-lupdate-lconvert-lrelease-in-no-gui-builds.patch b/general/qttools/patches/200-CMake-Re-enable-lupdate-lconvert-lrelease-in-no-gui-builds.patch new file mode 100644 index 00000000..8163c974 --- /dev/null +++ b/general/qttools/patches/200-CMake-Re-enable-lupdate-lconvert-lrelease-in-no-gui-builds.patch @@ -0,0 +1,48 @@ +From 8bb2a0c02b305f8ae8611e501fe7dd3d2b4468a6 Mon Sep 17 00:00:00 2001 +From: Joerg Bornemann +Date: Tue, 11 Jun 2024 10:47:18 +0200 +Subject: [PATCH] CMake: Re-enable lupdate/lconvert/lrelease in no-gui builds + +This reverts 8dba0e48a0f7d3487b318a74f80f2d8e59c320f9 which disabled the +'linguist' feature if the 'printsupport' feature wasn't available. +However, the 'linguist' feature controls not only the Qt Linguist +application but also the command line tools lupdate, lconvert, and +lrelease. In no-gui builds, which also disable printsupport, the command +line tools were unexpectedly missing. + +Fix the issue by extending the feature condition in +src/linguist/CMakeLists.txt. As drive-by, fix the FEATURE_png condition +that was still in QMake form from the initial conversion. + +Fixes: QTBUG-126189 +Task-number: QTBUG-125066 +Change-Id: I59ebb82fd5823165b307ffbc967d7fd89a071ede +Reviewed-by: Alexey Edelev +Reviewed-by: Alexandru Croitor +(cherry picked from commit 4be1823e4d459c89717e791ef27fd463ad04cb2b) +Reviewed-by: Qt Cherry-pick Bot +(cherry picked from commit aa9f8db49db2e7734c187445b8c3c56768f6e546) +--- + +--- a/configure.cmake ++++ b/configure.cmake +@@ -74,7 +74,6 @@ qt_feature("kmap2qmap" PRIVATE + qt_feature("linguist" PRIVATE + LABEL "Qt Linguist" + PURPOSE "Qt Linguist can be used by translator to translate text in Qt applications." +- CONDITION TARGET Qt::PrintSupport + ) + qt_feature("pixeltool" PRIVATE + LABEL "pixeltool" +--- a/src/linguist/CMakeLists.txt ++++ b/src/linguist/CMakeLists.txt +@@ -14,7 +14,8 @@ add_subdirectory(lrelease) + add_subdirectory(lrelease-pro) + add_subdirectory(lupdate) + add_subdirectory(lupdate-pro) +-if(QT_FEATURE_process AND QT_FEATURE_pushbutton AND QT_FEATURE_toolbutton AND TARGET Qt::Widgets AND NOT no-png) ++if(QT_FEATURE_process AND QT_FEATURE_pushbutton AND QT_FEATURE_toolbutton ++ AND QT_FEATURE_png AND QT_FEATURE_printsupport AND TARGET Qt::Widgets) + add_subdirectory(linguist) + endif() + diff --git a/general/shadowsocks-rust/Makefile b/general/shadowsocks-rust/Makefile index b0ebc98d..456eafcd 100644 --- a/general/shadowsocks-rust/Makefile +++ b/general/shadowsocks-rust/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=shadowsocks-rust -PKG_VERSION:=1.19.0 +PKG_VERSION:=1.20.1 PKG_RELEASE:=1 PKG_SOURCE_HEADER:=shadowsocks-v$(PKG_VERSION) @@ -21,29 +21,29 @@ endif ifeq ($(ARCH),aarch64) PKG_SOURCE:=$(PKG_SOURCE_HEADER).aarch64-$(PKG_SOURCE_BODY).$(PKG_SOURCE_FOOTER) - PKG_HASH:=c0ac84f0efdae92b19e72f5477438da5d2c835d3e0bf14a2b8dea0e0b6bcc064 + PKG_HASH:=8c0d0cd3b614888cd3ffcdf9e007ba8697aa6331f8433c90b0a3b2bc3eb37e8b else ifeq ($(ARCH),arm) # Referred to golang/golang-values.mk ARM_CPU_FEATURES:=$(word 2,$(subst +,$(space),$(call qstrip,$(CONFIG_CPU_TYPE)))) ifeq ($(ARM_CPU_FEATURES),) PKG_SOURCE:=$(PKG_SOURCE_HEADER).arm-$(PKG_SOURCE_BODY)eabi.$(PKG_SOURCE_FOOTER) - PKG_HASH:=2d350f6d990cfd0f0af70ec889e77bf121f7a711129bb2ff7def926676cb90ee + PKG_HASH:=4c24eab26472dfb332ccbb5a8c15d6e1ecc4a857d915ffa853372bde55f0eeeb else PKG_SOURCE:=$(PKG_SOURCE_HEADER).arm-$(PKG_SOURCE_BODY)eabihf.$(PKG_SOURCE_FOOTER) - PKG_HASH:=da2ace727b75039aabc4ebff74bc1ade07ffd21e46d4239aa7537b8665f71d33 + PKG_HASH:=35044b469236cab55902c09074c9c05af2192e60eba327688685f0b97c0de5e7 endif else ifeq ($(ARCH),i386) PKG_SOURCE:=$(PKG_SOURCE_HEADER).i686-$(PKG_SOURCE_BODY).$(PKG_SOURCE_FOOTER) - PKG_HASH:=074ac1591be87ba846df962f895b0dd7b07120ef900a1fbfee86b40f8f13d93d + PKG_HASH:=0b6916aa85763764e3896b31900229503802f5d76d3bd35b341fa45bf87486f9 else ifeq ($(ARCH),x86_64) PKG_SOURCE:=$(PKG_SOURCE_HEADER).x86_64-$(PKG_SOURCE_BODY).$(PKG_SOURCE_FOOTER) - PKG_HASH:=b2321bd795db6fb71b3bc70da03e1dd6aa64d194ce3183ffda789e08329edfd1 + PKG_HASH:=41a8d242409e4f46f0588d5cecc8ea41b420978f83083ed52443544b5d71936f else ifeq ($(ARCH),mips) PKG_SOURCE:=$(PKG_SOURCE_HEADER).mips-$(PKG_SOURCE_BODY).$(PKG_SOURCE_FOOTER) - PKG_HASH:=e5ba11eb81c94d5376586df8ad05793cf87038c83c2b02a6a1fbd3aebd6aecf8 + PKG_HASH:=0d64790a2dad37ee43cc9847169a216f5611ce0a1f37d1be1babf968196e8288 else ifeq ($(ARCH),mipsel) PKG_SOURCE:=$(PKG_SOURCE_HEADER).mipsel-$(PKG_SOURCE_BODY).$(PKG_SOURCE_FOOTER) - PKG_HASH:=e735d637f3c2e57b1d102f1a0c64bc3688f59632b7aa946310d5338117e308fd + PKG_HASH:=8e101612fcc9db88336343a480d5e410ae0f89192c6847439d8131cccfc31943 # Set the default value to make OpenWrt Package Checker happy else PKG_SOURCE:=dummy diff --git a/general/sing-box/Makefile b/general/sing-box/Makefile index a1709e22..c33c5c8a 100644 --- a/general/sing-box/Makefile +++ b/general/sing-box/Makefile @@ -6,13 +6,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=sing-box -PKG_VERSION:=1.9.0 +PKG_VERSION:=1.9.3 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/SagerNet/sing-box/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=cb1d91e362f4dd7c35f7bb040514414861a045a76301af8257134c65f7a45c36 -PKG_GIT_COMMIT:=5ff7006326e8a876d33d92b26ebd2671cdd48b9f +PKG_HASH:=ab3d321860f973151e773c0c4a1478ab31ed63d89e17c7ac618cf50b232dd1c4 +PKG_GIT_COMMIT:=085f60337799afc906069b540a38368968c123e4 PKG_LICENSE:=GPL-3.0-or-later PKG_LICENSE_FILES:=LICENSE diff --git a/general/tailscale/Makefile b/general/tailscale/Makefile index 5bd7a5c0..95c7df3c 100644 --- a/general/tailscale/Makefile +++ b/general/tailscale/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=tailscale -PKG_VERSION:=1.66.4 +PKG_VERSION:=1.68.1 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/tailscale/tailscale/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=db94df254a263110439aa9d6cf6e1e64a5644b6e6e459ab5298ba6e478a988cf +PKG_HASH:=d7fe30282d2f5eabdc76a5a89f11d935ed3a5d93d55f5fd5b40f9a9f49e19490 PKG_MAINTAINER:=Jan Pavlinec PKG_LICENSE:=BSD-3-Clause diff --git a/general/uugamebooster/Makefile b/general/uugamebooster/Makefile new file mode 100644 index 00000000..49888804 --- /dev/null +++ b/general/uugamebooster/Makefile @@ -0,0 +1,85 @@ +# +# Copyright (C) 2021 KFERMercer +# +# This is free software, licensed under the GNU General Public License v3. +# + +# +# to get the latest version & md5 checksum: +# curl -L -s -k -H "Accept:text/plain" "http://router.uu.163.com/api/plugin?type=openwrt-$(UU_ARCH)" +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=uugamebooster +PKG_VERSION:=v6.3.10 +PKG_RELEASE:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/uugamebooster + SECTION:=net + CATEGORY:=Network + DEPENDS:=@(aarch64||arm||mipsel||x86_64) +kmod-tun + TITLE:=NetEase UU Game Booster + URL:=https://uu.163.com +endef + +define Package/uugamebooster/description + NetEase's UU Game Booster Accelerates Triple-A Gameplay and Market +endef + +ifeq ($(ARCH),arm) + UU_ARCH:=arm + PKG_MD5SUM:=633596a922256c2a5f8d9373620ea439 +endif + +ifeq ($(ARCH),aarch64) + UU_ARCH:=aarch64 + PKG_MD5SUM:=94538a4f40dca41f508a0a9cb5958163 +endif + +ifeq ($(ARCH),mipsel) + UU_ARCH:=mipsel + PKG_MD5SUM:=022c616f84bd1ed5466eb00193376ad5 +endif + +ifeq ($(ARCH),x86_64) + UU_ARCH:=x86_64 + PKG_MD5SUM:=17fb275fe666ec3d03ba3b41c2441156 +endif + +PKG_SOURCE_URL:=https://uu.gdl.netease.com/uuplugin/openwrt-$(UU_ARCH)/$(PKG_VERSION)/uu.tar.gz? +PKG_SOURCE:=$(PKG_NAME)-$(UU_ARCH)-$(PKG_VERSION).tar.gz + +STRIP:=true + +UNTAR_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/$(PKG_NAME)-$(UU_ARCH)-bin + +define Build/Prepare + mkdir -vp $(UNTAR_DIR) + tar -zxvf $(DL_DIR)/$(PKG_SOURCE) -C $(UNTAR_DIR) +endef + +define Build/Compile +endef + +define Package/uugamebooster/conffiles +/root/.uuplugin_uuid +endef + +define Package/uugamebooster/install + # $(INSTALL_DIR) $(1)/etc/init.d + # $(INSTALL_BIN) ./files/uugamebooster.init $(1)/etc/init.d/uuplugin + + $(INSTALL_DIR) $(1)/usr/share/uugamebooster + $(INSTALL_BIN) $(UNTAR_DIR)/uuplugin $(1)/usr/share/uugamebooster/uuplugin + $(INSTALL_CONF) $(UNTAR_DIR)/uu.conf $(1)/usr/share/uugamebooster/uu.conf + + # not finish yet: + # $(INSTALL_DIR) $(1)/usr/bin + # $(INSTALL_BIN) ./files/uugamebooster-update $(1)/usr/bin/uugamebooster + # $(LN) $(1)/usr/bin/uugamebooster/uugamebooster-update $(1)/usr/bin/uugamebooster-update +endef + +$(eval $(call BuildPackage,uugamebooster)) diff --git a/general/uugamebooster/files/uugamebooster-update b/general/uugamebooster/files/uugamebooster-update new file mode 100755 index 00000000..8e078058 --- /dev/null +++ b/general/uugamebooster/files/uugamebooster-update @@ -0,0 +1,18 @@ +#!/bin/sh + +# Return: 0 means update flag is set. +check_update() { + if [ -f "/usr/bin/uugamebooster/uu.update" ];then + return 0 + else + return 1 + fi +} + +check_update +if [ "$?" != "0" ];then + exit 0 + return +fi + +exit 0 diff --git a/general/xray-core/Makefile b/general/xray-core/Makefile index db20efad..0ad3893f 100644 --- a/general/xray-core/Makefile +++ b/general/xray-core/Makefile @@ -1,12 +1,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=Xray-core -PKG_VERSION:=1.8.13 +PKG_VERSION:=1.8.16 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/XTLS/Xray-core/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=9e63fbeb4667c19e286389c370d30e9e904f4421784adcbe6cf4d6e172a2ac29 +PKG_HASH:=61a96fba9ae18e91ea163f317a3641bca21fa744c214fb912270a3e6b7a8da6d PKG_MAINTAINER:=Tianling Shen PKG_LICENSE:=MPL-2.0 diff --git a/general/xray-plugin/Makefile b/general/xray-plugin/Makefile index 352e91e9..bf4061db 100644 --- a/general/xray-plugin/Makefile +++ b/general/xray-plugin/Makefile @@ -5,12 +5,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=xray-plugin -PKG_VERSION:=1.8.12 +PKG_VERSION:=1.8.15 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/teddysun/xray-plugin/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=dddc552e1d3616a93bd93082439f042c048833307eb009a4df97f336deac3346 +PKG_HASH:=0079b964dedfa1e5823cc8e8c75c0589875466d91aa1e13cb3683ba5cee0fae5 PKG_LICENSE:=MIT PKG_LICENSE_FILES:=LICENSE