projects/guix·blob python-team · refs

140 lines · 4.3 KiB

1From e70dcd0a9f89efbdaa011c20737ad550635ea580 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= <[email protected]>
3Date: Tue, 20 Oct 2020 19:51:22 -0400
4Subject: [PATCH] rawudp-upnp test: Also build against new GUPnP 1.2 library if
5 present
6
7Update the configure test to match
8---
9 configure.ac | 17 +++++++++++++++++
10 tests/check/Makefile.am | 7 +++----
11 tests/check/transmitter/rawudp-upnp.c | 16 ++++++++++++++--
12 tests/check/transmitter/rawudp.c | 4 ++--
13 4 files changed, 36 insertions(+), 8 deletions(-)
14
15diff --git a/configure.ac b/configure.ac
16index 03afc96b..1efed132 100644
17--- a/configure.ac
18+++ b/configure.ac
19@@ -370,8 +370,25 @@ fi
20
21 if test "x$HAVE_GUPNP" = "xyes"; then
22 AC_DEFINE(HAVE_GUPNP,,[Have the GUPnP IGD library])
23+
24+ PKG_CHECK_MODULES(GUPNP_CORE, [ gupnp-1.2 ],
25+ [ HAVE_GUPNP_CORE_12=yes ],
26+ [ HAVE_GUPNP_CORE_12=no
27+ PKG_CHECK_MODULES(GUPNP_CORE, [ gupnp-1.0 ],
28+ [ HAVE_GUPNP_CORE_10=yes ],
29+ [ HAVE_GUPNP_CORE_10=no ])
30+ ])
31+
32+ if test "x$HAVE_GUPNP_CORE_10" = "xyes"; then
33+ AC_DEFINE(HAVE_GUPNP_CORE_10,,[Have the GUPnP 1.0 library])
34+ fi
35+
36+ if test "x$HAVE_GUPNP_CORE_12" = "xyes"; then
37+ AC_DEFINE(HAVE_GUPNP_CORE_12,,[Have the GUPnP 1.2 library])
38+ fi
39 fi
40
41+
42 dnl build static plugins or not
43 AC_MSG_CHECKING([whether to build static plugins or not])
44 AC_ARG_ENABLE(
45diff --git a/tests/check/Makefile.am b/tests/check/Makefile.am
46index d50fc264..d21687d7 100644
47--- a/tests/check/Makefile.am
48+++ b/tests/check/Makefile.am
49@@ -76,9 +76,9 @@ base_fscodec_SOURCES = \
50
51
52 transmitter_rawudp_CFLAGS = $(AM_CFLAGS) \
53- $(GUPNP_CFLAGS) $(GIO_CFLAGS) $(NICE_CFLAGS)
54+ $(GUPNP_CORE_CFLAGS) $(GIO_CFLAGS) $(NICE_CFLAGS)
55 transmitter_rawudp_LDADD = $(LDADD) \
56- $(GUPNP_LIBS) \
57+ $(GUPNP_CORE_LIBS) \
58 $(GIO_LIBS) \
59 $(NICE_LIBS)
60 transmitter_rawudp_SOURCES = \
61@@ -113,9 +113,8 @@ transmitter_nice_SOURCES = \
62 transmitter_nice_LDADD = $(LDADD) $(GST_BASE_LIBS)
63
64
65-transmitter_shm_CFLAGS = $(AM_CFLAGS) $(GUPNP_CFLAGS) $(NICE_CFLAGS)
66+transmitter_shm_CFLAGS = $(AM_CFLAGS) $(NICE_CFLAGS)
67 transmitter_shm_LDADD = $(LDADD) \
68- $(GUPNP_LIBS) \
69 $(NICE_LIBS)
70 transmitter_shm_SOURCES = \
71 check-threadsafe.h \
72diff --git a/tests/check/transmitter/rawudp-upnp.c b/tests/check/transmitter/rawudp-upnp.c
73index 4818cd28..9ccf85d8 100644
74--- a/tests/check/transmitter/rawudp-upnp.c
75+++ b/tests/check/transmitter/rawudp-upnp.c
76@@ -37,7 +37,7 @@ get_vars (gboolean *out_got_address,
77 }
78
79
80-#ifdef HAVE_GUPNP
81+#if defined(HAVE_GUPNP_CORE_10) || defined(HAVE_GUPNP_CORE_12)
82
83 #include <libgupnp/gupnp.h>
84
85@@ -126,8 +126,14 @@ start_upnp_server (void)
86 GUPnPDeviceInfo *subdev1;
87 GUPnPDeviceInfo *subdev2;
88 const gchar *upnp_xml_path;
89+ GError *gerr = NULL;
90
91- context = gupnp_context_new (NULL, NULL, 0, NULL);
92+#ifdef HAVE_GUPNP_CORE_12
93+ context = gupnp_context_new (NULL, 0, &gerr);
94+#else
95+ context = gupnp_context_new (NULL, NULL, 0, &gerr);
96+#endif
97+ g_assert_no_error (gerr);
98 ts_fail_if (context == NULL, "Can't get gupnp context");
99
100 if (g_getenv ("UPNP_XML_PATH"))
101@@ -137,8 +143,14 @@ start_upnp_server (void)
102
103 gupnp_context_host_path (context, upnp_xml_path, "");
104
105+#ifdef HAVE_GUPNP_CORE_12
106+ dev = gupnp_root_device_new (context, "InternetGatewayDevice.xml",
107+ upnp_xml_path, &gerr);
108+ g_assert_no_error (gerr);
109+#else
110 dev = gupnp_root_device_new (context, "InternetGatewayDevice.xml",
111 upnp_xml_path);
112+#endif
113 ts_fail_if (dev == NULL, "could not get root dev");
114
115 subdev1 = gupnp_device_info_get_device (GUPNP_DEVICE_INFO (dev),
116diff --git a/tests/check/transmitter/rawudp.c b/tests/check/transmitter/rawudp.c
117index e1936ac0..d803f347 100644
118--- a/tests/check/transmitter/rawudp.c
119+++ b/tests/check/transmitter/rawudp.c
120@@ -637,7 +637,7 @@ GST_START_TEST (test_rawudptransmitter_stop_stream)
121 }
122 GST_END_TEST;
123
124-#ifdef HAVE_GUPNP
125+#if defined(HAVE_GUPNP_CORE_10) || defined (HAVE_GUPNP_CORE_12)
126
127 GST_START_TEST (test_rawudptransmitter_run_upnp_discovery)
128 {
129@@ -967,7 +967,7 @@ rawudptransmitter_suite (void)
130 tcase_add_test (tc_chain, test_rawudptransmitter_stop_stream);
131 suite_add_tcase (s, tc_chain);
132
133-#ifdef HAVE_GUPNP
134+#if defined(HAVE_GUPNP_CORE_10) || defined (HAVE_GUPNP_CORE_12)
135 if (g_getenv ("UPNP")) {
136 gchar *multicast_addr;
137
138--
139GitLab
140