gnu: Remove unneeded uses of 'libiconv'.
[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 ;;; Copyright © 2021 Tobias Geerinckx-Rice <me@tobias.gr>
9 ;;;
10 ;;; This file is part of GNU Guix.
11 ;;;
12 ;;; GNU Guix is free software; you can redistribute it and/or modify it
13 ;;; under the terms of the GNU General Public License as published by
14 ;;; the Free Software Foundation; either version 3 of the License, or (at
15 ;;; your option) any later version.
16 ;;;
17 ;;; GNU Guix is distributed in the hope that it will be useful, but
18 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;;; GNU General Public License for more details.
21 ;;;
22 ;;; You should have received a copy of the GNU General Public License
23 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24
25 (define-module (gnu packages fltk)
26 #:use-module ((guix licenses) #:select (lgpl2.0 lgpl2.0+))
27 #:use-module (gnu packages)
28 #:use-module (gnu packages compression)
29 #:use-module (gnu packages image)
30 #:use-module (gnu packages xorg)
31 #:use-module (gnu packages gl)
32 #:use-module (gnu packages gtk) ;for "cairo"
33 #:use-module (gnu packages pkg-config)
34 #:use-module (gnu packages python)
35 #:use-module (gnu packages python-xyz)
36 #:use-module (guix packages)
37 #:use-module (guix download)
38 #:use-module (guix git-download)
39 #:use-module (guix build-system gnu)
40 #:use-module (guix build-system waf)
41 #:use-module (srfi srfi-1))
42
43 (define-public fltk
44 (package
45 (name "fltk")
46 (version "1.3.6")
47 (source
48 (origin
49 (method url-fetch)
50 (uri (string-append "http://fltk.org/pub/fltk/"
51 (first (string-split version #\-))
52 "/fltk-" version "-source.tar.gz"))
53 (sha256
54 (base32 "1arp1niiz3qxm8iacpmilwpc5rinsm6hsk4a6fsxfywvkvppbb4s"))))
55 (build-system gnu-build-system)
56 (native-inputs
57 (list 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 (list cairo libxft libx11))
139 (native-inputs
140 (list pkg-config))
141 (home-page "http://non.tuxfamily.org/ntk/")
142 (synopsis "Fork of FLTK with graphics rendering via Cairo")
143 (description "The Non Tool Kit (NTK) is a fork of the Fast Light ToolKit
144 library, adding improved graphics rendering via Cairo, a streamlined and
145 enhanced widget set, and other features designed to improve the appearance and
146 performance of the Non applications.")
147 (license lgpl2.0+))) ; plus certain additional permissions