Package: python-dmidecode
Version: 3.12.2-3
Severity: serious
Tags: patch buster sid

python-libxml2 contains the following change:
-/usr/lib/python2.7/dist-packages/libxml2mod.so
+/usr/lib/python2.7/dist-packages/libxml2mod.x86_64-linux-gnu.so

This makes python-dmidecode FTBFS since it wants to link
dmidecodemod.x86_64-linux-gnu.so with libxml2mod:

x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions 
-Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall 
-Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g 
-fdebug-prefix-map=/build/python2.7-HVkOs2/python2.7-2.7.13=. 
-fstack-protector-strong -Wformat -Werror=format-security -Wl,-z,relro 
-std=gnu89 -Wdate-time -D_FORTIFY_SOURCE=2 
build/temp.linux-x86_64-2.7/src/dmidecodemodule.o 
build/temp.linux-x86_64-2.7/src/util.o build/temp.linux-x86_64-2.7/src/dmioem.o 
build/temp.linux-x86_64-2.7/src/dmidecode.o 
build/temp.linux-x86_64-2.7/src/dmixml.o 
build/temp.linux-x86_64-2.7/src/dmierror.o 
build/temp.linux-x86_64-2.7/src/dmilog.o 
build/temp.linux-x86_64-2.7/src/xmlpythonizer.o 
build/temp.linux-x86_64-2.7/src/efi.o build/temp.linux-x86_64-2.7/src/dmidump.o 
-L/usr/lib/python2.7/dist-packages -L/usr/lib/pymodules/python2.7 -lxml2 
-lxml2mod -o build/lib.linux-x86_64-2.7/dmidecodemod.so
/usr/bin/ld: cannot find -lxml2mod


The attached patch copies the two functions used from libxml2mod
instead of linking with libxml2mod.
Description: Stop linking with libxml2mod
 Copy the two funcions used instead of linking with libxml2mod.
Author: Adrian Bunk <b...@debian.org>

--- python-dmidecode-3.12.2.orig/src/dmidecodemodule.c
+++ python-dmidecode-3.12.2/src/dmidecodemodule.c
@@ -42,7 +42,6 @@
 #include <Python.h>
 
 #include <libxml/tree.h>
-#include "libxml_wrap.h"
 
 #include "dmidecodemodule.h"
 #include "dmixml.h"
@@ -64,6 +63,32 @@ char *PyUnicode_AsUTF8(PyObject *unicode
 }
 #endif
 
+static PyObject *
+libxml_xmlDocPtrWrap(xmlDocPtr doc)
+{
+    PyObject *ret;
+
+    if (doc == NULL) {
+        Py_INCREF(Py_None);
+        return (Py_None);
+    }
+    ret = PyCapsule_New((void *) doc, (char *) "xmlDocPtr", NULL);
+    return (ret);
+}
+
+static PyObject *
+libxml_xmlNodePtrWrap(xmlNodePtr node)
+{
+    PyObject *ret;
+
+    if (node == NULL) {
+        Py_INCREF(Py_None);
+        return (Py_None);
+    }
+    ret = PyCapsule_New((void *) node, (char *) "xmlNodePtr", NULL);
+    return (ret);
+}
+
 static void init(options *opt)
 {
         opt->devmem = DEFAULT_MEM_DEV;
--- python-dmidecode-3.12.2.orig/src/setup_common.py
+++ python-dmidecode-3.12.2/src/setup_common.py
@@ -68,9 +68,6 @@ def libxml2_lib(libdir, libs):
         elif l.find('-l') == 0:
             libs.append(l.replace("-l", "", 1))
 
-    # this library is not reported and we need it anyway
-    libs.append('xml2mod')
-
 
 
 # Get version from src/version.h

Reply via email to