File: 0002-Stop-linking-with-libxml2mod.patch

package info (click to toggle)
python-dmidecode 3.12.3-5
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 952 kB
  • sloc: ansic: 7,962; xml: 744; python: 595; makefile: 85; sh: 68
file content (67 lines) | stat: -rw-r--r-- 1,446 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
From: Sandro Tosi <morph@debian.org>
Date: Tue, 5 Dec 2017 18:52:09 -0500
Subject: Stop linking with libxml2mod

Copy the two functions used instead of linking with libxml2mod.

Author: Adrian Bunk <bunk@debian.org>
---
 src/dmidecodemodule.c | 27 ++++++++++++++++++++++++++-
 src/setup_common.py   |  3 ---
 2 files changed, 26 insertions(+), 4 deletions(-)

--- a/src/dmidecodemodule.c
+++ b/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 @@
 }
 #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)
 {
 	int efi;
--- a/src/setup_common.py
+++ b/src/setup_common.py
@@ -68,9 +68,6 @@
         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