mirror of
https://github.com/openwrt/packages.git
synced 2026-10-12 18:57:35 +04:00
Add HOST_PYTHON3_PIP_VARS and --no-build-isolation to MAKE_VARS.
Without --no-build-isolation, pip creates an isolated build environment
which fails during cross-compilation because _sysconfigdata is missing.
Aligns with python-selinux which already has this fix.
The libsemanage pywrap uses the host Python's EXT_SUFFIX to name the
C extension, so we will use the PYCEXT env-var to correct that.
Add basic test.sh to verify the semanage Python bindings load correctly
in environments without SELinux kernel support.
Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
(cherry picked from commit acfafdaa03)
[keep version 3.8.1 from openwrt-25.12]
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
17 lines
604 B
Bash
Executable File
17 lines
604 B
Bash
Executable File
#!/bin/sh
|
|
|
|
[ "$1" = python3-semanage ] || exit 0
|
|
|
|
python3 - <<'EOF'
|
|
import semanage
|
|
|
|
# Verify the C extension loaded and key functions/constants are available
|
|
assert hasattr(semanage, 'semanage_handle_create'), "semanage_handle_create missing"
|
|
assert hasattr(semanage, 'SEMANAGE_CON_DIRECT'), "SEMANAGE_CON_DIRECT missing"
|
|
assert hasattr(semanage, 'SEMANAGE_CON_INVALID'), "SEMANAGE_CON_INVALID missing"
|
|
assert hasattr(semanage, 'SEMANAGE_FCONTEXT_ALL'), "SEMANAGE_FCONTEXT_ALL missing"
|
|
assert hasattr(semanage, 'SEMANAGE_FCONTEXT_REG'), "SEMANAGE_FCONTEXT_REG missing"
|
|
|
|
print("python3-semanage OK")
|
|
EOF
|