[eclipse/f21] Backport fix for eclipse bz438992

Mat Booth mbooth at fedoraproject.org
Tue Jul 15 10:05:46 UTC 2014


commit 07c056ffd6f767fe1ded603c11d615a1118a3b9d
Author: Mat Booth <mat.booth at redhat.com>
Date:   Tue Jul 15 10:40:56 2014 +0100

    Backport fix for eclipse bz438992
    
    - Only assemble products for current running target environment
    - Tidy up some unnecessary SCL bits

 eclipse-bug-438992.patch |   96 ++++++++++++++++++++++++++++++++++++++++++++++
 eclipse.spec             |   26 ++++++++-----
 2 files changed, 112 insertions(+), 10 deletions(-)
---
diff --git a/eclipse-bug-438992.patch b/eclipse-bug-438992.patch
new file mode 100644
index 0000000..6bd8a82
--- /dev/null
+++ b/eclipse-bug-438992.patch
@@ -0,0 +1,96 @@
+From faa3866df482c0e42ac5b308a5551882f833a3aa Mon Sep 17 00:00:00 2001
+From: Alexander Kurtakov
+Date: Thu, 10 Jul 2014 09:06:28 +0300
+Subject: Bug 438992 - Combo dropdown has empty space at top
+
+Setting wrap_width also trims the empty whitespace on top for combo
+popup.
+
+Change-Id: I073d1ccef913de8f1ccfa0ff1eb09538606f8f74
+Signed-off-by: Alexander Kurtakov <akurtako at redhat.com>
+
+diff --git a/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c
+index 89185b9..813f451 100644
+--- a/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c	
++++ b/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c	
+@@ -9970,6 +9970,16 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1combo_1box_1set_1focus_1on_1click)
+ }
+ #endif
+ 
++#ifndef NO__1gtk_1combo_1box_1set_1wrap_1width
++JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1combo_1box_1set_1wrap_1width)
++	(JNIEnv *env, jclass that, jintLong arg0, jint arg1)
++{
++	OS_NATIVE_ENTER(env, that, _1gtk_1combo_1box_1set_1wrap_1width_FUNC);
++	gtk_combo_box_set_wrap_width((GtkComboBox *)arg0, (gint)arg1);
++	OS_NATIVE_EXIT(env, that, _1gtk_1combo_1box_1set_1wrap_1width_FUNC);
++}
++#endif
++
+ #ifndef NO__1gtk_1combo_1box_1text_1insert
+ JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1combo_1box_1text_1insert)
+ 	(JNIEnv *env, jclass that, jintLong arg0, jint arg1, jbyteArray arg2, jbyteArray arg3)
+diff --git a/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c
+index fefc07e..16d6664 100644
+--- a/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c	
++++ b/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c	
+@@ -723,6 +723,7 @@ char * OS_nativeFunctionNames[] = {
+ 	"_1gtk_1combo_1box_1remove_1text",
+ 	"_1gtk_1combo_1box_1set_1active",
+ 	"_1gtk_1combo_1box_1set_1focus_1on_1click",
++	"_1gtk_1combo_1box_1set_1wrap_1width",
+ 	"_1gtk_1combo_1box_1text_1insert",
+ 	"_1gtk_1combo_1box_1text_1new",
+ 	"_1gtk_1combo_1box_1text_1new_1with_1entry",
+diff --git a/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h
+index aa408c5..78460d0 100644
+--- a/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h	
++++ b/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h	
+@@ -733,6 +733,7 @@ typedef enum {
+ 	_1gtk_1combo_1box_1remove_1text_FUNC,
+ 	_1gtk_1combo_1box_1set_1active_FUNC,
+ 	_1gtk_1combo_1box_1set_1focus_1on_1click_FUNC,
++	_1gtk_1combo_1box_1set_1wrap_1width_FUNC,
+ 	_1gtk_1combo_1box_1text_1insert_FUNC,
+ 	_1gtk_1combo_1box_1text_1new_FUNC,
+ 	_1gtk_1combo_1box_1text_1new_1with_1entry_FUNC,
+diff --git a/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
+index b531bf9..ab42819 100644
+--- a/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java	
++++ b/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java	
+@@ -7135,6 +7135,19 @@ public static final void gtk_combo_box_set_active(long /*int*/ combo_box, int in
+ 		lock.unlock();
+ 	}
+ }
++/**
++ * @param combo_box cast=(GtkComboBox *)
++ * @param width cast=(gint)
++ */
++public static final native void _gtk_combo_box_set_wrap_width(long /*int*/ combo_box, int width);
++public static final void gtk_combo_box_set_wrap_width(long /*int*/ combo_box, int width) {
++	lock.lock();
++	try {
++		_gtk_combo_box_set_wrap_width(combo_box, width);
++	} finally {
++		lock.unlock();
++	}
++}
+ /** @method flags=dynamic */
+ public static final native int _gtk_combo_box_get_active(long /*int*/ combo_box);
+ public static final int gtk_combo_box_get_active(long /*int*/ combo_box) {
+diff --git a/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java
+index ea5a93e..6589c9e 100644
+--- a/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java	
++++ b/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java	
+@@ -455,6 +455,8 @@ void createHandle (int index) {
+ 		if (handle == 0) error (SWT.ERROR_NO_HANDLES);
+ 		cellHandle = OS.gtk_bin_get_child (handle);
+ 		if (cellHandle == 0) error (SWT.ERROR_NO_HANDLES);
++		// Setting wrap width has the side effect of removing the whitespace on top in popup bug#438992
++		OS.gtk_combo_box_set_wrap_width(handle, 1);
+ 	} else {
+ 		if (OS.GTK3) {
+ 			handle = OS.gtk_combo_box_text_new_with_entry();
+-- 
+cgit v0.10.1-9-gd18e
+
diff --git a/eclipse.spec b/eclipse.spec
index d010a80..a8ac5c6 100644
--- a/eclipse.spec
+++ b/eclipse.spec
@@ -1,6 +1,5 @@
 %{?scl:%scl_package eclipse}
 %{!?scl:%global pkg_name %{name}}
-%{!?scl:%global _scl_root %{nil}}
 
 # Set to 1 to build Eclipse without dependency to eclipse-pde
 # Some parts (help) will not be built, and second run will be required,
@@ -39,7 +38,7 @@ Epoch:                  1
 Summary:        An open, extensible IDE
 Name:           %{?scl_prefix}eclipse
 Version:        %{eclipse_version}
-Release:        5%{?dist}
+Release:        6%{?dist}
 License:        EPL
 Group:          Development/Tools
 URL:            http://www.eclipse.org/
@@ -112,6 +111,9 @@ Patch21:        %{pkg_name}-mockito.patch
 
 Patch22:        %{pkg_name}-policy-comparators.patch
 
+# https://bugs.eclipse.org/bugs/show_bug.cgi?id=438992
+Patch23:        %{pkg_name}-bug-438992.patch
+
 BuildRequires: rsync
 BuildRequires: make, gcc
 BuildRequires: gtk2-devel
@@ -321,6 +323,7 @@ tar --strip-components=1 -xf %{SOURCE1}
 %patch20
 %patch21
 %patch22
+%patch23 -p1
 
 #Disable as many things as possible to make the build faster. We care only for Eclipse.
 %pom_disable_module platform.sdk eclipse.platform.releng.tychoeclipsebuilder
@@ -452,8 +455,6 @@ done
 cp -r %{_javadir}/eclipse-license/eclipse/features/* .m2/p2/repo-sdk/features/
 cp -r %{_javadir}/emf/eclipse/features/* .m2/p2/repo-sdk/features/
 cp -r %{_javadir}/ecf/eclipse/features/* .m2/p2/repo-sdk/features/
-%{?scl: cp %{_javadir}/ecf/eclipse/plugins/* .m2/p2/repo-sdk/plugins}
-%{?scl: cp %{_javadir}/*sat4j* .m2/p2/repo-sdk/plugins}
 %if ! %{bootstrap}
 cp -rf %{_libdir}/eclipse/dropins/sdk/plugins/org.eclipse.pde.build_* .m2/p2/repo-sdk/plugins/
 cp -rf %{_libdir}/eclipse/dropins/sdk/plugins/org.eclipse.pde.core_* .m2/p2/repo-sdk/plugins/
@@ -491,7 +492,7 @@ xmvn -o clean verify \
    -Declipse.javadoc=/usr/bin/javadoc \
    -Dmaven.test.skip=true -Dnative=gtk.linux.%{eclipse_arch} \
    -Dtycho.local.keepTarget -DbuildId=`echo "%{release}" | tr -d "."` \
-   -Dtargets=install
+   -Dtargets=install -Ddirector.running.env.only=true
 
 #symlink necessary plugins (that are provided by other packages)
 dependencies/replace_platform_plugins_with_symlinks.sh \
@@ -560,7 +561,7 @@ cat >> eclipse.ini <<EOF
 -XX:CompileCommand=exclude,org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage,addBinding
 -XX:CompileCommand=exclude,org/python/pydev/editor/codecompletion/revisited/PythonPathHelper,isValidSourceFile
 -XX:CompileCommand=exclude,org/eclipse/tycho/core/osgitools/EquinoxResolver,newState
--Dorg.eclipse.equinox.p2.reconciler.dropins.directory=%{_scl_root}/usr/share/eclipse/dropins
+-Dorg.eclipse.equinox.p2.reconciler.dropins.directory=%{?_scl_root}/usr/share/eclipse/dropins
 -Declipse.p2.skipMovedInstallDetection=true
 EOF
 
@@ -620,7 +621,7 @@ TARGET_LAUNCHER=%{_libdir}/%{pkg_name}/plugins/`ls eclipse.platform.releng.tycho
 sed -i -e "s, at LAUNCHER@,${TARGET_LAUNCHER}," $RPM_BUILD_ROOT%{_bindir}/efj
 
 #eclipse binary
-pushd $RPM_BUILD_ROOT%{_scl_root}%{_bindir}
+pushd $RPM_BUILD_ROOT%{_bindir}
     ln -s %{_libdir}/%{pkg_name}/eclipse
 popd 
 
@@ -651,7 +652,7 @@ popd
 # Symlink OSGI jars into javadir
 for J in osgi osgi.services osgi.util osgi.compatibility.state equinox.http.servlet ; do
   pushd $RPM_BUILD_ROOT%{_javadir}/eclipse
-    DIR=%{?scl: ../../../../}../../../..%{_libdir}/%{pkg_name}
+    DIR=%{?scl:../../../../}../../../..%{_libdir}/%{pkg_name}
     [ -e "`ls $DIR/plugins/org.eclipse.${J}_*.jar`" ] && ln -s $DIR/plugins/org.eclipse.${J}_*.jar ${J}.jar
     [ -e "`ls $DIR/dropins/*/plugins/org.eclipse.${J}_*.jar`" ] && ln -s $DIR/dropins/*/plugins/org.eclipse.${J}_*.jar ${J}.jar
   popd
@@ -718,7 +719,7 @@ pushd $RPM_BUILD_ROOT/%{_javadir}/eclipse-testing/plugins
 popd
 
 sed -i -e "s#@libdir@#%{_libdir}#" $RPM_BUILD_ROOT/%{_javadir}/eclipse-testing/runtests.sh
-sed -i -e "s#@USR@#%{?scl:%{_scl_root}}%{_usr}#" $RPM_BUILD_ROOT/%{_javadir}/eclipse-testing/runtests.sh
+sed -i -e "s#@USR@#%{?_scl_root}%{_usr}#" $RPM_BUILD_ROOT/%{_javadir}/eclipse-testing/runtests.sh
 touch $RPM_BUILD_ROOT%{_bindir}/%{pkg_name}-runEclipsePackageTests
 chmod a+x  $RPM_BUILD_ROOT/%{_bindir}/%{pkg_name}-runEclipsePackageTests
 echo '#!/bin/sh' >>  $RPM_BUILD_ROOT/%{_bindir}/%{pkg_name}-runEclipsePackageTests
@@ -739,7 +740,7 @@ sed -i 's|\.\+/\(prepAllTestBundles\.sh\)|%{_javadir}/eclipse-testing/testbundle
 sed -i 's|cp swtbot-library.xml alltest.xml updateTestBundleXML.sh target/|cp %{_javadir}/eclipse-testing/testbundle/{swtbot-library.xml,alltest.xml,updateTestBundleXML.sh} target/|' prepRuntimeLocation.sh
 
 for file in genRepo.sh gatherBundles.sh ;do
-  sed -i 's|scl_root=|scl_root=%{_scl_root}|' ${file}
+  sed -i 's|scl_root=|scl_root=%{?_scl_root}|' ${file}
 done
 
 mv $RPM_BUILD_ROOT/%{_javadir}/eclipse-testing/testbundle/%{pkg_name}-runTestBundles $RPM_BUILD_ROOT/%{_bindir}/%{pkg_name}-runTestBundles
@@ -1016,6 +1017,11 @@ fi
 %{_libdir}/%{pkg_name}/plugins/org.eclipse.osgi.compatibility.state_*
 
 %changelog
+* Tue Jul 15 2014 Mat Booth <mat.booth at redhat.com> - 1:4.4.0-6
+- Backport fix for eclipse bz438992
+- Only assemble products for current running target environment
+- Tidy up some unnecessary SCL bits
+
 * Tue Jul 08 2014 Mat Booth <mat.booth at redhat.com> - 1:4.4.0-5
 - Make GTK3 the default SWT implementation in eclipse.ini
 


More information about the scm-commits mailing list