forked from pool/python-dmidecode
- Add Makefile_libdir.patch to make package building even with
faulty distutils.sysconfig (bsc#1204395). OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-dmidecode?expand=0&rev=18
This commit is contained in:
44
Makefile_libdir.patch
Normal file
44
Makefile_libdir.patch
Normal file
@@ -0,0 +1,44 @@
|
||||
---
|
||||
Makefile | 3 ++-
|
||||
src/setup_common.py | 9 ++-------
|
||||
2 files changed, 4 insertions(+), 8 deletions(-)
|
||||
|
||||
--- 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
|
||||
--- a/src/setup_common.py
|
||||
+++ b/src/setup_common.py
|
||||
@@ -30,12 +30,7 @@ import subprocess, sys
|
||||
if sys.version_info[0] < 3:
|
||||
import commands as subprocess
|
||||
from os import path as os_path
|
||||
-try:
|
||||
- from distutils.sysconfig import get_python_lib, get_config_var
|
||||
- __python_lib = get_python_lib(1)
|
||||
-except ImportError:
|
||||
- from sysconfig import get_config_var, get_path
|
||||
- __python_lib = get_path('platlib')
|
||||
+from sysconfig import get_config_var, get_path
|
||||
|
||||
# libxml2 - C flags
|
||||
def libxml2_include(incdir):
|
||||
@@ -55,7 +50,7 @@ def libxml2_include(incdir):
|
||||
|
||||
# libxml2 - library flags
|
||||
def libxml2_lib(libdir, libs):
|
||||
- libdir.append(__python_lib)
|
||||
+ libdir.append(get_path('platlib'))
|
||||
if os_path.exists("/etc/debian_version"): #. XXX: Debian Workaround...
|
||||
libdir.append("/usr/lib/pymodules/python%d.%d"%sys.version_info[0:2])
|
||||
|
||||
Reference in New Issue
Block a user