java-graphics.scm 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net>
  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. (define-module (gnu packages java-graphics)
  19. #:use-module ((guix licenses) #:prefix license:)
  20. #:use-module (guix packages)
  21. #:use-module (guix git-download)
  22. #:use-module (guix utils)
  23. #:use-module (guix build-system ant)
  24. #:use-module (gnu packages)
  25. #:use-module (gnu packages java)
  26. #:use-module (gnu packages xorg)
  27. #:use-module (ice-9 match))
  28. (define-public java-piccolo2d-core
  29. (package
  30. (name "java-piccolo2d-core")
  31. (version "3.0.1")
  32. (source (origin
  33. (method git-fetch)
  34. (uri (git-reference
  35. (url "https://github.com/piccolo2d/piccolo2d.java")
  36. (commit (string-append "piccolo2d-complete-" version))))
  37. (file-name (git-file-name name version))
  38. (sha256
  39. (base32
  40. "1k6gw643k83516lcw04mgac2yi75phdrng44pz9xk6hz066ip21s"))))
  41. (build-system ant-build-system)
  42. (arguments
  43. `(#:jar-name "piccolo2d-core.jar"
  44. #:phases
  45. (modify-phases %standard-phases
  46. (add-after 'unpack 'chdir
  47. (lambda _ (chdir "core") #t)))))
  48. (inputs
  49. `(("java-junit" ,java-junit)))
  50. (home-page "http://piccolo2d.org")
  51. (synopsis "Structured 2D graphics framework")
  52. (description "Piccolo2D is a framework (in the Jazz ZUI tradition) to
  53. create robust, full-featured graphical applications in Java, with features
  54. such as zooming and multiple representation. This package provides the core
  55. libraries.")
  56. (license license:bsd-3)))
  57. (define-public java-piccolo2d-extras
  58. (package (inherit java-piccolo2d-core)
  59. (name "java-piccolo2d-extras")
  60. (arguments
  61. `(#:jar-name "piccolo2d-extras.jar"
  62. #:phases
  63. (modify-phases %standard-phases
  64. (add-after 'unpack 'chdir
  65. (lambda _ (chdir "extras") #t))
  66. (add-after 'chdir 'remove-failing-test
  67. (lambda _
  68. ;; TODO: These both fail with "Unable to convolve src image"
  69. (delete-file "src/test/java/org/piccolo2d/extras/nodes/PShadowTest.java")
  70. (delete-file "src/test/java/org/piccolo2d/extras/util/ShadowUtilsTest.java")
  71. #t))
  72. (add-before 'check 'start-xorg-server
  73. (lambda* (#:key inputs #:allow-other-keys)
  74. ;; The test suite requires a running X server.
  75. (system "Xvfb :1 -screen 0 640x480x24 &")
  76. (setenv "DISPLAY" ":1")
  77. #t)))))
  78. (inputs
  79. `(("java-piccolo2d-core" ,java-piccolo2d-core)
  80. ("java-junit" ,java-junit)))
  81. (native-inputs
  82. `(("xorg-server" ,xorg-server))) ; for tests
  83. (description "Piccolo2D is a framework (in the Jazz ZUI tradition) to
  84. create robust, full-featured graphical applications in Java, with features
  85. such as zooming and multiple representation. This package provides additional
  86. features not found in the core libraries.")))
  87. (define-public java-marlin-renderer
  88. (package
  89. (name "java-marlin-renderer")
  90. (version "0.9.4.2")
  91. (source (origin
  92. (method git-fetch)
  93. (uri (git-reference
  94. (url "https://github.com/bourgesl/marlin-renderer")
  95. (commit (string-append "v" (string-map (match-lambda
  96. (#\. #\_)
  97. (c c))
  98. version)))))
  99. (file-name (git-file-name name version))
  100. (sha256
  101. (base32
  102. "12vb8fmxf1smnyv6w8i1khahy76v6r29j1qwabbykxff8i9ndxqv"))))
  103. (build-system ant-build-system)
  104. (arguments
  105. `(#:jar-name "marlin.jar"
  106. #:test-include (list "src/test/java/RunJUnitTest.java")))
  107. (inputs
  108. `(("java-hamcrest-core" ,java-hamcrest-core)
  109. ("java-junit" ,java-junit)))
  110. (home-page "https://github.com/bourgesl/marlin-renderer/")
  111. (synopsis "Rendering engine")
  112. (description "Marlin is a Java2D @code{RenderingEngine} optimized for
  113. performance (improved memory usage and footprint, better multi-threading) and
  114. better visual quality based on OpenJDK's @code{pisces} implementation. It
  115. handles shape rendering (@code{Graphics2D} @code{draw(Shape)} /
  116. @code{fill(Shape)} with stroke and dash attributes.")
  117. ;; With Classpath Exception
  118. (license license:gpl2)))