uml.scm 3.7 KB

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