Opened 7 years ago

Closed 5 years ago

#41984 closed defect (fixed)

gtksourceview2 fails to build

Reported by: subscriber@… Owned by: wdc@…
Priority: Normal Milestone:
Component: ports Version: 2.2.1
Keywords: haspatch maintainer Cc: malar@…, hraban@…, landonf (Landon Fuller), su-v, bonoba@…, jgmath2000@…, maverickwoo (Maverick Woo), macports@…, Ionic (Mihai Moldovan)
Port: gtksourceview2

Description

64-bit MacBook Pro running Mavericks 10.9.1

called with install pspp +quartz, built because pspp depends on it

Attachments (12)

main.log (34.0 KB) - added by subscriber@… 7 years ago.
build log file
main.2.log (32.0 KB) - added by malar@… 7 years ago.
build failure
main.3.log (32.0 KB) - added by malar@… 7 years ago.
gtk3 @3.10.6_1+no_x11+quartz
gtksourceview2_main.log (131.8 KB) - added by hraban@… 7 years ago.
main.4.log (157.2 KB) - added by wdc@… 6 years ago.
My failed build log under MacOS 10.6
configure.ac.patch (547 bytes) - added by wdc@… 6 years ago.
Patch demonstrating configuration kludge.
gtksourceview.h.patch (861 bytes) - added by wdc@… 6 years ago.
Patch demonstrating simplification to gtksourceview.h
Portfile (2.6 KB) - added by wdc@… 6 years ago.
Portfile that uses latest gtk-osx-application integration. Note we STOP using a patch to gtksourceview-i18n.c
Portfile.diffs (748 bytes) - added by wdc@… 5 years ago.
Updated. Incorporating Changeset 135565
gtkosxapplication.diff (3.4 KB) - added by wdc@… 5 years ago.
Adopts filenames that are now canonical. See comment 24.
Portfile.diff (1.5 KB) - added by wdc@… 5 years ago.
patch-gtkosxapplication.diff (3.4 KB) - added by wdc@… 5 years ago.
New gtk2 integration

Download all attachments as: .zip

Change History (42)

Changed 7 years ago by subscriber@…

Attachment: main.log added

build log file

comment:1 Changed 7 years ago by mf2k (Frank Schima)

Keywords: gtksourceview removed
Owner: changed from macports-tickets@… to micah.lerner@…
Port: gtksourceview2 added
Type: submissiondefect

In the future, please fill in the Port field and Cc the port maintainers (port info --maintainers gtksourceview2).

comment:2 Changed 7 years ago by malar@…

Cc: malar@… added

Cc Me!

comment:3 Changed 7 years ago by malar@…

since ige-mac-integration, gedit and probably many others (gtk3 related?) depends on this package. please increase the priority.

Last edited 7 years ago by malar@… (previous) (diff)

Changed 7 years ago by malar@…

Attachment: main.2.log added

build failure

Changed 7 years ago by malar@…

Attachment: main.3.log added

gtk3 @3.10.6_1+no_x11+quartz

Changed 7 years ago by hraban@…

Attachment: gtksourceview2_main.log added

comment:4 Changed 7 years ago by hraban@…

Cc: hraban@… added

Cc Me!

Changed 6 years ago by wdc@…

Attachment: main.4.log added

My failed build log under MacOS 10.6

comment:5 Changed 6 years ago by wdc@…

I too had the same build failure under MacOS 10.6. (build log attached.) With the help of some folks on IRC, I understand the root cause and offer a kludge around the problems.

  1. The errors of the form:

