wip: kotlin dependencies

Julien LepillerTue May 15 22:42:41+0200 2018

b6e87b4

wip: kotlin dependencies

more/packages/kotlin.scm

11
;;; GNU Guix --- Functional package management for GNU
2-
;;; Copyright ?? 2017 Julien Lepiller <julien@lepiller.eu>
2+
;;; Copyright ?? 2018 Julien Lepiller <julien@lepiller.eu>
33
;;;
44
;;; This file is part of GNU Guix.
55
;;;

6464
             (substitute* "build.xml"
6565
               (("org/jetbrains/kotlin/ant/antlib.xml")
6666
                "ant/src/org/jetbrains/kotlin/ant/antlib.xml")))))))
67+
    (native-inputs
68+
     `(("java-intellij-compiler-javac2" ,java-intellij-compiler-javac2)))
6769
    (home-page "https://kotlinlang.org/")
6870
    (synopsis "Programming language targetting the JVM")
6971
    (description "")
7072
    (license license:asl2.0)))
7173
72-
(define-public java-javac2
74+
;; The release page on github is a mess
75+
(define intellij-community-version "0.182.2256")
76+
(define (intellij-community-source version)
77+
  (origin
78+
    (method url-fetch)
79+
    (uri (string-append "https://github.com/JetBrains/intellij-community/"
80+
                        "archive/appcode/" (substring version 2) ".tar.gz"))
81+
    (file-name (string-append "intellij-community-" version ".tar.gz"))
82+
    (sha256
83+
     (base32
84+
      "1b9csd0vs6m41q4jhlwl3rlfb596vcnjhch75pcwk8999zrvqf0f"))
85+
    (modules '((guix build utils)))
86+
    (snippet
87+
      `(begin
88+
         (for-each
89+
           (lambda (file)
90+
             (if (file-exists? file)
91+
               (delete-file-recursively file)))
92+
           (append (find-files "." "^lib$" #:directories? #t)
93+
                   (find-files "." "^bin$" #:directories? #t)))
94+
         (for-each delete-file (find-files "." ".*.jar$"))))))
95+
96+
(define-public java-intellij-compiler-instrumentation-util
97+
  (package
98+
    (name "java-intellij-compiler-instrumentation-util")
99+
    (version intellij-community-version)
100+
    (source (intellij-community-source version))
101+
    (build-system ant-build-system)
102+
    (arguments
103+
     `(#:source-dir "java/compiler/instrumentation-util/src"
104+
       #:jar-name "instrumentation-util.jar"
105+
       ;; No test
106+
       #:tests? #f
107+
       #:phases
108+
       (modify-phases %standard-phases
109+
         (add-before 'build 'fix-imports
110+
           (lambda _
111+
             (substitute* (find-files "java/compiler/instrumentation-util/src" ".*.java")
112+
               (("org.jetbrains.org.objectweb") "org.objectweb")
113+
                ;; As in build/asm/3_api_version.patch
114+
               (("API_VERSION") "ASM6")))))))
115+
    (inputs
116+
     `(("java-asm" ,java-asm)))
117+
    (home-page "https://github.com/JetBrains/intellij-community")
118+
    (synopsis "")
119+
    (description "")
120+
    (license license:asl2.0)))
121+
122+
(define-public java-intellij-compiler-javac2
123+
  (package
124+
    (name "java-intellij-compiler-javac2")
125+
    (version intellij-community-version)
126+
    (source (intellij-community-source version))
127+
    (build-system ant-build-system)
128+
    (arguments
129+
     `(#:source-dir "java/compiler/javac2/src"
130+
       #:jar-name "javac2.jar"
131+
       ;; No test
132+
       #:tests? #f))
133+
    (inputs
134+
     `(("java-intellij-compiler-instrumentation-util" ,java-intellij-compiler-instrumentation-util)))
135+
    (home-page "https://github.com/JetBrains/intellij-community")
136+
    (synopsis "")
137+
    (description "")
138+
    (license license:asl2.0)))
139+
140+
(define-public java-intellij-platform-forms-rt
73141
  (package
74-
    (name "java-javac2")
75-
    ;; The release page on github is a mess
76-
    (version "0.182.2256")
142+
    (name "java-intellij-platform-forms-rt")
143+
    (version intellij-community-version)
144+
    (source (intellij-community-source version))
145+
    (build-system ant-build-system)
146+
    (arguments
147+
     `(#:source-dir "platform/forms_rt/src"
148+
       #:jar-name "forms_rt.jar"
149+
       ;; No test
150+
       #:tests? #f))
151+
    (home-page "https://github.com/JetBrains/intellij-community")
152+
    (synopsis "")
153+
    (description "")
154+
    (license license:asl2.0)))
155+
156+
;; Newer versions are not free software anymore
157+
;; latest free versions are 1.8.1 and 1.8.0. We require something older for
158+
;; intellij though.
159+
(define-public java-jgoodies-common
160+
  (package
161+
    (name "java-jgoodies-common")
162+
    (version "1.8.1")
77163
    (source (origin
78164
              (method url-fetch)
79-
              (uri (string-append "https://github.com/JetBrains/intellij-community/"
80-
                                  "archive/appcode/" (substring version 2) ".tar.gz"))
81-
              (file-name (string-append name "-" version ".tar.gz"))
165+
              (uri "http://www.jgoodies.com/download/libraries/common/jgoodies-common-1_8_1.zip")
82166
              (sha256
83167
               (base32
84-
                "1b9csd0vs6m41q4jhlwl3rlfb596vcnjhch75pcwk8999zrvqf0f"))))
168+
                "1canj4zalrp668c55ji58rk90w005q44lnwzliffsr8mlrgxgaiw"))))
85169
    (build-system ant-build-system)
86170
    (arguments
87-
     `(#:source-dir "java/compiler/javac2/src"
171+
     `(#:jar-name "jgoodies-common.jar"
172+
       #:source-dir "."
173+
       #:tests? #f; no tests
174+
       #:phases
175+
       (modify-phases %standard-phases
176+
         (add-before 'build 'extract-source
177+
           (lambda _
178+
             (invoke "jar" "xf" "jgoodies-common-1.8.1-sources.jar")
179+
             #t)))))
180+
    (native-inputs
181+
     `(("unzip" ,unzip)))
182+
    (home-page "http://www.jgoodies.com")
183+
    (synopsis "")
184+
    (description "")
185+
    (license license:bsd-3)))
186+
187+
(define-public java-jgoodies-forms
188+
  (package
189+
    (name "java-jgoodies-forms")
190+
    (version "1.8.0")
191+
    (source (origin
192+
              (method url-fetch)
193+
              (uri "http://www.jgoodies.com/download/libraries/forms/jgoodies-forms-1_8_0.zip")
194+
              (sha256
195+
               (base32
196+
                "1av4w1px1jxmv19mljyicbv657sw5nqhkfx6s7nc5ckzf9ay945h"))))
197+
    (build-system ant-build-system)
198+
    (arguments
199+
     `(#:jar-name "jgoodies-forms.jar"
200+
       #:source-dir "."
201+
       #:tests? #f; no tests
202+
       #:phases
203+
       (modify-phases %standard-phases
204+
         (add-before 'build 'extract-source
205+
           (lambda _
206+
             (invoke "jar" "xf" "jgoodies-forms-1.8.0-sources.jar")
207+
             #t)))))
208+
    (native-inputs
209+
     `(("unzip" ,unzip)))
210+
    (inputs
211+
     `(("java-jgoodies-common" ,java-jgoodies-common)))
212+
    (home-page "http://www.jgoodies.com")
213+
    (synopsis "")
214+
    (description "")
215+
    (license license:bsd-3)))
216+
217+
;; Requires JGoodies Forms: http://www.jgoodies.com
218+
(define-public java-intellij-compiler-forms-compiler
219+
  (package
220+
    (name "java-intellij-compiler-forms-compiler")
221+
    (version intellij-community-version)
222+
    (source (intellij-community-source version))
223+
    (build-system ant-build-system)
224+
    (arguments
225+
     `(#:source-dir "java/compiler/forms-compiler/src"
226+
       #:jar-name "forms-compiler.jar"
88227
       ;; No test
89-
       #:tests? #f))
228+
       #:tests? #f
229+
       #:phases
230+
       (modify-phases %standard-phases
231+
         (add-before 'build 'fix-imports
232+
           (lambda _
233+
             (substitute* (find-files "java/compiler/forms-compiler/src" ".*.java")
234+
               (("org.jetbrains.org.objectweb") "org.objectweb")
235+
                ;; As in build/asm/3_api_version.patch
236+
               (("API_VERSION") "ASM6"))))
237+
         (add-before 'build 'fix-old-jgoodies
238+
           (lambda _
239+
             (substitute* "java/compiler/forms-compiler/src/com/intellij/uiDesigner/lw/FormLayoutSerializer.java"
240+
               (("new ColumnSpec\\(spec\\)") "ColumnSpec.parse(spec)")))))))
241+
    (inputs
242+
     `(("java-intellij-platform-forms-rt" ,java-intellij-platform-forms-rt)
243+
       ("java-intellij-compiler-instrumentation-util" ,java-intellij-compiler-instrumentation-util)
244+
       ("java-asm" ,java-asm)
245+
       ("java-jdom" ,java-jdom)
246+
       ("java-jgoodies-forms" ,java-jgoodies-forms)))
90247
    (home-page "https://github.com/JetBrains/intellij-community")
91248
    (synopsis "")
92249
    (description "")