15
0

- Modify detect-lib-with-py3.patch to be more robust.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-dmidecode?expand=0&rev=21
This commit is contained in:
2022-10-26 15:51:32 +00:00
committed by Git OBS Bridge
parent fbef7af84d
commit 83c674b8f9
2 changed files with 29 additions and 8 deletions

View File

@@ -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

View File

@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Wed Oct 26 15:51:25 UTC 2022 - Matej Cepl <mcepl@suse.com>
- Modify detect-lib-with-py3.patch to be more robust.
-------------------------------------------------------------------
Wed Oct 26 09:14:38 UTC 2022 - mcepl@cepl.eu