summaryrefslogtreecommitdiff
path: root/libre/clojure/clojure-replace_asm.patch
blob: 4fe1a4ef9433da51919eccd650302733e8300352 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
--- clojure-1.8.0.orig/build.xml	2016-01-19 14:29:20.000000000 -0500
+++ clojure-1.8.0/build.xml	2016-01-23 16:45:54.194673136 -0500
@@ -40,6 +40,7 @@
   <target name="compile-java" depends="init"
           description="Compile Java sources.">
     <javac srcdir="${jsrc}" destdir="${build}" includeJavaRuntime="yes"
+           classpath="/usr/share/java/asm-4.jar:/usr/share/java/asm-commons-4.jar"
            includeAntRuntime="false"
            debug="true" source="1.6" target="1.6"/>
   </target>
@@ -47,7 +48,7 @@
   <target name="compile-clojure"
           description="Compile Clojure sources.">
     <java classname="clojure.lang.Compile"
-          classpath="${maven.compile.classpath}:${build}:${cljsrc}"
+          classpath="/usr/share/java/asm-4.jar:/usr/share/java/asm-commons-4.jar:${maven.compile.classpath}:${build}:${cljsrc}"
           failonerror="true"
           fork="true">
       <sysproperty key="clojure.compile.path" value="${build}"/>
@@ -92,7 +93,7 @@
            debug="true" source="1.6" target="1.6" includeantruntime="no"/>
     <echo>Direct linking = ${directlinking}</echo>
     <java classname="clojure.lang.Compile"
-          classpath="${test-classes}:${test}:${build}:${cljsrc}"
+          classpath="/usr/share/java/asm-4.jar:/usr/share/java/asm-commons-4.jar:${test-classes}:${test}:${build}:${cljsrc}"
           failonerror="true"
 	  fork="true">
       <sysproperty key="clojure.compile.path" value="${test-classes}"/>
@@ -115,6 +116,8 @@
                    value="#{clojure.test-clojure.compilation.load-ns}"/>
       <sysproperty key="clojure.compiler.direct-linking" value="${directlinking}"/>
       <classpath>
+        <path location="/usr/share/java/asm-4.jar"/>
+        <path location="/usr/share/java/asm-commons-4.jar"/>
         <pathelement path="${maven.test.classpath}"/>
         <path location="${test-classes}"/>
         <path location="${test}"/>
@@ -133,6 +136,8 @@
       <sysproperty key="clojure.compiler.direct-linking" value="${directlinking}"/>
       <classpath>
         <pathelement path="${maven.test.classpath}"/>
+        <path location="/usr/share/java/asm-4.jar"/>
+        <path location="/usr/share/java/asm-commons-4.jar"/>
         <path location="${test-classes}"/>
         <path location="${test}"/>
         <path location="${build}"/>
--- clojure-1.8.0.orig/src/clj/clojure/core.clj	2016-01-19 14:29:20.000000000 -0500
+++ clojure-1.8.0/src/clj/clojure/core.clj	2016-01-23 16:50:12.926280030 -0500
@@ -5246,10 +5246,10 @@
                    (.getAnnotation c java.lang.annotation.Retention)] 
           (= (.value r) java.lang.annotation.RetentionPolicy/RUNTIME)))))
 
-(defn- descriptor [^Class c] (clojure.asm.Type/getDescriptor c))
+(defn- descriptor [^Class c] (org.objectweb.asm.Type/getDescriptor c))
 
 (declare process-annotation)
