gnu: emacs-svg-icon: Fix grammar.
[jackhill/guix/guix.git] / gnu / packages / fltk.scm
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, 2018 Ricardo Wurmus <rekado@elephly.net>
5 ;;; Copyright © 2016 Kei Kebreau <kkebreau@posteo.net>
6 ;;; Copyright © 2018 Mark H Weaver <mhw@netris.org>
7 ;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il>
8 ;;;
9 ;;; This file is part of GNU Guix.
10 ;;;
11 ;;; GNU Guix is free software; you can redistribute it and/or modify it
12 ;;; under the terms of the GNU General Public License as published by
13 ;;; the Free Software Foundation; either version 3 of the License, or (at
14 ;;; your option) any later version.
15 ;;;
16 ;;; GNU Guix is distributed in the hope that it will be useful, but
17 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;;; GNU General Public License for more details.
20 ;;;
21 ;;; You should have received a copy of the GNU General Public License
22 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23
24 (define-module (gnu packages fltk)
25 #:use-module ((guix licenses) #:select (lgpl2.0 lgpl2.0+))
26 #:use-module (gnu packages)
27 #:use-module (gnu packages compression)
28 #:use-module (gnu packages image)
29 #:use-module (gnu packages xorg)
30 #:use-module (gnu packages gl)
31 #:use-module (gnu packages gtk) ;for "cairo"
32 #:use-module (gnu packages pkg-config)
33 #:use-module (gnu packages python)
34 #:use-module (gnu packages python-xyz)
35 #:use-module (guix packages)
36 #:use-module (guix download)
37 #:use-module (guix git-download)
38 #:use-module (guix build-system gnu)
39 #:use-module (guix build-system waf)
40 #:use-module (srfi srfi-1))
41
42 (define-public fltk
43 (package
44 (name "fltk")
45 (version "1.3.5")
46 (source
47 (origin
48 (method url-fetch)
49 (uri (string-append "http://fltk.org/pub/fltk/"
50 (first (string-split version #\-))
51 "/fltk-" version "-source.tar.gz"))
52 (sha256
53 (base32
54 "00jp24z1818k9n6nn6lx7qflqf2k13g4kxr0p8v1d37kanhb4ac7"))))
55 (build-system gnu-build-system)
56 (native-inputs
57 `(("pkg-config" ,pkg-config)))
58 (inputs
59 `(("libjpeg" ,libjpeg-turbo)
60 ("libpng" ,libpng)
61 ("libx11" ,libx11)
62 ("libxft" ,libxft)
63 ("mesa" ,mesa)
64 ("zlib" ,zlib)))
65 (arguments
66 `(#:tests? #f ;TODO: compile programs in "test" dir
67 #:configure-flags
68 (list "--enable-shared"
69 (string-append "DSOFLAGS=-Wl,-rpath=" %output "/lib"))
70 #:phases
71 (modify-phases %standard-phases
72 (add-before 'configure 'patch-makeinclude
73 (lambda _
74 (substitute* "makeinclude.in"
75 (("/bin/sh") (which "sh")))
76 #t))
77 (add-after 'install 'patch-config
78 ;; Provide -L flags for image libraries when querying fltk-config to
79 ;; avoid propagating inputs.
80 (lambda* (#:key inputs outputs #:allow-other-keys)
81 (let ((conf (string-append (assoc-ref outputs "out")
82 "/bin/fltk-config"))
83 (jpeg (assoc-ref inputs "libjpeg"))
84 (png (assoc-ref inputs "libpng"))
85 (zlib (assoc-ref inputs "zlib")))
86 (substitute* conf
87 (("-ljpeg") (string-append "-L" jpeg "/lib -ljpeg"))
88 (("-lpng") (string-append "-L" png "/lib -lpng"))
89 (("-lz") (string-append "-L" zlib "/lib -lz"))))
90 #t)))))
91 (home-page "https://www.fltk.org")
92 (synopsis "3D C++ GUI library")
93 (description "FLTK is a C++ GUI toolkit providing modern GUI functionality
94 without the bloat. It supports 3D graphics via OpenGL and its built-in GLUT
95 emulation. FLTK is designed to be small and modular enough to be statically
96 linked, but works fine as a shared library. FLTK also includes an excellent
97 UI builder called FLUID that can be used to create applications in minutes.")
98 (license lgpl2.0))) ; plus certain additional permissions
99
100 (define-public ntk
101 (package
102 (name "ntk")
103 (version "1.3.1000")
104 (source (origin
105 (method git-fetch)
106 (uri (git-reference
107 (url "git://git.tuxfamily.org/gitroot/non/fltk.git")
108 (commit (string-append "v" version))))
109 (sha256
110 (base32
111 "0j38mhnfqy6swcrnc5zxcwlqi8b1pgklyghxk6qs1lf4japv2zc0"))
112 (file-name (git-file-name name version))))
113 (build-system waf-build-system)
114 (arguments
115 `(#:tests? #f ;no "check" target
116 #:configure-flags '("--enable-gl")
117 #:phases
118 (modify-phases %standard-phases
119 (add-before 'configure 'setup-waf
120 (lambda* (#:key inputs #:allow-other-keys)
121 (let ((waf (assoc-ref inputs "waf")))
122 (delete-file "waf")
123 (copy-file (string-append waf "/bin/waf") "waf"))
124 #t))
125 (add-before 'configure 'set-ldflags
126 (lambda* (#:key outputs #:allow-other-keys)
127 (setenv "LDFLAGS"
128 (string-append "-Wl,-rpath="
129 (assoc-ref outputs "out") "/lib"))
130 #t)))))
131 (inputs
132 `(("libjpeg" ,libjpeg-turbo)
133 ("glu" ,glu)
134 ("waf" ,python-waf)))
135 ;; ntk.pc lists "x11" and "xft" in Requires.private, and "cairo" in
136 ;; Requires.
137 (propagated-inputs
138 `(("cairo" ,cairo)
139 ("libxft" ,libxft)
140 ("libx11" ,libx11)))
141 (native-inputs
142 `(("pkg-config" ,pkg-config)))
143 (home-page "http://non.tuxfamily.org/ntk/")
144 (synopsis "Fork of FLTK with graphics rendering via Cairo")
145 (description "The Non Tool Kit (NTK) is a fork of the Fast Light ToolKit
146 library, adding improved graphics rendering via Cairo, a streamlined and
147 enhanced widget set, and other features designed to improve the appearance and
148 performance of the Non applications.")
149 (license lgpl2.0+))) ; plus certain additional permissions