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>
9 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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))
49 (uri (string-append "http://fltk.org/pub/fltk/"
50 (first (string-split version #\-))
51 "/fltk-" version "-source.tar.gz"))
54 "00jp24z1818k9n6nn6lx7qflqf2k13g4kxr0p8v1d37kanhb4ac7"))))
55 (build-system gnu-build-system)
57 `(("pkg-config" ,pkg-config)))
59 `(("libjpeg" ,libjpeg)
66 `(#:tests? #f ;TODO: compile programs in "test" dir
68 (list "--enable-shared"
69 (string-append "DSOFLAGS=-Wl,-rpath=" %output "/lib"))
71 (modify-phases %standard-phases
72 (add-before 'configure 'patch-makeinclude
74 (substitute* "makeinclude.in"
75 (("/bin/sh") (which "sh")))
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")
83 (jpeg (assoc-ref inputs "libjpeg"))
84 (png (assoc-ref inputs "libpng"))
85 (zlib (assoc-ref inputs "zlib")))
87 (("-ljpeg") (string-append "-L" jpeg "/lib -ljpeg"))
88 (("-lpng") (string-append "-L" png "/lib -lpng"))
89 (("-lz") (string-append "-L" zlib "/lib -lz"))))
91 (home-page "http://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
107 (url "git://git.tuxfamily.org/gitroot/non/fltk.git")
108 (commit (string-append "v" version))))
111 "0j38mhnfqy6swcrnc5zxcwlqi8b1pgklyghxk6qs1lf4japv2zc0"))
112 (file-name (string-append name "-" version "-checkout"))))
113 (build-system waf-build-system)
115 `(#:tests? #f ;no "check" target
116 #:configure-flags '("--enable-gl")
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")))
123 (copy-file (string-append waf "/bin/waf") "waf"))
125 (add-before 'configure 'set-ldflags
126 (lambda* (#:key outputs #:allow-other-keys)
128 (string-append "-Wl,-rpath="
129 (assoc-ref outputs "out") "/lib"))
132 `(("libjpeg" ,libjpeg)
134 ("waf" ,python-waf)))
135 ;; ntk.pc lists "x11" and "xft" in Requires.private, and "cairo" in
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