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
             #t))
90
         (add-before 'build 'fix-asm
91
           (lambda _
92
             (substitute* (find-files "." ".*.java$")
93
               (("org.jetbrains.asm4") "org.objectweb.asm"))
94
             #t)))))
95
    (inputs
96
     `(("java-asm" ,java-asm)
97
       ("java-asm-commons" ,java-asm-commons-7)
98
       ("java-intellij-java-psi-api" ,java-intellij-java-psi-api)
99
       ("java-intellij-java-psi-impl" ,java-intellij-java-psi-impl)
100
       ("java-intellij-platform-core-api" ,java-intellij-platform-core-api)
101
       ("java-intellij-platform-core-impl" ,java-intellij-platform-core-impl)
102
       ("java-intellij-platform-extensions" ,java-intellij-platform-extensions)
103
       ("java-intellij-platform-util" ,java-intellij-platform-util)
104
       ("java-intellij-platform-util-rt" ,java-intellij-platform-util-rt)
105
       ("java-javax-inject" ,java-javax-inject)
106
       ("java-jsr305" ,java-jsr305)
107
       ("java-jetbrains-annotations" ,java-jetbrains-annotations)
108
       ("java-guava" ,java-guava)))
109
    (home-page "")
110
    (synopsis "")
111
    (description "")
112
    (license license:asl2.0)))
113
114
;; Needs maven-core
115
(define-public kotlin-1.2
116
  (package
117
    (name "kotlin")
118
    ;; last version with a build.xml file
119
    ;; TODO: check if version 1.2.32-1.2.39 exist. 1.2.40 doesn't have build.xml.
120
    (version "1.2.31")
121
    (source (origin
122
              (method url-fetch)
123
              (uri (string-append "https://github.com/JetBrains/kotlin/archive/v"
124
                                  version ".tar.gz"))
125
              (file-name (string-append name "-" version ".tar.gz"))
126
              (sha256
127
               (base32
128
                "1lm1rvj1vf4z8nzpffqcdwcydnlf24ls07z0r0nc4by3hjxzs3sv"))
129
              (modules '((guix build utils)))
130
              (snippet
131
                `(begin
132
                   (for-each delete-file (find-files "." ".*.jar$"))
133
                   #t))))
134
    (build-system ant-build-system)
135
    (arguments
136
     `(#:phases
137
       (modify-phases %standard-phases
138
         (add-before 'build 'fix-build.xml
139
           (lambda _
140
             (substitute* "build.xml"
141
               (("org/jetbrains/kotlin/ant/antlib.xml")
142
                "ant/src/org/jetbrains/kotlin/ant/antlib.xml")))))))
143
    (native-inputs
144
     `(("java-intellij-compiler-javac2" ,java-intellij-compiler-javac2)))
145
    (home-page "https://kotlinlang.org/")
146
    (synopsis "Programming language targetting the JVM")
147
    (description "")
148
    (license license:asl2.0)))
149
150
(define-public kotlin
151
  (package
152
    (name "kotlin")
153
    (version "1.3.11")
154
    (source (origin
155
              (method git-fetch)
156
              (uri (git-reference
157
                     (url "https://github.com/JetBrains/kotlin")
158
                     (commit (string-append "v" version))))
159
              (file-name (git-file-name name version))
160
              (sha256
161
               (base32
162
                "123gfr72p0715n925kivl3khlqzk11qpyv65jwlhcplgfvw8rl73"))))
163
    (build-system ant-build-system)
164
    (home-page "https://kotlinlang.org/")
165
    (synopsis "Programming language targetting the JVM")
166
    (description "")
167
    (license license:asl2.0)))
168