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