guix-more/more/packages/intellij.scm

intellij.scm

1
;;; GNU Guix --- Functional package management for GNU
2
;;; Copyright © 2019 Julien Lepiller <julien@lepiller.eu>
3
;;;
4
;;; This file is part of GNU Guix.
5
;;;
6
;;; GNU Guix is free software; you can redistribute it and/or modify it
7
;;; under the terms of the GNU General Public License as published by
8
;;; the Free Software Foundation; either version 3 of the License, or (at
9
;;; your option) any later version.
10
;;;
11
;;; GNU Guix is distributed in the hope that it will be useful, but
12
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
;;; GNU General Public License for more details.
15
;;;
16
;;; You should have received a copy of the GNU General Public License
17
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
18
19
(define-module (more packages intellij)
20
  #:use-module ((guix licenses) #:prefix license:)
21
  #:use-module (gnu packages)
22
  #:use-module (guix packages)
23
  #:use-module (guix download)
24
  #:use-module (guix git-download)
25
  #:use-module (guix svn-download)
26
  #:use-module (guix cvs-download)
27
  #:use-module (guix utils)
28
  #:use-module (guix build-system ant)
29
  #:use-module (guix build-system gnu)
30
  #:use-module (guix build-system trivial)
31
  #:use-module (gnu packages autotools)
32
  #:use-module (gnu packages base)
33
  #:use-module (gnu packages batik)
34
  #:use-module (gnu packages compression)
35
  #:use-module (gnu packages docbook)
36
  #:use-module (gnu packages java)
37
  #:use-module (gnu packages maven)
38
  #:use-module (gnu packages perl)
39
  #:use-module (gnu packages web)
40
  #:use-module (gnu packages xml)
41
  #:use-module (more packages java))
42
43
;; The release page on github is a mess
44
(define intellij-community-version "182.5262.8")
45
(define intellij-community-commit "e2a5d9273ec0b3b656c0dad0c9b07e5f85bbd61a")
46
(define (intellij-community-source commit version)
47
  (origin
48
    (method git-fetch)
49
    (uri (git-reference
50
           (url "https://github.com/JetBrains/intellij-community")
51
           (commit commit)))
52
    (file-name (git-file-name "intellij" version))
53
    (sha256
54
     (base32
55
      "17qzhh2kw6sxwkyj7ng7hrpbcf2rjs2xjbsrg1bgkg90r5kb8sm4"))
56
    (modules '((guix build utils)))
57
    (snippet
58
      `(begin
59
         (for-each
60
           (lambda (file)
61
             (if (file-exists? file)
62
               (delete-file-recursively file)))
63
           (append (find-files "." "^lib$" #:directories? #t)
64
                   (find-files "." "^bin$" #:directories? #t)))
65
         (delete-file "build.xml")
66
         (for-each delete-file (find-files "." ".*.jar$"))
67
         #t))))
68
69
(define-public java-intellij-compiler-instrumentation-util
70
  (package
71
    (name "java-intellij-compiler-instrumentation-util")
72
    (version intellij-community-version)
73
    (source (intellij-community-source intellij-community-commit version))
74
    (build-system ant-build-system)
75
    (arguments
76
     `(#:source-dir "java/compiler/instrumentation-util/src"
77
       #:jar-name "instrumentation-util.jar"
78
       ;; No test
79
       #:tests? #f
80
       #:phases
81
       (modify-phases %standard-phases
82
         (add-before 'build 'fix-imports
83
           (lambda _
84
             (substitute* (find-files "java/compiler/instrumentation-util/src" ".*.java")
85
               (("org.jetbrains.org.objectweb") "org.objectweb")
86
                ;; As in build/asm/3_api_version.patch
87
               (("API_VERSION") "ASM6")))))))
88
    (inputs
89
     `(("java-asm" ,java-asm)))
90
    (home-page "https://github.com/JetBrains/intellij-community")
91
    (synopsis "")
92
    (description "")
93
    (license license:asl2.0)))
94
95
(define-public java-intellij-compiler-javac2
96
  (package
97
    (name "java-intellij-compiler-javac2")
98
    (version intellij-community-version)
99
    (source (intellij-community-source intellij-community-commit version))
100
    (build-system ant-build-system)
101
    (arguments
102
     `(#:source-dir "java/compiler/javac2/src"
103
       #:jar-name "javac2.jar"
104
       ;; No test
105
       #:tests? #f))
106
    (inputs
107
     `(("java-intellij-compiler-instrumentation-util" ,java-intellij-compiler-instrumentation-util)))
108
    (home-page "https://github.com/JetBrains/intellij-community")
109
    (synopsis "")
110
    (description "")
111
    (license license:asl2.0)))
112
113
(define-public java-intellij-platform-forms-rt
114
  (package
115
    (name "java-intellij-platform-forms-rt")
116
    (version intellij-community-version)
117
    (source (intellij-community-source intellij-community-commit version))
118
    (build-system ant-build-system)
119
    (arguments
120
     `(#:source-dir "platform/forms_rt/src"
121
       #:jar-name "forms_rt.jar"
122
       ;; No test
123
       #:tests? #f))
124
    (home-page "https://github.com/JetBrains/intellij-community")
125
    (synopsis "")
126
    (description "")
127
    (license license:asl2.0)))
128
129
(define-public java-intellij-platform-util-rt
130
  (package
131
    (name "java-intellij-platform-util-rt")
132
    (version intellij-community-version)
133
    (source (intellij-community-source intellij-community-commit version))
134
    (build-system ant-build-system)
135
    (arguments
136
     `(#:source-dir "platform/util-rt/src"
137
       #:jar-name "intellij.platform.util-rt.jar"
138
       #:jdk ,icedtea-7
139
       ;; No test
140
       #:tests? #f))
141
    (inputs
142
     `(("java-jetbrains-annotations" ,java-jetbrains-annotations)))
143
    (home-page "https://github.com/JetBrains/intellij-community")
144
    (synopsis "")
145
    (description "")
146
    (license license:asl2.0)))
147
148
(define-public java-intellij-platform-util
149
  (package
150
    (name "java-intellij-platform-util")
151
    (version intellij-community-version)
152
    (source (intellij-community-source intellij-community-commit version))
153
    (build-system ant-build-system)
154
    (arguments
155
     `(#:source-dir "platform/util/src"
156
       #:jar-name "intellij.platform.util.jar"
157
       ;; No test
158
       #:tests? #f
159
       #:phases
160
       (modify-phases %standard-phases
161
         (add-before 'build 'remove-apple
162
           (lambda _
163
             (delete-file "platform/util/src/com/intellij/util/AppleHiDPIScaledImage.java")
164
             (delete-file "platform/util/src/com/intellij/util/ui/IsRetina.java")
165
             #t)))))
166
    (propagated-inputs
167
     `(("java-batik" ,java-batik)
168
       ("java-commons-compress" ,java-commons-compress)
169
       ("java-imagescalr" ,java-imagescalr)
170
       ("java-intellij-platform-util-rt" ,java-intellij-platform-util-rt)
171
       ("java-jakarta-oro" ,java-jakarta-oro)
172
       ("java-jdom-for-intellij" ,java-jdom-for-intellij)
173
       ("java-jetbrains-annotations" ,java-jetbrains-annotations)
174
       ("java-log4j-api" ,java-log4j-api)
175
       ("java-log4j-1.2-api" ,java-log4j-1.2-api)
176
       ("java-lz4" ,java-lz4)
177
       ("java-native-access" ,java-native-access)
178
       ("java-native-access-platform" ,java-native-access-platform)
179
       ("java-trove4j-intellij" ,java-trove4j-intellij)
180
       ("java-w3c-svg" ,java-w3c-svg)))
181
    (home-page "https://github.com/JetBrains/intellij-community")
182
    (synopsis "")
183
    (description "")
184
    (license license:asl2.0)))
185
186
(define-public java-intellij-platform-extensions
187
  (package
188
    (name "java-intellij-platform-extensions")
189
    (version intellij-community-version)
190
    (source (intellij-community-source intellij-community-commit version))
191
    (build-system ant-build-system)
192
    (arguments
193
     `(#:source-dir "platform/extensions/src"
194
       #:jar-name "intellij.platform.extensions.jar"
195
       ;; No test
196
       #:tests? #f))
197
    (propagated-inputs
198
     `(("java-intellij-platform-util" ,java-intellij-platform-util)
199
       ("java-jetbrains-annotations" ,java-jetbrains-annotations)
200
       ("java-picocontainer-1" ,java-picocontainer-1)))
201
    (home-page "https://github.com/JetBrains/intellij-community")
202
    (synopsis "")
203
    (description "")
204
    (license license:asl2.0)))
205
206
(define-public java-intellij-platform-core-api
207
  (package
208
    (name "java-intellij-platform-core-api")
209
    (version intellij-community-version)
210
    (source (intellij-community-source intellij-community-commit version))
211
    (build-system ant-build-system)
212
    (arguments
213
     `(#:source-dir "platform/core-api/src"
214
       #:jar-name "intellij.platform.core-api.jar"
215
       ;; No test
216
       #:tests? #f))
217
    (propagated-inputs
218
     `(("java-automaton" ,java-automaton)
219
       ("java-intellij-platform-extensions" ,java-intellij-platform-extensions)
220
       ("java-intellij-platform-util" ,java-intellij-platform-util)
221
       ("java-jetbrains-annotations" ,java-jetbrains-annotations)
222
       ("java-trove4j-intellij" ,java-trove4j-intellij)))
223
    (home-page "https://github.com/JetBrains/intellij-community")
224
    (synopsis "")
225
    (description "")
226
    (license license:asl2.0)))
227
228
(define-public java-intellij-platform-core-impl
229
  (package
230
    (name "java-intellij-platform-core-impl")
231
    (version intellij-community-version)
232
    (source (intellij-community-source intellij-community-commit version))
233
    (build-system ant-build-system)
234
    (arguments
235
     `(#:source-dir "platform/core-impl/src"
236
       #:jar-name "intellij.platform.core-impl.jar"
237
       ;; No test
238
       #:tests? #f))
239
    (propagated-inputs
240
     `(("java-guava" ,java-guava)
241
       ("java-intellij-platform-core-api" ,java-intellij-platform-core-api)))
242
    (home-page "https://github.com/JetBrains/intellij-community")
243
    (synopsis "")
244
    (description "")
245
    (license license:asl2.0)))
246
247
(define-public java-intellij-java-psi-api
248
  (package
249
    (name "java-intellij-java-psi-api")
250
    (version intellij-community-version)
251
    (source (intellij-community-source intellij-community-commit version))
252
    (build-system ant-build-system)
253
    (arguments
254
     `(#:source-dir "java/java-psi-api/src"
255
       #:jar-name "intellij.java.psi-api.jar"
256
       ;; No test
257
       #:tests? #f))
258
    (propagated-inputs
259
     `(("java-intellij-platform-core-api" ,java-intellij-platform-core-api)
260
       ("java-intellij-platform-util" ,java-intellij-platform-util)
261
       ("java-jetbrains-annotations" ,java-jetbrains-annotations)))
262
    (home-page "https://github.com/JetBrains/intellij-community")
263
    (synopsis "")
264
    (description "")
265
    (license license:asl2.0)))
266
267
(define-public java-intellij-java-psi-impl
268
  (package
269
    (name "java-intellij-java-psi-impl")
270
    (version intellij-community-version)
271
    (source (intellij-community-source intellij-community-commit version))
272
    (build-system ant-build-system)
273
    (arguments
274
      ;; TODO: remove these auto-generated files and generate them with
275
      ;; java-flex from the same-named file in src, with .flex extension
276
      ;; (_JavaLexer, _JavaDocLexer)
277
     `(#:source-dir "java/java-psi-impl/src:java/java-psi-impl/gen"
278
       #:jar-name "intellij.java.psi-impl.jar"
279
       ;; No test
280
       #:tests? #f
281
       #:phases
282
       (modify-phases %standard-phases
283
         (add-before 'build 'fix-asm
284
           (lambda _
285
             (with-fluids ((%default-port-encoding "ISO-8859-1"))
286
               (substitute* (find-files "java/java-psi-impl/src" ".*\\.java$")
287
                 (("org.jetbrains.org.objectweb") "org.objectweb")
288
                 ;; As in build/asm/3_api_version.patch
289
                 (("API_VERSION") "ASM6")))
290
             #t)))))
291
    (propagated-inputs
292
     `(("java-asm" ,java-asm)
293
       ("java-intellij-java-psi-api" ,java-intellij-java-psi-api)
294
       ("java-intellij-platform-core-impl" ,java-intellij-platform-core-impl)
295
       ("java-jetbrains-annotations" ,java-jetbrains-annotations)
296
       ("java-streamex" ,java-streamex)))
297
    (home-page "https://github.com/JetBrains/intellij-community")
298
    (synopsis "")
299
    (description "")
300
    (license license:asl2.0)))
301
302
;; Newer versions are not free software anymore
303
;; latest free versions are 1.8.1 and 1.8.0. We require something older for
304
;; intellij though.
305
(define-public java-jgoodies-common
306
  (package
307
    (name "java-jgoodies-common")
308
    (version "1.8.1")
309
    (source (origin
310
              (method url-fetch)
311
              (uri "http://www.jgoodies.com/download/libraries/common/jgoodies-common-1_8_1.zip")
312
              (sha256
313
               (base32
314
                "1canj4zalrp668c55ji58rk90w005q44lnwzliffsr8mlrgxgaiw"))))
315
    (build-system ant-build-system)
316
    (arguments
317
     `(#:jar-name "jgoodies-common.jar"
318
       #:source-dir "."
319
       #:tests? #f; no tests
320
       #:phases
321
       (modify-phases %standard-phases
322
         (add-before 'build 'extract-source
323
           (lambda _
324
             (invoke "jar" "xf" "jgoodies-common-1.8.1-sources.jar")
325
             #t)))))
326
    (native-inputs
327
     `(("unzip" ,unzip)))
328
    (home-page "http://www.jgoodies.com")
329
    (synopsis "")
330
    (description "")
331
    (license license:bsd-3)))
332
333
(define-public java-jgoodies-forms
334
  (package
335
    (name "java-jgoodies-forms")
336
    (version "1.8.0")
337
    (source (origin
338
              (method url-fetch)
339
              (uri "http://www.jgoodies.com/download/libraries/forms/jgoodies-forms-1_8_0.zip")
340
              (sha256
341
               (base32
342
                "1av4w1px1jxmv19mljyicbv657sw5nqhkfx6s7nc5ckzf9ay945h"))))
343
    (build-system ant-build-system)
344
    (arguments
345
     `(#:jar-name "jgoodies-forms.jar"
346
       #:source-dir "."
347
       #:tests? #f; no tests
348
       #:phases
349
       (modify-phases %standard-phases
350
         (add-before 'build 'extract-source
351
           (lambda _
352
             (invoke "jar" "xf" "jgoodies-forms-1.8.0-sources.jar")
353
             #t)))))
354
    (native-inputs
355
     `(("unzip" ,unzip)))
356
    (inputs
357
     `(("java-jgoodies-common" ,java-jgoodies-common)))
358
    (home-page "http://www.jgoodies.com")
359
    (synopsis "")
360
    (description "")
361
    (license license:bsd-3)))
362
363
;; Requires JGoodies Forms: http://www.jgoodies.com
364
(define-public java-intellij-compiler-forms-compiler
365
  (package
366
    (name "java-intellij-compiler-forms-compiler")
367
    (version intellij-community-version)
368
    (source (intellij-community-source intellij-community-commit version))
369
    (build-system ant-build-system)
370
    (arguments
371
     `(#:source-dir "java/compiler/forms-compiler/src"
372
       #:jar-name "forms-compiler.jar"
373
       ;; No test
374
       #:tests? #f
375
       #:phases
376
       (modify-phases %standard-phases
377
         (add-before 'build 'fix-imports
378
           (lambda _
379
             (substitute* (find-files "java/compiler/forms-compiler/src" ".*.java")
380
               (("org.jetbrains.org.objectweb") "org.objectweb")
381
                ;; As in build/asm/3_api_version.patch
382
               (("API_VERSION") "ASM6"))))
383
         (add-before 'build 'fix-old-jgoodies
384
           (lambda _
385
             (substitute* "java/compiler/forms-compiler/src/com/intellij/uiDesigner/lw/FormLayoutSerializer.java"
386
               (("new ColumnSpec\\(spec\\)") "ColumnSpec.parse(spec)")))))))
387
    (inputs
388
     `(("java-intellij-platform-forms-rt" ,java-intellij-platform-forms-rt)
389
       ("java-intellij-compiler-instrumentation-util" ,java-intellij-compiler-instrumentation-util)
390
       ("java-asm" ,java-asm)
391
       ("java-jdom" ,java-jdom)
392
       ("java-jgoodies-forms" ,java-jgoodies-forms)))
393
    (home-page "https://github.com/JetBrains/intellij-community")
394
    (synopsis "")
395
    (description "")
396
    (license license:asl2.0)))
397