kotlin.scm
1 | ;;; GNU Guix --- Functional package management for GNU |
2 | ;;; Copyright © 2018, 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 kotlin) |
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 intellij) |
42 | #:use-module (more packages java)) |
43 | |
44 | (define-public java-former-dart-ast |
45 | (let ((commit "845189ca287c96b864bd1442fe31e591a9c6f883")) |
46 | (package |
47 | (name "java-former-dart-ast") |
48 | (version (git-version "0.0.0" "1" commit)) |
49 | (source (origin |
50 | (method git-fetch) |
51 | (uri (git-reference |
52 | (url "https://github.com/develar/former-dast-ast") |
53 | (commit commit))) |
54 | (file-name (git-file-name name version)) |
55 | (sha256 |
56 | (base32 |
57 | "0hl3rij3kdl0c8l6avwg1ibscjpymdqg6irwbqric6sl5fawlhwz")))) |
58 | (build-system ant-build-system) |
59 | (arguments |
60 | `(#:jar-name "dart-ast.jar" |
61 | ;; No tests |
62 | #:tests? #f)) |
63 | (propagated-inputs |
64 | `(("java-intellij-platform-util" ,java-intellij-platform-util) |
65 | ("java-jetbrains-annotations" ,java-jetbrains-annotations))) |
66 | (home-page "https://github.com/develar/former-dast-ast") |
67 | (synopsis "") |
68 | (description "") |
69 | (license license:bsd-3)))) |
70 | |
71 | (define-public kotlin-0 |
72 | (package |
73 | (name "kotlin") |
74 | (version "0") |
75 | (source (origin |
76 | (method git-fetch) |
77 | (uri (git-reference |
78 | (url "https://github.com/JetBrains/kotlin") |
79 | ;; build-0.4.424 |
80 | (commit "2f47e30a1a12347759dbb8707f5137178de65696"))) |
81 | (file-name (git-file-name name version)) |
82 | (sha256 |
83 | (base32 |
84 | "0f60v3swyrkh41c4lhha64njivvsnr7p6yz7i1vjmvs697pjvqg2")) |
85 | (patches |
86 | (search-patches "kotlin-Update-for-dependencies.patch")) |
87 | (modules '((guix build utils))) |
88 | (snippet |
89 | `(begin |
90 | (for-each delete-file (find-files "." ".*.jar$")) |
91 | ;; TODO: Remove these files, but they are needed by the |
92 | ;; process that generate them... |
93 | ;(for-each delete-file (find-files "." ".*Generated.java$")) |
94 | (mkdir-p "ideaSDK/core") |
95 | (mkdir "ideaSDK/lib") |
96 | (mkdir "dependencies") |
97 | #t)))) |
98 | (build-system ant-build-system) |
99 | (arguments |
100 | `(#:build-target "dist" |
101 | #:make-flags (list "-Dshrink=false") |
102 | #:phases |
103 | (modify-phases %standard-phases |
104 | (add-before 'build 'copy-jars |
105 | (lambda* (#:key inputs #:allow-other-keys) |
106 | (for-each |
107 | (lambda (file) |
108 | (copy-file file (string-append "lib/" (basename file)))) |
109 | (apply append |
110 | (map (lambda (input) |
111 | (find-files (assoc-ref inputs input) ".*.jar$")) |
112 | '("java-asm" "java-asm-commons" |
113 | "java-former-dart-ast" |
114 | "java-guava" |
115 | "java-intellij-java-psi-api" |
116 | "java-intellij-java-psi-impl" |
117 | "java-intellij-platform-core-api" |
118 | "java-intellij-platform-core-impl" |
119 | "java-intellij-platform-extensions" |
120 | "java-intellij-platform-util" |
121 | "java-intellij-platform-util-rt" |
122 | "java-javax-inject" |
123 | "java-jline-2" |
124 | "java-jsr305" |
125 | "java-jetbrains-annotations" |
126 | "java-spullara-cli-parser" |
127 | "java-trove4j-intellij" |
128 | ;; propagated inputs |
129 | "java-intellij-platform-resources" |
130 | "java-intellij-resources" |
131 | "java-picocontainer-1" |
132 | ;; implicit input |
133 | "ant")))) |
134 | #t)) |
135 | (add-before 'build 'fix-write-permission |
136 | (lambda _ |
137 | (with-directory-excursion "compiler/frontend.java/src/org/jetbrains/jet" |
138 | (chmod |
139 | "lang/resolve/java/JavaToKotlinMethodMapGenerated.java" |
140 | #o644)) |
141 | #t)) |
142 | (add-before 'build 'fix-asm |
143 | (lambda _ |
144 | (substitute* (find-files "." ".*.java$") |
145 | (("org.jetbrains.asm4") "org.objectweb.asm")) |
146 | #t))))) |
147 | (inputs |
148 | `(("java-asm" ,java-asm) |
149 | ("java-asm-commons" ,java-asm-commons-7) |
150 | ("java-former-dart-ast" ,java-former-dart-ast) |
151 | ("java-guava" ,java-guava) |
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)) |
159 | ("java-javax-inject" ,java-javax-inject) |
160 | ("java-jline-2" ,java-jline-2) |
161 | ("java-jsr305" ,java-jsr305) |
162 | ("java-jetbrains-annotations" ,java-jetbrains-annotations) |
163 | ("java-spullara-cli-parser" ,java-spullara-cli-parser) |
164 | ("java-trove4j-intellij" ,java-trove4j-intellij))) |
165 | (native-inputs |
166 | `(("java-jarjar" ,java-jarjar))) |
167 | (home-page "") |
168 | (synopsis "") |
169 | (description "") |
170 | (license license:asl2.0))) |
171 | |
172 | ;; Needs maven-core |
173 | (define-public kotlin-1.2 |
174 | (package |
175 | (name "kotlin") |
176 | ;; last version with a build.xml file |
177 | ;; TODO: check if version 1.2.32-1.2.39 exist. 1.2.40 doesn't have build.xml. |
178 | (version "1.2.31") |
179 | (source (origin |
180 | (method url-fetch) |
181 | (uri (string-append "https://github.com/JetBrains/kotlin/archive/v" |
182 | version ".tar.gz")) |
183 | (file-name (string-append name "-" version ".tar.gz")) |
184 | (sha256 |
185 | (base32 |
186 | "1lm1rvj1vf4z8nzpffqcdwcydnlf24ls07z0r0nc4by3hjxzs3sv")) |
187 | (modules '((guix build utils))) |
188 | (snippet |
189 | `(begin |
190 | (for-each delete-file (find-files "." ".*.jar$")) |
191 | #t)))) |
192 | (build-system ant-build-system) |
193 | (arguments |
194 | `(#:phases |
195 | (modify-phases %standard-phases |
196 | (add-before 'build 'fix-build.xml |
197 | (lambda _ |
198 | (substitute* "build.xml" |
199 | (("org/jetbrains/kotlin/ant/antlib.xml") |
200 | "ant/src/org/jetbrains/kotlin/ant/antlib.xml"))))))) |
201 | (native-inputs |
202 | `(("java-intellij-compiler-javac2" ,java-intellij-compiler-javac2))) |
203 | (home-page "https://kotlinlang.org/") |
204 | (synopsis "Programming language targetting the JVM") |
205 | (description "") |
206 | (license license:asl2.0))) |
207 | |
208 | (define-public kotlin |
209 | (package |
210 | (name "kotlin") |
211 | (version "1.3.11") |
212 | (source (origin |
213 | (method git-fetch) |
214 | (uri (git-reference |
215 | (url "https://github.com/JetBrains/kotlin") |
216 | (commit (string-append "v" version)))) |
217 | (file-name (git-file-name name version)) |
218 | (sha256 |
219 | (base32 |
220 | "123gfr72p0715n925kivl3khlqzk11qpyv65jwlhcplgfvw8rl73")))) |
221 | (build-system ant-build-system) |
222 | (home-page "https://kotlinlang.org/") |
223 | (synopsis "Programming language targetting the JVM") |
224 | (description "") |
225 | (license license:asl2.0))) |
226 |