java.scm
| 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2017 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 java) |
| 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 utils) |
| 26 | #:use-module (guix build-system ant) |
| 27 | #:use-module (guix build-system gnu) |
| 28 | #:use-module (guix build-system trivial) |
| 29 | #:use-module (gnu packages java)) |
| 30 | |
| 31 | (define-public josm |
| 32 | (package |
| 33 | (name "josm") |
| 34 | (version "c86ae64ca82a5bb9dd1972c7023797eb9a2577f5") |
| 35 | (source (origin |
| 36 | (method git-fetch) |
| 37 | (uri (git-reference |
| 38 | (url "https://github.com/openstreetmap/josm.git") |
| 39 | (commit version))) |
| 40 | (sha256 |
| 41 | (base32 |
| 42 | "07z2q4csq9gdpg4lp1zpvcl5z5sqn0fnqah94ya3sirm6bh4k74j")) |
| 43 | (file-name (string-append name "-" version)))) |
| 44 | (build-system ant-build-system) |
| 45 | (arguments |
| 46 | `(#:build-target "dist" |
| 47 | #:tests? #f |
| 48 | #:jdk ,icedtea-8 |
| 49 | #:phases |
| 50 | (modify-phases %standard-phases |
| 51 | (add-before 'build 'fix-compiler |
| 52 | (lambda* _ |
| 53 | (substitute* "build.xml" |
| 54 | ((".*com.google.errorprone.ErrorProneAntCompilerAdapter.*") "") |
| 55 | (("compiler=\"[^\"]*\" ") "")))) |
| 56 | (replace 'install |
| 57 | (lambda* (#:key outputs #:allow-other-keys) |
| 58 | (let* ((out (assoc-ref outputs "out")) |
| 59 | (bin (string-append out "/bin")) |
| 60 | (lib (string-append out "/lib/josm"))) |
| 61 | (mkdir-p bin) |
| 62 | (mkdir-p lib) |
| 63 | (copy-file "dist/josm-custom.jar" |
| 64 | (string-append lib "/josm.jar")) |
| 65 | (with-output-to-file (string-append bin "/josm") |
| 66 | (lambda _ |
| 67 | (display |
| 68 | (string-append "#!/bin/sh\n" |
| 69 | "java -jar " lib "/josm.jar")))) |
| 70 | (chmod (string-append bin "/josm") #o755))))))) |
| 71 | (home-page "https://josm.openstreetmap.de") |
| 72 | (synopsis "OSM editor") |
| 73 | (description "OSM editor.") |
| 74 | (license license:gpl2+))) |
| 75 |