mirror of
https://gitee.com/open-loongarch/buildroot-2024.08.git
synced 2026-10-28 05:57:13 +08:00
first commit: base 2024.08
Signed-off-by: maoxiaochuan <maoxiaochuan@loongson.cn>
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
From fd415a3613fad872062fb7cb4e271ac1476402ef Mon Sep 17 00:00:00 2001
|
||||
From: Adam Duskett <adam.duskett@amarulasolutions.com>
|
||||
Date: Tue, 24 Oct 2023 08:47:12 +0200
|
||||
Subject: [PATCH] use sysconfig.get_path instead of get_python_lib
|
||||
|
||||
Distutils has been removed from python 3.12.0. Use sysconfig.get_path instead
|
||||
of get_python_lib.
|
||||
|
||||
Upstream: https://github.com/ldx/python-iptables/pull/340
|
||||
|
||||
Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com>
|
||||
---
|
||||
iptc/util.py | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/iptc/util.py b/iptc/util.py
|
||||
index 04fe905..94befc5 100644
|
||||
--- a/iptc/util.py
|
||||
+++ b/iptc/util.py
|
||||
@@ -3,7 +3,7 @@ import os
|
||||
import sys
|
||||
import ctypes
|
||||
import ctypes.util
|
||||
-from distutils.sysconfig import get_python_lib
|
||||
+import sysconfig
|
||||
from itertools import product
|
||||
from subprocess import Popen, PIPE
|
||||
from sys import version_info
|
||||
@@ -64,7 +64,7 @@ def _do_find_library(name):
|
||||
|
||||
# probably we have been installed in a virtualenv
|
||||
try:
|
||||
- lib = ctypes.CDLL(os.path.join(get_python_lib(), name),
|
||||
+ lib = ctypes.CDLL(os.path.join(sysconfig.get_path("purelib"), name),
|
||||
mode=ctypes.RTLD_GLOBAL)
|
||||
return lib
|
||||
except:
|
||||
--
|
||||
2.41.0
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
config BR2_PACKAGE_PYTHON_IPTABLES
|
||||
bool "python-iptables"
|
||||
depends on !BR2_STATIC_LIBS
|
||||
select BR2_PACKAGE_IPTABLES
|
||||
help
|
||||
Python bindings for iptables.
|
||||
|
||||
https://github.com/ldx/python-iptables
|
||||
|
||||
comment "python-iptables needs a toolchain w/ dynamic library"
|
||||
depends on BR2_STATIC_LIBS
|
||||
@@ -0,0 +1,6 @@
|
||||
# md5, sha256 from https://pypi.org/pypi/python-iptables/json
|
||||
md5 bd6950c1ed9c6b48b7d552ff8e6766c5 python-iptables-1.0.1.tar.gz
|
||||
sha256 1989f2b48598392c3574052a95f456985cb06fb4287b61bf8794e93ebc37eddb python-iptables-1.0.1.tar.gz
|
||||
|
||||
# Locally calculated
|
||||
sha256 b827789c74144d9bb92595ed3bc568aef767a7e8d930fba61c2cdd9f6ec27599 NOTICE
|
||||
@@ -0,0 +1,23 @@
|
||||
################################################################################
|
||||
#
|
||||
# python-iptables
|
||||
#
|
||||
################################################################################
|
||||
|
||||
PYTHON_IPTABLES_VERSION = 1.0.1
|
||||
PYTHON_IPTABLES_SITE = https://files.pythonhosted.org/packages/35/e4/33e639b9e153c2d798d73342a96715a4edca6f46431d763b275a34b3aeca
|
||||
PYTHON_IPTABLES_SETUP_TYPE = setuptools
|
||||
PYTHON_IPTABLES_LICENSE = Apache-2.0
|
||||
PYTHON_IPTABLES_LICENSE_FILES = NOTICE
|
||||
PYTHON_IPTABLES_DEPENDENCIES = iptables
|
||||
|
||||
define PYTHON_IPTABLES_SET_XTABLES_ENV_VARS
|
||||
XTABLES_VERSION=`awk '/XTABLES_VERSION_CODE/ {print $$NF}' $(STAGING_DIR)/usr/include/xtables-version.h`; \
|
||||
sed -i "s%os.getenv(\"PYTHON_IPTABLES_XTABLES_VERSION\")%$$XTABLES_VERSION%" $(@D)/iptc/xtables.py
|
||||
sed -i "s%os.getenv(\"XTABLES_LIBDIR\")%\"/usr/lib/xtables\"%" $(@D)/iptc/xtables.py
|
||||
sed -i "s%os.environ.get('IPTABLES_LIBDIR', None)%\"/usr/lib\"%" $(@D)/iptc/util.py
|
||||
endef
|
||||
|
||||
PYTHON_IPTABLES_PRE_BUILD_HOOKS += PYTHON_IPTABLES_SET_XTABLES_ENV_VARS
|
||||
|
||||
$(eval $(python-package))
|
||||
Reference in New Issue
Block a user