2022-02-23 18:12:57 +00:00
|
|
|
---
|
2022-10-26 09:20:33 +00:00
|
|
|
Makefile | 3 ++-
|
|
|
|
|
src/setup_common.py | 9 ++++++---
|
|
|
|
|
2 files changed, 8 insertions(+), 4 deletions(-)
|
2022-02-23 18:12:57 +00:00
|
|
|
|
2022-10-26 09:20:33 +00:00
|
|
|
--- a/Makefile
|
|
|
|
|
+++ b/Makefile
|
|
|
|
|
@@ -42,9 +42,10 @@ PY_BIN := python3
|
|
|
|
|
VERSION := $(shell cd src;$(PY_BIN) -c "from setup_common import *; print(get_version());")
|
|
|
|
|
PACKAGE := python-dmidecode
|
|
|
|
|
PY_VER := $(shell $(PY_BIN) -c 'import sys; print("%d.%d"%sys.version_info[0:2])')
|
|
|
|
|
+PY_VER_DL := $(shell echo $(PY_VER) | tr -d '.')
|
|
|
|
|
PY_MV := $(shell echo $(PY_VER) | cut -b 1)
|
|
|
|
|
PY := python$(PY_VER)
|
|
|
|
|
-SO_PATH := build/lib.linux-$(shell uname -m)-$(PY_VER)
|
|
|
|
|
+SO_PATH := build/lib.linux-$(shell uname -m)-cpython-$(PY_VER_DL)
|
|
|
|
|
ifeq ($(PY_MV),2)
|
|
|
|
|
SO := $(SO_PATH)/dmidecodemod.so
|
|
|
|
|
else
|
2022-02-23 18:12:57 +00:00
|
|
|
--- a/src/setup_common.py
|
|
|
|
|
+++ b/src/setup_common.py
|
2022-10-26 09:20:33 +00:00
|
|
|
@@ -30,7 +30,7 @@ import subprocess, sys
|
2022-02-23 18:12:57 +00:00
|
|
|
if sys.version_info[0] < 3:
|
|
|
|
|
import commands as subprocess
|
|
|
|
|
from os import path as os_path
|
|
|
|
|
-from distutils.sysconfig import get_python_lib
|
2022-10-26 09:20:33 +00:00
|
|
|
+from sysconfig import get_config_var, get_path
|
2022-02-23 18:12:57 +00:00
|
|
|
|
|
|
|
|
# libxml2 - C flags
|
|
|
|
|
def libxml2_include(incdir):
|
2022-10-26 09:20:33 +00:00
|
|
|
@@ -50,7 +50,7 @@ def libxml2_include(incdir):
|
2022-05-20 15:07:30 +00:00
|
|
|
|
|
|
|
|
# libxml2 - library flags
|
|
|
|
|
def libxml2_lib(libdir, libs):
|
|
|
|
|
- libdir.append(get_python_lib(1))
|
2022-10-26 09:20:33 +00:00
|
|
|
+ libdir.append(get_path('platlib'))
|
2022-05-20 15:07:30 +00:00
|
|
|
if os_path.exists("/etc/debian_version"): #. XXX: Debian Workaround...
|
|
|
|
|
libdir.append("/usr/lib/pymodules/python%d.%d"%sys.version_info[0:2])
|
|
|
|
|
|
2022-10-26 09:20:33 +00:00
|
|
|
@@ -69,7 +69,10 @@ def libxml2_lib(libdir, libs):
|
2022-02-23 18:12:57 +00:00
|
|
|
libs.append(l.replace("-l", "", 1))
|
|
|
|
|
|
|
|
|
|
# this library is not reported and we need it anyway
|
|
|
|
|
- libs.append('xml2mod')
|
|
|
|
|
+ if get_config_var("SOABI"):
|
|
|
|
|
+ libs.append('xml2mod.%s' % get_config_var("SOABI"))
|
|
|
|
|
+ else:
|
|
|
|
|
+ libs.append('xml2mod')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|