fltk.scm 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2014 John Darrington <jmd@gnu.org>
  3. ;;; Copyright © 2015 Eric Bavier <bavier@member.fsf.org>
  4. ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
  5. ;;; Copyright © 2016 Kei Kebreau <kkebreau@posteo.net>
  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 fltk)
  22. #:use-module ((guix licenses) #:select (lgpl2.0 lgpl2.0+))
  23. #:use-module (gnu packages)
  24. #:use-module (gnu packages compression)
  25. #:use-module (gnu packages image)
  26. #:use-module (gnu packages xorg)
  27. #:use-module (gnu packages gl)
  28. #:use-module (gnu packages gtk) ;for "cairo"
  29. #:use-module (gnu packages pkg-config)
  30. #:use-module (gnu packages python)
  31. #:use-module (guix packages)
  32. #:use-module (guix download)
  33. #:use-module (guix git-download)
  34. #:use-module (guix build-system gnu)
  35. #:use-module (guix build-system waf))
  36. (define-public fltk
  37. (package
  38. (name "fltk")
  39. (version "1.3.3")
  40. (source
  41. (origin
  42. (method url-fetch)
  43. (uri (string-append "http://fltk.org/pub/fltk/" version
  44. "/fltk-" version "-source.tar.gz"))
  45. (sha256
  46. (base32
  47. "15qd7lkz5d5ynz70xhxhigpz3wns39v9xcf7ggkl0792syc8sfgq"))
  48. (patches (search-patches "fltk-shared-lib-defines.patch"
  49. "fltk-xfont-on-demand.patch"))))
  50. (build-system gnu-build-system)
  51. (inputs
  52. `(("libjpeg" ,libjpeg-8) ;jpeg_read_header argument error in libjpeg-9
  53. ("libpng" ,libpng)
  54. ("libx11" ,libx11)
  55. ("libxft" ,libxft)
  56. ("mesa" ,mesa)
  57. ("zlib" ,zlib)))
  58. (arguments
  59. `(#:tests? #f ;TODO: compile programs in "test" dir
  60. #:configure-flags
  61. (list "--enable-shared"
  62. (string-append "DSOFLAGS=-Wl,-rpath=" %output "/lib"))
  63. #:phases
  64. (alist-cons-before
  65. 'configure 'patch-makeinclude
  66. (lambda _
  67. (substitute* "makeinclude.in"
  68. (("/bin/sh") (which "sh"))))
  69. (alist-cons-after
  70. 'install 'patch-config
  71. ;; Provide -L flags for image libraries when querying fltk-config to
  72. ;; avoid propagating inputs.
  73. (lambda* (#:key inputs outputs #:allow-other-keys)
  74. (use-modules (srfi srfi-26))
  75. (let* ((conf (string-append (assoc-ref outputs "out")
  76. "/bin/fltk-config"))
  77. (jpeg (assoc-ref inputs "libjpeg"))
  78. (png (assoc-ref inputs "libpng"))
  79. (zlib (assoc-ref inputs "zlib")))
  80. (substitute* conf
  81. (("-ljpeg") (string-append "-L" jpeg "/lib -ljpeg"))
  82. (("-lpng") (string-append "-L" png "/lib -lpng"))
  83. (("-lz") (string-append "-L" zlib "/lib -lz")))))
  84. %standard-phases))))
  85. (home-page "http://www.fltk.org")
  86. (synopsis "3D C++ GUI library")
  87. (description "FLTK is a C++ GUI toolkit providing modern GUI functionality
  88. without the bloat. It supports 3D graphics via OpenGL and its built-in GLUT
  89. emulation. FLTK is designed to be small and modular enough to be statically
  90. linked, but works fine as a shared library. FLTK also includes an excellent
  91. UI builder called FLUID that can be used to create applications in minutes.")
  92. (license lgpl2.0))) ; plus certain additional permissions
  93. (define-public ntk
  94. (package
  95. (name "ntk")
  96. (version "1.3.0")
  97. (source (origin
  98. (method git-fetch)
  99. (uri (git-reference
  100. (url "git://git.tuxfamily.org/gitroot/non/fltk.git")
  101. (commit (string-append "v" version))))
  102. (sha256
  103. (base32
  104. "0ggrh6rihf676z1vfgpgcl6kpqwyh39ih0hskcgzklh7fphfik39"))
  105. (file-name (string-append name "-" version "-checkout"))))
  106. (build-system waf-build-system)
  107. (arguments
  108. `(#:tests? #f ;no "check" target
  109. #:python ,python-2
  110. #:configure-flags '("--enable-gl")
  111. #:phases
  112. (modify-phases %standard-phases
  113. (add-before
  114. 'configure 'set-ldflags
  115. (lambda* (#:key outputs #:allow-other-keys)
  116. (setenv "LDFLAGS"
  117. (string-append "-Wl,-rpath="
  118. (assoc-ref outputs "out") "/lib")))))))
  119. (inputs
  120. `(("libjpeg" ,libjpeg)
  121. ("glu" ,glu)))
  122. ;; ntk.pc lists "x11" and "xft" in Requires.private, and "cairo" in
  123. ;; Requires.
  124. (propagated-inputs
  125. `(("cairo" ,cairo)
  126. ("libxft" ,libxft)
  127. ("libx11" ,libx11)))
  128. (native-inputs
  129. `(("pkg-config" ,pkg-config)))
  130. (home-page "http://non.tuxfamily.org/ntk/")
  131. (synopsis "Fork of FLTK with graphics rendering via Cairo")
  132. (description "The Non Tool Kit (NTK) is a fork of the Fast Light ToolKit
  133. library, adding improved graphics rendering via Cairo, a streamlined and
  134. enhanced widget set, and other features designed to improve the appearance and
  135. performance of the Non applications.")
  136. (license lgpl2.0+))) ; plus certain additional permissions