Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 379647 - dev-util/gtk-doc[highlight vim] can also RDEPEND on app-editors/gvim
Summary: dev-util/gtk-doc[highlight vim] can also RDEPEND on app-editors/gvim
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] GNOME (show other bugs)
Hardware: All All
: Normal minor (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-18 05:27 UTC by Markus Peloquin
Modified: 2011-08-29 00:02 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Peloquin 2011-08-18 05:27:36 UTC
The gtk-doc ebuilds assume that the vim binary comes from just app-editors/vim, but it also comes from app-editors/gvim.  My fix:

-		vim? ( app-editors/vim )
+		vim? ( || ( app-editors/vim app-editors/gvim ) )

I don't actually know how to test that it works properly, but it might as well be set this way unless there's a bug in gtk-doc.  I just want to have USE='highlight vim' set for gtk-doc because it makes me feel good.  (And to whoever I emailed about this earlier: yes, I am finally getting around to making this a bug; and yes, I am lazy.)

Reproducible: Always




The workaround for anybody who can't figure it out is to have USE='highlight -vim' set in package.use.
Comment 1 Gilles Dartiguelongue (RETIRED) gentoo-dev 2011-08-21 15:33:45 UTC
iirc the dependency was written like this because gtk-doc expects
Comment 2 Gilles Dartiguelongue (RETIRED) gentoo-dev 2011-08-21 15:34:41 UTC
damn tab+space :(

iirc the dependency was written like this because gtk-doc expects /usr/bin/vim binary. Does gvim provides the same ?
Comment 3 Markus Peloquin 2011-08-21 17:46:29 UTC
Yeah, you actually can't install both. I really don't know why there isn't just one version with an 'X' USE flag, but there you have it.
Comment 4 Alexandre Rostovtsev (RETIRED) gentoo-dev 2011-08-22 04:00:23 UTC
> I don't actually know how to test that it works properly, but it might as well
> be set this way unless there's a bug in gtk-doc.

You need to verify that gtk-doc with gvim works without X.

If you try to run gvim without X, you get an error message that must be dismissed manually. Perhaps there is a way to disable this behavior; perhaps not. If it cannot be disabled, then using gvim in gtk-doc would be unacceptable: gtk-doc is used in ebuilds, people often emerge things from the console, and they would not want their package building to be interrupted by error prompts requiring user interaction.
Comment 5 Markus Peloquin 2011-08-22 05:36:55 UTC
You only get an error/warning prompt if you invoke vim as `gvim` or `vim -g`.  The output is:
    E233: cannot open display
    Press ENTER or type command to continue

Plain `vim` without an X connection prints nothing to stderr or stdout.

...

Okay, I just confirmed vim from app-editors/gvim works.  I regenerated the docs from gtk+-2.24.4 by hand:

$ unset DISPLAY
$ cd gtk+-2.24.4
$ find . -name \*.html | xargs rm
# the first configure argument is required, the second maybe not?
$ ./configure --enable-gtk-doc --enable-gtk-doc-html
$ make

It's maybe worth noting that gtk-doc first writes non-highlighted HTML, and comes back to it at the end to add highlighting (it confused me when I was testing).  I got it to highlight with both source-highlight (USE='highlight -vim') and vim; vim is slightly less colorful.
Comment 6 Markus Peloquin 2011-08-22 05:42:13 UTC
And if it wasn't clear, app-editors/gvim installs a symlink (ln -s gvim /usr/bin/vim) that is equivalent to the vim from app-editors/vim (except that in the app-editors/gvim version, `vim -g` is the same as `gvim`).
Comment 7 Alexandre Rostovtsev (RETIRED) gentoo-dev 2011-08-22 06:43:03 UTC
Markus, thank you for your analysis.

I can confirm that having gtk-doc depend on gvim would work; I just successfully built glib-2.28.8 with USE=doc and with gtk-doc that used gvim's /usr/bin/vim symlink, and the resulting documentation had source code highlighted correctly.

Also, in case it wasn't clear to anyone reading: if you have both vim and gvim installed, then /usr/bin/vim is a binary that belongs to vim. If you have only gvim installed, then /usr/bin/vim is a symlink to gvim that is created by gvim during its pkg_postinst.
Comment 8 Alexandre Rostovtsev (RETIRED) gentoo-dev 2011-08-22 06:47:15 UTC
(In reply to comment #7)
> I can confirm that having gtk-doc depend on gvim would work; I just
> successfully built glib-2.28.8 with USE=doc and with gtk-doc that used gvim's
> /usr/bin/vim symlink

Forgot to add that this was with DISPLAY unset.
Comment 9 Nirbheek Chauhan (RETIRED) gentoo-dev 2011-08-29 00:02:24 UTC
Alrighty, change made, thanks for the analysis.

+  29 Aug 2011; Nirbheek Chauhan <nirbheek@gentoo.org> gtk-doc-1.17.ebuild:
+  Can use either vim or gvim for the /usr/bin/vim binary, bug 379647
+