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