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>
8 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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))
46 (uri (string-append "http://fltk.org/pub/fltk/" version
47 "/fltk-" version "-source.tar.gz"))
50 "15qd7lkz5d5ynz70xhxhigpz3wns39v9xcf7ggkl0792syc8sfgq"))
51 (patches (search-patches "fltk-shared-lib-defines.patch"
52 "fltk-xfont-on-demand.patch"))))
53 (build-system gnu-build-system)
55 `(("pkg-config" ,pkg-config)))
57 `(("libjpeg" ,libjpeg-8) ;jpeg_read_header argument error in libjpeg-9
64 `(#:tests? #f ;TODO: compile programs in "test" dir
66 (list "--enable-shared"
67 (string-append "DSOFLAGS=-Wl,-rpath=" %output "/lib"))
69 (modify-phases %standard-phases
70 (add-before 'configure 'patch-makeinclude
72 (substitute* "makeinclude.in"
73 (("/bin/sh") (which "sh")))
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")
82 (jpeg (assoc-ref inputs "libjpeg"))
83 (png (assoc-ref inputs "libpng"))
84 (zlib (assoc-ref inputs "zlib")))
86 (("-ljpeg") (string-append "-L" jpeg "/lib -ljpeg"))
87 (("-lpng") (string-append "-L" png "/lib -lpng"))
88 (("-lz") (string-append "-L" zlib "/lib -lz"))))
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
106 (url "git://git.tuxfamily.org/gitroot/non/fltk.git")
107 (commit (string-append "v" version))))
110 "0ggrh6rihf676z1vfgpgcl6kpqwyh39ih0hskcgzklh7fphfik39"))
111 (file-name (string-append name "-" version "-checkout"))))
112 (build-system waf-build-system)
114 `(#:tests? #f ;no "check" target
116 #:configure-flags '("--enable-gl")
118 (modify-phases %standard-phases
120 'configure 'set-ldflags
121 (lambda* (#:key outputs #:allow-other-keys)
123 (string-append "-Wl,-rpath="
124 (assoc-ref outputs "out") "/lib")))))))
126 `(("libjpeg" ,libjpeg)
128 ;; ntk.pc lists "x11" and "xft" in Requires.private, and "cairo" in
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