[eclipse-pydev] Patch to build with latest version of jython

Mat Booth mbooth at fedoraproject.org
Thu Jun 5 12:00:58 UTC 2014


commit ee3e28d48a96b898ed8ca99ad097bdd68d63b1d8
Author: Mat Booth <mat.booth at redhat.com>
Date:   Wed Jun 4 15:11:44 2014 +0100

    Patch to build with latest version of jython
    
    - Install license files
    - No longer need to package a portion of jython's lib dir

 .gitignore         |   39 +++------------------------------------
 eclipse-pydev.spec |   31 ++++++++++++++++++-------------
 jython-build.patch |   39 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 60 insertions(+), 49 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 3c408f6..d61a4b0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,36 +1,3 @@
-org.python.pydev.mylyn.feature-fetched-src-pydev_1_3_7.tar.bz2
-org.python.pydev.feature-1.4.5.2727-sources.zip
-org.python.pydev.feature-1.4.6.2788-sources.zip
-org.python.pydev.feature-1.4.7.2843-sources.zip
-org.python.pydev.feature-1.5.0.1251989166-sources.zip
-org.python.pydev.feature-1.5.1.1258496115-sources.zip
-org.python.pydev.feature-1.5.2.1260362205-sources.zip
-org.python.pydev.feature-1.5.3.1260390783-sources.zip
-org.python.pydev.feature-1.5.4.2010011921-sources.zip
-org.python.pydev.feature-1.5.5.2010030420-sources.zip
-org.python.pydev.feature-1.5.6.2010033101-sources.zip
-org.python.pydev.feature-1.5.7.2010050621-sources.zip
-org.python.pydev.feature-1.5.9.2010063001-sources.zip
-/org.python.pydev.feature-1.6.1.2010080312-sources.zip
-org.python.pydev-1.6.3.2010100513-sources.zip
-org.python.pydev-1.6.4.2011010200-sources.zip
-org.python.pydev-2.0.0.2011040403-sources.zip
-PyDev%202.2.0%20sources.zip
-PyDev-2.2.0-sources.zip
-/PyDev-2.2.1-sources.zip
-PyDev-2.2.2-sources.zip
-/org.python.pydev-2.2.3.2011100616-sources.zip
-/PyDev-2.2.4-sources.zip
-/PyDev-2.7.0-sources.zip
-/PyDev-2.7.1-sources.zip
-/PyDev-2.7.3-sources.zip
-/PyDev-2.7.4-sources.zip
-/PyDev-2.7.5-sources.zip
-/PyDev-2.8.1-sources.zip
-/PyDev-2.8.2-sources.zip
-/PyDev-3.0-sources.zip
-/PyDev-3.1.0-sources.zip
-/Pydev-pydev_3_2_0.tar.gz
-/Pydev-pydev_3_3_3.tar.gz
-/Pydev-pydev_3_4_1.tar.gz
-/Pydev-pydev_3_5_0.tar.gz
+/Pydev-pydev_*.tar.gz
+/Pydev-pydev_*/
+/eclipse-pydev-*.src.rpm
diff --git a/eclipse-pydev.spec b/eclipse-pydev.spec
index ad3b9ff..8c52adb 100644
--- a/eclipse-pydev.spec
+++ b/eclipse-pydev.spec
@@ -7,17 +7,20 @@ Epoch: 1
 Summary: Eclipse Python development plug-in
 Name:    eclipse-pydev
 Version:          3.5.0
-Release:          1%{?dist}
+Release:          2%{?dist}
 License:          EPL
 URL:              http://pydev.org
-Group:            Development/Tools
-#Fetched from https://github.com/fabioz/Pydev/archive/pydev_3_5_0.tar.gz
+
+# Fetched from https://github.com/fabioz/Pydev/archive/pydev_3_5_0.tar.gz
 Source0:          Pydev-pydev_3_5_0.tar.gz
 
 Patch0:           remove-winregistry.patch
 Patch1:           pydev-remove-jython.patch
 Patch2:           remove-iInfo-error.patch
 
+# Allow building with the latest version of jython in Fedora
+Patch3:           jython-build.patch
+
 BuildRequires:    java-devel >= 1.7.0
 BuildArch:        noarch
 
@@ -29,7 +32,7 @@ Requires: xmlrpc-common
 Requires: xmlrpc-client
 Requires: xmlrpc-server
 Requires: junit >= 3.8.1
-Requires: jython >= 2.2
+Requires: jython >= 2.5.3
 Requires: pylint
 Requires: jpathwatch
 Requires: python-django 
@@ -48,7 +51,7 @@ BuildRequires:    ws-commons-util
 BuildRequires:    xmlrpc-common
 BuildRequires:    xmlrpc-client
 BuildRequires:    xmlrpc-server
-BuildRequires:    jython >= 2.2
+BuildRequires:    jython >= 2.5.3
 BuildRequires:    jpathwatch
 BuildRequires:    tycho-extras
 BuildRequires:    feclipse-maven-plugin
@@ -62,7 +65,6 @@ Python development.
 Summary:  Pydev Mylyn Focused UI
 Requires: eclipse-mylyn
 Requires: %{name} = %{epoch}:%{version}-%{release}
-Group: Development/Tools
 
 %description mylyn
 Mylyn Task-Focused UI extensions for Pydev.
