Opened 11 years ago

Closed 4 years ago

#39756 closed defect (duplicate)

Adding runtime dep of yelp @2.31.6_1 to gnome apps breaks +quartz variant

Reported by: c.herbig@… Owned by: dbevans (David B. Evans)
Priority: Normal Milestone:
Component: ports Version:
Keywords: haspatch Cc: cooljeanius (Eric Gallager), todmorrison (Tod Morrison)
Port: yelp

Description (last modified by larryv (Lawrence Velázquez))

Yelp does not compile for +quartz due to some X11 specific calls in the yelp-application.c file. Forcing it as a dependency, even though these programs technically do not depend on it (unless you want to browse the help), breaks the ability to even run them at all.

Specifically it is the function application_uri_resolved, if this could be fixed:

...
...
...
yelp_window_load_uri (window, uri);

    gtk_widget_show_all (GTK_WIDGET (window));

    /* Metacity no longer does anything useful with gtk_window_present */
    gdk_window = gtk_widget_get_window (GTK_WIDGET (window));
    if (gdk_window)
        gdk_x11_window_move_to_current_desktop (gdk_window);

    /* Ensure we actually present the window when invoked from the command
     * line. This is somewhat evil, but the minor evil of Yelp stealing
     * focus (after you requested it) is outweighed for me by the major
     * evil of no help window appearing when you click Help.
     */
    if (data->timestamp == 0)
        data->timestamp = gdk_x11_get_server_time (gtk_widget_get_window (GTK_WIDGET (window)));

    gtk_window_present_with_time (GTK_WINDOW (window), data->timestamp);

    g_free (data);
}

then everything should be fine. I would imagine that since a +quartz environment doesn't need metacity, it could perhaps be patched out...

This issue was described here #39571

Attachments (2)

patch_quartz-src-yelp-application.c.diff (1.2 KB) - added by c.herbig@… 11 years ago.
Portfile-yelp.diff (414 bytes) - added by c.herbig@… 11 years ago.
undid revision increment

Download all attachments as: .zip

Change History (21)

comment:1 Changed 11 years ago by larryv (Lawrence Velázquez)

Cc: devans@… removed
Description: modified (diff)
Owner: changed from macports-tickets@… to devans@…

comment:2 Changed 11 years ago by c.herbig@…

If it is not possible to patch yelp, then perhaps a +quartz variant could be added to the relevant gnome apps, such as

variant quartz {
    depends_run-delete port:yelp
}

comment:3 Changed 11 years ago by c.herbig@…

P.S. I can't provide a list at the moment, mainly because it takes soooo long to build, but trying to install webkit-gtk +quartz from a clean macports installation will fail, it still has X11 dependencies in the source code. It also happens if you try to set the configure arguments to compile as webkit-gtk3.

comment:4 Changed 11 years ago by c.herbig@…

Here is the first thing that fails for trying to compile yelp +quartz

:info:build yelp-application.c:33:10: fatal error: 'gdk/gdkx.h' file not found
:info:build #include <gdk/gdkx.h>
:info:build          ^

This seems to be a common problem for trying to compile things for +quartz, for example, it also occurs for gnome-chemistry-utils. Is there a known workaround for this dependency?

comment:5 Changed 11 years ago by c.herbig@…

Huzzah!!! The problem is solved (except for webkit-gtk still wanting some x11 deps)!!!

Step 1, comment out the

#include <gdk/gdkx.h>

line in yelp-application.c

Step 2, comment out all of this:

/* Metacity no longer does anything useful with gtk_window_present */
    gdk_window = gtk_widget_get_window (GTK_WIDGET (window));
    if (gdk_window)
        gdk_x11_window_move_to_current_desktop (gdk_window);

    /* Ensure we actually present the window when invoked from the command
     * line. This is somewhat evil, but the minor evil of Yelp stealing
     * focus (after you requested it) is outweighed for me by the major
     * evil of no help window appearing when you click Help.
     */
    if (data->timestamp == 0)
        data->timestamp = gdk_x11_get_server_time (gtk_widget_get_window (GTK_WIDGET (window)));

    gtk_window_present_with_time (GTK_WINDOW (window), data->timestamp);

