ecf8fe0c45dd7fd5be94777518a1a9c2edf3717b
[jackhill/guix/guix.git] / gnu / packages / uml.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2016 Theodoros Foradis <theodoros@foradis.org>
3 ;;; Copyright © 2019 Arun Isaac <arunisaac@systemreboot.net>
4 ;;; Copyright © 2019 Tobias Geerinckx-Rice <me@tobias.gr>
5 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
6 ;;;
7 ;;; This file is part of GNU Guix.
8 ;;;
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
13 ;;;
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
18 ;;;
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21
22 (define-module (gnu packages uml)
23 #:use-module ((guix licenses) #:prefix license:)
24 #:use-module (guix packages)
25 #:use-module (guix download)
26 #:use-module (guix utils)
27 #:use-module (guix build-system ant)
28 #:use-module (gnu packages graphviz)
29 #:use-module (gnu packages java))
30
31 (define-public plantuml
32 (package
33 (name "plantuml")
34 (version "1.2020.15")
35 (source (origin
36 (method url-fetch)
37 (uri (string-append "mirror://sourceforge/plantuml/"
38 version "/plantuml-" version ".tar.gz"))
39 (sha256
40 (base32
41 "0n9zrdylc79kdzq7i42kd38bndrhgs7p24bmcm7l09nzv8w8j5r0"))))
42 (build-system ant-build-system)
43 (arguments
44 `(#:tests? #f ; no tests
45 #:build-target "dist"
46 #:phases
47 (modify-phases %standard-phases
48 (add-before 'build 'delete-extra-from-classpath
49 (lambda _
50 (substitute* "build.xml"
51 (("1.6") "1.7")
52 (("<attribute name=\"Class-Path\"") "<!--")
53 (("ditaa0_9.jar\" />") "-->"))
54 #t))
55 (add-after 'delete-extra-from-classpath 'patch-usr-bin-dot
56 (lambda* (#:key inputs #:allow-other-keys)
57 (let ((dot (string-append (assoc-ref inputs "graphviz")
58 "/bin/dot")))
59 (substitute*
60 "src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizLinux.java"
61 (("/usr/bin/dot") dot)))
62 #t))
63 (replace 'install
64 (lambda* (#:key outputs #:allow-other-keys)
65 (install-file "plantuml.jar" (string-append
66 (assoc-ref outputs "out")
67 "/share/java"))
68 #t))
69 (add-after 'install 'make-wrapper
70 (lambda* (#:key inputs outputs #:allow-other-keys)
71 (let* ((out (assoc-ref outputs "out"))
72 (wrapper (string-append out "/bin/plantuml")))
73 (mkdir-p (string-append out "/bin"))
74 (with-output-to-file wrapper
75 (lambda _
76 (display
77 (string-append
78 "#!/bin/sh\n\n"
79 (assoc-ref inputs "jre") "/bin/java -jar "
80 out "/share/java/plantuml.jar \"$@\"\n"))))
81 (chmod wrapper #o555))
82 #t)))))
83 (inputs
84 `(("graphviz" ,graphviz)
85 ("jre" ,icedtea)))
86 (home-page "https://plantuml.com/")
87 (synopsis "Draw UML diagrams from simple textual description")
88 (description
89 "Plantuml is a tool to generate sequence, usecase, class, activity,
90 component, state, deployment and object UML diagrams, using a simple and
91 human readable text description. Contains @code{salt}, a tool that can design
92 simple graphical interfaces.")
93 (license license:gpl3+)))