Use older intellij libraries for kotlin-0

Julien LepillerThu May 16 22:33:28+0200 2019

f1cec48

Use older intellij libraries for kotlin-0

more/packages/intellij.scm

1717
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
1818
1919
(define-module (more packages intellij)
20+
  #:use-module (ice-9 match)
21+
  #:use-module (srfi srfi-1)
2022
  #:use-module ((guix licenses) #:prefix license:)
2123
  #:use-module (gnu packages)
2224
  #:use-module (guix packages)

3436
  #:use-module (gnu packages compression)
3537
  #:use-module (gnu packages docbook)
3638
  #:use-module (gnu packages java)
39+
  #:use-module (gnu packages java-compression)
3740
  #:use-module (gnu packages maven)
3841
  #:use-module (gnu packages perl)
3942
  #:use-module (gnu packages web)
4043
  #:use-module (gnu packages xml)
4144
  #:use-module (more packages java))
4245
46+
(define intellij-community-2013-commit "8bc091c3131a888b5400c63a9e51eb0bc7fbe0fb")
47+
(define intellij-community-2013-version (git-version "0.0.0" "0"
48+
                                                     intellij-community-2013-commit))
49+
4350
;; The release page on github is a mess
4451
(define intellij-community-version "182.5262.8")
4552
(define intellij-community-commit "e2a5d9273ec0b3b656c0dad0c9b07e5f85bbd61a")
46-
(define (intellij-community-source commit version)
53+
(define (get-intellij-community-source commit version hash)
4754
  (origin
4855
    (method git-fetch)
4956
    (uri (git-reference
5057
           (url "https://github.com/JetBrains/intellij-community")
5158
           (commit commit)))
5259
    (file-name (git-file-name "intellij" version))
53-
    (sha256
54-
     (base32
55-
      "17qzhh2kw6sxwkyj7ng7hrpbcf2rjs2xjbsrg1bgkg90r5kb8sm4"))
60+
    (sha256 (base32 hash))
5661
    (modules '((guix build utils)))
5762
    (snippet
5863
      `(begin

6671
         (for-each delete-file (find-files "." ".*.jar$"))
6772
         #t))))
6873
74+
(define intellij-community-source (get-intellij-community-source
75+
                                    intellij-community-commit
76+
                                    intellij-community-version
77+
                                    "17qzhh2kw6sxwkyj7ng7hrpbcf2rjs2xjbsrg1bgkg90r5kb8sm4"))
78+
(define intellij-community-2013-source (get-intellij-community-source
79+
                                        intellij-community-2013-commit
80+
                                        intellij-community-2013-version
81+
                                        "0z5rq713lf7q2x0c0sb0r1ha2pszcyygddh7r12wyzf5p0iiy1im"))
82+
83+
(define (strip-intellij-variant variant-property base)
84+
  (package
85+
    (inherit base)
86+
    (properties (alist-delete variant-property (package-properties base)))))
87+
88+
(define (package-intellij-for-explicit-version version source variant-property base)
89+
  (define variant
90+
    (assq-ref (package-properties base) variant-property))
91+
92+
  (define (map-inputs inputs)
93+
    (map (lambda (input)
94+
           (match input
95+
             ((name input)
96+
              (if (and
97+
                    (> (string-length name) 13)
98+
                    (equal? (substring name 0 13) "java-intellij"))
99+
                  `(,name ,(package-intellij-for-explicit-version
100+
                             version source variant-property input))
101+
                  `(,name ,input)))))
102+
         inputs))
103+
104+
  (cond
105+
    (variant => force)
106+
    (else
107+
      (package
108+
        (inherit base)
109+
        (version version)
110+
        (source source)
111+
        (propagated-inputs (map-inputs (package-propagated-inputs base)))
112+
        (inputs (map-inputs (package-inputs base)))))))
113+
114+
(define-public (intellij-2013-package base)
115+
  (package-intellij-for-explicit-version intellij-community-2013-version
116+
                                         intellij-community-2013-source
117+
                                         'intellij-2013-variant
118+
                                         base))
119+
(define-public (strip-2013-variant base)
120+
  (strip-intellij-variant 'intellij-2013-variant base))
121+
69122
(define-public java-intellij-compiler-instrumentation-util
70123
  (package
71124
    (name "java-intellij-compiler-instrumentation-util")
72125
    (version intellij-community-version)
73-
    (source (intellij-community-source intellij-community-commit version))
126+
    (source intellij-community-source)
74127
    (build-system ant-build-system)
75128
    (arguments
76129
     `(#:source-dir "java/compiler/instrumentation-util/src"

96149
  (package
97150
    (name "java-intellij-compiler-javac2")
98151
    (version intellij-community-version)
99-
    (source (intellij-community-source intellij-community-commit version))
152+
    (source intellij-community-source)
100153
    (build-system ant-build-system)
101154
    (arguments
102155
     `(#:source-dir "java/compiler/javac2/src"

114167
  (package
115168
    (name "java-intellij-platform-forms-rt")
116169
    (version intellij-community-version)
117-
    (source (intellij-community-source intellij-community-commit version))
170+
    (source intellij-community-source)
118171
    (build-system ant-build-system)
119172
    (arguments
120173
     `(#:source-dir "platform/forms_rt/src"

130183
  (package
131184
    (name "java-intellij-platform-util-rt")
132185
    (version intellij-community-version)
133-
    (source (intellij-community-source intellij-community-commit version))
186+
    (source intellij-community-source)
134187
    (build-system ant-build-system)
135188
    (arguments
136189
     `(#:source-dir "platform/util-rt/src"

149202
  (package
150203
    (name "java-intellij-platform-util")
151204
    (version intellij-community-version)
152-
    (source (intellij-community-source intellij-community-commit version))
205+
    (source intellij-community-source)
153206
    (build-system ant-build-system)
154207
    (arguments
155208
     `(#:source-dir "platform/util/src"

168221
             (delete-file "platform/util/src/com/intellij/util/ui/IsRetina.java")
169222
             #t)))))
170223
    (propagated-inputs
171-
     `(("java-batik" ,java-batik)
224+
     `(("java-batik-1.7" ,java-batik-1.7)
172225
       ("java-commons-compress" ,java-commons-compress)
173226
       ("java-imagescalr" ,java-imagescalr)
174227
       ("java-intellij-platform-util-rt" ,java-intellij-platform-util-rt)

182235
       ("java-native-access-platform" ,java-native-access-platform)
183236
       ("java-trove4j-intellij" ,java-trove4j-intellij)
184237
       ("java-w3c-svg" ,java-w3c-svg)))
238+
    (properties
239+
     `((intellij-2013-variant . ,(delay java-intellij-platform-util-2013))))
185240
    (home-page "https://github.com/JetBrains/intellij-community")
186241
    (synopsis "")
187242
    (description "")
188243
    (license license:asl2.0)))
189244
245+
(define-public java-intellij-platform-util-2013
246+
  (let ((base (intellij-2013-package (strip-2013-variant java-intellij-platform-util))))
247+
    (package
248+
      (inherit base)
249+
      (propagated-inputs
250+
       (append (alist-delete "java-jdom-for-intellij" (package-propagated-inputs base))
251+
               `(("java-batik" ,java-batik)
252+
                 ("java-iq80-snappy" ,java-iq80-snappy)
253+
                 ("java-jdom1-for-intellij" ,java-jdom1-for-intellij))))
254+
      (arguments
255+
        (substitute-keyword-arguments (package-arguments base)
256+
          ((#:phases phases)
257+
           `(modify-phases ,phases
258+
              (add-before 'build 'fix-implicit-conversions
259+
                (lambda _
260+
                  (substitute* "build.xml"
261+
                    (("<javac") "<javac source=\"1.6\""))))
262+
              (delete 'remove-apple))))))))
263+
                ;(lambda _
264+
                ;  (delete-file "platform/util/src/com/intellij/util/AppleHiDPIScaledImage.java")
265+
                ;  (delete-file "platform/util/src/com/intellij/util/ui/IsRetina.java")
266+
                ;  (delete-file "platform/util/src/com/intellij/util/RetinaImage.java")
267+
                ;  (substitute* "platform/util/src/com/intellij/util/ui/UIUtil.java"
268+
                ;    (("IsRetina.isRetina\\(\\)") "false"))
269+
                ;  #t)))))))))
270+
190271
(define-public java-intellij-platform-extensions
191272
  (package
192273
    (name "java-intellij-platform-extensions")
193274
    (version intellij-community-version)
194-
    (source (intellij-community-source intellij-community-commit version))
275+
    (source intellij-community-source)
195276
    (build-system ant-build-system)
196277
    (arguments
197278
     `(#:source-dir "platform/extensions/src"

211292
  (package
212293
    (name "java-intellij-platform-core-api")
213294
    (version intellij-community-version)
214-
    (source (intellij-community-source intellij-community-commit version))
295+
    (source intellij-community-source)
215296
    (build-system ant-build-system)
216297
    (arguments
217298
     `(#:source-dir "platform/core-api/src"

235316
  (package
236317
    (name "java-intellij-platform-core-impl")
237318
    (version intellij-community-version)
238-
    (source (intellij-community-source intellij-community-commit version))
319+
    (source intellij-community-source)
239320
    (build-system ant-build-system)
240321
    (arguments
241322
     `(#:source-dir "platform/core-impl/src"

254335
  (package
255336
    (name "java-intellij-java-psi-api")
256337
    (version intellij-community-version)
257-
    (source (intellij-community-source intellij-community-commit version))
338+
    (source intellij-community-source)
258339
    (build-system ant-build-system)
259340
    (arguments
260341
     `(#:source-dir "java/java-psi-api/src"

281362
  (package
282363
    (name "java-intellij-java-psi-impl")
283364
    (version intellij-community-version)
284-
    (source (intellij-community-source intellij-community-commit version))
365+
    (source intellij-community-source)
285366
    (build-system ant-build-system)
286367
    (arguments
287368
      ;; TODO: remove these auto-generated files and generate them with

323404
  (package
324405
    (name "java-intellij-platform-resources")
325406
    (version intellij-community-version)
326-
    (source (intellij-community-source intellij-community-commit version))
407+
    (source intellij-community-source)
327408
    (build-system ant-build-system)
328409
    (arguments
329410
      ;; TODO: remove these auto-generated files and generate them with

352433
  (package
353434
    (name "java-intellij-resources")
354435
    (version intellij-community-version)
355-
    (source (intellij-community-source intellij-community-commit version))
436+
    (source intellij-community-source)
356437
    (build-system ant-build-system)
357438
    (arguments
358439
      ;; TODO: remove these auto-generated files and generate them with

442523
  (package
443524
    (name "java-intellij-compiler-forms-compiler")
444525
    (version intellij-community-version)
445-
    (source (intellij-community-source intellij-community-commit version))
526+
    (source intellij-community-source)
446527
    (build-system ant-build-system)
447528
    (arguments
448529
     `(#:source-dir "java/compiler/forms-compiler/src"

more/packages/java.scm

21732173
               (install-file "build/jdom.jar" jar-dir)
21742174
               #t))))))))
21752175
2176+
;; One commit before the rename to jdom2
2177+
;; How to find the version that's supposed to be used though?
2178+
(define-public java-jdom1-for-intellij
2179+
  (package
2180+
    (inherit java-jdom)
2181+
    (version "1.1.1-intellij")
2182+
    (source (origin
2183+
              (method git-fetch)
2184+
              (uri (git-reference
2185+
                     (url "https://github.com/JetBrains/intellij-deps-jdom")
2186+
                     (commit "fac95752180b2e0e27fe6539cad819623d50975a")))
2187+
              (file-name (git-file-name "java-jdom" version))
2188+
              (sha256
2189+
               (base32
2190+
                "1iyqysa71fjhnr5q61cbx1q6brkx4mpbvg33zzrhagjmkslw2axn"))
2191+
              (modules '((guix build utils)))
2192+
              (snippet
2193+
                `(begin
2194+
                   (for-each delete-file (find-files "." ".*.jar$"))
2195+
                   #t))))
2196+
    (arguments
2197+
     `(#:jar-name "jdom.jar"
2198+
       #:tests? #f
2199+
       #:source-dir "core/src/java"))
2200+
    (inputs
2201+
     `(("java-jaxen" ,java-jaxen)))
2202+
    (native-inputs
2203+
      (append (package-native-inputs java-jdom)
2204+
              `(("unzip" ,unzip))))))
2205+
21762206
(define-public java-jdom-for-intellij
21772207
  (package
21782208
    (inherit java-jdom)

67306760
    (description "")
67316761
    (license license:asl2.0)))
67326762
6763+
(define-public java-batik-1.7
6764+
  (package
6765+
    (inherit java-batik)
6766+
    (name "java-batik")
6767+
    (version "1.7")
6768+
    (source (origin
6769+
              (method url-fetch)
6770+
              (uri (string-append "mirror://apache/xmlgraphics/batik/source/"
6771+
                                  "batik-src-" version ".zip"))
6772+
              (sha256
6773+
               (base32
6774+
                "1zbrffb8xrddb41sn8fzq40wxc5i8177cl9nm0gmd5x78csmkskb"))))
6775+
    (native-inputs
6776+
     (append (package-native-inputs java-batik)
6777+
             `(("unzip" ,unzip))))
6778+
    (arguments
6779+
     `(#:test-target "regard"; FIXME: no test is actually run
6780+
       #:build-target "all-jar"
6781+
       #:phases
6782+
       (modify-phases %standard-phases
6783+
         (add-before 'check 'remove-failing
6784+
           (lambda _
6785+
             ;; This file looks for w3c.dom.Window, but it has been moved to
6786+
             ;; org.apache.batik.w3c.dom.Window.
6787+
             (delete-file "samples/tests/resources/java/sources/com/untrusted/script/UntrustedScriptHandler.java")
6788+
             #t))
6789+
         (replace 'install
6790+
           (lambda* (#:key outputs #:allow-other-keys)
6791+
             (let ((dir (string-append (assoc-ref outputs "out") "/share/java/")))
6792+
               (mkdir-p dir)
6793+
               (copy-file (string-append "batik-" ,version "/lib/batik-all.jar")
6794+
                          (string-append dir "batik-all.jar"))))))))))
6795+
67336796
(define-public java-xmlgraphics-commons
67346797
  (package
67356798
    (name "java-xmlgraphics-commons")

more/packages/kotlin.scm

149149
       ("java-asm-commons" ,java-asm-commons-7)
150150
       ("java-former-dart-ast" ,java-former-dart-ast)
151151
       ("java-guava" ,java-guava)
152-
       ("java-intellij-java-psi-api" ,java-intellij-java-psi-api)
153-
       ("java-intellij-java-psi-impl" ,java-intellij-java-psi-impl)
154-
       ("java-intellij-platform-core-api" ,java-intellij-platform-core-api)
155-
       ("java-intellij-platform-core-impl" ,java-intellij-platform-core-impl)
156-
       ("java-intellij-platform-extensions" ,java-intellij-platform-extensions)
157-
       ("java-intellij-platform-util" ,java-intellij-platform-util)
158-
       ("java-intellij-platform-util-rt" ,java-intellij-platform-util-rt)
152+
       ("java-intellij-java-psi-api" ,(intellij-2013-package java-intellij-java-psi-api))
153+
       ("java-intellij-java-psi-impl" ,(intellij-2013-package java-intellij-java-psi-impl))
154+
       ("java-intellij-platform-core-api" ,(intellij-2013-package java-intellij-platform-core-api))
155+
       ("java-intellij-platform-core-impl" ,(intellij-2013-package java-intellij-platform-core-impl))
156+
       ("java-intellij-platform-extensions" ,(intellij-2013-package java-intellij-platform-extensions))
157+
       ("java-intellij-platform-util" ,(intellij-2013-package java-intellij-platform-util))
158+
       ("java-intellij-platform-util-rt" ,(intellij-2013-package java-intellij-platform-util-rt))
159159
       ("java-javax-inject" ,java-javax-inject)
160160
       ("java-jline-2" ,java-jline-2)
161161
       ("java-jsr305" ,java-jsr305)