projects/guix·blob javascript-team · refs

96 lines · 3.9 KiB

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