@@ -72,6 +74,7 @@ Mylyn Task-Focused UI extensions for Pydev.
 %patch0 
 %patch1
 %patch2 -p1
+%patch3 -p1
 
 #fix mylyn plugin version
 sed --in-place 's:libs/,\\:libs/:' plugins/org.python.pydev/build.properties 
@@ -101,7 +104,7 @@ ln -sf %{_jnidir}/jpathwatch.jar \
        plugins/org.python.pydev.core/lib/jpathwatch-0-95.jar
 
 mkdir plugins/org.python.pydev.jython/lib/
-ln -sf %{_javadir}/jython.jar \
+ln -sf %{_javadir}/jython/jython.jar \
        plugins/org.python.pydev.jython/lib/jython.jar
 
 ln -sf %{_datadir}/jython/Lib \
@@ -161,14 +164,10 @@ file=`find . -name xmlrpc-server-3.1.3.jar`
 rm -f $file
 ln -sf %{_javadir}/xmlrpc-server.jar $file
 
-# Symlink and copy required python libs before deleting Lib dir.
-mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/jython/Lib
-cp org.python.pydev.jython_%{version}.$qualifier/Lib/textwrap.py ${RPM_BUILD_ROOT}%{_datadir}/jython/Lib
-
+# Symlink system jython and libs
 rm -rf org.python.pydev.jython_%{version}.$qualifier/Lib
 ln -sf %{_datadir}/jython/Lib \
        org.python.pydev.jython_%{version}.$qualifier/Lib
-
 ln -sf %{_javadir}/jython.jar \
        org.python.pydev.jython_%{version}.$qualifier/lib
 popd
@@ -186,13 +185,19 @@ ln -sf /usr/lib`arch | sed 's/x86_//;s/i686//'`/python2.7/optparse.py %{_datadir
 rm -f  %{_datadir}/jython/Lib/optparse.py
 
 %files
+%doc LICENSE.txt README.txt
 %{install_loc}/pydev
-%{_datadir}/jython/Lib/*
 
 %files mylyn
+%doc LICENSE.txt
 %{install_loc}/pydev-mylyn
 
 %changelog
+* Mon Jun 02 2014 Mat Booth <mat.booth at redhat.com> - 1:3.5.0-2
+- Patch to build with latest version of jython
+- Install license files
+- No longer need to package a portion of jython's lib dir
+
 * Thu May 29 2014 Alexander Kurtakov <akurtako at redhat.com> 1:3.5.0-1
 - Update to 3.5.0.
 
diff --git a/jython-build.patch b/jython-build.patch
new file mode 100644
index 0000000..0f4f9be
--- /dev/null
+++ b/jython-build.patch
@@ -0,0 +1,39 @@
+diff --git a/plugins/org.python.pydev.jython/src/org/python/pydev/jython/IPythonInterpreter.java b/plugins/org.python.pydev.jython/src/org/python/pydev/jython/IPythonInterpreter.java
+index d9caad8..fe1e450 100644
+--- a/plugins/org.python.pydev.jython/src/org/python/pydev/jython/IPythonInterpreter.java
++++ b/plugins/org.python.pydev.jython/src/org/python/pydev/jython/IPythonInterpreter.java
+@@ -38,7 +38,7 @@ public interface IPythonInterpreter {
+      * @param class_ the java class that should be used as the return value
+      * @return the object with the variable requested as a java object
+      */
+-    Object get(String varName, Class class_);
++    <T> T get(String name, Class<T> javaclass);
+ 
+     /**
+      * This method returns the variable that we want to get from the interpreter as a PyObject
+diff --git a/plugins/org.python.pydev.jython/src/org/python/pydev/jython/JythonPlugin.java b/plugins/org.python.pydev.jython/src/org/python/pydev/jython/JythonPlugin.java
+index cef86ca..2981fe6 100644
+--- a/plugins/org.python.pydev.jython/src/org/python/pydev/jython/JythonPlugin.java
++++ b/plugins/org.python.pydev.jython/src/org/python/pydev/jython/JythonPlugin.java
+@@ -28,7 +28,7 @@ import org.osgi.framework.Bundle;
+ import org.osgi.framework.BundleContext;
+ import org.python.core.PyClass;
+ import org.python.core.PyException;
+-import org.python.core.PyJavaClass;
++import org.python.core.PyJavaType;
+ import org.python.core.PyObject;
+ import org.python.core.PySystemState;
+ import org.python.pydev.core.log.Log;
+@@ -530,9 +530,9 @@ public class JythonPlugin extends AbstractUIPlugin {
+             //actually, this is more likely to happen when raising an exception in jython
+             if (e instanceof PyException) {
+                 PyException pE = (PyException) e;
+-                if (pE.type instanceof PyJavaClass) {
+-                    PyJavaClass t = (PyJavaClass) pE.type;
+-                    if (t.__name__ != null && t.__name__.equals("org.python.pydev.jython.ExitScriptException")) {
++                if (pE.type instanceof PyJavaType) {
++                    PyJavaType t = (PyJavaType) pE.type;
++                    if (t.getName() != null && t.getName().equals("org.python.pydev.jython.ExitScriptException")) {
+                         return null;
+                     }
+                 } else if (pE.type instanceof PyClass) {


More information about the scm-commits mailing list