diff --git a/.cvsignore b/.cvsignore index cba4219..3e5b65b 100644 --- a/.cvsignore +++ b/.cvsignore @@ -28,3 +28,6 @@ eclipse-cdt-fetched-src-v200906161748.tar.bz2 eclipse-cdt-fetched-src-CDT_6_0_0.tar.bz2 eclipse-cdt-fetched-src-autotools-v200906171600.tar.gz eclipse-cdt-fetched-src-autotools-v200907241319.tar.gz +libstdc++-v3.libhover +glibc-2.7-2.libhover +eclipse-cdt-fetched-src-libhover-R0_3_0.tar.gz diff --git a/eclipse-cdt-libhover-feature.patch b/eclipse-cdt-libhover-feature.patch deleted file mode 100644 index a033eeb..0000000 --- a/eclipse-cdt-libhover-feature.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -up ./feature.xml.fix ./feature.xml ---- ./feature.xml.fix 2008-10-16 13:09:31.000000000 -0400 -+++ ./feature.xml 2008-10-16 13:09:40.000000000 -0400 -@@ -131,10 +131,15 @@ Copyright © 2006 The Eclipse Foundation - unpack="false"/> - - -+ -+ -+ version="0.0.0"/> - - diff --git a/eclipse-cdt-libhover-glibc.patch b/eclipse-cdt-libhover-glibc.patch deleted file mode 100644 index 3144294..0000000 --- a/eclipse-cdt-libhover-glibc.patch +++ /dev/null @@ -1,9 +0,0 @@ -diff -up ./build.properties.fix ./build.properties ---- ./build.properties.fix 2008-10-16 14:08:29.000000000 -0400 -+++ ./build.properties 2008-10-16 14:08:42.000000000 -0400 -@@ -1,3 +1,4 @@ - bin.includes = META-INF/,\ -- plugin.xml -+ plugin.xml,\ -+ toc.xml - src.includes = about.html diff --git a/eclipse-cdt-libhover-jar.patch b/eclipse-cdt-libhover-jar.patch deleted file mode 100644 index 3cb67e1..0000000 --- a/eclipse-cdt-libhover-jar.patch +++ /dev/null @@ -1,191 +0,0 @@ ---- com.redhat.eclipse.cdt.autotools/src/com/redhat/eclipse/cdt/autotools/ui/LibHover.java.fix 2006-08-02 13:34:36.000000000 -0400 -+++ com.redhat.eclipse.cdt.autotools/src/com/redhat/eclipse/cdt/autotools/ui/LibHover.java 2006-08-02 13:34:57.000000000 -0400 -@@ -15,40 +15,45 @@ - - package com.redhat.eclipse.cdt.autotools.ui; - --import java.util.*; --import java.net.URL; --import java.io.File; - import java.io.IOException; -+import java.io.InputStream; -+import java.net.MalformedURLException; -+import java.util.ArrayList; - - import javax.xml.parsers.DocumentBuilder; - import javax.xml.parsers.DocumentBuilderFactory; - import javax.xml.parsers.ParserConfigurationException; - --import org.xml.sax.SAXException; --import org.xml.sax.SAXParseException; -- --import org.w3c.dom.*; -- --import org.eclipse.core.runtime.*; --import com.redhat.eclipse.cdt.autotools.AutotoolsPlugin; --import org.eclipse.cdt.ui.ICHelpProvider; --import org.eclipse.cdt.ui.text.ICHelpInvocationContext; -+import org.eclipse.cdt.ui.CUIPlugin; - import org.eclipse.cdt.ui.ICHelpBook; -+import org.eclipse.cdt.ui.ICHelpProvider; - import org.eclipse.cdt.ui.ICHelpResourceDescriptor; - import org.eclipse.cdt.ui.IFunctionSummary; - import org.eclipse.cdt.ui.IRequiredInclude; -+import org.eclipse.cdt.ui.text.ICHelpInvocationContext; -+import org.eclipse.core.runtime.FileLocator; -+import org.eclipse.core.runtime.Path; -+import org.eclipse.core.runtime.Plugin; - import org.eclipse.help.IHelpResource; -+import org.w3c.dom.Document; -+import org.w3c.dom.Element; -+import org.w3c.dom.NamedNodeMap; -+import org.w3c.dom.Node; -+import org.w3c.dom.NodeList; -+import org.xml.sax.SAXException; -+import org.xml.sax.SAXParseException; -+ -+import com.redhat.eclipse.cdt.autotools.AutotoolsPlugin; - - public class LibHover implements ICHelpProvider { - - private static Plugin plugin; -- private static String docsRootPath = null; - - // see comment in initialize() - // private static String defaultSearchPath = null; - - private static Document document; -- private static String oldpath = null;static final String constructTypes[] ={ -+ static final String constructTypes[] ={ - "dtype", - "enum", - "function", -@@ -63,70 +68,39 @@ public class LibHover implements ICHelpP - static final int typeIndex = 4; - static final int unionIndex = 5; - -- private Document getDocument(String path, String name) { -- Document doc = null; -- -- String userHome = System.getProperty("user.home"); -- String userDir = System.getProperty("user.dir"); -- -- if ((null == oldpath) || !oldpath.equals(path)) { -- StringTokenizer dirs = new StringTokenizer(path, ":", false); -- -- while((null == doc) && dirs.hasMoreTokens()) { -- String dir = dirs.nextToken(); -- if ((null != userHome) && dir.startsWith("~")) { -- dir = dir.replaceFirst("~", userHome); -- } -- else if ((null != userDir) && dir.startsWith(".")) { -- dir = dir.replaceFirst(".", userDir); -- } -- else if ((null != docsRootPath) && dir.startsWith("!")) { -- dir = dir.replaceFirst("!", docsRootPath); -- } -- -- if (!dir.endsWith("/")) dir = dir.concat("/"); -- -- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); -- factory.setValidating(true); -- try { -- DocumentBuilder builder = factory.newDocumentBuilder(); --// builder.setErrorHandler(new TextHoverErrorHandler()); -- doc = builder.parse( new File(dir + name) ); -- } -- catch (SAXParseException saxException) { -- doc = null; -- } -- catch (SAXException saxEx) { -- doc = null; -- } -- catch (ParserConfigurationException pce) { -- doc = null; -- } -- catch (IOException ioe) { -- doc = null; -- } -- } -- oldpath = path; -- } -- -- return doc; -- } -- -- public void buildDocPath(String root, String path) { -+ -+ public void getLibHoverDocs() { - if (null != plugin) { -- URL homeURL = plugin.find(new Path(".")); -+ Document doc = null; - try { -- homeURL = Platform.asLocalURL(homeURL); -- IPath topPath = (new Path(homeURL.getPath())).removeLastSegments(1); -- IPath homePath = topPath; -- if (null != root) homePath = homePath.append(root); -- if (null != path) homePath = homePath.append(path); -- homePath = homePath.addTrailingSeparator(); -- docsRootPath = homePath.toOSString(); -- - // see comment in initialize() -- // document = getDocument(((null == defaultSearchPath) ? "!" : defaultSearchPath), "glibc.xml"); -- document = getDocument("./libhoverdocs:~/libhoverdocs:/usr/share/eclipse/libhoverdocs:!", "glibc.xml"); -+ try { -+ // Use the FileLocator class to open the magic hover doc file -+ // in the plugin's jar. -+ Path p = new Path("libhoverdocs/glibc.xml"); //$NON-NLS-1$ -+ InputStream docStream = FileLocator.openStream(AutotoolsPlugin.getDefault().getBundle(), p, false); -+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); -+ factory.setValidating(true); -+ try { -+ DocumentBuilder builder = factory.newDocumentBuilder(); -+ doc = builder.parse(docStream); -+ } -+ catch (SAXParseException saxException) { -+ doc = null; -+ } -+ catch (SAXException saxEx) { -+ doc = null; -+ } -+ catch (ParserConfigurationException pce) { -+ doc = null; -+ } -+ catch (IOException ioe) { -+ doc = null; -+ } -+ } catch (MalformedURLException e) { -+ CUIPlugin.getDefault().log(e); -+ } -+ document = doc; - } - catch (IOException ioe) { - } -@@ -135,26 +109,7 @@ public class LibHover implements ICHelpP - - public void initialize() { - plugin = (Plugin)AutotoolsPlugin.getDefault(); -- -- // the getAttribute() isn't working right -- it gets ghost attrs from somwhere rather than from the current fragment.xml -- -- // so to hell with it for the moment. -- // -- // String libhoverdocsroot = null; -- // String libhoverdocspath = null; -- // IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(CUIPlugin.PLUGIN_ID, -- // "CCompletionContributor"); //$NON-NLS-1$ -- // if (extensionPoint != null) { -- // IConfigurationElement[] elements = extensionPoint.getConfigurationElements(); -- // for (int i = 0; i < elements.length; i++) { -- // libhoverdocsroot = elements[i].getAttribute("libhoverdocsroot"); -- // libhoverdocspath = elements[i].getAttribute("libhoverdocspath"); -- // defaultSearchPath = elements[i].getAttribute("defaultsearchpath"); -- // } -- // } -- // buildDocPath(libhoverdocsroot,libhoverdocspath); -- // -- // use the following, pro-tem, instead -- buildDocPath("com.redhat.eclipse.cdt.autotools", "libhoverdocs"); -+ getLibHoverDocs(); - } - - private class HelpBook implements ICHelpBook { diff --git a/eclipse-cdt-libhover-local.patch b/eclipse-cdt-libhover-local.patch new file mode 100644 index 0000000..4997b69 --- /dev/null +++ b/eclipse-cdt-libhover-local.patch @@ -0,0 +1,37 @@ +diff -up ./org.eclipse.linuxtools.cdt.libhover/build.properties.fix ./org.eclipse.linuxtools.cdt.libhover/build.properties +--- ./org.eclipse.linuxtools.cdt.libhover/build.properties.fix 2009-09-23 17:07:18.000000000 -0400 ++++ ./org.eclipse.linuxtools.cdt.libhover/build.properties 2009-09-23 17:07:38.000000000 -0400 +@@ -3,7 +3,8 @@ output.. = bin/ + bin.includes = plugin.xml,\ + META-INF/,\ + .,\ +- plugin.properties ++ plugin.properties,\ ++ libhoverdocs/ + + javacSource=1.5 + javacTarget=1.5 +diff -up ./org.eclipse.linuxtools.cdt.libhover.glibc/plugin.xml.fix ./org.eclipse.linuxtools.cdt.libhover.glibc/plugin.xml +--- ./org.eclipse.linuxtools.cdt.libhover.glibc/plugin.xml.fix 2009-09-23 17:12:01.000000000 -0400 ++++ ./org.eclipse.linuxtools.cdt.libhover.glibc/plugin.xml 2009-09-23 17:12:26.000000000 -0400 +@@ -7,7 +7,7 @@ + point="org.eclipse.linuxtools.cdt.libhover.library"> + + +diff -up ./org.eclipse.linuxtools.cdt.libhover.libstdcxx/plugin.xml.fix ./org.eclipse.linuxtools.cdt.libhover.libstdcxx/plugin.xml +--- ./org.eclipse.linuxtools.cdt.libhover.libstdcxx/plugin.xml.fix 2009-09-23 17:12:43.000000000 -0400 ++++ ./org.eclipse.linuxtools.cdt.libhover.libstdcxx/plugin.xml 2009-09-23 17:13:04.000000000 -0400 +@@ -7,7 +7,7 @@ + point="org.eclipse.linuxtools.cdt.libhover.library"> + + diff --git a/eclipse-cdt-libhover.patch b/eclipse-cdt-libhover.patch new file mode 100644 index 0000000..d572f0a --- /dev/null +++ b/eclipse-cdt-libhover.patch @@ -0,0 +1,110 @@ +diff -up ./org.eclipse.linuxtools.cdt.libhover/META-INF/MANIFEST.MF.fix2 ./org.eclipse.linuxtools.cdt.libhover/META-INF/MANIFEST.MF +--- ./org.eclipse.linuxtools.cdt.libhover/META-INF/MANIFEST.MF.fix2 2009-09-23 17:15:45.000000000 -0400 ++++ ./org.eclipse.linuxtools.cdt.libhover/META-INF/MANIFEST.MF 2009-09-23 17:08:47.000000000 -0400 +@@ -18,3 +18,4 @@ Require-Bundle: org.eclipse.ui, + org.eclipse.jface.text;bundle-version="3.4.1" + Bundle-RequiredExecutionEnvironment: J2SE-1.5 + Export-Package: org.eclipse.linuxtools.cdt.libhover ++Bundle-ActivationPolicy: lazy +diff -up ./org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/LibhoverPlugin.java.fix2 ./org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/LibhoverPlugin.java +--- ./org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/LibhoverPlugin.java.fix2 2009-09-23 17:16:59.000000000 -0400 ++++ ./org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/LibhoverPlugin.java 2009-09-23 17:09:54.000000000 -0400 +@@ -29,6 +29,7 @@ public class LibhoverPlugin extends Abst + * The constructor + */ + public LibhoverPlugin() { ++ plugin = this; + } + + /* +diff -up ./org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHover.java.fix2 ./org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHover.java +--- ./org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHover.java.fix2 2009-09-23 17:11:05.000000000 -0400 ++++ ./org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHover.java 2009-09-23 17:11:21.000000000 -0400 +@@ -451,7 +451,7 @@ public class LibHover implements ICHelpP + return null; + if (methodType != null) { + try { +- args = resolveArgs(info, methodType.getParameterTypes()); ++ args = resolveArgs(info, methodType.getParameterTypes(), templateTypes); + returnType = methodType.getReturnType(); + } catch (DOMException e) { + // TODO Auto-generated catch block +@@ -465,11 +465,11 @@ public class LibHover implements ICHelpP + MemberInfo member = info.getMember(memberName); + if (member != null) { + MemberInfo m = null; +- if (!isParmMatch(member, args)) { ++ if (!isParmMatch(member, args, templateTypes, info)) { + ArrayList members = member.getChildren(); + for (int i = 0; i < members.size(); ++i) { + MemberInfo k = members.get(i); +- if (isParmMatch(k, args)) { ++ if (isParmMatch(k, args, templateTypes, info)) { + m = k; + break; + } +@@ -513,12 +513,18 @@ public class LibHover implements ICHelpP + } + + +- private boolean isParmMatch(MemberInfo m, String[] args) { ++ private boolean isParmMatch(MemberInfo m, String[] args, ArrayList templateTypes, ClassInfo info) { + String[] memberParms = m.getParamTypes(); ++ for (int i = 0; i < memberParms.length; ++i) { ++ String[] templateParms = info.getTemplateParms(); ++ for (int j = 0; j < templateTypes.size(); ++j) { ++ memberParms[i] = memberParms[i].replaceAll(templateParms[j], templateTypes.get(j)); ++ } ++ } + return Arrays.equals(memberParms, args); + } + +- private String[] resolveArgs(ClassInfo info, IType[] parameterTypes) { ++ private String[] resolveArgs(ClassInfo info, IType[] parameterTypes, ArrayList templateTypes) { + String[] templateParms = info.getTemplateParms(); + String[] result = new String[parameterTypes.length]; + for (int i = 0; i < parameterTypes.length; ++i) { +@@ -529,7 +535,11 @@ public class LibHover implements ICHelpP + while (index >= 0) { + // We assume no class has more than 9 template parms. + int digit = param.charAt(index + 1) - '0'; +- param = param.replaceFirst(param.substring(index, index + 2), templateParms[digit]); ++ // where possible, replace template parms with real values ++ if (digit < templateTypes.size()) ++ param = param.replaceFirst(param.substring(index, index + 2), templateTypes.get(digit)); ++ else ++ param = param.replaceFirst(param.substring(index, index + 2), templateParms[digit]); + index = param.indexOf("#"); + } + result[i] = param; +diff -up ./org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHoverLibrary.java.fix2 ./org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHoverLibrary.java +--- ./org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHoverLibrary.java.fix2 2009-09-23 17:10:32.000000000 -0400 ++++ ./org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHoverLibrary.java 2009-09-23 17:10:55.000000000 -0400 +@@ -21,10 +21,12 @@ import java.net.URL; + import java.util.ArrayList; + + import org.eclipse.core.filesystem.URIUtil; ++import org.eclipse.core.runtime.FileLocator; + import org.eclipse.core.runtime.IPath; + import org.eclipse.linuxtools.cdt.libhover.ClassInfo; + import org.eclipse.linuxtools.cdt.libhover.FunctionInfo; + import org.eclipse.linuxtools.cdt.libhover.LibHoverInfo; ++import org.eclipse.linuxtools.cdt.libhover.LibhoverPlugin; + import org.eclipse.linuxtools.cdt.libhover.TypedefInfo; + + public class LibHoverLibrary { +@@ -98,7 +100,13 @@ public class LibHoverLibrary { + URL url = acDoc.toURL(); + docStream = url.openStream(); + } else { +- docStream = new FileInputStream(p.toFile()); ++ try { ++ // Try to open the file as local to this plug-in. ++ docStream = FileLocator.openStream(LibhoverPlugin.getDefault().getBundle(), p, false); ++ } catch (IOException e) { ++ // File is not local to plug-in, try file system. ++ docStream = new FileInputStream(p.toFile()); ++ } + } + ObjectInputStream input = new ObjectInputStream(docStream); + hoverInfo = (LibHoverInfo)input.readObject(); diff --git a/eclipse-cdt.spec b/eclipse-cdt.spec index cde86ed..aea6fd1 100644 --- a/eclipse-cdt.spec +++ b/eclipse-cdt.spec @@ -22,7 +22,7 @@ Epoch: 1 Summary: Eclipse C/C++ Development Tools (CDT) plugin Name: eclipse-cdt Version: %{majmin}.%{micro} -Release: 9%{?dist} +Release: 10%{?dist} License: EPL and CPL Group: Development/Tools URL: http://www.eclipse.org/cdt @@ -38,7 +38,7 @@ Source4: fetch-cdt.sh Source1: http://sources.redhat.com/eclipse/autotools/eclipse-cdt-fetched-src-autotools-v200907241319.tar.gz -Source2: http://sources.redhat.com/eclipse/autotools/eclipse-cdt-fetched-src-libhover-R0_1_1.tar.gz +Source2: http://sources.redhat.com/eclipse/autotools/eclipse-cdt-fetched-src-libhover-R0_3_0.tar.gz ## The following tarball was generated thusly: ## @@ -54,6 +54,10 @@ Source2: http://sources.redhat.com/eclipse/autotools/eclipse-cdt-fetched-src-lib # Script to run the tests in Xvnc Source5: %{name}-runtests.sh +# Libhover docs to place locally +Source6: glibc-2.7-2.libhover +Source7: libstdc++-v3.libhover + ## Patch to cppunit code to support double-clicking on file names, classes, and ## member names in the Hierarchy and Failure views such that the appropriate ## file will be opened and the appropriate line will be selected. @@ -74,12 +78,13 @@ Patch12: %{name}-openpty.patch # Add XML -> HTML generation after running tests Patch13: %{name}-testaggregation.patch -# FIXME: investigate for 5.0.1 -# -# There is a bug in this test that makes it not build. It looks like -# it's fixed upstream in 5.0.1 -# https://bugs.eclipse.org/bugs/show_bug.cgi?id=130235 -#Patch14: %{name}-noLexerTests.patch +# Following is a patch to supply libhover docs directory from the libhover +# plugin and not require html to access them. +Patch14: %{name}-libhover-local.patch + +# Following is a patch to libhover to fix member resolution, plugin loading, +# and to enable local plugin file support for docs. +Patch15: %{name}-libhover.patch BuildRequires: eclipse-pde BuildRequires: eclipse-mylyn >= 3.0 @@ -191,6 +196,15 @@ popd mkdir libhover pushd libhover tar -xzf %{SOURCE2} +%patch14 -p0 +%patch15 -p0 +pushd org.eclipse.linuxtools.cdt.libhover +mkdir libhoverdocs +pushd libhoverdocs +cp %{SOURCE6} . +cp %{SOURCE7} . +popd +popd popd ## Cppunit stuff @@ -297,7 +311,7 @@ java -cp $SDK/startup.jar \ -application org.eclipse.ant.core.antRunner \ -Duser.home=$homedir \ -Dtype=feature \ - -Did=org.eclipse.linuxtools.cdt.libhover.feature \ + -Did=org.eclipse.linuxtools.cdt.libhover \ -DsourceDirectory=$(pwd) \ -DbaseLocation=$SDK \ -Dbuilder=$PDEDIR/templates/package-build \ @@ -357,7 +371,7 @@ popd # Libhover install pushd libhover -unzip -qq -d $installDir build/rpmBuild/org.eclipse.linuxtools.cdt.libhover.feature.zip +unzip -qq -d $installDir build/rpmBuild/org.eclipse.linuxtools.cdt.libhover.zip popd mkdir -p $mylynInstallDir/eclipse/features $mylynInstallDir/eclipse/plugins @@ -508,6 +522,12 @@ rm -rf ${RPM_BUILD_ROOT} %endif %changelog +* Wed Sep 23 2009 Jeff Johnston 1:6.0.0-10 +- Resolves #290247 +- Upgrade libhover to 0.3.0. +- Add libhover patch to fix libstdc++ member resolution and + to place libhover docs locally within libhover plugin. + * Wed Aug 12 2009 Andrew Overholt 1:6.0.0-9 - Use launcher jar to run metadata generator instead of eclipse binary. diff --git a/make-libhover-tarball.sh b/make-libhover-tarball.sh index ab51806..431510a 100755 --- a/make-libhover-tarball.sh +++ b/make-libhover-tarball.sh @@ -7,5 +7,7 @@ rm -rf libhover svn export svn://dev.eclipse.org/svnroot/technology/org.eclipse.linuxtools/libhover/tags/$rel libhover cd libhover pwd +# We don't want newlib libhover shipped unconditionally +rm -rf org.eclipse.linuxtools.cdt.libhover.newlib* tar -czvf eclipse-cdt-fetched-src-libhover-$tag.tar.gz org.eclipse.linuxtools.cdt.libhover* diff --git a/sources b/sources index aebae89..6a05f07 100644 --- a/sources +++ b/sources @@ -1,5 +1,7 @@ 5c470fb0777d27541edbfa31443d91f7 eclipse-cdt-cppunit-20061102.tar.gz 2d4ae0a2131ba1efc896d981072cc091 eclipse-cdt-target_filter.gif.gz -23c3498e551936980269c83a0051d6b1 eclipse-cdt-fetched-src-libhover-R0_1_1.tar.gz d0b0b38accc5547e6209fda23c6c8d49 eclipse-cdt-fetched-src-CDT_6_0_0.tar.bz2 6cfdaee7d8ca1c14359225f7393e46ae eclipse-cdt-fetched-src-autotools-v200907241319.tar.gz +921f3464c4b5a284473ebdad634e5c2d libstdc++-v3.libhover +4bccad3ee92faaca4f8dc3ac6941434e glibc-2.7-2.libhover +2dbeff80a9c053b2888940a30f62d3f2 eclipse-cdt-fetched-src-libhover-R0_3_0.tar.gz