Bug 153712 - Kdevelop 3.3.5 requires ctags 5.6
Bug#: 153712 Product:  Gentoo Linux Version: unspecified Platform: All
OS/Version: Linux Status: RESOLVED Severity: normal Priority: P2
Resolution: FIXED Assigned To: kde@gentoo.org Reported By: pocmatos@gmail.com
Component: Development
URL: 
Summary: Kdevelop 3.3.5 requires ctags 5.6
Keywords:  
Status Whiteboard: 
Opened: 2006-11-01 10:08 0000
Description:   Opened: 2006-11-01 10:08 0000
kdevelop 3.3.5 requires ctags 5.6. 
Trying to build a ctags database for a C++ project I get from kdevelop: ctags
-R --c++-types=+px --excmd=pattern --exclude=Makefile --exclude=.
ctags: unrecognized option `--c++-types=+px`

seems that --c++-types is a 5.6 flag.

Problem is that there's no ebuild yet for 5.6! :-/

------- Comment #1 From Michael Kers 2006-12-06 15:39:02 0000 -------
Yeah, this is totally retarded.

It is caused by kdevelop hard-coding the binary "ctags".  However, that points
to(at least on my system) a ctags from the Emacs package...

root@willbtop ctags2 :) $ equery belongs ctags
[ Searching for file(s) ctags in *... ]
app-editors/xemacs-21.4.17 (/usr/bin/ctags)

Whereas, the file I want is "exuberant-ctags", that belongs to the "ctags"
package:

root@willbtop ctags2 :) $ equery files ctags
[ Searching for packages matching ctags... ]
* Contents of dev-util/ctags-5.5.4-r2:
/usr
/usr/bin
/usr/bin/exuberant-ctags

Problem is... There is no "configuration" method I have found of telling
kdevelop to use "exuberant-ctags" instead of "ctags".  This breaks code
complete on my version also (kdevelop-3.3.2).

But a patch can be had... The file ctags2_part.cpp in the kdevelop project can
be patched like so:

--- ctags2_part.cpp     2005-09-10 02:21:56.000000000 -0600
+++ ctags2_part.cpp.bak 2006-12-06 16:27:19.000000000 -0700
@@ -132,9 +132,9 @@
 */
        KConfig * config = kapp->config();
        config->setGroup( "CTAGS" );
-       QString ctagsBinary = config->readEntry( "ctags binary", "ctags"
).stripWhiteSpace();
+       //      QString ctagsBinary = config->readEntry( "ctags binary",
"ctags" ).stripWhiteSpace();
        if ( ctagsBinary.isEmpty() ) 
-               ctagsBinary = "ctags";
+               ctagsBinary = "exuberant-ctags";

        QString argsDefault = "-R --c++-types=+px --excmd=pattern
--exclude=Makefile --exclude=.";

And added to the kdevelop-ebuild-dohicky.

------- Comment #2 From Michael Kers 2006-12-06 15:42:14 0000 -------
Actually, that is a lousy way of doing it (too much burn out)... How about this
instead: 

--- ctags2_part.cpp     2005-09-10 02:21:56.000000000 -0600
+++ ctags2_part.cpp.bak 2006-12-06 16:41:47.000000000 -0700
@@ -132,9 +132,10 @@
 */
        KConfig * config = kapp->config();
        config->setGroup( "CTAGS" );
-       QString ctagsBinary = config->readEntry( "ctags binary", "ctags"
).stripWhiteSpace();
+       //      QString ctagsBinary = config->readEntry( "ctags binary",
"ctags" ).stripWhiteSpace();
+       QString ctagsBinary;
        if ( ctagsBinary.isEmpty() ) 
-               ctagsBinary = "ctags";
+               ctagsBinary = "exuberant-ctags";

        QString argsDefault = "-R --c++-types=+px --excmd=pattern
--exclude=Makefile --exclude=.";

------- Comment #3 From Diego E. 'Flameeyes' Pettenò 2007-01-27 16:12:28 0000 -------
Will fix in 3.4.0.

------- Comment #4 From Diego E. 'Flameeyes' Pettenò 2007-01-27 17:44:01 0000 -------
Fixed in 3.4.0, the default for new installs will be exuberant-ctags.