and insert

gtk_window_present(GTK_WIDGET (window));

and the yelp seems to work just fine.

I'll try to make an actual patch tomorrow.

comment:6 Changed 11 years ago by cooljeanius (Eric Gallager)

Cc: egall@… added

Cc Me!

comment:7 Changed 11 years ago by c.herbig@…

Here are the patch files. Can somebody add the haspatch keyword?

Last edited 11 years ago by c.herbig@… (previous) (diff)

Changed 11 years ago by c.herbig@…

comment:8 Changed 11 years ago by larryv (Lawrence Velázquez)

Keywords: haspatch added
Summary: Adding runtime dep of yelp to gnome apps breaks +quartz variantAdding runtime dep of yelp @2.31.6_1 to gnome apps breaks +quartz variant

comment:9 Changed 11 years ago by mf2k (Frank Schima)

There is no need to increase the revision when you only are adding a variant.

Changed 11 years ago by c.herbig@…

Attachment: Portfile-yelp.diff added

undid revision increment

comment:10 Changed 11 years ago by c.herbig@…

P.S. The reason I did not remove the X11 stuff in the quartz variant is because having them is the only way I was able to get webkit-gtk+quartz to compile. So whatever pangox or startup-items installs, it seems to also be needed for webkit-gtk+quartz...

comment:11 Changed 11 years ago by todmorrison (Tod Morrison)

Cc: todmorrison@… added

Cc Me!

comment:12 Changed 11 years ago by c.herbig@…

Yet another P.S., the same code in the yelp 3.8.x also fails for +quartz in the same way, and can be fixed in the same way.

comment:13 Changed 11 years ago by c.herbig@…

Although the quick fix patch I submitted gets yelp to work with +quartz, I have since been unable to get webkit-gtk +quartz to compile. The exact same problem reported here #39598. As such, gnome apps +quartz are still broken with depends_run yelp.

comment:14 Changed 11 years ago by c.herbig@…

I found that the quartz variant can be build using only xorg-libX11 from startup-notification as such:

variant quartz {
    patchfiles-append   patch_quartz-src-yelp-application.c.diff
    depends_lib-delete  port:startup-notification
    depends_lib-append  port:xorg-libX11
} 

This is still just a quick fix to the actual problem which should ultimately be dealt with upstream.

comment:15 in reply to:  14 Changed 11 years ago by c.herbig@…

Replying to c.herbig@…:

I found that the quartz variant can be build using only xorg-libX11 from startup-notification as such:

variant quartz {
    patchfiles-append   patch_quartz-src-yelp-application.c.diff
    depends_lib-delete  port:startup-notification
    depends_lib-append  port:xorg-libX11
} 

This is still just a quick fix to the actual problem which should ultimately be dealt with upstream.

Sorry, I got my projects mixed up, yelp doesn't need an xorg library at all, so both depends_lib part can be removed. It's webkit-gtk +quartz that needs them. I filed a ticket for that problem.

comment:16 Changed 11 years ago by c.herbig@…

So... can we commit this?

comment:17 Changed 11 years ago by c.herbig@…

The new yelp update (r109403) will probably negate this ticket, and would need new patches anyway. So, I guess this ticket can be closed as unnecessary.

comment:18 Changed 11 years ago by c.herbig@…

I was able to compile and run yelp 3.8.1 +quartz using the instructions in ticket #40116. So, I won't be spending anymore time on this version. If you are interested in trying the new yelp, head to the new ticket.

comment:19 Changed 4 years ago by kencu (Ken)

Resolution: duplicate
Status: newclosed

superceded by 40116

Note: See TracTickets for help on using tickets.