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 'copy-resources |
| 162 | (lambda _ |
| 163 | (copy-recursively "platform/util/resources" "build/classes") |
| 164 | #t)) |
| 165 | (add-before 'build 'remove-apple |
| 166 | (lambda _ |
| 167 | (delete-file "platform/util/src/com/intellij/util/AppleHiDPIScaledImage.java") |
| 168 | (delete-file "platform/util/src/com/intellij/util/ui/IsRetina.java") |
| 169 | #t))))) |
| 170 | (propagated-inputs |
| 171 | `(("java-batik" ,java-batik) |
| 172 | ("java-commons-compress" ,java-commons-compress) |
| 173 | ("java-imagescalr" ,java-imagescalr) |
| 174 | ("java-intellij-platform-util-rt" ,java-intellij-platform-util-rt) |
| 175 | ("java-jakarta-oro" ,java-jakarta-oro) |
| 176 | ("java-jdom-for-intellij" ,java-jdom-for-intellij) |
| 177 | ("java-jetbrains-annotations" ,java-jetbrains-annotations) |
| 178 | ("java-log4j-api" ,java-log4j-api) |
| 179 | ("java-log4j-1.2-api" ,java-log4j-1.2-api) |
| 180 | ("java-lz4" ,java-lz4) |
| 181 | ("java-native-access" ,java-native-access) |
| 182 | ("java-native-access-platform" ,java-native-access-platform) |
| 183 | ("java-trove4j-intellij" ,java-trove4j-intellij) |
| 184 | ("java-w3c-svg" ,java-w3c-svg))) |
| 185 | (home-page "https://github.com/JetBrains/intellij-community") |
| 186 | (synopsis "") |
| 187 | (description "") |
| 188 | (license license:asl2.0))) |
| 189 | |
| 190 | (define-public java-intellij-platform-extensions |
| 191 | (package |
| 192 | (name "java-intellij-platform-extensions") |
| 193 | (version intellij-community-version) |
| 194 | (source (intellij-community-source intellij-community-commit version)) |
| 195 | (build-system ant-build-system) |
| 196 | (arguments |
| 197 | `(#:source-dir "platform/extensions/src" |
| 198 | #:jar-name "intellij.platform.extensions.jar" |
| 199 | ;; No test |
| 200 | #:tests? #f)) |
| 201 | (propagated-inputs |
| 202 | `(("java-intellij-platform-util" ,java-intellij-platform-util) |
| 203 | ("java-jetbrains-annotations" ,java-jetbrains-annotations) |
| 204 | ("java-picocontainer-1" ,java-picocontainer-1))) |
| 205 | (home-page "https://github.com/JetBrains/intellij-community") |
| 206 | (synopsis "") |
| 207 | (description "") |
| 208 | (license license:asl2.0))) |
| 209 | |
| 210 | (define-public java-intellij-platform-core-api |
| 211 | (package |
| 212 | (name "java-intellij-platform-core-api") |
| 213 | (version intellij-community-version) |
| 214 | (source (intellij-community-source intellij-community-commit version)) |
| 215 | (build-system ant-build-system) |
| 216 | (arguments |
| 217 | `(#:source-dir "platform/core-api/src" |
| 218 | #:jar-name "intellij.platform.core-api.jar" |
| 219 | ;; No test |
| 220 | #:tests? #f)) |
| 221 | (propagated-inputs |
| 222 | `(("java-automaton" ,java-automaton) |
| 223 | ("java-intellij-platform-extensions" ,java-intellij-platform-extensions) |
| 224 | ("java-intellij-platform-resources" ,java-intellij-platform-resources) |
| 225 | ("java-intellij-platform-util" ,java-intellij-platform-util) |
| 226 | ("java-intellij-resources" ,java-intellij-resources) |
| 227 | ("java-jetbrains-annotations" ,java-jetbrains-annotations) |
| 228 | ("java-trove4j-intellij" ,java-trove4j-intellij))) |
| 229 | (home-page "https://github.com/JetBrains/intellij-community") |
| 230 | (synopsis "") |
| 231 | (description "") |
| 232 | (license license:asl2.0))) |
| 233 | |
| 234 | (define-public java-intellij-platform-core-impl |
| 235 | (package |
| 236 | (name "java-intellij-platform-core-impl") |
| 237 | (version intellij-community-version) |
| 238 | (source (intellij-community-source intellij-community-commit version)) |
| 239 | (build-system ant-build-system) |
| 240 | (arguments |
| 241 | `(#:source-dir "platform/core-impl/src" |
| 242 | #:jar-name "intellij.platform.core-impl.jar" |
| 243 | ;; No test |
| 244 | #:tests? #f)) |
| 245 | (propagated-inputs |
| 246 | `(("java-guava" ,java-guava) |
| 247 | ("java-intellij-platform-core-api" ,java-intellij-platform-core-api))) |
| 248 | (home-page "https://github.com/JetBrains/intellij-community") |
| 249 | (synopsis "") |
| 250 | (description "") |
| 251 | (license license:asl2.0))) |
| 252 | |
| 253 | (define-public java-intellij-java-psi-api |
| 254 | (package |
| 255 | (name "java-intellij-java-psi-api") |
| 256 | (version intellij-community-version) |
| 257 | (source (intellij-community-source intellij-community-commit version)) |
| 258 | (build-system ant-build-system) |
| 259 | (arguments |
| 260 | `(#:source-dir "java/java-psi-api/src" |
| 261 | #:jar-name "intellij.java.psi-api.jar" |
| 262 | ;; No test |
| 263 | #:tests? #f |
| 264 | #:phases |
| 265 | (modify-phases %standard-phases |
| 266 | (add-before 'build 'copy-resources |
| 267 | (lambda _ |
| 268 | (copy-recursively "java/java-psi-api/src/messages" |
| 269 | "build/classes/messages") |
| 270 | #t))))) |
| 271 | (propagated-inputs |
| 272 | `(("java-intellij-platform-core-api" ,java-intellij-platform-core-api) |
| 273 | ("java-intellij-platform-util" ,java-intellij-platform-util) |
| 274 | ("java-jetbrains-annotations" ,java-jetbrains-annotations))) |
| 275 | (home-page "https://github.com/JetBrains/intellij-community") |
| 276 | (synopsis "") |
| 277 | (description "") |
| 278 | (license license:asl2.0))) |
| 279 | |
| 280 | (define-public java-intellij-java-psi-impl |
| 281 | (package |
| 282 | (name "java-intellij-java-psi-impl") |
| 283 | (version intellij-community-version) |
| 284 | (source (intellij-community-source intellij-community-commit version)) |
| 285 | (build-system ant-build-system) |
| 286 | (arguments |
| 287 | ;; TODO: remove these auto-generated files and generate them with |
| 288 | ;; java-flex from the same-named file in src, with .flex extension |
| 289 | ;; (_JavaLexer, _JavaDocLexer) |
| 290 | `(#:source-dir "java/java-psi-impl/src:java/java-psi-impl/gen" |
| 291 | #:jar-name "intellij.java.psi-impl.jar" |
| 292 | ;; No test |
| 293 | #:tests? #f |
| 294 | #:phases |
| 295 | (modify-phases %standard-phases |
| 296 | (add-before 'build 'fix-asm |
| 297 | (lambda _ |
| 298 | (with-fluids ((%default-port-encoding "ISO-8859-1")) |
| 299 | (substitute* (find-files "java/java-psi-impl/src" ".*\\.java$") |
| 300 | (("org.jetbrains.org.objectweb") "org.objectweb") |
| 301 | ;; As in build/asm/3_api_version.patch |
| 302 | (("API_VERSION") "ASM6"))) |
| 303 | #t)) |
| 304 | (add-before 'build 'copy-resources |
| 305 | (lambda _ |
| 306 | (copy-recursively "java/java-psi-impl/src/META-INF" |
| 307 | "build/classes/META-INF") |
| 308 | (copy-recursively "java/java-psi-impl/src/messages" |
| 309 | "build/classes/intellij/java/resources/en") |
| 310 | #t))))) |
| 311 | (propagated-inputs |
| 312 | `(("java-asm" ,java-asm) |
| 313 | ("java-intellij-java-psi-api" ,java-intellij-java-psi-api) |
| 314 | ("java-intellij-platform-core-impl" ,java-intellij-platform-core-impl) |
| 315 | ("java-jetbrains-annotations" ,java-jetbrains-annotations) |
| 316 | ("java-streamex" ,java-streamex))) |
| 317 | (home-page "https://github.com/JetBrains/intellij-community") |
| 318 | (synopsis "") |
| 319 | (description "") |
| 320 | (license license:asl2.0))) |
| 321 | |
| 322 | (define-public java-intellij-platform-resources |
| 323 | (package |
| 324 | (name "java-intellij-platform-resources") |
| 325 | (version intellij-community-version) |
| 326 | (source (intellij-community-source intellij-community-commit version)) |
| 327 | (build-system ant-build-system) |
| 328 | (arguments |
| 329 | ;; TODO: remove these auto-generated files and generate them with |
| 330 | ;; java-flex from the same-named file in src, with .flex extension |
| 331 | ;; (_JavaLexer, _JavaDocLexer) |
| 332 | `(#:source-dir "platform/platform-resources" |
| 333 | #:jar-name "intellij.platform.resources.jar" |
| 334 | ;; No test |
| 335 | #:tests? #f |
| 336 | #:phases |
| 337 | (modify-phases %standard-phases |
| 338 | (add-before 'build 'copy-resources |
| 339 | (lambda _ |
| 340 | (copy-recursively "platform/platform-resources/src" |
| 341 | "build/classes") |
| 342 | #t))))) |
| 343 | (propagated-inputs '()) |
| 344 | (native-inputs '()) |
| 345 | (inputs '()) |
| 346 | (home-page "https://github.com/JetBrains/intellij-community") |
| 347 | (synopsis "") |
| 348 | (description "") |
| 349 | (license license:asl2.0))) |
| 350 | |
| 351 | (define-public java-intellij-resources |
| 352 | (package |
| 353 | (name "java-intellij-resources") |
| 354 | (version intellij-community-version) |
| 355 | (source (intellij-community-source intellij-community-commit version)) |
| 356 | (build-system ant-build-system) |
| 357 | (arguments |
| 358 | ;; TODO: remove these auto-generated files and generate them with |
| 359 | ;; java-flex from the same-named file in src, with .flex extension |
| 360 | ;; (_JavaLexer, _JavaDocLexer) |
| 361 | `(#:source-dir "resources" |
| 362 | #:jar-name "intellij.resources.jar" |
| 363 | ;; No test |
| 364 | #:tests? #f |
| 365 | #:phases |
| 366 | (modify-phases %standard-phases |
| 367 | (add-before 'build 'copy-resources |
| 368 | (lambda _ |
| 369 | (copy-recursively "resources/src" "build/classes") |
| 370 | #t))))) |
| 371 | (propagated-inputs '()) |
| 372 | (native-inputs '()) |
| 373 | (inputs '()) |
| 374 | (home-page "https://github.com/JetBrains/intellij-community") |
| 375 | (synopsis "") |
| 376 | (description "") |
| 377 | (license license:asl2.0))) |
| 378 | |
| 379 | ;; Newer versions are not free software anymore |
| 380 | ;; latest free versions are 1.8.1 and 1.8.0. We require something older for |
| 381 | ;; intellij though. |
| 382 | (define-public java-jgoodies-common |
| 383 | (package |
| 384 | (name "java-jgoodies-common") |
| 385 | (version "1.8.1") |
| 386 | (source (origin |
| 387 | (method url-fetch) |
| 388 | (uri "http://www.jgoodies.com/download/libraries/common/jgoodies-common-1_8_1.zip") |
| 389 | (sha256 |
| 390 | (base32 |
| 391 | "1canj4zalrp668c55ji58rk90w005q44lnwzliffsr8mlrgxgaiw")))) |
| 392 | (build-system ant-build-system) |
| 393 | (arguments |
| 394 | `(#:jar-name "jgoodies-common.jar" |
| 395 | #:source-dir "." |
| 396 | #:tests? #f; no tests |
| 397 | #:phases |
| 398 | (modify-phases %standard-phases |
| 399 | (add-before 'build 'extract-source |
| 400 | (lambda _ |
| 401 | (invoke "jar" "xf" "jgoodies-common-1.8.1-sources.jar") |
| 402 | #t))))) |
| 403 | (native-inputs |
| 404 | `(("unzip" ,unzip))) |
| 405 | (home-page "http://www.jgoodies.com") |
| 406 | (synopsis "") |
| 407 | (description "") |
| 408 | (license license:bsd-3))) |
| 409 | |
| 410 | (define-public java-jgoodies-forms |
| 411 | (package |
| 412 | (name "java-jgoodies-forms") |
| 413 | (version "1.8.0") |
| 414 | (source (origin |
| 415 | (method url-fetch) |
| 416 | (uri "http://www.jgoodies.com/download/libraries/forms/jgoodies-forms-1_8_0.zip") |
| 417 | (sha256 |
| 418 | (base32 |
| 419 | "1av4w1px1jxmv19mljyicbv657sw5nqhkfx6s7nc5ckzf9ay945h")))) |
| 420 | (build-system ant-build-system) |
| 421 | (arguments |
| 422 | `(#:jar-name "jgoodies-forms.jar" |
| 423 | #:source-dir "." |
| 424 | #:tests? #f; no tests |
| 425 | #:phases |
| 426 | (modify-phases %standard-phases |
| 427 | (add-before 'build 'extract-source |
| 428 | (lambda _ |
| 429 | (invoke "jar" "xf" "jgoodies-forms-1.8.0-sources.jar") |
| 430 | #t))))) |
| 431 | (native-inputs |
| 432 | `(("unzip" ,unzip))) |
| 433 | (inputs |
| 434 | `(("java-jgoodies-common" ,java-jgoodies-common))) |
| 435 | (home-page "http://www.jgoodies.com") |
| 436 | (synopsis "") |
| 437 | (description "") |
| 438 | (license license:bsd-3))) |
| 439 | |
| 440 | ;; Requires JGoodies Forms: http://www.jgoodies.com |
| 441 | (define-public java-intellij-compiler-forms-compiler |
| 442 | (package |
| 443 | (name "java-intellij-compiler-forms-compiler") |
| 444 | (version intellij-community-version) |
| 445 | (source (intellij-community-source intellij-community-commit version)) |
| 446 | (build-system ant-build-system) |
| 447 | (arguments |
| 448 | `(#:source-dir "java/compiler/forms-compiler/src" |
| 449 | #:jar-name "forms-compiler.jar" |
| 450 | ;; No test |
| 451 | #:tests? #f |
| 452 | #:phases |
| 453 | (modify-phases %standard-phases |
| 454 | (add-before 'build 'fix-imports |
| 455 | (lambda _ |
| 456 | (substitute* (find-files "java/compiler/forms-compiler/src" ".*.java") |
| 457 | (("org.jetbrains.org.objectweb") "org.objectweb") |
| 458 | ;; As in build/asm/3_api_version.patch |
| 459 | (("API_VERSION") "ASM6")))) |
| 460 | (add-before 'build 'fix-old-jgoodies |
| 461 | (lambda _ |
| 462 | (substitute* "java/compiler/forms-compiler/src/com/intellij/uiDesigner/lw/FormLayoutSerializer.java" |
| 463 | (("new ColumnSpec\\(spec\\)") "ColumnSpec.parse(spec)"))))))) |
| 464 | (inputs |
| 465 | `(("java-intellij-platform-forms-rt" ,java-intellij-platform-forms-rt) |
| 466 | ("java-intellij-compiler-instrumentation-util" ,java-intellij-compiler-instrumentation-util) |
| 467 | ("java-asm" ,java-asm) |
| 468 | ("java-jdom" ,java-jdom) |
| 469 | ("java-jgoodies-forms" ,java-jgoodies-forms))) |
| 470 | (home-page "https://github.com/JetBrains/intellij-community") |
| 471 | (synopsis "") |
| 472 | (description "") |
| 473 | (license license:asl2.0))) |
| 474 |