gnu: Replace uses of 'libjpeg' with 'libjpeg-turbo'.
[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>
e10a15fa 4;;; Copyright © 2015, 2018 Ricardo Wurmus <rekado@elephly.net>
3c8ba11a 5;;; Copyright © 2016 Kei Kebreau <kkebreau@posteo.net>
7c291296 6;;; Copyright © 2018 Mark H Weaver <mhw@netris.org>
0728f600 7;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il>
b6cbb314
JD
8;;;
9;;; This file is part of GNU Guix.
10;;;
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.
15;;;
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.
20;;;
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/>.
23
24(define-module (gnu packages fltk)
e727ed6a 25 #:use-module ((guix licenses) #:select (lgpl2.0 lgpl2.0+))
401f9a8b 26 #:use-module (gnu packages)
ef698bf9
EB
27 #:use-module (gnu packages compression)
28 #:use-module (gnu packages image)
b6cbb314
JD
29 #:use-module (gnu packages xorg)
30 #:use-module (gnu packages gl)
a9974701
RW
31 #:use-module (gnu packages gtk) ;for "cairo"
32 #:use-module (gnu packages pkg-config)
33 #:use-module (gnu packages python)
44d10b1f 34 #:use-module (gnu packages python-xyz)
b6cbb314
JD
35 #:use-module (guix packages)
36 #:use-module (guix download)
a9974701
RW
37 #:use-module (guix git-download)
38 #:use-module (guix build-system gnu)
0728f600
EF
39 #:use-module (guix build-system waf)
40 #:use-module (srfi srfi-1))
b6cbb314
JD
41
42(define-public fltk
43 (package
44 (name "fltk")
92e1e0ec 45 (version "1.3.5")
b6cbb314
JD
46 (source
47 (origin
48 (method url-fetch)
0728f600
EF
49 (uri (string-append "http://fltk.org/pub/fltk/"
50 (first (string-split version #\-))
35b9e423 51 "/fltk-" version "-source.tar.gz"))
b6cbb314
JD
52 (sha256
53 (base32
92e1e0ec 54 "00jp24z1818k9n6nn6lx7qflqf2k13g4kxr0p8v1d37kanhb4ac7"))))
b6cbb314 55 (build-system gnu-build-system)
7c291296
MW
56 (native-inputs
57 `(("pkg-config" ,pkg-config)))
ef698bf9 58 (inputs
4bd428a7 59 `(("libjpeg" ,libjpeg-turbo)
ef698bf9
EB
60 ("libpng" ,libpng)
61 ("libx11" ,libx11)
cf1b55bd 62 ("libxft" ,libxft)
ef698bf9
EB
63 ("mesa" ,mesa)
64 ("zlib" ,zlib)))
b6cbb314 65 (arguments
d4bf49b1 66 `(#:tests? #f ;TODO: compile programs in "test" dir
691cb22b
SB
67 #:configure-flags
68 (list "--enable-shared"
69 (string-append "DSOFLAGS=-Wl,-rpath=" %output "/lib"))
d4bf49b1 70 #:phases
dc1d3cde
KK
71 (modify-phases %standard-phases
72 (add-before 'configure 'patch-makeinclude
73 (lambda _
74 (substitute* "makeinclude.in"
75 (("/bin/sh") (which "sh")))
76 #t))
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)
0728f600
EF
81 (let ((conf (string-append (assoc-ref outputs "out")
82 "/bin/fltk-config"))
83 (jpeg (assoc-ref inputs "libjpeg"))
84 (png (assoc-ref inputs "libpng"))
85 (zlib (assoc-ref inputs "zlib")))
dc1d3cde
KK
86 (substitute* conf
87 (("-ljpeg") (string-append "-L" jpeg "/lib -ljpeg"))
88 (("-lpng") (string-append "-L" png "/lib -lpng"))
89 (("-lz") (string-append "-L" zlib "/lib -lz"))))
90 #t)))))
07af3e5e 91 (home-page "http://www.fltk.org")
b6cbb314 92 (synopsis "3D C++ GUI library")
35b9e423
EB
93 (description "FLTK is a C++ GUI toolkit providing modern GUI functionality
94without the bloat. It supports 3D graphics via OpenGL and its built-in GLUT
95emulation. FLTK is designed to be small and modular enough to be statically
96linked, but works fine as a shared library. FLTK also includes an excellent
97UI builder called FLUID that can be used to create applications in minutes.")
b6cbb314 98 (license lgpl2.0))) ; plus certain additional permissions
a9974701
RW
99
100(define-public ntk
101 (package
102 (name "ntk")
e10a15fa 103 (version "1.3.1000")
a9974701
RW
104 (source (origin
105 (method git-fetch)
106 (uri (git-reference
107 (url "git://git.tuxfamily.org/gitroot/non/fltk.git")
108 (commit (string-append "v" version))))
109 (sha256
110 (base32
e10a15fa 111 "0j38mhnfqy6swcrnc5zxcwlqi8b1pgklyghxk6qs1lf4japv2zc0"))
a9974701
RW
112 (file-name (string-append name "-" version "-checkout"))))
113 (build-system waf-build-system)
114 (arguments
115 `(#:tests? #f ;no "check" target
a9974701
RW
116 #:configure-flags '("--enable-gl")
117 #:phases
118 (modify-phases %standard-phases
4cf879fe
EF
119 (add-before 'configure 'setup-waf
120 (lambda* (#:key inputs #:allow-other-keys)
121 (let ((waf (assoc-ref inputs "waf")))
122 (delete-file "waf")
123 (copy-file (string-append waf "/bin/waf") "waf"))
124 #t))
e10a15fa
RW
125 (add-before 'configure 'set-ldflags
126 (lambda* (#:key outputs #:allow-other-keys)
127 (setenv "LDFLAGS"
128 (string-append "-Wl,-rpath="
129 (assoc-ref outputs "out") "/lib"))
130 #t)))))
a9974701 131 (inputs
4bd428a7 132 `(("libjpeg" ,libjpeg-turbo)
4cf879fe
EF
133 ("glu" ,glu)
134 ("waf" ,python-waf)))
a9974701
RW
135 ;; ntk.pc lists "x11" and "xft" in Requires.private, and "cairo" in
136 ;; Requires.
137 (propagated-inputs
138 `(("cairo" ,cairo)
139 ("libxft" ,libxft)
140 ("libx11" ,libx11)))
141 (native-inputs
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
146library, adding improved graphics rendering via Cairo, a streamlined and
147enhanced widget set, and other features designed to improve the appearance and
148performance of the Non applications.")
149 (license lgpl2.0+))) ; plus certain additional permissions