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 kotlin-0
45
  (package
46
    (name "kotlin")
47
    (version "0")
48
    (source (origin
49
              (method git-fetch)
50
              (uri (git-reference
51
                     (url "https://github.com/JetBrains/kotlin")
52
                     (commit "2f47e30a1a12347759dbb8707f5137178de65696")))
53
              (file-name (git-file-name name version))
54
              (sha256
55
               (base32
56
                "0f60v3swyrkh41c4lhha64njivvsnr7p6yz7i1vjmvs697pjvqg2"))
57
              (modules '((guix build utils)))
58
              (snippet
59
                `(begin
60
                   (for-each delete-file (find-files "." ".*.jar$"))
61
                   (mkdir "ideaSDK")
62
                   (mkdir "dependencies")
63
                   #t))))
64
    (build-system ant-build-system)
65
    (arguments
66
     `(#:build-target "dist"
67
       #:phases
68
       (modify-phases %standard-phases
69
         (add-before 'build 'copy-jars
70
           (lambda* (#:key inputs #:allow-other-keys)
71
             (for-each
72
               (lambda (file)
73
                 (copy-file file (string-append "lib/" (basename file))))
74
               (apply append
75
                 (map (lambda (input)
76
                        (find-files (assoc-ref inputs input) ".*.jar$"))
77
                   '("java-asm" "java-asm-commons"
78
                     "java-guava"
79
                     "java-intellij-java-psi-api"
80
                     "java-intellij-java-psi-impl"
81
                     "java-intellij-platform-core-api"
82
                     "java-intellij-platform-core-impl"
83
                     "java-intellij-platform-extensions"
84
                     "java-intellij-platform-util"
85
                     "java-intellij-platform-util-rt"
86
                     "java-javax-inject"
87
                     "java-jsr305"
88
                     "java-jetbrains-annotations"
89
                     "java-trove4j-intellij"))))
90
             #t))
91
         (add-before 'build 'fix-asm
92
           (lambda _
93
             (substitute* (find-files "." ".*.java$")
94
               (("org.jetbrains.asm4") "org.objectweb.asm"))
95
             #t)))))
96
    (inputs
97
     `(("java-asm" ,java-asm)
98
       ("java-asm-commons" ,java-asm-commons-7)
99
       ("java-guava" ,java-guava)
100
       ("java-intellij-java-psi-api" ,java-intellij-java-psi-api)
101
       ("java-intellij-java-psi-impl" ,java-intellij-java-psi-impl)
102
       ("java-intellij-platform-core-api" ,java-intellij-platform-core-api)
103
       ("java-intellij-platform-core-impl" ,java-intellij-platform-core-impl)
104
       ("java-intellij-platform-extensions" ,java-intellij-platform-extensions)
105
       ("java-intellij-platform-util" ,java-intellij-platform-util)
106
       ("java-intellij-platform-util-rt" ,java-intellij-platform-util-rt)
107
       ("java-javax-inject" ,java-javax-inject)
108
       ("java-jsr305" ,java-jsr305)
109
       ("java-jetbrains-annotations" ,java-jetbrains-annotations)
110
       ("java-trove4j-intellij" ,java-trove4j-intellij)))
111
    (home-page "")
112
    (synopsis "")
113
    (description "")
114
    (license license:asl2.0)))
115
116
;; Needs maven-core
117
(define-public kotlin-1.2
118
  (package
119
    (name "kotlin")
120
    ;; last version with a build.xml file
121
    ;; TODO: check if version 1.2.32-1.2.39 exist. 1.2.40 doesn't have build.xml.
122
    (version "1.2.31")
123
    (source (origin
124
              (method url-fetch)
125
              (uri (string-append "https://github.com/JetBrains/kotlin/archive/v"
126
                                  version ".tar.gz"))
127
              (file-name (string-append name "-" version ".tar.gz"))
128
              (sha256
129
               (base32
130
                "1lm1rvj1vf4z8nzpffqcdwcydnlf24ls07z0r0nc4by3hjxzs3sv"))
131
              (modules '((guix build utils)))
132
              (snippet
133
                `(begin
134
                   (for-each delete-file (find-files "." ".*.jar$"))
135
                   #t))))
136
    (build-system ant-build-system)
137
    (arguments
138
     `(#:phases
139
       (modify-phases %standard-phases
140
         (add-before 'build 'fix-build.xml
141
           (lambda _
142
             (substitute* "build.xml"
143
               (("org/jetbrains/kotlin/ant/antlib.xml")
144
                "ant/src/org/jetbrains/kotlin/ant/antlib.xml")))))))
145
    (native-inputs
146
     `(("java-intellij-compiler-javac2" ,java-intellij-compiler-javac2)))
147
    (home-page "https://kotlinlang.org/")
148
    (synopsis "Programming language targetting the JVM")
149
    (description "")
150
    (license license:asl2.0)))
151
152
(define-public kotlin
153
  (package
154
    (name "kotlin")
155
    (version "1.3.11")
156
    (source (origin
157
              (method git-fetch)
158
              (uri (git-reference
159
                     (url "https://github.com/JetBrains/kotlin")
160
                     (commit (string-append "v" version))))
161
              (file-name (git-file-name name version))
162
              (sha256
163
               (base32
164
                "123gfr72p0715n925kivl3khlqzk11qpyv65jwlhcplgfvw8rl73"))))
165
    (build-system ant-build-system)
166
    (home-page "https://kotlinlang.org/")
167
    (synopsis "Programming language targetting the JVM")
168
    (description "")
169
    (license license:asl2.0)))
170