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>
7 ;;; This file is part of GNU Guix.
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.
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.
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/>.
22 (define-module (gnu packages fltk)
23 #:use-module ((guix licenses) #:select (lgpl2.0 lgpl2.0+))
24 #:use-module (gnu packages)
25 #:use-module (gnu packages compression)
26 #:use-module (gnu packages image)
27 #:use-module (gnu packages xorg)
28 #:use-module (gnu packages gl)
29 #:use-module (gnu packages gtk) ;for "cairo"
30 #:use-module (gnu packages pkg-config)
31 #:use-module (gnu packages python)
32 #:use-module (guix packages)
33 #:use-module (guix download)
34 #:use-module (guix git-download)
35 #:use-module (guix build-system gnu)
36 #:use-module (guix build-system waf))
45 (uri (string-append "http://fltk.org/pub/fltk/" version
46 "/fltk-" version "-source.tar.gz"))
49 "15qd7lkz5d5ynz70xhxhigpz3wns39v9xcf7ggkl0792syc8sfgq"))
50 (patches (search-patches "fltk-shared-lib-defines.patch"
51 "fltk-xfont-on-demand.patch"))))
52 (build-system gnu-build-system)
54 `(("libjpeg" ,libjpeg-8) ;jpeg_read_header argument error in libjpeg-9
61 `(#:tests? #f ;TODO: compile programs in "test" dir
63 (list "--enable-shared"
64 (string-append "DSOFLAGS=-Wl,-rpath=" %output "/lib"))
66 (modify-phases %standard-phases
67 (add-before 'configure 'patch-makeinclude
69 (substitute* "makeinclude.in"
70 (("/bin/sh") (which "sh")))
72 (add-after 'install 'patch-config
73 ;; Provide -L flags for image libraries when querying fltk-config to
74 ;; avoid propagating inputs.
75 (lambda* (#:key inputs outputs #:allow-other-keys)
76 (use-modules (srfi srfi-26))
77 (let* ((conf (string-append (assoc-ref outputs "out")
79 (jpeg (assoc-ref inputs "libjpeg"))
80 (png (assoc-ref inputs "libpng"))
81 (zlib (assoc-ref inputs "zlib")))
83 (("-ljpeg") (string-append "-L" jpeg "/lib -ljpeg"))
84 (("-lpng") (string-append "-L" png "/lib -lpng"))
85 (("-lz") (string-append "-L" zlib "/lib -lz"))))
87 (home-page "http://www.fltk.org")
88 (synopsis "3D C++ GUI library")
89 (description "FLTK is a C++ GUI toolkit providing modern GUI functionality
90 without the bloat. It supports 3D graphics via OpenGL and its built-in GLUT
91 emulation. FLTK is designed to be small and modular enough to be statically
92 linked, but works fine as a shared library. FLTK also includes an excellent
93 UI builder called FLUID that can be used to create applications in minutes.")
94 (license lgpl2.0))) ; plus certain additional permissions
103 (url "git://git.tuxfamily.org/gitroot/non/fltk.git")
104 (commit (string-append "v" version))))
107 "0ggrh6rihf676z1vfgpgcl6kpqwyh39ih0hskcgzklh7fphfik39"))
108 (file-name (string-append name "-" version "-checkout"))))
109 (build-system waf-build-system)
111 `(#:tests? #f ;no "check" target
113 #:configure-flags '("--enable-gl")
115 (modify-phases %standard-phases
117 'configure 'set-ldflags
118 (lambda* (#:key outputs #:allow-other-keys)
120 (string-append "-Wl,-rpath="
121 (assoc-ref outputs "out") "/lib")))))))
123 `(("libjpeg" ,libjpeg)
125 ;; ntk.pc lists "x11" and "xft" in Requires.private, and "cairo" in
132 `(("pkg-config" ,pkg-config)))
133 (home-page "http://non.tuxfamily.org/ntk/")
134 (synopsis "Fork of FLTK with graphics rendering via Cairo")
135 (description "The Non Tool Kit (NTK) is a fork of the Fast Light ToolKit
136 library, adding improved graphics rendering via Cairo, a streamlined and
137 enhanced widget set, and other features designed to improve the appearance and
138 performance of the Non applications.")
139 (license lgpl2.0+))) ; plus certain additional permissions