Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 111979 - app-editors/vim + vim-with-x incompatible with modular X
Summary: app-editors/vim + vim-with-x incompatible with modular X
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Vim Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-09 09:28 UTC by Chris Paulson-Ellis
Modified: 2006-01-24 22:35 UTC (History)
0 users

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


Attachments
Fix for vim eclass (vim.eclass.diff,717 bytes, patch)
2005-11-09 15:56 UTC, Chris Paulson-Ellis
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Paulson-Ellis 2005-11-09 09:28:18 UTC
The app-editors/vim ebuild (actually vim.eclass) depends on virtual/x11 when the
vim-with-x USE flag is specified. This is incompatible with the new modular X
ebuilds (see
http://dev.gentoo.org/~spyderous/xorg-x11/porting_to_modular_x_howto.txt).

Reproducible: Always
Steps to Reproduce:
Comment 1 Ciaran McCreesh 2005-11-09 10:22:41 UTC
Since I don't plan to switch to modular X any time soon... I'll change this if
someone figures out the exact dependencies required and then verifies it from a
stage3 chroot.
Comment 2 Chris Paulson-Ellis 2005-11-09 15:55:21 UTC
I gave the scripts a whirl (see my analysis and the raw results below). I'm
attaching a patch for the vim eclass. It may be worth getting spyderous to check
over my analysis.

Chris.



The only library that the script couldn't find was libelf.so. This seems to be a
library from dev-libs/elfutils that is not present in my modular chroot system.
I don't think it has anything to do with X. Looking at the vim source, it
appears to be added by the HAS_ELF check in vim63/src/auto/configure, just
because it was found. It does not seem to have been used by the vim executable
(ldd /usr/bin/vim does not list it), so I guess it's not really needed on the
link line. It may be there for other platforms.

An oddity in the libraries list is libXdmcp. It doesn't appear in the ldd
output, so is not an RDEPEND. According to vim63/src/configure.in, it is on the
link line for SunOS. There are no includes of X11/Xdmcp.h.

Similarly, libXpm is on the link line, but is not shown by ldd. It appears to be
there for some of the GUI versions of vim (esp. the Motif version). I'm sure
vim-with-x would still build if configure hadn't found it (like it did without
libelf).

Looking at the includes list...

x11-base/xorg-server is erroneously mentioned because of globals.h in the vim
source matching /usr/include/xorg/globals.h.

x11-libs/libXpm is erroneously mentioned because xpm.h appears in gui_x11.c,
gui_x11.c & integration.c (Sun workshop integration). None of these source files
are used by vim-with-x.

x11-proto/xproto is correctly mentioned because Xatom.h (and others) are
required by the basic X support in vim63/src/ui.c.

x11-libs/libXaw and x11-libs/libXmu are erroneously mentioned because the athena
and motif gui versions of vim use them.

Note that although x11-libs/libICE is not mentioned in the includes, it is
required for linking.

After stripping out the other non-X libraries, I determined that the RDEPEND
fragment should be:

|| ( ( x11-libs/libICE
       x11-libs/libXt
       x11-libs/libX11
       x11-libs/libSM
     )
     virtual/x11
   )

and the DEPEND fragment should be:

|| ( ( x11-libs/libICE
       x11-libs/libXt
       x11-libs/libX11
       x11-libs/libSM
       x11-proto/xproto
     )
     virtual/x11
   )

I tried these settings in vim.eclass and build vim in the modular chroot. The
resulting executable appears to have a different list of library dependencies
than the executable on my non-modular system! ldd reveals that it also requires
libXau and libXdmcp.

Looking at the vim compilation, it appears that the vim executable is first
linked with many X libraries (-lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE).
The makefile then tries re-linking without each of these libraries. The only one
it determines that it does need is Xt. It then relinks the vim executable with
just -lXt. The other libraries must be indirectly included by Xt using some
linker magic.

It therefore follows (I think) that x11-libs/Xdmcp and x11-libs/Xau should not
be added to the RDEPEND & DEPEND lists because they are dependencies of Xt
(direct or indirect), not of vim-with-x. This is born out by 'equery depends',
which reveals that both these libraries are dependencies of x11-libs/libX11.

This argument also applies to the other library dependencies. x11-libs/libXt
depends on all of our other dependencies:

# equery depgraph x11-libs/libXt
[ Searching for packages matching x11-libs/libXt... ]
* dependency graph for x11-libs/libXt-0.99.1
`-- x11-libs/libXt-0.99.1
 `-- x11-libs/libX11-0.99.2
  `-- x11-libs/xtrans-0.99.1
  `-- x11-libs/libXau-0.99.1
   `-- x11-proto/xproto-7.0.1
  `-- x11-libs/libXdmcp-0.99.1
  `-- x11-proto/kbproto-1.0.1
 `-- x11-libs/libSM-0.99.1-r1
  `-- x11-libs/libICE-0.99.0
[ x11-libs/libXt-0.99.1 stats: packages (9), max depth (3) ]

So... RDEPEND can just include x11-libs/libXt.

libICE can also be removed from DEPEND because there are no includes of the ICE
headers.

The remaining entries in DEPEND correspond to headers that are used by the
vim-with-x source, so must stay even though they are also dependencies of libXt.

So my final analysis (phew!) is that the RDEPEND fragment should be

|| ( x11-libs/libXt
     virtual/x11
   )

and the DEPEND fragment should be:

|| ( ( x11-libs/libXt
       x11-libs/libX11
       x11-libs/libSM
       x11-proto/xproto
     )
     virtual/x11
   )



Raw results:


On a non-modular box, I did:
# script typescript.vim
# USE="vim-with-x" emerge vim
# exit


In a modular chroot. I did:
# ./linking_libs.sh typescript.vim
Analyzing log ...
Looking for libraries ...
  Looking for libdl.so ... OK
  Looking for libelf.so ... Not found!
  Looking for libgpm.so ... OK
  Looking for libICE.so ... OK
  Looking for libncurses.so ... OK
  Looking for libnsl.so ... OK
  Looking for libSM.so ... OK
  Looking for libX11.so ... OK
  Looking for libXdmcp.so ... OK
  Looking for libXpm.so ... OK
  Looking for libXt.so ... OK
Tracing libraries back to packages ...

sys-libs/gpm-1.20.1-r4
sys-libs/ncurses-5.4-r6
sys-libs/glibc-2.3.4.20041102-r1
x11-libs/libICE-0.99.0
x11-libs/libXt-0.99.1
x11-libs/libX11-0.99.2
x11-libs/libXdmcp-0.99.1
x11-libs/libSM-0.99.1-r1
x11-libs/libXpm-3.5.3

# ebuild /usr/portage/app-editors/vim/vim-6.3.084.ebuild unpack
# ./included_headers.sh /var/tmp/portage/vim-6.3.084/work
Analyzing source ...
Looking for absolute headers ...

  Looking for /usr/include/assert.h ... OK
  Looking for /usr/include/ctype.h ... OK
  Looking for /usr/include/dirent.h ... OK
  Looking for /usr/include/dlfcn.h ... OK
  Looking for /usr/include/elf.h ... OK
  Looking for /usr/include/errno.h ... OK
  Looking for /usr/include/fcntl.h ... OK
  Looking for /usr/include/gpm.h ... OK
  Looking for /usr/include/iconv.h ... OK
  Looking for /usr/include/langinfo.h ... OK
  Looking for /usr/include/libgen.h ... OK
  Looking for /usr/include/libintl.h ... OK
  Looking for /usr/include/limits.h ... OK
  Looking for /usr/include/locale.h ... OK
  Looking for /usr/include/netdb.h ... OK
  Looking for /usr/include/netinet/in.h ... OK
  Looking for /usr/include/poll.h ... OK
  Looking for /usr/include/pthread.h ... OK
  Looking for /usr/include/pwd.h ... OK
  Looking for /usr/include/setjmp.h ... OK
  Looking for /usr/include/sgtty.h ... OK
  Looking for /usr/include/signal.h ... OK
  Looking for /usr/include/stdio.h ... OK
  Looking for /usr/include/stdlib.h ... OK
  Looking for /usr/include/string.h ... OK
  Looking for /usr/include/strings.h ... OK
  Looking for /usr/include/stropts.h ... OK
  Looking for /usr/include/sys/dir.h ... OK
  Looking for /usr/include/sys/errno.h ... OK
  Looking for /usr/include/sys/ioctl.h ... OK
  Looking for /usr/include/sys/param.h ... OK
  Looking for /usr/include/sys/poll.h ... OK
  Looking for /usr/include/sys/resource.h ... OK
  Looking for /usr/include/sys/select.h ... OK
  Looking for /usr/include/sys/socket.h ... OK
  Looking for /usr/include/sys/statfs.h ... OK
  Looking for /usr/include/sys/stat.h ... OK
  Looking for /usr/include/sys/sysctl.h ... OK
  Looking for /usr/include/sys/sysinfo.h ... OK
  Looking for /usr/include/sys/sysmacros.h ... OK
  Looking for /usr/include/sys/termios.h ... OK
  Looking for /usr/include/sys/time.h ... OK
  Looking for /usr/include/sys/types.h ... OK
  Looking for /usr/include/sys/un.h ... OK
  Looking for /usr/include/sys/utsname.h ... OK
  Looking for /usr/include/sys/wait.h ... OK
  Looking for /usr/include/termcap.h ... OK
  Looking for /usr/include/termio.h ... OK
  Looking for /usr/include/termios.h ... OK
  Looking for /usr/include/time.h ... OK
  Looking for /usr/include/unistd.h ... OK
  Looking for /usr/include/utime.h ... OK
  Looking for /usr/include/wchar.h ... OK
  Looking for /usr/include/X11/Composite.h ... OK
  Looking for /usr/include/X11/cursorfont.h ... OK
  Looking for /usr/include/X11/Intrinsic.h ... OK
  Looking for /usr/include/X11/IntrinsicP.h ... OK
  Looking for /usr/include/X11/keysym.h ... OK
  Looking for /usr/include/X11/Shell.h ... OK
  Looking for /usr/include/X11/SM/SMlib.h ... OK
  Looking for /usr/include/X11/StringDefs.h ... OK
  Looking for /usr/include/X11/Sunkeysym.h ... OK
  Looking for /usr/include/X11/Xatom.h ... OK
  Looking for /usr/include/X11/Xaw/AsciiText.h ... OK
  Looking for /usr/include/X11/Xaw/Box.h ... OK
  Looking for /usr/include/X11/Xaw/Cardinals.h ... OK
  Looking for /usr/include/X11/Xaw/Command.h ... OK
  Looking for /usr/include/X11/Xaw/Dialog.h ... OK
  Looking for /usr/include/X11/Xaw/Form.h ... OK
  Looking for /usr/include/X11/Xaw/Label.h ... OK
  Looking for /usr/include/X11/Xaw/MenuButton.h ... OK
  Looking for /usr/include/X11/Xaw/Paned.h ... OK
  Looking for /usr/include/X11/Xaw/SimpleMenu.h ... OK
  Looking for /usr/include/X11/Xaw/SimpleP.h ... OK
  Looking for /usr/include/X11/Xaw/SmeBSB.h ... OK
  Looking for /usr/include/X11/Xaw/SmeLine.h ... OK
  Looking for /usr/include/X11/Xaw/Text.h ... OK
  Looking for /usr/include/X11/Xaw/XawInit.h ... OK
  Looking for /usr/include/X11/Xlib.h ... OK
  Looking for /usr/include/X11/Xlocale.h ... OK
  Looking for /usr/include/X11/Xmu/Converters.h ... OK
  Looking for /usr/include/X11/Xmu/Drawing.h ... OK
  Looking for /usr/include/X11/Xmu/Editres.h ... OK
  Looking for /usr/include/X11/Xos.h ... OK
  Looking for /usr/include/X11/xpm.h ... OK
  Looking for /usr/include/X11/Xutil.h ... OK
Looking for relative headers ...

  Looking for /usr/include/xorg/globals.h ... OK
  Looking for /usr/include/regexp.h ... OK
  Looking for /usr/include/term.h ... OK
  Looking for version.h ...
    More than one option found for version.h in /usr/include.
    Not considering version.h.
  Looking for file.h ...
    More than one option found for file.h in /usr/include.
    Not considering file.h.
  Looking for io.h ...
    More than one option found for io.h in /usr/include.
    Not considering io.h.
  Looking for /usr/include/python2.3/patchlevel.h ... OK
  Looking for /usr/include/python2.3/Python.h ... OK
  Looking for socket.h ...
    More than one option found for socket.h in /usr/include.
    Not considering socket.h.
  Looking for stat.h ...
    More than one option found for stat.h in /usr/include.
    Not considering stat.h.
  Looking for /usr/include/linux/stddef.h ... OK
  Looking for types.h ...
    More than one option found for types.h in /usr/include.
    Not considering types.h.
Tracing headers back to packages ...

dev-lang/python-2.3.5
sys-kernel/linux-headers-2.6.11-r2
sys-libs/gpm-1.20.1-r4
sys-libs/ncurses-5.4-r6
sys-libs/glibc-2.3.4.20041102-r1
x11-base/xorg-server-0.99.2-r1
x11-libs/libXt-0.99.1
x11-libs/libXaw-0.99.1
x11-libs/libX11-0.99.2
x11-libs/libSM-0.99.1-r1
x11-libs/libXmu-0.99.1-r1
x11-libs/libXpm-3.5.3
x11-proto/xproto-7.0.1
Comment 3 Chris Paulson-Ellis 2005-11-09 15:56:18 UTC
Created attachment 72525 [details, diff]
Fix for vim eclass
Comment 4 Ciaran McCreesh 2005-11-17 09:32:39 UTC
Thanks.