uml.scm 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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, 2020 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. (define-module (gnu packages uml)
  22. #:use-module ((guix licenses) #:prefix license:)
  23. #:use-module (guix packages)
  24. #:use-module (guix download)
  25. #:use-module (guix utils)
  26. #:use-module (guix build-system ant)
  27. #:use-module (gnu packages graphviz)
  28. #:use-module (gnu packages java))
  29. (define-public plantuml
  30. (package
  31. (name "plantuml")
  32. (version "1.2020.24")
  33. (source (origin
  34. (method url-fetch)
  35. (uri (string-append "mirror://sourceforge/plantuml/"
  36. version "/plantuml-" version ".tar.gz"))
  37. (sha256
  38. (base32
  39. "1czjrsngy0j0lgbmvfzg1ax13vzba2c6ybmfbzqyvnasx4rfrsf8"))))
  40. (build-system ant-build-system)
  41. (arguments
  42. `(#:tests? #f ; no tests
  43. #:build-target "dist"
  44. #:phases
  45. (modify-phases %standard-phases
  46. (add-before 'build 'delete-extra-from-classpath
  47. (lambda _
  48. (substitute* "build.xml"
  49. (("1.6") "1.7")
  50. (("<attribute name=\"Class-Path\"") "<!--")
  51. (("ditaa0_9.jar\" />") "-->"))
  52. #t))
  53. (add-after 'delete-extra-from-classpath 'patch-usr-bin-dot
  54. (lambda* (#:key inputs #:allow-other-keys)
  55. (let ((dot (search-input-file inputs "/bin/dot")))
  56. (substitute*
  57. "src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizLinux.java"
  58. (("/usr/bin/dot") dot)))
  59. #t))
  60. (replace 'install
  61. (lambda* (#:key outputs #:allow-other-keys)
  62. (install-file "plantuml.jar" (string-append
  63. (assoc-ref outputs "out")
  64. "/share/java"))
  65. #t))
  66. (add-after 'install 'make-wrapper
  67. (lambda* (#:key inputs outputs #:allow-other-keys)
  68. (let* ((out (assoc-ref outputs "out"))
  69. (wrapper (string-append out "/bin/plantuml")))
  70. (mkdir-p (string-append out "/bin"))
  71. (with-output-to-file wrapper
  72. (lambda _
  73. (display
  74. (string-append
  75. "#!/bin/sh\n\n"
  76. (assoc-ref inputs "jre") "/bin/java -jar "
  77. out "/share/java/plantuml.jar \"$@\"\n"))))
  78. (chmod wrapper #o555))
  79. #t)))))
  80. (inputs
  81. `(("graphviz" ,graphviz)
  82. ("jre" ,icedtea)))
  83. (home-page "https://plantuml.com/")
  84. (synopsis "Draw UML diagrams from simple textual description")
  85. (description
  86. "Plantuml is a tool to generate sequence, usecase, class, activity,
  87. component, state, deployment and object UML diagrams, using a simple and
  88. human readable text description. Contains @code{salt}, a tool that can design
  89. simple graphical interfaces.")
  90. (license license:gpl3+)))