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 (ice-9 match) |
| 21 | #:use-module (srfi srfi-1) |
| 22 | #:use-module ((guix licenses) #:prefix license:) |
| 23 | #:use-module (gnu packages) |
| 24 | #:use-module (guix packages) |
| 25 | #:use-module (guix download) |
| 26 | #:use-module (guix git-download) |
| 27 | #:use-module (guix svn-download) |
| 28 | #:use-module (guix cvs-download) |
| 29 | #:use-module (guix utils) |
| 30 | #:use-module (guix build-system ant) |
| 31 | #:use-module (guix build-system gnu) |
| 32 | #:use-module (guix build-system trivial) |
| 33 | #:use-module (gnu packages autotools) |
| 34 | #:use-module (gnu packages base) |
| 35 | #:use-module (gnu packages batik) |
| 36 | #:use-module (gnu packages compression) |
| 37 | #:use-module (gnu packages docbook) |
| 38 | #:use-module (gnu packages java) |
| 39 | #:use-module (gnu packages java-compression) |
| 40 | #:use-module (gnu packages maven) |
| 41 | #:use-module (gnu packages perl) |
| 42 | #:use-module (gnu packages web) |
| 43 | #:use-module (gnu packages xml) |
| 44 | #:use-module (more packages java)) |
| 45 | |
| 46 | ;(define intellij-community-2013-commit "8bc091c3131a888b5400c63a9e51eb0bc7fbe0fb") |
| 47 | ;; Take a random old commit that has the right files |
| 48 | ;(define intellij-community-2013-commit "f116b27261f9dea1c0f00b90ad09d58c6e2fa2f2") |
| 49 | (define intellij-community-2013-commit "32cf812a36e0efd8d7859378b52c0ea3b1e3e321") |
| 50 | (define intellij-community-2013-version (git-version "0.0.0" "0" |
| 51 | intellij-community-2013-commit)) |
| 52 | |
| 53 | ;; The release page on github is a mess |
| 54 | (define intellij-community-version "182.5262.8") |
| 55 | (define intellij-community-commit "e2a5d9273ec0b3b656c0dad0c9b07e5f85bbd61a") |
| 56 | (define (get-intellij-community-source commit version hash) |
| 57 | (origin |
| 58 | (method git-fetch) |
| 59 | (uri (git-reference |
| 60 | (url "https://github.com/JetBrains/intellij-community") |
| 61 | (commit commit))) |
| 62 | (file-name (git-file-name "intellij" version)) |
| 63 | (sha256 (base32 hash)) |
| 64 | (modules '((guix build utils))) |
| 65 | (snippet |
| 66 | `(begin |
| 67 | (for-each |
| 68 | (lambda (file) |
| 69 | (if (file-exists? file) |
| 70 | (delete-file-recursively file))) |
| 71 | (append (find-files "." "^lib$" #:directories? #t) |
| 72 | (find-files "." "^bin$" #:directories? #t))) |
| 73 | (delete-file "build.xml") |
| 74 | (for-each delete-file (find-files "." ".*.jar$")) |
| 75 | #t)))) |
| 76 | |
| 77 | (define intellij-community-source (get-intellij-community-source |
| 78 | intellij-community-commit |
| 79 | intellij-community-version |
| 80 | "17qzhh2kw6sxwkyj7ng7hrpbcf2rjs2xjbsrg1bgkg90r5kb8sm4")) |
| 81 | ;(define intellij-community-2013-source (get-intellij-community-source |
| 82 | ; intellij-community-2013-commit |
| 83 | ; intellij-community-2013-version |
| 84 | ; "0z5rq713lf7q2x0c0sb0r1ha2pszcyygddh7r12wyzf5p0iiy1im")) |
| 85 | (define intellij-community-2013-source (get-intellij-community-source |
| 86 | intellij-community-2013-commit |
| 87 | intellij-community-2013-version |
| 88 | "1r9jrmbc634zlg3gvqmlqlhi0sf2sjgvgnc3an5wfz1w8izbk6ji")) |
| 89 | |
| 90 | (define (strip-intellij-variant variant-property base) |
| 91 | (package |
| 92 | (inherit base) |
| 93 | (properties (alist-delete variant-property (package-properties base))))) |
| 94 | |
| 95 | (define (package-intellij-for-explicit-version version source variant-property base) |
| 96 | (define variant |
| 97 | (assq-ref (package-properties base) variant-property)) |
| 98 | |
| 99 | (define (map-inputs inputs) |
| 100 | (map (lambda (input) |
| 101 | (match input |
| 102 | ((name input) |
| 103 | (if (and |
| 104 | (> (string-length name) 13) |
| 105 | (equal? (substring name 0 13) "java-intellij")) |
| 106 | `(,name ,(package-intellij-for-explicit-version |
| 107 | version source variant-property input)) |
| 108 | `(,name ,input))))) |
| 109 | inputs)) |
| 110 | |
| 111 | (cond |
| 112 | (variant => force) |
| 113 | (else |
| 114 | (package |
| 115 | (inherit base) |
| 116 | (version version) |
| 117 | (source source) |
| 118 | (propagated-inputs (map-inputs (package-propagated-inputs base))) |
| 119 | (inputs (map-inputs (package-inputs base))))))) |
| 120 | |
| 121 | (define-public (intellij-2013-package base) |
| 122 | (package-intellij-for-explicit-version intellij-community-2013-version |
| 123 | intellij-community-2013-source |
| 124 | 'intellij-2013-variant |
| 125 | base)) |
| 126 | (define-public (strip-2013-variant base) |
| 127 | (strip-intellij-variant 'intellij-2013-variant base)) |
| 128 | |
| 129 | (define-public java-intellij-compiler-instrumentation-util |
| 130 | (package |
| 131 | (name "java-intellij-compiler-instrumentation-util") |
| 132 | (version intellij-community-version) |
| 133 | (source intellij-community-source) |
| 134 | (build-system ant-build-system) |
| 135 | (arguments |
| 136 | `(#:source-dir "java/compiler/instrumentation-util/src" |
| 137 | #:jar-name "instrumentation-util.jar" |
| 138 | ;; No test |
| 139 | #:tests? #f |
| 140 | #:phases |
| 141 | (modify-phases %standard-phases |
| 142 | (add-before 'build 'fix-imports |
| 143 | (lambda _ |
| 144 | (substitute* (find-files "java/compiler/instrumentation-util/src" ".*.java") |
| 145 | (("org.jetbrains.org.objectweb") "org.objectweb") |
| 146 | ;; As in build/asm/3_api_version.patch |
| 147 | (("API_VERSION") "ASM6"))))))) |
| 148 | (inputs |
| 149 | `(("java-asm" ,java-asm))) |
| 150 | (home-page "https://github.com/JetBrains/intellij-community") |
| 151 | (synopsis "") |
| 152 | (description "") |
| 153 | (license license:asl2.0))) |
| 154 | |
| 155 | (define-public java-jdom-for-intellij-2013 |
| 156 | (package |
| 157 | (inherit java-jdom) |
| 158 | (version "0") |
| 159 | (source (origin |
| 160 | (method url-fetch) |
| 161 | (uri (string-append "https://github.com/JetBrains/" |
| 162 | "intellij-community/raw/" |
| 163 | intellij-community-2013-commit |
| 164 | "/lib/src/jdom.zip")) |
| 165 | (sha256 |
| 166 | (base32 |
| 167 | "0yvs1bxxbpa11bnvhdhi11mnps1qbgg3qw7s8zw24s8wabznjn6a")))) |
| 168 | (arguments |
| 169 | `(#:jar-name "jdom.jar" |
| 170 | #:source-dir ".." |
| 171 | #:tests? #f)) |
| 172 | (inputs |
| 173 | `(("java-jaxen" ,java-jaxen))) |
| 174 | (native-inputs |
| 175 | `(("unzip" ,unzip))))) |
| 176 | |
| 177 | (define-public java-jsr166e-for-intellij-2013 |
| 178 | (package |
| 179 | (name "java-jsr166e") |
| 180 | (version "0") |
| 181 | (source (origin |
| 182 | (method url-fetch) |
| 183 | (uri (string-append "https://github.com/JetBrains/" |
| 184 | "intellij-community/raw/" |
| 185 | intellij-community-2013-commit |
| 186 | "/lib/src/jsr166e_src.jar")) |
| 187 | (sha256 |
| 188 | (base32 |
| 189 | "0ifiszqz57c1i90fhhprfll5jribh7s4wq1qnmkl9454pcdawrzp")))) |
| 190 | (build-system ant-build-system) |
| 191 | (arguments |
| 192 | `(#:jar-name "jsr166e.jar" |
| 193 | #:source-dir ".." |
| 194 | #:jdk ,icedtea-7 |
| 195 | #:tests? #f)) |
| 196 | (home-page "") |
| 197 | (synopsis "") |
| 198 | (description "") |
| 199 | (license license:cc0))) |
| 200 | |
| 201 | (define-public java-intellij-compiler-javac2 |
| 202 | (package |
| 203 | (name "java-intellij-compiler-javac2") |
| 204 | (version intellij-community-version) |
| 205 | (source intellij-community-source) |
| 206 | (build-system ant-build-system) |
| 207 | (arguments |
| 208 | `(#:source-dir "java/compiler/javac2/src" |
| 209 | #:jar-name "javac2.jar" |
| 210 | ;; No test |
| 211 | #:tests? #f)) |
| 212 | (inputs |
| 213 | `(("java-intellij-compiler-instrumentation-util" ,java-intellij-compiler-instrumentation-util))) |
| 214 | (home-page "https://github.com/JetBrains/intellij-community") |
| 215 | (synopsis "") |
| 216 | (description "") |
| 217 | (license license:asl2.0))) |
| 218 | |
| 219 | (define-public java-intellij-platform-forms-rt |
| 220 | (package |
| 221 | (name "java-intellij-platform-forms-rt") |
| 222 | (version intellij-community-version) |
| 223 | (source intellij-community-source) |
| 224 | (build-system ant-build-system) |
| 225 | (arguments |
| 226 | `(#:source-dir "platform/forms_rt/src" |
| 227 | #:jar-name "forms_rt.jar" |
| 228 | ;; No test |
| 229 | #:tests? #f)) |
| 230 | (home-page "https://github.com/JetBrains/intellij-community") |
| 231 | (synopsis "") |
| 232 | (description "") |
| 233 | (license license:asl2.0))) |
| 234 | |
| 235 | (define-public java-intellij-platform-util-rt |
| 236 | (package |
| 237 | (name "java-intellij-platform-util-rt") |
| 238 | (version intellij-community-version) |
| 239 | (source intellij-community-source) |
| 240 | (build-system ant-build-system) |
| 241 | (arguments |
| 242 | `(#:source-dir "platform/util-rt/src" |
| 243 | #:jar-name "intellij.platform.util-rt.jar" |
| 244 | #:jdk ,icedtea-7 |
| 245 | ;; No test |
| 246 | #:tests? #f)) |
| 247 | (inputs |
| 248 | `(("java-jetbrains-annotations" ,java-jetbrains-annotations))) |
| 249 | (home-page "https://github.com/JetBrains/intellij-community") |
| 250 | (synopsis "") |
| 251 | (description "") |
| 252 | (license license:asl2.0))) |
| 253 | |
| 254 | (define-public java-intellij-platform-util |
| 255 | (package |
| 256 | (name "java-intellij-platform-util") |
| 257 | (version intellij-community-version) |
| 258 | (source intellij-community-source) |
| 259 | (build-system ant-build-system) |
| 260 | (arguments |
| 261 | `(#:source-dir "platform/util/src" |
| 262 | #:jar-name "intellij.platform.util.jar" |
| 263 | ;; No test |
| 264 | #:tests? #f |
| 265 | #:phases |
| 266 | (modify-phases %standard-phases |
| 267 | (add-before 'build 'copy-resources |
| 268 | (lambda _ |
| 269 | (copy-recursively "platform/util/resources" "build/classes") |
| 270 | #t)) |
| 271 | (add-before 'build 'remove-apple |
| 272 | (lambda _ |
| 273 | (delete-file "platform/util/src/com/intellij/util/AppleHiDPIScaledImage.java") |
| 274 | (delete-file "platform/util/src/com/intellij/util/ui/IsRetina.java") |
| 275 | #t))))) |
| 276 | (propagated-inputs |
| 277 | `(("java-batik" ,java-batik) |
| 278 | ("java-commons-compress" ,java-commons-compress) |
| 279 | ("java-imagescalr" ,java-imagescalr) |
| 280 | ("java-intellij-platform-util-rt" ,java-intellij-platform-util-rt) |
| 281 | ("java-jakarta-oro" ,java-jakarta-oro) |
| 282 | ("java-jdom-for-intellij" ,java-jdom-for-intellij) |
| 283 | ("java-jetbrains-annotations" ,java-jetbrains-annotations) |
| 284 | ("java-log4j-api" ,java-log4j-api) |
| 285 | ("java-log4j-1.2-api" ,java-log4j-1.2-api) |
| 286 | ("java-lz4" ,java-lz4) |
| 287 | ("java-native-access" ,java-native-access) |
| 288 | ("java-native-access-platform" ,java-native-access-platform) |
| 289 | ("java-trove4j-intellij" ,java-trove4j-intellij) |
| 290 | ("java-w3c-svg" ,java-w3c-svg))) |
| 291 | (properties |
| 292 | `((intellij-2013-variant . ,(delay java-intellij-platform-util-2013)))) |
| 293 | (home-page "https://github.com/JetBrains/intellij-community") |
| 294 | (synopsis "") |
| 295 | (description "") |
| 296 | (license license:asl2.0))) |
| 297 | |
| 298 | (define-public java-intellij-platform-util-2013 |
| 299 | (let ((base (intellij-2013-package (strip-2013-variant java-intellij-platform-util)))) |
| 300 | (package |
| 301 | (inherit base) |
| 302 | (propagated-inputs |
| 303 | (append (alist-delete "java-jdom-for-intellij" (package-propagated-inputs base)) |
| 304 | `(("java-asm" ,java-asm) |
| 305 | ("java-batik-1.7" ,java-batik-1.7) |
| 306 | ("java-cglib" ,java-cglib) |
| 307 | ("java-iq80-snappy" ,java-iq80-snappy) |
| 308 | ("java-jdom" ,java-jdom-for-intellij-2013) |
| 309 | ("java-jsr166e-for-intellij-2013" ,java-jsr166e-for-intellij-2013) |
| 310 | ("java-picocontainer-1" ,java-picocontainer-1) |
| 311 | ("java-xstream" ,java-xstream)))) |
| 312 | (inputs |
| 313 | `(("java-eawtstub" ,java-eawtstub))) |
| 314 | (arguments |
| 315 | (substitute-keyword-arguments (package-arguments base) |
| 316 | ((#:phases phases) |
| 317 | `(modify-phases ,phases |
| 318 | (delete 'remove-apple) |
| 319 | (add-before 'build 'fix-newer-jdk |
| 320 | (lambda _ |
| 321 | (substitute* "platform/util/src/com/intellij/ui/mac/foundation/Foundation.java" |
| 322 | (("public static class NSRect extends Structure implements Structure.ByValue.*") |
| 323 | "public static class NSRect extends Structure implements Structure.ByValue { |
| 324 | @Override |
| 325 | protected java.util.List<String> getFieldOrder() { |
| 326 | return java.util.Arrays.asList(new String[]{\"origin\", \"size\"}); |
| 327 | }") |
| 328 | (("public static class NSPoint extends Structure implements Structure.ByValue.*") |
| 329 | "public static class NSPoint extends Structure implements Structure.ByValue { |
| 330 | @Override |
| 331 | protected java.util.List<String> getFieldOrder() { |
| 332 | return java.util.Arrays.asList(new String[]{\"x\", \"y\"}); |
| 333 | }") |
| 334 | (("public static class NSSize extends Structure implements Structure.ByValue.*") |
| 335 | "public static class NSSize extends Structure implements Structure.ByValue { |
| 336 | @Override |
| 337 | protected java.util.List<String> getFieldOrder() { |
| 338 | return java.util.Arrays.asList(new String[]{\"width\", \"height\"}); |
| 339 | }")) |
| 340 | #t))))))))) |
| 341 | |
| 342 | (define-public java-intellij-platform-extensions |
| 343 | (package |
| 344 | (name "java-intellij-platform-extensions") |
| 345 | (version intellij-community-version) |
| 346 | (source intellij-community-source) |
| 347 | (build-system ant-build-system) |
| 348 | (arguments |
| 349 | `(#:source-dir "platform/extensions/src" |
| 350 | #:jar-name "intellij.platform.extensions.jar" |
| 351 | ;; No test |
| 352 | #:tests? #f)) |
| 353 | (propagated-inputs |
| 354 | `(("java-intellij-platform-util" ,java-intellij-platform-util) |
| 355 | ("java-jetbrains-annotations" ,java-jetbrains-annotations) |
| 356 | ("java-picocontainer-1" ,java-picocontainer-1))) |
| 357 | (home-page "https://github.com/JetBrains/intellij-community") |
| 358 | (synopsis "") |
| 359 | (description "") |
| 360 | (license license:asl2.0))) |
| 361 | |
| 362 | (define-public java-intellij-platform-core-api |
| 363 | (package |
| 364 | (name "java-intellij-platform-core-api") |
| 365 | (version intellij-community-version) |
| 366 | (source intellij-community-source) |
| 367 | (build-system ant-build-system) |
| 368 | (arguments |
| 369 | `(#:source-dir "platform/core-api/src" |
| 370 | #:jar-name "intellij.platform.core-api.jar" |
| 371 | ;; No test |
| 372 | #:tests? #f)) |
| 373 | (propagated-inputs |
| 374 | `(("java-automaton" ,java-automaton) |
| 375 | ("java-intellij-platform-extensions" ,java-intellij-platform-extensions) |
| 376 | ("java-intellij-platform-resources" ,java-intellij-platform-resources) |
| 377 | ("java-intellij-platform-util" ,java-intellij-platform-util) |
| 378 | ("java-intellij-resources" ,java-intellij-resources) |
| 379 | ("java-jetbrains-annotations" ,java-jetbrains-annotations) |
| 380 | ("java-trove4j-intellij" ,java-trove4j-intellij))) |
| 381 | (properties |
| 382 | `((intellij-2013-variant . ,(delay java-intellij-platform-core-api-2013)))) |
| 383 | (home-page "https://github.com/JetBrains/intellij-community") |
| 384 | (synopsis "") |
| 385 | (description "") |
| 386 | (license license:asl2.0))) |
| 387 | |
| 388 | (define-public java-intellij-platform-core-api-2013 |
| 389 | (let ((base (intellij-2013-package |
| 390 | (strip-2013-variant java-intellij-platform-core-api)))) |
| 391 | (package |
| 392 | (inherit base) |
| 393 | (propagated-inputs |
| 394 | (append (package-propagated-inputs base) |
| 395 | `(("java-asm" ,java-asm) |
| 396 | ("java-cglib" ,java-cglib))))))) |
| 397 | |
| 398 | (define-public java-intellij-platform-boot |
| 399 | (package |
| 400 | (name "java-intellij-platform-boot") |
| 401 | (version intellij-community-version) |
| 402 | (source intellij-community-source) |
| 403 | (build-system ant-build-system) |
| 404 | (arguments |
| 405 | ;; TODO: remove these auto-generated files and generate them with |
| 406 | ;; java-flex from the same-named file in src, with .flex extension |
| 407 | ;; (_JavaLexer, _JavaDocLexer) |
| 408 | `(#:source-dir "platform/boot/src" |
| 409 | #:jar-name "intellij.platform.boot.jar" |
| 410 | ;; No test |
| 411 | #:tests? #f |
| 412 | #:phases |
| 413 | (modify-phases %standard-phases |
| 414 | (add-before 'build 'copy-resources |
| 415 | (lambda _ |
| 416 | (copy-recursively "java/java-psi-impl/src/META-INF" |
| 417 | "build/classes/META-INF") |
| 418 | #t))))) |
| 419 | (home-page "https://github.com/JetBrains/intellij-community") |
| 420 | (synopsis "") |
| 421 | (description "") |
| 422 | (license license:asl2.0))) |
| 423 | |
| 424 | (define-public java-intellij-platform-core-impl |
| 425 | (package |
| 426 | (name "java-intellij-platform-core-impl") |
| 427 | (version intellij-community-version) |
| 428 | (source intellij-community-source) |
| 429 | (build-system ant-build-system) |
| 430 | (arguments |
| 431 | `(#:source-dir "platform/core-impl/src" |
| 432 | #:jar-name "intellij.platform.core-impl.jar" |
| 433 | ;; No test |
| 434 | #:tests? #f)) |
| 435 | (propagated-inputs |
| 436 | `(("java-guava" ,java-guava) |
| 437 | ("java-intellij-platform-boot" ,java-intellij-platform-boot) |
| 438 | ("java-intellij-platform-core-api" ,java-intellij-platform-core-api))) |
| 439 | (properties |
| 440 | `((intellij-2013-variant . ,(delay java-intellij-platform-core-impl-2013)))) |
| 441 | (home-page "https://github.com/JetBrains/intellij-community") |
| 442 | (synopsis "") |
| 443 | (description "") |
| 444 | (license license:asl2.0))) |
| 445 | |
| 446 | (define-public java-intellij-platform-core-impl-2013 |
| 447 | (let ((base (intellij-2013-package |
| 448 | (strip-2013-variant java-intellij-platform-core-impl)))) |
| 449 | (package |
| 450 | (inherit base) |
| 451 | (propagated-inputs |
| 452 | (append (package-propagated-inputs base) |
| 453 | `(("java-snappy" ,java-snappy))))))) |
| 454 | |
| 455 | (define-public java-intellij-java-psi-api |
| 456 | (package |
| 457 | (name "java-intellij-java-psi-api") |
| 458 | (version intellij-community-version) |
| 459 | (source intellij-community-source) |
| 460 | (build-system ant-build-system) |
| 461 | (arguments |
| 462 | `(#:source-dir "java/java-psi-api/src" |
| 463 | #:jar-name "intellij.java.psi-api.jar" |
| 464 | ;; No test |
| 465 | #:tests? #f |
| 466 | #:phases |
| 467 | (modify-phases %standard-phases |
| 468 | (add-before 'build 'copy-resources |
| 469 | (lambda _ |
| 470 | (copy-recursively "java/java-psi-api/src/messages" |
| 471 | "build/classes/messages") |
| 472 | #t))))) |
| 473 | (propagated-inputs |
| 474 | `(("java-intellij-platform-core-api" ,java-intellij-platform-core-api) |
| 475 | ("java-intellij-platform-util" ,java-intellij-platform-util) |
| 476 | ("java-jetbrains-annotations" ,java-jetbrains-annotations))) |
| 477 | (home-page "https://github.com/JetBrains/intellij-community") |
| 478 | (synopsis "") |
| 479 | (description "") |
| 480 | (license license:asl2.0))) |
| 481 | |
| 482 | (define-public java-intellij-java-psi-impl |
| 483 | (package |
| 484 | (name "java-intellij-java-psi-impl") |
| 485 | (version intellij-community-version) |
| 486 | (source intellij-community-source) |
| 487 | (build-system ant-build-system) |
| 488 | (arguments |
| 489 | ;; TODO: remove these auto-generated files and generate them with |
| 490 | ;; java-flex from the same-named file in src, with .flex extension |
| 491 | ;; (_JavaLexer, _JavaDocLexer) |
| 492 | `(#:source-dir "java/java-psi-impl/src:java/java-psi-impl/gen" |
| 493 | #:jar-name "intellij.java.psi-impl.jar" |
| 494 | ;; No test |
| 495 | #:tests? #f |
| 496 | #:phases |
| 497 | (modify-phases %standard-phases |
| 498 | (add-before 'build 'fix-asm |
| 499 | (lambda _ |
| 500 | (with-fluids ((%default-port-encoding "ISO-8859-1")) |
| 501 | (substitute* (find-files "java/java-psi-impl/src" ".*\\.java$") |
| 502 | (("org.jetbrains.org.objectweb") "org.objectweb") |
| 503 | ;; As in build/asm/3_api_version.patch |
| 504 | (("API_VERSION") "ASM6"))) |
| 505 | #t)) |
| 506 | (add-before 'build 'copy-resources |
| 507 | (lambda _ |
| 508 | (copy-recursively "java/java-psi-impl/src/META-INF" |
| 509 | "build/classes/META-INF") |
| 510 | (copy-recursively "java/java-psi-impl/src/messages" |
| 511 | "build/classes/intellij/java/resources/en") |
| 512 | #t))))) |
| 513 | (propagated-inputs |
| 514 | `(("java-asm" ,java-asm) |
| 515 | ("java-intellij-java-psi-api" ,java-intellij-java-psi-api) |
| 516 | ("java-intellij-platform-core-impl" ,java-intellij-platform-core-impl) |
| 517 | ("java-jetbrains-annotations" ,java-jetbrains-annotations) |
| 518 | ("java-streamex" ,java-streamex))) |
| 519 | (properties |
| 520 | `((intellij-2013-variant . ,(delay java-intellij-java-psi-impl-2013)))) |
| 521 | (home-page "https://github.com/JetBrains/intellij-community") |
| 522 | (synopsis "") |
| 523 | (description "") |
| 524 | (license license:asl2.0))) |
| 525 | |
| 526 | (define-public java-intellij-java-psi-impl-2013 |
| 527 | (let ((base (intellij-2013-package |
| 528 | (strip-2013-variant java-intellij-java-psi-impl)))) |
| 529 | (package |
| 530 | (inherit base) |
| 531 | (arguments |
| 532 | (substitute-keyword-arguments (package-arguments base) |
| 533 | ((#:source-dir _) |
| 534 | "java/java-psi-impl/src") |
| 535 | ((#:phases phases) |
| 536 | `(modify-phases ,phases |
| 537 | (add-before 'build 'fix-asm |
| 538 | (lambda _ |
| 539 | (substitute* "java/java-psi-impl/src/com/intellij/psi/impl/compiled/ClsParsingUtil.java" |
| 540 | (("V1_9") "V9")) |
| 541 | #t))))))))) |
| 542 | |
| 543 | (define-public java-intellij-platform-resources |
| 544 | (package |
| 545 | (name "java-intellij-platform-resources") |
| 546 | (version intellij-community-version) |
| 547 | (source intellij-community-source) |
| 548 | (build-system ant-build-system) |
| 549 | (arguments |
| 550 | ;; TODO: remove these auto-generated files and generate them with |
| 551 | ;; java-flex from the same-named file in src, with .flex extension |
| 552 | ;; (_JavaLexer, _JavaDocLexer) |
| 553 | `(#:source-dir "platform/platform-resources" |
| 554 | #:jar-name "intellij.platform.resources.jar" |
| 555 | ;; No test |
| 556 | #:tests? #f |
| 557 | #:phases |
| 558 | (modify-phases %standard-phases |
| 559 | (add-before 'build 'copy-resources |
| 560 | (lambda _ |
| 561 | (copy-recursively "platform/platform-resources/src" |
| 562 | "build/classes") |
| 563 | #t))))) |
| 564 | (propagated-inputs '()) |
| 565 | (native-inputs '()) |
| 566 | (inputs '()) |
| 567 | (home-page "https://github.com/JetBrains/intellij-community") |
| 568 | (synopsis "") |
| 569 | (description "") |
| 570 | (license license:asl2.0))) |
| 571 | |
| 572 | (define-public java-intellij-resources |
| 573 | (package |
| 574 | (name "java-intellij-resources") |
| 575 | (version intellij-community-version) |
| 576 | (source intellij-community-source) |
| 577 | (build-system ant-build-system) |
| 578 | (arguments |
| 579 | ;; TODO: remove these auto-generated files and generate them with |
| 580 | ;; java-flex from the same-named file in src, with .flex extension |
| 581 | ;; (_JavaLexer, _JavaDocLexer) |
| 582 | `(#:source-dir "resources" |
| 583 | #:jar-name "intellij.resources.jar" |
| 584 | ;; No test |
| 585 | #:tests? #f |
| 586 | #:phases |
| 587 | (modify-phases %standard-phases |
| 588 | (add-before 'build 'copy-resources |
| 589 | (lambda _ |
| 590 | (copy-recursively "resources/src" "build/classes") |
| 591 | #t))))) |
| 592 | (propagated-inputs '()) |
| 593 | (native-inputs '()) |
| 594 | (inputs '()) |
| 595 | (home-page "https://github.com/JetBrains/intellij-community") |
| 596 | (synopsis "") |
| 597 | (description "") |
| 598 | (license license:asl2.0))) |
| 599 | |
| 600 | ;; Newer versions are not free software anymore |
| 601 | ;; latest free versions are 1.8.1 and 1.8.0. We require something older for |
| 602 | ;; intellij though. |
| 603 | (define-public java-jgoodies-common |
| 604 | (package |
| 605 | (name "java-jgoodies-common") |
| 606 | (version "1.8.1") |
| 607 | (source (origin |
| 608 | (method url-fetch) |
| 609 | (uri "http://www.jgoodies.com/download/libraries/common/jgoodies-common-1_8_1.zip") |
| 610 | (sha256 |
| 611 | (base32 |
| 612 | "1canj4zalrp668c55ji58rk90w005q44lnwzliffsr8mlrgxgaiw")))) |
| 613 | (build-system ant-build-system) |
| 614 | (arguments |
| 615 | `(#:jar-name "jgoodies-common.jar" |
| 616 | #:source-dir "." |
| 617 | #:tests? #f; no tests |
| 618 | #:phases |
| 619 | (modify-phases %standard-phases |
| 620 | (add-before 'build 'extract-source |
| 621 | (lambda _ |
| 622 | (invoke "jar" "xf" "jgoodies-common-1.8.1-sources.jar") |
| 623 | #t))))) |
| 624 | (native-inputs |
| 625 | `(("unzip" ,unzip))) |
| 626 | (home-page "http://www.jgoodies.com") |
| 627 | (synopsis "") |
| 628 | (description "") |
| 629 | (license license:bsd-3))) |
| 630 | |
| 631 | (define-public java-jgoodies-forms |
| 632 | (package |
| 633 | (name "java-jgoodies-forms") |
| 634 | (version "1.8.0") |
| 635 | (source (origin |
| 636 | (method url-fetch) |
| 637 | (uri "http://www.jgoodies.com/download/libraries/forms/jgoodies-forms-1_8_0.zip") |
| 638 | (sha256 |
| 639 | (base32 |
| 640 | "1av4w1px1jxmv19mljyicbv657sw5nqhkfx6s7nc5ckzf9ay945h")))) |
| 641 | (build-system ant-build-system) |
| 642 | (arguments |
| 643 | `(#:jar-name "jgoodies-forms.jar" |
| 644 | #:source-dir "." |
| 645 | #:tests? #f; no tests |
| 646 | #:phases |
| 647 | (modify-phases %standard-phases |
| 648 | (add-before 'build 'extract-source |
| 649 | (lambda _ |
| 650 | (invoke "jar" "xf" "jgoodies-forms-1.8.0-sources.jar") |
| 651 | #t))))) |
| 652 | (native-inputs |
| 653 | `(("unzip" ,unzip))) |
| 654 | (inputs |
| 655 | `(("java-jgoodies-common" ,java-jgoodies-common))) |
| 656 | (home-page "http://www.jgoodies.com") |
| 657 | (synopsis "") |
| 658 | (description "") |
| 659 | (license license:bsd-3))) |
| 660 | |
| 661 | ;; Requires JGoodies Forms: http://www.jgoodies.com |
| 662 | (define-public java-intellij-compiler-forms-compiler |
| 663 | (package |
| 664 | (name "java-intellij-compiler-forms-compiler") |
| 665 | (version intellij-community-version) |
| 666 | (source intellij-community-source) |
| 667 | (build-system ant-build-system) |
| 668 | (arguments |
| 669 | `(#:source-dir "java/compiler/forms-compiler/src" |
| 670 | #:jar-name "forms-compiler.jar" |
| 671 | ;; No test |
| 672 | #:tests? #f |
| 673 | #:phases |
| 674 | (modify-phases %standard-phases |
| 675 | (add-before 'build 'fix-imports |
| 676 | (lambda _ |
| 677 | (substitute* (find-files "java/compiler/forms-compiler/src" ".*.java") |
| 678 | (("org.jetbrains.org.objectweb") "org.objectweb") |
| 679 | ;; As in build/asm/3_api_version.patch |
| 680 | (("API_VERSION") "ASM6")))) |
| 681 | (add-before 'build 'fix-old-jgoodies |
| 682 | (lambda _ |
| 683 | (substitute* "java/compiler/forms-compiler/src/com/intellij/uiDesigner/lw/FormLayoutSerializer.java" |
| 684 | (("new ColumnSpec\\(spec\\)") "ColumnSpec.parse(spec)"))))))) |
| 685 | (inputs |
| 686 | `(("java-intellij-platform-forms-rt" ,java-intellij-platform-forms-rt) |
| 687 | ("java-intellij-compiler-instrumentation-util" ,java-intellij-compiler-instrumentation-util) |
| 688 | ("java-asm" ,java-asm) |
| 689 | ("java-jdom" ,java-jdom) |
| 690 | ("java-jgoodies-forms" ,java-jgoodies-forms))) |
| 691 | (home-page "https://github.com/JetBrains/intellij-community") |
| 692 | (synopsis "") |
| 693 | (description "") |
| 694 | (license license:asl2.0))) |
| 695 |