summaryrefslogtreecommitdiffstats
path: root/recipes-extended/libvirt/libvirt/libvirt_api_xml_path.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-extended/libvirt/libvirt/libvirt_api_xml_path.patch')
-rw-r--r--recipes-extended/libvirt/libvirt/libvirt_api_xml_path.patch87
1 files changed, 0 insertions, 87 deletions
diff --git a/recipes-extended/libvirt/libvirt/libvirt_api_xml_path.patch b/recipes-extended/libvirt/libvirt/libvirt_api_xml_path.patch
deleted file mode 100644
index 30c30e88..00000000
--- a/recipes-extended/libvirt/libvirt/libvirt_api_xml_path.patch
+++ /dev/null
@@ -1,87 +0,0 @@
1Adding support for LIBVIRT_CFLAGS and LIBVIRT_LIBS
2
3Signed-off-by: Amy Fong <amy.fong@windriver.com>
4
5
6Adding a support for LIBVIRT_API_PATH evironment variable, which can
7control where the script should look for the 'libvirt-api.xml' file.
8This allows building libvirt-python against different libvirt than the
9one installed in the system. This may be used for example in autotest
10or by packagers without the need to install libvirt into the system.
11
12Signed-off-by: Martin Kletzander <mkletzan redhat com>
13[ywei: rebased to 1.3.2]
14Signed-off-by: Yunguo Wei <yunguo.wei@windriver.com>
15---
16 setup.py | 35 ++++++++++++++++++++++++-----------
17 1 file changed, 24 insertions(+), 11 deletions(-)
18
19diff --git a/setup.py b/setup.py
20index eff9d54..48ec4fe 100755
21--- a/setup.py
22+++ b/setup.py
23@@ -43,13 +43,7 @@ def check_minimum_libvirt_version():
24 "libvirt"])
25
26 def have_libvirt_lxc():
27- try:
28- spawn([get_pkgcfg(),
29- "--atleast-version=%s" % MIN_LIBVIRT_LXC,
30- "libvirt"])
31- return True
32- except DistutilsExecError:
33- return False
34+ return True
35
36 def have_libvirtaio():
37 # This depends on asyncio, which in turn depends on "yield from" syntax.
38@@ -77,7 +71,17 @@ def get_api_xml_files():
39 """Check with pkg-config that libvirt is present and extract
40 the API XML file paths we need from it"""
41
42- libvirt_api = get_pkgconfig_data(["--variable", "libvirt_api"], "libvirt")
43+ libvirt_api = os.getenv("LIBVIRT_API_PATH")
44+
45+ if libvirt_api:
46+ if not libvirt_api.endswith("-api.xml"):
47+ raise ValueError("Invalid path '%s' for API XML" % libvirt_api)
48+ if not os.path.exists(libvirt_api):
49+ raise ValueError("API XML '%s' does not exist, "
50+ "have you built libvirt?" % libvirt_api)
51+ else:
52+ libvirt_api = get_pkgconfig_data(["--variable", "libvirt_api"],
53+ "libvirt")
54
55 offset = libvirt_api.index("-api.xml")
56 libvirt_qemu_api = libvirt_api[0:offset] + "-qemu-api.xml"
57@@ -97,8 +101,17 @@ def get_module_lists():
58
59 c_modules = []
60 py_modules = []
61- ldflags = get_pkgconfig_data(["--libs-only-L"], "libvirt", False).split()
62- cflags = get_pkgconfig_data(["--cflags"], "libvirt", False).split()
63+ libvirt_cflags = os.getenv("LIBVIRT_CFLAGS")
64+ if libvirt_cflags:
65+ cflags = libvirt_cflags.split()
66+ else:
67+ cflags = get_pkgconfig_data(["--cflags"], "libvirt", False).split()
68+
69+ libvirt_libs = os.getenv("LIBVIRT_LIBS")
70+ if libvirt_libs:
71+ ldflags = libvirt_libs.split()
72+ else:
73+ ldflags = get_pkgconfig_data(["--libs-only-L"], "libvirt", False).split()
74
75 module = Extension('libvirtmod',
76 sources = ['libvirt-override.c', 'build/libvirt.c', 'typewrappers.c', 'libvirt-utils.c'],
77@@ -144,7 +157,7 @@ def get_module_lists():
78 class my_build(build):
79
80 def run(self):
81- check_minimum_libvirt_version()
82+# check_minimum_libvirt_version()
83 apis = get_api_xml_files()
84
85 self.spawn([sys.executable, "generator.py", "libvirt", apis[0]])
86--
872.17.0