Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

caja-extension-sendto-upnp doesn't build with gupnp-1.2 #52

Closed
jonsger opened this issue Jul 18, 2019 · 1 comment · Fixed by #53
Closed

caja-extension-sendto-upnp doesn't build with gupnp-1.2 #52

jonsger opened this issue Jul 18, 2019 · 1 comment · Fixed by #53

Comments

@jonsger
Copy link
Contributor

jonsger commented Jul 18, 2019

On openSUSE Tumbleweed we only ship gupnp-1.2 (1.2.1), so no gupnp-1.0. So we can't build caja-extension-sendto-upnp out-of-the-box anymore.

I created the following patch to let it build again:

--- configure.ac
+++ configure.ac
@@ -196,7 +196,7 @@
             fi
             ;;
             upnp)
-                PKG_CHECK_MODULES(UPNP, gupnp-1.0 >= $GUPNP_REQUIRED,
+                PKG_CHECK_MODULES(UPNP, gupnp-1.2 >= $GUPNP_REQUIRED,
                     enable_upnp=yes, enable_upnp=no)
                 if test "${enable_upnp}" != "yes" ; then
                     sendto_plugin_error_or_ignore "you need gupnp installed to build the upnp plugin"
--- sendto/plugins/upnp/upnp.c
+++ sendto/plugins/upnp/upnp.c
@@ -206,7 +206,7 @@
                return FALSE;
        g_free (upload_cmd);
 
-       context_manager = gupnp_context_manager_new (NULL, 0);
+       context_manager = gupnp_context_manager_create (0);
        g_assert (context_manager != NULL);
        g_signal_connect (context_manager, "context-available",
                          G_CALLBACK (on_context_available), NULL);

Is this the right way to do it? Would you accept a proper PR, the configure.ac thing needs some more love.

@vkareh
Copy link
Member

vkareh commented Jul 29, 2019

@jonsger - gupnp 1.2 was tagged a few months ago, most distros won't have that available that quickly. The "proper" way (if there's such a thing) would be to have a conditional check in configure.ac that checks which version and set a variable like HAS_GUPNP_VERSION_1_2 or something, then in the code do something like this:

#ifdef HAS_GUPNP_VERSION_1_2
context_manager = gupnp_context_manager_create (0);
#else
context_manager = gupnp_context_manager_new (NULL, 0);
#endif

Please send a pull request and we can start testing. Alternatively, you can just distro-patch Tumbleweed, but then you'll need to maintain that extra configuration on your side...

jonsger added a commit to jonsger/caja-extensions that referenced this issue Jul 30, 2019
This fixes mate-desktop#52.

* (configure.ac): Check also for gupnp-1.2 and set HAS_GUPNP_VERSION_1_2
to yes if found.
* (sendto/plugins/upnp/upnp.c): Use gupnp_context_manager_create when
building with gupnp-1.2 as gupnp_context_manager_new was removed.
jonsger pushed a commit to jonsger/caja-extensions that referenced this issue Jul 30, 2019
This fixes mate-desktop#52.

* (configure.ac): Check also for gupnp-1.2 and set HAS_GUPNP_VERSION_1_2
to yes if found.
* (sendto/plugins/upnp/upnp.c): Use gupnp_context_manager_create when
building with gupnp-1.2 as gupnp_context_manager_new was removed.

Signed-off-by: Jonathan Brielmaier <jbrielmaier@suse.de>
jonsger pushed a commit to jonsger/caja-extensions that referenced this issue Aug 12, 2019
This fixes mate-desktop#52.

* (configure.ac): Check also for gupnp-1.2 and set HAS_GUPNP_VERSION_1_2
to yes if found.
* (sendto/plugins/upnp/upnp.c): Use gupnp_context_manager_create when
building with gupnp-1.2 as gupnp_context_manager_new was removed.

Signed-off-by: Jonathan Brielmaier <jbrielmaier@suse.de>
Co-authored-by: Gianfranco Costamagna <costamagnagianfranco@yahoo.it>
flexiondotorg pushed a commit that referenced this issue Aug 18, 2019
This fixes #52.

* (configure.ac): Check also for gupnp-1.2 and set HAS_GUPNP_VERSION_1_2
to yes if found.
* (sendto/plugins/upnp/upnp.c): Use gupnp_context_manager_create when
building with gupnp-1.2 as gupnp_context_manager_new was removed.

Signed-off-by: Jonathan Brielmaier <jbrielmaier@suse.de>
Co-authored-by: Gianfranco Costamagna <costamagnagianfranco@yahoo.it>
raveit65 pushed a commit that referenced this issue Sep 12, 2019
This fixes #52.

* (configure.ac): Check also for gupnp-1.2 and set HAS_GUPNP_VERSION_1_2
to yes if found.
* (sendto/plugins/upnp/upnp.c): Use gupnp_context_manager_create when
building with gupnp-1.2 as gupnp_context_manager_new was removed.

Signed-off-by: Jonathan Brielmaier <jbrielmaier@suse.de>
Co-authored-by: Gianfranco Costamagna <costamagnagianfranco@yahoo.it>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants