guix-more/more/packages/kotlin.scm

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.4.424")
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
       #:phases
102
       (modify-phases %standard-phases
103
         (add-before 'build 'copy-jars
104
           (lambda* (#:key inputs #:allow-other-keys)
105
             (for-each
106
               (lambda (file)
107
                 (copy-file file (string-append "lib/" (basename file))))
108
               (apply append
109
                 (map (lambda (input)
110
                        (find-files (assoc-ref inputs input) ".*.jar$"))
111
                   '("java-asm" "java-asm-commons"
112
                     "java-former-dart-ast"
113
                     "java-guava"
114
                     "java-intellij-java-psi-api"
115
                     "java-intellij-java-psi-impl"
116
                     "java-intellij-platform-core-api"
117
                     "java-intellij-platform-core-impl"
118
                     "java-intellij-platform-extensions"
119
                     "java-intellij-platform-util"
120
                     "java-intellij-platform-util-rt"
121
                     "java-javax-inject"
122
                     "java-jline-2"
123
                     "java-jsr305"
124
                     "java-jetbrains-annotations"
125
                     "java-spullara-cli-parser"
126
                     "java-trove4j-intellij"
127
                     ;; propagated inputs
128
                     "java-intellij-platform-resources"
129
                     "java-intellij-resources"
130
                     "java-picocontainer-1"
131
                     ;; implicit input
132
                     "ant"))))
133
             #t))
134
         (add-before 'build 'fix-write-permission
135
           (lambda _
136
             (with-directory-excursion "compiler/frontend.java/src/org/jetbrains/jet"
137
               (chmod
138
                 "lang/resolve/java/JavaToKotlinMethodMapGenerated.java"
139
                 #o644))
140
             #t))
141
         (add-before 'build 'fix-asm
142
           (lambda _
143
             (substitute* (find-files "." ".*.java$")
144
               (("org.jetbrains.asm4") "org.objectweb.asm"))
145
             #t)))))
146
    (inputs
147
     `(("java-asm" ,java-asm)
148
       ("java-asm-commons" ,java-asm-commons-7)
149
       ("java-former-dart-ast" ,java-former-dart-ast)
150
       ("java-guava" ,java-guava)
151
       ("java-intellij-java-psi-api" ,(intellij-2013-package java-intellij-java-psi-api))
152
       ("java-intellij-java-psi-impl" ,(intellij-2013-package java-intellij-java-psi-impl))
153
       ("java-intellij-platform-core-api" ,(intellij-2013-package java-intellij-platform-core-api))
154
       ("java-intellij-platform-core-impl" ,(intellij-2013-package java-intellij-platform-core-impl))
155
       ("java-intellij-platform-extensions" ,(intellij-2013-package java-intellij-platform-extensions))
156
       ("java-intellij-platform-util" ,(intellij-2013-package java-intellij-platform-util))
157
       ("java-intellij-platform-util-rt" ,(intellij-2013-package java-intellij-platform-util-rt))
158
       ("java-javax-inject" ,java-javax-inject)
159
       ("java-jline-2" ,java-jline-2)
160
       ("java-jsr305" ,java-jsr305)
161
       ("java-jetbrains-annotations" ,java-jetbrains-annotations)
162
       ("java-spullara-cli-parser" ,java-spullara-cli-parser)
163
       ("java-trove4j-intellij" ,java-trove4j-intellij)))
164
    (native-inputs
165
     `(("java-jarjar" ,java-jarjar)))
166
    (home-page "")
167
    (synopsis "")
168
    (description "")
169
    (license license:asl2.0)))
170
171
;; Needs maven-core
172
(define-public kotlin-1.2
173
  (package
174
    (name "kotlin")
175
    ;; last version with a build.xml file
176
    ;; TODO: check if version 1.2.32-1.2.39 exist. 1.2.40 doesn't have build.xml.
177
    (version "1.2.31")
178
    (source (origin
179
              (method url-fetch)
180
              (uri (string-append "https://github.com/JetBrains/kotlin/archive/v"
181
                                  version ".tar.gz"))
182
              (file-name (string-append name "-" version ".tar.gz"))
183
              (sha256
184
               (base32
185
                "1lm1rvj1vf4z8nzpffqcdwcydnlf24ls07z0r0nc4by3hjxzs3sv"))
186
              (modules '((guix build utils)))
187
              (snippet
188
                `(begin
189
                   (for-each delete-file (find-files "." ".*.jar$"))
190
                   #t))))
191
    (build-system ant-build-system)
192
    (arguments
193
     `(#:phases
194
       (modify-phases %standard-phases
195
         (add-before 'build 'fix-build.xml
196
           (lambda _
197
             (substitute* "build.xml"
198
               (("org/jetbrains/kotlin/ant/antlib.xml")
199
                "ant/src/org/jetbrains/kotlin/ant/antlib.xml")))))))
200
    (native-inputs
201
     `(("java-intellij-compiler-javac2" ,java-intellij-compiler-javac2)))
202
    (home-page "https://kotlinlang.org/")
203
    (synopsis "Programming language targetting the JVM")
204
    (description "")
205
    (license license:asl2.0)))
206
207
(define-public kotlin
208
  (package
209
    (name "kotlin")
210
    (version "1.3.11")
211
    (source (origin
212
              (method git-fetch)
213
              (uri (git-reference
214
                     (url "https://github.com/JetBrains/kotlin")
215
                     (commit (string-append "v" version))))
216
              (file-name (git-file-name name version))
217
              (sha256
218
               (base32
219
                "123gfr72p0715n925kivl3khlqzk11qpyv65jwlhcplgfvw8rl73"))))
220
    (build-system ant-build-system)
221
    (home-page "https://kotlinlang.org/")
222
    (synopsis "Programming language targetting the JVM")
223
    (description "")
224
    (license license:asl2.0)))
225