gnu: pigx-chipseq: Update to 0.0.17.
[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>
3c8ba11a 5;;; Copyright © 2016 Kei Kebreau <kkebreau@posteo.net>
7c291296 6;;; Copyright © 2018 Mark H Weaver <mhw@netris.org>
b6cbb314
JD
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)
e727ed6a 24 #:use-module ((guix licenses) #:select (lgpl2.0 lgpl2.0+))
401f9a8b 25 #:use-module (gnu packages)
ef698bf9
EB
26 #:use-module (gnu packages compression)
27 #:use-module (gnu packages image)
b6cbb314
JD
28 #:use-module (gnu packages xorg)
29 #:use-module (gnu packages gl)
a9974701
RW
30 #:use-module (gnu packages gtk) ;for "cairo"
31 #:use-module (gnu packages pkg-config)
32 #:use-module (gnu packages python)
b6cbb314
JD
33 #:use-module (guix packages)
34 #:use-module (guix download)
a9974701
RW
35 #:use-module (guix git-download)
36 #:use-module (guix build-system gnu)
37 #:use-module (guix build-system waf))
b6cbb314
JD
38
39(define-public fltk
40 (package
41 (name "fltk")
bda4ca76 42 (version "1.3.3")
b6cbb314
JD
43 (source
44 (origin
45 (method url-fetch)
35b9e423
EB
46 (uri (string-append "http://fltk.org/pub/fltk/" version
47 "/fltk-" version "-source.tar.gz"))
b6cbb314
JD
48 (sha256
49 (base32
401f9a8b 50 "15qd7lkz5d5ynz70xhxhigpz3wns39v9xcf7ggkl0792syc8sfgq"))
6fdc73e0
SB
51 (patches (search-patches "fltk-shared-lib-defines.patch"
52 "fltk-xfont-on-demand.patch"))))
b6cbb314 53 (build-system gnu-build-system)
7c291296
MW
54 (native-inputs
55 `(("pkg-config" ,pkg-config)))
ef698bf9
EB
56 (inputs
57 `(("libjpeg" ,libjpeg-8) ;jpeg_read_header argument error in libjpeg-9
58 ("libpng" ,libpng)
59 ("libx11" ,libx11)
cf1b55bd 60 ("libxft" ,libxft)
ef698bf9
EB
61 ("mesa" ,mesa)
62 ("zlib" ,zlib)))
b6cbb314 63 (arguments
d4bf49b1 64 `(#:tests? #f ;TODO: compile programs in "test" dir
691cb22b
SB
65 #:configure-flags
66 (list "--enable-shared"
67 (string-append "DSOFLAGS=-Wl,-rpath=" %output "/lib"))
d4bf49b1 68 #:phases
dc1d3cde
KK
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)))))
07af3e5e 90 (home-page "http://www.fltk.org")
b6cbb314 91 (synopsis "3D C++ GUI library")
35b9e423
EB
92 (description "FLTK is a C++ GUI toolkit providing modern GUI functionality
93without the bloat. It supports 3D graphics via OpenGL and its built-in GLUT
94emulation. FLTK is designed to be small and modular enough to be statically
95linked, but works fine as a shared library. FLTK also includes an excellent
96UI builder called FLUID that can be used to create applications in minutes.")
b6cbb314 97 (license lgpl2.0))) ; plus certain additional permissions
a9974701
RW
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
139library, adding improved graphics rendering via Cairo, a streamlined and
140enhanced widget set, and other features designed to improve the appearance and
141performance of the Non applications.")
142 (license lgpl2.0+))) ; plus certain additional permissions