-(defn- add-annotation [^clojure.asm.AnnotationVisitor av name v]
+(defn- add-annotation [^org.objectweb.asm.AnnotationVisitor av name v]
   (cond
    (vector? v) (let [avec (.visitArray av name)]
                  (doseq [vval v]
@@ -5259,7 +5259,7 @@
                  (cond 
                   (instance? java.lang.Enum ev)
                   (.visitEnum av name (descriptor (class ev)) (str ev))
-                  (class? ev) (.visit av name (clojure.asm.Type/getType ev))
+                  (class? ev) (.visit av name (org.objectweb.asm.Type/getType ev))
                   :else (throw (IllegalArgumentException. 
                                 (str "Unsupported annotation value: " v " of class " (class ev))))))
    (seq? v) (let [[nested nv] v
--- clojure-1.8.0.orig/src/clj/clojure/core_proxy.clj	2016-01-19 14:29:20.000000000 -0500
+++ clojure-1.8.0/src/clj/clojure/core_proxy.clj	2016-01-23 16:51:18.359981058 -0500
@@ -11,9 +11,9 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;; proxy ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 (import
- '(clojure.asm ClassWriter ClassVisitor Opcodes Type) 
+ '(org.objectweb.asm ClassWriter ClassVisitor Opcodes Type) 
  '(java.lang.reflect Modifier Constructor)
- '(clojure.asm.commons Method GeneratorAdapter)
+ '(org.objectweb.asm.commons Method GeneratorAdapter)
  '(clojure.lang IProxy Reflector DynamicClassLoader IPersistentMap PersistentHashMap RT))
 
 (defn method-sig [^java.lang.reflect.Method meth]
--- clojure-1.8.0.orig/src/clj/clojure/genclass.clj	2016-01-19 14:29:20.000000000 -0500
+++ clojure-1.8.0/src/clj/clojure/genclass.clj	2016-01-23 16:52:02.684638807 -0500
@@ -9,8 +9,8 @@
 (in-ns 'clojure.core)
 
 (import '(java.lang.reflect Modifier Constructor)
-        '(clojure.asm ClassWriter ClassVisitor Opcodes Type)
-        '(clojure.asm.commons Method GeneratorAdapter)
+        '(org.objectweb.asm ClassWriter ClassVisitor Opcodes Type)
+        '(org.objectweb.asm.commons Method GeneratorAdapter)
         '(clojure.lang IPersistentMap))
 
 ;(defn method-sig [^java.lang.reflect.Method meth]
--- clojure-1.8.0.orig/src/clj/clojure/reflect/java.clj	2016-01-19 14:29:20.000000000 -0500
+++ clojure-1.8.0/src/clj/clojure/reflect/java.clj	2016-01-23 16:58:39.629981468 -0500
@@ -11,7 +11,7 @@
 
 (require '[clojure.set :as set]
          '[clojure.string :as str])
-(import '[clojure.asm ClassReader ClassVisitor Type Opcodes]
+(import '[org.objectweb.asm ClassReader ClassVisitor Type Opcodes]
          '[java.lang.reflect Modifier]
          java.io.InputStream)
 
--- clojure-1.8.0.orig/src/jvm/clojure/lang/Compiler.java	2016-01-19 14:29:20.000000000 -0500
+++ clojure-1.8.0/src/jvm/clojure/lang/Compiler.java	2016-01-23 16:56:35.772261713 -0500
@@ -12,11 +12,12 @@
 
 package clojure.lang;
 
-//*
+/*
 
 import clojure.asm.*;
 import clojure.asm.commons.GeneratorAdapter;
 import clojure.asm.commons.Method;
+*/
 
 import java.io.*;
 import java.lang.reflect.Constructor;
@@ -26,14 +27,15 @@
 import java.util.regex.Matcher;
 
 //*/
-/*
+///*
 
 import org.objectweb.asm.*;
 import org.objectweb.asm.commons.Method;
 import org.objectweb.asm.commons.GeneratorAdapter;
+/*
 import org.objectweb.asm.util.TraceClassVisitor;
 import org.objectweb.asm.util.CheckClassAdapter;
-//*/
+*/
 
 public class Compiler implements Opcodes{
 
--- clojure-1.8.0.orig/src/jvm/clojure/lang/Intrinsics.java	2016-01-19 14:29:20.000000000 -0500
+++ clojure-1.8.0/src/jvm/clojure/lang/Intrinsics.java	2016-01-23 16:57:05.184262012 -0500
@@ -12,7 +12,7 @@
 
 package clojure.lang;
 
-import clojure.asm.Opcodes;
+import org.objectweb.asm.Opcodes;
 
 public class Intrinsics implements Opcodes{
 private static Object[] oa(Object... arr){
--- clojure-1.8.0.orig/test/clojure/test_clojure/reflect.clj	2016-01-19 14:29:20.000000000 -0500
+++ clojure-1.8.0/test/clojure/test_clojure/reflect.clj	2016-01-23 16:59:58.489740657 -0500
@@ -26,7 +26,7 @@
 
 (deftest field-descriptor->class-symbol-test
   (are [s d] (= s (@#'reflect/field-descriptor->class-symbol d))
-       'clojure.asm.Type<><> "[[Lclojure/asm/Type;"
+       'org.objectweb.asm.Type<><> "[[Lclojure/asm/Type;"
        'int "I"
        'java.lang.Object "Ljava.lang.Object;"))
 
--- clojure-1.8.0.orig/pom.xml	2016-01-19 14:29:20.000000000 -0500
+++ clojure-1.8.0/pom.xml	2016-01-23 17:02:41.205699248 -0500
@@ -73,6 +73,16 @@
         </exclusion>
       </exclusions>
     </dependency>
+    <dependency>
+      <groupId>org.ow2.asm</groupId>
+      <artifactId>asm</artifactId>
+      <version>5.0.4</version>
+    </dependency>
+    <dependency>
+      <groupId>org.ow2.asm</groupId>
+      <artifactId>asm-commons</artifactId>
+      <version>5.0.4</version>
+    </dependency>
   </dependencies>
 
   <build>