gnu: Add wl-clipboard.
[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)
b6cbb314
JD
34 #:use-module (guix packages)
35 #:use-module (guix download)
a9974701
RW
36 #:use-module (guix git-download)
37 #:use-module (guix build-system gnu)
0728f600
EF
38 #:use-module (guix build-system waf)
39 #:use-module (srfi srfi-1))
b6cbb314
JD
40
41(define-public fltk
42 (package
43 (name "fltk")
0728f600 44 (version "1.3.4-2")
b6cbb314
JD
45 (source
46 (origin
47 (method url-fetch)
0728f600
EF
48 (uri (string-append "http://fltk.org/pub/fltk/"
49 (first (string-split version #\-))
35b9e423 50 "/fltk-" version "-source.tar.gz"))
b6cbb314
JD
51 (sha256
52 (base32
0728f600 53 "0459rm1gl5x3famiqma7ja7k6hvan8p5l8lgshvqfl4rik0lklr5"))))
b6cbb314 54 (build-system gnu-build-system)
7c291296
MW
55 (native-inputs
56 `(("pkg-config" ,pkg-config)))
ef698bf9 57 (inputs
0728f600 58 `(("libjpeg" ,libjpeg)
ef698bf9
EB
59 ("libpng" ,libpng)
60 ("libx11" ,libx11)
cf1b55bd 61 ("libxft" ,libxft)
ef698bf9
EB
62 ("mesa" ,mesa)
63 ("zlib" ,zlib)))
b6cbb314 64 (arguments
d4bf49b1 65 `(#:tests? #f ;TODO: compile programs in "test" dir
691cb22b
SB
66 #:configure-flags
67 (list "--enable-shared"
68 (string-append "DSOFLAGS=-Wl,-rpath=" %output "/lib"))
d4bf49b1 69 #:phases
dc1d3cde
KK
70 (modify-phases %standard-phases
71 (add-before 'configure 'patch-makeinclude
72 (lambda _
73 (substitute* "makeinclude.in"
74 (("/bin/sh") (which "sh")))
75 #t))
76 (add-after 'install 'patch-config
77 ;; Provide -L flags for image libraries when querying fltk-config to
78 ;; avoid propagating inputs.
79 (lambda* (#:key inputs outputs #:allow-other-keys)
0728f600
EF
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")))
dc1d3cde
KK
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")
e10a15fa 102 (version "1.3.1000")
a9974701
RW
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
e10a15fa 110 "0j38mhnfqy6swcrnc5zxcwlqi8b1pgklyghxk6qs1lf4japv2zc0"))
a9974701
RW
111 (file-name (string-append name "-" version "-checkout"))))
112 (build-system waf-build-system)
113 (arguments
114 `(#:tests? #f ;no "check" target
a9974701
RW
115 #:configure-flags '("--enable-gl")
116 #:phases
117 (modify-phases %standard-phases
4cf879fe
EF
118 (add-before 'configure 'setup-waf
119 (lambda* (#:key inputs #:allow-other-keys)
120 (let ((waf (assoc-ref inputs "waf")))
121 (delete-file "waf")
122 (copy-file (string-append waf "/bin/waf") "waf"))
123 #t))
e10a15fa
RW
124 (add-before 'configure 'set-ldflags
125 (lambda* (#:key outputs #:allow-other-keys)
126 (setenv "LDFLAGS"
127 (string-append "-Wl,-rpath="
128 (assoc-ref outputs "out") "/lib"))
129 #t)))))
a9974701
RW
130 (inputs
131 `(("libjpeg" ,libjpeg)
4cf879fe
EF
132 ("glu" ,glu)
133 ("waf" ,python-waf)))
a9974701
RW
134 ;; ntk.pc lists "x11" and "xft" in Requires.private, and "cairo" in
135 ;; Requires.
136 (propagated-inputs
137 `(("cairo" ,cairo)
138 ("libxft" ,libxft)
139 ("libx11" ,libx11)))
140 (native-inputs
141 `(("pkg-config" ,pkg-config)))
142 (home-page "http://non.tuxfamily.org/ntk/")
143 (synopsis "Fork of FLTK with graphics rendering via Cairo")
144 (description "The Non Tool Kit (NTK) is a fork of the Fast Light ToolKit
145library, adding improved graphics rendering via Cairo, a streamlined and
146enhanced widget set, and other features designed to improve the appearance and
147performance of the Non applications.")
148 (license lgpl2.0+))) ; plus certain additional permissions