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