Opened 11 years ago
Closed 9 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@…, fiee (Henning Hraban Ramm), 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)
Change History (42)
Changed 11 years ago by subscriber@…
comment:1 Changed 11 years ago by mf2k (Frank Schima)
Keywords: | gtksourceview removed |
---|---|
Owner: | changed from macports-tickets@… to micah.lerner@… |
Port: | gtksourceview2 added |
Type: | submission → defect |
In the future, please fill in the Port field and Cc the port maintainers (port info --maintainers gtksourceview2
).
comment:3 Changed 11 years ago by malar@…
since ige-mac-integration, gedit and probably many others (gtk3 related?) depends on this package. please increase the priority.
Changed 11 years ago by fiee (Henning Hraban Ramm)
Attachment: | gtksourceview2_main.log added |
---|
comment:5 Changed 10 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.
- 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.
- 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 10 years ago by wdc@…
Attachment: | configure.ac.patch added |
---|
Patch demonstrating configuration kludge.
Changed 10 years ago by wdc@…
Attachment: | gtksourceview.h.patch added |
---|
Patch demonstrating simplification to gtksourceview.h
comment:7 Changed 10 years ago by neverpanic (Clemens Lang)
Cc: | landonf@… added |
---|
comment:10 Changed 10 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 10 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 10 years ago by wdc@…
Portfile that uses latest gtk-osx-application integration. Note we STOP using a patch to gtksourceview-i18n.c
comment:12 Changed 10 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 10 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 follow-up: 16 Changed 10 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:16 Changed 10 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?
comment:17 follow-up: 19 Changed 10 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 10 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.
comment:19 Changed 10 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 gtk-ige to gtk-mac but not gtk-osx. I am confused.
comment:21 follow-up: 23 Changed 10 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 10 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 Changed 10 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?
comment:24 Changed 10 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
Changed 9 years ago by wdc@…
Attachment: | Portfile.diffs added |
---|
Updated. Incorporating Changeset 135565
Changed 9 years ago by wdc@…
Attachment: | gtkosxapplication.diff added |
---|
Adopts filenames that are now canonical. See comment 24.
comment:27 Changed 9 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.
Changed 9 years ago by wdc@…
Attachment: | Portfile.diff added |
---|
comment:29 Changed 9 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 9 years ago by Ionic (Mihai Moldovan)
Resolution: | → fixed |
---|---|
Status: | new → closed |
build log file