:info:build /opt/local/bin/glib-mkenums: gtksourceview.h:131: Failed to parse ` GTK_SOURCE_DRAW_SPACES_TAB | \ '

are caused by a really nasty assignment in an enum in gtksourceview.h which chokes glib-mkenums. The attached file gtksourceview2.h.patch demonstrates a kludge to fix this. As near as I can tell, the complex r-value in the enum is just more than glib-mkenums can cope with.

  1. After that is fixed, however, the build still fails to find the basic gtk objects. The errors look like this:

:info:build In file included from ../gtksourceview/gtksourceview.h:30, :info:build from gtksourceview-typebuiltins.h:13, :info:build from gtksourceview.c:39: :info:build ../gtksourceview/gtksourcecompletion.h:60: error: expected specifier-qualifier-list before 'GtkObject' :info:build gtksourceview.c:268: error: expected ')' before '*' token :info:build gtksourceview.c: In function 'gtk_source_view_class_init':

The root cause of this is some sort of mis-understanding of dependencies that happens when installing ige-mac-integration (a dependency listed for gtksourceview2) after gtk3 is installed. (For example if you've installed gnumeric, it wants gtk3. gtk3 and gtk2 are separate and don't want to co-mingle, but when ige-mac-integration gets installed, it decides it wants to link against gtk3. Those includes shadow the gtk2 includes needed to successfully build gtksourceview2.

A kludgy work-around is simply to tell configure.ac not to bother with ige-mac-integration. configure.ac.patch demonstrates the change.

I've been told that the right long term solution is either to modify gtksourceview2 to use gtk-mac-integration instead, or to quit using gtksourceview2, since gtk2 is no longer actively supported.

I leave it to the port maintainers to decide on the best course of action going forward, and hope that this information makes that work easier.

Changed 6 years ago by wdc@…

Attachment: configure.ac.patch added

Patch demonstrating configuration kludge.

Changed 6 years ago by wdc@…

Attachment: gtksourceview.h.patch added

Patch demonstrating simplification to gtksourceview.h

comment:6 Changed 6 years ago by wdc@…

Cc: wdc@… added

Cc Me!

comment:7 Changed 6 years ago by neverpanic (Clemens Lang)

Cc: landonf@… added

comment:8 Changed 6 years ago by su-v

Cc: suv-sf@… added

Cc Me!

comment:9 Changed 6 years ago by bonoba@…

Cc: bonoba@… added

Cc Me!

comment:10 Changed 6 years ago by wdc@…

It turns out that in 2011, the gnome folks actually coded and checked in a change that switch us from ige-mac-integration to gtk-osx-application, but the change was never released. I took the diffs from the commit, and modified the Portfile to use it. It works! I have attached the relevant revised Portfile and diff. Note that we stop using a patch to gtksourceview-i18n.c because the diff goes against upstream source.

comment:11 Changed 6 years ago by wdc@…

Ok, something is still not quite right. I just did a clean rebuild and now I'm getting unresolved symbols from the link phase: :info:build CCLD libgtksourceview-2.0.la :info:build Undefined symbols for architecture x86_64: :info:build "_quartz_application_get_bundle_id", referenced from: :info:build gtksourceview_gettext in gtksourceview-i18n.o :info:build "_quartz_application_get_resource_path", referenced from: :info:build gtksourceview_gettext in gtksourceview-i18n.o :info:build ld: symbol(s) not found for architecture x86_64

This is the error I got when I tried to add gtk-osx-application as line in depends_lib. There is something funky about the library dependencies that I can't quite fathom.

Changed 6 years ago by wdc@…

Attachment: Portfile added

Portfile that uses latest gtk-osx-application integration. Note we STOP using a patch to gtksourceview-i18n.c

comment:12 Changed 6 years ago by wdc@…

Great news! The reason why it broke was that the routines "quartz_foo" got renamed to "gtkosx_foo". A later commit incorporated that change. I guess when I cleaned things up, the old library with the older names got removed. I've replaced Portfile and gtkosxapplication.diff with versions that now work on clean installs.

Share and enjoy!

comment:13 Changed 6 years ago by wdc@…

I've been told on #macports that it's proper to attach a diff comparing my Portfile to the original. I have now done so.

comment:14 Changed 6 years ago by wdc@…

Oh one more thing. In comment #5 above, I reported a fix to gtksourceview.h. It turns out that change is unnecessary. The relevant glib-mkenums output works and the messages are just warnings.

The definitive fix that gets everything working is, "Stop using ige-mac-integration. It gets confused and pulls in stuff from gtk3 that should never get pulled in, and blows out the build, since this is a gtk2 source."

comment:15 Changed 6 years ago by jgmath2000@…

Cc: jgmath2000@… added

Cc Me!

comment:16 in reply to:  14 Changed 6 years ago by craftey

Replying to wdc@…:

Oh one more thing. In comment #5 above, I reported a fix to gtksourceview.h. It turns out that change is unnecessary. The relevant glib-mkenums output works and the messages are just warnings.

The definitive fix that gets everything working is, "Stop using ige-mac-integration. It gets confused and pulls in stuff from gtk3 that should never get pulled in, and blows out the build, since this is a gtk2 source."

I tried your patch gtkosxapplication.diff​ locally. I use the original Portfile and modify it myself, by adding your patch simply as the quartz variant

variant quartz {
	depends_lib-append port:gtk-osx-application
	patchfiles-delete patch-gtksourceview_gtksourceview-i18n.c.diff
	patchfiles-append gtkosxapplication.diff
}

So the only changes I make are the Portfile (my way, see above) and adding gtkosxapplication.diff​ to the folder /files.

When now trying to install gtksourceview2 +quartz, I can see the pkg gtk-osx-application is pulled and build. But gtksourceview2 still fails, now on configure phase.

---> Configuring gtksourceview2
Error: Failed to configure gtksourceview2, consult /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_gnome_gtksourceview2/gtksourceview2/work/gtksourceview-2.10.5/config.log

Exerpt from that log:

:info:configure checking for native Mac OS X... yes
:info:configure checking for GTK_MAC... no
:info:configure configure: error: Package requirements (gtk-mac-integration >= 2.0.0) were not met:
:info:configure 
:info:configure No package 'gtk-mac-integration' found

When looking at your patch gtkosxapplication.diff​ and the above error message compared to the lib dependency in the Portfile, I recognize two different names: gtk-mac-integration vs. gtk-osx-integration. I don't know if that is the issue. What am I doing wrong?

Last edited 6 years ago by craftey (previous) (diff)

comment:17 Changed 6 years ago by wdc@…

Those are two different libraries. gtk-mac-integration is the old way that we're migrating off of. gtk-osx-integration is the new one. You need to use my patch as written to make the change successfully.

comment:18 Changed 6 years ago by craftey

Could u please summarize again, what to do. Because from what you have written I understand to use gtkosxapplication.diff​ and NOT apply patch-gtksourceview_gtksourceview-i18n.c.diff, Adding the dependency port:gtk-osx-application (which is what your Portfile does). Thats it. And thats what I have done.

The only difference I see, is that your Portfile does that changes in the default variant, I am trying to achieve the same in variant quartz, which should not make any difference.

Btw, I have also gtk3 installed, cause some other port needs it. Does that harm?

What I am finally trying to achieve is

port upgrade meld +quartz

which is broken for a year now or so. It used to work on osx 10.6, since 10.9 it is broken. The still installed old binary, compiled a year ago, is working.

Last edited 6 years ago by craftey (previous) (diff)

comment:19 in reply to:  17 Changed 6 years ago by craftey

Replying to wdc@…:

Those are two different libraries. gtk-mac-integration is the old way that we're migrating off of. gtk-osx-integration is the new one. You need to use my patch as written to make the change successfully.

In gtkosxapplication.diff​ we see the patch changes stuff from ige-mac-integration to gtk-mac-integration. So it looks to me we are moving from ige-mac to gtk-mac but not to gtk-osx. I am confused.

Last edited 6 years ago by craftey (previous) (diff)

comment:20 Changed 6 years ago by wdc@…

They renamed the library and api prefix.

comment:21 Changed 6 years ago by wdc@…

I apologize for not taking time to think this through more carefully and helpfully before.

The purpose of the patch is to move us from the ige-mac-integration which conflicts with GTK3 and doesn't well support quartz to gtk-mac-integration. One tricky bit is that gtk-mac-integration renamed its api prefix from "quartz_" to "gtk_osx_"

My environment is all quartz. I set "-x11 +no_x11 +quartz" in my /opt/local/etc/macports/variants.conf

I think I did have problems where the build wasn't finding the library and I had to either perform "port clean" or "port uninstall" followed by "port install" of either gtksourceview2 or something it depends upon. Sadly, in the haze of building and rebuilding, and owing to my not having done much with macports, I don't remember exactly what it was.

Perhaps output of port deps and port info of getsourceview2 on my system will be helpful to you:

$ port deps gtksourceview2 Warning: port definitions are more than two weeks old, consider updating them by running 'port selfupdate'. Full Name: gtksourceview2 @2.10.5_7 Build Dependencies: intltool, pkgconfig, gnome-common, gtk-doc, autoconf,

automake, libtool

Library Dependencies: glib2, gettext, gtk2, libxml2, gtk-osx-application

$ port info gtksourceview2 Warning: port definitions are more than two weeks old, consider updating them by running 'port selfupdate'. gtksourceview2 @2.10.5_7 (gnome) Variants: glade, universal

Description: GtkSourceView is a text widget that extends the standard

gtk+ 2.x text widget GtkTextView. It improves GtkTextView by implementing syntax highlighting and other features typical of a source editor. This port contains version 2 of the GtkSourceView widget. Port GtkSourceView contains version 1 of the widget.

Homepage: https://wiki.gnome.org/Projects/GtkSourceView

Build Dependencies: intltool, pkgconfig, gnome-common, gtk-doc, autoconf,

automake, libtool

Library Dependencies: glib2, gettext, gtk2, libxml2, gtk-osx-application Platforms: darwin License: LGPL-2.1+ Maintainers: micah.lerner@…, openmaintainer@…

comment:22 Changed 6 years ago by wdc@…

Micah:

Is there any chance you could integrate my patch into the gtksourceview2 as distributed so that it would just work for folks?

I'm really not sure how to help petep here.

comment:23 in reply to:  21 Changed 6 years ago by craftey

@wdc:

I found something. If I change in your patch gtkosxapplication.diff​ the string gtk-mac-integration to gtk-mac-integration-gtk2 then my issue is gone. Then configure phase of gtksourceview2 +quartz finally finds gtk-mac-integration.

The installation of the dependency port:gtk-osx-application installs the package gtk-mac-integration, on my system with a suffix to the original name:

in Terminal:

$ ls /opt/local/lib/pkgconfig/gtk-mac-in*
/opt/local/lib/pkgconfig/gtk-mac-integration-gtk2.pc

$ pkg-config  --list-all | grep gtk-mac
gtk-mac-integration-gtk2            gtk-mac-integration - Mac menu bar and dock integration for GTK+

Is the pkgconfig name of gtk-mac-integration different on your system?

Last edited 6 years ago by craftey (previous) (diff)

comment:24 Changed 6 years ago by wdc@…

Sure enough. Somebody renamed the package.

$ ls /opt/local/lib/pkgconfig/gtk-mac-in*

/opt/local/lib/pkgconfig/gtk-mac-integration.pc

Last edited 6 years ago by wdc@… (previous) (diff)

comment:25 Changed 6 years ago by maverickwoo (Maverick Woo)

Cc: maverick.woo@… added

Cc Me!

comment:26 Changed 5 years ago by macports@…

Cc: macports@… added

Cc Me!

Changed 5 years ago by wdc@…

Attachment: Portfile.diffs added

Updated. Incorporating Changeset 135565

Changed 5 years ago by wdc@…

Attachment: gtkosxapplication.diff added

Adopts filenames that are now canonical. See comment 24.

comment:27 Changed 5 years ago by wdc@…

I've just updated my fixes. I apologize for taking so long. I confess to reluctance to confront "upgrade outdated" until this week.

One thing made debugging this difficult: When changeset 135565 was incorporated into the port, there was no revision bump. I went along blithely believing that there wasn't any real need to revise anything because there was no new version number. But indeed, I needed to take a new portfile.

Recognizing that gtk integration is a moving target, I believe that the portfile and diffs I'm providing are the best available at this time. The ige-mac-integration fails on any system where gtk2 and gtk3 ports are installed.

This integration is more in line with upstream.

Please consider this patch to configure.ac, Makefile.am and gtksourceview-i18n.c with the updated Portfile for inclusion in an update to the gtksourceview2 port. I volunteer to do whatever work is necessary to make this inclusion happen as soon as possible.

comment:28 Changed 5 years ago by Ionic (Mihai Moldovan)

Has duplicate #48588.

Changed 5 years ago by wdc@…

Attachment: Portfile.diff added

Changed 5 years ago by wdc@…

New gtk2 integration

comment:29 Changed 5 years ago by Ionic (Mihai Moldovan)

Cc: ionic@… added; wdc@… removed
Keywords: haspatch maintainer added
Owner: changed from micah.lerner@… to wdc@…

comment:30 Changed 5 years ago by Ionic (Mihai Moldovan)

Resolution: fixed
Status: newclosed

Applied patches in r139437. Revbump in r139438. Thanks.

Note: See TracTickets for help on using tickets.