diff --git a/detect-lib-with-py3.patch b/detect-lib-with-py3.patch index b98d3af..4b68c25 100644 --- a/detect-lib-with-py3.patch +++ b/detect-lib-with-py3.patch @@ -1,22 +1,38 @@ --- - Makefile | 3 ++- + Makefile | 10 ++++------ src/setup_common.py | 9 ++++++--- - 2 files changed, 8 insertions(+), 4 deletions(-) + 2 files changed, 10 insertions(+), 9 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 +@@ -44,12 +44,11 @@ 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 +- SO := $(SO_PATH)/dmidecodemod.so ++ SOLIB := dmidecodemod.so else + SOABI := $(shell $(PY_BIN) -c 'import sysconfig; print(sysconfig.get_config_var("SOABI"))') +- SO := $(SO_PATH)/dmidecodemod.$(SOABI).so ++ SOLIB := dmidecodemod.$(SOABI).so + endif + SHELL := /bin/bash + +@@ -59,10 +58,9 @@ SHELL := /bin/bash + all : build dmidump + + build: $(PY)-dmidecodemod.so +-$(PY)-dmidecodemod.so: $(SO) +- cp $< $@ +-$(SO): ++$(PY)-dmidecodemod.so: + $(PY) src/setup.py build ++ cp $$(find build -name $(SOLIB)) $@ + + dmidump : src/util.o src/efi.o src/dmilog.o + $(CC) -o $@ src/dmidump.c $^ -g -Wall -D_DMIDUMP_MAIN_ --- a/src/setup_common.py +++ b/src/setup_common.py @@ -30,7 +30,7 @@ import subprocess, sys diff --git a/python-dmidecode.changes b/python-dmidecode.changes index ca9b496..4607dc2 100644 --- a/python-dmidecode.changes +++ b/python-dmidecode.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Oct 26 15:51:25 UTC 2022 - Matej Cepl + +- Modify detect-lib-with-py3.patch to be more robust. + ------------------------------------------------------------------- Wed Oct 26 09:14:38 UTC 2022 - mcepl@cepl.eu